From b170b54bf534aa2a2aee14e896c9daf126167019 Mon Sep 17 00:00:00 2001 From: "wei.ying" Date: Sat, 18 Nov 2017 01:36:33 +0800 Subject: [PATCH] Display policy in server groups table instead of sub table According to [1][2], the server group policies can only contain one. However in angular create instance server groups tab, the server group policies are displayed in server groups sub table, it will let users misunderstand there are multiple policies. So it is best to display policy directly in the server groups table. [1] https://developer.openstack.org/api-ref/compute/#create-server-group [2] https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/server_groups.py#L28 Change-Id: I9a557f90d4662005b9e0639ea564f424c37513bb Closes-Bug:#1740661 --- .../server-groups/server-group-details.html | 13 ------------- .../server-groups/server-groups.controller.js | 16 ++-------------- .../server-groups/server-groups.html | 14 +++----------- .../server-groups/server-groups.spec.js | 7 +------ 4 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-group-details.html diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-group-details.html b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-group-details.html deleted file mode 100644 index d61c115995..0000000000 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-group-details.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - -
Policy
{$ policy | noValue $}
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.controller.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.controller.js index 7603c913fb..0101d14954 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.controller.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.controller.js @@ -21,20 +21,18 @@ .controller('LaunchInstanceServerGroupsController', LaunchInstanceServerGroupsController); LaunchInstanceServerGroupsController.$inject = [ - 'launchInstanceModel', - 'horizon.dashboard.project.workflow.launch-instance.basePath' + 'launchInstanceModel' ]; /** * @ngdoc controller * @name LaunchInstanceServerGroupsController * @param {Object} launchInstanceModel - * @param {string} basePath * @description * Allows selection of server groups. * @returns {undefined} No return value */ - function LaunchInstanceServerGroupsController(launchInstanceModel, basePath) { + function LaunchInstanceServerGroupsController(launchInstanceModel) { var ctrl = this; ctrl.tableData = { @@ -44,8 +42,6 @@ displayedAllocated: [] }; - ctrl.tableDetails = basePath + 'server-groups/server-group-details.html'; - ctrl.tableHelp = { /*eslint-disable max-len */ noneAllocText: gettext('Select a server group from the available groups below.'), @@ -56,13 +52,5 @@ ctrl.tableLimits = { maxAllocation: 1 }; - - ctrl.filterFacets = [ - { - label: gettext('Name'), - name: 'name', - singleton: true - } - ]; } })(); diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.html b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.html index de67363930..c2b1c85bbf 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.html +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.html @@ -19,8 +19,8 @@ - Name + Policy @@ -39,13 +39,10 @@ - - - - {$ row.name $} + {$ row.policies[0] | noValue $} - - - - - diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.spec.js index 7e3e9736cb..cd753b7d4b 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/server-groups/server-groups.spec.js @@ -33,8 +33,7 @@ ctrl = $controller( 'LaunchInstanceServerGroupsController', { - launchInstanceModel: model, - 'horizon.dashboard.project.workflow.launch-instance.basePath': '' + launchInstanceModel: model }); })); @@ -52,10 +51,6 @@ expect(ctrl.tableData.displayedAllocated).toEqual([]); }); - it('defines table details template', function() { - expect(ctrl.tableDetails).toBeDefined(); - }); - it('defines table help', function() { expect(ctrl.tableHelp).toBeDefined(); expect(Object.keys(ctrl.tableHelp).length).toBe(2);