Skip to content

Commit

Permalink
DEV: Update modal to component API (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
janzenisaac authored Dec 7, 2023
1 parent ac7df5e commit 3dd5ad0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
19 changes: 19 additions & 0 deletions assets/javascripts/discourse/components/modal/query-help.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import DModal from "discourse/components/d-modal";
import htmlSafe from "discourse-common/helpers/html-safe";
import i18n from "discourse-common/helpers/i18n";

const QueryHelp = <template>
<DModal
@title={{i18n "explorer.help.modal_title"}}
@closeModal={{@closeModal}}
>
<:body>
{{htmlSafe (i18n "explorer.help.auto_resolution")}}
{{htmlSafe (i18n "explorer.help.custom_params")}}
{{htmlSafe (i18n "explorer.help.default_values")}}
{{htmlSafe (i18n "explorer.help.data_types")}}
</:body>
</DModal>
</template>;

export default QueryHelp;
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { inject as service } from "@ember/service";
import { Promise } from "rsvp";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";
import { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";
import QueryHelp from "discourse/plugins/discourse-data-explorer/discourse/components/modal/query-help";
import Query from "discourse/plugins/discourse-data-explorer/discourse/models/query";

const NoQuery = Query.create({ name: "No queries", fake: true, group_ids: [] });

export default class PluginsExplorerController extends Controller {
@service modal;
@service dialog;
@service appEvents;
@service router;
Expand Down Expand Up @@ -270,7 +271,7 @@ export default class PluginsExplorerController extends Controller {

@action
showHelpModal() {
showModal("query-help");
this.modal.show(QueryHelp);
}

@action
Expand Down
6 changes: 0 additions & 6 deletions assets/javascripts/discourse/templates/modal/query-help.hbs

This file was deleted.

0 comments on commit 3dd5ad0

Please sign in to comment.