+10
-1
@@ -666,6 +666,14 @@ class StepForgeApp {
|
|||||||
this.renderBulkBar();
|
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() {
|
async bulkPurgeTrash() {
|
||||||
const names = [...this.state.selectedTrash];
|
const names = [...this.state.selectedTrash];
|
||||||
if (!names.length) return;
|
if (!names.length) return;
|
||||||
@@ -685,12 +693,13 @@ class StepForgeApp {
|
|||||||
const allSelected = this.state.trash.length > 0 && n === this.state.trash.length;
|
const allSelected = this.state.trash.length > 0 && n === this.state.trash.length;
|
||||||
this.domBulkBar.append(
|
this.domBulkBar.append(
|
||||||
el('div.bulk-bar', {},
|
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('span.spacer', {}),
|
||||||
el('button', {
|
el('button', {
|
||||||
type: 'button',
|
type: 'button',
|
||||||
onClick: () => (allSelected ? this.clearTrashSelection() : this.selectAllTrash()),
|
onClick: () => (allSelected ? this.clearTrashSelection() : this.selectAllTrash()),
|
||||||
}, allSelected ? 'Clear selection' : 'Select all'),
|
}, 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'),
|
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)
|
- Editor step list: a "Select" toggle enables multi-select (checkboxes)
|
||||||
with a "Select all" / "Delete" bar for removing several steps at once.
|
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
|
- The library's "Select" toggle and bulk action bar now also work in the
|
||||||
Trash, with a "Delete forever" action that permanently removes the
|
Trash, with "Restore" and "Delete forever" actions for the selected
|
||||||
selected items.
|
items.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user