diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js index 736f3e65..ad219f54 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js @@ -39,6 +39,7 @@ function ListenerDetailsController($scope, gettext) { var ctrl = this; ctrl.protocolChange = protocolChange; + ctrl.createChange = createChange; // Error text for invalid fields ctrl.portNumberError = gettext('The port must be a number between 1 and 65535.'); @@ -71,6 +72,14 @@ } } + function createChange() { + if ($scope.model.context.create_listener === false) { + // Disabling listener form disables pool form and monitor form + $scope.model.context.create_pool = false; + $scope.model.context.create_monitor = false; + } + } + function listenerPortExists(port) { return $scope.model.listenerPorts.some(function(element) { return element === port; diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.spec.js index eb9fb62b..aca2d4ab 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.spec.js @@ -36,6 +36,11 @@ }; scope = { model: { + context: { + create_listener: true, + create_pool: true, + create_monitor: true + }, listenerPorts: [80], members: [{port: ''}, {port: ''}], spec: { @@ -118,6 +123,18 @@ }); }); + it('should update create_pool and create_monitor flags', function() { + scope.model.context.create_listener = true; + ctrl.createChange(); + expect(scope.model.context.create_pool).toBe(true); + expect(scope.model.context.create_monitor).toBe(true); + + scope.model.context.create_listener = false; + ctrl.createChange(); + expect(scope.model.context.create_pool).toBe(false); + expect(scope.model.context.create_monitor).toBe(false); + }); + }); }); })(); diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html index bae57227..37de5ef3 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html @@ -1,250 +1,17 @@

Provide the details for the listener.

-
+
- - -
-
- -
-
- - -
-
- -
- -
- -
-
- - -
-
- -
-
- - - - {$ ::ctrl.portNumberError $} - - - {$ ::ctrl.portUniqueError $} - -
-
- -
- -
- -
-
- - - - {$ ::ctrl.timeoutError $} - -
-
- -
-
- - - - {$ ::ctrl.timeoutError $} - -
-
- -
- -
- -
-
- - - - {$ ::ctrl.timeoutError $} - -
-
- -
-
- - - - {$ ::ctrl.timeoutError $} - -
-
- -
- -
- -
-
- - - - {$ ::ctrl.connectionLimitError $} - -
-
- -
-
- - -
-
- -
-
- - - -
-
-
- -
- -
-
- - - - {$ ::ctrl.tls_ciphersError $} - -
-
- -
- -

Insert Headers

- -
- -
-
-
- - -
-
-
- -
-
-
- - -
-
-
- -
-
-
- - -
-
-
- -
- -
- -
-
- +
@@ -253,4 +20,258 @@
+
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ +
+ +
+
+ + +
+
+ +
+
+ + + + {$ ::ctrl.portNumberError $} + + + {$ ::ctrl.portUniqueError $} + +
+
+ +
+ +
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+ +
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+ +
+ +
+
+ + + + {$ ::ctrl.connectionLimitError $} + +
+
+ +
+
+ + +
+
+ +
+
+ + + +
+
+
+ +
+ +
+
+ + + + {$ ::ctrl.tls_ciphersError $} + +
+
+ +
+ +

Insert Headers

+ +
+ +
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.html b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.html index 1f74f8ce..cb28a7f3 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.html +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.html @@ -1,4 +1,5 @@ -
+

Add members to the load balancer pool.

Provide the details for the health monitor.

-
- -
-
- - -
-
- -
-
- - -
-
- -
-
- - - - {$ ::ctrl.retryDownError $} - -
-
- -
- -
- -
-
- - - - {$ ::ctrl.intervalError $} - -
-
- -
-
- - - - {$ ::ctrl.retryError $} - -
-
- -
-
- - - - {$ ::ctrl.timeoutError $} - -
-
- -
- -
- -
-
- - -
-
- -
-
- - - - {$ ::ctrl.statusError $} - -
-
- -
-
- - - - {$ ::ctrl.pathError $} - -
-
- -
- -
+
- +
@@ -153,4 +20,158 @@
+
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + + + {$ ::ctrl.retryDownError $} + +
+
+ +
+ +
+ +
+
+ + + + {$ ::ctrl.intervalError $} + +
+
+ +
+
+ + + + {$ ::ctrl.retryError $} + +
+
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+ +
+ +
+
+ + +
+
+ +
+
+ + + + {$ ::ctrl.statusError $} + +
+
+ +
+
+ + + + {$ ::ctrl.pathError $} + +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.js index d57867f9..e1753e5a 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.js @@ -38,6 +38,17 @@ function PoolDetailsController($scope, gettext) { var ctrl = this; + ctrl.createChange = createChange; + + function createChange() { + if ($scope.model.context.create_pool) { + // Enabling pool form enables listener form + $scope.model.context.create_listener = true; + } else { + // Disabling pool form disables monitor form + $scope.model.context.create_monitor = false; + } + } // Error text for invalid fields ctrl.tls_ciphersError = gettext('The cipher string must conform to OpenSSL syntax.'); diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.spec.js index a96b975d..33fac221 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.controller.spec.js @@ -24,8 +24,16 @@ describe('PoolDetailsController', function() { var ctrl, scope; - beforeEach(inject(function($controller, $rootScope) { - scope = $rootScope.$new(); + beforeEach(inject(function($controller) { + scope = { + model: { + context: { + create_listener: true, + create_pool: true, + create_monitor: true + } + } + }; ctrl = $controller('PoolDetailsController', { $scope: scope }); @@ -35,6 +43,18 @@ expect(ctrl.tls_ciphersError).toBeDefined(); }); + it('should update create_listener and create_monitor flags', function() { + scope.model.context.create_pool = true; + ctrl.createChange(); + expect(scope.model.context.create_listener).toBe(true); + expect(scope.model.context.create_monitor).toBe(true); + + scope.model.context.create_pool = false; + ctrl.createChange(); + expect(scope.model.context.create_listener).toBe(true); + expect(scope.model.context.create_monitor).toBe(false); + }); + }); }); })(); diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.html b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.html index cc855dc1..bb4bc808 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.html +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/pool/pool.html @@ -1,99 +1,17 @@

Provide the details for the pool.

-
+
- - -
-
- -
-
- - -
-
- -
- -
- -
-
- - -
-
- -
-
- - -
-
- -
- -
- -
-
- - -
-
- -
-
- - -
-
- -
- -
- -
-
- +
@@ -102,39 +20,141 @@
-
+
+
-
-
- - - - {$ ::ctrl.tls_ciphersError $} - +
+
+ + +
+ +
+
+ + +
+
+
-
+
-
+
+
+ + +
+
-
-
- -
-
- +
+
+ + +
+
+ +
+ +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
-
+
+
+
+ + + + {$ ::ctrl.tls_ciphersError $} + +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+
diff --git a/releasenotes/notes/allows-creation-of-single-resources-9ec5fe87acc7c93c.yaml b/releasenotes/notes/allows-creation-of-single-resources-9ec5fe87acc7c93c.yaml new file mode 100644 index 00000000..ea9644ee --- /dev/null +++ b/releasenotes/notes/allows-creation-of-single-resources-9ec5fe87acc7c93c.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Allows the creation of single resources (i.e Load Balancer) without + enforcing the creation of children resources (Listeners, Pools, Health + monitors). A switch has been added in the children resource wizards to + avoid resource creation.