Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Update modal to component API #269

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions assets/javascripts/discourse/components/modal/query-help.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import DModal from "discourse/components/d-modal";
import htmlSafe from "discourse-common/helpers/html-safe";
import i18n from "discourse-common/helpers/i18n";

<template>
janzenisaac marked this conversation as resolved.
Show resolved Hide resolved
<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>
janzenisaac marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +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("router") router;
@service modal;
@service dialog;
@service appEvents;
@service router;
Expand Down Expand Up @@ -271,7 +271,7 @@ export default class PluginsExplorerController extends Controller {

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

@action
Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/routes/group-reports-index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import DiscourseRoute from "discourse/routes/discourse";
import { inject as service } from "@ember/service";

export default class GroupReportsIndexRoute extends DiscourseRoute {
@service router;
Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/routes/group-reports-show.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import DiscourseRoute from "discourse/routes/discourse";
import { inject as service } from "@ember/service";

export default class GroupReportsShowRoute extends DiscourseRoute {
@service router;
Expand Down
6 changes: 0 additions & 6 deletions assets/javascripts/discourse/templates/modal/query-help.hbs

This file was deleted.