From c5d0216939d704dcfadd9733767c9fee2488c3f9 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 23 Jun 2020 09:59:43 +0100 Subject: [PATCH] ui: Support for Node Identities (#8137) * Add all the new data required for NodeIdentities * Add potential NodeIdentity to the token list component * Amend the policy-form/selector to allow node identity creation * Fix up CSS for radio buttons and select label * Add node-identity policy template component * Fix up and add acceptance tests for NodeIndentities * Make sure policy previews take node identities into account * Only show certain policy markup if those we have those policies * Potentially temporarily hide dt's that don't have icons yet --- ui-v2/app/adapters/role.js | 2 + ui-v2/app/adapters/token.js | 2 + .../consul-intention-form/index.hbs | 8 +-- .../components/consul-token-list/index.hbs | 20 ++++-- ui-v2/app/components/node-identity/index.hbs | 6 ++ ui-v2/app/components/node-identity/index.js | 5 ++ ui-v2/app/components/policy-form/index.hbs | 43 ++++++++++--- ui-v2/app/components/policy-form/index.js | 6 +- .../app/components/policy-form/pageobject.js | 2 +- .../app/components/policy-selector/index.hbs | 43 ++++++++----- ui-v2/app/components/policy-selector/index.js | 2 +- ui-v2/app/mixins/policy/as-many.js | 63 ++++++++++++++----- ui-v2/app/models/role.js | 5 ++ ui-v2/app/models/token.js | 5 ++ .../base/components/radio-group/layout.scss | 1 - .../app/styles/components/composite-row.scss | 5 ++ .../app/styles/components/form-elements.scss | 1 + ui-v2/app/templates/dc/nspaces/-form.hbs | 2 +- .../policies/as-many/add-existing.feature | 1 + .../dc/acls/policies/as-many/add-new.feature | 39 +++++++++++- .../dc/acls/policies/as-many/list.feature | 8 +-- .../dc/acls/policies/as-many/remove.feature | 1 + .../acceptance/dc/acls/tokens/clone.feature | 1 + ui-v2/tests/helpers/normalizers.js | 35 +++++++---- ui-v2/yarn.lock | 6 +- 25 files changed, 237 insertions(+), 75 deletions(-) create mode 100644 ui-v2/app/components/node-identity/index.hbs create mode 100644 ui-v2/app/components/node-identity/index.js diff --git a/ui-v2/app/adapters/role.js b/ui-v2/app/adapters/role.js index 5b7a1f46e..210987a7d 100644 --- a/ui-v2/app/adapters/role.js +++ b/ui-v2/app/adapters/role.js @@ -50,6 +50,7 @@ export default Adapter.extend({ Description: serialized.Description, Policies: serialized.Policies, ServiceIdentities: serialized.ServiceIdentities, + NodeIdentities: serialized.NodeIdentities, ...Namespace(serialized.Namespace), }} `; @@ -66,6 +67,7 @@ export default Adapter.extend({ Description: serialized.Description, Policies: serialized.Policies, ServiceIdentities: serialized.ServiceIdentities, + NodeIdentities: serialized.NodeIdentities, ...Namespace(serialized.Namespace), }} `; diff --git a/ui-v2/app/adapters/token.js b/ui-v2/app/adapters/token.js index afed469db..b19349c95 100644 --- a/ui-v2/app/adapters/token.js +++ b/ui-v2/app/adapters/token.js @@ -53,6 +53,7 @@ export default Adapter.extend({ Policies: serialized.Policies, Roles: serialized.Roles, ServiceIdentities: serialized.ServiceIdentities, + NodeIdentities: serialized.NodeIdentities, Local: serialized.Local, ...Namespace(serialized.Namespace), }} @@ -84,6 +85,7 @@ export default Adapter.extend({ Policies: serialized.Policies, Roles: serialized.Roles, ServiceIdentities: serialized.ServiceIdentities, + NodeIdentities: serialized.NodeIdentities, Local: serialized.Local, ...Namespace(serialized.Namespace), }} diff --git a/ui-v2/app/components/consul-intention-form/index.hbs b/ui-v2/app/components/consul-intention-form/index.hbs index c6b38a9c0..cc2c5cc69 100644 --- a/ui-v2/app/components/consul-intention-form/index.hbs +++ b/ui-v2/app/components/consul-intention-form/index.hbs @@ -3,7 +3,7 @@

Source

-