diff --git a/ui/core/app/routes/scopes/scope/auth-methods.js b/ui/core/app/routes/scopes/scope/auth-methods.js index f7bbe65c5..0b4072276 100644 --- a/ui/core/app/routes/scopes/scope/auth-methods.js +++ b/ui/core/app/routes/scopes/scope/auth-methods.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../utilities/confirm'; export default class ScopesScopeAuthMethodsRoute extends Route { // =services @@ -71,10 +72,11 @@ export default class ScopesScopeAuthMethodsRoute extends Route { */ @action @loading + @confirm('questions.delete-confirm') async delete(authMethod) { try { await authMethod.destroyRecord(); - await this.transitionTo('scopes.scope.auth-methods'); + await this.replaceWith('scopes.scope.auth-methods'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); } catch (error) { diff --git a/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js b/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js index fbd28041a..306acb0b8 100644 --- a/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js +++ b/ui/core/app/routes/scopes/scope/auth-methods/auth-method/accounts.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../utilities/confirm'; export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route { // =services @@ -71,10 +72,11 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route */ @action @loading - async delete(account) { + @confirm('questions.delete-confirm') + async deleteAccount(account) { try { await account.destroyRecord(); - await this.transitionTo('scopes.scope.auth-methods.auth-method.accounts'); + await this.replaceWith('scopes.scope.auth-methods.auth-method.accounts'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); } catch (error) { diff --git a/ui/core/app/routes/scopes/scope/groups.js b/ui/core/app/routes/scopes/scope/groups.js index 66ac9d8bd..26b5a3f61 100644 --- a/ui/core/app/routes/scopes/scope/groups.js +++ b/ui/core/app/routes/scopes/scope/groups.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../utilities/confirm'; export default class ScopesScopeGroupsRoute extends Route { // =services @@ -68,12 +69,13 @@ export default class ScopesScopeGroupsRoute extends Route { */ @action @loading + @confirm('questions.delete-confirm') async delete(group) { try { await group.destroyRecord(); + await this.replaceWith('scopes.scope.groups'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); - await this.transitionTo('scopes.scope.groups'); } catch (error) { //TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/routes/scopes/scope/groups/group/members.js b/ui/core/app/routes/scopes/scope/groups/group/members.js index 8b3c34bc4..c7f6d52ff 100644 --- a/ui/core/app/routes/scopes/scope/groups/group/members.js +++ b/ui/core/app/routes/scopes/scope/groups/group/members.js @@ -3,6 +3,7 @@ import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import { hash, all } from 'rsvp'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../utilities/confirm'; export default class ScopesScopeGroupsGroupMembersRoute extends Route { // =services @@ -38,10 +39,11 @@ export default class ScopesScopeGroupsGroupMembersRoute extends Route { */ @action @loading + @confirm('questions.remove-confirm') async removeMember(group, member) { try { await group.removeMember(member.id); - await this.refresh(); + this.refresh(); this.notify.success(this.intl.t('notifications.remove-success')); } catch (error) { // TODO: replace with translated strings diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs.js index 3cc9e212d..28058850f 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../utilities/confirm'; export default class ScopesScopeProjectsProjectHostCatalogsRoute extends Route { // =services @@ -61,16 +62,17 @@ export default class ScopesScopeProjectsProjectHostCatalogsRoute extends Route { /** * Deletes the host catalog and redirects to index. - * @param {ProjectModel} project + * @param {HostCatalogModel} hostCatalog */ @action @loading - async delete(project) { + @confirm('questions.delete-confirm') + async delete(hostCatalog) { try { - await project.destroyRecord(); + await hostCatalog.destroyRecord(); + await this.replaceWith('scopes.scope.projects.project.host-catalogs'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); - this.transitionTo('scopes.scope.projects.project.host-catalogs'); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets.js index affdabbe0..3591b4a4b 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../../../utilities/confirm'; export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsRoute extends Route { // =services @@ -70,13 +71,14 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsRo */ @action @loading - async delete(hostSet) { + @confirm('questions.delete-confirm') + async deleteHostSet(hostSet) { try { await hostSet.destroyRecord(); - this.notify.success(this.intl.t('notifications.delete-success')); - this.transitionTo( + await this.replaceWith( 'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets' ); + this.notify.success(this.intl.t('notifications.delete-success')); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/hosts.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/hosts.js index e13798b48..de4743209 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/hosts.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/hosts.js @@ -3,6 +3,7 @@ import { hash, all } from 'rsvp'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../../../../../utilities/confirm'; export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetHostsRoute extends Route { // =services @@ -37,6 +38,7 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHo */ @action @loading + @confirm('questions.remove-confirm') async removeHost(hostSet, host) { try { const scopeID = this.modelFor('scopes.scope.projects.project').id; diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js index 031975c46..42dd70019 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../../../utilities/confirm'; export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsRoute extends Route { // =services @@ -70,14 +71,15 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsRoute */ @action @loading - async delete(host) { + @confirm('questions.delete-confirm') + async deleteHost(host) { try { await host.destroyRecord(); - this.refresh(); - this.notify.success(this.intl.t('notifications.delete-success')); - this.transitionTo( + await this.replaceWith( 'scopes.scope.projects.project.host-catalogs.host-catalog.hosts' ); + this.refresh(); + this.notify.success(this.intl.t('notifications.delete-success')); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/routes/scopes/scope/projects/project/targets.js b/ui/core/app/routes/scopes/scope/projects/project/targets.js index fa019bdc7..64f254467 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/targets.js +++ b/ui/core/app/routes/scopes/scope/projects/project/targets.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../utilities/confirm'; export default class ScopesScopeProjectsProjectTargetsRoute extends Route { // =services @@ -62,12 +63,13 @@ export default class ScopesScopeProjectsProjectTargetsRoute extends Route { */ @action @loading + @confirm('questions.delete-confirm') async delete(target) { try { await target.destroyRecord(); + await this.replaceWith('scopes.scope.projects.project.targets'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); - this.transitionTo('scopes.scope.projects.project.targets'); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/routes/scopes/scope/projects/project/targets/target/host-sets.js b/ui/core/app/routes/scopes/scope/projects/project/targets/target/host-sets.js index 1633c5713..c87abdf0a 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/targets/target/host-sets.js +++ b/ui/core/app/routes/scopes/scope/projects/project/targets/target/host-sets.js @@ -3,6 +3,7 @@ import { all, hash } from 'rsvp'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../../../utilities/confirm'; export default class ScopesScopeProjectsProjectTargetsTargetHostSetsRoute extends Route { // =services @@ -55,6 +56,7 @@ export default class ScopesScopeProjectsProjectTargetsTargetHostSetsRoute extend */ @action @loading + @confirm('questions.remove-confirm') async removeHostSet(target, hostSet) { try { await target.removeHostSet(hostSet.id); diff --git a/ui/core/app/routes/scopes/scope/roles.js b/ui/core/app/routes/scopes/scope/roles.js index c9e907069..b7eb93adc 100644 --- a/ui/core/app/routes/scopes/scope/roles.js +++ b/ui/core/app/routes/scopes/scope/roles.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../utilities/confirm'; export default class ScopesScopeRolesRoute extends Route { // =services @@ -68,12 +69,13 @@ export default class ScopesScopeRolesRoute extends Route { */ @action @loading + @confirm('questions.delete-confirm') async delete(role) { try { await role.destroyRecord(); + await this.replaceWith('scopes.scope.roles'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); - this.transitionTo('scopes.scope.roles'); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); 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 045d568ce..8fde07b08 100644 --- a/ui/core/app/routes/scopes/scope/roles/role/principals.js +++ b/ui/core/app/routes/scopes/scope/roles/role/principals.js @@ -3,6 +3,7 @@ import { all, hash } from 'rsvp'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../../../utilities/confirm'; export default class ScopesScopeRolesRolePrincipalsRoute extends Route { // =services @@ -65,6 +66,7 @@ export default class ScopesScopeRolesRolePrincipalsRoute extends Route { */ @action @loading + @confirm('questions.remove-confirm') async removePrincipal(principal) { try { const role = this.modelFor('scopes.scope.roles.role'); diff --git a/ui/core/app/routes/scopes/scope/users.js b/ui/core/app/routes/scopes/scope/users.js index 563cf13d8..5628a5179 100644 --- a/ui/core/app/routes/scopes/scope/users.js +++ b/ui/core/app/routes/scopes/scope/users.js @@ -2,6 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; +import { confirm } from '../../../utilities/confirm'; export default class ScopesScopeUsersRoute extends Route { // =services @@ -69,12 +70,13 @@ export default class ScopesScopeUsersRoute extends Route { */ @action @loading + @confirm('questions.delete-confirm') async delete(user) { try { await user.destroyRecord(); + await this.replaceWith('scopes.scope.users'); this.refresh(); this.notify.success(this.intl.t('notifications.delete-success')); - this.transitionTo('scopes.scope.users'); } catch (error) { // TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-actions.hbs b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-actions.hbs index ea1b0115d..fb179b954 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-actions.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/-actions.hbs @@ -2,7 +2,7 @@ {{t 'actions.delete'}} diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-actions.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-actions.hbs index 557d572ba..adbf2705f 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-actions.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-actions.hbs @@ -19,4 +19,4 @@ > {{t 'resources.host-catalog.actions.delete'}} - \ No newline at end of file + diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-actions.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-actions.hbs index 0b6331854..cbf2d45cc 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-actions.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-actions.hbs @@ -5,8 +5,8 @@ {{t 'resources.host-set.actions.delete'}} - \ No newline at end of file + diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-actions.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-actions.hbs index d01333c17..4c9a91aa3 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-actions.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-actions.hbs @@ -2,8 +2,8 @@ {{t 'resources.host.actions.delete'}} - \ No newline at end of file +