-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: HouseAdsChooser
onChange
handling (#234)
Having an action named the same as an argument is no longer possible in a classic component. Move the logic to the parent instead. Followup to 7685ebf
- Loading branch information
1 parent
00298bf
commit 44b1714
Showing
3 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
admin/assets/javascripts/discourse/components/house-ads-list-setting.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { action } from "@ember/object"; | ||
import { mapBy } from "@ember/object/computed"; | ||
import { classNames } from "@ember-decorators/component"; | ||
import { makeArray } from "discourse-common/lib/helpers"; | ||
import HouseAdsSetting from "discourse/plugins/discourse-adplugin/discourse/components/house-ads-setting"; | ||
|
||
@classNames("house-ads-setting house-ads-list-setting") | ||
export default class HouseAdsListSetting extends HouseAdsSetting { | ||
@mapBy("allAds", "name") adNames; | ||
|
||
@action | ||
changeAdValue(value) { | ||
const settingValue = makeArray(value).join("|"); | ||
this.set("adValue", settingValue); | ||
} | ||
} |