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
29 lines
629 B
JavaScript
29 lines
629 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class ScopesScopeProjectsRoute extends Route {
|
|
// =services
|
|
|
|
@service session;
|
|
|
|
// =methods
|
|
|
|
/**
|
|
* If arriving here unauthenticated, redirect to index for further processing.
|
|
*/
|
|
beforeModel() {
|
|
if (!this.session.isAuthenticated) this.transitionTo('index');
|
|
}
|
|
|
|
/**
|
|
* Loads project scopes for the current scope.
|
|
* @return {Promise
|
|
*/
|
|
model() {
|
|
const currentScope = this.modelFor('scopes.scope');
|
|
return this.store.query('scope', {
|
|
scope_id: currentScope.id,
|
|
});
|
|
}
|
|
}
|