Merge branch 'main' into fix-jest-unmet-peer-dependency

This commit is contained in:
Randall Morey authored and GitHub committed 2022-01-20 11:45:27 -05:00
commit f2934472c8
48 files changed
+760 -716

No files matched your search

+2
View File
@@ -61,6 +61,8 @@ export default class AuthMethodModel extends GeneratedAuthMethodModel {
*/
@equal('is_primary', true) isPrimary;
options = options;
/**
* @type {boolean}
*/
+3 -2
View File
@@ -536,9 +536,10 @@ export default function () {
return managedGroups.where({ authMethodId });
}
);
this.get('/managed-groups/:id');
this.del('/managed-groups/:id');
this.post('/managed-groups');
this.get('/managed-groups/:id');
this.patch('/managed-groups/:id');
this.del('/managed-groups/:id');
/* Uncomment the following line and the Response import above
* Then change the response code to simulate error responses.
@@ -22,7 +22,11 @@
{{/if}}
{{@label}}
{{#if @helperText}}
<Rose::Form::HelperText @id="helper-text-{{this.id}}" @error={{@error}} @link={{@link}} @linkText={{@linkText}}>
{{@helperText}}
</Rose::Form::HelperText>
{{/if}}
</label>
{{yield}}
@@ -29,12 +29,14 @@ Renders a form radiofield.
@selectedValue={{selectedValue}}
@disabled={{disabled}}
@icon={{icon}}
@helperText={{helperText}}
/>
`,
context: {
label: text('text', 'Radiofield'),
error: boolean('error', false),
value: text('value', 'value and selectedValue must match to select radiofield'),
helperText: text('helperText', 'Helper text'),
selectedValue: text(
'selectedValue',
'value and selectedValue must match to select radiofield'
@@ -63,6 +65,7 @@ Renders a form radiofield.
@disabled={{false}}
@changed={{fn}}
@inline={{true}}
@helperText={{helperText}}
/>
```
@@ -77,6 +80,7 @@ Renders a form radiofield.
@disabled={{disabled}}
@icon={{icon}}
@inline={{inline}}
@helperText={{helperText}}
/>
<Rose::Form::Radio::Radio
@label='Radiofield2'
@@ -86,6 +90,7 @@ Renders a form radiofield.
@disabled={{disabled}}
@icon={{icon}}
@inline={{inline}}
@helperText={{helperText}}
/>
<Rose::Form::Radio::Radio
@label='Radiofield3'
@@ -95,6 +100,7 @@ Renders a form radiofield.
@disabled={{disabled}}
@icon={{icon}}
@inline={{inline}}
@helperText={{helperText}}
/>
`,
context: {
@@ -104,6 +110,7 @@ Renders a form radiofield.
'selectedValue',
'value and selectedValue must match to select radiofield'
),
helperText: text('helperText', 'Helper text'),
disabled: boolean('disabled', false),
icon: select(
'icon',
@@ -1,5 +1,6 @@
@use '../../variables/sizing';
@use '../../utilities/type';
@use '../../variables/typography';
$radio-svg: (
'default':
@@ -34,9 +35,18 @@ $data-svg-prefix: 'data:image/svg+xml;utf-8,';
color: var(--ui-gray);
.rose-form-radio-label {
display: flex;
align-items: center;
.rose-form-helper-text {
font-weight: normal;
margin-left: sizing.rems(xxs);
margin-bottom: 0;
}
@include type.type(s, semibold);
color: currentColor;
padding-left: sizing.rems(l);
padding-top: sizing.rems(xxxs);
.rose-icon {
margin-right: sizing.rems(xxs);
@@ -21,7 +21,7 @@
@changed={{route-action 'changeState'}}
as |radioGroup|
>
{{#each this.oidcStates as |state|}}
{{#each @model.options.oidc.state as |state|}}
<dropdown.item>
<radioGroup.radio
@label={{t (concat 'states.' state)}}
@@ -7,7 +7,7 @@
<dropdown.button
@style='danger'
@disabled={{@model.canSave}}
{{on 'click' (route-action 'delete' @model)}}
{{on 'click' (route-action 'deleteManagedGroup' @model)}}
>
{{t 'resources.managed-group.actions.delete'}}
</dropdown.button>
@@ -1,5 +1,4 @@
import Controller from '@ember/controller';
import { options } from 'api/models/auth-method';
export default class ScopesScopeAuthMethodsAuthMethodController extends Controller {
// =attributes
@@ -11,12 +10,4 @@ export default class ScopesScopeAuthMethodsAuthMethodController extends Controll
get breadCrumb() {
return this.model.displayName;
}
/**
* OIDC auth-method states
* @type {[string]}
*/
get oidcStates() {
return options.oidc.state;
}
}
@@ -15,30 +15,6 @@ export default class ScopesScopeAuthMethodsAuthMethodRoute extends Route {
return this.store.findRecord('auth-method', auth_method_id);
}
/**
* Renders the auth-method specific templates for header, navigation,
* and actions page sections.
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render('scopes/scope/auth-methods/auth-method/-header', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'header',
});
this.render('scopes/scope/auth-methods/auth-method/-navigation', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'navigation',
});
this.render('scopes/scope/auth-methods/auth-method/-actions', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'actions',
});
}
// =actions
/**
@@ -19,16 +19,23 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route
* Returns accounts for the current auth method.
* @return {Promise{[AccountModel]}}
*/
model() {
async model() {
const authMethod = this.modelFor('scopes.scope.auth-methods.auth-method');
const { id: auth_method_id } = authMethod;
let accounts;
if (
this.can.can('list collection', authMethod, {
collection: 'accounts',
})
) {
return this.store.query('account', { auth_method_id });
accounts = await this.store.query('account', { auth_method_id });
}
return {
authMethod,
accounts,
};
}
// =actions
@@ -12,36 +12,4 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountRoute extend
model({ account_id }) {
return this.store.findRecord('account', account_id, { reload: true });
}
/**
* Renders the route-set specific page sections
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render(
'scopes/scope/auth-methods/auth-method/accounts/account/-header',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'header',
}
);
this.render(
'scopes/scope/auth-methods/auth-method/accounts/account/-actions',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'actions',
}
);
this.render(
'scopes/scope/auth-methods/auth-method/accounts/account/-navigation',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'navigation',
}
);
}
}
@@ -1,10 +1,2 @@
import Route from '@ember/routing/route';
export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountIndexRoute extends Route {
// setupController(controller) {
// const authMethod = this.modelFor(
// 'scopes.scope.auth-methods.auth-method'
// );
// super.setupController(...arguments);
// controller.setProperties({ authMethod });
// }
}
export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountIndexRoute extends Route {}
@@ -11,23 +11,6 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
@service notify;
@service router;
// =methods
/**
* Renders the route-set specific page sections
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render(
'scopes/scope/auth-methods/auth-method/accounts/account/set-password/-header',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'header',
}
);
}
// =actions
/**
@@ -16,27 +16,4 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsNewRoute extends Ro
auth_method_id,
});
}
/**
* Renders new account templates for header, navigation, and action page sections.
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render('scopes/scope/auth-methods/auth-method/accounts/new/-header', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'header',
});
this.render('_empty', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'actions',
});
this.render('_empty', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'navigation',
});
}
}
@@ -19,16 +19,24 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
*
* @returns {Promise{[ManagedGroupsModel]}}
*/
model() {
async model() {
const authMethod = this.modelFor('scopes.scope.auth-methods.auth-method');
const { id: auth_method_id } = authMethod;
const canListManagedGroups = this.can.can('list collection', authMethod, {
collection: 'managed-groups',
});
let managedGroups;
if (canListManagedGroups) {
return this.store.query('managed-group', { auth_method_id });
managedGroups = await this.store.query('managed-group', {
auth_method_id,
});
}
return {
authMethod,
managedGroups,
};
}
// =actions
@@ -81,7 +89,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
@confirm('questions.delete-confirm')
@notifyError(({ message }) => message, { catch: true })
@notifySuccess('notifications.delete-success')
async delete(managedGroup) {
async deleteManagedGroup(managedGroup) {
await managedGroup.destroyRecord();
await this.router.replaceWith(
'scopes.scope.auth-methods.auth-method.managed-groups'
@@ -14,36 +14,4 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsManagedGroupRo
reload: true,
});
}
/**
* Render the route-set specific page sections
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render(
'scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-header',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'header',
}
);
this.render(
'scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-actions',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'actions',
}
);
this.render(
'scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-navigation',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'navigation',
}
);
}
}
@@ -12,15 +12,19 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsManagedGroupMe
* Returns the previously loaded managed group instances memebrs.
* @return {Promise{[AccountModel]}}
*/
model() {
const { auth_method_id, member_ids } = this.modelFor(
async model() {
const managedGroup = this.modelFor(
'scopes.scope.auth-methods.auth-method.managed-groups.managed-group'
);
const { auth_method_id, member_ids } = managedGroup;
return this.resourceFilterStore.queryBy(
'account',
{ id: member_ids },
{ auth_method_id }
);
return {
managedGroup,
members: await this.resourceFilterStore.queryBy(
'account',
{ id: member_ids },
{ auth_method_id }
),
};
}
}
@@ -11,26 +11,4 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsNewRoute exten
auth_method_id,
});
}
renderTemplate() {
super.renderTemplate(...arguments);
this.render(
'scopes/scope/auth-methods/auth-method/managed-groups/new/-header',
{
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'header',
}
);
this.render('_empty', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'actions',
});
this.render('_empty', {
into: 'scopes/scope/auth-methods/auth-method',
outlet: 'navigation',
});
}
}
@@ -12,27 +12,4 @@ export default class ScopesScopeUsersUserRoute extends Route {
async model({ user_id }) {
return this.store.findRecord('user', user_id);
}
/**
* Renders the route-set specific page sections
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render('scopes/scope/users/user/-header', {
into: 'scopes/scope/users/user',
outlet: 'header',
});
this.render('scopes/scope/users/user/-actions', {
into: 'scopes/scope/users/user',
outlet: 'actions',
});
this.render('scopes/scope/users/user/-navigation', {
into: 'scopes/scope/users/user',
outlet: 'navigation',
});
}
}
@@ -38,29 +38,6 @@ export default class ScopesScopeUsersUserAddAccountsRoute extends Route {
return { user, authMethods, accounts };
}
/**
* Renders the route-set specific page sections
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render('scopes/scope/users/user/add-accounts/-header', {
into: 'scopes/scope/users/user',
outlet: 'header',
});
this.render('-empty', {
into: 'scopes/scope/users/user',
outlet: 'actions',
});
this.render('-empty', {
into: 'scopes/scope/users/user',
outlet: 'navigation',
});
}
// =actions
/**
@@ -1,25 +1,3 @@
{{page-title @model.displayName}}
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
{{outlet 'header'}}
</page.header>
<page.navigation>
{{outlet 'navigation'}}
</page.navigation>
<page.actions>
{{outlet 'actions'}}
</page.actions>
<page.body>
{{outlet}}
</page.body>
</Rose::Layout::Page>
{{outlet}}
@@ -1,5 +1,28 @@
<Form::Account
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<AuthMethods::AuthMethod::Accounts::Account::Header @model={{@model}} />
</page.header>
<page.navigation>
<AuthMethods::AuthMethod::Accounts::Account::Nav @model={{@model}} />
</page.navigation>
<page.actions>
<AuthMethods::AuthMethod::Accounts::Account::Actions @model={{@model}} />
</page.actions>
<page.body>
<Form::Account
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
</page.body>
</Rose::Layout::Page>
@@ -1,7 +1,37 @@
{{page-title (t 'actions.set-password')}}
<Form::Account::Password::SetPassword
@model={{@model}}
@submit={{route-action 'setPassword' @model}}
@cancel={{route-action 'cancel' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<h2>{{t 'resources.account.title'}}</h2>
<p>{{t 'resources.account.messages.set-password.description'}}</p>
<Copyable
@text={{@model.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{@model.id}}</code>
</Copyable>
</page.header>
<page.navigation>
<AuthMethods::AuthMethod::Accounts::Account::Nav @model={{@model}} />
</page.navigation>
<page.actions>
<AuthMethods::AuthMethod::Accounts::Account::Actions @model={{@model}} />
</page.actions>
<page.body>
<Form::Account::Password::SetPassword
@model={{@model}}
@submit={{route-action 'setPassword' @model}}
@cancel={{route-action 'cancel' @model}}
/>
</page.body>
</Rose::Layout::Page>
@@ -1,9 +0,0 @@
<h2>{{t 'resources.account.title'}}</h2>
<p>{{t 'resources.account.messages.set-password.description'}}</p>
<Copyable
@text={{@model.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{@model.id}}</code>
</Copyable>
@@ -1,149 +1,175 @@
{{#if @model}}
{{! OIDC accounts display more fields }}
{{#if @model.firstObject.isOIDC}}
<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'>
{{#if (can 'read model' account)}}
<LinkTo
@route='scopes.scope.auth-methods.auth-method.accounts.account'
@model={{account.id}}
>
{{account.accountName}}
</LinkTo>
{{else}}
{{account.accountName}}
{{/if}}
<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::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.login_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>
{{#if (can 'read model' account)}}
<LinkTo
@route='scopes.scope.auth-methods.auth-method.accounts.account'
@model={{account.id}}
>
{{account.accountName}}
</LinkTo>
{{else}}
{{account.accountName}}
{{/if}}
<p>{{account.description}}</p>
</row.headerCell>
<row.cell>
{{account.attributes.login_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>
{{/if}}
{{else}}
<Rose::Layout::Page as |page|>
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.account.messages.welcome.title'}}
as |message|
>
<message.description>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
{{#if (can 'list collection' this.authMethod collection='accounts')}}
{{! can list (at least): show default welcome message}}
{{t 'resources.account.description'}}
<page.header>
<AuthMethods::AuthMethod::Header @model={{@model.authMethod}} />
</page.header>
{{else if (can
'create collection' this.authMethod collection='accounts'
)}}
{{! can create (only): show create-but-not-list welcome message}}
{{t
'descriptions.create-but-not-list'
resource=(t 'resources.account.title_plural')
}}
{{else}}
{{! can neither list nor create }}
{{t
'descriptions.neither-list-nor-create'
resource=(t 'resources.account.title_plural')
}}
{{/if}}
<page.navigation>
<AuthMethods::AuthMethod::Nav @model={{@model.authMethod}} />
</page.navigation>
</message.description>
<page.actions>
<AuthMethods::AuthMethod::Actions @model={{@model.authMethod}} />
</page.actions>
{{#if (can 'create collection' this.authMethod collection='accounts')}}
<message.link
@route='scopes.scope.auth-methods.auth-method.accounts.new'
>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.account.actions.create'}}
</message.link>
<page.body>
{{#if @model.accounts}}
{{! OIDC accounts display more fields }}
{{#if @model.accounts.firstObject.isOIDC}}
<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.accounts as |account|}}
<body.row as |row|>
<row.headerCell scope='row'>
{{#if (can 'read model' account)}}
<LinkTo
@route='scopes.scope.auth-methods.auth-method.accounts.account'
@model={{account.id}}
>
{{account.accountName}}
</LinkTo>
{{else}}
{{account.accountName}}
{{/if}}
<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::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.login_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.accounts as |account|}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' account)}}
<LinkTo
@route='scopes.scope.auth-methods.auth-method.accounts.account'
@model={{account.id}}
>
{{account.accountName}}
</LinkTo>
{{else}}
{{account.accountName}}
{{/if}}
<p>{{account.description}}</p>
</row.headerCell>
<row.cell>
{{account.attributes.login_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>
{{/if}}
</Rose::Message>
</Rose::Layout::Centered>
{{else}}
{{/if}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.account.messages.welcome.title'}}
as |message|
>
<message.description>
{{#if
(can 'list collection' this.authMethod collection='accounts')
}}
{{! can list (at least): show default welcome message}}
{{t 'resources.account.description'}}
{{else if (can
'create collection' this.authMethod collection='accounts'
)}}
{{! can create (only): show create-but-not-list welcome message}}
{{t
'descriptions.create-but-not-list'
resource=(t 'resources.account.title_plural')
}}
{{else}}
{{! can neither list nor create }}
{{t
'descriptions.neither-list-nor-create'
resource=(t 'resources.account.title_plural')
}}
{{/if}}
</message.description>
{{#if
(can 'create collection' this.authMethod collection='accounts')
}}
<message.link
@route='scopes.scope.auth-methods.auth-method.accounts.new'
>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.account.actions.create'}}
</message.link>
{{/if}}
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>
@@ -1,5 +1,23 @@
<Form::Account
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<h2>
{{t 'titles.new'}}
<DocLink @doc='account.new' @iconSize='large' />
</h2>
</page.header>
<page.body>
<Form::Account
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
</page.body>
</Rose::Layout::Page>
@@ -1,4 +0,0 @@
<h2>
{{t 'titles.new'}}
<DocLink @doc='account.new' @iconSize='large' />
</h2>
@@ -1,8 +1,30 @@
<Form::AuthMethod
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
@removeItemByIndex={{route-action 'removeItemByIndex' @model}}
@addStringItem={{route-action 'addStringItem' @model}}
@addAccountClaimMapItem={{route-action 'addAccountClaimMapItem' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<AuthMethods::AuthMethod::Header @model={{@model}} />
</page.header>
<page.navigation>
<AuthMethods::AuthMethod::Nav @model={{@model}} />
</page.navigation>
<page.actions>
<AuthMethods::AuthMethod::Actions @model={{@model}} />
</page.actions>
<page.body>
<Form::AuthMethod
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
@removeItemByIndex={{route-action 'removeItemByIndex' @model}}
@addStringItem={{route-action 'addStringItem' @model}}
@addAccountClaimMapItem={{route-action 'addAccountClaimMapItem' @model}}
/>
</page.body>
</Rose::Layout::Page>
@@ -1,86 +1,112 @@
{{#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.description.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
</header.row>
</table.header>
<Rose::Layout::Page as |page|>
<table.body as |body|>
{{#each @model as |managed-group|}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' managed-group)}}
<LinkTo
@route='scopes.scope.auth-methods.auth-method.managed-groups.managed-group'
@model={{managed-group.id}}
>
{{managed-group.displayName}}
</LinkTo>
{{else}}
{{managed-group.displayName}}
{{/if}}
</row.headerCell>
<row.cell>{{managed-group.description}}</row.cell>
<row.cell>
<Rose::Badge>{{managed-group.type}}</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{managed-group.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{managed-group.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.managed-group.messages.welcome.title'}}
as |message|
>
<message.description>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
{{#if
(can 'list collection' this.authMethod collection='managed-groups')
}}
{{! Can list (at least): show default welcome message }}
{{t 'resources.managed-group.description'}}
{{else if (can
'create collection' this.authMethod collection='managed-groups'
)}}
{{! Can create only: show create but not list welcome message }}
{{t
'descriptions.create-but-not-list'
resource=(t 'resources.managed-group.title_plural')
}}
{{else}}
{{! Can neither list nor create }}
{{t
'descriptions.neither-list-nor-create'
resource=(t 'resources.managed-group.title_plural')
}}
{{/if}}
</message.description>
<page.header>
<AuthMethods::AuthMethod::Header @model={{@model.authMethod}} />
</page.header>
{{#if
(can 'create collection' this.authMethod collection='managed-groups')
}}
<message.link
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
<page.navigation>
<AuthMethods::AuthMethod::Nav @model={{@model.authMethod}} />
</page.navigation>
<page.actions>
<AuthMethods::AuthMethod::Actions @model={{@model.authMethod}} />
</page.actions>
<page.body>
{{#if @model.managedGroups}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.description.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.managedGroups as |managed-group|}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' managed-group)}}
<LinkTo
@route='scopes.scope.auth-methods.auth-method.managed-groups.managed-group'
@model={{managed-group.id}}
>
{{managed-group.displayName}}
</LinkTo>
{{else}}
{{managed-group.displayName}}
{{/if}}
</row.headerCell>
<row.cell>{{managed-group.description}}</row.cell>
<row.cell>
<Rose::Badge>{{managed-group.type}}</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{managed-group.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{managed-group.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.managed-group.messages.welcome.title'}}
as |message|
>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.managed-group.actions.create'}}
</message.link>
{{/if}}
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
<message.description>
{{#if
(can
'list collection' this.authMethod collection='managed-groups'
)
}}
{{! Can list (at least): show default welcome message }}
{{t 'resources.managed-group.description'}}
{{else if (can
'create collection' this.authMethod collection='managed-groups'
)}}
{{! Can create only: show create but not list welcome message }}
{{t
'descriptions.create-but-not-list'
resource=(t 'resources.managed-group.title_plural')
}}
{{else}}
{{! Can neither list nor create }}
{{t
'descriptions.neither-list-nor-create'
resource=(t 'resources.managed-group.title_plural')
}}
{{/if}}
</message.description>
{{#if
(can
'create collection' this.authMethod collection='managed-groups'
)
}}
<message.link
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.managed-group.actions.create'}}
</message.link>
{{/if}}
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>
@@ -1,5 +1,33 @@
<Form::ManagedGroup
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<AuthMethods::AuthMethod::ManagedGroups::ManagedGroup::Header
@model={{@model}}
/>
</page.header>
<page.navigation>
<AuthMethods::AuthMethod::ManagedGroups::ManagedGroup::Nav
@model={{@model}}
/>
</page.navigation>
<page.actions>
<AuthMethods::AuthMethod::ManagedGroups::ManagedGroup::Actions
@model={{@model}}
/>
</page.actions>
<page.body>
<Form::ManagedGroup
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
</page.body>
</Rose::Layout::Page>
@@ -1,62 +1,90 @@
{{page-title (t 'resources.managed-group.member.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 |member|}}
<body.row as |row|>
<row.headerCell scope='row'>
{{member.accountName}}
<p>{{member.description}}</p>
</row.headerCell>
<row.cell>
<code>{{member.attributes.issuer}}</code>
</row.cell>
<row.cell>
<code>{{member.attributes.subject}}</code>
</row.cell>
<row.cell>
<code>{{member.attributes.email}}</code>
</row.cell>
<row.cell>
{{member.attributes.full_name}}
</row.cell>
<row.cell>
<Rose::Badge>{{member.type}}</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{member.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{member.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.managed-group.member.messages.title'}}
as |message|
>
<message.description>
{{t 'resources.managed-group.member.messages.description'}}
</message.description>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<AuthMethods::AuthMethod::ManagedGroups::ManagedGroup::Header
@model={{@model.managedGroup}}
/>
</page.header>
<page.navigation>
<AuthMethods::AuthMethod::ManagedGroups::ManagedGroup::Nav
@model={{@model.managedGroup}}
/>
</page.navigation>
<page.actions>
<AuthMethods::AuthMethod::ManagedGroups::ManagedGroup::Actions
@model={{@model.managedGroup}}
/>
</page.actions>
<page.body>
{{#if @model.members}}
<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.members as |member|}}
<body.row as |row|>
<row.headerCell scope='row'>
{{member.accountName}}
<p>{{member.description}}</p>
</row.headerCell>
<row.cell>
<code>{{member.attributes.issuer}}</code>
</row.cell>
<row.cell>
<code>{{member.attributes.subject}}</code>
</row.cell>
<row.cell>
<code>{{member.attributes.email}}</code>
</row.cell>
<row.cell>
{{member.attributes.full_name}}
</row.cell>
<row.cell>
<Rose::Badge>{{member.type}}</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{member.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{member.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.managed-group.member.messages.title'}}
as |message|
>
<message.description>
{{t 'resources.managed-group.member.messages.description'}}
</message.description>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>
@@ -1,5 +1,23 @@
<Form::ManagedGroup
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<h2>
{{t 'titles.new'}}
{{! TODO: change the icon link }}
<DocLink @doc='account.new' @iconSize='large' />
</h2>
</page.header>
<page.body>
<Form::ManagedGroup
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
</page.body>
</Rose::Layout::Page>
@@ -1,5 +0,0 @@
<h2>
{{t 'titles.new'}}
{{! TODO: change the icon link }}
<DocLink @doc='account.new' @iconSize='large' />
</h2>
@@ -1,25 +1,3 @@
{{page-title @model.displayName}}
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
{{outlet 'header'}}
</page.header>
<page.navigation>
{{outlet 'navigation'}}
</page.navigation>
<page.actions>
{{outlet 'actions'}}
</page.actions>
<page.body>
{{outlet}}
</page.body>
</Rose::Layout::Page>
{{outlet}}
@@ -1,79 +1,101 @@
{{page-title (t 'resources.user.messages.accounts.title')}}
{{#if @model.accounts}}
<Rose::Layout::Page as |page|>
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
<row.headerCell>{{t 'titles.actions'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model.accounts as |account|}}
<body.row as |row|>
<row.headerCell>
{{account.accountName}}
<p>{{account.description}}</p>
</row.headerCell>
<row.cell>
<Rose::Badge>
{{t (concat 'resources.auth-method.types.' 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>
<row.cell>
{{#if (can 'removeAccounts user' @model.user)}}
<Rose::Dropdown
@icon='flight-icons/svg/more-horizontal-16'
@iconOnly={{true}}
@showCaret={{false}}
@dropdownRight={{true}}
@text='{{t 'actions.manage'}}'
as |dropdown|
>
<dropdown.button
@style='danger'
{{on
'click'
(route-action 'removeAccount' @model.user account)
}}
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<Users::User::Header @model={{@model.user}} />
</page.header>
<page.navigation>
<Users::User::Nav @model={{@model.user}} />
</page.navigation>
<page.actions>
<Users::User::Actions @model={{@model.user}} />
</page.actions>
<page.body>
{{#if @model.accounts}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
<row.headerCell>{{t 'titles.actions'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model.accounts as |account|}}
<body.row as |row|>
<row.headerCell>
{{account.accountName}}
<p>{{account.description}}</p>
</row.headerCell>
<row.cell>
<Rose::Badge>
{{t (concat 'resources.auth-method.types.' account.type)}}
</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{account.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
{{t 'actions.remove'}}
</dropdown.button>
</Rose::Dropdown>
{{/if}}
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
<code>{{account.id}}</code>
</Copyable>
</row.cell>
<row.cell>
{{#if (can 'removeAccounts user' @model.user)}}
<Rose::Dropdown
@icon='flight-icons/svg/more-horizontal-16'
@iconOnly={{true}}
@showCaret={{false}}
@dropdownRight={{true}}
@text='{{t 'actions.manage'}}'
as |dropdown|
>
<dropdown.button
@style='danger'
{{on
'click'
(route-action 'removeAccount' @model.user account)
}}
>
{{t 'actions.remove'}}
</dropdown.button>
</Rose::Dropdown>
{{/if}}
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.user.messages.accounts.title'}}
as |message|
>
<message.description>
{{t 'resources.user.messages.accounts.description'}}
</message.description>
<message.link @route='scopes.scope.users.user.add-accounts'>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.user.actions.add-accounts'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.user.messages.accounts.title'}}
as |message|
>
<message.description>
{{t 'resources.user.messages.accounts.description'}}
</message.description>
<message.link @route='scopes.scope.users.user.add-accounts'>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.user.actions.add-accounts'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
{{/if}}
</page.body>
</Rose::Layout::Page>
@@ -1,28 +1,43 @@
{{page-title (t 'resources.user.actions.add-accounts')}}
{{#if @model.accounts}}
<Form::User::AddAccounts
@model={{@model.user}}
@authMethods={{@model.authMethods}}
@accounts={{@model.accounts}}
@submit={{route-action 'addAccounts' @model.user}}
@cancel={{route-action 'cancel'}}
/>
{{/if}}
<Rose::Layout::Page as |page|>
{{#unless @model.accounts}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.user.messages.no-accounts.title'}}
as |message|
>
<message.description>
{{t 'resources.user.messages.no-accounts.description'}}
</message.description>
<message.link @route='scopes.scope.users.user.accounts'>
<Rose::Icon @name='flight-icons/svg/chevron-left-16' />
{{t 'actions.back'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<h2>{{t 'resources.user.messages.add-accounts.title'}}</h2>
<p>{{t 'resources.user.messages.add-accounts.description'}}</p>
</page.header>
<page.body>
{{#if @model.accounts}}
<Form::User::AddAccounts
@model={{@model.user}}
@authMethods={{@model.authMethods}}
@accounts={{@model.accounts}}
@submit={{route-action 'addAccounts' @model.user}}
@cancel={{route-action 'cancel'}}
/>
{{/if}}
{{#unless @model.accounts}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.user.messages.no-accounts.title'}}
as |message|
>
<message.description>
{{t 'resources.user.messages.no-accounts.description'}}
</message.description>
<message.link @route='scopes.scope.users.user.accounts'>
<Rose::Icon @name='flight-icons/svg/chevron-left-16' />
{{t 'actions.back'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}
</page.body>
</Rose::Layout::Page>
@@ -1,2 +0,0 @@
<h2>{{t 'resources.user.messages.add-accounts.title'}}</h2>
<p>{{t 'resources.user.messages.add-accounts.description'}}</p>
@@ -1,5 +1,27 @@
<Form::User
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<Users::User::Header @model={{@model}} />
</page.header>
<page.navigation>
<Users::User::Nav @model={{@model}} />
</page.navigation>
<page.actions>
<Users::User::Actions @model={{@model}} />
</page.actions>
<page.body>
<Form::User
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
</page.body>
</Rose::Layout::Page>