REFACTOR: Remove Ember.get

This commit is contained in:
Robin Ward
2019-10-31 16:28:10 -04:00
parent 89f602f66b
commit 640a05c4ee
31 changed files with 84 additions and 56 deletions
@@ -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");
}
}
}
@@ -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", [
@@ -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 = [];