From 1ff8678df7c26b9c6cf24fc11ad89e5fd99351f2 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 28 Jan 2020 09:39:09 +0000 Subject: [PATCH] ui: Remove the Policy/Service Identity selector from nspaces (#7124) When editing Nspaces, although you can assign policies to a nspace using PolicyDefaults you cannot assign a Service Identity to a policy like you can when adding a policy to a token. This commit adds an extra attribute to our policy-form/policy-selector component so you can disable this setting. At a later date we may change this to have a conficgurable `` instead. Simple acceptance tests is included here --- ui-v2/app/components/policy-form.js | 1 + ui-v2/app/components/policy-selector.js | 1 + .../app/templates/components/policy-form.hbs | 8 ++++++-- .../templates/components/policy-selector.hbs | 2 +- ui-v2/app/templates/dc/nspaces/-form.hbs | 2 +- .../dc/acls/policies/as-many/nspaces.feature | 19 +++++++++++++++++++ .../dc/acls/policies/as-many/nspaces-steps.js | 10 ++++++++++ ui-v2/tests/pages.js | 4 +++- ui-v2/tests/pages/dc/nspaces/edit.js | 11 ++++++++++- ui-v2/tests/steps/assertions/dom.js | 3 +++ 10 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 ui-v2/tests/acceptance/dc/acls/policies/as-many/nspaces.feature create mode 100644 ui-v2/tests/acceptance/steps/dc/acls/policies/as-many/nspaces-steps.js diff --git a/ui-v2/app/components/policy-form.js b/ui-v2/app/components/policy-form.js index 0fd9e76bfa..cbd7cd13af 100644 --- a/ui-v2/app/components/policy-form.js +++ b/ui-v2/app/components/policy-form.js @@ -7,6 +7,7 @@ export default FormComponent.extend({ datacenterRepo: service('repository/dc/component'), type: 'policy', name: 'policy', + allowServiceIdentity: true, classNames: ['policy-form'], isScoped: false, diff --git a/ui-v2/app/components/policy-selector.js b/ui-v2/app/components/policy-selector.js index 6fd42ea413..a36115af04 100644 --- a/ui-v2/app/components/policy-selector.js +++ b/ui-v2/app/components/policy-selector.js @@ -12,6 +12,7 @@ export default ChildSelectorComponent.extend({ datacenterRepo: service('repository/dc/component'), name: 'policy', type: 'policy', + allowServiceIdentity: true, classNames: ['policy-selector'], init: function() { this._super(...arguments); diff --git a/ui-v2/app/templates/components/policy-form.hbs b/ui-v2/app/templates/components/policy-form.hbs index 6ae0e8521a..fb9f8a46c0 100644 --- a/ui-v2/app/templates/components/policy-form.hbs +++ b/ui-v2/app/templates/components/policy-form.hbs @@ -3,8 +3,9 @@ {{#yield-slot name='template'}} {{else}}
- Policy or service identity? + Policy{{if allowServiceIdentity ' or service identity?' ''}}
+ {{#if allowServiceIdentity}}

A Service Identity is default policy with a configurable service name. This saves you some time and effort you're using Consul for Connect features.

@@ -13,10 +14,13 @@ {{#each templates as |template|}} {{/each}} + {{else}} + + {{/if}} {{/yield-slot}}