mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 08:15:00 +00:00
DEV: Fix decorator deprecations (#20438)
…and correctly fix the decorateCookedElement id arg
This commit is contained in:
parent
1dca7b8b0a
commit
04659b0e41
@ -1,11 +1,11 @@
|
||||
import { action } from "@ember/object";
|
||||
import { classNames } from "@ember-decorators/component";
|
||||
import { on } from "@ember-decorators/object";
|
||||
import { observes, on } from "@ember-decorators/object";
|
||||
import Component from "@ember/component";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import I18n from "I18n";
|
||||
import { bind, observes } from "discourse-common/utils/decorators";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
|
||||
const COLOR_VARS_REGEX =
|
||||
/\$(primary|secondary|tertiary|quaternary|header_background|header_primary|highlight|danger|success|love)(\s|;|-(low|medium|high))/g;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { classNames } from "@ember-decorators/component";
|
||||
import { observes, on } from "discourse-common/utils/decorators";
|
||||
import { observes, on } from "@ember-decorators/object";
|
||||
import Component from "@ember/component";
|
||||
import I18n from "I18n";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { classNames } from "@ember-decorators/component";
|
||||
import { action, computed } from "@ember/object";
|
||||
import Component from "@ember/component";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
import { observes } from "@ember-decorators/object";
|
||||
|
||||
/**
|
||||
An input field for a color.
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { observes, on } from "discourse-common/utils/decorators";
|
||||
import { observes, on } from "@ember-decorators/object";
|
||||
import Component from "@ember/component";
|
||||
import highlightSyntax from "discourse/lib/highlight-syntax";
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { classNameBindings } from "@ember-decorators/component";
|
||||
import Component from "@ember/component";
|
||||
import I18n from "I18n";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { on } from "discourse-common/utils/decorators";
|
||||
import { on } from "@ember-decorators/object";
|
||||
import { action, set } from "@ember/object";
|
||||
|
||||
@classNameBindings(":value-list", ":secret-value-list")
|
||||
|
@ -2,7 +2,8 @@ import { classNameBindings } from "@ember-decorators/component";
|
||||
import { empty } from "@ember/object/computed";
|
||||
import Component from "@ember/component";
|
||||
import { action } from "@ember/object";
|
||||
import discourseComputed, { on } from "discourse-common/utils/decorators";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { on } from "@ember-decorators/object";
|
||||
|
||||
@classNameBindings(":simple-list", ":value-list")
|
||||
export default class SimpleList extends Component {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { classNameBindings, classNames } from "@ember-decorators/component";
|
||||
import Component from "@ember/component";
|
||||
import highlightHTML from "discourse/lib/highlight-html";
|
||||
import { on } from "discourse-common/utils/decorators";
|
||||
import { on } from "@ember-decorators/object";
|
||||
|
||||
@classNames("site-text")
|
||||
@classNameBindings("siteText.overridden")
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { action } from "@ember/object";
|
||||
import { classNames } from "@ember-decorators/component";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { on } from "@ember-decorators/object";
|
||||
import { empty, reads } from "@ember/object/computed";
|
||||
import discourseComputed, { on } from "discourse-common/utils/decorators";
|
||||
import Component from "@ember/component";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
|
||||
|
@ -2,7 +2,8 @@ import { action } from "@ember/object";
|
||||
import { classNames, tagName } from "@ember-decorators/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { equal, not } from "@ember/object/computed";
|
||||
import discourseComputed, { observes } from "discourse-common/utils/decorators";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { observes } from "@ember-decorators/object";
|
||||
import Component from "@ember/component";
|
||||
import I18n from "I18n";
|
||||
import WatchedWord from "admin/models/watched-word";
|
||||
|
@ -23,10 +23,9 @@ acceptance("Acceptance | decorateCookedElement", function () {
|
||||
DemoComponent
|
||||
);
|
||||
|
||||
withPluginApi(
|
||||
0,
|
||||
(api) => {
|
||||
api.decorateCookedElement((cooked, helper) => {
|
||||
withPluginApi(0, (api) => {
|
||||
api.decorateCookedElement(
|
||||
(cooked, helper) => {
|
||||
if (helper.getModel().post_number !== 1) {
|
||||
return;
|
||||
}
|
||||
@ -47,10 +46,10 @@ acceptance("Acceptance | decorateCookedElement", function () {
|
||||
cooked.querySelector(".existing-wrapper"),
|
||||
hbs` with more content from glimmer`
|
||||
);
|
||||
});
|
||||
},
|
||||
{ id: "render-glimmer-test" }
|
||||
);
|
||||
},
|
||||
{ id: "render-glimmer-test" }
|
||||
);
|
||||
});
|
||||
|
||||
await visit("/t/internationalization-localization/280");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user