Skip to content

Commit ae155e3

Browse files
authored
List Bulk Edit - Share And Follow Functionality (#2872)
* Enhance bulk edit functionality: Add synthetic 'Share' and 'Follow' fields with typeahead support for user selection. Implement special handling for these fields in the bulk edit process, including payload adjustments for sharing actions. Ensure backward compatibility with legacy share input handling. * consistency with comment. * Enhance bulk edit functionality in modular-list-bulk.js - Introduced support for a new share payload format, allowing for user-specific sharing actions. - Added backward compatibility for legacy share formats to ensure seamless user experience. - Implemented dynamic handling of share and follow fields, improving the bulk edit process. - Refactored share input handling to accommodate both new and legacy formats, enhancing maintainability. - Removed outdated bulk edit field selection logic from modular-list.js, centralizing functionality in modular-list-bulk.js. * Enhance share field handling in modular-list-bulk.js - Updated share field logic to support multiple user selections, improving user experience. - Refactored user ID collection to accommodate both new and legacy formats, ensuring backward compatibility. - Enhanced initial value setup for share fields to handle arrays of user IDs, streamlining the bulk edit process. - Improved error handling for parsing user data from the share component, ensuring robustness in data retrieval. * Enhance bulk edit functionality in modular-list-bulk.js - Introduced a new utility function, normalizeShareComponentItems, to standardize the handling of share component values, improving robustness against various input types. - Refactored existing logic to utilize the new utility function, streamlining the process of extracting user IDs from share components. - Updated documentation to clarify the purpose of the module and the organization of bulk-related features. * Remove bulk delete functionality from modular-list.js and update related comments. The bulk delete logic has been relocated to modular-list-bulk.js to streamline the codebase and improve maintainability. * Refactor share component handling in modular-list-bulk.js - Simplified the logic for checking and processing share field data, improving readability and maintainability. - Updated the processShareComponentValue function to handle errors more gracefully and ensure compatibility with existing data structures. - Enhanced event listener for share component changes to better manage asynchronous updates and error logging. * Update comments and refactor toggle handling in modular-list-bulk.js - Clarified comments regarding share payload formats and the use of legacy formats for multiple users. - Updated the toggle handling for clearable fields to use a more descriptive class name. - Enhanced the follow HTML generation to escape label and help text, improving security against HTML injection. - Delegated the 'Remove Values' mode toggle to ensure proper handling of clearable fields. * Enhance share functionality in modular-list-bulk.js and enqueue-scripts.php - Added new translation strings for 'Share', 'Follow', and 'Follow Help' in enqueue-scripts.php to improve user interface clarity. - Refactored the processShareComponentValue function in modular-list-bulk.js to streamline the handling of share component values, ensuring compatibility with various input formats. - Improved error handling and logging for component initialization and value processing, enhancing robustness and maintainability. * remove artifact comments
1 parent f9faf3d commit ae155e3

2 files changed

Lines changed: 467 additions & 24 deletions

File tree

dt-assets/functions/enqueue-scripts.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ function dt_site_scripts() {
136136
'edit' => __( 'Edit', 'disciple_tools' ),
137137
'copy' => __( 'Copy', 'disciple_tools' ),
138138
'copied_text' => __( 'Copied: %s', 'disciple_tools' ),
139+
'share' => __( 'Share', 'disciple_tools' ),
140+
'follow' => __( 'Follow', 'disciple_tools' ),
141+
'follow_help' => __( 'Toggle to follow or unfollow records', 'disciple_tools' ),
139142
],
140143
'post_type' => $post_type,
141144
'url_path' => $url_path,

0 commit comments

Comments
 (0)