This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed
admin/assets/javascripts/discourse/components Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1- import { action , computed } from "@ember/object" ;
1+ import { computed } from "@ember/object" ;
22import { classNames } from "@ember-decorators/component" ;
33import { makeArray } from "discourse-common/lib/helpers" ;
44import MultiSelectComponent from "select-kit/components/multi-select" ;
@@ -22,11 +22,6 @@ export default class HouseAdsChooser extends MultiSelectComponent {
2222 . filter ( Boolean ) ;
2323 }
2424
25- // TODO: kept for legacy, remove when Discourse is 2.5
26- mutateValues ( values ) {
27- this . set ( "settingValue" , values . join ( this . tokenSeparator ) ) ;
28- }
29-
3025 computeValues ( ) {
3126 return this . settingValue . split ( this . tokenSeparator ) . filter ( Boolean ) ;
3227 }
@@ -35,10 +30,4 @@ export default class HouseAdsChooser extends MultiSelectComponent {
3530 get content ( ) {
3631 return makeArray ( this . choices ) ;
3732 }
38-
39- @action
40- onChange ( value ) {
41- const settingValue = makeArray ( value ) . join ( this . tokenSeparator ) ;
42- this . onChange ?. ( settingValue ) ;
43- }
4433}
Original file line number Diff line number Diff line change 22{{ house-ads-chooser
33 settingValue =this.adValue
44 choices =this.adNames
5- onChange =( action ( mut this.adValue ))
5+ onChange =this.changeAdValue
66}}
77<div class =" setting-controls" >
88 {{ #if this.changed }}
Original file line number Diff line number Diff line change 1+ import { action } from "@ember/object" ;
12import { mapBy } from "@ember/object/computed" ;
23import { classNames } from "@ember-decorators/component" ;
4+ import { makeArray } from "discourse-common/lib/helpers" ;
35import HouseAdsSetting from "discourse/plugins/discourse-adplugin/discourse/components/house-ads-setting" ;
46
57@classNames ( "house-ads-setting house-ads-list-setting" )
68export default class HouseAdsListSetting extends HouseAdsSetting {
79 @mapBy ( "allAds" , "name" ) adNames ;
10+
11+ @action
12+ changeAdValue ( value ) {
13+ const settingValue = makeArray ( value ) . join ( "|" ) ;
14+ this . set ( "adValue" , settingValue ) ;
15+ }
816}
You can’t perform that action at this time.
0 commit comments