mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 22:31:53 +08:00
DEV: controllers/admin-site-text-edit
to native class syntax (#28173)
This commit is contained in:
parent
d4479eab73
commit
fa6dbbed1b
@ -6,20 +6,23 @@ import { bufferedProperty } from "discourse/mixins/buffered-content";
|
|||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import I18n from "discourse-i18n";
|
import I18n from "discourse-i18n";
|
||||||
|
|
||||||
export default Controller.extend(bufferedProperty("siteText"), {
|
export default class AdminSiteTextEdit extends Controller.extend(
|
||||||
dialog: service(),
|
bufferedProperty("siteText")
|
||||||
saved: false,
|
) {
|
||||||
queryParams: ["locale"],
|
@service dialog;
|
||||||
|
|
||||||
|
saved = false;
|
||||||
|
queryParams = ["locale"];
|
||||||
|
|
||||||
@discourseComputed("buffered.value")
|
@discourseComputed("buffered.value")
|
||||||
saveDisabled(value) {
|
saveDisabled(value) {
|
||||||
return this.siteText.value === value;
|
return this.siteText.value === value;
|
||||||
},
|
}
|
||||||
|
|
||||||
@discourseComputed("siteText.status")
|
@discourseComputed("siteText.status")
|
||||||
isOutdated(status) {
|
isOutdated(status) {
|
||||||
return status === "outdated";
|
return status === "outdated";
|
||||||
},
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
saveChanges() {
|
saveChanges() {
|
||||||
@ -33,7 +36,7 @@ export default Controller.extend(bufferedProperty("siteText"), {
|
|||||||
this.set("saved", true);
|
this.set("saved", true);
|
||||||
})
|
})
|
||||||
.catch(popupAjaxError);
|
.catch(popupAjaxError);
|
||||||
},
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
revertChanges() {
|
revertChanges() {
|
||||||
@ -52,7 +55,7 @@ export default Controller.extend(bufferedProperty("siteText"), {
|
|||||||
.catch(popupAjaxError);
|
.catch(popupAjaxError);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
dismissOutdated() {
|
dismissOutdated() {
|
||||||
@ -62,9 +65,9 @@ export default Controller.extend(bufferedProperty("siteText"), {
|
|||||||
this.siteText.set("status", "up_to_date");
|
this.siteText.set("status", "up_to_date");
|
||||||
})
|
})
|
||||||
.catch(popupAjaxError);
|
.catch(popupAjaxError);
|
||||||
},
|
}
|
||||||
|
|
||||||
get interpolationKeys() {
|
get interpolationKeys() {
|
||||||
return this.siteText.interpolation_keys.join(", ");
|
return this.siteText.interpolation_keys.join(", ");
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user