diff --git a/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjs b/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjs new file mode 100644 index 00000000000..54432c86a7c --- /dev/null +++ b/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjs @@ -0,0 +1,54 @@ +import Component from "@glimmer/component"; +import { action } from "@ember/object"; +import DButton from "discourse/components/d-button"; +import DModal from "discourse/components/d-modal"; +import i18n from "discourse-common/helpers/i18n"; + +export default class DiscardDraftModal extends Component { + @action + async discardDraft() { + await this.args.model.onDestroyDraft(); + this.args.closeModal(); + } + + @action + async saveDraftAndClose() { + await this.args.model.onSaveDraft(); + this.args.closeModal(); + } + + + + <:body> + + {{i18n "post.cancel_composer.confirm"}} + + + + <:footer> + + {{#if @model.showSaveDraftButton}} + + {{/if}} + + + + +} diff --git a/app/assets/javascripts/discourse/app/components/modal/discard-draft.hbs b/app/assets/javascripts/discourse/app/components/modal/discard-draft.hbs deleted file mode 100644 index fd966f5b665..00000000000 --- a/app/assets/javascripts/discourse/app/components/modal/discard-draft.hbs +++ /dev/null @@ -1,32 +0,0 @@ - - <:body> - - {{i18n "post.cancel_composer.confirm"}} - - - - <:footer> - - {{#if @model.showSaveDraftButton}} - - {{/if}} - - - \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/modal/discard-draft.js b/app/assets/javascripts/discourse/app/components/modal/discard-draft.js deleted file mode 100644 index d113e5af19b..00000000000 --- a/app/assets/javascripts/discourse/app/components/modal/discard-draft.js +++ /dev/null @@ -1,16 +0,0 @@ -import Component from "@glimmer/component"; -import { action } from "@ember/object"; - -export default class DiscardDraftModal extends Component { - @action - async discardDraft() { - await this.args.model.onDestroyDraft(); - this.args.closeModal(); - } - - @action - async saveDraftAndClose() { - await this.args.model.onSaveDraft(); - this.args.closeModal(); - } -}