chore: 🤖 rename account settings to set-password

This commit is contained in:
Randall Morey committed 2020-09-16 12:52:24 -04:00
1 parent c0dbf7335c
commit 1140122c0e
9 files changed
+26 -19

No files matched your search

+2 -2
View File
@@ -75,14 +75,14 @@ Router.map(function () {
this.route('auth-method', { path: ':auth_method_id' }, function() {
this.route('accounts', function() {
this.route('account', { path: ':account_id' }, function() {
this.route('settings');
this.route('set-password');
});
this.route('new');
});
});
this.route('new');
});
});
});
});
@@ -9,6 +9,20 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
@service intl;
@service notify;
// =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
/**
@@ -20,7 +34,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
async setPassword(account) {
try {
await account.setPassword();
await this.replaceWith('scopes.scope.auth-methods.auth-method.accounts.account.settings');
await this.replaceWith('scopes.scope.auth-methods.auth-method.accounts.account.set-password');
this.notify.success(
this.intl.t('notify.save-success')
);
@@ -35,6 +49,6 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
*/
@action
cancel() {
this.replaceWith('scopes.scope.auth-methods.auth-method.accounts.account.settings');
this.replaceWith('scopes.scope.auth-methods.auth-method.accounts.account.set-password');
}
}
@@ -1,6 +1 @@
<h2>{{t "resources.auth-method"}}</h2>
{{!--
<Rose::Badge>
{{t (concat 'auth.method-types.' @model.type)}}
</Rose::Badge>
--}}
@@ -1,4 +1 @@
<h2>{{t "resources.account"}}</h2>
<Rose::Badge>
{{t (concat 'account.types.' @model.type)}}
</Rose::Badge>
@@ -2,7 +2,7 @@
<nav.link @route='scopes.scope.auth-methods.auth-method.accounts.account.index'>
{{t 'titles.details'}}
</nav.link>
<nav.link @route='scopes.scope.auth-methods.auth-method.accounts.account.settings'>
{{t 'titles.settings'}}
<nav.link @route='scopes.scope.auth-methods.auth-method.accounts.account.set-password'>
{{t 'actions.set-password'}}
</nav.link>
</Rose::Nav::Tabs>
@@ -1,5 +1,3 @@
<p>{{t 'descriptions.account-settings-overview'}}</p>
<Form::Account::Password::SetPassword
@model={{@model}}
@submit={{route-action "setPassword" @model}}
@@ -0,0 +1,2 @@
<h2>{{t "resources.account"}}</h2>
<p>{{t 'descriptions.account-set-password-overview'}}</p>
@@ -1,11 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | scopes/scope/auth-methods/auth-method/accounts/account/settings', function(hooks) {
module('Unit | Route | scopes/scope/auth-methods/auth-method/accounts/account/set-password', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let route = this.owner.lookup('route:scopes/scope/auth-methods/auth-method/accounts/account/settings');
let route = this.owner.lookup('route:scopes/scope/auth-methods/auth-method/accounts/account/set-password');
assert.ok(route);
});
});
+2 -1
View File
@@ -29,6 +29,7 @@ actions:
add-members: Add Members
add-hosts: Add Hosts
add-account: Create Account
set-password: Set Password
auth:
titles:
no-scopes: No Scopes Available
@@ -132,7 +133,7 @@ descriptions:
no-principals-available: Principals are not available for assignment.
group-members-welcome: Users belonging to this group appear here.
no-available-users: No users are available to add to this group.
account-settings-overview: Set the password for current account.
account-set-password-overview: Set the password for current account.
accounts-welcome: No accounts are available in this auth method.
states:
info: Info