Files
threshold-ui/ui/admin/app/routes/onboarding/quick-setup/create-resources/success.js
T
Cameron Perera c5416e770a feat: 🎸 Add Controller URL component to Success screen (#1135)
* feat: 🎸 Add Controller URL component to Success screen

✅ Closes: ICU-4785

* style: 💄 Update Success screen styles to match wireframe

* refactor: 💡 Update class names to be more descriptive

* refactor: 💡 Update styles for Success card

* test: 💍 Fix failing test
2022-06-14 16:36:11 -05:00

38 lines
1002 B
JavaScript

import Route from '@ember/routing/route';
import { getOwner } from '@ember/application';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
export default class OnboardingQuickSetupCreateResourcesSuccessRoute extends Route {
// =services
@service router;
// =attributes
/**
* Looks up the window object indirectly.
* @type {Window}
*/
get window() {
// The Ember way of accessing globals...
const document = getOwner(this).lookup('service:-document').documentElement;
// defaultView === window, but without using globals directly
return document.parentNode.defaultView;
}
// =methods
model() {
const model = this.modelFor('onboarding.quick-setup.create-resources');
return {
...model,
origin: this.window.location.origin,
};
}
@action
showTargetList(scope) {
const {
project: { id: scopeID },
} = scope;
this.router.transitionTo('scopes.scope.targets', scopeID);
}
}