A platform for community discussion. Free, open, simple.
DEV: Various bulk-select dropdown tweaks (#26424)
Blake Ericksonba806eec745c
diff --git a/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs b/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjsindex 5ee59bf64e0..b5894646fe5 100644--- a/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs@@ -262,6 +262,7 @@ export default class BulkTopicActions extends Component {<template><DModal@title={{@model.title}}+ @subtitle={{@model.description}}@closeModal={{@closeModal}}class="topic-bulk-actions-modal -large">diff --git a/app/assets/javascripts/discourse/app/raw-templates/topic-list-header-column.hbr b/app/assets/javascripts/discourse/app/raw-templates/topic-list-header-column.hbrindex 475c8d1b90c..729a9f0c4b1 100644--- a/app/assets/javascripts/discourse/app/raw-templates/topic-list-header-column.hbr+++ b/app/assets/javascripts/discourse/app/raw-templates/topic-list-header-column.hbr@@ -12,8 +12,6 @@{{~#if canDoBulkActions}}{{~#if experimentalTopicBulkActionsEnabled }}{{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"}}​</button>{{else}}<button class='btn btn-icon no-text bulk-select-actions'>{{d-icon "cog"}}​</button>{{/if ~}}diff --git a/app/assets/javascripts/select-kit/addon/components/bulk-select-topics-dropdown.js b/app/assets/javascripts/select-kit/addon/components/bulk-select-topics-dropdown.jsindex c75786024d3..75b224546a4 100644--- a/app/assets/javascripts/select-kit/addon/components/bulk-select-topics-dropdown.js+++ b/app/assets/javascripts/select-kit/addon/components/bulk-select-topics-dropdown.js@@ -49,27 +49,21 @@ export default DropdownSelectBoxComponent.extend({id: "update-category",icon: "pencil-alt",name: i18n("topic_bulk_actions.update_category.name"),- description: i18n("topic_bulk_actions.update_category.description"),},{id: "update-notifications",icon: "d-regular",name: i18n("topic_bulk_actions.update_notifications.name"),- description: i18n(- "topic_bulk_actions.update_notifications.description"- ),},{id: "reset-bump-dates",icon: "anchor",name: i18n("topic_bulk_actions.reset_bump_dates.name"),- description: i18n("topic_bulk_actions.reset_bump_dates.description"),},{id: "defer",icon: "circle",name: i18n("topic_bulk_actions.defer.name"),- description: i18n("topic_bulk_actions.defer.description"),visible: ({ currentUser }) => currentUser.user_option.enable_defer,},{@@ -144,6 +138,7 @@ export default DropdownSelectBoxComponent.extend({let allowSilent = false;let initialAction = null;let initialActionLabel = null;+ let description = null;if (opts.allowSilent === true) {allowSilent = true;}@@ -156,11 +151,15 @@ export default DropdownSelectBoxComponent.extend({} else {title = i18n(`topics.bulk.${title}`);}+ if (opts.description) {+ description = opts.description;+ }this.modal.show(BulkTopicActions, {model: {action: actionName,title,+ description,bulkSelectHelper: this.bulkSelectHelper,refreshClosure: () => this.router.refresh(),allowSilent,@@ -174,10 +173,16 @@ export default DropdownSelectBoxComponent.extend({onSelect(id) {switch (id) {case "update-category":- this.showBulkTopicActionsModal(id, "change_category");+ this.showBulkTopicActionsModal(id, "change_category", {+ description: i18n(`topic_bulk_actions.update_category.description`),+ });break;case "update-notifications":- this.showBulkTopicActionsModal(id, "notification_level");+ this.showBulkTopicActionsModal(id, "notification_level", {+ description: i18n(+ `topic_bulk_actions.update_notifications.description`+ ),+ });break;case "close-topics":this.showBulkTopicActionsModal("close", "close_topics", {@@ -206,10 +211,14 @@ export default DropdownSelectBoxComponent.extend({this.showBulkTopicActionsModal("delete", "delete");break;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;case "defer":- this.showBulkTopicActionsModal(id, "defer");+ this.showBulkTopicActionsModal(id, "defer", {+ description: i18n(`topic_bulk_actions.defer.description`),+ });break;default:if (_customOnSelection[id]) {diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 3d89ad2c968..45c5702e435 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -3037,7 +3037,7 @@ en:name: "Defer Topics"description: "Mark topics as unread"update_notifications:- name: "Update Notifications…"+ name: "Update Notifications"description: "Change notification level to Watching, Tracking, Normal, or Muted"topic:diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex f4e9c8146c3..f8e7b733b2c 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -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>."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."+ 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."show_user_menu_avatars: "Show user avatars in the user menu"diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 0d6732e2e96..c02c3fe7a6f 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -2362,7 +2362,6 @@ developer:hidden: trueexperimental_topic_bulk_actions_enabled_groups:default: ""- hidden: truetype: group_listlist_type: compactallow_any: false