discourse/app/assets/javascripts/admin/addon/routes/admin-config-customize-themes.js
Ted Johansson 1fcb3a8b33
DEV: Port install theme button modal to new themes page (#32834)
We recently added a new themes and components page. We didn't port over the code that enables the Install theme button on Meta. It works by looking for certain query parameters and opening a special version of the install modal.

This PR is a lift-and-shift of that code from the old themes page.
2025-05-22 17:24:37 +08:00

25 lines
611 B
JavaScript
Vendored

import DiscourseRoute from "discourse/routes/discourse";
import { i18n } from "discourse-i18n";
export default class AdminConfigThemesAndComponentsThemesRoute extends DiscourseRoute {
queryParams = {
repoUrl: { replace: true },
repoName: { replace: true },
};
titleToken() {
return i18n("admin.config_areas.themes_and_components.themes.title");
}
async model(params) {
return {
themes: (
await this.store.findAll("theme", {
useConfigAreaEndpoint: true,
})
).content,
repoUrl: params.repoUrl,
repoName: params.repoName,
};
}
}