-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(editor): Fix execution list item selection #5606
Merged
cstuncsik
merged 28 commits into
master
from
pay-101-unselect-a-single-execution-in-execution
Mar 17, 2023
Merged
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c0c36b6
fix(editor): Fix execution list item selection
cstuncsik 811dd6a
fix(editor): Delete only selected executions
cstuncsik 6db282c
fix(editor): Fix clear selection
cstuncsik c74e16c
fix(editor): Fix clear selection
cstuncsik b092793
fix(editor): Fix clear selection
cstuncsik 5d7a652
Merge remote-tracking branch 'origin/master' into pay-101-unselect-a-…
cstuncsik f710769
Merge remote-tracking branch 'origin/master' into pay-101-unselect-a-…
cstuncsik 6780c63
feat(editor): Add select all existing executions checkbox
cstuncsik 9700903
fix(editor): Do not mark later loaded executions selected
cstuncsik cfe4785
test(editor): Add execution list unit test
cstuncsik fc9dcb9
fix(editor): Fix selection
cstuncsik 920863c
test(editor): update execution selection test
cstuncsik 985193f
Merge remote-tracking branch 'origin/master' into pay-101-unselect-a-…
cstuncsik 50c1051
fix(editor): Handle UI state when there is no execution
cstuncsik e4e347e
fix(editor): Remove unnecessary logic
cstuncsik 225bc8c
test(editor): Add more execution list unit tests and fake data genera…
cstuncsik 80ee5ea
test(editor): Add more execution list unit tests
cstuncsik 6238a43
test(editor): Simplifying test setup
cstuncsik fff0df6
Merge remote-tracking branch 'origin/master' into pay-101-unselect-a-…
cstuncsik 4605be1
chore: update pnpm lock after resolving merge conflocts
cstuncsik 0ce56df
chore: fix package version
cstuncsik 669cabe
fix: Improved executions deletion to prevent crashing and fixed remov…
krynble f0605ba
fix: Add comment to clarify why change was needed
krynble 984bd8e
fix: fix executions list bug when selecting all and changing filter
alexgrozav 8594158
fix: fix execution lists running execution showing up on different wo…
alexgrozav 16d7da6
Merge remote-tracking branch 'origin/master' into pay-101-unselect-a-…
cstuncsik a99ac01
fix(editor): Deleting an execution while all are selected
cstuncsik 6bedc7f
fix(editor): Deleting an execution while all are selected
cstuncsik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,12 +40,7 @@ | |
<thead> | ||
<tr> | ||
<th> | ||
<el-checkbox | ||
:indeterminate="isIndeterminate" | ||
v-model="checkAll" | ||
@change="handleCheckAllChange" | ||
label="" | ||
/> | ||
<el-checkbox :value="checkAll" @change="handleCheckAllChange" label="" /> | ||
</th> | ||
<th>{{ $locale.baseText('executionsList.name') }}</th> | ||
<th>{{ $locale.baseText('executionsList.startedAt') }}</th> | ||
|
@@ -229,7 +224,7 @@ | |
</div> | ||
<div v-else :class="$style.loadedAll">{{ $locale.baseText('executionsList.loadedAll') }}</div> | ||
</div> | ||
<div v-if="checkAll === true || isIndeterminate === true" :class="$style.selectionOptions"> | ||
<div v-if="numSelected > 0" :class="$style.selectionOptions"> | ||
<span> | ||
{{ $locale.baseText('executionsList.selected', { interpolate: { numSelected } }) }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done by Csaba |
||
</span> | ||
|
@@ -261,10 +256,9 @@ import { | |
IExecutionsCurrentSummaryExtended, | ||
IExecutionDeleteFilter, | ||
IExecutionsListResponse, | ||
IExecutionsSummary, | ||
IWorkflowShortResponse, | ||
} from '@/Interface'; | ||
import type { ExecutionStatus, IDataObject } from 'n8n-workflow'; | ||
import type { IExecutionsSummary, ExecutionStatus, IDataObject } from 'n8n-workflow'; | ||
import { range as _range } from 'lodash-es'; | ||
import mixins from 'vue-typed-mixins'; | ||
import { mapStores } from 'pinia'; | ||
|
@@ -353,7 +347,7 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, restApi, | |
return this.workflowsStore.activeExecutions; | ||
}, | ||
combinedExecutions(): IExecutionsSummary[] { | ||
const returnData: IExecutionsSummary[] = []; | ||
const returnData = []; | ||
|
||
if (['ALL', 'running'].includes(this.filter.status)) { | ||
returnData.push(...this.activeExecutions); | ||
|
@@ -363,23 +357,9 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, restApi, | |
} | ||
return returnData; | ||
}, | ||
combinedExecutionsCount(): number { | ||
return 0 + this.activeExecutions.length + this.finishedExecutionsCount; | ||
}, | ||
numSelected(): number { | ||
mutdmour marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (this.checkAll) { | ||
return this.finishedExecutionsCount; | ||
} | ||
|
||
return Object.keys(this.selectedItems).length; | ||
}, | ||
isIndeterminate(): boolean { | ||
if (this.checkAll) { | ||
return false; | ||
} | ||
|
||
return this.numSelected > 0; | ||
}, | ||
workflowFilterCurrent(): IDataObject { | ||
const filter: IDataObject = {}; | ||
if (this.filter.workflowId !== 'ALL') { | ||
|
@@ -435,8 +415,13 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, restApi, | |
} | ||
}, | ||
handleCheckAllChange() { | ||
this.checkAll = !this.checkAll; | ||
if (!this.checkAll) { | ||
Vue.set(this, 'selectedItems', {}); | ||
} else { | ||
this.combinedExecutions.forEach((execution: IExecutionsSummary) => { | ||
Vue.set(this.selectedItems, execution.id, true); | ||
}); | ||
} | ||
}, | ||
handleCheckboxChanged(executionId: string) { | ||
|
@@ -445,6 +430,7 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, restApi, | |
} else { | ||
Vue.set(this.selectedItems, executionId, true); | ||
} | ||
this.checkAll = Object.keys(this.selectedItems).length === this.combinedExecutions.length; | ||
}, | ||
async handleDeleteSelected() { | ||
const deleteExecutions = await this.confirmMessage( | ||
|
@@ -464,11 +450,7 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, restApi, | |
this.isDataLoading = true; | ||
|
||
const sendData: IExecutionDeleteFilter = {}; | ||
if (this.checkAll) { | ||
sendData.deleteBefore = this.finishedExecutions[0].startedAt as Date; | ||
} else { | ||
sendData.ids = Object.keys(this.selectedItems); | ||
} | ||
sendData.ids = Object.keys(this.selectedItems); | ||
|
||
sendData.filters = this.workflowFilterPast; | ||
|
||
|
@@ -536,7 +518,7 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, restApi, | |
}, | ||
handleClearSelection() { | ||
this.checkAll = false; | ||
this.handleCheckAllChange(); | ||
Vue.set(this, 'selectedItems', {}); | ||
}, | ||
handleFilterChanged() { | ||
this.refreshData(); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like an intentional feature we are losing here.. can you make sure to double check with Product and design first?