discourse/app/assets/javascripts/admin/routes/admin-customize-themes.js.es6
Krzysztof Kotlarek 5e29ae3ef5
FEATURE: Warning when component is added and not assigned (#8482)
When a component is installed and not assigned to any theme and the user is changing page, we should display a warning.

If the user decides to skip warning or come back later, a warning should not be shown anymore.

Also, when the user clicks "delete" button right after installation, warning about forgotten themes should not be shown.
2019-12-10 08:43:26 +11:00

26 lines
589 B
JavaScript

import Route from "@ember/routing/route";
import showModal from "discourse/lib/show-modal";
export default Route.extend({
model() {
return this.store.findAll("theme");
},
setupController(controller, model) {
this._super(controller, model);
controller.set("editingTheme", false);
},
actions: {
installModal() {
showModal("admin-install-theme", { admin: true });
},
addTheme(theme) {
this.refresh();
theme.setProperties({ recentlyInstalled: true });
this.transitionTo("adminCustomizeThemes.show", theme.get("id"));
}
}
});