mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Update install-theme
modal extension points (#23444)
This commit is contained in:
parent
894307ff0e
commit
72f124a5d0
@ -26,7 +26,9 @@ export default class InstallTheme extends Component {
|
|||||||
@tracked themeCannotBeInstalled;
|
@tracked themeCannotBeInstalled;
|
||||||
@tracked name;
|
@tracked name;
|
||||||
|
|
||||||
recordType = "theme";
|
recordType = this.args.model.recordType || "theme";
|
||||||
|
keyGenUrl = this.args.model.keyGenUrl || "/admin/themes/generate_key_pair";
|
||||||
|
importUrl = this.args.model.importUrl || "/admin/themes/import";
|
||||||
|
|
||||||
get createTypes() {
|
get createTypes() {
|
||||||
return [
|
return [
|
||||||
@ -121,7 +123,7 @@ export default class InstallTheme extends Component {
|
|||||||
@action
|
@action
|
||||||
async generatePublicKey() {
|
async generatePublicKey() {
|
||||||
try {
|
try {
|
||||||
const pair = await ajax("/admin/themes/generate_key_pair", {
|
const pair = await ajax(this.keyGenUrl, {
|
||||||
type: "POST",
|
type: "POST",
|
||||||
});
|
});
|
||||||
this.publicKey = pair.public_key;
|
this.publicKey = pair.public_key;
|
||||||
@ -211,7 +213,7 @@ export default class InstallTheme extends Component {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const result = await ajax("/admin/themes/import", options);
|
const result = await ajax(this.importUrl, options);
|
||||||
const theme = this.store.createRecord(this.recordType, result.theme);
|
const theme = this.store.createRecord(this.recordType, result.theme);
|
||||||
this.args.model.addTheme(theme);
|
this.args.model.addTheme(theme);
|
||||||
this.args.closeModal();
|
this.args.closeModal();
|
||||||
|
Loading…
Reference in New Issue
Block a user