feat: List accounts within a managed group

This commit is contained in:
Susmitha Girumala committed 2021-11-12 11:22:16 -05:00
1 parent ff5cc71f60
commit be5f033712
11 files changed
+207 -6

No files matched your search

+3 -1
View File
@@ -59,7 +59,9 @@ Router.map(function () {
this.route(
'managed-group',
{ path: ':managed_group_id' },
function () {}
function () {
this.route('accounts');
}
);
this.route('new');
});
@@ -0,0 +1,26 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsManagedGroupAccountsRoute extends Route {
// =services
@service resourceFilterStore;
// =methods
/**
* Returns the previously loaded managed group instances accounts.
* @return {Promise{[AccountModel]}}
*/
model() {
const { auth_method_id, member_ids } = this.modelFor(
'scopes.scope.auth-methods.auth-method.managed-groups.managed-group'
);
return this.resourceFilterStore.queryBy(
'account',
{ id: member_ids },
{ auth_method_id }
);
}
}
@@ -1,2 +1,2 @@
{{page-title 'ManagedGroup'}}
{{page-title @model.displayName}}
{{outlet}}
@@ -4,4 +4,9 @@
>
{{t 'titles.details'}}
</nav.link>
<nav.link
@route='scopes.scope.auth-methods.auth-method.managed-groups.managed-group.accounts'
>
{{t 'resources.account.title_plural'}}
</nav.link>
</Rose::Nav::Tabs>
@@ -0,0 +1,62 @@
{{page-title (t 'resources.account.title_plural')}}
{{#if @model}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.issuer.label'}}</row.headerCell>
<row.headerCell>{{t 'form.subject.label'}}</row.headerCell>
<row.headerCell>{{t 'form.email.label'}}</row.headerCell>
<row.headerCell>{{t 'form.full_name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model as |account|}}
<body.row as |row|>
<row.headerCell scope='row'>
{{account.accountName}}
<p>{{account.description}}</p>
</row.headerCell>
<row.cell>
<code>{{account.attributes.issuer}}</code>
</row.cell>
<row.cell>
<code>{{account.attributes.subject}}</code>
</row.cell>
<row.cell>
<code>{{account.attributes.email}}</code>
</row.cell>
<row.cell>
{{account.attributes.full_name}}
</row.cell>
<row.cell>
<Rose::Badge>{{account.type}}</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{account.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{account.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.managed-group.messages.accounts.title'}}
as |message|
>
<message.description>
{{t 'resources.managed-group.messages.accounts.description'}}
</message.description>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}