DEV: Fix select-kit deprecations (#15080)

This commit is contained in:
Jarek Radosz 2022-04-05 19:01:09 +02:00 committed by GitHub
parent ddafa42b7e
commit 14778ba52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 129 additions and 59 deletions

View File

@ -68,7 +68,9 @@
value=buffered.badge_type_id
content=badgeTypes
onChange=(action (mut buffered.badge_type_id))
isDisabled=readOnly
options=(hash
disabled=readOnly
)
}}
</div>
@ -155,7 +157,9 @@
value=buffered.trigger
content=badgeTriggers
onChange=(action (mut buffered.trigger))
disabled=readOnly
options=(hash
disabled=readOnly
)
}}
</div>
{{/if}}

View File

@ -1,11 +1,11 @@
{{combo-box
filterable=true
valueProperty="value"
content=groupOptions
value=groupId
none="admin.dashboard.reports.groups"
onChange=(action "onChange")
options=(hash
allowAny=filter.allow_any
filterable=true
none="admin.dashboard.reports.groups"
)
}}

View File

@ -1,8 +1,10 @@
{{combo-box
content=filter.choices
filterable=true
allowAny=filter.allow_any
value=filter.default
none="admin.dashboard.report_filter_any"
onChange=(action "onChange")
options=(hash
allowAny=filter.allow_any
filterable=true
none="admin.dashboard.report_filter_any"
)
}}

View File

@ -1,8 +1,8 @@
{{category-chooser
value=value
allowUncategorized=true
onChange=(action (mut value))
options=(hash
allowUncategorized=true
none=(eq setting.default "")
)
}}

View File

@ -34,13 +34,13 @@
{{/if}}
{{combo-box
options=(hash
allowAny=true
)
none=noneKey
valueProperty=null
nameProperty=null
value=newValue
content=filteredChoices
onChange=(action "selectChoice")
options=(hash
allowAny=true
none=noneKey
)
}}

View File

@ -159,10 +159,12 @@
<div class="setting-value">
{{color-palettes
content=colorSchemes
filterable=true
forceEscape=true
value=colorSchemeId
icon="paint-brush"}}
icon="paint-brush"
options=(hash
filterable=true
)
}}
<div class="desc">{{i18n "admin.customize.theme.color_scheme_select"}}</div>
</div>

View File

@ -34,8 +34,10 @@
{{combo-box
content=userHistoryActions
value=filterActionId
none="admin.logs.staff_actions.all"
onChange=(action "filterActionIdChanged")
options=(hash
none="admin.logs.staff_actions.all"
)
}}
{{/if}}

View File

@ -17,10 +17,12 @@
<div class="control-group">
<label>{{i18n "admin.badges.badge"}}</label>
{{combo-box
filterable=true
value=selectedBadgeId
content=grantableBadges
onChange=(action (mut selectedBadgeId))
options=(hash
filterable=true
)
}}
</div>
<div class="control-group">

View File

@ -551,8 +551,10 @@
{{combo-box
content=model.customGroups
value=model.primary_group_id
none="admin.groups.no_primary"
onChange=(action (mut model.primary_group_id))
options=(hash
none="admin.groups.no_primary"
)
}}
</div>
{{#if primaryGroupDirty}}

View File

@ -15,10 +15,10 @@
value=category.parent_category_id
categories=parentCategories
allowSubCategories=true
allowUncategorized=false
allowRestrictedCategories=true
onChange=(action (mut category.parent_category_id))
options=(hash
allowUncategorized=false
excludeCategoryId=category.id
none=true
)

View File

@ -12,8 +12,10 @@
<label class="control-label">{{i18n "topic.topic_status_update.publish_to"}}</label>
{{category-chooser
value=topicTimer.category_id
excludeCategoryId=excludeCategoryId
onChange=(action (mut topicTimer.category_id))
options=(hash
excludeCategoryId=excludeCategoryId
)
}}
</div>
{{/if}}

View File

@ -28,9 +28,11 @@
value=group.imap_mailbox_name
valueProperty="value"
content=mailboxes
none="groups.manage.email.mailboxes.disabled"
tabindex="10"
onChange=(action (mut group.imap_mailbox_name))
options=(hash
none="groups.manage.email.mailboxes.disabled"
)
}}
{{/if}}
</div>

View File

@ -2,13 +2,13 @@
{{dropdown-select-box
class="reviewable-action-dropdown"
nameProperty="label"
title=bundle.label
content=bundle.actions
onChange=(action "performById")
options=(hash
icon=bundle.icon
disabled=reviewableUpdating
placement=placement
translatedNone=bundle.label
)
}}
{{else}}

View File

@ -23,11 +23,11 @@
{{tag-chooser
id="search-with-tags"
tags=searchedTerms.tags
allowCreate=false
everyTag=true
unlimitedTagCount=true
onChange=(action "onChangeSearchTermForTags")
options=(hash
allowAny=false
headerAriaLabel=(i18n "search.advanced.with_tags.aria_label")
)
}}

View File

@ -8,10 +8,10 @@
{{tag-chooser
tags=buffered.tag_names
everyTag=true
allowCreate=true
unlimitedTagCount=true
excludeSynonyms=true
options=(hash
allowAny=true
filterPlaceholder="tagging.groups.tags_placeholder"
)
}}
@ -23,11 +23,11 @@
{{tag-chooser
tags=buffered.parent_tag_name
everyTag=true
maximum=1
allowCreate=true
excludeSynonyms=true
options=(hash
allowAny=true
filterPlaceholder="tagging.groups.parent_tag_placeholder"
maximum=1
)
}}
</div>

View File

@ -12,8 +12,10 @@
valueProperty=null
nameProperty=null
value=this.value
none=this.noneLabel
onChange=(action (mut this.value))
options=(hash
none=this.noneLabel
)
}}
<div class="instructions">{{html-safe this.field.description}}</div>
</div>

View File

@ -12,8 +12,10 @@
valueProperty=null
nameProperty=null
value=this.value
none=this.noneLabel
onChange=(action (mut this.value))
options=(hash
none=this.noneLabel
)
}}
<div class="instructions">{{html-safe this.field.description}}</div>
</div>

View File

@ -118,8 +118,8 @@
{{category-chooser
value=model.categoryId
onChange=(action (mut model.categoryId))
isDisabled=disableCategoryChooser
options=(hash
disabled=disableCategoryChooser
scopedCategoryId=scopedCategoryId
prioritizedCategoryId=prioritizedCategoryId
)
@ -131,9 +131,9 @@
{{#if canEditTags}}
{{mini-tag-chooser
value=model.tags
isDisabled=disableTagsChooser
onChange=(action (mut model.tags))
options=(hash
disabled=disableTagsChooser
categoryId=model.categoryId
minimum=model.minimumRequiredTags
)

View File

@ -13,9 +13,11 @@
{{tag-chooser
tags=model.watching_tags
blacklist=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
<div class="control-instructions">
@ -29,9 +31,11 @@
{{tag-chooser
tags=model.tracking_tags
blacklist=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
<div class="control-instructions">
@ -45,9 +49,11 @@
{{tag-chooser
tags=model.watching_first_post_tags
blacklist=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
<div class="control-instructions">
@ -61,9 +67,11 @@
{{tag-chooser
tags=model.regular_tags
blacklist=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
<div class="control-instructions">
@ -77,9 +85,11 @@
{{tag-chooser
tags=model.muted_tags
blacklist=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
<div class="control-instructions">

View File

@ -5,11 +5,13 @@
{{else}}
<p>
{{combo-box
filterable=true
value=selectedBadgeId
content=grantableBadges
none="badges.none"
onChange=(action (mut selectedBadgeId))
options=(hash
filterable=true
none="badges.none"
)
}}
</p>
{{/if}}

View File

@ -24,7 +24,7 @@
{{#if canTagMessages}}
<label>{{i18n "tagging.tags"}}</label>
{{tag-chooser tags=tags filterable=true}}
{{tag-chooser tags=tags}}
{{/if}}
</form>
{{/if}}
@ -89,7 +89,7 @@
}}
{{#if canAddTags}}
<label>{{i18n "tagging.tags"}}</label>
{{tag-chooser tags=tags filterable=true categoryId=categoryId}}
{{tag-chooser tags=tags categoryId=categoryId}}
{{/if}}
</form>
{{/if}}
@ -104,7 +104,7 @@
{{#if canTagMessages}}
<label>{{i18n "tagging.tags"}}</label>
{{tag-chooser tags=tags filterable=true}}
{{tag-chooser tags=tags}}
{{/if}}
</form>
{{/if}}

View File

@ -154,8 +154,10 @@
{{combo-box
value=newTitleInput
content=model.availableTitles
none="user.title.none"
onChange=(action (mut newTitleInput))
options=(hash
none="user.title.none"
)
}}
</div>
<div class="instructions">
@ -171,8 +173,10 @@
{{flair-chooser
value=newFlairGroupId
content=model.availableFlairs
none="user.flair.none"
onChange=(action (mut newFlairGroupId))
options=(hash
none="user.flair.none"
)
}}
</div>
<div class="instructions">
@ -188,7 +192,10 @@
{{combo-box
value=newPrimaryGroupInput
content=model.filteredGroups
none="user.primary_group.none"}}
options=(hash
none="user.primary_group.none"
)
}}
</div>
</div>
{{/if}}

View File

@ -58,10 +58,12 @@
<div class="controls controls-dropdown">
{{combo-box
valueProperty="value"
filterable=true
content=digestFrequencies
value=model.user_option.digest_after_minutes
onChange=(action (mut model.user_option.digest_after_minutes))
options=(hash
filterable=true
)
}}
</div>
{{preference-checkbox labelKey="user.include_tl0_in_digests" disabled=model.user_option.mailing_list_mode checked=model.user_option.include_tl0_in_digests}}

View File

@ -7,9 +7,11 @@
{{tag-chooser
tags=model.watched_tags
blockedTags=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
</div>
@ -20,9 +22,12 @@
{{tag-chooser
tags=model.tracked_tags
blockedTags=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true}}
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
</div>
<div class="instructions">{{i18n "user.tracked_tags_instructions"}}</div>
@ -32,9 +37,12 @@
{{tag-chooser
tags=model.watching_first_post_tags
blockedTags=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true}}
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
</div>
<div class="instructions">
@ -46,9 +54,12 @@
{{tag-chooser
tags=model.muted_tags
blockedTags=selectedTags
allowCreate=false
everyTag=true
unlimitedTagCount=true}}
unlimitedTagCount=true
options=(hash
allowAny=false
)
}}
</div>
<div class="instructions">{{i18n "user.muted_tags_instructions"}}</div>
</div>

View File

@ -35,8 +35,10 @@
{{combo-box
value=filterType
content=allTypes
none="review.filters.type.all"
onChange=(action (mut filterType))
options=(hash
none="review.filters.type.all"
)
}}
</div>
@ -52,9 +54,11 @@
<div class="reviewable-filter">
<label class="filter-label">{{i18n "review.filters.category"}}</label>
{{category-chooser
none="review.filters.all_categories"
value=filterCategoryId
onChange=(action (mut filterCategoryId))
options=(hash
none="review.filters.all_categories"
)
}}
</div>

View File

@ -141,7 +141,7 @@ discourseModule(
},
});
componentTest("with allowUncategorized=null rootNone=true", {
componentTest("with allowUncategorized=null none=true", {
template: hbs`
{{category-chooser
value=value

View File

@ -1118,6 +1118,7 @@ export default Component.extend(
none: "options.none",
rootNone: "options.none",
disabled: "options.disabled",
isDisabled: "options.disabled",
rootNoneLabel: "options.none",
showFullTitle: "options.showFullTitle",
title: "options.translatedNone",

View File

@ -74,7 +74,7 @@ export default Component.extend(UtilsMixin, {
},
keyDown(event) {
if (this.selectKit.isDisabled) {
if (this.selectKit.isDisabled || this.selectKit.options.disabled) {
return;
}

View File

@ -94,7 +94,10 @@
class="recurrence-input"
value=recurring
onChange=(action (mut recurring))
none="discourse_local_dates.create.form.recurring_none"}}
options=(hash
none="discourse_local_dates.create.form.recurring_none"
)
}}
</div>
</div>
{{/unless}}
@ -134,10 +137,12 @@
valueProperty=null
nameProperty=null
class="timezones-input"
allowAny=false
maximum=5
content=allTimezones
value=timezones
options=(hash
allowAny=false
maximum=5
)
}}
</div>
</div>

View File

@ -47,7 +47,13 @@
{{/styleguide-example}}
{{#styleguide-example title="dropdown-select-box"}}
{{dropdown-select-box content=dummy.options title="Something" onChange=(action "dummy")}}
{{dropdown-select-box
content=dummy.options
onChange=(action "dummy")
options=(hash
translatedNone="Something"
)
}}
{{/styleguide-example}}
{{#styleguide-example title="future-date-input-selector"}}