Ghost/ghost/admin/app/controllers/settings/design.js
Kevin Ansfield 63b1e1d385 Dropped intermediate design screen and moved to full-overlay modal
refs https://github.com/TryGhost/Team/issues/1111
refs https://github.com/TryGhost/Team/issues/1103

- moved customize modal from a link on the design screen to the main design screen
- changed modal design to be a full-screen overlay with side bar that emulates standard Admin design
- added toggled groups of settings in sidebar
  - added `{{set-has}}` helper for use in conditionals matching when a Set contains an object
  - added grouping of theme settings
- dropped unfinished advanced/change theme modals
2021-10-04 16:34:28 +01:00

33 lines
849 B
JavaScript

import Controller from '@ember/controller';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency-decorators';
export default class SettingsDesignController extends Controller {
@service customThemeSettings;
@service notifications;
@service router;
@service settings;
@task
*saveTask() {
try {
if (this.settings.get('errors').length !== 0) {
return;
}
yield Promise.all([
this.settings.save(),
this.customThemeSettings.save()
]);
// ensure task button switches to success state
return true;
} catch (error) {
if (error) {
this.notifications.showAPIError(error);
throw error;
}
}
}
}