diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml
index 74fd773ad..8ec4ff544 100644
--- a/addons/core/translations/resources/en-us.yaml
+++ b/addons/core/translations/resources/en-us.yaml
@@ -193,6 +193,8 @@ org:
title: Welcome to Orgs
settings:
title: Org Settings
+ titles:
+ new: New Org
actions:
delete: Delete Org
project:
@@ -204,6 +206,8 @@ project:
title: Welcome to Projects
settings:
title: Project Settings
+ titles:
+ new: New Project
actions:
delete: Delete Project
user:
diff --git a/ui/admin/app/controllers/scopes/scope/scopes/new.js b/ui/admin/app/controllers/scopes/scope/scopes/new.js
new file mode 100644
index 000000000..f5e1343d9
--- /dev/null
+++ b/ui/admin/app/controllers/scopes/scope/scopes/new.js
@@ -0,0 +1,27 @@
+import Controller from '@ember/controller';
+import { inject as service } from '@ember/service';
+import { computed } from '@ember/object';
+
+export default class ScopesScopeScopesNewController extends Controller {
+ // =services
+
+ @service intl;
+
+ // =attributes
+
+ /**
+ * @type {string}
+ */
+ @computed('intl', 'model.{currentScope,isOrg,isProject}')
+ get breadCrumb() {
+ if (this.model.isOrg) {
+ return this.intl.t('resources.org.titles.new');
+ }
+ /* istanbul ignore else */
+ if (this.model.isProject) {
+ return this.intl.t('resources.project.titles.new');
+ }
+ /* istanbul ignore next */
+ return null;
+ }
+}
diff --git a/ui/admin/app/router.js b/ui/admin/app/router.js
index 3e158c4f4..b3865f84b 100644
--- a/ui/admin/app/router.js
+++ b/ui/admin/app/router.js
@@ -18,9 +18,10 @@ Router.map(function () {
});
});
- this.route('scopes', function () {});
+ this.route('scopes', function () {
+ this.route('new');
+ });
this.route('edit');
- this.route('new');
this.route('users', function () {
this.route('user', { path: ':user_id' }, function () {
diff --git a/ui/admin/app/routes/onboarding/quick-setup/choose-path.js b/ui/admin/app/routes/onboarding/quick-setup/choose-path.js
index 9e8a9397a..f953c18e0 100644
--- a/ui/admin/app/routes/onboarding/quick-setup/choose-path.js
+++ b/ui/admin/app/routes/onboarding/quick-setup/choose-path.js
@@ -17,7 +17,7 @@ export default class OnboardingQuickSetupChoosePathRoute extends Route {
break;
case 'manual':
default:
- this.router.transitionTo('scopes.scope.new', 'global');
+ this.router.transitionTo('scopes.scope.scopes.new', 'global');
break;
}
}
diff --git a/ui/admin/app/routes/scopes/scope.js b/ui/admin/app/routes/scopes/scope.js
index c92df4829..bcca939b1 100644
--- a/ui/admin/app/routes/scopes/scope.js
+++ b/ui/admin/app/routes/scopes/scope.js
@@ -2,6 +2,7 @@ import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { A } from '@ember/array';
import { action } from '@ember/object';
+import { next } from '@ember/runloop';
import { loading } from 'ember-loading';
import { confirm } from 'core/decorators/confirm';
import { notifySuccess, notifyError } from 'core/decorators/notify';
@@ -105,8 +106,10 @@ export default class ScopesScopeRoute extends Route {
@action
cancel(scope) {
const { isNew } = scope;
- scope.rollbackAttributes();
- if (isNew) this.router.transitionTo('scopes.scope');
+ next(() => {
+ scope.rollbackAttributes();
+ if (isNew) this.router.transitionTo('scopes.scope');
+ });
}
/**
diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js
index 16cec5477..a6f73a431 100644
--- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js
+++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js
@@ -24,7 +24,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
'scopes.scope.host-catalogs.host-catalog'
);
const { id: host_catalog_id } = hostCatalog;
- let hostSets
+ let hostSets;
if (
this.can.can('list model', hostCatalog, {
@@ -36,8 +36,8 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
return {
hostCatalog,
- hostSets
- }
+ hostSets,
+ };
}
// =actions
diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/hosts.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/hosts.js
index d00d32627..a7a4cf1ca 100644
--- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/hosts.js
+++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/hosts.js
@@ -37,7 +37,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
return {
hostCatalog,
hosts,
- }
+ };
}
// =actions
diff --git a/ui/admin/app/routes/scopes/scope/new.js b/ui/admin/app/routes/scopes/scope/scopes/new.js
similarity index 93%
rename from ui/admin/app/routes/scopes/scope/new.js
rename to ui/admin/app/routes/scopes/scope/scopes/new.js
index c5de307ba..163482862 100644
--- a/ui/admin/app/routes/scopes/scope/new.js
+++ b/ui/admin/app/routes/scopes/scope/scopes/new.js
@@ -1,7 +1,7 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
-export default class ScopesScopeNewRoute extends Route {
+export default class ScopesScopeScopesNewRoute extends Route {
// =services
@service session;
diff --git a/ui/admin/app/templates/scopes/scope/new.hbs b/ui/admin/app/templates/scopes/scope/new.hbs
deleted file mode 100644
index ead78ec21..000000000
--- a/ui/admin/app/templates/scopes/scope/new.hbs
+++ /dev/null
@@ -1,27 +0,0 @@
-{{page-title (t 'titles.new')}}
-
-
- {{t 'titles.new'}}
-
-
{{t 'resources.org.description'}}
{{/if}} - {{/if}} - {{#if @model.currentScope.isOrg}} + {{else if @model.currentScope.isOrg}}{{t 'resources.org.description'}}
+ {{else if @model.isProject}} +{{t 'resources.project.description'}}
+ {{/if}} +