diff --git a/app/assets/javascripts/admin/addon/adapters/api-key.js b/app/assets/javascripts/admin/addon/adapters/api-key.js index 860e4c50692..6e1ad0eb327 100644 --- a/app/assets/javascripts/admin/addon/adapters/api-key.js +++ b/app/assets/javascripts/admin/addon/adapters/api-key.js @@ -1,13 +1,13 @@ -import RESTAdapter from "discourse/adapters/rest"; +import RestAdapter from "discourse/adapters/rest"; -export default RESTAdapter.extend({ - jsonMode: true, +export default class ApiKey extends RestAdapter { + jsonMode = true; basePath() { return "/admin/api/"; - }, + } apiNameFor() { return "key"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/build-plugin.js b/app/assets/javascripts/admin/addon/adapters/build-plugin.js index 3a81ab4e573..98b875ba94b 100644 --- a/app/assets/javascripts/admin/addon/adapters/build-plugin.js +++ b/app/assets/javascripts/admin/addon/adapters/build-plugin.js @@ -1,11 +1,11 @@ import RestAdapter from "discourse/adapters/rest"; export default function buildPluginAdapter(pluginName) { - return RestAdapter.extend({ + return class extends RestAdapter { pathFor(store, type, findArgs) { return ( - "/admin/plugins/" + pluginName + this._super(store, type, findArgs) + "/admin/plugins/" + pluginName + super.pathFor(store, type, findArgs) ); - }, - }); + } + }; } diff --git a/app/assets/javascripts/admin/addon/adapters/customization-base.js b/app/assets/javascripts/admin/addon/adapters/customization-base.js index 272103ee8a8..d20f15d1dca 100644 --- a/app/assets/javascripts/admin/addon/adapters/customization-base.js +++ b/app/assets/javascripts/admin/addon/adapters/customization-base.js @@ -1,7 +1,7 @@ import RestAdapter from "discourse/adapters/rest"; -export default RestAdapter.extend({ +export default class CustomizationBase extends RestAdapter { basePath() { return "/admin/customize/"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/email-style.js b/app/assets/javascripts/admin/addon/adapters/email-style.js index 12919f04b0d..e4465ef56eb 100644 --- a/app/assets/javascripts/admin/addon/adapters/email-style.js +++ b/app/assets/javascripts/admin/addon/adapters/email-style.js @@ -1,7 +1,7 @@ import RestAdapter from "discourse/adapters/rest"; -export default RestAdapter.extend({ +export default class EmailStyle extends RestAdapter { pathFor() { return "/admin/customize/email_style"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/embedding.js b/app/assets/javascripts/admin/addon/adapters/embedding.js index ba3fb816b80..966098fd4d1 100644 --- a/app/assets/javascripts/admin/addon/adapters/embedding.js +++ b/app/assets/javascripts/admin/addon/adapters/embedding.js @@ -1,7 +1,7 @@ import RestAdapter from "discourse/adapters/rest"; -export default RestAdapter.extend({ +export default class Embedding extends RestAdapter { pathFor() { return "/admin/customize/embedding"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/staff-action-log.js b/app/assets/javascripts/admin/addon/adapters/staff-action-log.js index d281f9746be..9a9d1d6c0b4 100644 --- a/app/assets/javascripts/admin/addon/adapters/staff-action-log.js +++ b/app/assets/javascripts/admin/addon/adapters/staff-action-log.js @@ -1,7 +1,7 @@ import RestAdapter from "discourse/adapters/rest"; -export default RestAdapter.extend({ +export default class StaffActionLog extends RestAdapter { basePath() { return "/admin/logs/"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/tag-group.js b/app/assets/javascripts/admin/addon/adapters/tag-group.js index 4c12654d967..4caa9172b92 100644 --- a/app/assets/javascripts/admin/addon/adapters/tag-group.js +++ b/app/assets/javascripts/admin/addon/adapters/tag-group.js @@ -1,5 +1,5 @@ import RestAdapter from "discourse/adapters/rest"; -export default RestAdapter.extend({ - jsonMode: true, -}); +export default class TagGroup extends RestAdapter { + jsonMode = true; +} diff --git a/app/assets/javascripts/admin/addon/adapters/theme.js b/app/assets/javascripts/admin/addon/adapters/theme.js index cf34ab42f5f..66f901b2cdb 100644 --- a/app/assets/javascripts/admin/addon/adapters/theme.js +++ b/app/assets/javascripts/admin/addon/adapters/theme.js @@ -1,9 +1,10 @@ import RestAdapter from "discourse/adapters/rest"; -export default RestAdapter.extend({ +export default class Theme extends RestAdapter { + jsonMode = true; basePath() { return "/admin/"; - }, + } afterFindAll(results) { let map = {}; @@ -20,7 +21,5 @@ export default RestAdapter.extend({ theme.set("parentThemes", mappedParents); }); return results; - }, - - jsonMode: true, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/web-hook-event.js b/app/assets/javascripts/admin/addon/adapters/web-hook-event.js index 1acd38386ba..8a6fa2b082d 100644 --- a/app/assets/javascripts/admin/addon/adapters/web-hook-event.js +++ b/app/assets/javascripts/admin/addon/adapters/web-hook-event.js @@ -1,7 +1,7 @@ -import RESTAdapter from "discourse/adapters/rest"; +import RestAdapter from "discourse/adapters/rest"; -export default RESTAdapter.extend({ +export default class WebHookEvent extends RestAdapter { basePath() { return "/admin/api/"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/adapters/web-hook.js b/app/assets/javascripts/admin/addon/adapters/web-hook.js index 1acd38386ba..813f7dbf03b 100644 --- a/app/assets/javascripts/admin/addon/adapters/web-hook.js +++ b/app/assets/javascripts/admin/addon/adapters/web-hook.js @@ -1,7 +1,7 @@ -import RESTAdapter from "discourse/adapters/rest"; +import RestAdapter from "discourse/adapters/rest"; -export default RESTAdapter.extend({ +export default class WebHook extends RestAdapter { basePath() { return "/admin/api/"; - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/helpers/disposition-icon.js b/app/assets/javascripts/admin/addon/helpers/disposition-icon.js index f49d22e2726..80820b0bc63 100644 --- a/app/assets/javascripts/admin/addon/helpers/disposition-icon.js +++ b/app/assets/javascripts/admin/addon/helpers/disposition-icon.js @@ -2,7 +2,7 @@ import Helper from "@ember/component/helper"; import { iconHTML } from "discourse-common/lib/icon-library"; import { htmlSafe } from "@ember/template"; -export default Helper.extend({ +export default class DispositionIcon extends Helper { compute([disposition]) { if (!disposition) { return null; @@ -24,5 +24,5 @@ export default Helper.extend({ } } return htmlSafe(iconHTML(icon, { title })); - }, -}); + } +} diff --git a/app/assets/javascripts/admin/addon/services/admin-tools.js b/app/assets/javascripts/admin/addon/services/admin-tools.js index 59d3a432d14..79944fc1475 100644 --- a/app/assets/javascripts/admin/addon/services/admin-tools.js +++ b/app/assets/javascripts/admin/addon/services/admin-tools.js @@ -10,8 +10,8 @@ import { htmlSafe } from "@ember/template"; // A service that can act as a bridge between the front end Discourse application // and the admin application. Use this if you need front end code to access admin // modules. Inject it optionally, and if it exists go to town! -export default Service.extend({ - dialog: service(), +export default class AdminToolsService extends Service { + @service dialog; showActionLogs(target, filters) { const controller = getOwner(target).lookup( @@ -20,15 +20,15 @@ export default Service.extend({ target.transitionToRoute("adminLogs.staffActionLogs").then(() => { controller.changeFilters(filters); }); - }, + } checkSpammer(userId) { return AdminUser.find(userId).then((au) => this.spammerDetails(au)); - }, + } deleteUser(id, formData) { return AdminUser.find(id).then((user) => user.destroy(formData)); - }, + } spammerDetails(adminUser) { return { @@ -37,7 +37,7 @@ export default Service.extend({ adminUser.get("can_be_deleted") && adminUser.get("can_delete_all_posts"), }; - }, + } _showControlModal(type, user, opts) { opts = opts || {}; @@ -67,15 +67,15 @@ export default Service.extend({ controller.finishedSetup(); }); - }, + } showSilenceModal(user, opts) { this._showControlModal("silence", user, opts); - }, + } showSuspendModal(user, opts) { this._showControlModal("suspend", user, opts); - }, + } _deleteSpammer(adminUser) { // Try loading the email if the site supports it @@ -131,5 +131,5 @@ export default Service.extend({ }); }); }); - }, -}); + } +}