REFACTOR: Move `bootbox` to an import instead of global variable (#10533)

REFACTOR: Move bootbox to an import instead of global variable (#10533)

diff --git a/.eslintrc b/.eslintrc
index d7350cd..4356458 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 28a1771..fddad89 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 11bb2b4..79011ce 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 93d4df6..3559570 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 d67a236..bfb7d8d 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 d004555..4097990 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 81e9346..61a1e96 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 ca535d0..711fad2 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 7530f29..8e0c60c 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 96ddbff..942934c 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 dceecea..fd8c8e6 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 c3b4345..8719be1 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 d7945b1..9c37dff 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 6a44fe4..7903951 100644
--- a/app/assets/javascripts/admin/controllers/admin-badges-show.js
+++ b/app/assets/javascripts/admin/controllers/admin-badges-show.js

[... diff too long, it was truncated ...]

GitHub sha: ff4de97d

This commit appears in #10533 which was merged by eviltrout.