REFACTOR: Remove `Ember.Controller` in favor of import
This commit is contained in:
parent
e18af18fec
commit
6287eccb35
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
admin-add-upload.js.es6admin-badge-preview.js.es6admin-color-scheme-select-base.js.es6admin-edit-badge-groupings.js.es6admin-incoming-email.js.es6admin-install-theme.js.es6admin-reseed.js.es6admin-silence-user.js.es6admin-staff-action-log-details.js.es6admin-start-backup.js.es6admin-suspend-user.js.es6admin-theme-change.js.es6admin-uploaded-image-list.js.es6admin-watched-word-test.js.es6site-setting-default-categories.js.es6
discourse/controllers
about.js.es6account-created-edit-email.js.es6account-created-index.js.es6activation-edit.js.es6add-post-notice.js.es6application.js.es6associate-account-confirm.js.es6auth-token.js.es6avatar-selector.js.es6
badges
basic-modal-body.js.es6bulk-notification-level.js.es6change-owner.js.es6change-timestamp.js.es6composer.js.es6convert-to-public-topic.js.es6create-account.js.es6discovery-sortable.js.es6discovery.js.es6edit-category.js.es6edit-topic-timer.js.es6email-login.js.es6exception.js.es6explain-reviewable.js.es6feature-topic.js.es6flag.js.es6forgot-password.js.es6full-page-search.js.es6grant-badge.js.es6group-activity-posts.js.es6group-activity-topics.js.es6group-activity.js.es6group-add-members.js.es6group-bulk-add.js.es6group-index.js.es6group-manage-logs.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"),
|
||||
|
|
|
@ -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"),
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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: "",
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export default Ember.Controller.extend();
|
||||
import Controller from "@ember/controller";
|
||||
export default Controller.extend();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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"),
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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?
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(),
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export default Ember.Controller.extend();
|
||||
import Controller from "@ember/controller";
|
||||
export default Controller.extend();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"),
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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: "",
|
||||
|
|
|
@ -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(),
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Controller.extend({
|
||||
import Controller from "@ember/controller";
|
||||
export default Controller.extend({
|
||||
actions: {
|
||||
loadMore() {
|
||||
this.model.loadMore();
|
||||
|
|
|
@ -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"]
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue