DEV: Various bulk-select dropdown tweaks (#26424)

* DEV: Various bulk-select dropdown tweaks

- Setting is no longer hidden
- descriptions have been moved to the modal
- Removed ... from one of the dropdown titles
This commit is contained in:
Blake Erickson 2024-03-29 12:29:24 -06:00 committed by GitHub
parent 74d55f14fe
commit ba806eec74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 14 deletions

View File

@ -262,6 +262,7 @@ export default class BulkTopicActions extends Component {
<template> <template>
<DModal <DModal
@title={{@model.title}} @title={{@model.title}}
@subtitle={{@model.description}}
@closeModal={{@closeModal}} @closeModal={{@closeModal}}
class="topic-bulk-actions-modal -large" class="topic-bulk-actions-modal -large"
> >

View File

@ -12,8 +12,6 @@
{{~#if canDoBulkActions}} {{~#if canDoBulkActions}}
{{~#if experimentalTopicBulkActionsEnabled }} {{~#if experimentalTopicBulkActionsEnabled }}
{{raw "topic-bulk-select-dropdown" bulkSelectHelper=bulkSelectHelper}} {{raw "topic-bulk-select-dropdown" bulkSelectHelper=bulkSelectHelper}}
{{! Just showing both buttons for now for development}}
<button class='btn btn-icon no-text bulk-select-actions'>{{d-icon "cog"}}&#8203;</button>
{{else}} {{else}}
<button class='btn btn-icon no-text bulk-select-actions'>{{d-icon "cog"}}&#8203;</button> <button class='btn btn-icon no-text bulk-select-actions'>{{d-icon "cog"}}&#8203;</button>
{{/if ~}} {{/if ~}}

View File

@ -49,27 +49,21 @@ export default DropdownSelectBoxComponent.extend({
id: "update-category", id: "update-category",
icon: "pencil-alt", icon: "pencil-alt",
name: i18n("topic_bulk_actions.update_category.name"), name: i18n("topic_bulk_actions.update_category.name"),
description: i18n("topic_bulk_actions.update_category.description"),
}, },
{ {
id: "update-notifications", id: "update-notifications",
icon: "d-regular", icon: "d-regular",
name: i18n("topic_bulk_actions.update_notifications.name"), name: i18n("topic_bulk_actions.update_notifications.name"),
description: i18n(
"topic_bulk_actions.update_notifications.description"
),
}, },
{ {
id: "reset-bump-dates", id: "reset-bump-dates",
icon: "anchor", icon: "anchor",
name: i18n("topic_bulk_actions.reset_bump_dates.name"), name: i18n("topic_bulk_actions.reset_bump_dates.name"),
description: i18n("topic_bulk_actions.reset_bump_dates.description"),
}, },
{ {
id: "defer", id: "defer",
icon: "circle", icon: "circle",
name: i18n("topic_bulk_actions.defer.name"), name: i18n("topic_bulk_actions.defer.name"),
description: i18n("topic_bulk_actions.defer.description"),
visible: ({ currentUser }) => currentUser.user_option.enable_defer, visible: ({ currentUser }) => currentUser.user_option.enable_defer,
}, },
{ {
@ -144,6 +138,7 @@ export default DropdownSelectBoxComponent.extend({
let allowSilent = false; let allowSilent = false;
let initialAction = null; let initialAction = null;
let initialActionLabel = null; let initialActionLabel = null;
let description = null;
if (opts.allowSilent === true) { if (opts.allowSilent === true) {
allowSilent = true; allowSilent = true;
} }
@ -156,11 +151,15 @@ export default DropdownSelectBoxComponent.extend({
} else { } else {
title = i18n(`topics.bulk.${title}`); title = i18n(`topics.bulk.${title}`);
} }
if (opts.description) {
description = opts.description;
}
this.modal.show(BulkTopicActions, { this.modal.show(BulkTopicActions, {
model: { model: {
action: actionName, action: actionName,
title, title,
description,
bulkSelectHelper: this.bulkSelectHelper, bulkSelectHelper: this.bulkSelectHelper,
refreshClosure: () => this.router.refresh(), refreshClosure: () => this.router.refresh(),
allowSilent, allowSilent,
@ -174,10 +173,16 @@ export default DropdownSelectBoxComponent.extend({
onSelect(id) { onSelect(id) {
switch (id) { switch (id) {
case "update-category": case "update-category":
this.showBulkTopicActionsModal(id, "change_category"); this.showBulkTopicActionsModal(id, "change_category", {
description: i18n(`topic_bulk_actions.update_category.description`),
});
break; break;
case "update-notifications": case "update-notifications":
this.showBulkTopicActionsModal(id, "notification_level"); this.showBulkTopicActionsModal(id, "notification_level", {
description: i18n(
`topic_bulk_actions.update_notifications.description`
),
});
break; break;
case "close-topics": case "close-topics":
this.showBulkTopicActionsModal("close", "close_topics", { this.showBulkTopicActionsModal("close", "close_topics", {
@ -206,10 +211,14 @@ export default DropdownSelectBoxComponent.extend({
this.showBulkTopicActionsModal("delete", "delete"); this.showBulkTopicActionsModal("delete", "delete");
break; break;
case "reset-bump-dates": case "reset-bump-dates":
this.showBulkTopicActionsModal(id, "reset_bump_dates"); this.showBulkTopicActionsModal(id, "reset_bump_dates", {
description: i18n(`topic_bulk_actions.reset_bump_dates.description`),
});
break; break;
case "defer": case "defer":
this.showBulkTopicActionsModal(id, "defer"); this.showBulkTopicActionsModal(id, "defer", {
description: i18n(`topic_bulk_actions.defer.description`),
});
break; break;
default: default:
if (_customOnSelection[id]) { if (_customOnSelection[id]) {

View File

@ -3037,7 +3037,7 @@ en:
name: "Defer Topics" name: "Defer Topics"
description: "Mark topics as unread" description: "Mark topics as unread"
update_notifications: update_notifications:
name: "Update Notifications" name: "Update Notifications"
description: "Change notification level to Watching, Tracking, Normal, or Muted" description: "Change notification level to Watching, Tracking, Normal, or Muted"
topic: topic:

View File

@ -2584,6 +2584,7 @@ en:
experimental_form_templates: "EXPERIMENTAL: Enable the form templates feature. <b>After enabled,</b> manage the templates at <a href='%{base_path}/admin/customize/form-templates'>Customize / Templates</a>." experimental_form_templates: "EXPERIMENTAL: Enable the form templates feature. <b>After enabled,</b> manage the templates at <a href='%{base_path}/admin/customize/form-templates'>Customize / Templates</a>."
admin_sidebar_enabled_groups: "EXPERIMENTAL: Enable sidebar navigation for the admin UI for the specified groups, which replaces the top-level admin navigation buttons." admin_sidebar_enabled_groups: "EXPERIMENTAL: Enable sidebar navigation for the admin UI for the specified groups, which replaces the top-level admin navigation buttons."
lazy_load_categories_groups: "EXPERIMENTAL: Lazy load category information only for users of these groups. This improves performance on sites with many categories." lazy_load_categories_groups: "EXPERIMENTAL: Lazy load category information only for users of these groups. This improves performance on sites with many categories."
experimental_topic_bulk_actions_enabled_groups: "EXPERIMENTAL: Enable the new bulk actions dropdown."
page_loading_indicator: "Configure the loading indicator which appears during page navigations within Discourse. 'Spinner' is a full page indicator. 'Slider' shows a narrow bar at the top of the screen." page_loading_indicator: "Configure the loading indicator which appears during page navigations within Discourse. 'Spinner' is a full page indicator. 'Slider' shows a narrow bar at the top of the screen."
show_user_menu_avatars: "Show user avatars in the user menu" show_user_menu_avatars: "Show user avatars in the user menu"

View File

@ -2362,7 +2362,6 @@ developer:
hidden: true hidden: true
experimental_topic_bulk_actions_enabled_groups: experimental_topic_bulk_actions_enabled_groups:
default: "" default: ""
hidden: true
type: group_list type: group_list
list_type: compact list_type: compact
allow_any: false allow_any: false