DEV: Replace bootbox alert dialogs (#190)

This commit is contained in:
Penar Musaraj 2022-10-18 14:13:00 -04:00 committed by GitHub
parent 4236689d27
commit 0deecbe2ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,4 @@
2.9.0.beta8: 729e5a2add46fb4e2d8ed092da05a87ebbfcf05b
2.9.0.beta6: 272e9dd760f82e33f9756866434ddcbe470cdb8e 2.9.0.beta6: 272e9dd760f82e33f9756866434ddcbe470cdb8e
2.9.0.beta2: e7c19ac107dcd37618c7ac7b98530e99c7fe31db 2.9.0.beta2: e7c19ac107dcd37618c7ac7b98530e99c7fe31db
2.8.0.beta3: 23287ece952cb45203819e7b470ebc194c58cb13 2.8.0.beta3: 23287ece952cb45203819e7b470ebc194c58cb13

View File

@ -6,13 +6,14 @@ import { ajax } from "discourse/lib/ajax";
import discourseComputed, { observes } from "discourse-common/utils/decorators"; import discourseComputed, { observes } from "discourse-common/utils/decorators";
import I18n from "I18n"; import I18n from "I18n";
import { Promise } from "rsvp"; import { Promise } from "rsvp";
import bootbox from "bootbox"; import { inject as service } from "@ember/service";
import { get } from "@ember/object"; import { get } from "@ember/object";
import { not, reads, sort } from "@ember/object/computed"; import { not, reads, sort } from "@ember/object/computed";
const NoQuery = Query.create({ name: "No queries", fake: true, group_ids: [] }); const NoQuery = Query.create({ name: "No queries", fake: true, group_ids: [] });
export default Controller.extend({ export default Controller.extend({
dialog: service(),
queryParams: { selectedQueryId: "id", params: "params" }, queryParams: { selectedQueryId: "id", params: "params" },
selectedQueryId: null, selectedQueryId: null,
editDisabled: false, editDisabled: false,
@ -180,11 +181,11 @@ export default Controller.extend({
if (e.jqXHR) { if (e.jqXHR) {
popupAjaxError(e); popupAjaxError(e);
} else if (e instanceof SyntaxError) { } else if (e instanceof SyntaxError) {
bootbox.alert(I18n.t("explorer.import.unparseable_json")); this.dialog.alert(I18n.t("explorer.import.unparseable_json"));
} else if (e instanceof TypeError) { } else if (e instanceof TypeError) {
bootbox.alert(I18n.t("explorer.import.wrong_json")); this.dialog.alert(I18n.t("explorer.import.wrong_json"));
} else { } else {
bootbox.alert(I18n.t("errors.desc.unknown")); this.dialog.alert(I18n.t("errors.desc.unknown"));
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error(e); console.error(e);
} }