refactor: 💡 migrate to router.replaceWith due to deprecations
This commit is contained in:
31 files changed
+147
-55
No files matched your search
@@ -12,6 +12,7 @@ export default class AccountChangePasswordRoute extends Route {
|
||||
@service session;
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -42,7 +43,7 @@ export default class AccountChangePasswordRoute extends Route {
|
||||
// redirects depending on the authentication context. These additional
|
||||
// redirects may abort this initial transition, resulting in a
|
||||
// TransitionAborted error, which we do not want to show to the user.
|
||||
await this.replaceWith('index').catch(() => {});
|
||||
await this.router.replaceWith('index').catch(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,6 +51,6 @@ export default class AccountChangePasswordRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('index');
|
||||
this.router.replaceWith('index');
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ export default class ScopesScopeRoute extends Route {
|
||||
@service intl;
|
||||
@service session;
|
||||
@service scope;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -149,7 +150,7 @@ export default class ScopesScopeRoute extends Route {
|
||||
async delete(scope) {
|
||||
const { scopeID } = scope;
|
||||
await scope.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.scopes', scopeID);
|
||||
await this.router.replaceWith('scopes.scope.scopes', scopeID);
|
||||
//this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
@service session;
|
||||
@service can;
|
||||
@service resourceFilterStore;
|
||||
@service router;
|
||||
|
||||
// =attributes
|
||||
|
||||
@@ -97,7 +98,7 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
// Reload the scope, since this is where the primary_auth_method_id is
|
||||
// stored. An auth method deletion could affect this field.
|
||||
await scopeModel.reload();
|
||||
await this.replaceWith('scopes.scope.auth-methods');
|
||||
await this.router.replaceWith('scopes.scope.auth-methods');
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
@@ -82,7 +84,9 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteAccount(account) {
|
||||
await account.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.auth-methods.auth-method.accounts');
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.auth-methods.auth-method.accounts'
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -9,6 +9,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -40,7 +41,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
|
||||
@notifySuccess('notifications.save-success')
|
||||
async setPassword(account, password) {
|
||||
await account.setPassword(password);
|
||||
await this.replaceWith(
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.auth-methods.auth-method.accounts.account.set-password'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
//=methods
|
||||
|
||||
@@ -80,7 +81,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(managedGroup) {
|
||||
await managedGroup.destroyRecord();
|
||||
await this.replaceWith(
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.auth-methods.auth-method.managed-groups'
|
||||
);
|
||||
this.refresh();
|
||||
|
||||
@@ -8,6 +8,8 @@ import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
export default class ScopesScopeCredentialStoresRoute extends Route {
|
||||
// =methods
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
/**
|
||||
* Load all credential stores under current scope
|
||||
* @returns {Promise[CredentialStoreModel]}
|
||||
@@ -65,7 +67,7 @@ export default class ScopesScopeCredentialStoresRoute extends Route {
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(credentialStore) {
|
||||
await credentialStore.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.credential-stores');
|
||||
await this.router.replaceWith('scopes.scope.credential-stores');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -8,6 +8,7 @@ import { inject as service } from '@ember/service';
|
||||
export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrariesRoute extends Route {
|
||||
// =methods
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
/**
|
||||
* Loads all credential libraries under the current credential store.
|
||||
@@ -79,7 +80,7 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrari
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(credentialLibrary) {
|
||||
await credentialLibrary.destroyRecord();
|
||||
await this.replaceWith(
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.credential-stores.credential-store.credential-libraries'
|
||||
);
|
||||
this.refresh();
|
||||
|
||||
@@ -12,6 +12,8 @@ export default class ScopesScopeGroupsRoute extends Route {
|
||||
@service notify;
|
||||
@service session;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
@@ -76,7 +78,7 @@ export default class ScopesScopeGroupsRoute extends Route {
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(group) {
|
||||
await group.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.groups');
|
||||
await this.router.replaceWith('scopes.scope.groups');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export default class ScopesScopeGroupsGroupAddMembersRoute extends Route {
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -70,7 +71,7 @@ export default class ScopesScopeGroupsGroupAddMembersRoute extends Route {
|
||||
@notifySuccess('notifications.add-success')
|
||||
async addMembers(group, userIDs) {
|
||||
await group.addMembers(userIDs);
|
||||
await this.replaceWith('scopes.scope.groups.group.members');
|
||||
await this.router.replaceWith('scopes.scope.groups.group.members');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,6 +79,6 @@ export default class ScopesScopeGroupsGroupAddMembersRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('scopes.scope.groups.group.members');
|
||||
this.router.replaceWith('scopes.scope.groups.group.members');
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ export default class ScopesScopeHostCatalogsRoute extends Route {
|
||||
@service notify;
|
||||
@service session;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
@@ -79,7 +81,7 @@ export default class ScopesScopeHostCatalogsRoute extends Route {
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(hostCatalog) {
|
||||
await hostCatalog.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.host-catalogs');
|
||||
await this.router.replaceWith('scopes.scope.host-catalogs');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,8 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
@@ -83,6 +85,8 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteHostSet(hostSet) {
|
||||
await hostSet.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.host-catalogs.host-catalog.host-sets');
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets'
|
||||
);
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -10,6 +10,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetAddHostsRo
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -75,7 +76,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetAddHostsRo
|
||||
@notifySuccess('notifications.add-success')
|
||||
async addHosts(hostSet, hostIDs) {
|
||||
await hostSet.addHosts(hostIDs);
|
||||
await this.replaceWith(
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
@@ -85,7 +86,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetAddHostsRo
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith(
|
||||
this.router.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
|
||||
+3
-2
@@ -9,6 +9,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetCreateAndA
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -70,7 +71,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetCreateAndA
|
||||
);
|
||||
await host.save();
|
||||
await hostSet.addHost(host.id);
|
||||
await this.replaceWith(
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
@@ -80,7 +81,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetCreateAndA
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith(
|
||||
this.router.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
@@ -80,7 +82,9 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteHost(host) {
|
||||
await host.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.host-catalogs.host-catalog.hosts');
|
||||
await this.router.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.hosts'
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ export default class ScopesScopeRolesRoute extends Route {
|
||||
@service notify;
|
||||
@service session;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -77,7 +78,7 @@ export default class ScopesScopeRolesRoute extends Route {
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(role) {
|
||||
await role.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.roles');
|
||||
await this.router.replaceWith('scopes.scope.roles');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export default class ScopesScopeRolesRoleAddPrincipalsRoute extends Route {
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -64,7 +65,7 @@ export default class ScopesScopeRolesRoleAddPrincipalsRoute extends Route {
|
||||
@notifySuccess('notifications.add-success')
|
||||
async addPrincipals(role, principalIDs) {
|
||||
await role.addPrincipals(principalIDs);
|
||||
this.replaceWith('scopes.scope.roles.role.principals');
|
||||
this.router.replaceWith('scopes.scope.roles.role.principals');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,6 +73,6 @@ export default class ScopesScopeRolesRoleAddPrincipalsRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('scopes.scope.roles.role.principals');
|
||||
this.router.replaceWith('scopes.scope.roles.role.principals');
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ export default class ScopesScopeTargetsRoute extends Route {
|
||||
@service notify;
|
||||
@service session;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -79,7 +80,7 @@ export default class ScopesScopeTargetsRoute extends Route {
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(target) {
|
||||
await target.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.targets');
|
||||
await this.router.replaceWith('scopes.scope.targets');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export default class ScopesScopeTargetsTargetAddCredentialSourcesRoute extends R
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -78,7 +79,7 @@ export default class ScopesScopeTargetsTargetAddCredentialSourcesRoute extends R
|
||||
@notifySuccess('notifications.add-success')
|
||||
async save(target, credentialLibraryIDs) {
|
||||
await target.addCredentialSources(credentialLibraryIDs);
|
||||
this.replaceWith('scopes.scope.targets.target.credential-sources');
|
||||
this.router.replaceWith('scopes.scope.targets.target.credential-sources');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,6 +87,6 @@ export default class ScopesScopeTargetsTargetAddCredentialSourcesRoute extends R
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('scopes.scope.targets.target.credential-sources');
|
||||
this.router.replaceWith('scopes.scope.targets.target.credential-sources');
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export default class ScopesScopeTargetsTargetAddHostSourcesRoute extends Route {
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -72,7 +73,7 @@ export default class ScopesScopeTargetsTargetAddHostSourcesRoute extends Route {
|
||||
@notifySuccess('notifications.add-success')
|
||||
async save(target, hostSetIDs) {
|
||||
await target.addHostSources(hostSetIDs);
|
||||
this.replaceWith('scopes.scope.targets.target.host-sources');
|
||||
this.router.replaceWith('scopes.scope.targets.target.host-sources');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,6 +81,6 @@ export default class ScopesScopeTargetsTargetAddHostSourcesRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('scopes.scope.targets.target.host-sources');
|
||||
this.router.replaceWith('scopes.scope.targets.target.host-sources');
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ export default class ScopesScopeUsersRoute extends Route {
|
||||
@service notify;
|
||||
@service session;
|
||||
@service can;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -78,7 +79,7 @@ export default class ScopesScopeUsersRoute extends Route {
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(user) {
|
||||
await user.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.users');
|
||||
await this.router.replaceWith('scopes.scope.users');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export default class ScopesScopeUsersUserAddAccountsRoute extends Route {
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -74,7 +75,7 @@ export default class ScopesScopeUsersUserAddAccountsRoute extends Route {
|
||||
@notifySuccess('notifications.add-success')
|
||||
async addAccounts(user, accountIDs) {
|
||||
await user.addAccounts(accountIDs);
|
||||
await this.replaceWith('scopes.scope.users.user.accounts');
|
||||
await this.router.replaceWith('scopes.scope.users.user.accounts');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,6 +83,6 @@ export default class ScopesScopeUsersUserAddAccountsRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('scopes.scope.users.user.accounts');
|
||||
this.router.replaceWith('scopes.scope.users.user.accounts');
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
.rose-dropdown {
|
||||
$icon-width: sizing.rems(m) + sizing.rems(s);
|
||||
$indent: $icon-width + sizing.rems(xs);
|
||||
$indent: $icon-width + sizing.rems(xs);
|
||||
|
||||
.rose-form-radio-label {
|
||||
display: flex;
|
||||
@@ -129,7 +129,14 @@
|
||||
&.loading {
|
||||
&::after {
|
||||
animation: gradient 1s linear infinite;
|
||||
background: repeating-linear-gradient(to right, var(--subtle), var(--subtle), var(--info), var(--subtle), var(--subtle));
|
||||
background: repeating-linear-gradient(
|
||||
to right,
|
||||
var(--subtle),
|
||||
var(--subtle),
|
||||
var(--info),
|
||||
var(--subtle),
|
||||
var(--subtle)
|
||||
);
|
||||
background-position: -100% 0;
|
||||
background-size: 200% auto;
|
||||
content: ' ';
|
||||
@@ -140,8 +147,12 @@
|
||||
top: 100%;
|
||||
|
||||
@keyframes gradient {
|
||||
0% { background-position: -100% 0; }
|
||||
100% { background-position: -200% 0; }
|
||||
0% {
|
||||
background-position: -100% 0;
|
||||
}
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,8 +194,12 @@
|
||||
color: inherit;
|
||||
|
||||
@keyframes fadeBackground {
|
||||
0% { background-color: var(--action-subtler-1); }
|
||||
100% { background-color: transparent; }
|
||||
0% {
|
||||
background-color: var(--action-subtler-1);
|
||||
}
|
||||
100% {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user