From 049251413108d8b3275d0d39acbf19506fb61d75 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Tue, 9 May 2023 10:43:12 +0200 Subject: [PATCH 1/4] dev wip --- .../web-app-files/src/components/FilesList/ResourceTable.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/web-app-files/src/components/FilesList/ResourceTable.vue b/packages/web-app-files/src/components/FilesList/ResourceTable.vue index 23e457923b2..d18c3feaedd 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTable.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTable.vue @@ -587,6 +587,8 @@ export default defineComponent({ return this.configuration?.options?.displayResourcesLazy }, areAllResourcesSelected() { + console.log('selected-ids length', this.selectedIds) + console.log('selected-ids length', this.selectedIds.length) return this.selectedIds.length === this.resources.length }, selectedResources() { From 92437138f224a2263b1ce588b4f0ff939357652f Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Tue, 9 May 2023 13:44:25 +0200 Subject: [PATCH 2/4] Fix id getting double selected --- .../src/components/FilesList/KeyboardActions.vue | 5 ++++- .../web-app-files/src/components/FilesList/ResourceTable.vue | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue index edf8135211a..c6f686c6440 100644 --- a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue +++ b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue @@ -167,7 +167,7 @@ export default defineComponent({ scrollToResource({ id: nextResourceId } as any) selectionCursor.value = unref(selectionCursor) + 1 } - const handleShiftClickAction = (resource) => { + const handleShiftClickAction = ({ resource, skipTargetSelection }) => { const parent = document.querySelectorAll(`[data-item-id='${resource.id}']`)[0] const resourceNodes = Object.values(parent.parentNode.children) const latestNode = resourceNodes.find( @@ -184,6 +184,9 @@ export default defineComponent({ for (let i = minIndex; i <= maxIndex; i++) { const nodeId = resourceNodes[i].getAttribute('data-item-id') + if (skipTargetSelection && nodeId === resource.id) { + continue + } store.commit('Files/ADD_FILE_SELECTION', { id: nodeId }) } store.commit('Files/SET_LATEST_SELECTED_FILE_ID', resource.id) diff --git a/packages/web-app-files/src/components/FilesList/ResourceTable.vue b/packages/web-app-files/src/components/FilesList/ResourceTable.vue index d18c3feaedd..7c5552ca182 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTable.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTable.vue @@ -47,7 +47,7 @@ :model-value="isResourceSelected(item)" :outline="isLatestSelectedItem(item)" @update:model-value="setSelection($event, item)" - @click.stop="fileClicked([item, $event])" + @click.stop="fileClicked([item, $event, true])" />