diff --git a/app/assets/javascripts/admin/models/theme.js.es6 b/app/assets/javascripts/admin/models/theme.js.es6 index bf4700719b2..4ea3d3e2163 100644 --- a/app/assets/javascripts/admin/models/theme.js.es6 +++ b/app/assets/javascripts/admin/models/theme.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { or, gt } from "@ember/object/computed"; import RestModel from "discourse/models/rest"; @@ -243,7 +244,7 @@ const Theme = RestModel.extend({ @computed("childThemes.[]") child_theme_ids(childThemes) { if (childThemes) { - return childThemes.map(theme => Ember.get(theme, "id")); + return childThemes.map(theme => get(theme, "id")); } }, diff --git a/app/assets/javascripts/admin/routes/admin-badges-show.js.es6 b/app/assets/javascripts/admin/routes/admin-badges-show.js.es6 index 039231e8976..36043f60964 100644 --- a/app/assets/javascripts/admin/routes/admin-badges-show.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-badges-show.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import Route from "@ember/routing/route"; import { ajax } from "discourse/lib/ajax"; import Badge from "discourse/models/badge"; @@ -5,7 +6,7 @@ import showModal from "discourse/lib/show-modal"; export default Route.extend({ serialize(m) { - return { badge_id: Ember.get(m, "id") || "new" }; + return { badge_id: get(m, "id") || "new" }; }, model(params) { diff --git a/app/assets/javascripts/admin/routes/admin-user.js.es6 b/app/assets/javascripts/admin/routes/admin-user.js.es6 index cdb611964eb..563c63d0a5e 100644 --- a/app/assets/javascripts/admin/routes/admin-user.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-user.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import AdminUser from "admin/models/admin-user"; @@ -10,7 +11,7 @@ export default DiscourseRoute.extend({ }, model(params) { - return AdminUser.find(Ember.get(params, "user_id")); + return AdminUser.find(get(params, "user_id")); }, renderTemplate() { diff --git a/app/assets/javascripts/admin/routes/admin-web-hooks-show-events.js.es6 b/app/assets/javascripts/admin/routes/admin-web-hooks-show-events.js.es6 index f4b6c740d26..2b70a5e79e1 100644 --- a/app/assets/javascripts/admin/routes/admin-web-hooks-show-events.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-web-hooks-show-events.js.es6 @@ -1,10 +1,11 @@ +import { get } from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; export default DiscourseRoute.extend({ model(params) { return this.store.findAll( "web-hook-event", - Ember.get(params, "web_hook_id") + get(params, "web_hook_id") ); }, diff --git a/app/assets/javascripts/admin/routes/admin-web-hooks-show.js.es6 b/app/assets/javascripts/admin/routes/admin-web-hooks-show.js.es6 index 07878867166..dd9780068cc 100644 --- a/app/assets/javascripts/admin/routes/admin-web-hooks-show.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-web-hooks-show.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import DiscourseRoute from "discourse/routes/discourse"; @@ -10,7 +11,7 @@ export default DiscourseRoute.extend({ if (params.web_hook_id === "new") { return this.store.createRecord("web-hook"); } - return this.store.find("web-hook", Ember.get(params, "web_hook_id")); + return this.store.find("web-hook", get(params, "web_hook_id")); }, setupController(controller, model) { diff --git a/app/assets/javascripts/discourse-common/lib/helpers.js.es6 b/app/assets/javascripts/discourse-common/lib/helpers.js.es6 index 907ae24d8c9..79d43aa84ff 100644 --- a/app/assets/javascripts/discourse-common/lib/helpers.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/helpers.js.es6 @@ -1,4 +1,4 @@ -import { get } from "discourse-common/lib/raw-handlebars"; +import { rawGet } from "discourse-common/lib/raw-handlebars"; export function htmlHelper(fn) { return Ember.Helper.helper(function(...args) { @@ -39,7 +39,7 @@ function resolveParams(ctx, options) { ) { params[k] = hash[k]; } else if (type === "ID" || type === "PathExpression") { - params[k] = get(ctx, hash[k], options); + params[k] = rawGet(ctx, hash[k], options); } }); } else { @@ -59,7 +59,7 @@ export function registerUnbound(name, fn) { options.types && (options.types[i] === "ID" || options.types[i] === "PathExpression") ) { - properties[i] = get(this, properties[i], options); + properties[i] = rawGet(this, properties[i], options); } } diff --git a/app/assets/javascripts/discourse-common/lib/raw-handlebars.js.es6 b/app/assets/javascripts/discourse-common/lib/raw-handlebars.js.es6 index 5922fc55c81..78cec47164e 100644 --- a/app/assets/javascripts/discourse-common/lib/raw-handlebars.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/raw-handlebars.js.es6 @@ -1,3 +1,5 @@ +import { get } from "@ember/object"; + // This is a mechanism for quickly rendering templates which is Ember aware // templates are highly compatible with Ember so you don't need to worry about calling "get" // and computed properties function, additionally it uses stringParams like Ember does @@ -24,7 +26,7 @@ RawHandlebars.helpers["get"] = function(context, options) { context = context.slice(context.indexOf(".") + 1); } - return val === undefined ? Ember.get(firstContext, context) : val; + return val === undefined ? get(firstContext, context) : val; }; // adds compatability so this works with stringParams @@ -45,7 +47,7 @@ RawHandlebars.registerHelper("each", function( contextName, options ) { - var list = Ember.get(this, contextName); + var list = get(this, contextName); var output = []; var innerContext = objectCreate(this); for (var i = 0; i < list.length; i++) { @@ -178,7 +180,7 @@ RawHandlebars.get = function(ctx, property, options) { ? view.getStream(property).value() : view.getAttr(property); } else { - return Ember.get(ctx, property); + return get(ctx, property); } }; @@ -194,7 +196,7 @@ export function compile() { return RawHandlebars.compile.apply(this, arguments); } -export function get() { +export function rawGet() { return RawHandlebars.get.apply(this, arguments); } diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index 408922ea8fc..199f6374a90 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -11,7 +11,10 @@ var define, requirejs; default: Ember.Controller, inject: Ember.inject.controller }, - "@ember/object": { default: Ember.Object }, + "@ember/object": { + default: Ember.Object, + get: Ember.get + }, "@ember/object/computed": { default: Ember.computed, alias: Ember.computed.alias, diff --git a/app/assets/javascripts/discourse/components/choose-message.js.es6 b/app/assets/javascripts/discourse/components/choose-message.js.es6 index dc8e38eab46..cb6c251355e 100644 --- a/app/assets/javascripts/discourse/components/choose-message.js.es6 +++ b/app/assets/javascripts/discourse/components/choose-message.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { next } from "@ember/runloop"; import Component from "@ember/component"; @@ -57,7 +58,7 @@ export default Component.extend({ actions: { chooseMessage(message) { - const messageId = Ember.get(message, "id"); + const messageId = get(message, "id"); this.set("selectedTopicId", messageId); next(() => $(`#choose-message-${messageId}`).prop("checked", "true")); return false; diff --git a/app/assets/javascripts/discourse/components/suggested-topics.js.es6 b/app/assets/javascripts/discourse/components/suggested-topics.js.es6 index e8415f34980..11b6cbf20d3 100644 --- a/app/assets/javascripts/discourse/components/suggested-topics.js.es6 +++ b/app/assets/javascripts/discourse/components/suggested-topics.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import Component from "@ember/component"; import computed from "ember-addons/ember-computed-decorators"; import { categoryBadgeHTML } from "discourse/helpers/category-link"; @@ -35,7 +36,7 @@ export default Component.extend({ if ( category && - Ember.get(category, "id") === + get(category, "id") === Discourse.Site.currentProp("uncategorized_category_id") ) { category = null; diff --git a/app/assets/javascripts/discourse/helpers/bound-avatar.js.es6 b/app/assets/javascripts/discourse/helpers/bound-avatar.js.es6 index a1058c4e3d4..6504dc1c085 100644 --- a/app/assets/javascripts/discourse/helpers/bound-avatar.js.es6 +++ b/app/assets/javascripts/discourse/helpers/bound-avatar.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { htmlHelper } from "discourse-common/lib/helpers"; import { avatarImg } from "discourse/lib/utilities"; @@ -8,6 +9,6 @@ export default htmlHelper((user, size) => { return "
"; } - const avatarTemplate = Ember.get(user, "avatar_template"); + const avatarTemplate = get(user, "avatar_template"); return avatarImg(addExtraUserClasses(user, { size, avatarTemplate })); }); diff --git a/app/assets/javascripts/discourse/helpers/category-link.js.es6 b/app/assets/javascripts/discourse/helpers/category-link.js.es6 index 7f02dae2804..c76382c8df6 100644 --- a/app/assets/javascripts/discourse/helpers/category-link.js.es6 +++ b/app/assets/javascripts/discourse/helpers/category-link.js.es6 @@ -1,10 +1,9 @@ +import { get } from "@ember/object"; import { registerUnbound } from "discourse-common/lib/helpers"; import { isRTL } from "discourse/lib/text-direction"; import { iconHTML } from "discourse-common/lib/icon-library"; -var get = Ember.get, - escapeExpression = Handlebars.Utils.escapeExpression; - +let escapeExpression = Handlebars.Utils.escapeExpression; let _renderer = defaultCategoryLinkRenderer; export function replaceCategoryLinkRenderer(fn) { @@ -32,7 +31,7 @@ export function categoryBadgeHTML(category, opts) { if ( !category || (!opts.allowUncategorized && - Ember.get(category, "id") === + get(category, "id") === Discourse.Site.currentProp("uncategorized_category_id") && Discourse.SiteSettings.suppress_uncategorized_badge) ) diff --git a/app/assets/javascripts/discourse/helpers/editable-value.js.es6 b/app/assets/javascripts/discourse/helpers/editable-value.js.es6 index 799815590ad..131973c0b33 100644 --- a/app/assets/javascripts/discourse/helpers/editable-value.js.es6 +++ b/app/assets/javascripts/discourse/helpers/editable-value.js.es6 @@ -1,10 +1,11 @@ +import { get } from "@ember/object"; export function formatCurrency([reviewable, fieldId]) { // The field `category_id` corresponds to `category` if (fieldId === "category_id") { fieldId = "category.id"; } - let value = Ember.get(reviewable, fieldId); + let value = get(reviewable, fieldId); // If it's an array, say tags, make a copy so we aren't mutating the original if (Array.isArray(value)) { diff --git a/app/assets/javascripts/discourse/helpers/user-avatar.js.es6 b/app/assets/javascripts/discourse/helpers/user-avatar.js.es6 index ff09e4e2fcd..b46a49d6ff2 100644 --- a/app/assets/javascripts/discourse/helpers/user-avatar.js.es6 +++ b/app/assets/javascripts/discourse/helpers/user-avatar.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { registerUnbound } from "discourse-common/lib/helpers"; import { avatarImg, formatUsername } from "discourse/lib/utilities"; @@ -30,9 +31,9 @@ function renderAvatar(user, options) { options = options || {}; if (user) { - const name = Ember.get(user, options.namePath || "name"); - const username = Ember.get(user, options.usernamePath || "username"); - const avatarTemplate = Ember.get( + const name = get(user, options.namePath || "name"); + const username = get(user, options.usernamePath || "username"); + const avatarTemplate = get( user, options.avatarTemplatePath || "avatar_template" ); @@ -46,11 +47,11 @@ function renderAvatar(user, options) { let title = options.title; if (!title && !options.ignoreTitle) { // first try to get a title - title = Ember.get(user, "title"); + title = get(user, "title"); // if there was no title provided if (!title) { // try to retrieve a description - const description = Ember.get(user, "description"); + const description = get(user, "description"); // if a description has been provided if (description && description.length > 0) { // preprend the username before the description @@ -61,7 +62,7 @@ function renderAvatar(user, options) { return avatarImg({ size: options.imageSize, - extraClasses: Ember.get(user, "extras") || options.extraClasses, + extraClasses: get(user, "extras") || options.extraClasses, title: title || displayName, avatarTemplate: avatarTemplate }); diff --git a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 index 26e6d16ef27..9658a959e28 100644 --- a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 +++ b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 @@ -463,7 +463,7 @@ class PluginApi { ```javascript api.customUserAvatarClasses(user => { - if (Ember.get(user, 'primary_group_name') === 'managers') { + if (get(user, 'primary_group_name') === 'managers') { return ['managers']; } }); diff --git a/app/assets/javascripts/discourse/models/category.js.es6 b/app/assets/javascripts/discourse/models/category.js.es6 index 48f78e1ec09..4248f6a8f81 100644 --- a/app/assets/javascripts/discourse/models/category.js.es6 +++ b/app/assets/javascripts/discourse/models/category.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import RestModel from "discourse/models/rest"; import computed from "ember-addons/ember-computed-decorators"; @@ -232,15 +233,15 @@ Category.reopenClass({ slugFor(category, separator = "/") { if (!category) return ""; - const parentCategory = Ember.get(category, "parentCategory"); + const parentCategory = get(category, "parentCategory"); let result = ""; if (parentCategory) { result = Category.slugFor(parentCategory) + separator; } - const id = Ember.get(category, "id"), - slug = Ember.get(category, "slug"); + const id = get(category, "id"), + slug = get(category, "slug"); return !slug || slug.trim().length === 0 ? `${result}${id}-category` diff --git a/app/assets/javascripts/discourse/models/post-stream.js.es6 b/app/assets/javascripts/discourse/models/post-stream.js.es6 index 0f60c6e7377..ae634fbd311 100644 --- a/app/assets/javascripts/discourse/models/post-stream.js.es6 +++ b/app/assets/javascripts/discourse/models/post-stream.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { or, not, and } from "@ember/object/computed"; import { ajax } from "discourse/lib/ajax"; @@ -882,12 +883,12 @@ export default RestModel.extend({ than you supplied if the post has already been loaded. **/ storePost(post) { - // Calling `Ember.get(undefined)` raises an error + // Calling `get(undefined)` raises an error if (!post) { return; } - const postId = Ember.get(post, "id"); + const postId = get(post, "id"); if (postId) { const existing = this._identityMap[post.get("id")]; @@ -931,7 +932,7 @@ export default RestModel.extend({ this.set("topic.suggested_topics", result.suggested_topics); } - const posts = Ember.get(result, "post_stream.posts"); + const posts = get(result, "post_stream.posts"); if (posts) { posts.forEach(p => { @@ -971,7 +972,7 @@ export default RestModel.extend({ this.set("topic.suggested_topics", result.suggested_topics); } - const posts = Ember.get(result, "post_stream.posts"); + const posts = get(result, "post_stream.posts"); if (posts) { posts.forEach(p => this.storePost(store.createRecord("post", p))); diff --git a/app/assets/javascripts/discourse/models/post.js.es6 b/app/assets/javascripts/discourse/models/post.js.es6 index 59487da87d5..382b369c562 100644 --- a/app/assets/javascripts/discourse/models/post.js.es6 +++ b/app/assets/javascripts/discourse/models/post.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { equal, and, or, not } from "@ember/object/computed"; import EmberObject from "@ember/object"; @@ -282,7 +283,7 @@ const Post = RestModel.extend({ if (key === "reply_to_user" && value && oldValue) { skip = value.username === oldValue.username || - Ember.get(value, "username") === Ember.get(oldValue, "username"); + get(value, "username") === get(oldValue, "username"); } if (!skip) { diff --git a/app/assets/javascripts/discourse/models/site.js.es6 b/app/assets/javascripts/discourse/models/site.js.es6 index 6057ece5da2..07dc4d72b3a 100644 --- a/app/assets/javascripts/discourse/models/site.js.es6 +++ b/app/assets/javascripts/discourse/models/site.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { alias, sort } from "@ember/object/computed"; import EmberObject from "@ember/object"; @@ -110,7 +111,7 @@ const Site = RestModel.extend({ updateCategory(newCategory) { const categories = this.categories; - const categoryId = Ember.get(newCategory, "id"); + const categoryId = get(newCategory, "id"); const existingCategory = categories.findBy("id", categoryId); // Don't update null permissions diff --git a/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 b/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 index 13476b900e7..89eab6119a9 100644 --- a/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 +++ b/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { NotificationLevels } from "discourse/lib/notification-levels"; import { @@ -390,8 +391,8 @@ const TopicTrackingState = Discourse.Model.extend({ ); } - let categoryId = category ? Ember.get(category, "id") : null; - let categoryName = category ? Ember.get(category, "name") : null; + let categoryId = category ? get(category, "id") : null; + let categoryName = category ? get(category, "name") : null; if (name === "new") { return this.countNew(categoryId); diff --git a/app/assets/javascripts/discourse/models/topic.js.es6 b/app/assets/javascripts/discourse/models/topic.js.es6 index a4940d2c0a9..b7614afddf7 100644 --- a/app/assets/javascripts/discourse/models/topic.js.es6 +++ b/app/assets/javascripts/discourse/models/topic.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { not, notEmpty, equal, and, or } from "@ember/object/computed"; import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; @@ -378,7 +379,7 @@ const Topic = RestModel.extend({ this.set("bookmarking", true); const stream = this.postStream; - const posts = Ember.get(stream, "posts"); + const posts = get(stream, "posts"); const firstPost = posts && posts[0] && posts[0].get("post_number") === 1 && posts[0]; const bookmark = !this.bookmarked; diff --git a/app/assets/javascripts/discourse/routes/group-activity-posts.js.es6 b/app/assets/javascripts/discourse/routes/group-activity-posts.js.es6 index 77a8c600cdb..86b35b6534b 100644 --- a/app/assets/javascripts/discourse/routes/group-activity-posts.js.es6 +++ b/app/assets/javascripts/discourse/routes/group-activity-posts.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; export function buildGroupPage(type) { @@ -9,7 +10,7 @@ export function buildGroupPage(type) { }, model(params, transition) { - let categoryId = Ember.get(transition.to, "queryParams.category_id"); + let categoryId = get(transition.to, "queryParams.category_id"); return this.modelFor("group").findPosts({ type, categoryId }); }, diff --git a/app/assets/javascripts/discourse/routes/topic.js.es6 b/app/assets/javascripts/discourse/routes/topic.js.es6 index 60bc266f00c..a6f3eba69ad 100644 --- a/app/assets/javascripts/discourse/routes/topic.js.es6 +++ b/app/assets/javascripts/discourse/routes/topic.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { cancel } from "@ember/runloop"; import { scheduleOnce } from "@ember/runloop"; @@ -215,9 +216,9 @@ const TopicRoute = DiscourseRoute.extend({ setupParams(topic, params) { const postStream = topic.get("postStream"); - postStream.set("summary", Ember.get(params, "filter") === "summary"); + postStream.set("summary", get(params, "filter") === "summary"); - const usernames = Ember.get(params, "username_filters"), + const usernames = get(params, "username_filters"), userFilters = postStream.get("userFilters"); userFilters.clear(); diff --git a/app/assets/javascripts/discourse/services/search.js.es6 b/app/assets/javascripts/discourse/services/search.js.es6 index dba599c6909..641e35e4825 100644 --- a/app/assets/javascripts/discourse/services/search.js.es6 +++ b/app/assets/javascripts/discourse/services/search.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import EmberObject from "@ember/object"; import { default as computed, @@ -19,7 +20,7 @@ export default EmberObject.extend({ contextType: { get(searchContext) { if (searchContext) { - return Ember.get(searchContext, "type"); + return get(searchContext, "type"); } }, set(value, searchContext) { diff --git a/app/assets/javascripts/discourse/services/theme-settings.js.es6 b/app/assets/javascripts/discourse/services/theme-settings.js.es6 index 5ebe9f37057..032024b56bf 100644 --- a/app/assets/javascripts/discourse/services/theme-settings.js.es6 +++ b/app/assets/javascripts/discourse/services/theme-settings.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import Service from "@ember/service"; export default Service.extend({ @@ -14,7 +15,7 @@ export default Service.extend({ getSetting(themeId, settingsKey) { if (this._settings[themeId]) { - return Ember.get(this._settings[themeId], settingsKey); + return get(this._settings[themeId], settingsKey); } return null; }, diff --git a/app/assets/javascripts/discourse/widgets/header.js.es6 b/app/assets/javascripts/discourse/widgets/header.js.es6 index 02fd704dca3..c86931260b1 100644 --- a/app/assets/javascripts/discourse/widgets/header.js.es6 +++ b/app/assets/javascripts/discourse/widgets/header.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { schedule } from "@ember/runloop"; import { createWidget } from "discourse/widgets/widget"; import { iconNode } from "discourse-common/lib/icon-library"; @@ -558,7 +559,7 @@ export default createWidget("header", { if (service) { const ctx = service.get("searchContext"); if (ctx) { - return Ember.get(ctx, "type"); + return get(ctx, "type"); } } } diff --git a/app/assets/javascripts/discourse/widgets/search-menu-controls.js.es6 b/app/assets/javascripts/discourse/widgets/search-menu-controls.js.es6 index c546c59c553..de2ea2ac427 100644 --- a/app/assets/javascripts/discourse/widgets/search-menu-controls.js.es6 +++ b/app/assets/javascripts/discourse/widgets/search-menu-controls.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { searchContextDescription } from "discourse/lib/search"; import { h } from "virtual-dom"; import { createWidget } from "discourse/widgets/widget"; @@ -52,8 +53,8 @@ createWidget("search-context", { const result = []; if (ctx) { const description = searchContextDescription( - Ember.get(ctx, "type"), - Ember.get(ctx, "user.username") || Ember.get(ctx, "category.name") + get(ctx, "type"), + get(ctx, "user.username") || get(ctx, "category.name") ); result.push( h("label", [ diff --git a/app/assets/javascripts/discourse/widgets/search-menu.js.es6 b/app/assets/javascripts/discourse/widgets/search-menu.js.es6 index 1bd428a8352..5c3b3e08b1f 100644 --- a/app/assets/javascripts/discourse/widgets/search-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/search-menu.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { debounce } from "@ember/runloop"; import { later } from "@ember/runloop"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -99,7 +100,7 @@ export default createWidget("search-menu", { const contextEnabled = searchData.contextEnabled; const ctx = contextEnabled ? this.searchContext() : null; - const type = ctx ? Ember.get(ctx, "type") : null; + const type = ctx ? get(ctx, "type") : null; let url = "/search"; const params = []; diff --git a/app/assets/javascripts/select-kit/components/category-selector.js.es6 b/app/assets/javascripts/select-kit/components/category-selector.js.es6 index b53e8ea2a82..17e138e3617 100644 --- a/app/assets/javascripts/select-kit/components/category-selector.js.es6 +++ b/app/assets/javascripts/select-kit/components/category-selector.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { makeArray } from "discourse/lib/utilities"; import MultiSelectComponent from "select-kit/components/multi-select"; import Category from "discourse/models/category"; @@ -39,7 +40,7 @@ export default MultiSelectComponent.extend({ filterComputedContent(computedContent, computedValues, filter) { const regex = new RegExp(filter, "i"); return computedContent.filter(category => - this._normalize(Ember.get(category, "name")).match(regex) + this._normalize(get(category, "name")).match(regex) ); }, diff --git a/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6 b/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6 index bfd9a44af80..1e6d4ebe746 100644 --- a/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6 +++ b/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6 @@ -1,3 +1,5 @@ +import { isEmpty } from "@ember/utils"; +import { get } from "@ember/object"; import { makeArray } from "discourse/lib/utilities"; import Category from "discourse/models/category"; import ComboBox from "select-kit/components/combo-box"; @@ -6,7 +8,6 @@ import { default as computed } from "ember-addons/ember-computed-decorators"; import renderTag from "discourse/lib/render-tag"; import { escapeExpression } from "discourse/lib/utilities"; import { iconHTML } from "discourse-common/lib/icon-library"; -const { get, isEmpty, run } = Ember; export default ComboBox.extend(TagsMixin, { allowContentReplacement: true, @@ -168,9 +169,7 @@ export default ComboBox.extend(TagsMixin, { computeHeaderContent() { let content = this._super(...arguments); - const joinedTags = this.selection - .map(s => Ember.get(s, "value")) - .join(", "); + const joinedTags = this.selection.map(s => get(s, "value")).join(", "); if (isEmpty(this.selection)) { content.label = I18n.t("tagging.choose_for_topic"); @@ -198,7 +197,7 @@ export default ComboBox.extend(TagsMixin, { if (this.selection) { data.selected_tags = this.selection - .map(s => Ember.get(s, "value")) + .map(s => get(s, "value")) .slice(0, 100); } diff --git a/app/assets/javascripts/select-kit/mixins/events.js.es6 b/app/assets/javascripts/select-kit/mixins/events.js.es6 index b43c2542d0f..d369445c9c2 100644 --- a/app/assets/javascripts/select-kit/mixins/events.js.es6 +++ b/app/assets/javascripts/select-kit/mixins/events.js.es6 @@ -1,3 +1,4 @@ +import { get } from "@ember/object"; import { makeArray } from "discourse/lib/utilities"; import { isEmpty } from "@ember/utils"; import { throttle } from "@ember/runloop"; @@ -298,7 +299,7 @@ export default Mixin.create({ .slice() .reverse() .some(selection => { - if (!Ember.get(selection, "locked")) { + if (!get(selection, "locked")) { this.highlightSelection(selection); return true; }