diff --git a/.eslintrc b/.eslintrc index d7350cda7f5..43564589375 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,5 +3,8 @@ "plugins": ["discourse-ember"], "rules": { "discourse-ember/global-ember": 2 + }, + "globals": { + "bootbox": "off" } } diff --git a/app/assets/javascripts/admin/components/admin-watched-word.js b/app/assets/javascripts/admin/components/admin-watched-word.js index 28a17712466..fddad89cb3a 100644 --- a/app/assets/javascripts/admin/components/admin-watched-word.js +++ b/app/assets/javascripts/admin/components/admin-watched-word.js @@ -1,6 +1,7 @@ import I18n from "I18n"; import Component from "@ember/component"; import { iconHTML } from "discourse-common/lib/icon-library"; +import bootbox from "bootbox"; export default Component.extend({ classNames: ["watched-word"], diff --git a/app/assets/javascripts/admin/components/admin-web-hook-event.js b/app/assets/javascripts/admin/components/admin-web-hook-event.js index 11bb2b4024f..79011ce6c5c 100644 --- a/app/assets/javascripts/admin/components/admin-web-hook-event.js +++ b/app/assets/javascripts/admin/components/admin-web-hook-event.js @@ -4,6 +4,7 @@ import Component from "@ember/component"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { ensureJSON, plainJSON, prettyJSON } from "discourse/lib/formatter"; +import bootbox from "bootbox"; export default Component.extend({ tagName: "li", diff --git a/app/assets/javascripts/admin/components/email-styles-editor.js b/app/assets/javascripts/admin/components/email-styles-editor.js index 93d4df6b7d6..35595709914 100644 --- a/app/assets/javascripts/admin/components/email-styles-editor.js +++ b/app/assets/javascripts/admin/components/email-styles-editor.js @@ -2,6 +2,7 @@ import I18n from "I18n"; import discourseComputed from "discourse-common/utils/decorators"; import { reads } from "@ember/object/computed"; import Component from "@ember/component"; +import bootbox from "bootbox"; export default Component.extend({ editorId: reads("fieldName"), diff --git a/app/assets/javascripts/admin/components/embeddable-host.js b/app/assets/javascripts/admin/components/embeddable-host.js index d67a236aa4c..bfb7d8d146c 100644 --- a/app/assets/javascripts/admin/components/embeddable-host.js +++ b/app/assets/javascripts/admin/components/embeddable-host.js @@ -8,6 +8,7 @@ import { bufferedProperty } from "discourse/mixins/buffered-content"; import { on, observes } from "discourse-common/utils/decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; import Category from "discourse/models/category"; +import bootbox from "bootbox"; export default Component.extend(bufferedProperty("host"), { editToggled: false, diff --git a/app/assets/javascripts/admin/components/ip-lookup.js b/app/assets/javascripts/admin/components/ip-lookup.js index d0045555136..40979902215 100644 --- a/app/assets/javascripts/admin/components/ip-lookup.js +++ b/app/assets/javascripts/admin/components/ip-lookup.js @@ -6,6 +6,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { ajax } from "discourse/lib/ajax"; import AdminUser from "admin/models/admin-user"; import copyText from "discourse/lib/copy-text"; +import bootbox from "bootbox"; export default Component.extend({ classNames: ["ip-lookup"], diff --git a/app/assets/javascripts/admin/components/permalink-form.js b/app/assets/javascripts/admin/components/permalink-form.js index 81e9346d6fc..61a1e963d15 100644 --- a/app/assets/javascripts/admin/components/permalink-form.js +++ b/app/assets/javascripts/admin/components/permalink-form.js @@ -4,6 +4,7 @@ import Component from "@ember/component"; import discourseComputed from "discourse-common/utils/decorators"; import { fmt } from "discourse/lib/computed"; import Permalink from "admin/models/permalink"; +import bootbox from "bootbox"; export default Component.extend({ classNames: ["permalink-form"], diff --git a/app/assets/javascripts/admin/components/screened-ip-address-form.js b/app/assets/javascripts/admin/components/screened-ip-address-form.js index ca535d05f3a..711fad2e8fa 100644 --- a/app/assets/javascripts/admin/components/screened-ip-address-form.js +++ b/app/assets/javascripts/admin/components/screened-ip-address-form.js @@ -2,6 +2,8 @@ import I18n from "I18n"; import discourseComputed from "discourse-common/utils/decorators"; import { schedule } from "@ember/runloop"; import Component from "@ember/component"; +import bootbox from "bootbox"; + /** A form to create an IP address that will be blocked or allowed. Example usage: diff --git a/app/assets/javascripts/admin/components/tags-uploader.js b/app/assets/javascripts/admin/components/tags-uploader.js index 7530f29e217..8e0c60c4c5b 100644 --- a/app/assets/javascripts/admin/components/tags-uploader.js +++ b/app/assets/javascripts/admin/components/tags-uploader.js @@ -2,6 +2,7 @@ import I18n from "I18n"; import { alias } from "@ember/object/computed"; import Component from "@ember/component"; import UploadMixin from "discourse/mixins/upload"; +import bootbox from "bootbox"; export default Component.extend(UploadMixin, { type: "csv", diff --git a/app/assets/javascripts/admin/components/watched-word-form.js b/app/assets/javascripts/admin/components/watched-word-form.js index 96ddbffd7c6..942934c61b3 100644 --- a/app/assets/javascripts/admin/components/watched-word-form.js +++ b/app/assets/javascripts/admin/components/watched-word-form.js @@ -3,6 +3,7 @@ import { isEmpty } from "@ember/utils"; import { schedule } from "@ember/runloop"; import Component from "@ember/component"; import WatchedWord from "admin/models/watched-word"; +import bootbox from "bootbox"; import discourseComputed, { on, observes diff --git a/app/assets/javascripts/admin/components/watched-word-uploader.js b/app/assets/javascripts/admin/components/watched-word-uploader.js index dceecea2280..fd8c8e62ef7 100644 --- a/app/assets/javascripts/admin/components/watched-word-uploader.js +++ b/app/assets/javascripts/admin/components/watched-word-uploader.js @@ -3,6 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { alias } from "@ember/object/computed"; import Component from "@ember/component"; import UploadMixin from "discourse/mixins/upload"; +import bootbox from "bootbox"; export default Component.extend(UploadMixin, { type: "txt", diff --git a/app/assets/javascripts/admin/controllers/admin-backups-index.js b/app/assets/javascripts/admin/controllers/admin-backups-index.js index c3b43450b19..8719be10793 100644 --- a/app/assets/javascripts/admin/controllers/admin-backups-index.js +++ b/app/assets/javascripts/admin/controllers/admin-backups-index.js @@ -4,6 +4,7 @@ import Controller, { inject as controller } from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import discourseComputed from "discourse-common/utils/decorators"; import { setting, i18n } from "discourse/lib/computed"; +import bootbox from "bootbox"; export default Controller.extend({ adminBackups: controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-badges-award.js b/app/assets/javascripts/admin/controllers/admin-badges-award.js index d7945b15c73..9c37dff9642 100644 --- a/app/assets/javascripts/admin/controllers/admin-badges-award.js +++ b/app/assets/javascripts/admin/controllers/admin-badges-award.js @@ -2,6 +2,7 @@ import I18n from "I18n"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; export default Controller.extend({ saving: false, diff --git a/app/assets/javascripts/admin/controllers/admin-badges-show.js b/app/assets/javascripts/admin/controllers/admin-badges-show.js index 6a44fe4ae47..7903951ca02 100644 --- a/app/assets/javascripts/admin/controllers/admin-badges-show.js +++ b/app/assets/javascripts/admin/controllers/admin-badges-show.js @@ -6,6 +6,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import { propertyNotEqual } from "discourse/lib/computed"; import { run } from "@ember/runloop"; +import bootbox from "bootbox"; export default Controller.extend(bufferedProperty("model"), { adminBadges: controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js b/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js index 61f6e5d6e75..9ca23f186c7 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js +++ b/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js @@ -2,6 +2,7 @@ import I18n from "I18n"; import discourseComputed from "discourse-common/utils/decorators"; import { later } from "@ember/runloop"; import Controller from "@ember/controller"; +import bootbox from "bootbox"; export default Controller.extend({ @discourseComputed("model.colors", "onlyOverridden") diff --git a/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js b/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js index 0daf5c7973e..b79d8535412 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js +++ b/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js @@ -1,6 +1,7 @@ import I18n from "I18n"; import discourseComputed from "discourse-common/utils/decorators"; import Controller from "@ember/controller"; +import bootbox from "bootbox"; export default Controller.extend({ @discourseComputed("model.isSaving") diff --git a/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js b/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js index 22c902ed45d..5bf8c6a1718 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js +++ b/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js @@ -5,6 +5,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import { action } from "@ember/object"; import { inject as controller } from "@ember/controller"; +import bootbox from "bootbox"; export default Controller.extend(bufferedProperty("emailTemplate"), { adminCustomizeEmailTemplates: controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js index 2c5ad32a182..4247956f51f 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js +++ b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js @@ -15,6 +15,7 @@ import showModal from "discourse/lib/show-modal"; import ThemeSettings from "admin/models/theme-settings"; import { THEMES, COMPONENTS } from "admin/models/theme"; import EmberObject from "@ember/object"; +import bootbox from "bootbox"; const THEME_UPLOAD_VAR = 2; diff --git a/app/assets/javascripts/admin/controllers/admin-email-index.js b/app/assets/javascripts/admin/controllers/admin-email-index.js index 8fad5ff0340..af879a3e320 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-index.js +++ b/app/assets/javascripts/admin/controllers/admin-email-index.js @@ -3,6 +3,7 @@ import { empty } from "@ember/object/computed"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { observes } from "discourse-common/utils/decorators"; +import bootbox from "bootbox"; export default Controller.extend({ /** diff --git a/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js b/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js index 66b393196a5..8f8f4b4211e 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js +++ b/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js @@ -2,6 +2,7 @@ import { empty, or, notEmpty } from "@ember/object/computed"; import Controller from "@ember/controller"; import EmailPreview from "admin/models/email-preview"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; export default Controller.extend({ username: null, diff --git a/app/assets/javascripts/admin/controllers/admin-emojis.js b/app/assets/javascripts/admin/controllers/admin-emojis.js index 96b9e1ff8ec..255638ea0c7 100644 --- a/app/assets/javascripts/admin/controllers/admin-emojis.js +++ b/app/assets/javascripts/admin/controllers/admin-emojis.js @@ -3,6 +3,7 @@ import { sort } from "@ember/object/computed"; import EmberObject, { action, computed } from "@ember/object"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; +import bootbox from "bootbox"; const ALL_FILTER = "all"; diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js b/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js index 73a780e2787..8899d010285 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js @@ -6,6 +6,7 @@ import { exportEntity } from "discourse/lib/export-csv"; import ScreenedIpAddress from "admin/models/screened-ip-address"; import { observes } from "discourse-common/utils/decorators"; import { INPUT_DELAY } from "discourse-common/config/environment"; +import bootbox from "bootbox"; export default Controller.extend({ loading: false, diff --git a/app/assets/javascripts/admin/controllers/admin-permalinks.js b/app/assets/javascripts/admin/controllers/admin-permalinks.js index 23c47f57399..e57ad34dac0 100644 --- a/app/assets/javascripts/admin/controllers/admin-permalinks.js +++ b/app/assets/javascripts/admin/controllers/admin-permalinks.js @@ -4,6 +4,7 @@ import discourseDebounce from "discourse/lib/debounce"; import Permalink from "admin/models/permalink"; import { observes } from "discourse-common/utils/decorators"; import { INPUT_DELAY } from "discourse-common/config/environment"; +import bootbox from "bootbox"; export default Controller.extend({ loading: false, diff --git a/app/assets/javascripts/admin/controllers/admin-site-text-edit.js b/app/assets/javascripts/admin/controllers/admin-site-text-edit.js index 417c8238247..91f1103e011 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-text-edit.js +++ b/app/assets/javascripts/admin/controllers/admin-site-text-edit.js @@ -3,6 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { bufferedProperty } from "discourse/mixins/buffered-content"; +import bootbox from "bootbox"; export default Controller.extend(bufferedProperty("siteText"), { saved: false, diff --git a/app/assets/javascripts/admin/controllers/admin-user-badges.js b/app/assets/javascripts/admin/controllers/admin-user-badges.js index 63e7edca25f..fec04fdd9f3 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-badges.js +++ b/app/assets/javascripts/admin/controllers/admin-user-badges.js @@ -5,6 +5,7 @@ import { next } from "@ember/runloop"; import Controller, { inject as controller } from "@ember/controller"; import GrantBadgeController from "discourse/mixins/grant-badge-controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; export default Controller.extend(GrantBadgeController, { adminUser: controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-user-fields.js b/app/assets/javascripts/admin/controllers/admin-user-fields.js index 61e916748b9..813cc19744e 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-fields.js +++ b/app/assets/javascripts/admin/controllers/admin-user-fields.js @@ -2,6 +2,7 @@ import I18n from "I18n"; import { gte, sort } from "@ember/object/computed"; import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; const MAX_FIELDS = 20; diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js b/app/assets/javascripts/admin/controllers/admin-user-index.js index de6545056f7..aa025a8e36e 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-index.js +++ b/app/assets/javascripts/admin/controllers/admin-user-index.js @@ -11,6 +11,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { fmt } from "discourse/lib/computed"; import { htmlSafe } from "@ember/template"; import showModal from "discourse/lib/show-modal"; +import bootbox from "bootbox"; export default Controller.extend(CanCheckEmails, { adminTools: service(), diff --git a/app/assets/javascripts/admin/controllers/admin-watched-words-action.js b/app/assets/javascripts/admin/controllers/admin-watched-words-action.js index 1a8070569f4..6a692b63ab4 100644 --- a/app/assets/javascripts/admin/controllers/admin-watched-words-action.js +++ b/app/assets/javascripts/admin/controllers/admin-watched-words-action.js @@ -7,6 +7,7 @@ import WatchedWord from "admin/models/watched-word"; import { ajax } from "discourse/lib/ajax"; import { fmt } from "discourse/lib/computed"; import showModal from "discourse/lib/show-modal"; +import bootbox from "bootbox"; export default Controller.extend({ adminWatchedWords: controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js b/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js index e6f20ee2f52..2e92b09189b 100644 --- a/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js +++ b/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js @@ -7,6 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import { extractDomainFromUrl } from "discourse/lib/utilities"; import EmberObject from "@ember/object"; import { isAbsoluteURL } from "discourse-common/lib/get-url"; +import bootbox from "bootbox"; export default Controller.extend({ adminWebHooks: controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-web-hooks.js b/app/assets/javascripts/admin/controllers/admin-web-hooks.js index ec025662ef4..213bb249e2b 100644 --- a/app/assets/javascripts/admin/controllers/admin-web-hooks.js +++ b/app/assets/javascripts/admin/controllers/admin-web-hooks.js @@ -1,6 +1,7 @@ import I18n from "I18n"; import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; export default Controller.extend({ actions: { diff --git a/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js b/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js index 1372f16ca93..65eb0d00137 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js +++ b/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js @@ -4,6 +4,7 @@ import { A } from "@ember/array"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { observes } from "discourse-common/utils/decorators"; +import bootbox from "bootbox"; export default Controller.extend(ModalFunctionality, { @observes("model") diff --git a/app/assets/javascripts/admin/controllers/modals/admin-reseed.js b/app/assets/javascripts/admin/controllers/modals/admin-reseed.js index 44bf29a2070..a9f52dc86a7 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-reseed.js +++ b/app/assets/javascripts/admin/controllers/modals/admin-reseed.js @@ -2,6 +2,7 @@ import I18n from "I18n"; import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; +import bootbox from "bootbox"; export default Controller.extend(ModalFunctionality, { loading: true, diff --git a/app/assets/javascripts/admin/mixins/penalty-controller.js b/app/assets/javascripts/admin/mixins/penalty-controller.js index 73349e10677..ca4069a99c9 100644 --- a/app/assets/javascripts/admin/mixins/penalty-controller.js +++ b/app/assets/javascripts/admin/mixins/penalty-controller.js @@ -4,6 +4,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import Mixin from "@ember/object/mixin"; import { next } from "@ember/runloop"; import { Promise } from "rsvp"; +import bootbox from "bootbox"; export default Mixin.create(ModalFunctionality, { reason: null, diff --git a/app/assets/javascripts/admin/models/admin-user.js b/app/assets/javascripts/admin/models/admin-user.js index 53e469c465f..8ab76f2947c 100644 --- a/app/assets/javascripts/admin/models/admin-user.js +++ b/app/assets/javascripts/admin/models/admin-user.js @@ -10,6 +10,7 @@ import Group from "discourse/models/group"; import DiscourseURL, { userPath } from "discourse/lib/url"; import { Promise } from "rsvp"; import User from "discourse/models/user"; +import bootbox from "bootbox"; const wrapAdmin = user => (user ? AdminUser.create(user) : null); diff --git a/app/assets/javascripts/admin/models/backup.js b/app/assets/javascripts/admin/models/backup.js index 0b6f7122a4d..e44a945bf0e 100644 --- a/app/assets/javascripts/admin/models/backup.js +++ b/app/assets/javascripts/admin/models/backup.js @@ -4,6 +4,7 @@ import { ajax } from "discourse/lib/ajax"; import { extractError } from "discourse/lib/ajax-error"; import EmberObject from "@ember/object"; import MessageBus from "message-bus-client"; +import bootbox from "bootbox"; const Backup = EmberObject.extend({ destroy() { diff --git a/app/assets/javascripts/admin/models/theme.js b/app/assets/javascripts/admin/models/theme.js index 06d5faeefc2..32bcdb2cc06 100644 --- a/app/assets/javascripts/admin/models/theme.js +++ b/app/assets/javascripts/admin/models/theme.js @@ -9,6 +9,7 @@ import { ajax } from "discourse/lib/ajax"; import { escapeExpression } from "discourse/lib/utilities"; import highlightSyntax from "discourse/lib/highlight-syntax"; import { url } from "discourse/lib/computed"; +import bootbox from "bootbox"; const THEME_UPLOAD_VAR = 2; const FIELDS_IDS = [0, 1, 5]; diff --git a/app/assets/javascripts/admin/routes/admin-backups.js b/app/assets/javascripts/admin/routes/admin-backups.js index aa7c88aba98..10dd19e06b6 100644 --- a/app/assets/javascripts/admin/routes/admin-backups.js +++ b/app/assets/javascripts/admin/routes/admin-backups.js @@ -8,6 +8,7 @@ import BackupStatus from "admin/models/backup-status"; import Backup from "admin/models/backup"; import PreloadStore from "discourse/lib/preload-store"; import User from "discourse/models/user"; +import bootbox from "bootbox"; const LOG_CHANNEL = "/admin/backups/logs"; diff --git a/app/assets/javascripts/admin/routes/admin-badges-show.js b/app/assets/javascripts/admin/routes/admin-badges-show.js index 7a74db7161c..125ae9430c0 100644 --- a/app/assets/javascripts/admin/routes/admin-badges-show.js +++ b/app/assets/javascripts/admin/routes/admin-badges-show.js @@ -4,6 +4,7 @@ import Route from "@ember/routing/route"; import { ajax } from "discourse/lib/ajax"; import Badge from "discourse/models/badge"; import showModal from "discourse/lib/show-modal"; +import bootbox from "bootbox"; export default Route.extend({ serialize(m) { diff --git a/app/assets/javascripts/admin/routes/admin-customize-email-style-edit.js b/app/assets/javascripts/admin/routes/admin-customize-email-style-edit.js index d3a2b035af0..9953da2344b 100644 --- a/app/assets/javascripts/admin/routes/admin-customize-email-style-edit.js +++ b/app/assets/javascripts/admin/routes/admin-customize-email-style-edit.js @@ -1,5 +1,7 @@ import I18n from "I18n"; import Route from "@ember/routing/route"; +import bootbox from "bootbox"; + export default Route.extend({ model(params) { return { diff --git a/app/assets/javascripts/admin/routes/admin-customize-themes-edit.js b/app/assets/javascripts/admin/routes/admin-customize-themes-edit.js index 5cb695ddcd5..44b8e9fb17b 100644 --- a/app/assets/javascripts/admin/routes/admin-customize-themes-edit.js +++ b/app/assets/javascripts/admin/routes/admin-customize-themes-edit.js @@ -1,5 +1,7 @@ import I18n from "I18n"; import Route from "@ember/routing/route"; +import bootbox from "bootbox"; + export default Route.extend({ model(params) { const all = this.modelFor("adminCustomizeThemes"); diff --git a/app/assets/javascripts/admin/services/admin-tools.js b/app/assets/javascripts/admin/services/admin-tools.js index 6d49fc395d1..61a77a33d5e 100644 --- a/app/assets/javascripts/admin/services/admin-tools.js +++ b/app/assets/javascripts/admin/services/admin-tools.js @@ -10,6 +10,7 @@ import showModal from "discourse/lib/show-modal"; import { getOwner } from "discourse-common/lib/get-owner"; import Service from "@ember/service"; import { Promise } from "rsvp"; +import bootbox from "bootbox"; export default Service.extend({ init() { diff --git a/app/assets/javascripts/discourse-shims.js b/app/assets/javascripts/discourse-shims.js index 9a86440123e..df7de1166a4 100644 --- a/app/assets/javascripts/discourse-shims.js +++ b/app/assets/javascripts/discourse-shims.js @@ -21,6 +21,10 @@ define("ember-buffered-proxy/proxy", ["exports"], function(__exports__) { __exports__.default = window.BufferedProxy; }); +define("bootbox", ["exports"], function(__exports__) { + __exports__.default = window.bootbox; +}); + define("@popperjs/core", ["exports"], function(__exports__) { __exports__.default = window.Popper; __exports__.createPopper = window.Popper.createPopper; diff --git a/app/assets/javascripts/discourse/app/components/badge-title.js b/app/assets/javascripts/discourse/app/components/badge-title.js index bda31c93af1..267013f501c 100644 --- a/app/assets/javascripts/discourse/app/components/badge-title.js +++ b/app/assets/javascripts/discourse/app/components/badge-title.js @@ -1,6 +1,7 @@ import I18n from "I18n"; import Component from "@ember/component"; import { ajax } from "discourse/lib/ajax"; +import bootbox from "bootbox"; export default Component.extend({ classNames: ["badge-title"], diff --git a/app/assets/javascripts/discourse/app/components/bookmark-list.js b/app/assets/javascripts/discourse/app/components/bookmark-list.js index 1a5917a7d97..0841f3edcfe 100644 --- a/app/assets/javascripts/discourse/app/components/bookmark-list.js +++ b/app/assets/javascripts/discourse/app/components/bookmark-list.js @@ -6,6 +6,7 @@ import { shouldOpenInNewTab, openLinkInNewTab } from "discourse/lib/click-track"; +import bootbox from "bootbox"; export default Component.extend({ classNames: ["bookmark-list-wrapper"], diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.js b/app/assets/javascripts/discourse/app/components/composer-editor.js index a17838f0924..f777ec1b5ab 100644 --- a/app/assets/javascripts/discourse/app/components/composer-editor.js +++ b/app/assets/javascripts/discourse/app/components/composer-editor.js @@ -36,6 +36,7 @@ import { getUploadMarkdown, displayErrorForUpload } from "discourse/lib/uploads"; +import bootbox from "bootbox"; import { cacheShortUploadUrl, diff --git a/app/assets/javascripts/discourse/app/components/csv-uploader.js b/app/assets/javascripts/discourse/app/components/csv-uploader.js index abc8e061b13..dd946db9555 100644 --- a/app/assets/javascripts/discourse/app/components/csv-uploader.js +++ b/app/assets/javascripts/discourse/app/components/csv-uploader.js @@ -3,6 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import Component from "@ember/component"; import UploadMixin from "discourse/mixins/upload"; import { on } from "@ember/object/evented"; +import bootbox from "bootbox"; export default Component.extend(UploadMixin, { type: "csv", diff --git a/app/assets/javascripts/discourse/app/components/d-document.js b/app/assets/javascripts/discourse/app/components/d-document.js index 4264a34a965..817a8ab95d4 100644 --- a/app/assets/javascripts/discourse/app/components/d-document.js +++ b/app/assets/javascripts/discourse/app/components/d-document.js @@ -4,6 +4,7 @@ import { bind } from "discourse-common/utils/decorators"; import logout from "discourse/lib/logout"; import I18n from "I18n"; import { setLogoffCallback } from "discourse/lib/ajax"; +import bootbox from "bootbox"; export default Component.extend({ tagName: "", diff --git a/app/assets/javascripts/discourse/app/components/d-navigation.js b/app/assets/javascripts/discourse/app/components/d-navigation.js index b8324f6e1b7..ba223c48fa7 100644 --- a/app/assets/javascripts/discourse/app/components/d-navigation.js +++ b/app/assets/javascripts/discourse/app/components/d-navigation.js @@ -3,6 +3,7 @@ import NavItem from "discourse/models/nav-item"; import { inject as service } from "@ember/service"; import Component from "@ember/component"; import FilterModeMixin from "discourse/mixins/filter-mode"; +import bootbox from "bootbox"; export default Component.extend(FilterModeMixin, { router: service(), diff --git a/app/assets/javascripts/discourse/app/components/group-membership-button.js b/app/assets/javascripts/discourse/app/components/group-membership-button.js index 88985455dda..e0237764aea 100644 --- a/app/assets/javascripts/discourse/app/components/group-membership-button.js +++ b/app/assets/javascripts/discourse/app/components/group-membership-button.js @@ -3,6 +3,7 @@ import Component from "@ember/component"; import discourseComputed from "discourse-common/utils/decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; import showModal from "discourse/lib/show-modal"; +import bootbox from "bootbox"; export default Component.extend({ classNames: ["group-membership-button"], diff --git a/app/assets/javascripts/discourse/app/components/reviewable-item.js b/app/assets/javascripts/discourse/app/components/reviewable-item.js index 3d028a8bf8d..8dba457839e 100644 --- a/app/assets/javascripts/discourse/app/components/reviewable-item.js +++ b/app/assets/javascripts/discourse/app/components/reviewable-item.js @@ -8,6 +8,7 @@ import optionalService from "discourse/lib/optional-service"; import showModal from "discourse/lib/show-modal"; import { dasherize } from "@ember/string"; import { set } from "@ember/object"; +import bootbox from "bootbox"; let _components = {}; diff --git a/app/assets/javascripts/discourse/app/components/shared-draft-controls.js b/app/assets/javascripts/discourse/app/components/shared-draft-controls.js index 5a9e6436c8e..970f5f88fb5 100644 --- a/app/assets/javascripts/discourse/app/components/shared-draft-controls.js +++ b/app/assets/javascripts/discourse/app/components/shared-draft-controls.js @@ -1,6 +1,7 @@ import I18n from "I18n"; import discourseComputed from "discourse-common/utils/decorators"; import Component from "@ember/component"; +import bootbox from "bootbox"; export default Component.extend({ tagName: "", diff --git a/app/assets/javascripts/discourse/app/components/tag-groups-form.js b/app/assets/javascripts/discourse/app/components/tag-groups-form.js index a1df90730cb..209413446e8 100644 --- a/app/assets/javascripts/discourse/app/components/tag-groups-form.js +++ b/app/assets/javascripts/discourse/app/components/tag-groups-form.js @@ -4,6 +4,7 @@ import { isEmpty } from "@ember/utils"; import Component from "@ember/component"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import PermissionType from "discourse/models/permission-type"; +import bootbox from "bootbox"; export default Component.extend(bufferedProperty("model"), { tagName: "", diff --git a/app/assets/javascripts/discourse/app/components/tag-info.js b/app/assets/javascripts/discourse/app/components/tag-info.js index c4fa98ccc2d..99af98eb092 100644 --- a/app/assets/javascripts/discourse/app/components/tag-info.js +++ b/app/assets/javascripts/discourse/app/components/tag-info.js @@ -6,6 +6,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import Component from "@ember/component"; import { reads, and } from "@ember/object/computed"; import { isEmpty } from "@ember/utils"; +import bootbox from "bootbox"; export default Component.extend({ tagName: "", diff --git a/app/assets/javascripts/discourse/app/controllers/bookmark.js b/app/assets/javascripts/discourse/app/controllers/bookmark.js index f3cd123713d..494e33dd805 100644 --- a/app/assets/javascripts/discourse/app/controllers/bookmark.js +++ b/app/assets/javascripts/discourse/app/controllers/bookmark.js @@ -13,6 +13,7 @@ import { ajax } from "discourse/lib/ajax"; import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts"; import { formattedReminderTime, REMINDER_TYPES } from "discourse/lib/bookmark"; import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark"; +import bootbox from "bootbox"; // global shortcuts that interfere with these modal shortcuts, they are rebound when the // modal is closed diff --git a/app/assets/javascripts/discourse/app/controllers/composer.js b/app/assets/javascripts/discourse/app/controllers/composer.js index 62b79702fc6..d374577edda 100644 --- a/app/assets/javascripts/discourse/app/controllers/composer.js +++ b/app/assets/javascripts/discourse/app/controllers/composer.js @@ -27,6 +27,7 @@ import { Promise } from "rsvp"; import { isTesting } from "discourse-common/config/environment"; import EmberObject, { computed, action } from "@ember/object"; import deprecated from "discourse-common/lib/deprecated"; +import bootbox from "bootbox"; function loadDraft(store, opts) { let promise = Promise.resolve(); diff --git a/app/assets/javascripts/discourse/app/controllers/edit-category.js b/app/assets/javascripts/discourse/app/controllers/edit-category.js index 3cf6cea1828..55e3db9e978 100644 --- a/app/assets/javascripts/discourse/app/controllers/edit-category.js +++ b/app/assets/javascripts/discourse/app/controllers/edit-category.js @@ -9,6 +9,7 @@ import discourseComputed, { observes } from "discourse-common/utils/decorators"; import Category from "discourse/models/category"; +import bootbox from "bootbox"; export default Controller.extend(ModalFunctionality, { selectedTab: null, diff --git a/app/assets/javascripts/discourse/app/controllers/feature-topic.js b/app/assets/javascripts/discourse/app/controllers/feature-topic.js index 253bce8eb22..7ca6da04579 100644 --- a/app/assets/javascripts/discourse/app/controllers/feature-topic.js +++ b/app/assets/javascripts/discourse/app/controllers/feature-topic.js @@ -6,6 +6,7 @@ import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { categoryLinkHTML } from "discourse/helpers/category-link"; import EmberObject from "@ember/object"; +import bootbox from "bootbox"; export default Controller.extend(ModalFunctionality, { topicController: inject("topic"), diff --git a/app/assets/javascripts/discourse/app/controllers/group.js b/app/assets/javascripts/discourse/app/controllers/group.js index 7073fcf1c7a..7c04a1c1189 100644 --- a/app/assets/javascripts/discourse/app/controllers/group.js +++ b/app/assets/javascripts/discourse/app/controllers/group.js @@ -5,6 +5,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { inject as service } from "@ember/service"; import { readOnly } from "@ember/object/computed"; import deprecated from "discourse-common/lib/deprecated"; +import bootbox from "bootbox"; const Tab = EmberObject.extend({ init() { diff --git a/app/assets/javascripts/discourse/app/controllers/groups-new.js b/app/assets/javascripts/discourse/app/controllers/groups-new.js index 94a598cbf19..4eab5e1b67c 100644 --- a/app/assets/javascripts/discourse/app/controllers/groups-new.js +++ b/app/assets/javascripts/discourse/app/controllers/groups-new.js @@ -3,6 +3,7 @@ import { action } from "@ember/object"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; export function popupAutomaticMembershipAlert(group_id, email_domains) { if (!email_domains) { diff --git a/app/assets/javascripts/discourse/app/controllers/history.js b/app/assets/javascripts/discourse/app/controllers/history.js index b2bbe94d0fa..7ae18686f79 100644 --- a/app/assets/javascripts/discourse/app/controllers/history.js +++ b/app/assets/javascripts/discourse/app/controllers/history.js @@ -11,6 +11,7 @@ import { iconHTML } from "discourse-common/lib/icon-library"; import Post from "discourse/models/post"; import Category from "discourse/models/category"; import { computed } from "@ember/object"; +import bootbox from "bootbox"; function customTagArray(fieldName) { return computed(fieldName, function() { diff --git a/app/assets/javascripts/discourse/app/controllers/login.js b/app/assets/javascripts/discourse/app/controllers/login.js index 870c75d9000..f43886ab8c8 100644 --- a/app/assets/javascripts/discourse/app/controllers/login.js +++ b/app/assets/javascripts/discourse/app/controllers/login.js @@ -16,6 +16,7 @@ import { escapeExpression, areCookiesEnabled } from "discourse/lib/utilities"; import { extractError } from "discourse/lib/ajax-error"; import { SECOND_FACTOR_METHODS } from "discourse/models/user"; import { getWebauthnCredential } from "discourse/lib/webauthn"; +import bootbox from "bootbox"; // This is happening outside of the app via popup const AuthErrors = [ diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/account.js b/app/assets/javascripts/discourse/app/controllers/preferences/account.js index 6eecf3e7e94..45912ae7a67 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/account.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/account.js @@ -13,6 +13,7 @@ import { ajax } from "discourse/lib/ajax"; import { userPath } from "discourse/lib/url"; import logout from "discourse/lib/logout"; import EmberObject from "@ember/object"; +import bootbox from "bootbox"; // Number of tokens shown by default. const DEFAULT_AUTH_TOKENS_COUNT = 2; diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/profile.js b/app/assets/javascripts/discourse/app/controllers/preferences/profile.js index 54941de50e8..c3d89a2466b 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/profile.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/profile.js @@ -8,6 +8,7 @@ import { cookAsync } from "discourse/lib/text"; import { ajax } from "discourse/lib/ajax"; import showModal from "discourse/lib/show-modal"; import { readOnly } from "@ember/object/computed"; +import bootbox from "bootbox"; export default Controller.extend({ init() { diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js b/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js index 6babce0b193..4b885ff8b68 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js @@ -8,6 +8,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import { findAll } from "discourse/models/login-method"; import { SECOND_FACTOR_METHODS } from "discourse/models/user"; import showModal from "discourse/lib/show-modal"; +import bootbox from "bootbox"; export default Controller.extend(CanCheckEmails, { loading: false, diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/username.js b/app/assets/javascripts/discourse/app/controllers/preferences/username.js index 8e13897bd9b..526a9e57ab2 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/username.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/username.js @@ -8,6 +8,7 @@ import DiscourseURL from "discourse/lib/url"; import { userPath } from "discourse/lib/url"; import { popupAjaxError } from "discourse/lib/ajax-error"; import User from "discourse/models/user"; +import bootbox from "bootbox"; export default Controller.extend({ taken: false, diff --git a/app/assets/javascripts/discourse/app/controllers/tags-index.js b/app/assets/javascripts/discourse/app/controllers/tags-index.js index 3d689eb4e7a..2f0d8b28583 100644 --- a/app/assets/javascripts/discourse/app/controllers/tags-index.js +++ b/app/assets/javascripts/discourse/app/controllers/tags-index.js @@ -5,6 +5,7 @@ import Controller from "@ember/controller"; import showModal from "discourse/lib/show-modal"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; export default Controller.extend({ sortedByCount: true, diff --git a/app/assets/javascripts/discourse/app/controllers/tags-show.js b/app/assets/javascripts/discourse/app/controllers/tags-show.js index 64d772d0789..42d6bceefc1 100644 --- a/app/assets/javascripts/discourse/app/controllers/tags-show.js +++ b/app/assets/javascripts/discourse/app/controllers/tags-show.js @@ -6,6 +6,7 @@ import BulkTopicSelection from "discourse/mixins/bulk-topic-selection"; import NavItem from "discourse/models/nav-item"; import FilterModeMixin from "discourse/mixins/filter-mode"; import { queryParams } from "discourse/controllers/discovery-sortable"; +import bootbox from "bootbox"; export default Controller.extend(BulkTopicSelection, FilterModeMixin, { application: controller(), diff --git a/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js b/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js index 04454ebebe7..71fbd136bb5 100644 --- a/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js +++ b/app/assets/javascripts/discourse/app/controllers/topic-bulk-actions.js @@ -4,6 +4,7 @@ import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import Topic from "discourse/models/topic"; import Category from "discourse/models/category"; +import bootbox from "bootbox"; const _buttons = []; diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.js index a1cdb9a8e0e..07cfe1ade9d 100644 --- a/app/assets/javascripts/discourse/app/controllers/topic.js +++ b/app/assets/javascripts/discourse/app/controllers/topic.js @@ -25,6 +25,7 @@ import { Promise } from "rsvp"; import { escapeExpression } from "discourse/lib/utilities"; import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark"; import { inject as service } from "@ember/service"; +import bootbox from "bootbox"; let customPostMessageCallbacks = {}; diff --git a/app/assets/javascripts/discourse/app/controllers/user-activity.js b/app/assets/javascripts/discourse/app/controllers/user-activity.js index be48af10f5b..76eb84ce243 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-activity.js +++ b/app/assets/javascripts/discourse/app/controllers/user-activity.js @@ -4,6 +4,7 @@ import { inject as service } from "@ember/service"; import Controller, { inject as controller } from "@ember/controller"; import { exportUserArchive } from "discourse/lib/export-csv"; import { observes } from "discourse-common/utils/decorators"; +import bootbox from "bootbox"; export default Controller.extend({ application: controller(), diff --git a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js index c75b3085da7..9e778f5ba12 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js +++ b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js @@ -6,6 +6,7 @@ import discourseDebounce from "discourse/lib/debounce"; import { popupAjaxError } from "discourse/lib/ajax-error"; import discourseComputed, { observes } from "discourse-common/utils/decorators"; import { INPUT_DELAY } from "discourse-common/config/environment"; +import bootbox from "bootbox"; export default Controller.extend({ user: null, diff --git a/app/assets/javascripts/discourse/app/controllers/user-private-messages.js b/app/assets/javascripts/discourse/app/controllers/user-private-messages.js index 83cb0638832..7445fdd5513 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-private-messages.js +++ b/app/assets/javascripts/discourse/app/controllers/user-private-messages.js @@ -4,6 +4,7 @@ import { alias, equal, and } from "@ember/object/computed"; import { inject as service } from "@ember/service"; import Controller, { inject as controller } from "@ember/controller"; import Topic from "discourse/models/topic"; +import bootbox from "bootbox"; export default Controller.extend({ userTopicsList: controller("user-topics-list"), diff --git a/app/assets/javascripts/discourse/app/initializers/asset-version.js b/app/assets/javascripts/discourse/app/initializers/asset-version.js index ab1a85fec9b..1136dd0fc74 100644 --- a/app/assets/javascripts/discourse/app/initializers/asset-version.js +++ b/app/assets/javascripts/discourse/app/initializers/asset-version.js @@ -1,5 +1,7 @@ import I18n from "I18n"; import { later } from "@ember/runloop"; +import bootbox from "bootbox"; + // Subscribe to "asset-version" change events via the Message Bus export default { name: "asset-version", diff --git a/app/assets/javascripts/discourse/app/initializers/jquery-plugins.js b/app/assets/javascripts/discourse/app/initializers/jquery-plugins.js index 46388f688f5..153b2901a4d 100644 --- a/app/assets/javascripts/discourse/app/initializers/jquery-plugins.js +++ b/app/assets/javascripts/discourse/app/initializers/jquery-plugins.js @@ -1,4 +1,5 @@ import autocomplete from "discourse/lib/autocomplete"; +import bootbox from "bootbox"; export default { name: "jquery-plugins", diff --git a/app/assets/javascripts/discourse/app/initializers/localization.js b/app/assets/javascripts/discourse/app/initializers/localization.js index fd5a364d6cf..11d2cb3e30c 100644 --- a/app/assets/javascripts/discourse/app/initializers/localization.js +++ b/app/assets/javascripts/discourse/app/initializers/localization.js @@ -1,4 +1,6 @@ import I18n from "I18n"; +import bootbox from "bootbox"; + export default { name: "localization", after: "inject-objects", diff --git a/app/assets/javascripts/discourse/app/initializers/logout.js b/app/assets/javascripts/discourse/app/initializers/logout.js index 76ccca27366..45bb11620a2 100644 --- a/app/assets/javascripts/discourse/app/initializers/logout.js +++ b/app/assets/javascripts/discourse/app/initializers/logout.js @@ -1,5 +1,6 @@ import I18n from "I18n"; import logout from "discourse/lib/logout"; +import bootbox from "bootbox"; let _showingLogout = false; diff --git a/app/assets/javascripts/discourse/app/lib/ajax-error.js b/app/assets/javascripts/discourse/app/lib/ajax-error.js index e0c16b5e45e..e808a297f66 100644 --- a/app/assets/javascripts/discourse/app/lib/ajax-error.js +++ b/app/assets/javascripts/discourse/app/lib/ajax-error.js @@ -1,4 +1,6 @@ import I18n from "I18n"; +import bootbox from "bootbox"; + export function extractError(error, defaultMessage) { if (error instanceof Error) { // eslint-disable-next-line no-console diff --git a/app/assets/javascripts/discourse/app/lib/click-track.js b/app/assets/javascripts/discourse/app/lib/click-track.js index 93543b847e3..2f1da7449ee 100644 --- a/app/assets/javascripts/discourse/app/lib/click-track.js +++ b/app/assets/javascripts/discourse/app/lib/click-track.js @@ -8,6 +8,7 @@ import { selectedText } from "discourse/lib/utilities"; import { Promise } from "rsvp"; import { isTesting } from "discourse-common/config/environment"; import User from "discourse/models/user"; +import bootbox from "bootbox"; export function isValidLink($link) { // .hashtag == category/tag link diff --git a/app/assets/javascripts/discourse/app/lib/export-csv.js b/app/assets/javascripts/discourse/app/lib/export-csv.js index 4f4a1e4b9cc..d1708626177 100644 --- a/app/assets/javascripts/discourse/app/lib/export-csv.js +++ b/app/assets/javascripts/discourse/app/lib/export-csv.js @@ -1,6 +1,7 @@ import I18n from "I18n"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import bootbox from "bootbox"; function exportEntityByType(type, entity, args) { return ajax("/export_csv/export_entity.json", { diff --git a/app/assets/javascripts/discourse/app/lib/export-result.js b/app/assets/javascripts/discourse/app/lib/export-result.js index 9865d9b4615..303708cd603 100644 --- a/app/assets/javascripts/discourse/app/lib/export-result.js +++ b/app/assets/javascripts/discourse/app/lib/export-result.js @@ -1,4 +1,6 @@ import I18n from "I18n"; +import bootbox from "bootbox"; + export function outputExportResult(result) { if (result.success) { bootbox.alert(I18n.t("admin.export_csv.success")); diff --git a/app/assets/javascripts/discourse/app/lib/uploads.js b/app/assets/javascripts/discourse/app/lib/uploads.js index a8bb5f379cb..de2aa052722 100644 --- a/app/assets/javascripts/discourse/app/lib/uploads.js +++ b/app/assets/javascripts/discourse/app/lib/uploads.js @@ -1,5 +1,6 @@ import I18n from "I18n"; import { isAppleDevice } from "discourse/lib/utilities"; +import bootbox from "bootbox"; function isGUID(value) { return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test( diff --git a/app/assets/javascripts/discourse/app/mixins/upload.js b/app/assets/javascripts/discourse/app/mixins/upload.js index 4e51a2a197c..69b36bf836e 100644 --- a/app/assets/javascripts/discourse/app/mixins/upload.js +++ b/app/assets/javascripts/discourse/app/mixins/upload.js @@ -7,6 +7,7 @@ import { import getUrl from "discourse-common/lib/get-url"; import { on } from "@ember/object/evented"; import Mixin from "@ember/object/mixin"; +import bootbox from "bootbox"; export default Mixin.create({ uploading: false, diff --git a/app/assets/javascripts/discourse/app/models/composer.js b/app/assets/javascripts/discourse/app/models/composer.js index 99dc32bf148..ebade501c98 100644 --- a/app/assets/javascripts/discourse/app/models/composer.js +++ b/app/assets/javascripts/discourse/app/models/composer.js @@ -22,6 +22,7 @@ import { Promise } from "rsvp"; import Site from "discourse/models/site"; import User from "discourse/models/user"; import deprecated from "discourse-common/lib/deprecated"; +import bootbox from "bootbox"; // The actions the composer can take export const CREATE_TOPIC = "createTopic", diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.js index c22cba93367..145fd2a2a5c 100644 --- a/app/assets/javascripts/discourse/app/models/topic.js +++ b/app/assets/javascripts/discourse/app/models/topic.js @@ -22,6 +22,7 @@ import Session from "discourse/models/session"; import { Promise } from "rsvp"; import Site from "discourse/models/site"; import User from "discourse/models/user"; +import bootbox from "bootbox"; export function loadTopicView(topic, args) { const data = _.merge({}, args); diff --git a/app/assets/javascripts/discourse/app/routes/application.js b/app/assets/javascripts/discourse/app/routes/application.js index 816b356b06a..c8895411e1a 100644 --- a/app/assets/javascripts/discourse/app/routes/application.js +++ b/app/assets/javascripts/discourse/app/routes/application.js @@ -13,6 +13,7 @@ import { getOwner } from "discourse-common/lib/get-owner"; import { userPath } from "discourse/lib/url"; import Composer from "discourse/models/composer"; import { inject as service } from "@ember/service"; +import bootbox from "bootbox"; function unlessReadOnly(method, message) { return function() { diff --git a/app/assets/javascripts/discourse/app/routes/new-message.js b/app/assets/javascripts/discourse/app/routes/new-message.js index b3d37af8b8e..5c8545b0371 100644 --- a/app/assets/javascripts/discourse/app/routes/new-message.js +++ b/app/assets/javascripts/discourse/app/routes/new-message.js @@ -3,6 +3,7 @@ import { next } from "@ember/runloop"; import DiscourseRoute from "discourse/routes/discourse"; import User from "discourse/models/user"; import Group from "discourse/models/group"; +import bootbox from "bootbox"; export default DiscourseRoute.extend({ beforeModel(transition) { diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.js index cd72875a59c..de8c1d8e4b5 100644 --- a/app/assets/javascripts/discourse/app/widgets/post.js +++ b/app/assets/javascripts/discourse/app/widgets/post.js @@ -19,6 +19,7 @@ import hbs from "discourse/widgets/hbs-compiler"; import { relativeAgeMediumSpan } from "discourse/lib/formatter"; import { prioritizeNameInUx } from "discourse/lib/settings"; import { Promise } from "rsvp"; +import bootbox from "bootbox"; function transformWithCallbacks(post) { let transformed = transformBasicPost(post); diff --git a/app/assets/javascripts/discourse/app/widgets/private-message-map.js b/app/assets/javascripts/discourse/app/widgets/private-message-map.js index 5738312e597..7ba1a203d97 100644 --- a/app/assets/javascripts/discourse/app/widgets/private-message-map.js +++ b/app/assets/javascripts/discourse/app/widgets/private-message-map.js @@ -5,6 +5,7 @@ import { createWidget } from "discourse/widgets/widget"; import { h } from "virtual-dom"; import { avatarFor, avatarImg } from "discourse/widgets/post"; import hbs from "discourse/widgets/hbs-compiler"; +import bootbox from "bootbox"; createWidget("pm-remove-group-link", { tagName: "a.remove-invited.no-text.btn-icon.btn", diff --git a/app/assets/javascripts/select-kit/addon/components/composer-actions.js b/app/assets/javascripts/select-kit/addon/components/composer-actions.js index 540aca54cd5..7f79bf49909 100644 --- a/app/assets/javascripts/select-kit/addon/components/composer-actions.js +++ b/app/assets/javascripts/select-kit/addon/components/composer-actions.js @@ -12,6 +12,7 @@ import { computed } from "@ember/object"; import { equal } from "@ember/object/computed"; import { camelize } from "@ember/string"; import { isEmpty } from "@ember/utils"; +import bootbox from "bootbox"; // Component can get destroyed and lose state let _topicSnapshot = null; diff --git a/test/javascripts/helpers/qunit-helpers.js b/test/javascripts/helpers/qunit-helpers.js index c51cec6f62e..1b1446afb0c 100644 --- a/test/javascripts/helpers/qunit-helpers.js +++ b/test/javascripts/helpers/qunit-helpers.js @@ -30,6 +30,7 @@ import { getOwner } from "discourse-common/lib/get-owner"; import { setTopicList } from "discourse/lib/topic-list-tracker"; import { setURLContainer } from "discourse/lib/url"; import { setDefaultOwner } from "discourse-common/lib/get-owner"; +import bootbox from "bootbox"; export function currentUser() { return User.create(sessionFixtures["/session/current.json"].current_user); @@ -97,7 +98,7 @@ function AcceptanceModal(option, _relatedTarget) { }); } -window.bootbox.$body = $("#ember-testing"); +bootbox.$body = $("#ember-testing"); $.fn.modal = AcceptanceModal; let _pretenderCallbacks = {}; diff --git a/test/javascripts/lib/uploads-test.js b/test/javascripts/lib/uploads-test.js index a8492d75b36..3ddf9d7ef7e 100644 --- a/test/javascripts/lib/uploads-test.js +++ b/test/javascripts/lib/uploads-test.js @@ -10,6 +10,7 @@ import { import * as Utilities from "discourse/lib/utilities"; import User from "discourse/models/user"; import { discourseModule } from "helpers/qunit-helpers"; +import bootbox from "bootbox"; discourseModule("lib:uploads");