From 19c5f27434ff93585054f7bdf897602e35fa296b Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Mon, 17 May 2021 16:41:39 -0500 Subject: [PATCH] UI/fix identity model (#11641) --- changelog/11641.txt | 3 +++ ui/app/models/identity/group.js | 4 ++-- .../components/database-connection.hbs | 7 +++--- .../components/identity/item-details.hbs | 24 +++++++++---------- .../components/identity/item-groups.hbs | 14 ++++++----- .../components/identity/item-members.hbs | 23 +++++++++++------- .../components/identity/item-metadata.hbs | 14 +++++------ .../identity/item-parent-groups.hbs | 7 +++--- .../components/identity/item-policies.hbs | 7 +++--- .../vault/cluster/access/identity/show.hbs | 2 +- .../access/identity/_shared-tests.js | 16 ++++++++++--- .../pages/components/identity/edit-form.js | 2 ++ 12 files changed, 73 insertions(+), 50 deletions(-) create mode 100644 changelog/11641.txt diff --git a/changelog/11641.txt b/changelog/11641.txt new file mode 100644 index 000000000..84bd31188 --- /dev/null +++ b/changelog/11641.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix entity group membership and metadata not showing +``` diff --git a/ui/app/models/identity/group.js b/ui/app/models/identity/group.js index d51a96ef6..31a0b6932 100644 --- a/ui/app/models/identity/group.js +++ b/ui/app/models/identity/group.js @@ -64,8 +64,8 @@ export default IdentityModel.extend({ 'memberGroupIds.[]', function() { let { memberEntityIds, memberGroupIds } = this; - let numEntities = (memberEntityIds && memberEntityIds.get('length')) || 0; - let numGroups = (memberGroupIds && memberGroupIds.get('length')) || 0; + let numEntities = (memberEntityIds && memberEntityIds.length) || 0; + let numGroups = (memberGroupIds && memberGroupIds.length) || 0; return numEntities + numGroups > 0; } ), diff --git a/ui/app/templates/components/database-connection.hbs b/ui/app/templates/components/database-connection.hbs index 638464252..61a968316 100644 --- a/ui/app/templates/components/database-connection.hbs +++ b/ui/app/templates/components/database-connection.hbs @@ -87,7 +87,7 @@ {{form-field data-test-field attr=attr model=@model}} {{/if}} {{/each}} - + {{!-- Plugin Config Section --}}
@@ -148,7 +148,6 @@ /> {{else}} {{#each @model.statementFields as |attr|}} - {{log attr}} {{form-field data-test-field attr=attr model=@model}} {{/each}} {{/if}} @@ -295,11 +294,11 @@ {{#each @model.showAttrs as |attr|}} {{#let attr.options.defaultDisplay as |defaultDisplay|}} {{#if (eq attr.type "object")}} - {{else if (eq attr.type "array")}} - {{#if model.disabled}} + {{#if @model.disabled}} - {{#if model.canEdit}} - {{/if}} {{/if}} - - - - + + + +
- {{#each model.mergedEntityIds as |id|}} + {{#each @model.mergedEntityIds as |id|}}
{{id}}
{{/each}}
- -
- {{#if model.canEdit}} - + {{#if @model.canEdit}} + {{/if}}
{{/linked-block}} {{/each}} - {{#each model.memberEntityIds as |gid|}} + {{#each @model.memberEntityIds as |gid|}} {{#linked-block "vault.cluster.access.identity.show" "groups" @@ -32,14 +32,19 @@ }}
- + {{gid}} + />{{gid}} +
- {{#if model.canEdit}} - + {{#if @model.canEdit}} + {{/if}}
diff --git a/ui/app/templates/components/identity/item-metadata.hbs b/ui/app/templates/components/identity/item-metadata.hbs index 91873d83d..495b8fc8b 100644 --- a/ui/app/templates/components/identity/item-metadata.hbs +++ b/ui/app/templates/components/identity/item-metadata.hbs @@ -1,4 +1,4 @@ -{{#each-in model.metadata as |key value|}} +{{#each-in @model.metadata as |key value|}}
@@ -10,19 +10,19 @@ {{value}}
- {{#if model.canEdit}} - + {{#if @model.canEdit}} + {{/if}}
{{else}} - - Edit {{lowercase (humanize model.identityType)}} + + Edit {{lowercase (humanize @model.identityType)}} Learn more diff --git a/ui/app/templates/components/identity/item-parent-groups.hbs b/ui/app/templates/components/identity/item-parent-groups.hbs index c0031c7c4..fabc4879e 100644 --- a/ui/app/templates/components/identity/item-parent-groups.hbs +++ b/ui/app/templates/components/identity/item-parent-groups.hbs @@ -1,5 +1,5 @@ -{{#if model.parentGroupIds.length}} - {{#each model.parentGroupIds as |gid|}} +{{#if @model.parentGroupIds.length}} + {{#each @model.parentGroupIds as |gid|}} {{#linked-block "vault.cluster.access.identity.show" "groups" @@ -9,7 +9,8 @@ }}
- + {{gid}} diff --git a/ui/app/templates/components/identity/item-policies.hbs b/ui/app/templates/components/identity/item-policies.hbs index 5d675588e..cab6df2a6 100644 --- a/ui/app/templates/components/identity/item-policies.hbs +++ b/ui/app/templates/components/identity/item-policies.hbs @@ -7,12 +7,13 @@ }}
- {{policyName}} + + {{policyName}}
- {{#if model.canEdit}} - + {{#if @model.canEdit}} + {{/if}}
diff --git a/ui/app/templates/vault/cluster/access/identity/show.hbs b/ui/app/templates/vault/cluster/access/identity/show.hbs index df09bf417..9aa7a244a 100644 --- a/ui/app/templates/vault/cluster/access/identity/show.hbs +++ b/ui/app/templates/vault/cluster/access/identity/show.hbs @@ -21,7 +21,7 @@