diff --git a/assets/javascripts/discourse/initializers/extend-for-solved-button.js b/assets/javascripts/discourse/initializers/extend-for-solved-button.js index 1637d34..e0173fa 100644 --- a/assets/javascripts/discourse/initializers/extend-for-solved-button.js +++ b/assets/javascripts/discourse/initializers/extend-for-solved-button.js @@ -9,6 +9,7 @@ import { ajax } from "discourse/lib/ajax"; import PostCooked from "discourse/widgets/post-cooked"; import { formatUsername } from "discourse/lib/utilities"; import { iconHTML, iconNode } from "discourse-common/lib/icon-library"; +import { computed } from "@ember/object"; function clearAccepted(topic) { const posts = topic.get("postStream.posts"); @@ -216,7 +217,7 @@ export default { initialize() { Topic.reopen({ // keeping this here cause there is complex localization - acceptedAnswerHtml: Ember.computed("accepted_answer", "id", function () { + acceptedAnswerHtml: computed("accepted_answer", "id", function () { const username = this.get("accepted_answer.username"); const postNumber = this.get("accepted_answer.post_number"); @@ -236,7 +237,7 @@ export default { }); TopicStatus.reopen({ - statuses: Ember.computed(function () { + statuses: computed(function () { const results = this._super(...arguments); if (this.topic.has_accepted_answer) { diff --git a/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js b/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js index 0d3ec04..9e23fe5 100644 --- a/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js +++ b/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js @@ -1,4 +1,5 @@ import Category from "discourse/models/category"; +import { computed } from "@ember/object"; export default { name: "extend-category-for-solved", @@ -7,11 +8,11 @@ export default { initialize() { Category.reopen({ - enable_accepted_answers: Ember.computed( + enable_accepted_answers: computed( "custom_fields.enable_accepted_answers", { get(fieldName) { - return Ember.get(this.custom_fields, fieldName) === "true"; + return this.get(this.custom_fields, fieldName) === "true"; }, } ), diff --git a/package.json b/package.json index 9e28b7c..836adf0 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "author": "Discourse", "license": "MIT", "devDependencies": { - "eslint-config-discourse": "^1.1.8" + "eslint-config-discourse": "^2.0.0" } } diff --git a/test/javascripts/acceptance/discourse-solved-test.js b/test/javascripts/acceptance/discourse-solved-test.js index 1fb3cde..7c121f1 100644 --- a/test/javascripts/acceptance/discourse-solved-test.js +++ b/test/javascripts/acceptance/discourse-solved-test.js @@ -1,7 +1,7 @@ import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers"; import { fixturesByUrl } from "discourse/tests/helpers/create-pretender"; import { test } from "qunit"; -import { click, visit } from "@ember/test-helpers"; +import { click, fillIn, visit } from "@ember/test-helpers"; acceptance("Discourse Solved Plugin", function (needs) { needs.user(); diff --git a/yarn.lock b/yarn.lock index d2d380b..3020ede 100644 --- a/yarn.lock +++ b/yarn.lock @@ -498,10 +498,10 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-config-discourse@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.8.tgz#c297831876811ea08203aa348d1ba2a963b2ae78" - integrity sha512-ZSQfhliiO5Cfa7WcKoMkN4wW/1rBJpecpMJpfjiFsElfgPj4EV4Pzksi5CvFnRbJDoZh6DYYrQfO+tW062VOUA== +eslint-config-discourse@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-2.0.0.tgz#811ab2cf4e32c1f0d41bd57d9736d578fe80b741" + integrity sha512-enjsLU++iibJXM64YM6Y/yUM5580wKtkti9fQdrJDFkfLJnvv8/f2j7QmNbX//MoqWfIQfY2RkHH6VTfRUg4Mw== dependencies: babel-eslint "^10.1.0" ember-template-lint "^2.11.0"