Ghost/ghost/admin/app/components/gh-launch-wizard/customise-design.js
Kevin Ansfield 3cd1eb5826 Standardised brand settings form behaviour
closes https://github.com/TryGhost/Team/issues/506

- launch wizard and brand settings both shared the same design and behaviour for customising brand settings but used duplicated code that had diverged
- extracted the more up-to-date behaviour from the launch wizard into a component
- updated brand settings and launch wizard to use the new component

changes to brand settings modal behaviour:
- preview is no longer interactive
- switches to using iframe contents replacement instead of `postMessage`
2021-03-02 17:10:43 +00:00

26 lines
644 B
JavaScript

import Component from '@glimmer/component';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency-decorators';
export default class GhLaunchWizardCustomiseDesignComponent extends Component {
@service notifications;
@service settings;
willDestroy() {
this.settings.rollbackAttributes();
}
@task
*saveAndContinueTask() {
try {
yield this.settings.save();
this.args.nextStep();
} catch (error) {
if (error) {
this.notifications.showAPIError(error);
throw error;
}
}
}
}