Appearance
Search Bulk Actions Component
File Information
- Path:
components/dam/SearchBulkActions.vue - Purpose: Bulk action toolbar for performing operations on multiple selected search results
Overview
The SearchBulkActions component provides a toolbar with bulk operation buttons that appear when items are selected in search results. It supports bulk operations like download, share, add to collage, tag management, custom field updates, move, and delete. All operations are permission-based.
Key Features
Bulk Operations
- Bulk download
- Bulk share
- Add to collage
- Tag management
- Custom field updates
- Move to folder
- Delete
Permission-Based Actions
- Actions filtered by user permissions
- Share/download (if
canShareDownload) - Tag management (if
canAddTags) - Custom fields (if
canAddCustomFields) - Move content (if
canMoveContent) - Delete (if
canDeleteContent) - Create collages (if
canCreateCollages)
Selection Management
- Selection count display
- Select all functionality
- Clear selection
- Selection state management
Progress Indicators
- Loading states for operations
- Progress feedback
- Operation status
Props
javascript
{
selectedItemsCount: {
type: Number,
default: 0,
description: 'Number of selected items'
},
selectedItems: {
type: Array,
default: () => [],
description: 'Array of selected item objects'
},
canShareDownload: {
type: Boolean,
default: false,
description: 'Permission to share/download'
},
canAddTags: {
type: Boolean,
default: false,
description: 'Permission to add tags'
},
canAddCustomFields: {
type: Boolean,
default: false,
description: 'Permission to add custom fields'
},
canMoveContent: {
type: Boolean,
default: false,
description: 'Permission to move content'
},
canDeleteContent: {
type: Boolean,
default: false,
description: 'Permission to delete content'
},
canCreateCollages: {
type: Boolean,
default: false,
description: 'Permission to create collages'
}
}Events
javascript
{
'select-all': () => {}, // Select all items
'clear-selection': () => {}, // Clear selection
'bulk-download': (items) => {}, // Bulk download
'bulk-share': (items) => {}, // Bulk share
'bulk-add-to-collage': (items) => {}, // Add to collage
'bulk-tag': (items) => {}, // Bulk tag management
'bulk-custom-field': (items) => {}, // Bulk custom field update
'bulk-move': (items) => {}, // Bulk move
'bulk-delete': (items) => {} // Bulk delete
}Data Properties
javascript
{
downloadSlctd: boolean, // Download in progress
shareSlctd: boolean, // Share in progress
tagSlctd: boolean, // Tag operation in progress
moveSlctd: boolean, // Move operation in progress
deleteSlctd: boolean // Delete operation in progress
}Methods
handleSelectAllClick()
Handles select all click:
- Toggles selection of all items
- Emits
select-allevent - Updates selection state
handleShareClick()
Handles bulk share:
- Opens share dialog
- Passes selected items
- Emits
bulk-shareevent - Shows loading state
downloadFile()
Handles bulk download:
- Initiates download for selected items
- Shows progress indicator
- Handles download completion
- Emits
bulk-downloadevent
handleAddToCollageClick()
Handles add to collage:
- Opens collage selection dialog
- Adds selected items to collage
- Emits
bulk-add-to-collageevent - Shows success message
handleTaggingButtonClick()
Handles bulk tag management:
- Opens tag dialog
- Applies tags to selected items
- Emits
bulk-tagevent - Updates tag state
handleCustomFieldClick()
Handles bulk custom field update:
- Opens custom field dialog
- Updates custom fields for selected items
- Emits
bulk-custom-fieldevent
handleMoveClick()
Handles bulk move:
- Opens folder selection dialog
- Moves selected items to folder
- Emits
bulk-moveevent - Shows loading state
handleDeleteClick()
Handles bulk delete:
- Shows confirmation dialog
- Deletes selected items
- Emits
bulk-deleteevent - Shows loading state
Bulk Operation Flow
Selection
- User selects multiple items
- Selection count displayed
- Bulk actions toolbar appears
Operation Selection
- User clicks bulk action button
- Permission checked
- Operation dialog opens
Operation Execution
- Operation performed on all selected items
- Progress tracked
- Success/error handling
Completion
- Selection cleared
- Results refreshed
- Success message shown
API Endpoints
POST /dam/assets/bulk-download- Bulk download- Request Body:json
{ "asset_ids": [1, 2, 3] } - Response: Download URL or file stream
- Request Body:
POST /dam/assets/bulk-share- Bulk share- Request Body:json
{ "asset_ids": [1, 2, 3], "share_options": {} }
- Request Body:
POST /dam/assets/bulk-tags- Bulk tag assignment- Request Body:json
{ "asset_ids": [1, 2, 3], "tag_ids": [1, 2] }
- Request Body:
POST /dam/assets/bulk-move- Bulk move- Request Body:json
{ "asset_ids": [1, 2, 3], "folder_id": 123 }
- Request Body:
DELETE /dam/assets/bulk-delete- Bulk delete- Request Body:json
{ "asset_ids": [1, 2, 3] }
- Request Body:
Usage Examples
Basic Usage
vue
<template>
<SearchBulkActions
:selected-items-count="selectedCount"
:selected-items="selectedItems"
:can-share-download="canShareDownload"
:can-add-tags="canAddTags"
@bulk-download="handleBulkDownload"
@bulk-share="handleBulkShare"
/>
</template>
<script>
export default {
data() {
return {
selectedCount: 0,
selectedItems: [],
canShareDownload: true,
canAddTags: true
}
},
methods: {
handleBulkDownload(items) {
// Handle bulk download
this.downloadAssets(items)
},
handleBulkShare(items) {
// Handle bulk share
this.openShareDialog(items)
}
}
}
</script>Styling
- Uses custom CSS classes:
grid-list-view- Main containertotalSelected- Selection count chiph-bg-purple-light- Action button stylingpointer- Clickable elements- Responsive design for mobile/tablet/desktop
Integration Points
- Search Page: Main search interface
- Share Dialogs: Share operation dialogs
- Tag Dialogs: Tag management dialogs
- Folder Dialogs: Move operation dialogs
- Permission System: Access control
Notes for Development
- Component only shows when items are selected
- All actions are permission-gated
- Progress indicators show operation status
- Bulk operations handle errors gracefully
- Selection state persists during operations
- Operations can be cancelled if needed
Related Documentation
- Search Page - Search results page
- Search Tabs Component - Tab navigation
- Share Asset Dialog - Share functionality
- Tag Management Feature - Tag system