REFACTOR: Remove `Ember.Controller` in favor of import

This commit is contained in:
Robin Ward 2019-10-23 13:06:54 -04:00
parent e18af18fec
commit 6287eccb35
172 changed files with 623 additions and 462 deletions
app/assets/javascripts
admin/controllers
admin-backups-index.js.es6admin-backups-logs.js.es6admin-backups.js.es6admin-badges-show.js.es6admin-badges.js.es6admin-customize-colors-show.js.es6admin-customize-colors.js.es6admin-customize-email-style-edit.js.es6admin-customize-email-templates-edit.js.es6admin-customize-email-templates.js.es6admin-customize-robots-txt.js.es6admin-customize-themes-edit.js.es6admin-customize-themes-show.js.es6admin-customize-themes.js.es6admin-dashboard-general.js.es6admin-dashboard-moderation.js.es6admin-dashboard-reports.js.es6admin-dashboard.js.es6admin-email-advanced-test.js.es6admin-email-index.js.es6admin-email-logs.js.es6admin-email-preview-digest.js.es6admin-embedding.js.es6admin-emojis.js.es6admin-logs-screened-emails.js.es6admin-logs-screened-ip-addresses.js.es6admin-logs-screened-urls.js.es6admin-logs-staff-action-logs.js.es6admin-permalinks.js.es6admin-plugins.js.es6admin-reports-show.js.es6admin-search-logs-index.js.es6admin-search-logs-term.js.es6admin-site-settings-category.js.es6admin-site-settings.js.es6admin-site-text-edit.js.es6admin-site-text-index.js.es6admin-user-badges.js.es6admin-user-fields.js.es6admin-user-index.js.es6admin-user.js.es6admin-users-list-show.js.es6admin-watched-words-action.js.es6admin-watched-words.js.es6admin-web-hooks-show-events.js.es6admin-web-hooks-show.js.es6admin-web-hooks.js.es6admin.js.es6
modals
discourse/controllers

View File

@ -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"),

View File

@ -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"),

View File

@ -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",

View File

@ -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: "",

View File

@ -1 +1,2 @@
export default Ember.Controller.extend();
import Controller from "@ember/controller";
export default Controller.extend();

View File

@ -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) {

View File

@ -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);

View File

@ -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");

View File

@ -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")

View File

@ -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"),

View File

@ -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"),

View File

@ -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,

View File

@ -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"),

View File

@ -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")

View File

@ -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"),

View File

@ -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 {

View File

@ -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")

View File

@ -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"),

View File

@ -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,

View File

@ -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?

View File

@ -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) {

View File

@ -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,

View File

@ -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,

View File

@ -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() {

View File

@ -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: {

View File

@ -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,

View File

@ -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() {

View File

@ -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),

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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",

View File

@ -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,

View File

@ -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(),

View File

@ -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,

View File

@ -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")

View File

@ -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,

View File

@ -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"),

View File

@ -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"),

View File

@ -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,

View File

@ -1 +1,2 @@
export default Ember.Controller.extend();
import Controller from "@ember/controller";
export default Controller.extend();

View File

@ -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,

View File

@ -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(

View File

@ -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,

View File

@ -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"),

View File

@ -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"),

View File

@ -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(

View File

@ -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")

View File

@ -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",

View File

@ -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"),

View File

@ -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: {

View File

@ -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;

View File

@ -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);

View File

@ -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"),

View File

@ -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,

View File

@ -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,

View File

@ -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);

View File

@ -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: {

View File

@ -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,

View File

@ -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(

View File

@ -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() {

View File

@ -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;

View File

@ -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);
},

View File

@ -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

View File

@ -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,

View File

@ -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(() => {

View File

@ -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,

View File

@ -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,

View File

@ -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(),

View File

@ -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({

View File

@ -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() {

View File

@ -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",

View File

@ -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) {

View File

@ -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,

View File

@ -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
});

View File

@ -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,

View File

@ -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,

View File

@ -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: "",

View File

@ -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(),

View File

@ -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,

View File

@ -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,

View File

@ -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;

View File

@ -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(),

View File

@ -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,

View File

@ -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",

View File

@ -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")

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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));
}
}
);
});

View File

@ -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(),

View File

@ -1,4 +1,5 @@
export default Ember.Controller.extend({
import Controller from "@ember/controller";
export default Controller.extend({
actions: {
loadMore() {
this.model.loadMore();

View File

@ -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"]
});

View File

@ -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,

View File

@ -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")

View File

@ -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,

View File

@ -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,

Some files were not shown because too many files have changed in this diff Show More