DEV: add btn-default classes to buttons using default styling (#31039)

All of these buttons use our default grey background styling, but aren't
carrying the `btn-default` class, which makes them easier to target in
themes. This PR adds the class.
This commit is contained in:
Kris 2025-01-28 15:40:34 -05:00 committed by GitHub
parent dcac09ed32
commit f6c5eca485
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 37 additions and 35 deletions

View File

@ -78,7 +78,7 @@ export default class AdminConfigAreasEmojisList extends Component {
<DButton <DButton
@action={{fn this.adminEmojis.destroyEmoji emoji}} @action={{fn this.adminEmojis.destroyEmoji emoji}}
@label="admin.emoji.delete" @label="admin.emoji.delete"
class="btn-small d-admin-row__controls-delete" class="btn-default btn-small d-admin-row__controls-delete"
/> />
</td> </td>
</tr> </tr>

View File

@ -147,7 +147,7 @@ export default class AdminFlagItem extends Component {
<div class="d-admin-row__controls-options"> <div class="d-admin-row__controls-options">
<DButton <DButton
class="btn-small admin-flag-item__edit" class="btn-default btn-small admin-flag-item__edit"
@action={{this.edit}} @action={{this.edit}}
@label="admin.config_areas.flags.edit" @label="admin.config_areas.flags.edit"
@disabled={{not this.canEdit}} @disabled={{not this.canEdit}}
@ -160,6 +160,7 @@ export default class AdminFlagItem extends Component {
@title={{i18n "admin.config_areas.flags.more_options.title"}} @title={{i18n "admin.config_areas.flags.more_options.title"}}
@icon="ellipsis-vertical" @icon="ellipsis-vertical"
@onRegisterApi={{this.onRegisterApi}} @onRegisterApi={{this.onRegisterApi}}
@class="btn-default"
> >
<:content> <:content>
<DropdownMenu as |dropdown|> <DropdownMenu as |dropdown|>

View File

@ -27,6 +27,7 @@ export default class AdminNotice extends Component {
<DButton <DButton
@action={{this.dismiss}} @action={{this.dismiss}}
@label="admin.dashboard.dismiss_notice" @label="admin.dashboard.dismiss_notice"
class="btn-default"
/> />
{{/if}} {{/if}}
</div> </div>

View File

@ -142,7 +142,7 @@ export default class AdminPluginsListItem extends Component {
{{#if this.showPluginSettingsButton}} {{#if this.showPluginSettingsButton}}
{{#if @plugin.useNewShowRoute}} {{#if @plugin.useNewShowRoute}}
<LinkTo <LinkTo
class="btn btn-text btn-small" class="btn btn-default btn-text btn-small"
@route="adminPlugins.show" @route="adminPlugins.show"
@model={{@plugin}} @model={{@plugin}}
@disabled={{this.disablePluginSettingsButton}} @disabled={{this.disablePluginSettingsButton}}
@ -153,7 +153,7 @@ export default class AdminPluginsListItem extends Component {
</LinkTo> </LinkTo>
{{else}} {{else}}
<LinkTo <LinkTo
class="btn btn-text btn-small" class="btn btn-default btn-text btn-small"
@route="adminSiteSettingsCategory" @route="adminSiteSettingsCategory"
@model={{@plugin.settingCategoryName}} @model={{@plugin.settingCategoryName}}
@query={{hash filter=(concat "plugin:" @plugin.name)}} @query={{hash filter=(concat "plugin:" @plugin.name)}}

View File

@ -82,7 +82,7 @@ export default class AdminUserFieldItem extends Component {
<td class="d-admin-row__controls"> <td class="d-admin-row__controls">
<div class="d-admin-row__controls-options"> <div class="d-admin-row__controls-options">
<DButton <DButton
class="btn-small admin-user_field-item__edit" class="btn-default btn-small admin-user_field-item__edit"
@action={{this.edit}} @action={{this.edit}}
@label="admin.user_fields.edit" @label="admin.user_fields.edit"
/> />

View File

@ -97,13 +97,14 @@ export default class ApiKeysList extends Component {
@action={{this.edit}} @action={{this.edit}}
@label="admin.api_keys.edit" @label="admin.api_keys.edit"
@title="admin.api.show_details" @title="admin.api.show_details"
class="btn-small" class="btn-default btn-small"
/> />
<DMenu <DMenu
@identifier="api_key-menu" @identifier="api_key-menu"
@title={{i18n "admin.config_areas.user_fields.more_options.title"}} @title={{i18n "admin.config_areas.user_fields.more_options.title"}}
@icon="ellipsis-vertical" @icon="ellipsis-vertical"
@onRegisterApi={{this.onRegisterApi}} @onRegisterApi={{this.onRegisterApi}}
@class="btn-default"
> >
<:content> <:content>
<DropdownMenu as |dropdown|> <DropdownMenu as |dropdown|>

View File

@ -33,7 +33,7 @@ export default class DashboardPeriodSelector extends Component {
@icon="gear" @icon="gear"
@action={{this.openCustomDateRangeModal}} @action={{this.openCustomDateRangeModal}}
@title="admin.dashboard.custom_date_range" @title="admin.dashboard.custom_date_range"
class="custom-date-range-button" class="btn-default custom-date-range-button"
/> />
</div> </div>
</template> </template>

View File

@ -61,7 +61,7 @@ export default class EmbeddableHost extends Component {
<td class="d-admin-row__controls"> <td class="d-admin-row__controls">
<div class="d-admin-row__controls-options"> <div class="d-admin-row__controls-options">
<DButton <DButton
class="btn-small admin-embeddable-host-item__edit" class="btn-default btn-small admin-embeddable-host-item__edit"
@route="adminEmbedding.edit" @route="adminEmbedding.edit"
@routeModels={{this.host}} @routeModels={{this.host}}
@label="admin.embedding.edit" @label="admin.embedding.edit"

View File

@ -6,7 +6,7 @@
@action={{fn this.removeValue data}} @action={{fn this.removeValue data}}
@icon="xmark" @icon="xmark"
@disabled={{not data.isEditable}} @disabled={{not data.isEditable}}
class="remove-value-btn btn-small" class="btn-default remove-value-btn btn-small"
/> />
<div <div
@ -29,12 +29,12 @@
<DButton <DButton
@action={{fn this.shift -1 index}} @action={{fn this.shift -1 index}}
@icon="arrow-up" @icon="arrow-up"
class="shift-up-value-btn btn-small" class="btn-default shift-up-value-btn btn-small"
/> />
<DButton <DButton
@action={{fn this.shift 1 index}} @action={{fn this.shift 1 index}}
@icon="arrow-down" @icon="arrow-down"
class="shift-down-value-btn btn-small" class="btn-default shift-down-value-btn btn-small"
/> />
{{/if}} {{/if}}
</li> </li>

View File

@ -161,6 +161,7 @@ export default class IpLookup extends Component {
@modalForMobile={{true}} @modalForMobile={{true}}
@onRegisterApi={{this.onRegisterApi}} @onRegisterApi={{this.onRegisterApi}}
@isLoading={{this.loading}} @isLoading={{this.loading}}
@class="btn-default"
> >
<:content> <:content>
<div class="location-box"> <div class="location-box">

View File

@ -5,7 +5,7 @@
<DButton <DButton
@action={{fn this.removeValue value}} @action={{fn this.removeValue value}}
@icon="xmark" @icon="xmark"
class="remove-value-btn btn-small" class="btn-default remove-value-btn btn-small"
/> />
<Input <Input
@value={{value.key}} @value={{value.key}}

View File

@ -5,7 +5,7 @@
<DButton <DButton
@action={{fn this.removeValue value}} @action={{fn this.removeValue value}}
@icon="xmark" @icon="xmark"
class="remove-value-btn btn-small" class="btn-default remove-value-btn btn-small"
/> />
<Input <Input
@ -19,12 +19,12 @@
<DButton <DButton
@action={{fn this.shift -1 index}} @action={{fn this.shift -1 index}}
@icon="arrow-up" @icon="arrow-up"
class="shift-up-value-btn btn-small" class="btn-default shift-up-value-btn btn-small"
/> />
<DButton <DButton
@action={{fn this.shift 1 index}} @action={{fn this.shift 1 index}}
@icon="arrow-down" @icon="arrow-down"
class="shift-down-value-btn btn-small" class="btn-default shift-down-value-btn btn-small"
/> />
{{/if}} {{/if}}
</div> </div>

View File

@ -114,7 +114,7 @@ export default class FileTypesList extends Component {
"admin.site_settings.file_types_list.add_types_title" "admin.site_settings.file_types_list.add_types_title"
types=IMAGE_TYPES_STRING types=IMAGE_TYPES_STRING
}} }}
class="btn file-types-list__button image" class="btn btn-small btn-default file-types-list__button image"
/> />
<DButton <DButton
@action={{fn this.insertDefaultTypes "video"}} @action={{fn this.insertDefaultTypes "video"}}
@ -123,7 +123,7 @@ export default class FileTypesList extends Component {
"admin.site_settings.file_types_list.add_types_title" "admin.site_settings.file_types_list.add_types_title"
types=VIDEO_TYPES_STRING types=VIDEO_TYPES_STRING
}} }}
class="btn file-types-list__button video" class="btn btn-small btn-default file-types-list__button video"
/> />
<DButton <DButton
@action={{fn this.insertDefaultTypes "audio"}} @action={{fn this.insertDefaultTypes "audio"}}
@ -132,7 +132,7 @@ export default class FileTypesList extends Component {
"admin.site_settings.file_types_list.add_types_title audio" "admin.site_settings.file_types_list.add_types_title audio"
types=AUDIO_TYPES_STRING types=AUDIO_TYPES_STRING
}} }}
class="btn file-types-list__button" class="btn btn-small btn-default file-types-list__button"
/> />
<DButton <DButton
@action={{fn this.insertDefaultTypes "document"}} @action={{fn this.insertDefaultTypes "document"}}
@ -141,7 +141,7 @@ export default class FileTypesList extends Component {
"admin.site_settings.file_types_list.add_types_title" "admin.site_settings.file_types_list.add_types_title"
types=DOCUMENT_TYPES_STRING types=DOCUMENT_TYPES_STRING
}} }}
class="btn file-types-list__button document" class="btn btn-small btn-default file-types-list__button document"
/> />
</template> </template>
} }

View File

@ -5,7 +5,7 @@
<DButton <DButton
@action={{fn this.removeValue value}} @action={{fn this.removeValue value}}
@icon="xmark" @icon="xmark"
class="remove-value-btn btn-small" class="btn-default remove-value-btn btn-small"
/> />
<Input <Input
@ -19,12 +19,12 @@
<DButton <DButton
@action={{fn this.shift -1 index}} @action={{fn this.shift -1 index}}
@icon="arrow-up" @icon="arrow-up"
class="shift-up-value-btn btn-small" class="btn-default shift-up-value-btn btn-small"
/> />
<DButton <DButton
@action={{fn this.shift 1 index}} @action={{fn this.shift 1 index}}
@icon="arrow-down" @icon="arrow-down"
class="shift-down-value-btn btn-small" class="btn-default shift-down-value-btn btn-small"
/> />
{{/if}} {{/if}}
</div> </div>

View File

@ -55,7 +55,7 @@ export default class WebhookItem extends Component {
@action={{this.edit}} @action={{this.edit}}
@label="admin.web_hooks.edit" @label="admin.web_hooks.edit"
@title="admin.web_hooks.edit" @title="admin.web_hooks.edit"
class="btn-small" class="btn-default btn-small"
/> />
<DMenu <DMenu
@identifier="webhook-menu" @identifier="webhook-menu"

View File

@ -65,7 +65,7 @@
@identifier="backup-item-menu" @identifier="backup-item-menu"
@title={{i18n "more_options"}} @title={{i18n "more_options"}}
@icon="ellipsis-vertical" @icon="ellipsis-vertical"
class="btn-small" class="btn-default btn-small"
> >
<:content> <:content>
<DropdownMenu as |dropdown|> <DropdownMenu as |dropdown|>

View File

@ -67,7 +67,7 @@
<td class="d-admin-row__controls"> <td class="d-admin-row__controls">
<div class="d-admin-row__controls-options"> <div class="d-admin-row__controls-options">
<DButton <DButton
class="btn-small admin-permalink-item__edit" class="btn-default btn-small admin-permalink-item__edit"
@route="adminPermalinks.edit" @route="adminPermalinks.edit"
@routeModels={{pl}} @routeModels={{pl}}
@label="admin.config_areas.permalinks.edit" @label="admin.config_areas.permalinks.edit"

View File

@ -20,7 +20,7 @@
@label="admin.watched_words.test.button_label" @label="admin.watched_words.test.button_label"
@icon="far-eye" @icon="far-eye"
@action={{this.test}} @action={{this.test}}
class="watched-word-test" class="btn-default watched-word-test"
/> />
<DButton <DButton

View File

@ -108,7 +108,7 @@ export default class BadgeCard extends Component {
<DButton <DButton
@icon="star" @icon="star"
@action={{@onFavoriteClick}} @action={{@onFavoriteClick}}
class="favorite-btn" class="btn-default favorite-btn"
/> />
{{else}} {{else}}
<DButton <DButton
@ -120,7 +120,7 @@ export default class BadgeCard extends Component {
"badges.favorite_max_reached" "badges.favorite_max_reached"
}} }}
@disabled={{not @canFavoriteMoreBadges}} @disabled={{not @canFavoriteMoreBadges}}
class="favorite-btn" class="btn-default favorite-btn"
/> />
{{/if}} {{/if}}
{{/if}} {{/if}}

View File

@ -79,7 +79,7 @@
@label="category.required_tag_group.add" @label="category.required_tag_group.add"
@action={{this.addRequiredTagGroup}} @action={{this.addRequiredTagGroup}}
@icon="plus" @icon="plus"
class="add-required-tag-group" class="btn-default add-required-tag-group"
/> />
</section> </section>
</section> </section>

View File

@ -149,7 +149,7 @@ export default class UsernamePreference extends Component {
@action={{this.toggleEditing}} @action={{this.toggleEditing}}
@icon="pencil" @icon="pencil"
@title="user.username.edit" @title="user.username.edit"
class="btn-small username-preference__edit-username" class="btn-default btn-small username-preference__edit-username"
/> />
{{/if}} {{/if}}
</div> </div>

View File

@ -34,7 +34,7 @@
@action={{this.manage2FA}} @action={{this.manage2FA}}
@icon="lock" @icon="lock"
@label="user.second_factor.enable" @label="user.second_factor.enable"
class="btn-second-factor" class="btn-default btn-second-factor"
/> />
</div> </div>
</div> </div>

View File

@ -165,8 +165,5 @@
.file-types-list__button { .file-types-list__button {
margin-top: 0.5em; margin-top: 0.5em;
margin-bottom: 0.2em; margin-bottom: 0.2em;
background: var(--primary-medium);
color: var(--secondary);
font-size: var(--font-down-2);
} }
} }

View File

@ -90,7 +90,7 @@ export default class AdminChatIncomingWebhooksList extends Component {
<LinkTo <LinkTo
@route="adminPlugins.show.discourse-chat-incoming-webhooks.edit" @route="adminPlugins.show.discourse-chat-incoming-webhooks.edit"
@model={{webhook.id}} @model={{webhook.id}}
class="btn btn-small admin-chat-incoming-webhooks-edit" class="btn btn-default btn-small admin-chat-incoming-webhooks-edit"
>{{i18n "chat.incoming_webhooks.edit"}}</LinkTo> >{{i18n "chat.incoming_webhooks.edit"}}</LinkTo>
<DButton <DButton

View File

@ -117,6 +117,7 @@ export default class BrowseChannels extends Component {
<DButton <DButton
@action={{this.showChatNewMessageModal}} @action={{this.showChatNewMessageModal}}
@label="chat.empty_state.direct_message_cta" @label="chat.empty_state.direct_message_cta"
class="btn-default"
/> />
</div> </div>
</list.EmptyState> </list.EmptyState>