FIX: Restore `propertyEqual` following native-class conversions (#28605)

I mistakenly replaced these with `@equal`, thinking the behavior was the same. It's not. `@propertyEqual` compares two properties, while `@equal` compares a single property with a constant.
This commit is contained in:
David Taylor 2024-08-28 16:20:16 +01:00 committed by GitHub
parent 54b281c4a2
commit 2e5502c417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -1,9 +1,10 @@
import Component from "@ember/component"; import Component from "@ember/component";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { empty, equal } from "@ember/object/computed"; import { empty } from "@ember/object/computed";
import { scheduleOnce } from "@ember/runloop"; import { scheduleOnce } from "@ember/runloop";
import { underscore } from "@ember/string"; import { underscore } from "@ember/string";
import { classNameBindings, tagName } from "@ember-decorators/component"; import { classNameBindings, tagName } from "@ember-decorators/component";
import { propertyEqual } from "discourse/lib/computed";
import DiscourseURL from "discourse/lib/url"; import DiscourseURL from "discourse/lib/url";
import getURL from "discourse-common/lib/get-url"; import getURL from "discourse-common/lib/get-url";
import discourseComputed from "discourse-common/utils/decorators"; import discourseComputed from "discourse-common/utils/decorators";
@ -13,7 +14,7 @@ import I18n from "discourse-i18n";
@classNameBindings("active", "tabClassName") @classNameBindings("active", "tabClassName")
export default class EditCategoryTab extends Component { export default class EditCategoryTab extends Component {
@empty("params.slug") newCategory; @empty("params.slug") newCategory;
@equal("selectedTab", "tab") active; @propertyEqual("selectedTab", "tab") active;
@discourseComputed("tab") @discourseComputed("tab")
tabClassName(tab) { tabClassName(tab) {

View File

@ -1,6 +1,6 @@
import Component from "@ember/component"; import Component from "@ember/component";
import { equal } from "@ember/object/computed";
import { classNameBindings } from "@ember-decorators/component"; import { classNameBindings } from "@ember-decorators/component";
import { propertyEqual } from "discourse/lib/computed";
import { prioritizeNameInUx } from "discourse/lib/settings"; import { prioritizeNameInUx } from "discourse/lib/settings";
import { userPath } from "discourse/lib/url"; import { userPath } from "discourse/lib/url";
import getURL from "discourse-common/lib/get-url"; import getURL from "discourse-common/lib/get-url";
@ -14,7 +14,7 @@ import I18n from "discourse-i18n";
"primaryGroup" "primaryGroup"
) )
export default class GroupPost extends Component { export default class GroupPost extends Component {
@equal("post.post_type", "site.post_types.moderator_action") @propertyEqual("post.post_type", "site.post_types.moderator_action")
moderatorAction; moderatorAction;
@discourseComputed("post.url") @discourseComputed("post.url")