mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
b226b03f09
refs https://github.com/TryGhost/Toolbox/issues/356 - this commit updates the route to `/settings/history` and moves all the files to their new name so we can avoid further cleanup down the line
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import Controller from '@ember/controller';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class HistoryController extends Controller {
|
|
@service router;
|
|
@service settings;
|
|
@service store;
|
|
|
|
queryParams = ['excludedEvents', 'excludedResources', 'user'];
|
|
|
|
@tracked excludedEvents = null;
|
|
@tracked excludedResources = null;
|
|
@tracked user = null;
|
|
|
|
get fullExcludedEvents() {
|
|
return (this.excludedEvents || '').split(',');
|
|
}
|
|
|
|
get fullExcludedResources() {
|
|
return (this.excludedResources || '').split(',');
|
|
}
|
|
|
|
get userRecord() {
|
|
if (!this.user) {
|
|
return null;
|
|
}
|
|
|
|
// TODO: {reload: true} here shouldn't be needed but without it
|
|
// the template renders nothing if the record is already in the store
|
|
return this.store.findRecord('user', this.user, {reload: true});
|
|
}
|
|
|
|
@action
|
|
changeExcludedItems({excludedEvents, excludedResources} = {}) {
|
|
this.router.transitionTo({queryParams: {excludedEvents, excludedResources}});
|
|
}
|
|
|
|
@action
|
|
changeUser(user) {
|
|
this.router.transitionTo({queryParams: {user: user?.id}});
|
|
}
|
|
}
|