Ghost/ghost/admin/app/services/session.js
Kevin Ansfield 05a3a11855 welcome tour (#527)
refs https://github.com/TryGhost/Ghost/issues/5168
- adds a `tour` service that handles syncing and management of tour throbbers & content
- adds a `gh-tour-item` component that handles the display of a throbber and it's associated popover when clicked
- uses settings API endpoint to populate viewed tour items on app boot/signin
- adds `liquid-tether@2.0.3` dependency for attaching throbbers and popups
- adds initial tour contents
2017-06-08 22:00:10 +07:00

29 lines
841 B
JavaScript

import RSVP from 'rsvp';
import SessionService from 'ember-simple-auth/services/session';
import computed from 'ember-computed';
import injectService from 'ember-service/inject';
export default SessionService.extend({
feature: injectService(),
store: injectService(),
tour: injectService(),
user: computed(function () {
return this.get('store').queryRecord('user', {id: 'me'});
}),
authenticate() {
return this._super(...arguments).then((authResult) => {
// TODO: remove duplication with application.afterModel
let preloadPromises = [
this.get('feature').fetch(),
this.get('tour').fetchViewed()
];
return RSVP.all(preloadPromises).then(() => {
return authResult;
});
});
}
});