2020-04-13 14:17:22 +02:00
|
|
|
import Controller from "@ember/controller";
|
2021-02-24 08:43:35 +01:00
|
|
|
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
|
|
|
import { equal } from "@ember/object/computed";
|
2020-04-13 14:17:22 +02:00
|
|
|
|
|
|
|
export default Controller.extend({
|
2021-02-24 08:43:35 +01:00
|
|
|
creating: equal("wizardId", "create"),
|
|
|
|
|
|
|
|
@discourseComputed("creating", "wizardId")
|
2020-04-13 14:17:22 +02:00
|
|
|
wizardListVal(creating, wizardId) {
|
|
|
|
return creating ? null : wizardId;
|
|
|
|
},
|
2021-02-24 08:43:35 +01:00
|
|
|
|
|
|
|
@discourseComputed("creating", "wizardId")
|
2020-04-20 13:40:32 +02:00
|
|
|
messageKey(creating, wizardId) {
|
2021-02-24 08:43:35 +01:00
|
|
|
let key = "select";
|
2020-04-13 14:17:22 +02:00
|
|
|
if (creating) {
|
2021-02-24 08:43:35 +01:00
|
|
|
key = "create";
|
2020-04-13 14:17:22 +02:00
|
|
|
} else if (wizardId) {
|
2021-02-24 08:43:35 +01:00
|
|
|
key = "edit";
|
2020-04-13 14:17:22 +02:00
|
|
|
}
|
2021-02-24 08:43:35 +01:00
|
|
|
return key;
|
2020-04-20 13:40:32 +02:00
|
|
|
},
|
2021-02-24 08:43:35 +01:00
|
|
|
|
|
|
|
messageUrl: "https://thepavilion.io/c/knowledge/discourse/custom-wizard",
|
|
|
|
});
|