Skip to content

Commit

Permalink
Uncheck "check all" after bulk delete
Browse files Browse the repository at this point in the history
Fixes #1057
  • Loading branch information
sfmskywalker committed May 28, 2021
1 parent 68e5be0 commit 88a5c61
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export class ElsaWorkflowInstanceListScreen {
}
}

updateSelectAllChecked(){
this.selectAllChecked = this.workflowInstances.items.findIndex(x => this.selectedWorkflowInstanceIds.findIndex(id => id == x.id) < 0) < 0;
}

async routeChanged(e: LocationSegments) {

if (e.pathname.toLowerCase().indexOf('workflow-instances') < 0)
Expand Down Expand Up @@ -136,7 +140,7 @@ export class ElsaWorkflowInstanceListScreen {
else
this.selectedWorkflowInstanceIds = this.selectedWorkflowInstanceIds.filter(x => x != workflowInstance.id);

this.selectAllChecked = this.workflowInstances.items.findIndex(x => this.selectedWorkflowInstanceIds.findIndex(id => id == x.id) < 0) < 0;
this.updateSelectAllChecked();
}

async onDeleteClick(e: Event, workflowInstance: WorkflowInstanceSummary) {
Expand All @@ -158,7 +162,10 @@ export class ElsaWorkflowInstanceListScreen {

const elsaClient = this.createClient();
await elsaClient.workflowInstancesApi.bulkDelete({workflowInstanceIds: this.selectedWorkflowInstanceIds});
this.selectedWorkflowInstanceIds = [];
this.updateSelectAllChecked();
await this.loadWorkflowInstances();
this.page = 0;
}

async onBulkActionSelected(e: CustomEvent<DropdownButtonItem>) {
Expand Down

0 comments on commit 88a5c61

Please sign in to comment.