2020-05-28 03:26:39 +02:00
|
|
|
import Controller from "@ember/controller";
|
2021-09-09 08:07:12 +02:00
|
|
|
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
2020-04-15 02:46:44 +02:00
|
|
|
|
2020-05-28 03:26:39 +02:00
|
|
|
export default Controller.extend({
|
2023-10-16 03:09:41 +02:00
|
|
|
documentationUrl:
|
|
|
|
"https://pavilion.tech/products/discourse-custom-wizard-plugin/documentation/",
|
2021-03-28 11:06:49 +02:00
|
|
|
|
2021-09-09 08:07:12 +02:00
|
|
|
@discourseComputed("wizardId")
|
|
|
|
wizardName(wizardId) {
|
|
|
|
let currentWizard = this.wizardList.find(
|
|
|
|
(wizard) => wizard.id === wizardId
|
|
|
|
);
|
|
|
|
if (currentWizard) {
|
|
|
|
return currentWizard.name;
|
2021-04-12 08:12:20 +02:00
|
|
|
}
|
2020-04-15 02:46:44 +02:00
|
|
|
},
|
2021-03-28 11:06:49 +02:00
|
|
|
|
2021-09-09 08:07:12 +02:00
|
|
|
@discourseComputed("wizardName")
|
|
|
|
messageOpts(wizardName) {
|
|
|
|
return {
|
|
|
|
wizardName,
|
|
|
|
};
|
2020-04-15 02:46:44 +02:00
|
|
|
},
|
2021-03-28 11:06:49 +02:00
|
|
|
|
2021-09-09 08:07:12 +02:00
|
|
|
@discourseComputed("wizardId")
|
|
|
|
messageKey(wizardId) {
|
|
|
|
let key = "select";
|
|
|
|
|
|
|
|
if (wizardId) {
|
|
|
|
key = "viewing";
|
|
|
|
}
|
2021-03-28 11:06:49 +02:00
|
|
|
|
2021-09-09 08:07:12 +02:00
|
|
|
return key;
|
2021-03-28 11:06:49 +02:00
|
|
|
},
|
|
|
|
});
|