Browse Source

Delete unused files and clean up cookie cutter files

These files were auto-generated from the cookiecutter commit
and aren't needed. Some should be renamed.

Change-Id: I2d6f7af84f9c8580b1a753f03b7170fd90e05314
tags/0.1.0
Kaitlin Farr 1 year ago
parent
commit
2a90199ded
35 changed files with 33 additions and 1675 deletions
  1. 22
    0
      .gitignore
  2. 4
    4
      README.rst
  3. 0
    131
      castellan_ui/api/client.py
  4. 0
    86
      castellan_ui/api/rest_api.py
  5. 0
    0
      castellan_ui/content/manages/__init__.py
  6. 0
    23
      castellan_ui/content/manages/panel.py
  7. 0
    19
      castellan_ui/content/manages/tests.py
  8. 0
    20
      castellan_ui/content/manages/urls.py
  9. 0
    36
      castellan_ui/enabled/_90_project_castellan_panelgroup.py
  10. 0
    21
      castellan_ui/enabled/_91_project_castellan_manages_panel.py
  11. 0
    37
      castellan_ui/static/dashboard/castellan/castellan.module.js
  12. 0
    23
      castellan_ui/static/dashboard/castellan/castellan.module.spec.js
  13. 0
    8
      castellan_ui/static/dashboard/castellan/castellan.scss
  14. 0
    81
      castellan_ui/static/dashboard/castellan/castellan.service.js
  15. 0
    87
      castellan_ui/static/dashboard/castellan/manages/actions/actions.module.js
  16. 0
    103
      castellan_ui/static/dashboard/castellan/manages/actions/create.service.js
  17. 0
    156
      castellan_ui/static/dashboard/castellan/manages/actions/delete.service.js
  18. 0
    122
      castellan_ui/static/dashboard/castellan/manages/actions/update.service.js
  19. 0
    57
      castellan_ui/static/dashboard/castellan/manages/details/details.module.js
  20. 0
    6
      castellan_ui/static/dashboard/castellan/manages/details/drawer.html
  21. 0
    43
      castellan_ui/static/dashboard/castellan/manages/details/overview.controller.js
  22. 0
    16
      castellan_ui/static/dashboard/castellan/manages/details/overview.html
  23. 0
    166
      castellan_ui/static/dashboard/castellan/manages/manages.module.js
  24. 0
    23
      castellan_ui/static/dashboard/castellan/manages/manages.module.spec.js
  25. 0
    0
      castellan_ui/static/dashboard/castellan/manages/manages.scss
  26. 0
    62
      castellan_ui/static/dashboard/castellan/manages/manages.service.js
  27. 0
    51
      castellan_ui/static/dashboard/castellan/manages/manages.service.spec.js
  28. 0
    5
      castellan_ui/static/dashboard/castellan/manages/panel.html
  29. 0
    4
      castellan_ui/static/dashboard/castellan/manages/workflow/info.help.html
  30. 0
    62
      castellan_ui/static/dashboard/castellan/manages/workflow/manage-model.js
  31. 0
    6
      castellan_ui/static/dashboard/castellan/manages/workflow/recipe.help.html
  32. 0
    210
      castellan_ui/static/dashboard/castellan/manages/workflow/workflow.service.js
  33. 2
    2
      doc/source/index.rst
  34. 3
    3
      doc/source/install/index.rst
  35. 2
    2
      setup.cfg

+ 22
- 0
.gitignore View File

@@ -0,0 +1,22 @@
1
+AUTHORS
2
+ChangeLog
3
+build
4
+cover
5
+doc/source/contributor/api
6
+node_modules
7
+npm-debug.log
8
+releasenotes/build
9
+castellan_ui/test/.secret_key_store
10
+.coverage*
11
+.jshintrc
12
+.project
13
+.pydevproject
14
+.settings
15
+.tox
16
+.venv
17
+*.egg*
18
+*.lock
19
+*.mo
20
+*.py[cod]
21
+*.swp
22
+*nose_results.html

+ 4
- 4
README.rst View File

@@ -2,7 +2,7 @@
2 2
 Castellan UI
3 3
 ===============================
4 4
 
5
-Generic Key Manager interface UI plugin for Horizon
5
+Generic Key Manager UI Plugin for Horizon
6 6
 
7 7
 * Free software: Apache license
8 8
 * Source: http://git.openstack.org/cgit/openstack/castellan-ui
@@ -53,12 +53,12 @@ Install Castellan UI with all dependencies in your virtual environment::
53 53
 
54 54
 And enable it in Horizon::
55 55
 
56
-    ln -s ../castellan-ui/castellan_ui/enabled/_90_project_castellan_panelgroup.py openstack_dashboard/local/enabled
57
-    ln -s ../castellan-ui/castellan_ui/enabled/_91_project_castellan_manages_panel.py openstack_dashboard/local/enabled
56
+    TODO(kfarr): add the panel group here
57
+    TODO(kfarr): add the panels here
58 58
 
59 59
 To run horizon with the newly enabled Castellan UI plugin run::
60 60
 
61 61
     ./run_tests.sh --runserver 0.0.0.0:8080
62 62
 
63 63
 to have the application start on port 8080 and the horizon dashboard will be
64
-available in your browser at http://localhost:8080/
64
+available in your browser at http://localhost:8080/

+ 0
- 131
castellan_ui/api/client.py View File

@@ -1,131 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-
14
-from __future__ import absolute_import
15
-
16
-import logging
17
-
18
-from castellan import key_manager
19
-
20
-from horizon import exceptions
21
-from horizon.utils.memoized import memoized
22
-from openstack_dashboard.api import base
23
-
24
-# for stab, should remove when use CLI API
25
-import copy
26
-from datetime import datetime
27
-import uuid
28
-
29
-
30
-LOG = logging.getLogger(__name__)
31
-
32
-ATTRIBUTES = ['name', 'description', 'enabled', 'size', 'temperature',
33
-              'base', 'flavor', 'topping']
34
-
35
-STUB_DATA = {}
36
-
37
-
38
-# for stab, should be removed when use CLI API
39
-class StubResponse(object):
40
-
41
-    def __init__(self, info):
42
-        self._info = info
43
-
44
-    def __repr__(self):
45
-        reprkeys = sorted(k for k in self.__dict__.keys() if k[0] != '_')
46
-        info = ", ".join("%s=%s" % (k, getattr(self, k)) for k in reprkeys)
47
-        return "<%s %s>" % (self.__class__.__name__, info)
48
-
49
-    def to_dict(self):
50
-        return copy.deepcopy(self._info)
51
-
52
-
53
-@memoized
54
-def apiclient(request):
55
-    api_url = ""
56
-
57
-    try:
58
-        api_url = base.url_for(request, 'manage')
59
-    except exceptions.ServiceCatalogException:
60
-        LOG.debug('No Manage Management service is configured.')
61
-        return None
62
-
63
-    LOG.debug('castellan connection created using the token "%s" and url'
64
-              '"%s"' % (request.user.token.id, api_url))
65
-    c = key_manager.API()
66
-    return c
67
-
68
-
69
-def manage_create(request, **kwargs):
70
-    args = {}
71
-    for (key, value) in kwargs.items():
72
-        if key in ATTRIBUTES:
73
-            args[str(key)] = value
74
-        else:
75
-            raise exceptions.BadRequest(
76
-                "Key must be in %s" % ",".join(ATTRIBUTES))
77
-    # created = apiclient(request).manages.create(**args)
78
-
79
-    # create dummy response
80
-    args["uuid"] = uuid.uuid1().hex
81
-    args["created_at"] = datetime.now().isoformat()
82
-    created = StubResponse(args)
83
-    for k in args:
84
-        setattr(created, k, args[k])
85
-    STUB_DATA[created.uuid] = created
86
-
87
-    return created
88
-
89
-
90
-def manage_update(request, id, **kwargs):
91
-    args = {}
92
-    for (key, value) in kwargs.items():
93
-        if key in ATTRIBUTES:
94
-            args[str(key)] = value
95
-        else:
96
-            raise exceptions.BadRequest(
97
-                "Key must be in %s" % ",".join(ATTRIBUTES))
98
-    # updated = apiclient(request).manage.update(id, **args)
99
-
100
-    # update dummy response
101
-    args["uuid"] = id
102
-    args["updated_at"] = datetime.now().isoformat()
103
-    updated = StubResponse(args)
104
-    for k in args:
105
-        setattr(updated, k, args[k])
106
-    STUB_DATA[updated.uuid] = updated
107
-
108
-    return updated
109
-
110
-
111
-def manage_delete(request, id):
112
-    # deleted = apiclient(request).manages.delete(id)
113
-    deleted = STUB_DATA.pop(id)
114
-
115
-    return deleted
116
-
117
-
118
-def manage_list(
119
-        request, limit=None, marker=None, sort_key=None,
120
-        sort_dir=None, detail=True):
121
-
122
-    # list = apiclient(request).Manages.list(limit, marker, sort_key,
123
-    #                                             sort_dir, detail)
124
-    list = [STUB_DATA[data] for data in STUB_DATA]
125
-    return list
126
-
127
-
128
-def manage_show(request, id):
129
-    # show = apiclient(request).manages.get(id)
130
-    show = STUB_DATA.get(id)
131
-    return show

+ 0
- 86
castellan_ui/api/rest_api.py View File

@@ -1,86 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-from django.views import generic
14
-
15
-from castellan_ui.api import client
16
-
17
-from openstack_dashboard.api.rest import urls
18
-from openstack_dashboard.api.rest import utils as rest_utils
19
-
20
-
21
-def change_to_id(obj):
22
-    """Change key named 'uuid' to 'id'
23
-
24
-    API returns objects with a field called 'uuid' many of Horizons
25
-    directives however expect objects to have a field called 'id'.
26
-    """
27
-    obj['id'] = obj.pop('uuid')
28
-    return obj
29
-
30
-
31
-@urls.register
32
-class Manage(generic.View):
33
-    """API for retrieving a single Manage"""
34
-    url_regex = r'castellan/manages/(?P<id>[^/]+)$'
35
-
36
-    @rest_utils.ajax()
37
-    def get(self, request, id):
38
-        """Get a specific manage"""
39
-        return change_to_id(client.manage_show(request, id).to_dict())
40
-
41
-    @rest_utils.ajax(data_required=True)
42
-    def post(self, request, id):
43
-        """Update a Manage.
44
-
45
-        Returns the updated Manage object on success.
46
-        """
47
-        manage = client.manage_update(request, id, **request.DATA)
48
-        return rest_utils.CreatedResponse(
49
-            '/api/castellan/manage/%s' % manage.uuid,
50
-            manage.to_dict())
51
-
52
-
53
-@urls.register
54
-class Manages(generic.View):
55
-    """API for Manages"""
56
-    url_regex = r'castellan/manages/$'
57
-
58
-    @rest_utils.ajax()
59
-    def get(self, request):
60
-        """Get a list of the Manages for a project.
61
-
62
-        The returned result is an object with property 'items' and each
63
-        item under this is a Manage.
64
-        """
65
-        result = client.manage_list(request)
66
-        return {'items': [change_to_id(n.to_dict()) for n in result]}
67
-
68
-    @rest_utils.ajax(data_required=True)
69
-    def delete(self, request):
70
-        """Delete one or more Manages by id.
71
-
72
-        Returns HTTP 204 (no content) on successful deletion.
73
-        """
74
-        for id in request.DATA:
75
-            client.manage_delete(request, id)
76
-
77
-    @rest_utils.ajax(data_required=True)
78
-    def put(self, request):
79
-        """Create a new Manage.
80
-
81
-        Returns the new Manage object on success.
82
-        """
83
-        manage = client.manage_create(request, **request.DATA)
84
-        return rest_utils.CreatedResponse(
85
-            '/api/castellan/manage/%s' % manage.uuid,
86
-            manage.to_dict())

+ 0
- 0
castellan_ui/content/manages/__init__.py View File


+ 0
- 23
castellan_ui/content/manages/panel.py View File

@@ -1,23 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-from django.utils.translation import ugettext_lazy as _
14
-import horizon
15
-
16
-# This panel will be loaded from horizon, because specified in enabled file.
17
-# To register REST api, import below here.
18
-from castellan_ui.api import rest_api  # noqa: F401
19
-
20
-
21
-class Manages(horizon.Panel):
22
-    name = _("Manages")
23
-    slug = "manages"

+ 0
- 19
castellan_ui/content/manages/tests.py View File

@@ -1,19 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-from openstack_dashboard.test import helpers as test
14
-
15
-
16
-class ManagesTests(test.TestCase):
17
-    # Unit tests for manage.
18
-    def test_me(self):
19
-        self.assertTrue(1 + 1 == 2)

+ 0
- 20
castellan_ui/content/manages/urls.py View File

@@ -1,20 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-from django.conf.urls import url
14
-from django.utils.translation import ugettext_lazy as _
15
-from horizon.browsers import views
16
-
17
-title = _("Manages")
18
-urlpatterns = [
19
-    url('', views.AngularIndexView.as_view(title=title), name='index'),
20
-]

+ 0
- 36
castellan_ui/enabled/_90_project_castellan_panelgroup.py View File

@@ -1,36 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-from django.utils.translation import ugettext_lazy as _
14
-
15
-# The slug of the panel group to be added to HORIZON_CONFIG. Required.
16
-PANEL_GROUP = 'castellan'
17
-# The display name of the PANEL_GROUP. Required.
18
-PANEL_GROUP_NAME = _('Castellan')
19
-# The slug of the dashboard the PANEL_GROUP associated with. Required.
20
-PANEL_GROUP_DASHBOARD = 'project'
21
-
22
-ADD_INSTALLED_APPS = ['castellan_ui']
23
-
24
-ADD_ANGULAR_MODULES = [
25
-    'horizon.dashboard.castellan'
26
-]
27
-
28
-ADD_JS_FILES = [
29
-    'horizon/lib/angular/angular-route.js'
30
-]
31
-
32
-ADD_SCSS_FILES = [
33
-    'dashboard/castellan/castellan.scss'
34
-]
35
-
36
-AUTO_DISCOVER_STATIC_FILES = True

+ 0
- 21
castellan_ui/enabled/_91_project_castellan_manages_panel.py View File

@@ -1,21 +0,0 @@
1
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
-#    not use this file except in compliance with the License. You may obtain
3
-#    a copy of the License at
4
-#
5
-#         http://www.apache.org/licenses/LICENSE-2.0
6
-#
7
-#    Unless required by applicable law or agreed to in writing, software
8
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
-#    License for the specific language governing permissions and limitations
11
-#    under the License.
12
-
13
-# The slug of the panel to be added to HORIZON_CONFIG. Required.
14
-PANEL = 'manages'
15
-# The slug of the panel group the PANEL is associated with.
16
-PANEL_GROUP = 'castellan'
17
-# The slug of the dashboard the PANEL associated with. Required.
18
-PANEL_DASHBOARD = 'project'
19
-
20
-# Python panel class of the PANEL to be added.
21
-ADD_PANEL = 'castellan_ui.content.manages.panel.Manages'

+ 0
- 37
castellan_ui/static/dashboard/castellan/castellan.module.js View File

@@ -1,37 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc overview
20
-   * @name horizon.dashboard.castellan
21
-   * @description
22
-   * Dashboard module to host various castellan panels.
23
-   */
24
-  angular
25
-    .module('horizon.dashboard.castellan', [
26
-      'horizon.dashboard.castellan.manages',
27
-      'ngRoute'
28
-    ])
29
-    .config(config)
30
-
31
-  config.$inject = ['$provide', '$windowProvider', '$routeProvider'];
32
-
33
-  function config($provide, $windowProvider, $routeProvider) {
34
-    var path = $windowProvider.$get().STATIC_URL + 'dashboard/castellan/';
35
-    $provide.constant('horizon.dashboard.castellan.basePath', path);
36
-  }
37
-})();

+ 0
- 23
castellan_ui/static/dashboard/castellan/castellan.module.spec.js View File

@@ -1,23 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-(function() {
15
-  'use strict';
16
-
17
-  describe('horizon.dashboard.castellan', function() {
18
-    it('should exist', function() {
19
-      expect(angular.module('horizon.dashboard.castellan')).toBeDefined();
20
-    });
21
-  });
22
-
23
-})();

+ 0
- 8
castellan_ui/static/dashboard/castellan/castellan.scss View File

@@ -1,8 +0,0 @@
1
-@import "manages/manages";
2
-
3
-.batch-action {
4
-  float: right;
5
-  action-list {
6
-    padding-left: 0.3em;
7
-  }
8
-}

+ 0
- 81
castellan_ui/static/dashboard/castellan/castellan.service.js View File

@@ -1,81 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License");
3
- * you may not use this file except in compliance with the License.
4
- * You may obtain a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS,
10
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the License for the specific language governing permissions and
12
- * limitations under the License.
13
- */
14
-(function () {
15
-  'use strict';
16
-
17
-  angular
18
-    .module('horizon.app.core.openstack-service-api')
19
-    .factory('horizon.app.core.openstack-service-api.castellan', API);
20
-
21
-  API.$inject = [
22
-    'horizon.framework.util.http.service',
23
-    'horizon.framework.widgets.toast.service',
24
-    'horizon.framework.util.i18n.gettext'
25
-  ];
26
-
27
-  function API(apiService, toastService, gettext) {
28
-    var service = {
29
-      getManage: getManage,
30
-      getManages: getManages,
31
-      createManage: createManage,
32
-      updateManage: updateManage,
33
-      deleteManage: deleteManage,
34
-    };
35
-
36
-    return service;
37
-
38
-    ///////////////
39
-    // Manages //
40
-    ///////////////
41
-
42
-    function getManage(id) {
43
-      return apiService.get('/api/castellan/manages/' + id)
44
-        .error(function() {
45
-          var msg = gettext('Unable to retrieve the Manage with id: %(id)s.');
46
-          toastService.add('error', interpolate(msg, {id: id}, true));
47
-        });
48
-    }
49
-
50
-    function getManages() {
51
-      return apiService.get('/api/castellan/manages/')
52
-        .error(function() {
53
-          toastService.add('error', gettext('Unable to retrieve the Manages.'));
54
-        });
55
-    }
56
-
57
-    function createManage(params) {
58
-      return apiService.put('/api/castellan/manages/', params)
59
-        .error(function() {
60
-          var msg = gettext('Unable to create the Manage with name: %(name)s');
61
-          toastService.add('error', interpolate(msg, { name: params.name }, true));
62
-        });
63
-    }
64
-
65
-    function updateManage(id, params) {
66
-      return apiService.post('/api/castellan/manages/' + id, params)
67
-        .error(function() {
68
-          var msg = gettext('Unable to update the Manage with id: %(id)s');
69
-          toastService.add('error', interpolate(msg, { id: params.id }, true));
70
-        });
71
-    }
72
-
73
-    function deleteManage(id, suppressError) {
74
-      var promise = apiService.delete('/api/castellan/manages/', [id]);
75
-      return suppressError ? promise : promise.error(function() {
76
-        var msg = gettext('Unable to delete the Manage with id: %(id)s');
77
-        toastService.add('error', interpolate(msg, { id: id }, true));
78
-      });
79
-    }
80
-  }
81
-}());

+ 0
- 87
castellan_ui/static/dashboard/castellan/manages/actions/actions.module.js View File

@@ -1,87 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc overview
20
-   * @ngname horizon.dashboard.castellan.manages.actions
21
-   *
22
-   * @description
23
-   * Provides all of the actions for Manages.
24
-   */
25
-  angular
26
-    .module('horizon.dashboard.castellan.manages.actions', [
27
-      'horizon.framework',
28
-      'horizon.dashboard.castellan'
29
-    ])
30
-    .run(registerManageActions);
31
-
32
-  registerManageActions.$inject = [
33
-    'horizon.framework.conf.resource-type-registry.service',
34
-    'horizon.framework.util.i18n.gettext',
35
-    'horizon.dashboard.castellan.manages.create.service',
36
-    'horizon.dashboard.castellan.manages.update.service',
37
-    'horizon.dashboard.castellan.manages.delete.service',
38
-    'horizon.dashboard.castellan.manages.resourceType'
39
-  ];
40
-
41
-  function registerManageActions (
42
-    registry,
43
-    gettext,
44
-    createManageService,
45
-    updateManageService,
46
-    deleteManageService,
47
-    resourceType
48
-  ) {
49
-    var managesResourceType = registry.getResourceType(resourceType);
50
-    managesResourceType.globalActions
51
-      .append({
52
-        id: 'createManageAction',
53
-        service: createManageService,
54
-        template: {
55
-          type: 'create',
56
-          text: gettext('Create Manage')
57
-        }
58
-      });
59
-
60
-    managesResourceType.batchActions
61
-      .append({
62
-        id: 'batchDeleteManageAction',
63
-        service: deleteManageService,
64
-        template: {
65
-          type: 'delete-selected',
66
-          text: gettext('Delete Manages')
67
-        }
68
-      });
69
-
70
-    managesResourceType.itemActions
71
-      .append({
72
-        id: 'updateManageAction',
73
-        service: updateManageService,
74
-        template: {
75
-          text: gettext('Update Manage')
76
-        }
77
-      })
78
-      .append({
79
-        id: 'deleteManageAction',
80
-        service: deleteManageService,
81
-        template: {
82
-          type: 'delete',
83
-          text: gettext('Delete Manage')
84
-        }
85
-      });
86
-  }
87
-})();

+ 0
- 103
castellan_ui/static/dashboard/castellan/manages/actions/create.service.js View File

@@ -1,103 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc overview
20
-   * @name horizon.dashboard.castellan.manages.create.service
21
-   * @description Service for the manage create modal
22
-   */
23
-  angular
24
-    .module('horizon.dashboard.castellan.manages')
25
-    .factory('horizon.dashboard.castellan.manages.create.service', createService);
26
-
27
-  createService.$inject = [
28
-    '$location',
29
-    'horizon.app.core.openstack-service-api.castellan',
30
-    'horizon.app.core.openstack-service-api.policy',
31
-    'horizon.framework.util.actions.action-result.service',
32
-    'horizon.framework.util.i18n.gettext',
33
-    'horizon.framework.util.q.extensions',
34
-    'horizon.framework.widgets.toast.service',
35
-    'horizon.dashboard.castellan.manages.events',
36
-    'horizon.dashboard.castellan.manages.model',
37
-    'horizon.dashboard.castellan.manages.resourceType',
38
-    'horizon.dashboard.castellan.manages.workflow'
39
-  ];
40
-
41
-  function createService(
42
-    $location, api, policy, actionResult, gettext, $qExtensions,
43
-    toast, events, model, resourceType, workflow
44
-  ) {
45
-
46
-    var message = {
47
-      success: gettext('Manage %s was successfully created.')
48
-    };
49
-
50
-    var service = {
51
-      initAction: initAction,
52
-      perform: perform,
53
-      allowed: allowed
54
-    };
55
-
56
-    return service;
57
-
58
-    //////////////
59
-
60
-    // fixme: include this function in your service
61
-    // if you plan to emit events to the parent controller,
62
-    // otherwise remove it
63
-    function initAction() {
64
-    }
65
-
66
-    // fixme: if newScope is unnecessary, remove it
67
-    /* eslint-disable no-unused-vars */
68
-    function perform(selected, newScope) {
69
-      // modal title, buttons
70
-      var title, submitText, submitIcon;
71
-      title = gettext("Create Manage");
72
-      submitText = gettext("Create");
73
-      submitIcon = "fa fa-check";
74
-      model.init();
75
-
76
-      var result = workflow.init(title, submitText, submitIcon, model.spec);
77
-      return result.then(submit);
78
-    }
79
-
80
-    function allowed() {
81
-      return $qExtensions.booleanAsPromise(true);
82
-      // fixme: if you need to set policy, change as follow
83
-      //return policy.ifAllowed({ rules: [['manage', 'create_manage']] });
84
-    }
85
-
86
-    function submit() {
87
-      model.cleanProperties();
88
-      return api.createManage(model.spec).then(success);
89
-    }
90
-
91
-    function success(response) {
92
-      response.data.id = response.data.uuid;
93
-      toast.add('success', interpolate(message.success, [response.data.id]));
94
-      var result = actionResult.getActionResult()
95
-                   .created(resourceType, response.data.id);
96
-      if (result.result.failed.length === 0 && result.result.created.length > 0) {
97
-        $location.path('/project/manages');
98
-      } else {
99
-        return result.result;
100
-      }
101
-    }
102
-  }
103
-})();

+ 0
- 156
castellan_ui/static/dashboard/castellan/manages/actions/delete.service.js View File

@@ -1,156 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use self file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngDoc factory
20
-   * @name horizon.dashboard.castellan.manages.delete.service
21
-   * @Description
22
-   * Brings up the delete manages confirmation modal dialog.
23
-   * On submit, delete selected resources.
24
-   * On cancel, do nothing.
25
-   */
26
-  angular
27
-    .module('horizon.dashboard.castellan.manages')
28
-    .factory('horizon.dashboard.castellan.manages.delete.service', deleteService);
29
-
30
-  deleteService.$inject = [
31
-    '$location',
32
-    '$q',
33
-    'horizon.app.core.openstack-service-api.castellan',
34
-    'horizon.app.core.openstack-service-api.policy',
35
-    'horizon.framework.util.actions.action-result.service',
36
-    'horizon.framework.util.i18n.gettext',
37
-    'horizon.framework.util.q.extensions',
38
-    'horizon.framework.widgets.modal.deleteModalService',
39
-    'horizon.framework.widgets.toast.service',
40
-    'horizon.dashboard.castellan.manages.resourceType',
41
-    'horizon.dashboard.castellan.manages.events'
42
-  ];
43
-
44
-  function deleteService(
45
-    $location, $q, api, policy, actionResult, gettext, $qExtensions,
46
-    deleteModal, toast, resourceType, events
47
-  ) {
48
-    var scope;
49
-    var context = {
50
-      labels: null,
51
-      deleteEntity: deleteEntity,
52
-      successEvent: events.DELETE_SUCCESS
53
-    };
54
-    var service = {
55
-      initAction: initAction,
56
-      allowed: allowed,
57
-      perform: perform
58
-    };
59
-    var notAllowedMessage =
60
-      gettext("You are not allowed to delete manages: %s");
61
-
62
-    return service;
63
-
64
-    //////////////
65
-
66
-    // fixme: include this function in your service
67
-    // if you plan to emit events to the parent controller,
68
-    // otherwise remove it
69
-    function initAction() {
70
-    }
71
-
72
-    function allowed() {
73
-      return $qExtensions.booleanAsPromise(true);
74
-      // fixme: if you need to set policy, change as follow
75
-      //return policy.ifAllowed({ rules: [['manage', 'delete_manage']] });
76
-    }
77
-
78
-    // delete selected resource objects
79
-    function perform(selected, newScope) {
80
-      scope = newScope;
81
-      selected = angular.isArray(selected) ? selected : [selected];
82
-      context.labels = labelize(selected.length);
83
-      return $qExtensions.allSettled(selected.map(checkPermission)).then(afterCheck);
84
-    }
85
-
86
-    function labelize(count) {
87
-      return {
88
-        title: ngettext('Confirm Delete Manage',
89
-                        'Confirm Delete Manages', count),
90
-        /* eslint-disable max-len */
91
-        message: ngettext('You have selected "%s". Please confirm your selection. Deleted manage is not recoverable.',
92
-                          'You have selected "%s". Please confirm your selection. Deleted manages are not recoverable.', count),
93
-        /* eslint-enable max-len */
94
-        submit: ngettext('Delete Manage',
95
-                         'Delete Manages', count),
96
-        success: ngettext('Deleted Manage: %s.',
97
-                          'Deleted Manages: %s.', count),
98
-        error: ngettext('Unable to delete Manage: %s.',
99
-                        'Unable to delete Manages: %s.', count)
100
-      };
101
-    }
102
-
103
-    // for batch delete
104
-    function checkPermission(selected) {
105
-      return {promise: allowed(selected), context: selected};
106
-    }
107
-
108
-    // for batch delete
109
-    function afterCheck(result) {
110
-      var outcome = $q.reject();  // Reject the promise by default
111
-      if (result.fail.length > 0) {
112
-        toast.add('error', getMessage(notAllowedMessage, result.fail));
113
-        outcome = $q.reject(result.fail);
114
-      }
115
-      if (result.pass.length > 0) {
116
-        outcome = deleteModal.open(scope, result.pass.map(getEntity), context).then(createResult);
117
-      }
118
-      return outcome;
119
-    }
120
-
121
-    function createResult(deleteModalResult) {
122
-      // To make the result of this action generically useful, reformat the return
123
-      // from the deleteModal into a standard form
124
-      var result = actionResult.getActionResult();
125
-      deleteModalResult.pass.forEach(function markDeleted(item) {
126
-        result.deleted(resourceType, getEntity(item).id);
127
-      });
128
-      deleteModalResult.fail.forEach(function markFailed(item) {
129
-        result.failed(resourceType, getEntity(item).id);
130
-      });
131
-      if (result.result.failed.length === 0 && result.result.deleted.length > 0) {
132
-        $location.path('/project/manages');
133
-      } else {
134
-        return result.result;
135
-      }
136
-    }
137
-
138
-    function getMessage(message, entities) {
139
-      return interpolate(message, [entities.map(getName).join(", ")]);
140
-    }
141
-
142
-    function getName(result) {
143
-      return getEntity(result).name;
144
-    }
145
-
146
-    // for batch delete
147
-    function getEntity(result) {
148
-      return result.context;
149
-    }
150
-
151
-    // call delete REST API
152
-    function deleteEntity(id) {
153
-      return api.deleteManage(id, true);
154
-    }
155
-  }
156
-})();

+ 0
- 122
castellan_ui/static/dashboard/castellan/manages/actions/update.service.js View File

@@ -1,122 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc overview
20
-   * @name horizon.dashboard.castellan.manages.update.service
21
-   * @description Service for the manage update modal
22
-   */
23
-  angular
24
-    .module('horizon.dashboard.castellan.manages')
25
-    .factory('horizon.dashboard.castellan.manages.update.service', updateService);
26
-
27
-  updateService.$inject = [
28
-    '$location',
29
-    'horizon.app.core.openstack-service-api.castellan',
30
-    'horizon.app.core.openstack-service-api.policy',
31
-    'horizon.framework.util.actions.action-result.service',
32
-    'horizon.framework.util.i18n.gettext',
33
-    'horizon.framework.util.q.extensions',
34
-    'horizon.framework.widgets.toast.service',
35
-    'horizon.dashboard.castellan.manages.events',
36
-    'horizon.dashboard.castellan.manages.model',
37
-    'horizon.dashboard.castellan.manages.resourceType',
38
-    'horizon.dashboard.castellan.manages.workflow'
39
-  ];
40
-
41
-  function updateService(
42
-    $location, api, policy, actionResult, gettext, $qExtensions,
43
-    toast, events, model, resourceType, workflow
44
-  ) {
45
-
46
-    var message = {
47
-      success: gettext('Manage %s was successfully updated.')
48
-    };
49
-
50
-    var service = {
51
-      initAction: initAction,
52
-      perform: perform,
53
-      allowed: allowed
54
-    };
55
-
56
-    var id;
57
-
58
-    return service;
59
-
60
-    //////////////
61
-
62
-    // fixme: include this function in your service
63
-    // if you plan to emit events to the parent controller,
64
-    // otherwise remove it
65
-    function initAction() {
66
-    }
67
-
68
-    // fixme: if newScope is unnecessary, remove it
69
-    /* eslint-disable no-unused-vars */
70
-    function perform(selected, newScope) {
71
-      // modal title, buttons
72
-      var title, submitText, submitIcon;
73
-      title = gettext("Update Manage");
74
-      submitText = gettext("Update");
75
-      submitIcon = "fa fa-check";
76
-      model.init();
77
-
78
-      // load current data
79
-      id = selected.id;
80
-      var deferred = api.getManage(id);
81
-      deferred.then(onLoad);
82
-
83
-      function onLoad(response) {
84
-        model.spec.id = response.data.id;
85
-        model.spec.name = response.data.name;
86
-        model.spec.description = response.data.description;
87
-        model.spec.enabled = response.data.enabled;
88
-        model.spec.size = response.data.size;
89
-        model.spec.temperature = response.data.temperature;
90
-        model.spec.base = response.data.base;
91
-        model.spec.flavor = response.data.flavor;
92
-        model.spec.topping = response.data.topping;
93
-      }
94
-
95
-      var result = workflow.init(title, submitText, submitIcon, model.spec);
96
-      return result.then(submit);
97
-    }
98
-
99
-    function allowed() {
100
-      return $qExtensions.booleanAsPromise(true);
101
-      // fixme: if you need to set policy, change as follow
102
-      //return policy.ifAllowed({ rules: [['manage', 'update_manage']] });
103
-    }
104
-
105
-    function submit() {
106
-      model.cleanProperties();
107
-      return api.updateManage(id, model.spec).then(success);
108
-    }
109
-
110
-    function success(response) {
111
-      response.data.id = response.data.uuid;
112
-      toast.add('success', interpolate(message.success, [response.data.id]));
113
-      var result = actionResult.getActionResult()
114
-                   .updated(resourceType, response.data.id);
115
-      if (result.result.failed.length === 0 && result.result.updated.length > 0) {
116
-        $location.path('/project/manages');
117
-      } else {
118
-        return result.result;
119
-      }
120
-    }
121
-  }
122
-})();

+ 0
- 57
castellan_ui/static/dashboard/castellan/manages/details/details.module.js View File

@@ -1,57 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc overview
20
-   * @ngname horizon.dashboard.castellan.manages.details
21
-   *
22
-   * @description
23
-   * Provides details features for Manage.
24
-   */
25
-  angular
26
-    .module('horizon.dashboard.castellan.manages.details', [
27
-      'horizon.app.core',
28
-      'horizon.framework.conf'
29
-    ])
30
-    .run(registerDetails);
31
-
32
-  registerDetails.$inject = [
33
-    'horizon.app.core.openstack-service-api.castellan',
34
-    'horizon.dashboard.castellan.manages.basePath',
35
-    'horizon.dashboard.castellan.manages.resourceType',
36
-    'horizon.framework.conf.resource-type-registry.service'
37
-  ];
38
-
39
-  function registerDetails(
40
-    api,
41
-    basePath,
42
-    resourceType,
43
-    registry
44
-  ) {
45
-    registry.getResourceType(resourceType)
46
-      .setLoadFunction(loadFunction)
47
-      .detailsViews.append({
48
-        id: 'manageDetailsOverview',
49
-        name: gettext('Overview'),
50
-        template: basePath + 'details/overview.html'
51
-      });
52
-
53
-    function loadFunction(identifier) {
54
-      return api.getManage(identifier);
55
-    }
56
-  }
57
-})();

+ 0
- 6
castellan_ui/static/dashboard/castellan/manages/details/drawer.html View File

@@ -1,6 +0,0 @@
1
-<hz-resource-property-list
2
-  resource-type-name="OS::Castellan::Manage"
3
-  item="item"
4
-  property-groups="[['id'],
5
-                    ['topping', 'created_at', 'updated_at']]">
6
-</hz-resource-property-list>

+ 0
- 43
castellan_ui/static/dashboard/castellan/manages/details/overview.controller.js View File

@@ -1,43 +0,0 @@
1
-/*
2
- * Licensed under the Apache License, Version 2.0 (the 'License');
3
- * you may not use this file except in compliance with the License.
4
- * You may obtain a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an 'AS IS' BASIS,
10
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the License for the specific language governing permissions and
12
- * limitations under the License.
13
- */
14
-(function() {
15
-  "use strict";
16
-
17
-  angular
18
-    .module('horizon.dashboard.castellan.manages')
19
-    .controller('horizon.dashboard.castellan.manages.OverviewController', controller);
20
-
21
-  controller.$inject = [
22
-    '$scope',
23
-    'horizon.dashboard.castellan.manages.resourceType',
24
-    'horizon.dashboard.castellan.manages.events',
25
-    'horizon.framework.conf.resource-type-registry.service'
26
-  ];
27
-
28
-  function controller(
29
-    $scope,
30
-    resourceType,
31
-    events,
32
-    registry
33
-  ) {
34
-    var ctrl = this;
35
-    ctrl.manage = {};
36
-
37
-    $scope.context.loadPromise.then(onGetManage);
38
-
39
-    function onGetManage(manage) {
40
-      ctrl.manage = manage.data;
41
-    }
42
-  }
43
-})();

+ 0
- 16
castellan_ui/static/dashboard/castellan/manages/details/overview.html View File

@@ -1,16 +0,0 @@
1
-<div ng-controller="horizon.dashboard.castellan.manages.OverviewController as ctrl">
2
-  <div class="row">
3
-    <div class="col-md-12 detail">
4
-      <h3 translate>Manage</h3>
5
-      <hr>
6
-      <hz-resource-property-list
7
-        resource-type-name="OS::Castellan::Manage"
8
-        cls="dl-horizontal"
9
-        item="ctrl.manage"
10
-        property-groups="[['name', 'description', 'enabled'],
11
-                          ['size', 'temperature', 'base', 'flavor', 'topping'],
12
-                          ['id', 'created_at', 'updated_at']]">
13
-      </hz-resource-property-list>
14
-    </div>
15
-  </div>
16
-</div>

+ 0
- 166
castellan_ui/static/dashboard/castellan/manages/manages.module.js View File

@@ -1,166 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc overview
20
-   * @name horizon.dashboard.castellan.manages
21
-   * @ngModule
22
-   * @description
23
-   * Provides all the services and widgets require to display the Manage
24
-   * panel
25
-   */
26
-  angular
27
-    .module('horizon.dashboard.castellan.manages', [
28
-      'ngRoute',
29
-      'horizon.dashboard.castellan.manages.actions',
30
-      'horizon.dashboard.castellan.manages.details'
31
-    ])
32
-    .constant('horizon.dashboard.castellan.manages.events', events())
33
-    .constant('horizon.dashboard.castellan.manages.resourceType', 'OS::Castellan::Manage')
34
-    .run(run)
35
-    .config(config);
36
-
37
-  /**
38
-   * @ngdoc constant
39
-   * @name horizon.dashboard.castellan.manages.events
40
-   * @description A list of events used by Manage
41
-   */
42
-  function events() {
43
-    return {
44
-      CREATE_SUCCESS: 'horizon.dashboard.castellan.manages.CREATE_SUCCESS',
45
-      DELETE_SUCCESS: 'horizon.dashboard.castellan.manages.DELETE_SUCCESS'
46
-    };
47
-  }
48
-
49
-  run.$inject = [
50
-    'horizon.framework.conf.resource-type-registry.service',
51
-    'horizon.dashboard.castellan.manages.service',
52
-    'horizon.dashboard.castellan.manages.basePath',
53
-    'horizon.dashboard.castellan.manages.resourceType'
54
-  ];
55
-
56
-  function run(registry, service, basePath, resourceType) {
57
-    registry.getResourceType(resourceType)
58
-    .setNames(gettext('Manage'), gettext('Manages'))
59
-    // for detail summary view on table row 
60
-    .setSummaryTemplateUrl(basePath + 'details/drawer.html')
61
-    // for table row items and detail summary view.
62
-    .setProperties(properties())
63
-    .setListFunction(service.getPromise)
64
-    .tableColumns
65
-    .append({
66
-      id: 'name',
67
-      priority: 1,
68
-      sortDefault: true,
69
-      filters: ['noName'],
70
-      urlFunction: service.urlFunction
71
-    })
72
-    .append({
73
-      id: 'size',
74
-      priority: 1,
75
-      filters: ['noValue']
76
-    })
77
-    .append({
78
-      id: 'temperature',
79
-      priority: 1,
80
-      filters: ['noValue']
81
-    })
82
-    .append({
83
-      id: 'base',
84
-      priority: 1,
85
-      filters: ['noValue']
86
-    })
87
-    .append({
88
-      id: 'flavor',
89
-      priority: 1,
90
-      filters: ['noValue']
91
-    })
92
-    .append({
93
-      id: 'topping',
94
-      priority: 2,
95
-      filters: ['noValue']
96
-    })
97
-    .append({
98
-      id: 'created_at',
99
-      priority: 2
100
-    })
101
-    .append({
102
-      id: 'updated_at',
103
-      priority: 2
104
-    });
105
-    // for magic-search
106
-    registry.getResourceType(resourceType).filterFacets
107
-    .append({
108
-      'label': gettext('Name'),
109
-      'name': 'name',
110
-      'singleton': true
111
-    })
112
-    .append({
113
-      'label': gettext('Base'),
114
-      'name': 'base',
115
-      'singleton': true
116
-    })
117
-    .append({
118
-      'label': gettext('Flavor'),
119
-      'name': 'flavor',
120
-      'singleton': true
121
-    })
122
-    .append({
123
-      'label': gettext('ID'),
124
-      'name': 'id',
125
-      'singleton': true
126
-    });
127
-  }
128
-
129
-  function properties() {
130
-    return {
131
-      id: { label: gettext('ID'), filters: ['noValue'] },
132
-      name: { label: gettext('Name'), filters: ['noName'] },
133
-      description: { label: gettext('Description'), filters: ['noValue'] },
134
-      enabled: { label: gettext('Enabled'), filters: ['yesno'] },
135
-      size: { label: gettext('Size'), filters: ['noValue'] },
136
-      temperature: { label: gettext('Temperature'), filters: ['noValue'] },
137
-      base: { label: gettext('Base'), filters: ['noValue'] },
138
-      flavor: { label: gettext('Flavor'), filters: ['noValue'] },
139
-      topping: { label: gettext('Topping'), filters: ['noValue'] },
140
-      created_at: { label: gettext('Created'), filters: ['simpleDate', 'noValue'] },
141
-      updated_at: { label: gettext('Updated'), filters: ['simpleDate', 'noValue'] }
142
-    };
143
-  }
144
-
145
-  config.$inject = [
146
-    '$provide',
147
-    '$windowProvider',
148
-    '$routeProvider'
149
-  ];
150
-
151
-  /**
152
-   * @name config
153
-   * @param {Object} $provide
154
-   * @param {Object} $windowProvider
155
-   * @param {Object} $routeProvider
156
-   * @description Routes used by this module.
157
-   * @returns {undefined} Returns nothing
158
-   */
159
-  function config($provide, $windowProvider, $routeProvider) {
160
-    var path = $windowProvider.$get().STATIC_URL + 'dashboard/castellan/manages/';
161
-    $provide.constant('horizon.dashboard.castellan.manages.basePath', path);
162
-    $routeProvider.when('/project/manages', {
163
-      templateUrl: path + 'panel.html'
164
-    });
165
-  }
166
-})();

+ 0
- 23
castellan_ui/static/dashboard/castellan/manages/manages.module.spec.js View File

@@ -1,23 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-(function() {
15
-  'use strict';
16
-
17
-  describe('horizon.dashboard.castellan.manages', function() {
18
-    it('should exist', function() {
19
-      expect(angular.module('horizon.dashboard.castellan.manages')).toBeDefined();
20
-    });
21
-  });
22
-
23
-})();

+ 0
- 0
castellan_ui/static/dashboard/castellan/manages/manages.scss View File


+ 0
- 62
castellan_ui/static/dashboard/castellan/manages/manages.service.js View File

@@ -1,62 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  "use strict";
17
-
18
-  angular.module('horizon.dashboard.castellan.manages')
19
-    .factory('horizon.dashboard.castellan.manages.service',
20
-      service);
21
-
22
-  service.$inject = [
23
-    '$filter',
24
-    'horizon.app.core.detailRoute',
25
-    'horizon.app.core.openstack-service-api.castellan'
26
-  ];
27
-
28
-  /*
29
-   * @ngdoc factory
30
-   * @name horizon.dashboard.castellan.manages.service
31
-   *
32
-   * @description
33
-   * This service provides functions that are used through the Manages
34
-   * features.  These are primarily used in the module registrations
35
-   * but do not need to be restricted to such use.  Each exposed function
36
-   * is documented below.
37
-   */
38
-  function service($filter, detailRoute, api) {
39
-    return {
40
-      getPromise: getPromise,
41
-      urlFunction: urlFunction
42
-    };
43
-
44
-    function getPromise(params) {
45
-      return api.getManages(params).then(modifyResponse);
46
-    }
47
-
48
-    function modifyResponse(response) {
49
-      return {data: {items: response.data.items.map(modifyItem)}};
50
-
51
-      function modifyItem(item) {
52
-        var timestamp = item.updated_at ? item.updated_at : item.created_at;
53
-        item.trackBy = item.id.concat(timestamp);
54
-        return item;
55
-      };
56
-    }
57
-
58
-    function urlFunction(item) {
59
-      return detailRoute + 'OS::Castellan::Manage/' + item.id;
60
-    }
61
-  }
62
-})();

+ 0
- 51
castellan_ui/static/dashboard/castellan/manages/manages.service.spec.js View File

@@ -1,51 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License");
3
- * you may not use this file except in compliance with the License.
4
- * You may obtain a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS,
10
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the License for the specific language governing permissions and
12
- * limitations under the License.
13
- */
14
-(function() {
15
-  "use strict";
16
-
17
-  describe('Manages service', function() {
18
-    var service;
19
-    beforeEach(module('horizon.dashboard.castellan.manages'));
20
-    beforeEach(inject(function($injector) {
21
-      service = $injector.get('horizon.dashboard.castellan.manages.service');
22
-    }));
23
-
24
-    describe('getPromise', function() {
25
-      it("provides a promise", inject(function($q, $injector, $timeout) {
26
-        var api = $injector.get('horizon.app.core.openstack-service-api.castellan');
27
-        var deferred = $q.defer();
28
-        spyOn(api, 'getManages').and.returnValue(deferred.promise);
29
-        var result = service.getPromise({});
30
-        deferred.resolve({
31
-          data:{
32
-            items: [{id: 123, name: 'resource1'}]
33
-          }
34
-        });
35
-        $timeout.flush();
36
-        expect(api.getManages).toHaveBeenCalled();
37
-        expect(result.$$state.value.data.items[0].name).toBe('resource1');
38
-      }));
39
-    });
40
-
41
-    describe('urlFunction', function() {
42
-      it("get url", inject(function() {
43
-        var detailRoute = $injector.get('horizon.app.core.detailRoute');
44
-        var result = service.urlFunction({id:"123abc"});
45
-        expect(result).toBe(detailRoute + "OS::Castellan::Manage/123abc");
46
-      }));
47
-    });
48
-
49
-  });
50
-
51
-})();

+ 0
- 5
castellan_ui/static/dashboard/castellan/manages/panel.html View File

@@ -1,5 +0,0 @@
1
-<hz-resource-panel resource-type-name="OS::Castellan::Manage">
2
-  <hz-resource-table resource-type-name="OS::Castellan::Manage"
3
-                     track-by="trackBy">
4
-  </hz-resource-table>
5
-</hz-resource-panel>

+ 0
- 4
castellan_ui/static/dashboard/castellan/manages/workflow/info.help.html View File

@@ -1,4 +0,0 @@
1
-<dl>
2
-  <dt translate>Manage Name</dt>
3
-  <dd translate>An arbitrary human-readable name</dd>
4
-</dl>

+ 0
- 62
castellan_ui/static/dashboard/castellan/manages/workflow/manage-model.js View File

@@ -1,62 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc model
20
-   * @name horizon.dashboard.castellan.manages.model
21
-   * @description Service for the manage model
22
-   */
23
-  angular
24
-    .module('horizon.dashboard.castellan.manages')
25
-    .factory('horizon.dashboard.castellan.manages.model', model);
26
-
27
-  model.$inject = [
28
-  ];
29
-
30
-  function model() {
31
-    var model = {
32
-      // params
33
-      "spec": {},
34
-
35
-      // methods
36
-      "init": init,
37
-      "cleanProperties": cleanProperties
38
-    };
39
-
40
-    function init() {
41
-      // initialize model
42
-      model.spec = {
43
-        "id": "",
44
-        "name": "",  // text required
45
-        "description": "",  // textarea
46
-        "enabled": true,  // checkbox
47
-        "size": "M",  // radio
48
-        "temperature": "H",  // radio
49
-        "base": "",  // select
50
-        "flavor": "",  // select
51
-        "topping": ""  // checkboxes
52
-      };
53
-    }
54
-
55
-    function cleanProperties() {
56
-      delete model.spec.id;
57
-      delete model.spec.tabs;
58
-    }
59
-
60
-    return model;
61
-  }
62
-})();

+ 0
- 6
castellan_ui/static/dashboard/castellan/manages/workflow/recipe.help.html View File

@@ -1,6 +0,0 @@
1
-<dl>
2
-  <dt translate>Base</dt>
3
-  <dd translate>Choose base drink.</dd>
4
-  <dt translate>Other options</dt>
5
-  <dd translate>Choose favorite options.</dd>
6
-</dl>

+ 0
- 210
castellan_ui/static/dashboard/castellan/manages/workflow/workflow.service.js View File

@@ -1,210 +0,0 @@
1
-/**
2
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
3
- * not use this file except in compliance with the License. You may obtain
4
- * a copy of the License at
5
- *
6
- *    http://www.apache.org/licenses/LICENSE-2.0
7
- *
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- * License for the specific language governing permissions and limitations
12
- * under the License.
13
- */
14
-
15
-(function() {
16
-  'use strict';
17
-
18
-  /**
19
-   * @ngdoc workflow
20
-   * @name horizon.dashboard.castellan.manages.workflow
21
-   * @description Service for the create/update workflow
22
-   */
23
-  angular
24
-    .module('horizon.dashboard.castellan.manages')
25
-    .factory('horizon.dashboard.castellan.manages.workflow', workflow);
26
-
27
-  workflow.$inject = [
28
-    'horizon.dashboard.castellan.basePath',
29
-    'horizon.framework.util.i18n.gettext',
30
-    'horizon.framework.widgets.form.ModalFormService'
31
-  ];
32
-
33
-  function workflow(basePath, gettext, modal) {
34
-    var workflow = {
35
-      init: init
36
-    };
37
-
38
-    function init(title, submitText, submitIcon, model) {
39
-      var schema, form;
40
-
41
-      // schema
42
-      schema = {
43
-        "type": "object",
44
-        "properties": {
45
-          "name": {
46
-            "title": gettext("Name"),
47
-            "type": "string"
48
-          },
49
-          "description": {
50
-            "title": gettext("Description"),
51
-            "type": "string"
52
-          },
53
-          "enabled": {
54
-            "title": gettext("Enabled"),
55
-            "type": "boolean",
56
-            "default": true
57
-          },
58
-          "size": {
59
-            "title": gettext("Size"),
60
-            "type": "string",
61
-            "default": "M"
62
-          },
63
-          "temperature": {
64
-            "title": gettext("Temperature"),
65
-            "type": "string",
66
-            "default": "H"
67
-          },
68
-          "base": {
69
-            "title": gettext("Base"),
70
-            "type": "string",
71
-            "default": ""
72
-          },
73
-          "flavor": {
74
-            "title": gettext("Flavor"),
75
-            "type": "string",
76
-            "default": ""
77
-          },
78
-          "topping": {
79
-            "title": gettext("Topping")
80
-          }
81
-        }
82
-      };
83
-
84
-      // form
85
-      form = [
86
-        {
87
-          "type": "tabs",
88
-          "tabs": [
89
-            {
90
-              "title": gettext("Info"),
91
-              "help": basePath + "manages/workflow/info.help.html",
92
-              "items": [
93
-                {
94
-                  "key": "name",
95
-                  "placeholder": gettext("Name of the manage."),
96
-                  "required": true
97
-                },
98
-                {
99
-                  "key": "description",
100
-                  "type": "textarea"
101
-                },
102
-                {
103
-                  "key": "enabled",
104
-                  "type": "checkbox"
105
-                }
106
-              ]
107
-            },
108
-            {
109
-              "title": gettext("Recipe"),
110
-              "help": basePath + "manages/workflow/recipe.help.html",
111
-              "items": [
112
-                {
113
-                  "key": "size",
114
-                  "type": "radiobuttons",
115
-                  "titleMap": [
116
-                    {"value": "S", "name": gettext("Small")},
117
-                    {"value": "M", "name": gettext("Medium")},
118
-                    {"value": "L", "name": gettext("Large")},
119
-                    {"value": "XL", "name": gettext("Extra Large")}
120
-                  ]
121
-                },
122
-                {
123
-                  "key": "temperature",
124
-                  "type": "radiobuttons",
125
-                  "titleMap": [
126
-                    {"value": "H", "name": gettext("Hot")},
127
-                    {"value": "I", "name": gettext("Ice")}
128
-                  ]
129
-                },
130
-                {
131
-                  "key": "base",
132
-                  "type": "select",
133
-                  "titleMap": [
134
-                    {"value": "", "name": gettext("Choose base.")},
135
-                    {
136
-                      "value": "blend",
137
-                      "name": gettext("House Blend"),
138
-                      "group": gettext("Coffee")
139
-                    },
140
-                    {
141
-                      "value": "mandheling",
142
-                      "name": gettext("Mandheling"),
143
-                      "group": gettext("Coffee")},
144
-                    {
145
-                      "value": "colombia",
146
-                      "name": gettext("Colombia"),
147
-                      "group": gettext("Coffee")
148
-                    },
149
-                    {
150
-                      "value": "espresso",
151
-                      "name": gettext("Espresso"),
152
-                      "group": gettext("Coffee")
153
-                    },
154
-                    {
155
-                      "value": "earl_gray",
156
-                      "name": gettext("Earl Gray"),
157
-                      "group": gettext("Tea")
158
-                    },
159
-                    {
160
-                      "value": "darjeeling",
161
-                      "name": gettext("Darjeeling"),
162
-                      "group": gettext("Tea")},
163
-                    {
164
-                      "value": "orange_pekoe",
165
-                      "name": gettext("Orange Pekoe"),
166
-                      "group": gettext("Tea")
167
-                    }
168
-                  ]
169
-                },
170
-                {
171
-                  "key": "flavor",
172
-                  "type": "select",
173
-                  "titleMap": [
174
-                    {"value": "", "name": gettext("Choose flavor.")},
175
-                    {"value": "chocolate", "name": gettext("Chocolate")},
176
-                    {"value": "mocha", "name": gettext("Mocha")},
177
-                    {"value": "strawberry", "name": gettext("Strawberry")},
178
-                    {"value": "blueberry", "name": gettext("Blueberry")},
179
-                    {"value": "raspberry", "name": gettext("Raspberry")}
180
-                  ]
181
-                },
182
-                {
183
-                  "key": "topping",
184
-                  "type": "checkboxes",
185
-                  "titleMap": [
186
-                    {"value": "clushed_nuts", "name": gettext("Clushed Nuts")},
187
-                    {"value": "whip_cream", "name": gettext("Whip Cream")},
188
-                    {"value": "mixed_serial", "name": gettext("Mixed Serial")}
189
-                  ]
190
-                }
191
-              ] // items
192
-            } // tab
193
-          ] // tabs
194
-        }
195
-      ]; // form
196
-
197
-      var config = {
198
-        "title": title,
199
-        "submitText": submitText,
200
-        "schema": schema,
201
-        "form": form,
202
-        "model": model
203
-      };
204
-
205
-      return modal.open(config);
206
-    }
207
-
208
-    return workflow;
209
-  }
210
-})();

+ 2
- 2
doc/source/index.rst View File

@@ -2,7 +2,7 @@
2 2
 Castellan UI
3 3
 ===============================
4 4
 
5
-Generic Key Manager interface UI plugin for Horizon
5
+Generic Key Manager UI Plugin for Horizon
6 6
 
7 7
 * Free software: Apache license
8 8
 * Source: http://git.openstack.org/cgit/openstack/castellan-ui
@@ -30,4 +30,4 @@ Contributor Guide
30 30
    :glob:
31 31
    :maxdepth: 2
32 32
 
33
-   contributor/index
33
+   contributor/index

+ 3
- 3
doc/source/install/index.rst View File

@@ -42,12 +42,12 @@ Install Castellan UI with all dependencies in your virtual environment::
42 42
 
43 43
 And enable it in Horizon::
44 44
 
45
-    ln -s ../castellan-ui/castellan_ui/enabled/_90_project_castellan_panelgroup.py openstack_dashboard/local/enabled
46
-    ln -s ../castellan-ui/castellan_ui/enabled/_91_project_castellan_manages_panel.py openstack_dashboard/local/enabled
45
+    ln -s ../castellan-ui/castellan_ui/enabled/_90_project_key_manager_panelgroup.py openstack_dashboard/local/enabled
46
+    ln -s ../castellan-ui/castellan_ui/enabled/_91_project_key_manager_symmetric_keys_panel.py openstack_dashboard/local/enabled
47 47
 
48 48
 To run horizon with the newly enabled Castellan UI plugin run::
49 49
 
50 50
     ./run_tests.sh --runserver 0.0.0.0:8080
51 51
 
52 52
 to have the application start on port 8080 and the horizon dashboard will be
53
-available in your browser at http://localhost:8080/
53
+available in your browser at http://localhost:8080/

+ 2
- 2
setup.cfg View File

@@ -1,6 +1,6 @@
1 1
 [metadata]
2 2
 name = castellan-ui
3
-summary = Generic Key Manager interface UI plugin for Horizon
3
+summary = Generic Key Manager UI Plugin for Horizon
4 4
 description-file =
5 5
     README.rst
6 6
 author = OpenStack
@@ -26,4 +26,4 @@ packages =
26 26
 all_files = 1
27 27
 build-dir = doc/build
28 28
 source-dir = doc/source
29
-warning-is-error = 1
29
+warning-is-error = 1

Loading…
Cancel
Save