DEV: Remove Ember.Mixin to import @ember/object/mixin (#8269)
This commit is contained in:
parent
e7eeb7c47f
commit
ba4b557114
|
@ -1,7 +1,8 @@
|
|||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create(ModalFunctionality, {
|
||||
export default Mixin.create(ModalFunctionality, {
|
||||
reason: null,
|
||||
message: null,
|
||||
postEdit: null,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseURL from "discourse/lib/url";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
queryParams: ["period"],
|
||||
period: "monthly",
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import { categoryLinkHTML } from "discourse/helpers/category-link";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
const CUSTOM_TYPES = [
|
||||
"bool",
|
||||
|
@ -19,7 +20,7 @@ const CUSTOM_TYPES = [
|
|||
|
||||
const AUTO_REFRESH_ON_SAVE = ["logo", "logo_small", "large_icon"];
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
classNameBindings: [":row", ":setting", "overridden", "typeClass"],
|
||||
content: Ember.computed.alias("setting"),
|
||||
validationMessage: null,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
@computed("value", "default")
|
||||
overridden(val, defaultVal) {
|
||||
if (val === null) val = "";
|
||||
|
|
|
@ -12,6 +12,7 @@ var define, requirejs;
|
|||
inject: Ember.inject.controller
|
||||
},
|
||||
"@ember/object": { default: Ember.Object },
|
||||
"@ember/object/mixin": { default: Ember.Mixin },
|
||||
"@ember/object/proxy": { default: Ember.ObjectProxy },
|
||||
"@ember/routing/route": { default: Ember.Route },
|
||||
"@ember/runloop": {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import EmberObjectProxy from "@ember/object/proxy";
|
||||
import Mixin from "@ember/object/mixin";
|
||||
|
||||
/* global BufferedProxy: true */
|
||||
export function bufferedProperty(property) {
|
||||
|
@ -21,7 +22,7 @@ export function bufferedProperty(property) {
|
|||
// It's a good idea to null out fields when declaring objects
|
||||
mixin.property = null;
|
||||
|
||||
return Ember.Mixin.create(mixin);
|
||||
return Mixin.create(mixin);
|
||||
}
|
||||
|
||||
export default bufferedProperty("content");
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { NotificationLevels } from "discourse/lib/notification-levels";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
bulkSelectEnabled: false,
|
||||
selected: null,
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { propertyEqual, setting } from "discourse/lib/computed";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
isCurrentUser: propertyEqual("model.id", "currentUser.id"),
|
||||
showEmailOnProfile: setting("moderators_view_emails"),
|
||||
canStaffCheckEmails: Ember.computed.and(
|
||||
|
|
|
@ -4,8 +4,9 @@ import { schedule } from "@ember/runloop";
|
|||
import { wantsNewWindow } from "discourse/lib/intercept-click";
|
||||
import afterTransition from "discourse/lib/after-transition";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
elementId: null, //click detection added for data-{elementId}
|
||||
triggeringLinkClass: null, //the <a> classname where this card should appear
|
||||
_showCallback: null, //username, $target - load up data for when show is called, should call this._positionCard($target) when it's done.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Mixin from '@ember/object/mixin';
|
||||
// Include this mixin if you want to be notified when the dom should be
|
||||
// cleaned (usually on route change.)
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
_initializeChooser: Ember.on("didInsertElement", function() {
|
||||
this.appEvents.on("dom:clean", this, "cleanUp");
|
||||
}),
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import Mixin from '@ember/object/mixin';
|
||||
import { debounce } from "@ember/runloop";
|
||||
|
||||
const helper = {
|
||||
offset() {
|
||||
const mainOffset = $("#main").offset();
|
||||
|
@ -7,7 +9,7 @@ const helper = {
|
|||
}
|
||||
};
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
queueDockCheck: null,
|
||||
|
||||
init() {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import UserBadge from "discourse/models/user-badge";
|
||||
import { convertIconClass } from "discourse-common/lib/icon-library";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
@computed("allBadges.[]", "userBadges.[]")
|
||||
grantableBadges(allBadges, userBadges) {
|
||||
const granted = userBadges.reduce((map, badge) => {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import Eyeline from "discourse/lib/eyeline";
|
||||
import Scrolling from "discourse/mixins/scrolling";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
// Provides the ability to load more items for a view which is scrolled to the bottom.
|
||||
export default Ember.Mixin.create(Scrolling, {
|
||||
export default Mixin.create(Scrolling, {
|
||||
scrolled() {
|
||||
const eyeline = this.eyeline;
|
||||
return eyeline && eyeline.update();
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { debounce } from "@ember/runloop";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
// Small buffer so that very tiny scrolls don't trigger mobile header switch
|
||||
const MOBILE_SCROLL_TOLERANCE = 5;
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
_lastScroll: null,
|
||||
_bottomHit: 0,
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import showModal from "discourse/lib/show-modal";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
flash(text, messageClass) {
|
||||
this.appEvents.trigger("modal-body:flash", { text, messageClass });
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import InputValidation from "discourse/models/input-validation";
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
@computed()
|
||||
nameInstructions() {
|
||||
return I18n.t(
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// This mixin allows a route to open the composer
|
||||
import Composer from "discourse/models/composer";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
openComposer(controller) {
|
||||
let categoryId = controller.get("category.id");
|
||||
if (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import Mixin from '@ember/object/mixin';
|
||||
/**
|
||||
Pan events is a mixin that allows components to detect and respond to swipe gestures
|
||||
It fires callbacks for panStart, panEnd, panMove with the pan state, and the original event.
|
||||
|
@ -6,7 +7,7 @@ export const SWIPE_VELOCITY = 40;
|
|||
export const SWIPE_DISTANCE_THRESHOLD = 50;
|
||||
export const SWIPE_VELOCITY_THRESHOLD = 0.12;
|
||||
export const MINIMUM_SWIPE_DISTANCE = 5;
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
//velocity is pixels per ms
|
||||
|
||||
_panState: null,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import InputValidation from "discourse/models/input-validation";
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
rejectedPasswords: null,
|
||||
|
||||
init() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
saved: false,
|
||||
|
||||
@computed("model.isSaving")
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { scheduleOnce } from "@ember/runloop";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { deprecated } from "discourse/mixins/scroll-top";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
const context = {
|
||||
_scrollTop() {
|
||||
|
@ -18,7 +19,7 @@ function scrollTop() {
|
|||
scheduleOnce("afterRender", context, context._scrollTop);
|
||||
}
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
didInsertElement() {
|
||||
deprecated(
|
||||
"The `ScrollTop` mixin is deprecated. Replace it with a `{{d-section}}` component"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { scheduleOnce } from "@ember/runloop";
|
||||
import debounce from "discourse/lib/debounce";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
/**
|
||||
This object provides the DOM methods we need for our Mixin to bind to scrolling
|
||||
|
@ -24,7 +25,7 @@ const ScrollingDOMMethods = {
|
|||
}
|
||||
};
|
||||
|
||||
const Scrolling = Ember.Mixin.create({
|
||||
const Scrolling = Mixin.create({
|
||||
// Begin watching for scroll events. By default they will be called at max every 100ms.
|
||||
// call with {debounce: N} for a diff time
|
||||
bindScrolling(opts) {
|
||||
|
|
|
@ -45,7 +45,9 @@
|
|||
|
||||
```
|
||||
**/
|
||||
const Singleton = Ember.Mixin.create({
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
const Singleton = Mixin.create({
|
||||
current() {
|
||||
if (!this._current) {
|
||||
this._current = this.createCurrent();
|
||||
|
|
|
@ -2,9 +2,11 @@ import {
|
|||
displayErrorForUpload,
|
||||
validateUploadedFiles
|
||||
} from "discourse/lib/utilities";
|
||||
import getUrl from "discourse-common/lib/get-url";
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
import getUrl from "discourse-common/lib/get-url";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Mixin.create({
|
||||
uploading: false,
|
||||
uploadProgress: 0,
|
||||
|
||||
|
|
|
@ -4,8 +4,9 @@ import {
|
|||
on,
|
||||
default as computed
|
||||
} from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
@on("init")
|
||||
_createUserFields() {
|
||||
if (!this.site) {
|
||||
|
|
|
@ -2,8 +2,9 @@ import InputValidation from "discourse/models/input-validation";
|
|||
import debounce from "discourse/lib/debounce";
|
||||
import { setting } from "discourse/lib/computed";
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
uniqueUsernameValidation: null,
|
||||
|
||||
maxUsernameLength: setting("max_username_length"),
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { CLOSE_STATUS_TYPE } from "discourse/controllers/edit-topic-timer";
|
||||
import { timeframeDetails } from "select-kit/components/future-date-input-selector";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
_computeIconsForValue(value) {
|
||||
let { icon } = this._updateAt(value);
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { next } from "@ember/runloop";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { throttle } from "@ember/runloop";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
const { bind } = Ember.run;
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
@on("init")
|
||||
_initKeys() {
|
||||
this.keys = {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
let _appendContentCallbacks = {};
|
||||
function appendContent(pluginApiIdentifiers, contentFunction) {
|
||||
if (Ember.isNone(_appendContentCallbacks[pluginApiIdentifiers])) {
|
||||
|
@ -167,7 +169,7 @@ export function clearCallbacks() {
|
|||
}
|
||||
|
||||
const EMPTY_ARRAY = Object.freeze([]);
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
concatenatedProperties: ["pluginApiIdentifiers"],
|
||||
pluginApiIdentifiers: EMPTY_ARRAY
|
||||
});
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
const { run, get } = Ember;
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import Mixin from '@ember/object/mixin';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Mixin from '@ember/object/mixin';
|
||||
const { get, isNone, guidFor } = Ember;
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
export default Mixin.create({
|
||||
valueForContentItem(content) {
|
||||
switch (typeof content) {
|
||||
case "string":
|
||||
|
|
Loading…
Reference in New Issue