From 77d4b3304e3329f768be4e0e866b919b9d4ff1e4 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 28 Aug 2024 14:32:56 +0100 Subject: [PATCH] DEV: Convert core components to native class syntax (batch 5) (#28597) Changes made using the ember-native-class-codemod, plus some manual tweaks --- .../app/components/featured-topic.js | 15 ++- .../app/components/flag-action-type.hbs | 4 +- .../app/components/flag-action-type.js | 36 +++--- .../app/components/flag-selection.js | 10 +- .../discourse/app/components/flat-button.js | 22 ++-- .../app/components/footer-message.js | 7 +- .../app/components/future-date-input.js | 45 +++---- .../discourse/app/components/global-notice.js | 16 +-- .../discourse/app/components/google-search.js | 14 +-- .../app/components/group-card-contents.js | 88 +++++++------- .../app/components/group-flair-inputs.js | 34 +++--- .../components/group-imap-email-settings.js | 26 ++-- .../components/group-manage-email-settings.js | 34 +++--- .../components/group-manage-logs-filter.js | 12 +- .../app/components/group-manage-logs-row.js | 13 +- .../components/group-manage-save-button.js | 26 ++-- .../discourse/app/components/group-member.js | 10 +- .../app/components/group-membership-button.js | 115 +++++++++--------- .../app/components/group-navigation.js | 7 +- .../discourse/app/components/group-post.js | 35 +++--- .../app/components/group-selector.js | 16 ++- .../groups-form-interaction-fields.js | 111 ++++++++--------- .../groups-form-membership-fields.js | 83 ++++++------- .../components/groups-form-profile-fields.js | 29 ++--- 24 files changed, 404 insertions(+), 404 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/featured-topic.js b/app/assets/javascripts/discourse/app/components/featured-topic.js index ea3edbc6e9d..0d9b695c0f9 100644 --- a/app/assets/javascripts/discourse/app/components/featured-topic.js +++ b/app/assets/javascripts/discourse/app/components/featured-topic.js @@ -1,10 +1,13 @@ import Component from "@ember/component"; +import { + attributeBindings, + classNameBindings, +} from "@ember-decorators/component"; import $ from "jquery"; -export default Component.extend({ - classNameBindings: [":featured-topic"], - attributeBindings: ["topic.id:data-topic-id"], - +@classNameBindings(":featured-topic") +@attributeBindings("topic.id:data-topic-id") +export default class FeaturedTopic extends Component { click(e) { if (e.target.closest(".last-posted-at")) { this.appEvents.trigger("topic-entrance:show", { @@ -13,5 +16,5 @@ export default Component.extend({ }); return false; } - }, -}); + } +} diff --git a/app/assets/javascripts/discourse/app/components/flag-action-type.hbs b/app/assets/javascripts/discourse/app/components/flag-action-type.hbs index 96a8b5c6b7e..c7452421f68 100644 --- a/app/assets/javascripts/discourse/app/components/flag-action-type.hbs +++ b/app/assets/javascripts/discourse/app/components/flag-action-type.hbs @@ -5,7 +5,7 @@