DEV: Convert theme-upload modal to component-based API (#22699)

This commit is contained in:
Isaac Janzen
2023-07-26 12:46:02 -05:00
committed by GitHub
parent a5b810fe18
commit f3b7351ff6
6 changed files with 167 additions and 186 deletions

View File

@ -14,14 +14,15 @@ import ThemeSettings from "admin/models/theme-settings";
import discourseComputed from "discourse-common/utils/decorators";
import { makeArray } from "discourse-common/lib/helpers";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";
import { url } from "discourse/lib/computed";
import ThemeUploadAddModal from "../components/theme-upload-add";
const THEME_UPLOAD_VAR = 2;
export default class AdminCustomizeThemesShowController extends Controller {
@service dialog;
@service router;
@service modal;
editRouteName = "adminCustomizeThemes.edit";
@ -274,7 +275,12 @@ export default class AdminCustomizeThemesShowController extends Controller {
@action
addUploadModal() {
showModal("admin-add-upload", { admin: true, name: "" });
this.modal.show(ThemeUploadAddModal, {
model: {
themeFields: this.model.theme_fields,
addUpload: this.addUpload,
},
});
}
@action