+10
-1
@@ -666,6 +666,14 @@ class StepForgeApp {
|
||||
this.renderBulkBar();
|
||||
}
|
||||
|
||||
async bulkRestoreTrash() {
|
||||
const names = [...this.state.selectedTrash];
|
||||
if (!names.length) return;
|
||||
await Promise.all(names.map((name) => api.library.trashRestore({ name })));
|
||||
this.state.selectedTrash = new Set();
|
||||
await this.refreshLibrary();
|
||||
}
|
||||
|
||||
async bulkPurgeTrash() {
|
||||
const names = [...this.state.selectedTrash];
|
||||
if (!names.length) return;
|
||||
@@ -685,12 +693,13 @@ class StepForgeApp {
|
||||
const allSelected = this.state.trash.length > 0 && n === this.state.trash.length;
|
||||
this.domBulkBar.append(
|
||||
el('div.bulk-bar', {},
|
||||
el('span', {}, n ? `${n} selected` : 'Select items to delete forever'),
|
||||
el('span', {}, n ? `${n} selected` : 'Select items to act on them'),
|
||||
el('span.spacer', {}),
|
||||
el('button', {
|
||||
type: 'button',
|
||||
onClick: () => (allSelected ? this.clearTrashSelection() : this.selectAllTrash()),
|
||||
}, allSelected ? 'Clear selection' : 'Select all'),
|
||||
el('button', { type: 'button', disabled: !n, onClick: () => this.bulkRestoreTrash() }, 'Restore'),
|
||||
el('button.danger', { type: 'button', disabled: !n, onClick: () => this.bulkPurgeTrash() }, 'Delete forever'),
|
||||
),
|
||||
);
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ Initial release.
|
||||
- Editor step list: a "Select" toggle enables multi-select (checkboxes)
|
||||
with a "Select all" / "Delete" bar for removing several steps at once.
|
||||
- The library's "Select" toggle and bulk action bar now also work in the
|
||||
Trash, with a "Delete forever" action that permanently removes the
|
||||
selected items.
|
||||
Trash, with "Restore" and "Delete forever" actions for the selected
|
||||
items.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user