Ensure top-level scopes route within ui/admin and ui/desktop are exactly the same in preparation for future refactor. feat: Add projects/targets route chore: yarn:format output in ui/desktop test: Add basic acceptance tests for projects and targets
24 lines
577 B
JavaScript
24 lines
577 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class ScopesScopeIndexRoute extends Route {
|
|
// =services
|
|
|
|
@service session;
|
|
|
|
// =methods
|
|
|
|
/**
|
|
* Redirects to scopes/scope/authenticate for further processing.
|
|
* If already authenticated, redirects to scopes/scope/scopes to display
|
|
* list of sub scopes.
|
|
*/
|
|
redirect() {
|
|
if (!this.session.isAuthenticated) {
|
|
this.replaceWith('scopes.scope.authenticate');
|
|
} else {
|
|
this.replaceWith('scopes.scope.projects.targets');
|
|
}
|
|
}
|
|
}
|