diff --git a/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 index 684f844bc5f..b71a45c57d1 100644 --- a/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { setting, i18n } from "discourse/lib/computed"; -export default Ember.Controller.extend({ +export default Controller.extend({ adminBackups: Ember.inject.controller(), status: Ember.computed.alias("adminBackups.model"), uploadLabel: i18n("admin.backups.upload.label"), diff --git a/app/assets/javascripts/admin/controllers/admin-backups-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-backups-logs.js.es6 index 40bad8ae00b..4887c779e68 100644 --- a/app/assets/javascripts/admin/controllers/admin-backups-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-backups-logs.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ adminBackups: Ember.inject.controller(), status: Ember.computed.alias("adminBackups.model"), diff --git a/app/assets/javascripts/admin/controllers/admin-backups.js.es6 b/app/assets/javascripts/admin/controllers/admin-backups.js.es6 index 5cfa57271eb..d697ae72887 100644 --- a/app/assets/javascripts/admin/controllers/admin-backups.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-backups.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ noOperationIsRunning: Ember.computed.not("model.isOperationRunning"), rollbackEnabled: Ember.computed.and( "model.canRollback", diff --git a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 index 1f7382f54be..254f9918f5b 100644 --- a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import { propertyNotEqual } from "discourse/lib/computed"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(bufferedProperty("model"), { +export default Controller.extend(bufferedProperty("model"), { adminBadges: Ember.inject.controller(), saving: false, savingStatus: "", diff --git a/app/assets/javascripts/admin/controllers/admin-badges.js.es6 b/app/assets/javascripts/admin/controllers/admin-badges.js.es6 index 77c79b724a7..cf6c4e3aa2e 100644 --- a/app/assets/javascripts/admin/controllers/admin-badges.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-badges.js.es6 @@ -1 +1,2 @@ -export default Ember.Controller.extend(); +import Controller from "@ember/controller"; +export default Controller.extend(); diff --git a/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 index 3fbdb989cff..df5d71d3de0 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-colors-show.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ @computed("model.colors", "onlyOverridden") colors(allColors, onlyOverridden) { if (onlyOverridden) { diff --git a/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 index 7a9be8cc5dc..9dad0098f10 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import showModal from "discourse/lib/show-modal"; import { default as computed } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ @computed("model.@each.id") baseColorScheme() { return this.model.findBy("is_base", true); diff --git a/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js.es6 index b8054c8bc3f..f48f46eff06 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-email-style-edit.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ @computed("model.isSaving") saveButtonText(isSaving) { return isSaving ? I18n.t("saving") : I18n.t("admin.customize.save"); diff --git a/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6 index 68a78a7d7f8..5ec405594a5 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(bufferedProperty("emailTemplate"), { +export default Controller.extend(bufferedProperty("emailTemplate"), { saved: false, @computed("buffered.body", "buffered.subject") diff --git a/app/assets/javascripts/admin/controllers/admin-customize-email-templates.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-email-templates.js.es6 index 8631babc672..253641fc12a 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-email-templates.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-email-templates.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ emailTemplates: null, sortedTemplates: Ember.computed.sort("emailTemplates", "titleSorting"), diff --git a/app/assets/javascripts/admin/controllers/admin-customize-robots-txt.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-robots-txt.js.es6 index 9cb38c75ea0..61b0b6269b2 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-robots-txt.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-robots-txt.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import { propertyEqual } from "discourse/lib/computed"; -export default Ember.Controller.extend(bufferedProperty("model"), { +export default Controller.extend(bufferedProperty("model"), { saved: false, isSaving: false, saveDisabled: propertyEqual("model.robots_txt", "buffered.robots_txt"), diff --git a/app/assets/javascripts/admin/controllers/admin-customize-themes-edit.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-themes-edit.js.es6 index ba54e3c91fd..a5a286bf80f 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-themes-edit.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-themes-edit.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { url } from "discourse/lib/computed"; import { default as computed } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ section: null, currentTarget: 0, maximized: false, diff --git a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6 index fc211ce628c..6b9c26601fe 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { url } from "discourse/lib/computed"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -7,7 +8,7 @@ import { THEMES, COMPONENTS } from "admin/models/theme"; const THEME_UPLOAD_VAR = 2; -export default Ember.Controller.extend({ +export default Controller.extend({ downloadUrl: url("model.id", "/admin/customize/themes/%@/export"), previewUrl: url("model.id", "/admin/themes/%@/preview"), addButtonDisabled: Ember.computed.empty("selectedChildThemeId"), diff --git a/app/assets/javascripts/admin/controllers/admin-customize-themes.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-themes.js.es6 index f38ae3ab747..6727df97f38 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-themes.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-themes.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { THEMES } from "admin/models/theme"; -export default Ember.Controller.extend({ +export default Controller.extend({ currentTab: THEMES, @computed("model", "model.@each.component") diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard-general.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard-general.js.es6 index eb85ef4a414..54916ed715a 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard-general.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard-general.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { setting } from "discourse/lib/computed"; import computed from "ember-addons/ember-computed-decorators"; import AdminDashboard from "admin/models/admin-dashboard"; @@ -12,7 +13,7 @@ function staticReport(reportType) { }); } -export default Ember.Controller.extend(PeriodComputationMixin, { +export default Controller.extend(PeriodComputationMixin, { isLoading: false, dashboardFetchedAt: null, exceptionController: Ember.inject.controller("exception"), diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard-moderation.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard-moderation.js.es6 index df06e682f48..e5d8dae25aa 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard-moderation.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard-moderation.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import PeriodComputationMixin from "admin/mixins/period-computation"; -export default Ember.Controller.extend(PeriodComputationMixin, { +export default Controller.extend(PeriodComputationMixin, { @computed flagsStatusOptions() { return { diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard-reports.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard-reports.js.es6 index 9c2eccdab16..12cc0400f17 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard-reports.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard-reports.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; const { get } = Ember; -export default Ember.Controller.extend({ +export default Controller.extend({ filter: null, @computed("model.[]", "filter") diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard.js.es6 index 0ff4b540d19..53a97a6304f 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { setting } from "discourse/lib/computed"; import computed from "ember-addons/ember-computed-decorators"; import AdminDashboard from "admin/models/admin-dashboard"; @@ -5,7 +6,7 @@ import VersionCheck from "admin/models/version-check"; const PROBLEMS_CHECK_MINUTES = 1; -export default Ember.Controller.extend({ +export default Controller.extend({ isLoading: false, dashboardFetchedAt: null, exceptionController: Ember.inject.controller("exception"), diff --git a/app/assets/javascripts/admin/controllers/admin-email-advanced-test.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-advanced-test.js.es6 index c98fb7cfb91..84433443491 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-advanced-test.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-advanced-test.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ email: null, text: null, elided: null, diff --git a/app/assets/javascripts/admin/controllers/admin-email-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-index.js.es6 index 02860948c03..586c911c3c4 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-index.js.es6 @@ -1,5 +1,6 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; -export default Ember.Controller.extend({ +export default Controller.extend({ /** Is the "send test email" button disabled? diff --git a/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 index c7c2df8c958..49a84ea6d11 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-logs.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import EmailLog from "admin/models/email-log"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, loadLogs(sourceModel, loadMore) { diff --git a/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 index 407478d681d..648891b5455 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import EmailPreview from "admin/models/email-preview"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ username: null, lastSeen: null, diff --git a/app/assets/javascripts/admin/controllers/admin-embedding.js.es6 b/app/assets/javascripts/admin/controllers/admin-embedding.js.es6 index a8b522130c9..7e185e9d123 100644 --- a/app/assets/javascripts/admin/controllers/admin-embedding.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-embedding.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ saved: false, embedding: null, diff --git a/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 b/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 index d1109043382..6bde3d29d8d 100644 --- a/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 @@ -1,5 +1,6 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; -export default Ember.Controller.extend({ +export default Controller.extend({ sortedEmojis: Ember.computed.sort("model", "emojiSorting"), init() { diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 index 2a410f77059..5b0908c3636 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; import ScreenedEmail from "admin/models/screened-email"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, actions: { diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 index 66ffe3c08c3..2e404eb29d5 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; import { outputExportResult } from "discourse/lib/export-result"; import { exportEntity } from "discourse/lib/export-csv"; import ScreenedIpAddress from "admin/models/screened-ip-address"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, filter: null, savedIpAddress: null, diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 index ef015623029..3f337831840 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; import ScreenedUrl from "admin/models/screened-url"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, show() { diff --git a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 index a3d332c1f51..e06ad2cbebf 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; import { @@ -5,7 +6,7 @@ import { on } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ model: null, filters: null, filtersExists: Ember.computed.gt("filterCount", 0), diff --git a/app/assets/javascripts/admin/controllers/admin-permalinks.js.es6 b/app/assets/javascripts/admin/controllers/admin-permalinks.js.es6 index 45e88514a0f..d024c830510 100644 --- a/app/assets/javascripts/admin/controllers/admin-permalinks.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-permalinks.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; import Permalink from "admin/models/permalink"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, filter: null, diff --git a/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 b/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 index 36b1f7ca112..c0322317e59 100644 --- a/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ @computed adminRoutes: function() { return this.model diff --git a/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6 index 2a78ece7f41..359be15f1de 100644 --- a/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ queryParams: ["start_date", "end_date", "filters"], start_date: null, end_date: null, diff --git a/app/assets/javascripts/admin/controllers/admin-search-logs-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-search-logs-index.js.es6 index 5c26cb0e9f2..397b4c9b9e5 100644 --- a/app/assets/javascripts/admin/controllers/admin-search-logs-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-search-logs-index.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; export const DEFAULT_PERIOD = "yearly"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, period: DEFAULT_PERIOD, searchType: "all", diff --git a/app/assets/javascripts/admin/controllers/admin-search-logs-term.js.es6 b/app/assets/javascripts/admin/controllers/admin-search-logs-term.js.es6 index 229aa67db87..66def62c97c 100644 --- a/app/assets/javascripts/admin/controllers/admin-search-logs-term.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-search-logs-term.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import { DEFAULT_PERIOD } from "admin/controllers/admin-search-logs-index"; -export default Ember.Controller.extend({ +export default Controller.extend({ loading: false, term: null, period: DEFAULT_PERIOD, diff --git a/app/assets/javascripts/admin/controllers/admin-site-settings-category.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-settings-category.js.es6 index a5831299ece..7d4f33a1acb 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-settings-category.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-settings-category.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ categoryNameKey: null, adminSiteSettings: Ember.inject.controller(), diff --git a/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 index 09a335946d8..c2ae8d5a568 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; -export default Ember.Controller.extend({ +export default Controller.extend({ filter: null, allSiteSettings: Ember.computed.alias("model"), visibleSiteSettings: null, diff --git a/app/assets/javascripts/admin/controllers/admin-site-text-edit.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-text-edit.js.es6 index 4aa1c3d4288..cd815b9ae85 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-text-edit.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-text-edit.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(bufferedProperty("siteText"), { +export default Controller.extend(bufferedProperty("siteText"), { saved: false, @computed("buffered.value") diff --git a/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 index 1c484e4287f..15a16be72b7 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; let lastSearch; -export default Ember.Controller.extend({ +export default Controller.extend({ searching: false, siteTexts: null, preferred: false, diff --git a/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6 index d419cf9e345..36dbf57f8d9 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import GrantBadgeController from "discourse/mixins/grant-badge-controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(GrantBadgeController, { +export default Controller.extend(GrantBadgeController, { adminUser: Ember.inject.controller(), user: Ember.computed.alias("adminUser.model"), userBadges: Ember.computed.alias("model"), diff --git a/app/assets/javascripts/admin/controllers/admin-user-fields.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-fields.js.es6 index 7d2a6b3d567..c2c6e9d5fcd 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-fields.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-fields.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; const MAX_FIELDS = 20; -export default Ember.Controller.extend({ +export default Controller.extend({ fieldTypes: null, createDisabled: Ember.computed.gte("model.length", MAX_FIELDS), sortedFields: Ember.computed.sort("model", "fieldSortOrder"), diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 index 4a24bbd4b5f..e086d85374e 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import CanCheckEmails from "discourse/mixins/can-check-emails"; import { propertyNotEqual, setting } from "discourse/lib/computed"; @@ -6,7 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { fmt } from "discourse/lib/computed"; -export default Ember.Controller.extend(CanCheckEmails, { +export default Controller.extend(CanCheckEmails, { adminTools: Ember.inject.service(), originalPrimaryGroupId: null, customGroupIdsBuffer: null, diff --git a/app/assets/javascripts/admin/controllers/admin-user.js.es6 b/app/assets/javascripts/admin/controllers/admin-user.js.es6 index 77c79b724a7..cf6c4e3aa2e 100644 --- a/app/assets/javascripts/admin/controllers/admin-user.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user.js.es6 @@ -1 +1,2 @@ -export default Ember.Controller.extend(); +import Controller from "@ember/controller"; +export default Controller.extend(); diff --git a/app/assets/javascripts/admin/controllers/admin-users-list-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-users-list-show.js.es6 index 743e68d24b5..944b0d9485e 100644 --- a/app/assets/javascripts/admin/controllers/admin-users-list-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-users-list-show.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; import { i18n } from "discourse/lib/computed"; import AdminUser from "admin/models/admin-user"; import CanCheckEmails from "discourse/mixins/can-check-emails"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(CanCheckEmails, { +export default Controller.extend(CanCheckEmails, { model: null, query: null, order: null, diff --git a/app/assets/javascripts/admin/controllers/admin-watched-words-action.js.es6 b/app/assets/javascripts/admin/controllers/admin-watched-words-action.js.es6 index cf4a28e2d35..632f84ec60e 100644 --- a/app/assets/javascripts/admin/controllers/admin-watched-words-action.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-watched-words-action.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; 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"; -export default Ember.Controller.extend({ +export default Controller.extend({ actionNameKey: null, adminWatchedWords: Ember.inject.controller(), showWordsList: Ember.computed.or( diff --git a/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 b/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 index 20ed6117817..6d064301f38 100644 --- a/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; -export default Ember.Controller.extend({ +export default Controller.extend({ filter: null, filtered: false, showWords: false, diff --git a/app/assets/javascripts/admin/controllers/admin-web-hooks-show-events.js.es6 b/app/assets/javascripts/admin/controllers/admin-web-hooks-show-events.js.es6 index 388fab304fa..1f10fa3e08f 100644 --- a/app/assets/javascripts/admin/controllers/admin-web-hooks-show-events.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-web-hooks-show-events.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ pingDisabled: false, incomingCount: Ember.computed.alias("incomingEventIds.length"), diff --git a/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 index 2a637d72786..2409e7c7db4 100644 --- a/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { extractDomainFromUrl } from "discourse/lib/utilities"; import computed from "ember-addons/ember-computed-decorators"; import InputValidation from "discourse/models/input-validation"; -export default Ember.Controller.extend({ +export default Controller.extend({ adminWebHooks: Ember.inject.controller(), eventTypes: Ember.computed.alias("adminWebHooks.eventTypes"), defaultEventTypes: Ember.computed.alias("adminWebHooks.defaultEventTypes"), diff --git a/app/assets/javascripts/admin/controllers/admin-web-hooks.js.es6 b/app/assets/javascripts/admin/controllers/admin-web-hooks.js.es6 index 696541c1cf8..f9f401e3306 100644 --- a/app/assets/javascripts/admin/controllers/admin-web-hooks.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-web-hooks.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ actions: { destroy(webhook) { return bootbox.confirm( diff --git a/app/assets/javascripts/admin/controllers/admin.js.es6 b/app/assets/javascripts/admin/controllers/admin.js.es6 index a79cf819444..52ecf0a70bb 100644 --- a/app/assets/javascripts/admin/controllers/admin.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ router: Ember.inject.service(), @computed("siteSettings.enable_group_directory") diff --git a/app/assets/javascripts/admin/controllers/modals/admin-add-upload.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-add-upload.js.es6 index 73f1f1e11ff..daad10549e1 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-add-upload.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-add-upload.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; import { @@ -52,7 +53,7 @@ const SCSS_VARIABLE_NAMES = [ "love-low" ]; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { adminCustomizeThemesShow: Ember.inject.controller(), uploadUrl: "/admin/themes/upload_asset", diff --git a/app/assets/javascripts/admin/controllers/modals/admin-badge-preview.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-badge-preview.js.es6 index 045a96c2aa6..bf58496ed7b 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-badge-preview.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-badge-preview.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { escapeExpression } from "discourse/lib/utilities"; -export default Ember.Controller.extend({ +export default Controller.extend({ sample: Ember.computed.alias("model.sample"), errors: Ember.computed.alias("model.errors"), count: Ember.computed.alias("model.grant_count"), diff --git a/app/assets/javascripts/admin/controllers/modals/admin-color-scheme-select-base.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-color-scheme-select-base.js.es6 index 374b6392f4a..80f57d9a181 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-color-scheme-select-base.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-color-scheme-select-base.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { adminCustomizeColors: Ember.inject.controller(), actions: { diff --git a/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 index 76dc4c07d74..4d0c66143c6 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { @observes("model") modelChanged() { const model = this.model; diff --git a/app/assets/javascripts/admin/controllers/modals/admin-incoming-email.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-incoming-email.js.es6 index e19afcd3599..210d664cda8 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-incoming-email.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-incoming-email.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import IncomingEmail from "admin/models/incoming-email"; import computed from "ember-addons/ember-computed-decorators"; import { longDate } from "discourse/lib/formatter"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { @computed("model.date") date(d) { return longDate(d); diff --git a/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 index a81e8caef76..84cccd52aeb 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-install-theme.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -10,7 +11,7 @@ import { POPULAR_THEMES } from "discourse-common/helpers/popular-themes"; const MIN_NAME_LENGTH = 4; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { popular: Ember.computed.equal("selection", "popular"), local: Ember.computed.equal("selection", "local"), remote: Ember.computed.equal("selection", "remote"), diff --git a/app/assets/javascripts/admin/controllers/modals/admin-reseed.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-reseed.js.es6 index f71c7eaf2e7..176c46be36b 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-reseed.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-reseed.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: true, reseeding: false, categories: null, diff --git a/app/assets/javascripts/admin/controllers/modals/admin-silence-user.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-silence-user.js.es6 index 79ec3e69454..15aa4a28065 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-silence-user.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-silence-user.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import PenaltyController from "admin/mixins/penalty-controller"; -export default Ember.Controller.extend(PenaltyController, { +export default Controller.extend(PenaltyController, { silenceUntil: null, silencing: false, diff --git a/app/assets/javascripts/admin/controllers/modals/admin-staff-action-log-details.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-staff-action-log-details.js.es6 index 23420631f02..06110e01130 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-staff-action-log-details.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-staff-action-log-details.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality); +export default Controller.extend(ModalFunctionality); diff --git a/app/assets/javascripts/admin/controllers/modals/admin-start-backup.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-start-backup.js.es6 index 7bd96b326a4..9a321c2348a 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-start-backup.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-start-backup.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { adminBackupsLogs: Ember.inject.controller(), actions: { diff --git a/app/assets/javascripts/admin/controllers/modals/admin-suspend-user.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-suspend-user.js.es6 index c5911322c59..18a9e42e588 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-suspend-user.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-suspend-user.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import PenaltyController from "admin/mixins/penalty-controller"; -export default Ember.Controller.extend(PenaltyController, { +export default Controller.extend(PenaltyController, { suspendUntil: null, suspending: false, diff --git a/app/assets/javascripts/admin/controllers/modals/admin-theme-change.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-theme-change.js.es6 index 834376a2d6a..e33284d233e 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-theme-change.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-theme-change.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loadDiff() { this.set("loading", true); ajax( diff --git a/app/assets/javascripts/admin/controllers/modals/admin-uploaded-image-list.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-uploaded-image-list.js.es6 index 22aa327651a..a5ac891c216 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-uploaded-image-list.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-uploaded-image-list.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { on, observes } from "ember-addons/ember-computed-decorators"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { @on("init") @observes("model.value") _setup() { diff --git a/app/assets/javascripts/admin/controllers/modals/admin-watched-word-test.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-watched-word-test.js.es6 index 7af6650ca6c..10f90ee6154 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-watched-word-test.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-watched-word-test.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { @computed("value", "model.compiledRegularExpression") matches(value, regexpString) { if (!value || !regexpString) return; diff --git a/app/assets/javascripts/admin/controllers/modals/site-setting-default-categories.js.es6 b/app/assets/javascripts/admin/controllers/modals/site-setting-default-categories.js.es6 index 5b856f1dbc6..62e77ed8e68 100644 --- a/app/assets/javascripts/admin/controllers/modals/site-setting-default-categories.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/site-setting-default-categories.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { onShow() { this.set("updateExistingUsers", null); }, diff --git a/app/assets/javascripts/discourse/controllers/about.js.es6 b/app/assets/javascripts/discourse/controllers/about.js.es6 index f17aac609be..d238d976efe 100644 --- a/app/assets/javascripts/discourse/controllers/about.js.es6 +++ b/app/assets/javascripts/discourse/controllers/about.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ faqOverriden: Ember.computed.gt("siteSettings.faq_url.length", 0), @computed diff --git a/app/assets/javascripts/discourse/controllers/account-created-edit-email.js.es6 b/app/assets/javascripts/discourse/controllers/account-created-edit-email.js.es6 index b22fd6de9aa..1002a907529 100644 --- a/app/assets/javascripts/discourse/controllers/account-created-edit-email.js.es6 +++ b/app/assets/javascripts/discourse/controllers/account-created-edit-email.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { changeEmail } from "discourse/lib/user-activation"; import computed from "ember-addons/ember-computed-decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ accountCreated: null, newEmail: null, diff --git a/app/assets/javascripts/discourse/controllers/account-created-index.js.es6 b/app/assets/javascripts/discourse/controllers/account-created-index.js.es6 index ed822d3d3b7..00d381a0802 100644 --- a/app/assets/javascripts/discourse/controllers/account-created-index.js.es6 +++ b/app/assets/javascripts/discourse/controllers/account-created-index.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import { resendActivationEmail } from "discourse/lib/user-activation"; -export default Ember.Controller.extend({ +export default Controller.extend({ actions: { sendActivationEmail() { resendActivationEmail(this.get("accountCreated.username")).then(() => { diff --git a/app/assets/javascripts/discourse/controllers/activation-edit.js.es6 b/app/assets/javascripts/discourse/controllers/activation-edit.js.es6 index ebe73984d06..c44c25ca1ff 100644 --- a/app/assets/javascripts/discourse/controllers/activation-edit.js.es6 +++ b/app/assets/javascripts/discourse/controllers/activation-edit.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { extractError } from "discourse/lib/ajax-error"; import { changeEmail } from "discourse/lib/user-activation"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { login: Ember.inject.controller(), currentEmail: null, diff --git a/app/assets/javascripts/discourse/controllers/add-post-notice.js.es6 b/app/assets/javascripts/discourse/controllers/add-post-notice.js.es6 index 13c3927d4af..ef05db0d67f 100644 --- a/app/assets/javascripts/discourse/controllers/add-post-notice.js.es6 +++ b/app/assets/javascripts/discourse/controllers/add-post-notice.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import computed from "ember-addons/ember-computed-decorators"; import { cookAsync } from "discourse/lib/text"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { post: null, resolve: null, reject: null, diff --git a/app/assets/javascripts/discourse/controllers/application.js.es6 b/app/assets/javascripts/discourse/controllers/application.js.es6 index 7cd2898bf1e..e0a5d5c90aa 100644 --- a/app/assets/javascripts/discourse/controllers/application.js.es6 +++ b/app/assets/javascripts/discourse/controllers/application.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { isAppWebview, isiOSPWA } from "discourse/lib/utilities"; -export default Ember.Controller.extend({ +export default Controller.extend({ showTop: true, showFooter: false, router: Ember.inject.service(), diff --git a/app/assets/javascripts/discourse/controllers/associate-account-confirm.js.es6 b/app/assets/javascripts/discourse/controllers/associate-account-confirm.js.es6 index e9685e0cf90..e138dc71db5 100644 --- a/app/assets/javascripts/discourse/controllers/associate-account-confirm.js.es6 +++ b/app/assets/javascripts/discourse/controllers/associate-account-confirm.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { actions: { finishConnect() { ajax({ diff --git a/app/assets/javascripts/discourse/controllers/auth-token.js.es6 b/app/assets/javascripts/discourse/controllers/auth-token.js.es6 index 1d933fb1917..0a02adf2231 100644 --- a/app/assets/javascripts/discourse/controllers/auth-token.js.es6 +++ b/app/assets/javascripts/discourse/controllers/auth-token.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; import { userPath } from "discourse/lib/url"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { expanded: false, onShow() { diff --git a/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 b/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 index 624eb3ab224..1a230335802 100644 --- a/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 +++ b/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; import { allowsImages } from "discourse/lib/utilities"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { @computed( "selected", "user.system_avatar_upload_id", diff --git a/app/assets/javascripts/discourse/controllers/badges/index.js.es6 b/app/assets/javascripts/discourse/controllers/badges/index.js.es6 index eb36dbe5219..c1c4d8db279 100644 --- a/app/assets/javascripts/discourse/controllers/badges/index.js.es6 +++ b/app/assets/javascripts/discourse/controllers/badges/index.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ @computed("model") badgeGroups(model) { var sorted = _.sortBy(model, function(badge) { diff --git a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 index def520016e6..3de5ac6cb09 100644 --- a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import Badge from "discourse/models/badge"; import UserBadge from "discourse/models/user-badge"; import { @@ -5,7 +6,7 @@ import { observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ queryParams: ["username"], noMoreBadges: false, userBadges: null, diff --git a/app/assets/javascripts/discourse/controllers/basic-modal-body.js.es6 b/app/assets/javascripts/discourse/controllers/basic-modal-body.js.es6 index 1ee99a75497..03d95d5cb26 100644 --- a/app/assets/javascripts/discourse/controllers/basic-modal-body.js.es6 +++ b/app/assets/javascripts/discourse/controllers/basic-modal-body.js.es6 @@ -1,5 +1,6 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { modal: null }); diff --git a/app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 b/app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 index f34195bf8a3..fe4c255645b 100644 --- a/app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 +++ b/app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { topicLevels } from "discourse/lib/notification-levels"; // Support for changing the notification level of various topics -export default Ember.Controller.extend({ +export default Controller.extend({ topicBulkActions: Ember.inject.controller(), notificationLevelId: null, diff --git a/app/assets/javascripts/discourse/controllers/change-owner.js.es6 b/app/assets/javascripts/discourse/controllers/change-owner.js.es6 index 0738db87404..40fa8bc15bf 100644 --- a/app/assets/javascripts/discourse/controllers/change-owner.js.es6 +++ b/app/assets/javascripts/discourse/controllers/change-owner.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import DiscourseURL from "discourse/lib/url"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { topicController: Ember.inject.controller("topic"), saving: false, diff --git a/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 b/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 index 6d64eb32e81..cd02a1a32be 100644 --- a/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 +++ b/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import computed from "ember-addons/ember-computed-decorators"; import DiscourseURL from "discourse/lib/url"; import Topic from "discourse/models/topic"; // Modal related to changing the timestamp of posts -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { topicController: Ember.inject.controller("topic"), saving: false, date: "", diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index 595568eec2f..e2bdfadc042 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import DiscourseURL from "discourse/lib/url"; import Quote from "discourse/lib/quote"; import Draft from "discourse/models/draft"; @@ -74,7 +75,7 @@ export function addPopupMenuOptionsCallback(callback) { _popupMenuOptionsCallbacks.push(callback); } -export default Ember.Controller.extend({ +export default Controller.extend({ topicController: Ember.inject.controller("topic"), router: Ember.inject.service(), diff --git a/app/assets/javascripts/discourse/controllers/convert-to-public-topic.js.es6 b/app/assets/javascripts/discourse/controllers/convert-to-public-topic.js.es6 index 58ccfbcf88a..2c08ff7884a 100644 --- a/app/assets/javascripts/discourse/controllers/convert-to-public-topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/convert-to-public-topic.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { publicCategoryId: null, saving: true, diff --git a/app/assets/javascripts/discourse/controllers/create-account.js.es6 b/app/assets/javascripts/discourse/controllers/create-account.js.es6 index eb370191e9e..42d3c401472 100644 --- a/app/assets/javascripts/discourse/controllers/create-account.js.es6 +++ b/app/assets/javascripts/discourse/controllers/create-account.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { setting } from "discourse/lib/computed"; @@ -14,7 +15,7 @@ import UserFieldsValidation from "discourse/mixins/user-fields-validation"; import { userPath } from "discourse/lib/url"; import { findAll } from "discourse/models/login-method"; -export default Ember.Controller.extend( +export default Controller.extend( ModalFunctionality, PasswordValidation, UsernameValidation, diff --git a/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 b/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 index 4ce4284c552..abe0e3795ec 100644 --- a/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import DiscourseNavigation from "discourse/components/d-navigation"; // Just add query params here to have them automatically passed to topic list filters. @@ -25,7 +26,7 @@ controllerOpts.queryParams.forEach( p => (controllerOpts[p] = Ember.computed.alias(`discoveryTopics.${p}`)) ); -const Controller = Ember.Controller.extend(controllerOpts); +const Controller = Controller.extend(controllerOpts); export const addDiscoveryQueryParam = function(p, opts) { queryParams[p] = opts; diff --git a/app/assets/javascripts/discourse/controllers/discovery.js.es6 b/app/assets/javascripts/discourse/controllers/discovery.js.es6 index 858058e4b09..075b47ee602 100644 --- a/app/assets/javascripts/discourse/controllers/discovery.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import DiscourseURL from "discourse/lib/url"; -export default Ember.Controller.extend({ +export default Controller.extend({ discoveryTopics: Ember.inject.controller("discovery/topics"), navigationCategory: Ember.inject.controller("navigation/category"), application: Ember.inject.controller(), diff --git a/app/assets/javascripts/discourse/controllers/edit-category.js.es6 b/app/assets/javascripts/discourse/controllers/edit-category.js.es6 index 381292baaa6..6b2e99844f6 100644 --- a/app/assets/javascripts/discourse/controllers/edit-category.js.es6 +++ b/app/assets/javascripts/discourse/controllers/edit-category.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import DiscourseURL from "discourse/lib/url"; import { extractError } from "discourse/lib/ajax-error"; @@ -7,7 +8,7 @@ import { observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { selectedTab: null, saving: false, deleting: false, diff --git a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 index d90ca5cbd4a..a0562e655ac 100644 --- a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import TopicTimer from "discourse/models/topic-timer"; @@ -10,7 +11,7 @@ export const DELETE_STATUS_TYPE = "delete"; export const REMINDER_TYPE = "reminder"; export const BUMP_TYPE = "bump"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, isPublic: "true", diff --git a/app/assets/javascripts/discourse/controllers/email-login.js.es6 b/app/assets/javascripts/discourse/controllers/email-login.js.es6 index d062144afef..78ab74f2394 100644 --- a/app/assets/javascripts/discourse/controllers/email-login.js.es6 +++ b/app/assets/javascripts/discourse/controllers/email-login.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { SECOND_FACTOR_METHODS } from "discourse/models/user"; import { ajax } from "discourse/lib/ajax"; @@ -5,7 +6,7 @@ import DiscourseURL from "discourse/lib/url"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { getWebauthnCredential } from "discourse/lib/webauthn"; -export default Ember.Controller.extend({ +export default Controller.extend({ lockImageUrl: Discourse.getURL("/images/lock.svg"), @computed("model") diff --git a/app/assets/javascripts/discourse/controllers/exception.js.es6 b/app/assets/javascripts/discourse/controllers/exception.js.es6 index 6b341b155a9..7b8a1bec8f0 100644 --- a/app/assets/javascripts/discourse/controllers/exception.js.es6 +++ b/app/assets/javascripts/discourse/controllers/exception.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { on, default as computed @@ -26,7 +27,7 @@ const ButtonBackBright = { }; // The controller for the nice error page -export default Ember.Controller.extend({ +export default Controller.extend({ thrown: null, lastTransition: null, diff --git a/app/assets/javascripts/discourse/controllers/explain-reviewable.js.es6 b/app/assets/javascripts/discourse/controllers/explain-reviewable.js.es6 index 49e57228a62..268958e1054 100644 --- a/app/assets/javascripts/discourse/controllers/explain-reviewable.js.es6 +++ b/app/assets/javascripts/discourse/controllers/explain-reviewable.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: null, reviewableExplanation: null, diff --git a/app/assets/javascripts/discourse/controllers/feature-topic.js.es6 b/app/assets/javascripts/discourse/controllers/feature-topic.js.es6 index 9709b21c48a..231b3cac085 100644 --- a/app/assets/javascripts/discourse/controllers/feature-topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/feature-topic.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { categoryLinkHTML } from "discourse/helpers/category-link"; import computed from "ember-addons/ember-computed-decorators"; import InputValidation from "discourse/models/input-validation"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { topicController: Ember.inject.controller("topic"), loading: true, diff --git a/app/assets/javascripts/discourse/controllers/flag.js.es6 b/app/assets/javascripts/discourse/controllers/flag.js.es6 index bcfbb5e325c..99dee423d23 100644 --- a/app/assets/javascripts/discourse/controllers/flag.js.es6 +++ b/app/assets/javascripts/discourse/controllers/flag.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import ActionSummary from "discourse/models/action-summary"; import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type"; @@ -5,7 +6,7 @@ import computed from "ember-addons/ember-computed-decorators"; import optionalService from "discourse/lib/optional-service"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { adminTools: optionalService(), userDetails: null, selected: null, diff --git a/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 b/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 index 288ffa8ba87..7f12df2e28c 100644 --- a/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 +++ b/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { escapeExpression } from "discourse/lib/utilities"; import { extractError } from "discourse/lib/ajax-error"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { offerHelp: null, helpSeen: false, diff --git a/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 b/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 index 29b70930071..bfe34bea92e 100644 --- a/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 +++ b/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { translateResults, @@ -24,7 +25,7 @@ const SortOrders = [ ]; const PAGE_LIMIT = 10; -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), composer: Ember.inject.controller(), bulkSelectEnabled: null, diff --git a/app/assets/javascripts/discourse/controllers/grant-badge.js.es6 b/app/assets/javascripts/discourse/controllers/grant-badge.js.es6 index 13757e678e0..2313ae5d3f0 100644 --- a/app/assets/javascripts/discourse/controllers/grant-badge.js.es6 +++ b/app/assets/javascripts/discourse/controllers/grant-badge.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { extractError } from "discourse/lib/ajax-error"; import ModalFunctionality from "discourse/mixins/modal-functionality"; @@ -5,82 +6,78 @@ import GrantBadgeController from "discourse/mixins/grant-badge-controller"; import Badge from "discourse/models/badge"; import UserBadge from "discourse/models/user-badge"; -export default Ember.Controller.extend( - ModalFunctionality, - GrantBadgeController, - { - topicController: Ember.inject.controller("topic"), - loading: true, - saving: false, - selectedBadgeId: null, +export default Controller.extend(ModalFunctionality, GrantBadgeController, { + topicController: Ember.inject.controller("topic"), + loading: true, + saving: false, + selectedBadgeId: null, - init() { - this._super(...arguments); + init() { + this._super(...arguments); - this.allBadges = []; - this.userBadges = []; - }, + this.allBadges = []; + this.userBadges = []; + }, - @computed("topicController.selectedPosts") - post() { - return this.get("topicController.selectedPosts")[0]; - }, + @computed("topicController.selectedPosts") + post() { + return this.get("topicController.selectedPosts")[0]; + }, - @computed("post") - badgeReason(post) { - const url = post.get("url"); - const protocolAndHost = - window.location.protocol + "//" + window.location.host; + @computed("post") + badgeReason(post) { + const url = post.get("url"); + const protocolAndHost = + window.location.protocol + "//" + window.location.host; - return url.indexOf("/") === 0 ? protocolAndHost + url : url; - }, + return url.indexOf("/") === 0 ? protocolAndHost + url : url; + }, - @computed("saving", "selectedBadgeGrantable") - buttonDisabled(saving, selectedBadgeGrantable) { - return saving || !selectedBadgeGrantable; - }, + @computed("saving", "selectedBadgeGrantable") + buttonDisabled(saving, selectedBadgeGrantable) { + return saving || !selectedBadgeGrantable; + }, - onShow() { - this.set("loading", true); + onShow() { + this.set("loading", true); - Ember.RSVP.all([ - Badge.findAll(), - UserBadge.findByUsername(this.get("post.username")) - ]).then(([allBadges, userBadges]) => { - this.setProperties({ - allBadges: allBadges, - userBadges: userBadges, - loading: false - }); + Ember.RSVP.all([ + Badge.findAll(), + UserBadge.findByUsername(this.get("post.username")) + ]).then(([allBadges, userBadges]) => { + this.setProperties({ + allBadges: allBadges, + userBadges: userBadges, + loading: false }); - }, + }); + }, - actions: { - grantBadge() { - this.set("saving", true); + actions: { + grantBadge() { + this.set("saving", true); - this.grantBadge( - this.selectedBadgeId, - this.get("post.username"), - this.badgeReason + this.grantBadge( + this.selectedBadgeId, + this.get("post.username"), + this.badgeReason + ) + .then( + newBadge => { + this.set("selectedBadgeId", null); + this.flash( + I18n.t("badges.successfully_granted", { + username: this.get("post.username"), + badge: newBadge.get("badge.name") + }), + "success" + ); + }, + error => { + this.flash(extractError(error), "error"); + } ) - .then( - newBadge => { - this.set("selectedBadgeId", null); - this.flash( - I18n.t("badges.successfully_granted", { - username: this.get("post.username"), - badge: newBadge.get("badge.name") - }), - "success" - ); - }, - error => { - this.flash(extractError(error), "error"); - } - ) - .finally(() => this.set("saving", false)); - } + .finally(() => this.set("saving", false)); } } -); +}); diff --git a/app/assets/javascripts/discourse/controllers/group-activity-posts.js.es6 b/app/assets/javascripts/discourse/controllers/group-activity-posts.js.es6 index 3e4454ce0ee..32c284f3e23 100644 --- a/app/assets/javascripts/discourse/controllers/group-activity-posts.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-activity-posts.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { observes } from "ember-addons/ember-computed-decorators"; import { fmt } from "discourse/lib/computed"; -export default Ember.Controller.extend({ +export default Controller.extend({ group: Ember.inject.controller(), groupActivity: Ember.inject.controller(), application: Ember.inject.controller(), diff --git a/app/assets/javascripts/discourse/controllers/group-activity-topics.js.es6 b/app/assets/javascripts/discourse/controllers/group-activity-topics.js.es6 index 2a559a196c1..6d922b754e3 100644 --- a/app/assets/javascripts/discourse/controllers/group-activity-topics.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-activity-topics.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ actions: { loadMore() { this.model.loadMore(); diff --git a/app/assets/javascripts/discourse/controllers/group-activity.js.es6 b/app/assets/javascripts/discourse/controllers/group-activity.js.es6 index 26fa94835aa..838045d2064 100644 --- a/app/assets/javascripts/discourse/controllers/group-activity.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-activity.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ router: Ember.inject.service(), queryParams: ["category_id"] }); diff --git a/app/assets/javascripts/discourse/controllers/group-add-members.js.es6 b/app/assets/javascripts/discourse/controllers/group-add-members.js.es6 index 6e478fe3d86..d3bf4a3ea56 100644 --- a/app/assets/javascripts/discourse/controllers/group-add-members.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-add-members.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { extractError } from "discourse/lib/ajax-error"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, setAsOwner: false, diff --git a/app/assets/javascripts/discourse/controllers/group-bulk-add.js.es6 b/app/assets/javascripts/discourse/controllers/group-bulk-add.js.es6 index 716347d4c6b..4a4323d611f 100644 --- a/app/assets/javascripts/discourse/controllers/group-bulk-add.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-bulk-add.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { extractError } from "discourse/lib/ajax-error"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { ajax } from "discourse/lib/ajax"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, @computed("input", "loading", "result") diff --git a/app/assets/javascripts/discourse/controllers/group-index.js.es6 b/app/assets/javascripts/discourse/controllers/group-index.js.es6 index 690997aa546..7dad9329d1b 100644 --- a/app/assets/javascripts/discourse/controllers/group-index.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-index.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import Group from "discourse/models/group"; import { @@ -6,7 +7,7 @@ import { } from "ember-addons/ember-computed-decorators"; import debounce from "discourse/lib/debounce"; -export default Ember.Controller.extend({ +export default Controller.extend({ queryParams: ["order", "desc", "filter"], order: "", desc: null, diff --git a/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 b/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 index 22ee01cff5e..87b0a01ecf3 100644 --- a/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import { default as computed, observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ group: Ember.inject.controller(), loading: false, offset: 0, diff --git a/app/assets/javascripts/discourse/controllers/group-manage-profile.js.es6 b/app/assets/javascripts/discourse/controllers/group-manage-profile.js.es6 index e316e97fad9..719745dfa36 100644 --- a/app/assets/javascripts/discourse/controllers/group-manage-profile.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-manage-profile.js.es6 @@ -1,3 +1,4 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ saving: null }); diff --git a/app/assets/javascripts/discourse/controllers/group-manage.js.es6 b/app/assets/javascripts/discourse/controllers/group-manage.js.es6 index 795627c3cb1..662887935a5 100644 --- a/app/assets/javascripts/discourse/controllers/group-manage.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-manage.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ router: Ember.inject.service(), @computed("model.automatic") diff --git a/app/assets/javascripts/discourse/controllers/group-messages.js.es6 b/app/assets/javascripts/discourse/controllers/group-messages.js.es6 index cda126a2e26..4cecbd37012 100644 --- a/app/assets/javascripts/discourse/controllers/group-messages.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-messages.js.es6 @@ -1,3 +1,4 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ router: Ember.inject.service() }); diff --git a/app/assets/javascripts/discourse/controllers/group-requests.js.es6 b/app/assets/javascripts/discourse/controllers/group-requests.js.es6 index 178db757588..3c29622ea91 100644 --- a/app/assets/javascripts/discourse/controllers/group-requests.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-requests.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import Group from "discourse/models/group"; @@ -7,7 +8,7 @@ import { } from "ember-addons/ember-computed-decorators"; import debounce from "discourse/lib/debounce"; -export default Ember.Controller.extend({ +export default Controller.extend({ queryParams: ["order", "desc", "filter"], order: "", desc: null, diff --git a/app/assets/javascripts/discourse/controllers/group.js.es6 b/app/assets/javascripts/discourse/controllers/group.js.es6 index f6a44552aa7..d555c7c161c 100644 --- a/app/assets/javascripts/discourse/controllers/group.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; const Tab = Ember.Object.extend({ @@ -9,7 +10,7 @@ const Tab = Ember.Object.extend({ } }); -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), counts: null, showing: "members", diff --git a/app/assets/javascripts/discourse/controllers/groups-index.js.es6 b/app/assets/javascripts/discourse/controllers/groups-index.js.es6 index 1c6a824deda..a689dfa7bde 100644 --- a/app/assets/javascripts/discourse/controllers/groups-index.js.es6 +++ b/app/assets/javascripts/discourse/controllers/groups-index.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; import { default as computed, observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), queryParams: ["order", "asc", "filter", "type"], order: null, diff --git a/app/assets/javascripts/discourse/controllers/groups-new.js.es6 b/app/assets/javascripts/discourse/controllers/groups-new.js.es6 index 293beffd532..f93c08959da 100644 --- a/app/assets/javascripts/discourse/controllers/groups-new.js.es6 +++ b/app/assets/javascripts/discourse/controllers/groups-new.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ saving: null, actions: { diff --git a/app/assets/javascripts/discourse/controllers/history.js.es6 b/app/assets/javascripts/discourse/controllers/history.js.es6 index 53627c157f6..8b139e19b73 100644 --- a/app/assets/javascripts/discourse/controllers/history.js.es6 +++ b/app/assets/javascripts/discourse/controllers/history.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { categoryBadgeHTML } from "discourse/helpers/category-link"; import computed from "ember-addons/ember-computed-decorators"; @@ -20,7 +21,7 @@ function customTagArray(fieldName) { } // This controller handles displaying of history -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: true, viewMode: "side_by_side", diff --git a/app/assets/javascripts/discourse/controllers/ignore-duration-with-username.js.es6 b/app/assets/javascripts/discourse/controllers/ignore-duration-with-username.js.es6 index 6ba026a1b87..491c496df74 100644 --- a/app/assets/javascripts/discourse/controllers/ignore-duration-with-username.js.es6 +++ b/app/assets/javascripts/discourse/controllers/ignore-duration-with-username.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { popupAjaxError } from "discourse/lib/ajax-error"; import User from "discourse/models/user"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, ignoredUntil: null, ignoredUsername: null, diff --git a/app/assets/javascripts/discourse/controllers/ignore-duration.js.es6 b/app/assets/javascripts/discourse/controllers/ignore-duration.js.es6 index 574f69e3739..c78b73cbb35 100644 --- a/app/assets/javascripts/discourse/controllers/ignore-duration.js.es6 +++ b/app/assets/javascripts/discourse/controllers/ignore-duration.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, ignoredUntil: null, actions: { diff --git a/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 b/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 index 82d3a7250b0..e1d714be399 100644 --- a/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 +++ b/app/assets/javascripts/discourse/controllers/insert-hyperlink.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { searchForTerm } from "discourse/lib/search"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { _debounced: null, _activeSearch: null, diff --git a/app/assets/javascripts/discourse/controllers/invites-show.js.es6 b/app/assets/javascripts/discourse/controllers/invites-show.js.es6 index 2664a95bd78..98d5fd5496f 100644 --- a/app/assets/javascripts/discourse/controllers/invites-show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/invites-show.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import getUrl from "discourse-common/lib/get-url"; import DiscourseURL from "discourse/lib/url"; @@ -8,7 +9,7 @@ import NameValidation from "discourse/mixins/name-validation"; import UserFieldsValidation from "discourse/mixins/user-fields-validation"; import { findAll as findLoginMethods } from "discourse/models/login-method"; -export default Ember.Controller.extend( +export default Controller.extend( PasswordValidation, UsernameValidation, NameValidation, diff --git a/app/assets/javascripts/discourse/controllers/jump-to-post.js.es6 b/app/assets/javascripts/discourse/controllers/jump-to-post.js.es6 index 385db0406f5..af6fd216f57 100644 --- a/app/assets/javascripts/discourse/controllers/jump-to-post.js.es6 +++ b/app/assets/javascripts/discourse/controllers/jump-to-post.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { model: null, postNumber: null, postDate: null, diff --git a/app/assets/javascripts/discourse/controllers/keyboard-shortcuts-help.js.es6 b/app/assets/javascripts/discourse/controllers/keyboard-shortcuts-help.js.es6 index 9520e6c8f8a..9e1c216e139 100644 --- a/app/assets/javascripts/discourse/controllers/keyboard-shortcuts-help.js.es6 +++ b/app/assets/javascripts/discourse/controllers/keyboard-shortcuts-help.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; const KEY = "keyboard_shortcuts_help"; @@ -46,7 +47,7 @@ function buildShortcut( return I18n.t(`${KEY}.${key}`, context); } -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { onShow() { this.set("modal.modalClass", "keyboard-shortcuts-modal"); }, diff --git a/app/assets/javascripts/discourse/controllers/login.js.es6 b/app/assets/javascripts/discourse/controllers/login.js.es6 index 7f0f5bdd33a..feaffe8fdff 100644 --- a/app/assets/javascripts/discourse/controllers/login.js.es6 +++ b/app/assets/javascripts/discourse/controllers/login.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import showModal from "discourse/lib/show-modal"; @@ -19,7 +20,7 @@ const AuthErrors = [ "not_allowed_from_ip_address" ]; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { createAccount: Ember.inject.controller(), forgotPassword: Ember.inject.controller(), application: Ember.inject.controller(), diff --git a/app/assets/javascripts/discourse/controllers/modal.js.es6 b/app/assets/javascripts/discourse/controllers/modal.js.es6 index 77c79b724a7..cf6c4e3aa2e 100644 --- a/app/assets/javascripts/discourse/controllers/modal.js.es6 +++ b/app/assets/javascripts/discourse/controllers/modal.js.es6 @@ -1 +1,2 @@ -export default Ember.Controller.extend(); +import Controller from "@ember/controller"; +export default Controller.extend(); diff --git a/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6 b/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6 index fa41654818a..195dc93322e 100644 --- a/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { movePosts, mergeTopic } from "discourse/models/topic"; import DiscourseURL from "discourse/lib/url"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { extractError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { topicName: null, saving: false, categoryId: null, diff --git a/app/assets/javascripts/discourse/controllers/navigation/default.js.es6 b/app/assets/javascripts/discourse/controllers/navigation/default.js.es6 index 0ad18786224..036f4174a21 100644 --- a/app/assets/javascripts/discourse/controllers/navigation/default.js.es6 +++ b/app/assets/javascripts/discourse/controllers/navigation/default.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ discovery: Ember.inject.controller(), discoveryTopics: Ember.inject.controller("discovery/topics"), diff --git a/app/assets/javascripts/discourse/controllers/not-activated.js.es6 b/app/assets/javascripts/discourse/controllers/not-activated.js.es6 index 71824b3e150..ba520eb6f2f 100644 --- a/app/assets/javascripts/discourse/controllers/not-activated.js.es6 +++ b/app/assets/javascripts/discourse/controllers/not-activated.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { resendActivationEmail } from "discourse/lib/user-activation"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { actions: { sendActivationEmail() { resendActivationEmail(this.username).then(() => { diff --git a/app/assets/javascripts/discourse/controllers/password-reset.js.es6 b/app/assets/javascripts/discourse/controllers/password-reset.js.es6 index 4194d67f16b..618e7a3c43c 100644 --- a/app/assets/javascripts/discourse/controllers/password-reset.js.es6 +++ b/app/assets/javascripts/discourse/controllers/password-reset.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import DiscourseURL from "discourse/lib/url"; import { ajax } from "discourse/lib/ajax"; @@ -6,7 +7,7 @@ import { userPath } from "discourse/lib/url"; import { SECOND_FACTOR_METHODS } from "discourse/models/user"; import { getWebauthnCredential } from "discourse/lib/webauthn"; -export default Ember.Controller.extend(PasswordValidation, { +export default Controller.extend(PasswordValidation, { isDeveloper: Ember.computed.alias("model.is_developer"), admin: Ember.computed.alias("model.admin"), secondFactorRequired: Ember.computed.alias("model.second_factor_required"), diff --git a/app/assets/javascripts/discourse/controllers/preferences.js.es6 b/app/assets/javascripts/discourse/controllers/preferences.js.es6 index cda126a2e26..4cecbd37012 100644 --- a/app/assets/javascripts/discourse/controllers/preferences.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences.js.es6 @@ -1,3 +1,4 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ router: Ember.inject.service() }); diff --git a/app/assets/javascripts/discourse/controllers/preferences/about.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/about.js.es6 index 37e7247a8ab..ec9958c1fc2 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/about.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/about.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ saving: false, newBio: null, diff --git a/app/assets/javascripts/discourse/controllers/preferences/account.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/account.js.es6 index 14fcc4b79fc..a5b9e098a59 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/account.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/account.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { iconHTML } from "discourse-common/lib/icon-library"; import CanCheckEmails from "discourse/mixins/can-check-emails"; import { default as computed } from "ember-addons/ember-computed-decorators"; @@ -12,248 +13,243 @@ import { userPath } from "discourse/lib/url"; // Number of tokens shown by default. const DEFAULT_AUTH_TOKENS_COUNT = 2; -export default Ember.Controller.extend( - CanCheckEmails, - PreferencesTabController, - { - init() { - this._super(...arguments); +export default Controller.extend(CanCheckEmails, PreferencesTabController, { + init() { + this._super(...arguments); - this.saveAttrNames = ["name", "title"]; - this.set("revoking", {}); - }, + this.saveAttrNames = ["name", "title"]; + this.set("revoking", {}); + }, - canEditName: setting("enable_names"), - canSaveUser: true, + canEditName: setting("enable_names"), + canSaveUser: true, - newNameInput: null, - newTitleInput: null, + newNameInput: null, + newTitleInput: null, - passwordProgress: null, + passwordProgress: null, - showAllAuthTokens: false, + showAllAuthTokens: false, - revoking: null, + revoking: null, - cannotDeleteAccount: Ember.computed.not("currentUser.can_delete_account"), - deleteDisabled: Ember.computed.or( - "model.isSaving", - "deleting", - "cannotDeleteAccount" - ), + cannotDeleteAccount: Ember.computed.not("currentUser.can_delete_account"), + deleteDisabled: Ember.computed.or( + "model.isSaving", + "deleting", + "cannotDeleteAccount" + ), - reset() { - this.set("passwordProgress", null); - }, + reset() { + this.set("passwordProgress", null); + }, - @computed() - nameInstructions() { - return I18n.t( - this.siteSettings.full_name_required - ? "user.name.instructions_required" - : "user.name.instructions" + @computed() + nameInstructions() { + return I18n.t( + this.siteSettings.full_name_required + ? "user.name.instructions_required" + : "user.name.instructions" + ); + }, + + canSelectTitle: Ember.computed.gt("model.availableTitles.length", 0), + + @computed("model.is_anonymous") + canChangePassword(isAnonymous) { + if (isAnonymous) { + return false; + } else { + return ( + !this.siteSettings.enable_sso && this.siteSettings.enable_local_logins ); - }, + } + }, - canSelectTitle: Ember.computed.gt("model.availableTitles.length", 0), + @computed("model.associated_accounts") + associatedAccountsLoaded(associatedAccounts) { + return typeof associatedAccounts !== "undefined"; + }, - @computed("model.is_anonymous") - canChangePassword(isAnonymous) { - if (isAnonymous) { - return false; + @computed("model.associated_accounts.[]") + authProviders(accounts) { + const allMethods = findAll(); + + const result = allMethods.map(method => { + return { + method, + account: accounts.find(account => account.name === method.name) // Will be undefined if no account + }; + }); + + return result.filter(value => value.account || value.method.can_connect); + }, + + disableConnectButtons: propertyNotEqual("model.id", "currentUser.id"), + + @computed( + "model.second_factor_enabled", + "canCheckEmails", + "model.is_anonymous" + ) + canUpdateAssociatedAccounts( + secondFactorEnabled, + canCheckEmails, + isAnonymous + ) { + if (secondFactorEnabled || !canCheckEmails || isAnonymous) { + return false; + } + return findAll().length > 0; + }, + + @computed("showAllAuthTokens", "model.user_auth_tokens") + authTokens(showAllAuthTokens, tokens) { + tokens.sort((a, b) => { + if (a.is_active) { + return -1; + } else if (b.is_active) { + return 1; } else { - return ( - !this.siteSettings.enable_sso && this.siteSettings.enable_local_logins + return b.seen_at.localeCompare(a.seen_at); + } + }); + + return showAllAuthTokens + ? tokens + : tokens.slice(0, DEFAULT_AUTH_TOKENS_COUNT); + }, + + canShowAllAuthTokens: Ember.computed.gt( + "model.user_auth_tokens.length", + DEFAULT_AUTH_TOKENS_COUNT + ), + + actions: { + save() { + this.set("saved", false); + + this.model.setProperties({ + name: this.newNameInput, + title: this.newTitleInput + }); + + return this.model + .save(this.saveAttrNames) + .then(() => this.set("saved", true)) + .catch(popupAjaxError); + }, + + changePassword() { + if (!this.passwordProgress) { + this.set( + "passwordProgress", + I18n.t("user.change_password.in_progress") ); - } - }, - - @computed("model.associated_accounts") - associatedAccountsLoaded(associatedAccounts) { - return typeof associatedAccounts !== "undefined"; - }, - - @computed("model.associated_accounts.[]") - authProviders(accounts) { - const allMethods = findAll(); - - const result = allMethods.map(method => { - return { - method, - account: accounts.find(account => account.name === method.name) // Will be undefined if no account - }; - }); - - return result.filter(value => value.account || value.method.can_connect); - }, - - disableConnectButtons: propertyNotEqual("model.id", "currentUser.id"), - - @computed( - "model.second_factor_enabled", - "canCheckEmails", - "model.is_anonymous" - ) - canUpdateAssociatedAccounts( - secondFactorEnabled, - canCheckEmails, - isAnonymous - ) { - if (secondFactorEnabled || !canCheckEmails || isAnonymous) { - return false; - } - return findAll().length > 0; - }, - - @computed("showAllAuthTokens", "model.user_auth_tokens") - authTokens(showAllAuthTokens, tokens) { - tokens.sort((a, b) => { - if (a.is_active) { - return -1; - } else if (b.is_active) { - return 1; - } else { - return b.seen_at.localeCompare(a.seen_at); - } - }); - - return showAllAuthTokens - ? tokens - : tokens.slice(0, DEFAULT_AUTH_TOKENS_COUNT); - }, - - canShowAllAuthTokens: Ember.computed.gt( - "model.user_auth_tokens.length", - DEFAULT_AUTH_TOKENS_COUNT - ), - - actions: { - save() { - this.set("saved", false); - - this.model.setProperties({ - name: this.newNameInput, - title: this.newTitleInput - }); - return this.model - .save(this.saveAttrNames) - .then(() => this.set("saved", true)) - .catch(popupAjaxError); - }, - - changePassword() { - if (!this.passwordProgress) { - this.set( - "passwordProgress", - I18n.t("user.change_password.in_progress") - ); - return this.model - .changePassword() - .then(() => { - // password changed - this.setProperties({ - changePasswordProgress: false, - passwordProgress: I18n.t("user.change_password.success") - }); - }) - .catch(() => { - // password failed to change - this.setProperties({ - changePasswordProgress: false, - passwordProgress: I18n.t("user.change_password.error") - }); - }); - } - }, - - delete() { - this.set("deleting", true); - const message = I18n.t("user.delete_account_confirm"), - model = this.model, - buttons = [ - { - label: I18n.t("cancel"), - class: "d-modal-cancel", - link: true, - callback: () => { - this.set("deleting", false); - } - }, - { - label: - iconHTML("exclamation-triangle") + - I18n.t("user.delete_account"), - class: "btn btn-danger", - callback() { - model.delete().then( - () => { - bootbox.alert( - I18n.t("user.deleted_yourself"), - () => (window.location = Discourse.getURL("/")) - ); - }, - () => { - bootbox.alert(I18n.t("user.delete_yourself_not_allowed")); - this.set("deleting", false); - } - ); - } - } - ]; - bootbox.dialog(message, buttons, { classes: "delete-account" }); - }, - - revokeAccount(account) { - this.set(`revoking.${account.name}`, true); - - this.model - .revokeAssociatedAccount(account.name) - .then(result => { - if (result.success) { - this.model.associated_accounts.removeObject(account); - } else { - bootbox.alert(result.message); - } - }) - .catch(popupAjaxError) - .finally(() => this.set(`revoking.${account.name}`, false)); - }, - - toggleShowAllAuthTokens() { - this.toggleProperty("showAllAuthTokens"); - }, - - revokeAuthToken(token) { - ajax( - userPath( - `${this.get("model.username_lower")}/preferences/revoke-auth-token` - ), - { - type: "POST", - data: token ? { token_id: token.id } : {} - } - ) + .changePassword() .then(() => { - if (!token) { - const redirect = this.siteSettings.logout_redirect; - if (Ember.isEmpty(redirect)) { - window.location = Discourse.getURL("/"); - } else { - window.location.href = redirect; - } - } + // password changed + this.setProperties({ + changePasswordProgress: false, + passwordProgress: I18n.t("user.change_password.success") + }); }) - .catch(popupAjaxError); - }, - - showToken(token) { - showModal("auth-token", { model: token }); - }, - - connectAccount(method) { - method.doLogin({ reconnect: true }); + .catch(() => { + // password failed to change + this.setProperties({ + changePasswordProgress: false, + passwordProgress: I18n.t("user.change_password.error") + }); + }); } + }, + + delete() { + this.set("deleting", true); + const message = I18n.t("user.delete_account_confirm"), + model = this.model, + buttons = [ + { + label: I18n.t("cancel"), + class: "d-modal-cancel", + link: true, + callback: () => { + this.set("deleting", false); + } + }, + { + label: + iconHTML("exclamation-triangle") + I18n.t("user.delete_account"), + class: "btn btn-danger", + callback() { + model.delete().then( + () => { + bootbox.alert( + I18n.t("user.deleted_yourself"), + () => (window.location = Discourse.getURL("/")) + ); + }, + () => { + bootbox.alert(I18n.t("user.delete_yourself_not_allowed")); + this.set("deleting", false); + } + ); + } + } + ]; + bootbox.dialog(message, buttons, { classes: "delete-account" }); + }, + + revokeAccount(account) { + this.set(`revoking.${account.name}`, true); + + this.model + .revokeAssociatedAccount(account.name) + .then(result => { + if (result.success) { + this.model.associated_accounts.removeObject(account); + } else { + bootbox.alert(result.message); + } + }) + .catch(popupAjaxError) + .finally(() => this.set(`revoking.${account.name}`, false)); + }, + + toggleShowAllAuthTokens() { + this.toggleProperty("showAllAuthTokens"); + }, + + revokeAuthToken(token) { + ajax( + userPath( + `${this.get("model.username_lower")}/preferences/revoke-auth-token` + ), + { + type: "POST", + data: token ? { token_id: token.id } : {} + } + ) + .then(() => { + if (!token) { + const redirect = this.siteSettings.logout_redirect; + if (Ember.isEmpty(redirect)) { + window.location = Discourse.getURL("/"); + } else { + window.location.href = redirect; + } + } + }) + .catch(popupAjaxError); + }, + + showToken(token) { + showModal("auth-token", { model: token }); + }, + + connectAccount(method) { + method.doLogin({ reconnect: true }); } } -); +}); diff --git a/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 index d45e3fad89e..b0ec789200c 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 index c7ad39668dd..9f59a93e4b6 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import { propertyEqual } from "discourse/lib/computed"; import InputValidation from "discourse/models/input-validation"; import { emailValid } from "discourse/lib/utilities"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ taken: false, saving: false, error: false, diff --git a/app/assets/javascripts/discourse/controllers/preferences/emails.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/emails.js.es6 index 2db23b6f4da..cc8d8aab4ed 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/emails.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/emails.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -8,7 +9,7 @@ const EMAIL_LEVELS = { NEVER: 2 }; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { emailMessagesLevelAway: Ember.computed.equal( "model.user_option.email_messages_level", EMAIL_LEVELS.ONLY_WHEN_AWAY diff --git a/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 index e5b7bf42bf7..b678d7076bc 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/interface.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { setDefaultHomepage } from "discourse/lib/utilities"; import { @@ -27,7 +28,7 @@ const USER_HOMES = { const TEXT_SIZES = ["smaller", "normal", "larger", "largest"]; const TITLE_COUNT_MODES = ["notifications", "contextual"]; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { @computed("makeThemeDefault") saveAttrNames(makeDefault) { let attrs = [ diff --git a/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 index 77690846d5b..8030885efb3 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { NotificationLevels } from "discourse/lib/notification-levels"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 index 5d1dde4b760..f253c027f40 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { cookAsync } from "discourse/lib/text"; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 index 34eb99d0e18..04ad204320f 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import CanCheckEmails from "discourse/mixins/can-check-emails"; import { default as DiscourseURL, userPath } from "discourse/lib/url"; @@ -6,7 +7,7 @@ import { findAll } from "discourse/models/login-method"; import { SECOND_FACTOR_METHODS } from "discourse/models/user"; import showModal from "discourse/lib/show-modal"; -export default Ember.Controller.extend(CanCheckEmails, { +export default Controller.extend(CanCheckEmails, { loading: false, dirty: false, resetPasswordLoading: false, diff --git a/app/assets/javascripts/discourse/controllers/preferences/tags.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/tags.js.es6 index e149711bd3d..85d1241ad3c 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/tags.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/tags.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse/controllers/preferences/username.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/username.js.es6 index 367f83903c5..28d683a9716 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/username.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/username.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed, observes @@ -7,7 +8,7 @@ import DiscourseURL from "discourse/lib/url"; import { userPath } from "discourse/lib/url"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ taken: false, saving: false, errorMessage: null, diff --git a/app/assets/javascripts/discourse/controllers/preferences/users.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/users.js.es6 index 9f213a3090c..aca7b02fda0 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/users.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/users.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(PreferencesTabController, { +export default Controller.extend(PreferencesTabController, { ignoredUsernames: Ember.computed.alias("model.ignored_usernames"), userIsMemberOrAbove: Ember.computed.gte("model.trust_level", 2), ignoredEnabled: Ember.computed.or("userIsMemberOrAbove", "model.staff"), diff --git a/app/assets/javascripts/discourse/controllers/raw-email.js.es6 b/app/assets/javascripts/discourse/controllers/raw-email.js.es6 index e671f3eef3f..07a58388a24 100644 --- a/app/assets/javascripts/discourse/controllers/raw-email.js.es6 +++ b/app/assets/javascripts/discourse/controllers/raw-email.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import Post from "discourse/models/post"; import IncomingEmail from "admin/models/incoming-email"; // This controller handles displaying of raw email -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { rawEmail: "", textPart: "", htmlPart: "", diff --git a/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 b/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 index 9a7a01d1efa..b08bc2d6464 100644 --- a/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 +++ b/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import computed from "ember-addons/ember-computed-decorators"; import BufferedContent from "discourse/mixins/buffered-content"; import { extractError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend(ModalFunctionality, BufferedContent, { +export default Controller.extend(ModalFunctionality, BufferedContent, { @computed("buffered.id", "id") renameDisabled(inputTagName, currentTagName) { const filterRegexp = new RegExp(this.site.tags_filter_regexp, "g"); diff --git a/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 b/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 index d893fa5b0db..05d69d39c6d 100644 --- a/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; const BufferedProxy = window.BufferedProxy; // import BufferedProxy from 'ember-buffered-proxy/proxy'; @@ -8,7 +9,7 @@ import { } from "ember-addons/ember-computed-decorators"; import Ember from "ember"; -export default Ember.Controller.extend(ModalFunctionality, Ember.Evented, { +export default Controller.extend(ModalFunctionality, Ember.Evented, { init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse/controllers/request-group-membership-form.js.es6 b/app/assets/javascripts/discourse/controllers/request-group-membership-form.js.es6 index dd3a9951609..0bab180cb90 100644 --- a/app/assets/javascripts/discourse/controllers/request-group-membership-form.js.es6 +++ b/app/assets/javascripts/discourse/controllers/request-group-membership-form.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; import DiscourseURL from "discourse/lib/url"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, reason: Ember.computed.alias("model.membership_request_template"), diff --git a/app/assets/javascripts/discourse/controllers/review-index.js.es6 b/app/assets/javascripts/discourse/controllers/review-index.js.es6 index f65fd2129b1..75ab25b4f14 100644 --- a/app/assets/javascripts/discourse/controllers/review-index.js.es6 +++ b/app/assets/javascripts/discourse/controllers/review-index.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ queryParams: [ "priority", "type", diff --git a/app/assets/javascripts/discourse/controllers/review-settings.js.es6 b/app/assets/javascripts/discourse/controllers/review-settings.js.es6 index d3ee32ccf70..8e670adb2a6 100644 --- a/app/assets/javascripts/discourse/controllers/review-settings.js.es6 +++ b/app/assets/javascripts/discourse/controllers/review-settings.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ saving: false, saved: false, diff --git a/app/assets/javascripts/discourse/controllers/search-help.js.es6 b/app/assets/javascripts/discourse/controllers/search-help.js.es6 index be04358f4bf..654722d2c73 100644 --- a/app/assets/javascripts/discourse/controllers/search-help.js.es6 +++ b/app/assets/javascripts/discourse/controllers/search-help.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { @computed showGoogleSearch() { return !Discourse.SiteSettings.login_required; diff --git a/app/assets/javascripts/discourse/controllers/second-factor-add-security-key.js.es6 b/app/assets/javascripts/discourse/controllers/second-factor-add-security-key.js.es6 index f19bb5a0f7d..54f41fc4054 100644 --- a/app/assets/javascripts/discourse/controllers/second-factor-add-security-key.js.es6 +++ b/app/assets/javascripts/discourse/controllers/second-factor-add-security-key.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { bufferToBase64, @@ -6,7 +7,7 @@ import { } from "discourse/lib/webauthn"; // model for this controller is user.js.es6 -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, errorMessage: null, diff --git a/app/assets/javascripts/discourse/controllers/second-factor-add-totp.js.es6 b/app/assets/javascripts/discourse/controllers/second-factor-add-totp.js.es6 index ac105f57b2d..eab4f2943f7 100644 --- a/app/assets/javascripts/discourse/controllers/second-factor-add-totp.js.es6 +++ b/app/assets/javascripts/discourse/controllers/second-factor-add-totp.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, secondFactorImage: null, secondFactorKey: null, diff --git a/app/assets/javascripts/discourse/controllers/second-factor-backup-edit.js.es6 b/app/assets/javascripts/discourse/controllers/second-factor-backup-edit.js.es6 index e11f484fbc5..ddddfbdb30c 100644 --- a/app/assets/javascripts/discourse/controllers/second-factor-backup-edit.js.es6 +++ b/app/assets/javascripts/discourse/controllers/second-factor-backup-edit.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { SECOND_FACTOR_METHODS } from "discourse/models/user"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { loading: false, errorMessage: null, successMessage: null, diff --git a/app/assets/javascripts/discourse/controllers/second-factor-edit-security-key.js.es6 b/app/assets/javascripts/discourse/controllers/second-factor-edit-security-key.js.es6 index 90815cfbea8..85074486072 100644 --- a/app/assets/javascripts/discourse/controllers/second-factor-edit-security-key.js.es6 +++ b/app/assets/javascripts/discourse/controllers/second-factor-edit-security-key.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { actions: { disableSecurityKey() { this.user diff --git a/app/assets/javascripts/discourse/controllers/second-factor-edit.js.es6 b/app/assets/javascripts/discourse/controllers/second-factor-edit.js.es6 index e39f0f2b659..c11b2781580 100644 --- a/app/assets/javascripts/discourse/controllers/second-factor-edit.js.es6 +++ b/app/assets/javascripts/discourse/controllers/second-factor-edit.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { actions: { disableSecondFactor() { this.user diff --git a/app/assets/javascripts/discourse/controllers/static.js.es6 b/app/assets/javascripts/discourse/controllers/static.js.es6 index 82fd514e16a..65c8de32bf9 100644 --- a/app/assets/javascripts/discourse/controllers/static.js.es6 +++ b/app/assets/javascripts/discourse/controllers/static.js.es6 @@ -1,8 +1,9 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import computed from "ember-addons/ember-computed-decorators"; import { userPath } from "discourse/lib/url"; -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), showLoginButton: Ember.computed.equal("model.path", "login"), diff --git a/app/assets/javascripts/discourse/controllers/tag-groups-show.js.es6 b/app/assets/javascripts/discourse/controllers/tag-groups-show.js.es6 index 7b80def0b7d..725b088db1c 100644 --- a/app/assets/javascripts/discourse/controllers/tag-groups-show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/tag-groups-show.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ tagGroups: Ember.inject.controller(), actions: { diff --git a/app/assets/javascripts/discourse/controllers/tag-groups.js.es6 b/app/assets/javascripts/discourse/controllers/tag-groups.js.es6 index e4515d90b96..cfde9214ea8 100644 --- a/app/assets/javascripts/discourse/controllers/tag-groups.js.es6 +++ b/app/assets/javascripts/discourse/controllers/tag-groups.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import TagGroup from "discourse/models/tag-group"; -export default Ember.Controller.extend({ +export default Controller.extend({ actions: { selectTagGroup(tagGroup) { if (this.selectedItem) { diff --git a/app/assets/javascripts/discourse/controllers/tags-index.js.es6 b/app/assets/javascripts/discourse/controllers/tags-index.js.es6 index fa20f97f2f3..81457b585c7 100644 --- a/app/assets/javascripts/discourse/controllers/tags-index.js.es6 +++ b/app/assets/javascripts/discourse/controllers/tags-index.js.es6 @@ -1,9 +1,10 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import showModal from "discourse/lib/show-modal"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Ember.Controller.extend({ +export default Controller.extend({ sortedByCount: true, sortedByName: false, diff --git a/app/assets/javascripts/discourse/controllers/tags-show.js.es6 b/app/assets/javascripts/discourse/controllers/tags-show.js.es6 index 0c1c77e6100..abd2798d26b 100644 --- a/app/assets/javascripts/discourse/controllers/tags-show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/tags-show.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { default as computed, observes @@ -48,7 +49,7 @@ if (customNavItemHref) { }); } -export default Ember.Controller.extend(BulkTopicSelection, { +export default Controller.extend(BulkTopicSelection, { application: Ember.inject.controller(), tag: null, diff --git a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 index 5d9c287cf2e..6df0ba9ac8e 100644 --- a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; const _buttons = []; @@ -67,7 +68,7 @@ addBulkButton("deleteTopics", "delete", { }); // Modal for performing bulk actions on topics -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { tags: null, emptyTags: Ember.computed.empty("tags"), diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 5e368497f23..f62884e3dca 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import { bufferedProperty } from "discourse/mixins/buffered-content"; import Composer from "discourse/models/composer"; import DiscourseURL from "discourse/lib/url"; @@ -33,7 +34,7 @@ export function registerCustomPostMessageCallback(type, callback) { customPostMessageCallbacks[type] = callback; } -export default Ember.Controller.extend(bufferedProperty("model"), { +export default Controller.extend(bufferedProperty("model"), { composer: Ember.inject.controller(), application: Ember.inject.controller(), multiSelect: false, diff --git a/app/assets/javascripts/discourse/controllers/upload-selector.js.es6 b/app/assets/javascripts/discourse/controllers/upload-selector.js.es6 index 73397bb07a9..cfb051c1f29 100644 --- a/app/assets/javascripts/discourse/controllers/upload-selector.js.es6 +++ b/app/assets/javascripts/discourse/controllers/upload-selector.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { default as computed, @@ -17,7 +18,7 @@ function uploadTranslate(key) { return `upload_selector.${key}`; } -export default Ember.Controller.extend(ModalFunctionality, { +export default Controller.extend(ModalFunctionality, { showMore: false, imageUrl: null, imageLink: null, diff --git a/app/assets/javascripts/discourse/controllers/user-activity.js.es6 b/app/assets/javascripts/discourse/controllers/user-activity.js.es6 index d8e6f29dcae..c82155802a9 100644 --- a/app/assets/javascripts/discourse/controllers/user-activity.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-activity.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import { exportUserArchive } from "discourse/lib/export-csv"; -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), router: Ember.inject.service(), user: Ember.inject.controller(), diff --git a/app/assets/javascripts/discourse/controllers/user-badges.js.es6 b/app/assets/javascripts/discourse/controllers/user-badges.js.es6 index 9046c373bdd..49b9c006a57 100644 --- a/app/assets/javascripts/discourse/controllers/user-badges.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-badges.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ user: Ember.inject.controller(), username: Ember.computed.alias("user.model.username_lower"), sortedBadges: Ember.computed.sort("model", "badgeSortOrder"), diff --git a/app/assets/javascripts/discourse/controllers/user-card.js.es6 b/app/assets/javascripts/discourse/controllers/user-card.js.es6 index 0f26ea5e596..1d59df23195 100644 --- a/app/assets/javascripts/discourse/controllers/user-card.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-card.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import { default as DiscourseURL, userPath, groupPath } from "discourse/lib/url"; -export default Ember.Controller.extend({ +export default Controller.extend({ topic: Ember.inject.controller(), router: Ember.inject.service(), diff --git a/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6 b/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6 index 23bbd45295f..7f2ef2ee873 100644 --- a/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6 @@ -1,3 +1,4 @@ +import Controller from "@ember/controller"; import Invite from "discourse/models/invite"; import debounce from "discourse/lib/debounce"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -6,7 +7,7 @@ import { observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ user: null, model: null, filter: null, diff --git a/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 b/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 index bb94ee6f509..e309e9349b8 100644 --- a/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import { default as computed, observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), @observes("model.canLoadMore") diff --git a/app/assets/javascripts/discourse/controllers/user-posts.js.es6 b/app/assets/javascripts/discourse/controllers/user-posts.js.es6 index 25c730d97ad..d60f93f45cc 100644 --- a/app/assets/javascripts/discourse/controllers/user-posts.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-posts.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ application: Ember.inject.controller(), _showFooter: function() { diff --git a/app/assets/javascripts/discourse/controllers/user-private-messages-tags.js.es6 b/app/assets/javascripts/discourse/controllers/user-private-messages-tags.js.es6 index 1be6e948c45..d1c311f8932 100644 --- a/app/assets/javascripts/discourse/controllers/user-private-messages-tags.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-private-messages-tags.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ sortProperties: ["count:desc", "id"], tagsForUser: null, sortedByCount: true, diff --git a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 index c5e1bd94528..cb4919867a0 100644 --- a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import Topic from "discourse/models/topic"; -export default Ember.Controller.extend({ +export default Controller.extend({ router: Ember.inject.service(), userTopicsList: Ember.inject.controller("user-topics-list"), user: Ember.inject.controller(), diff --git a/app/assets/javascripts/discourse/controllers/user-summary.js.es6 b/app/assets/javascripts/discourse/controllers/user-summary.js.es6 index 2e88396cb73..1f4ba939f2d 100644 --- a/app/assets/javascripts/discourse/controllers/user-summary.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-summary.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { durationTiny } from "discourse/lib/formatter"; // should be kept in sync with 'UserSummary::MAX_BADGES' const MAX_BADGES = 6; -export default Ember.Controller.extend({ +export default Controller.extend({ userController: Ember.inject.controller("user"), user: Ember.computed.alias("userController.model"), diff --git a/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 b/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 index dd453138d8b..b7b1bb7d12c 100644 --- a/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 @@ -1,7 +1,8 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; // Lists of topics on a user's page. -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), hideCategory: false, diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index e59b0edfdc3..f1f90bfa94c 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import CanCheckEmails from "discourse/mixins/can-check-emails"; import computed from "ember-addons/ember-computed-decorators"; import User from "discourse/models/user"; import optionalService from "discourse/lib/optional-service"; import { prioritizeNameInUx } from "discourse/lib/settings"; -export default Ember.Controller.extend(CanCheckEmails, { +export default Controller.extend(CanCheckEmails, { indexStream: false, router: Ember.inject.service(), userNotifications: Ember.inject.controller("user-notifications"), diff --git a/app/assets/javascripts/discourse/controllers/users.js.es6 b/app/assets/javascripts/discourse/controllers/users.js.es6 index 2fa9a8de59a..61476963a07 100644 --- a/app/assets/javascripts/discourse/controllers/users.js.es6 +++ b/app/assets/javascripts/discourse/controllers/users.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; -export default Ember.Controller.extend({ +export default Controller.extend({ application: Ember.inject.controller(), queryParams: ["period", "order", "asc", "name", "group", "exclude_usernames"], period: "weekly", diff --git a/app/assets/javascripts/wizard/controllers/application.js.es6 b/app/assets/javascripts/wizard/controllers/application.js.es6 index a98fff8d9db..58aede12a14 100644 --- a/app/assets/javascripts/wizard/controllers/application.js.es6 +++ b/app/assets/javascripts/wizard/controllers/application.js.es6 @@ -1,6 +1,7 @@ +import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Controller.extend({ +export default Controller.extend({ currentStepId: null, @computed("currentStepId") diff --git a/app/assets/javascripts/wizard/controllers/step.js.es6 b/app/assets/javascripts/wizard/controllers/step.js.es6 index 7c632570392..25e0ba0a4b9 100644 --- a/app/assets/javascripts/wizard/controllers/step.js.es6 +++ b/app/assets/javascripts/wizard/controllers/step.js.es6 @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ wizard: null, step: null, diff --git a/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-index.js.es6.erb b/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-index.js.es6.erb index 044750a7ed6..1e7a349b558 100644 --- a/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-index.js.es6.erb +++ b/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-index.js.es6.erb @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ actions: { } }); diff --git a/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-show.js.es6.erb b/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-show.js.es6.erb index 044750a7ed6..1e7a349b558 100644 --- a/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-show.js.es6.erb +++ b/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller-show.js.es6.erb @@ -1,4 +1,5 @@ -export default Ember.Controller.extend({ +import Controller from "@ember/controller"; +export default Controller.extend({ actions: { } }); diff --git a/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller.js.es6.erb b/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller.js.es6.erb index 2d3f9600e21..1c0ee0801d4 100644 --- a/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller.js.es6.erb +++ b/lib/generators/plugin/templates/assets/javascripts/discourse/controllers/controller.js.es6.erb @@ -1 +1,2 @@ -export default Ember.Controller.extend({}); +import Controller from "@ember/controller"; +export default Controller.extend({}); diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 index df1c4b06819..fdb7e0498e1 100644 --- a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 @@ -1,10 +1,11 @@ +import Controller from "@ember/controller"; import { default as computed, observes } from "ember-addons/ember-computed-decorators"; import InputValidation from "discourse/models/input-validation"; -export default Ember.Controller.extend({ +export default Controller.extend({ regularPollType: "regular", numberPollType: "number", multiplePollType: "multiple", diff --git a/test/javascripts/mixins/grant-badge-controller-test.js.es6 b/test/javascripts/mixins/grant-badge-controller-test.js.es6 index c08276c80dc..19d390a5ef9 100644 --- a/test/javascripts/mixins/grant-badge-controller-test.js.es6 +++ b/test/javascripts/mixins/grant-badge-controller-test.js.es6 @@ -1,11 +1,10 @@ +import Controller from "@ember/controller"; import GrantBadgeControllerMixin from "discourse/mixins/grant-badge-controller"; import Badge from "discourse/models/badge"; QUnit.module("mixin:grant-badge-controller", { before: function() { - this.GrantBadgeController = Ember.Controller.extend( - GrantBadgeControllerMixin - ); + this.GrantBadgeController = Controller.extend(GrantBadgeControllerMixin); this.badgeFirst = Badge.create({ id: 3,