magnum-ui 14.0.0.0rc1__py3-none-any.whl → 15.0.0.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. magnum_ui/locale/en_GB/LC_MESSAGES/djangojs.po +12 -40
  2. magnum_ui/locale/ru/LC_MESSAGES/djangojs.po +1 -19
  3. magnum_ui/static/dashboard/container-infra/cluster-templates/actions.module.spec.js +1 -3
  4. magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js +1 -1
  5. magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js +3 -0
  6. magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.js +1 -1
  7. magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.spec.js +3 -1
  8. magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.js +1 -1
  9. magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.spec.js +3 -1
  10. magnum_ui/static/dashboard/container-infra/cluster-templates/update/update.service.js +36 -50
  11. magnum_ui/static/dashboard/container-infra/clusters/actions.module.spec.js +1 -3
  12. magnum_ui/static/dashboard/container-infra/clusters/clusters.module.js +31 -7
  13. magnum_ui/static/dashboard/container-infra/clusters/clusters.scss +10 -0
  14. magnum_ui/static/dashboard/container-infra/clusters/clusters.utils.js +134 -0
  15. magnum_ui/static/dashboard/container-infra/clusters/clusters.utils.spec.js +56 -0
  16. magnum_ui/static/dashboard/container-infra/clusters/config/config.service.js +1 -1
  17. magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js +3 -0
  18. magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js +1 -1
  19. magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.spec.js +3 -1
  20. magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html +12 -2
  21. magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js +1 -1
  22. magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.spec.js +3 -1
  23. magnum_ui/static/dashboard/container-infra/clusters/workflow/advanced.help.html +2 -2
  24. magnum_ui/static/dashboard/container-infra/clusters/workflow/cluster-template.controller.spec.js +8 -8
  25. magnum_ui/static/dashboard/container-infra/clusters/workflow/size.help.html +6 -1
  26. magnum_ui/static/dashboard/container-infra/clusters/workflow/workflow.service.js +58 -21
  27. magnum_ui/static/dashboard/container-infra/magnum.service.js +2 -2
  28. magnum_ui/static/dashboard/container-infra/quotas/actions.module.spec.js +1 -3
  29. magnum_ui/static/dashboard/container-infra/quotas/delete/delete.service.js +3 -0
  30. magnum_ui/static/dashboard/container-infra/utils.service.js +16 -13
  31. {magnum_ui-14.0.0.0rc1.dist-info → magnum_ui-15.0.0.0rc1.dist-info}/AUTHORS +1 -0
  32. {magnum_ui-14.0.0.0rc1.dist-info → magnum_ui-15.0.0.0rc1.dist-info}/METADATA +1 -1
  33. {magnum_ui-14.0.0.0rc1.dist-info → magnum_ui-15.0.0.0rc1.dist-info}/RECORD +37 -35
  34. magnum_ui-15.0.0.0rc1.dist-info/pbr.json +1 -0
  35. magnum_ui-14.0.0.0rc1.dist-info/pbr.json +0 -1
  36. {magnum_ui-14.0.0.0rc1.dist-info → magnum_ui-15.0.0.0rc1.dist-info}/LICENSE +0 -0
  37. {magnum_ui-14.0.0.0rc1.dist-info → magnum_ui-15.0.0.0rc1.dist-info}/WHEEL +0 -0
  38. {magnum_ui-14.0.0.0rc1.dist-info → magnum_ui-15.0.0.0rc1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Copyright 2017 NEC Corporation
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+ * not use this file except in compliance with the License. You may obtain
6
+ * a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ * License for the specific language governing permissions and limitations
14
+ * under the License.
15
+ */
16
+
17
+ (function() {
18
+ 'use strict';
19
+
20
+ describe('horizon.dashboard.container-infra.clusters.utils', function() {
21
+
22
+ var service, $scope, mockDirective, actionsDirectiveLinkFn, attrs;
23
+
24
+ ///////////////////
25
+
26
+ beforeEach(module('horizon.app.core'));
27
+ beforeEach(module('horizon.framework'));
28
+ beforeEach(module('horizon.dashboard.container-infra.clusters'));
29
+
30
+ beforeEach(inject(function($injector, _$rootScope_) {
31
+ $scope = _$rootScope_.$new();
32
+ service = $injector.get(
33
+ 'horizon.dashboard.container-infra.clusters.utils');
34
+
35
+ mockDirective = {link:{apply:function() {}}};
36
+ actionsDirectiveLinkFn = service.getActionsDirectiveLinkFn(mockDirective);
37
+ attrs = {
38
+ type: 'row',
39
+ item: 'item',
40
+ allowed: 'allowed'
41
+ };
42
+ }));
43
+
44
+ it('should not amend the <actions> directive because the action type is ' +
45
+ 'not \'row\'', function() {
46
+ attrs.type = 'main';
47
+ actionsDirectiveLinkFn($scope, angular.element(""), attrs);
48
+ });
49
+
50
+ it('should attempt to amend the <actions> directive without critical failure', function() {
51
+ $scope.allowed = [];
52
+ actionsDirectiveLinkFn($scope, angular.element(""), attrs);
53
+ });
54
+
55
+ });
56
+ })();
@@ -54,7 +54,7 @@
54
54
  function perform(selected) {
55
55
  // get config
56
56
  return magnum.getClusterConfig(selected.id).then(function(response) {
57
- if ( response.data.key !== undefined ) {
57
+ if (typeof response.data.key !== "undefined") {
58
58
  textDownload.downloadTextFile(response.data.key, selected.name + "_key.pem");
59
59
  textDownload.downloadTextFile(response.data.ca, selected.name + "_ca.pem");
60
60
  textDownload.downloadTextFile(response.data.cert, selected.name + "_cert.pem");
@@ -40,12 +40,14 @@
40
40
  * @name clusters.delete.service
41
41
  * @param {Object} $location
42
42
  * @param {Object} $q
43
+ * @param {Object} $rootScope
43
44
  * @param {Object} magnum
44
45
  * @param {Object} policy
45
46
  * @param {Object} actionResult
46
47
  * @param {Object} gettext
47
48
  * @param {Object} $qExtensions
48
49
  * @param {Object} deleteModal
50
+ * @param {Object} tableEvents
49
51
  * @param {Object} toast
50
52
  * @param {Object} resourceType
51
53
  * @param {Object} events
@@ -143,6 +145,7 @@
143
145
  if (result.result.failed.length === 0 && result.result.deleted.length > 0 &&
144
146
  currentPath !== indexPath) {
145
147
  $location.path(indexPath);
148
+ return null;
146
149
  } else {
147
150
  $rootScope.$broadcast(tableEvents.CLEAR_SELECTIONS);
148
151
  return result.result;
@@ -36,7 +36,7 @@
36
36
 
37
37
  function objLen(obj) {
38
38
  var length = 0;
39
- if (typeof obj === 'object') {
39
+ if (obj && typeof obj === 'object') {
40
40
  length = Object.keys(obj).length;
41
41
  }
42
42
  return length;
@@ -26,7 +26,9 @@
26
26
  }));
27
27
 
28
28
  it('objLen returns number of attributes of object', inject(function() {
29
- expect(ctrl.objLen(undefined)).toBe(0);
29
+ expect(ctrl.objLen()).toBe(0);
30
+ expect(ctrl.objLen(null)).toBe(0);
31
+ expect(ctrl.objLen({})).toBe(0);
30
32
  expect(ctrl.objLen({a: 0})).toBe(1);
31
33
  }));
32
34
  });
@@ -25,13 +25,13 @@
25
25
  <dd><a ng-href="ngdetails/OS::Magnum::ClusterTemplate/{$ item.cluster_template_id $}">{$ item.cluster_template_id $}</a></dd>
26
26
  </dl>
27
27
  <dl class="col-md-6">
28
- <dt translate>API Address</dt>
28
+ <dt translate>Kubernetes API Address</dt>
29
29
  <dd>{$ item.api_address $}</dd>
30
30
  </dl>
31
31
  </div>
32
32
  <div class="row">
33
33
  <dl class="col-md-6">
34
- <dt translate>Master Addresses</dt>
34
+ <dt translate>Control Plane Addresses</dt>
35
35
  <dd ng-if="drawerCtrl.objLen(item.master_addresses) === 0" translate>None</dd>
36
36
  <dd ng-repeat="addr in item.master_addresses">{$ addr $}</dd>
37
37
  </dl>
@@ -41,4 +41,14 @@
41
41
  <dd ng-repeat="addr in item.node_addresses">{$ addr $}</dd>
42
42
  </dl>
43
43
  </div>
44
+ <div class="row">
45
+ <dl class="col-md-6">
46
+ <dt translate>Health Status Reason</dt>
47
+ <pre>{$ item.health_status_reason | json $}</pre>
48
+ </dl>
49
+ <dl class="col-md-6">
50
+ <dt translate>Status Reason</dt>
51
+ <dd>{$ item.status_reason $}</dd>
52
+ </dl>
53
+ </div>
44
54
  </div>
@@ -45,7 +45,7 @@
45
45
 
46
46
  function objLen(obj) {
47
47
  var length = 0;
48
- if (typeof obj === 'object') {
48
+ if (obj && typeof obj === 'object') {
49
49
  length = Object.keys(obj).length;
50
50
  }
51
51
  return length;
@@ -42,7 +42,9 @@
42
42
  }));
43
43
 
44
44
  it('objLen returns number of attributes of object', inject(function() {
45
- expect(ctrl.objLen(undefined)).toBe(0);
45
+ expect(ctrl.objLen()).toBe(0);
46
+ expect(ctrl.objLen(null)).toBe(0);
47
+ expect(ctrl.objLen({})).toBe(0);
46
48
  expect(ctrl.objLen({a: 0})).toBe(1);
47
49
  }));
48
50
  });
@@ -1,5 +1,5 @@
1
1
  <h1 class="h4" translate>Additional Labels</h1>
2
2
 
3
- <p translate>Specify additional kube_labels to apply to the cluster or override labels set by the cluster template. Overriding labels set by the cluster template may result in your cluster being misconfigured, unstable or unable to be created.</p>
3
+ <p translate>Specify additional labels to apply to the cluster or override labels set by the cluster template. Overriding labels set by the cluster template may result in your cluster being misconfigured, unstable or unable to be created.</p>
4
4
 
5
- <p translate>The key=value pair string is case insensitive and will be converted to lower case.</p>
5
+ <p translate>The key=value pair string is case insensitive and will be converted to lower case.</p>
@@ -142,7 +142,7 @@
142
142
  templateResponse.flavor_id = 'ABC';
143
143
 
144
144
  var model = $scope.model;
145
- model.cluster_template_id = '99'; // Triggers bussines logic revalidation
145
+ model.cluster_template_id = '99'; // Triggers business logic revalidation
146
146
  $scope.$apply();
147
147
 
148
148
  expect(model.keypair).toBe(1);
@@ -168,7 +168,7 @@
168
168
  templateResponse.node_count = 1;
169
169
  templateResponse.flavor_id = 'ABC';
170
170
 
171
- model.cluster_template_id = '99'; // Triggers bussines logic revalidation
171
+ model.cluster_template_id = '99'; // Triggers business logic revalidation
172
172
  $scope.$apply();
173
173
 
174
174
  expect(model.keypair).toBe(99);
@@ -182,12 +182,12 @@
182
182
  'response contains negative `master_lb_enabled` flag', function() {
183
183
  $scope.model.master_count = 99;
184
184
  templateResponse.master_lb_enabled = false;
185
- $scope.model.cluster_template_id = '99'; // Triggers bussines logic revalidation
185
+ $scope.model.cluster_template_id = '99'; // Triggers business logic revalidation
186
186
  $scope.$apply();
187
187
  expect($scope.model.master_count).toBe(1);
188
188
 
189
189
  $scope.model.master_count = MODEL_DEFAULTS.master_count;
190
- $scope.model.cluster_template_id = '999'; // Triggers bussines logic revalidation
190
+ $scope.model.cluster_template_id = '999'; // Triggers business logic revalidation
191
191
  $scope.$apply();
192
192
  expect($scope.model.master_count).toBe(1);
193
193
  });
@@ -196,7 +196,7 @@
196
196
  'template response', function() {
197
197
  templateResponse.labels = null;
198
198
  $scope.model.labels = MODEL_DEFAULTS.labels;
199
- $scope.model.cluster_template_id = '99'; // Triggers bussines logic revalidation
199
+ $scope.model.cluster_template_id = '99'; // Triggers business logic revalidation
200
200
  $scope.$apply();
201
201
 
202
202
  expect($scope.model.labels).toEqual(MODEL_DEFAULTS.labels);
@@ -229,13 +229,13 @@
229
229
 
230
230
  it('should not fail if the cluster template response is empty', function() {
231
231
  templateResponse = {};
232
- $scope.model.cluster_template_id = '99'; // Triggers bussines logic revalidation
232
+ $scope.model.cluster_template_id = '99'; // Triggers business logic revalidation
233
233
  $scope.$apply();
234
234
  });
235
235
 
236
236
  it('should not fail if the cluster template\'s labels are empty', function() {
237
237
  templateResponse = {labels:{}};
238
- $scope.model.cluster_template_id = '99'; // Triggers bussines logic revalidation
238
+ $scope.model.cluster_template_id = '99'; // Triggers business logic revalidation
239
239
  $scope.$apply();
240
240
  });
241
241
 
@@ -250,7 +250,7 @@
250
250
 
251
251
  templateResponse.labels.ingress_controller = 'c2';
252
252
 
253
- $scope.model.cluster_template_id = '99'; // Triggers bussines logic revalidation
253
+ $scope.model.cluster_template_id = '99'; // Triggers business logic revalidation
254
254
  $scope.$apply();
255
255
 
256
256
  expect($scope.model.ingress_controller.labels.ingress_controller).toBe('c2');
@@ -1,6 +1,11 @@
1
+ <h1 class="h4" translate>Control Plane size</h1>
2
+
3
+ <p translate>Only uneven number of control plane nodes are supported. This provides the best balance of fault tolerance and cost for etcd.</p>
4
+
5
+
1
6
  <h1 class="h4" translate>Auto Scaling</h1>
2
7
 
3
8
  <p translate>If enabled, the minimum and maximum number of worker nodes must be specified.</p>
4
9
  <p translate>Auto scaling requires the use of CPU and memory limits on the resource definition of Pods.</p>
5
- <p translate>If Kubernetes is unable to schedule a Pod due to insuficient CPU or memory in the cluster, a worker node will be added, as long as the maximum number of worker nodes has not been reached.</p>
10
+ <p translate>If Kubernetes is unable to schedule a Pod due to insufficient CPU or memory in the cluster, a worker node will be added, as long as the maximum number of worker nodes has not been reached.</p>
6
11
  <p translate>If the aggregate resource limits of all existing Pods is lower than 50% of the cluster capacity, a worker node will be removed, as long as the minimum number of worker nodes has not been reached.</p>
@@ -44,6 +44,9 @@
44
44
  // comma-separated key=value with optional space after comma
45
45
  var REGEXP_KEY_VALUE = /^(\w+=[^,]+,?\s?)+$/;
46
46
 
47
+ // Object name, must start with alphabetical character.
48
+ var REGEXP_CLUSTER_NAME = /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/;
49
+
47
50
  function ClusterWorkflow($q, basePath, gettext, magnum, neutron, nova) {
48
51
  var workflow = {
49
52
  init: init
@@ -59,9 +62,9 @@
59
62
  name: gettext('Choose an Availability Zone')}];
60
63
  var keypairsTitleMap = [{value: '', name: gettext('Choose a Keypair')}];
61
64
  var masterFlavorTitleMap = [{value: '',
62
- name: gettext('Choose a Flavor for the Master Node')}];
65
+ name: gettext('Choose a Flavor for the Control Plane nodes')}];
63
66
  var workerFlavorTitleMap = [{value: '',
64
- name: gettext('Choose a Flavor for the Worker Node')}];
67
+ name: gettext('Choose a Flavor for the Worker nodes')}];
65
68
  var networkTitleMap = [{value: '', name: gettext('Choose an existing network')}];
66
69
  var subnetTitleMap = [{value: '', name: fixedSubnetsInitial}];
67
70
  var ingressTitleMap = [{value: '', name: gettext('Choose an ingress controller')}];
@@ -86,7 +89,8 @@
86
89
 
87
90
  'master_count': {
88
91
  type: 'number',
89
- minimum: 1
92
+ minimum: 1,
93
+ maximum: 7,
90
94
  },
91
95
  'master_flavor_id': { type: 'string' },
92
96
  'node_count': {
@@ -101,7 +105,7 @@
101
105
  },
102
106
  'max_node_count': { type: 'number' },
103
107
 
104
- 'master_lb_enabled': {type: 'boolean'},
108
+ 'master_lb_enabled': { type: 'boolean' },
105
109
  'create_network': { type: 'boolean' },
106
110
  'fixed_network': { type: 'string' },
107
111
  'fixed_subnet': { type: 'string' },
@@ -117,9 +121,17 @@
117
121
 
118
122
  var formMasterCount = {
119
123
  key: 'master_count',
120
- title: gettext('Number of Master Nodes'),
121
- placeholder: gettext('The number of master nodes for the cluster'),
122
- required: true
124
+ title: gettext('Number of Control Plane nodes'),
125
+ placeholder: gettext('The number of Control Plane nodes for the cluster'),
126
+ required: true,
127
+ validationMessage: {
128
+ 'mustBeUnevenNumber': 'Supported control plane sizes are 1, 3, 5 or 7.'
129
+ },
130
+ $validators: {
131
+ mustBeUnevenNumber: function(value) {
132
+ return value % 2 !== 0;
133
+ }
134
+ }
123
135
  };
124
136
 
125
137
  // Disable the Master Count field, if only a single master is allowed
@@ -151,7 +163,18 @@
151
163
  key: 'name',
152
164
  title: gettext('Cluster Name'),
153
165
  placeholder: gettext('Name of the cluster'),
154
- required: true
166
+ required: true,
167
+ help: "Text",
168
+ validationMessage: {
169
+ 'invalidFormat': 'Cluster name must begin with an alphabetical ' +
170
+ 'character and only contain alphanumeric, underscore, ' +
171
+ 'dash and fullstop characters.'
172
+ },
173
+ $validators: {
174
+ invalidFormat: function(value) {
175
+ return REGEXP_CLUSTER_NAME.test(value);
176
+ }
177
+ }
155
178
  },
156
179
  {
157
180
  key: 'cluster_template_id',
@@ -203,7 +226,7 @@
203
226
  items: [
204
227
  {
205
228
  type: 'fieldset',
206
- title: gettext('Master Nodes'),
229
+ title: gettext('Control Plane Nodes'),
207
230
  items: [
208
231
  formMasterCount,
209
232
  // Info message explaining why only single master node is enabled
@@ -211,14 +234,27 @@
211
234
  type: 'template',
212
235
  template: '<div class="alert alert-info">' +
213
236
  '<span class="fa fa-info-circle"></span> ' +
214
- gettext('The selected Cluster Template does not support ' +
215
- 'multiple master nodes.') +
237
+ gettext('The selected options do not support ' +
238
+ 'multiple control plane nodes. A Kubernetes ' +
239
+ 'API Load Balancer is required, and can be ' +
240
+ 'enabled in the Network tab.') +
216
241
  '</div>',
217
242
  condition: 'model.isSingleMasterNode == true'
218
243
  },
244
+ // Info message explaining why we allow only uneven numbers of
245
+ // control plane nodes.
246
+ {
247
+ type: 'template',
248
+ template: '<div class="alert alert-info">' +
249
+ '<span class="fa fa-info-circle"></span> ' +
250
+ gettext('Only an uneven number of control plane nodes are allowed. ' +
251
+ 'This provides the best balance of fault tolerance and cost.') +
252
+ '</div>',
253
+ condition: 'false'
254
+ },
219
255
  {
220
256
  key: 'master_flavor_id',
221
- title: gettext('Flavor of Master Nodes'),
257
+ title: gettext('Flavor of Control Plane Nodes'),
222
258
  type: 'select',
223
259
  titleMap: masterFlavorTitleMap,
224
260
  required: true
@@ -304,7 +340,6 @@
304
340
  }
305
341
  ]
306
342
  }
307
-
308
343
  ]
309
344
  }
310
345
  ]
@@ -314,7 +349,7 @@
314
349
  help: basePath + 'clusters/workflow/network.help.html',
315
350
  type: 'section',
316
351
  htmlClass: 'row',
317
- required: true,
352
+ required: false,
318
353
  items: [
319
354
  {
320
355
  type: 'section',
@@ -333,10 +368,11 @@
333
368
  key: 'create_network',
334
369
  title: gettext('Create New Network'),
335
370
  onChange: function(isNewNetwork) {
336
- if (isNewNetwork) {
337
- model.fixed_network = MODEL_DEFAULTS.fixed_network;
338
- model.fixed_subnet = MODEL_DEFAULTS.fixed_subnet;
339
- }
371
+ // Reset relevant field selections
372
+ model.fixed_network = MODEL_DEFAULTS.fixed_network;
373
+ model.fixed_subnet = MODEL_DEFAULTS.fixed_subnet;
374
+ // Network tab has required fields based on this checkbox.
375
+ form[0].tabs[2].required = !isNewNetwork;
340
376
  }
341
377
  },
342
378
  {
@@ -598,7 +634,7 @@
598
634
 
599
635
  function changeFixedNetwork(model) {
600
636
  if (model.fixed_network) {
601
- subnetTitleMap = [{value:"", name: gettext("Choose an existing Subnet")}];
637
+ subnetTitleMap = [{value: "", name: gettext("Choose an existing Subnet")}];
602
638
  angular.forEach(networkTitleMap, function(network) {
603
639
  if (network.value === model.fixed_network) {
604
640
  angular.forEach(network.subnets, function(subnet) {
@@ -607,10 +643,11 @@
607
643
  }
608
644
  });
609
645
  } else {
610
- fixedSubnets = [{value:"", name: fixedSubnetsInitial}];
611
- model.fixed_subnet = "";
646
+ fixedSubnets = [{value: "", name: fixedSubnetsInitial}];
612
647
  }
648
+ // NOTE(dalees): This hardcoded index could be improved by referencing an object instead.
613
649
  form[0].tabs[2].items[0].items[0].items[3].titleMap = subnetTitleMap;
650
+ model.fixed_subnet = MODEL_DEFAULTS.fixed_subnet;
614
651
  }
615
652
 
616
653
  function onGetIngressControllers(response) {
@@ -130,7 +130,7 @@
130
130
  });
131
131
  }
132
132
 
133
- // FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016.
133
+ // NOTE(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016.
134
134
  function deleteClusters(ids) {
135
135
  return apiService.delete('/api/container_infra/clusters/', ids)
136
136
  .catch(function onError() {
@@ -179,7 +179,7 @@
179
179
  });
180
180
  }
181
181
 
182
- // FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016.
182
+ // NOTE(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016.
183
183
  function deleteClusterTemplates(ids) {
184
184
  return apiService.delete('/api/container_infra/cluster_templates/', ids)
185
185
  .catch(function onError() {
@@ -32,9 +32,7 @@
32
32
  return list.filter(matchesId).length === 1;
33
33
 
34
34
  function matchesId(action) {
35
- if (action.id === value) {
36
- return true;
37
- }
35
+ return action.id === value;
38
36
  }
39
37
  }
40
38
  });
@@ -40,12 +40,14 @@
40
40
  * @name quotas.delete.service
41
41
  * @param {Object} $location
42
42
  * @param {Object} $q
43
+ * @param {Object} $rootScope
43
44
  * @param {Object} magnum
44
45
  * @param {Object} policy
45
46
  * @param {Object} actionResult
46
47
  * @param {Object} gettext
47
48
  * @param {Object} $qExtensions
48
49
  * @param {Object} deleteModal
50
+ * @param {Object} tableEvents
49
51
  * @param {Object} toast
50
52
  * @param {Object} resourceType
51
53
  * @param {Object} events
@@ -143,6 +145,7 @@
143
145
  if (result.result.failed.length === 0 && result.result.deleted.length > 0 &&
144
146
  currentPath !== indexPath) {
145
147
  $location.path(indexPath);
148
+ return null;
146
149
  } else {
147
150
  $rootScope.$broadcast(tableEvents.CLEAR_SELECTIONS);
148
151
  return result.result;
@@ -37,36 +37,39 @@
37
37
  var v1parts = v1.split('.');
38
38
  var v2parts = v2.split('.');
39
39
 
40
+ // Step 1: Validation
40
41
  function isValidPart(x) {
41
42
  return (lexicographical ? /^\d+[A-Za-z]*$/ : /^\d+$/).test(x);
42
43
  }
43
-
44
44
  if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {
45
45
  return NaN;
46
46
  }
47
47
 
48
- if (zeroExtend) {
49
- while (v1parts.length < v2parts.length) { v1parts.push("0"); }
50
- while (v2parts.length < v1parts.length) { v2parts.push("0"); }
51
- }
52
-
53
- if (!lexicographical) {
54
- v1parts = v1parts.map(Number);
55
- v2parts = v2parts.map(Number);
48
+ // Step 2: Normalise
49
+ function normaliseParts(parts) {
50
+ if (zeroExtend) {
51
+ while (parts.length < parts.length) { parts.push("0"); }
52
+ }
53
+ if (!lexicographical) {
54
+ parts = parts.map(Number);
55
+ }
56
+ return parts;
56
57
  }
58
+ v1parts = normaliseParts(v1parts);
59
+ v2parts = normaliseParts(v2parts);
57
60
 
61
+ // Step 3: Comparison
58
62
  for (var i = 0; i < v1parts.length; ++i) {
59
63
  if (v2parts.length === i) { return 1; }
60
64
 
61
65
  if (v1parts[i] === v2parts[i]) {
62
66
  continue;
63
- } else if (v1parts[i] > v2parts[i]) {
67
+ }
68
+ if (v1parts[i] > v2parts[i]) {
64
69
  return 1;
65
- } else {
66
- return -1;
67
70
  }
71
+ return -1;
68
72
  }
69
-
70
73
  if (v1parts.length !== v2parts.length) { return -1; }
71
74
 
72
75
  return 0;
@@ -10,6 +10,7 @@ Bradley Jones <jones.bradley@me.com>
10
10
  Cao Xuan Hoang <hoangcx@vn.fujitsu.com>
11
11
  Charles Short <zulcss@gmail.com>
12
12
  Corey Bryant <corey.bryant@canonical.com>
13
+ Dale Smith <dale@catalystcloud.nz>
13
14
  Doug Hellmann <doug@doughellmann.com>
14
15
  Erik Olof Gunnar Andersson <eandersson@blizzard.com>
15
16
  Feilong Wang <flwang@catalyst.net.nz>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magnum-ui
3
- Version: 14.0.0.0rc1
3
+ Version: 15.0.0.0rc1
4
4
  Summary: Magnum User Interface
5
5
  Home-page: https://docs.openstack.org/developer/magnum-ui/
6
6
  Author: OpenStack