From 6ad18cb2906bed93f240b0eb07d5c1b7234f7e24 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 29 Sep 2020 17:29:37 -0400 Subject: [PATCH] refactor: Refactor resource id display --- ui/core/app/routes/scopes/scope/roles/role/principals.js | 7 +++++-- .../scopes/scope/auth-methods/auth-method/-header.hbs | 2 +- .../auth-methods/auth-method/accounts/account/-header.hbs | 2 +- .../auth-method/accounts/account/set-password/-header.hbs | 2 +- .../app/templates/scopes/scope/groups/group/-header.hbs | 2 +- .../project/host-catalogs/host-catalog/-header.hbs | 2 +- .../host-catalogs/host-catalog/host-sets/-header.hbs | 4 ++-- .../project/host-catalogs/host-catalog/hosts/-header.hbs | 4 ++-- .../app/templates/scopes/scope/projects/project/index.hbs | 2 +- .../scope/projects/project/targets/target/-header.hbs | 2 +- ui/core/app/templates/scopes/scope/roles/role/-header.hbs | 2 +- .../templates/scopes/scope/roles/role/grants/-header.hbs | 2 +- .../app/templates/scopes/scope/roles/role/principals.hbs | 4 ++-- .../scopes/scope/roles/role/principals/-header.hbs | 1 + ui/core/app/templates/scopes/scope/users/user/index.hbs | 2 +- 15 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ui/core/app/routes/scopes/scope/roles/role/principals.js b/ui/core/app/routes/scopes/scope/roles/role/principals.js index 00cc77303..045d568ce 100644 --- a/ui/core/app/routes/scopes/scope/roles/role/principals.js +++ b/ui/core/app/routes/scopes/scope/roles/role/principals.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; -import { all } from 'rsvp'; +import { all, hash } from 'rsvp'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; @@ -37,7 +37,10 @@ export default class ScopesScopeRolesRolePrincipalsRoute extends Route { model, })) ); - return all(users.concat(groups)); + return hash({ + role, + principals: all(users.concat(groups)), + }); } /** diff --git a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/-header.hbs b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/-header.hbs index d3f7ee8ba..7618aaff5 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/-header.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.auth-method.title"}}

-

{{@model.id}}

{{t "resources.auth-method.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-header.hbs b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-header.hbs index 938c5fedb..98de0eab5 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-header.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-header.hbs @@ -1,2 +1,2 @@

{{t "resources.account.title"}}

-

{{@model.id}}

\ No newline at end of file +

{{t "form.id.label"}}: {{@model.id}}

\ No newline at end of file diff --git a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password/-header.hbs b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password/-header.hbs index 8c94ca2c2..0651ff64c 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password/-header.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.account.title"}}

-

{{@model.id}}

{{t 'resources.account.messages.set-password.description'}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/groups/group/-header.hbs b/ui/core/app/templates/scopes/scope/groups/group/-header.hbs index 0e9e354c8..5a3d39553 100644 --- a/ui/core/app/templates/scopes/scope/groups/group/-header.hbs +++ b/ui/core/app/templates/scopes/scope/groups/group/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.group.title"}}

-

{{@model.id}}

{{t "resources.group.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs index 463da7457..da79077b0 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.host-catalog.title"}}

-

{{@model.id}}

{{t "resources.host-catalog.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs index 5baa8f616..cf4a925a3 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.host-set.title"}}

-

{{@model.id}}

-

{{t "resources.host-set.description"}}

\ No newline at end of file +

{{t "resources.host-set.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-header.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-header.hbs index 3253d7438..bfa8185aa 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-header.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.host.title"}}

-

{{@model.id}}

-

{{t "resources.host.description"}}

\ No newline at end of file +

{{t "resources.host.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/projects/project/index.hbs b/ui/core/app/templates/scopes/scope/projects/project/index.hbs index ecba6928c..f236cc5a2 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/index.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/index.hbs @@ -6,8 +6,8 @@

{{t "resources.project.title"}}

-

{{@model.id}}

{{t "resources.project.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/projects/project/targets/target/-header.hbs b/ui/core/app/templates/scopes/scope/projects/project/targets/target/-header.hbs index 21494f319..77509c545 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/targets/target/-header.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/targets/target/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.target.title"}}

-

{{@model.id}}

{{t "resources.target.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/roles/role/-header.hbs b/ui/core/app/templates/scopes/scope/roles/role/-header.hbs index 9322cedb0..0a52fdd62 100644 --- a/ui/core/app/templates/scopes/scope/roles/role/-header.hbs +++ b/ui/core/app/templates/scopes/scope/roles/role/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.role.title"}}

-

{{@model.id}}

{{t "resources.role.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/roles/role/grants/-header.hbs b/ui/core/app/templates/scopes/scope/roles/role/grants/-header.hbs index bc14001f0..c1ac11438 100644 --- a/ui/core/app/templates/scopes/scope/roles/role/grants/-header.hbs +++ b/ui/core/app/templates/scopes/scope/roles/role/grants/-header.hbs @@ -1,3 +1,3 @@

{{t "resources.role.title"}}

-

{{@model.id}}

{{t "resources.role.grant.description"}}

+

{{t "form.id.label"}}: {{@model.id}}

diff --git a/ui/core/app/templates/scopes/scope/roles/role/principals.hbs b/ui/core/app/templates/scopes/scope/roles/role/principals.hbs index 5d6b375fd..73ac90715 100644 --- a/ui/core/app/templates/scopes/scope/roles/role/principals.hbs +++ b/ui/core/app/templates/scopes/scope/roles/role/principals.hbs @@ -1,6 +1,6 @@ {{title (t 'resources.role.principal.title_plural')}} -{{#if @model}} +{{#if @model.principals}} @@ -12,7 +12,7 @@ - {{#each @model as |principal|}} + {{#each @model.principals as |principal|}} {{principal.model.displayName}} diff --git a/ui/core/app/templates/scopes/scope/roles/role/principals/-header.hbs b/ui/core/app/templates/scopes/scope/roles/role/principals/-header.hbs index 9d7156902..0bab051be 100644 --- a/ui/core/app/templates/scopes/scope/roles/role/principals/-header.hbs +++ b/ui/core/app/templates/scopes/scope/roles/role/principals/-header.hbs @@ -1,2 +1,3 @@

{{t "resources.role.title"}}

{{t "resources.role.principal.description"}}

+

{{t "form.id.label"}}: {{@model.role.id}}

diff --git a/ui/core/app/templates/scopes/scope/users/user/index.hbs b/ui/core/app/templates/scopes/scope/users/user/index.hbs index 32471c077..2f3bc1652 100644 --- a/ui/core/app/templates/scopes/scope/users/user/index.hbs +++ b/ui/core/app/templates/scopes/scope/users/user/index.hbs @@ -6,8 +6,8 @@

{{t "resources.user.title"}}

-

{{@model.id}}

{{t "resources.user.description"}}

+

{{t "form.id.label"}}: {{@model.id}}