Browse Source

fix: select all records tests

pull/9959/head
DarkPhoenix2704 6 days ago
parent
commit
cc3dbe2cad
  1. 20
      packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue

20
packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue

@ -1775,9 +1775,8 @@ watch(
}, },
) )
const toggleRowSelection = (row: number) => { const toggleRowSelection = (row: number) => {
if(vSelectedAllRecords.value) return if (vSelectedAllRecords.value) return
const data = cachedRows.value.get(row) const data = cachedRows.value.get(row)
if (!data) return if (!data) return
@ -1795,7 +1794,6 @@ watch(vSelectedAllRecords, (selectedAll) => {
} }
} }
}) })
</script> </script>
<template> <template>
@ -1828,7 +1826,7 @@ watch(vSelectedAllRecords, (selectedAll) => {
<div ref="gridWrapper" class="nc-grid-wrapper min-h-0 flex-1 relative !overflow-auto"> <div ref="gridWrapper" class="nc-grid-wrapper min-h-0 flex-1 relative !overflow-auto">
<NcDropdown <NcDropdown
v-model:visible="contextMenu" v-model:visible="contextMenu"
:disabled="contextMenuTarget === null && (!selectedRows.length && !vSelectedAllRecords)" :disabled="contextMenuTarget === null && !selectedRows.length && !vSelectedAllRecords"
:trigger="isSqlView ? [] : ['contextmenu']" :trigger="isSqlView ? [] : ['contextmenu']"
overlay-class-name="nc-dropdown-grid-context-menu" overlay-class-name="nc-dropdown-grid-context-menu"
> >
@ -1875,9 +1873,14 @@ watch(vSelectedAllRecords, (selectedAll) => {
}" }"
data-testid="grid-id-column" data-testid="grid-id-column"
> >
<div
<div class="flex items-center pl-2 pr-1 w-full h-full justify-center" v-if="!readOnly"> v-if="!readOnly"
<div class="nc-no-label text-gray-500" :class="{ hidden: vSelectedAllRecords }">#</div> data-testid="nc-check-all"
class="flex items-center pl-2 pr-1 w-full h-full justify-center"
>
<div class="nc-no-label text-gray-500" :class="{ hidden: vSelectedAllRecords }">
#
</div>
<div <div
:class="{ :class="{
hidden: !vSelectedAllRecords, hidden: !vSelectedAllRecords,
@ -1893,7 +1896,6 @@ watch(vSelectedAllRecords, (selectedAll) => {
<template v-else> <template v-else>
<div class="w-full h-full text-gray-500 flex pl-2 pr-1 items-center" data-testid="nc-check-all">#</div> <div class="w-full h-full text-gray-500 flex pl-2 pr-1 items-center" data-testid="nc-check-all">#</div>
</template> </template>
</th> </th>
<th <th
v-if="fields[0] && fields[0].id" v-if="fields[0] && fields[0].id"
@ -2225,7 +2227,7 @@ watch(vSelectedAllRecords, (selectedAll) => {
> >
<NcCheckbox <NcCheckbox
:checked="row.rowMeta.selected || vSelectedAllRecords" :checked="row.rowMeta.selected || vSelectedAllRecords"
:disabled="!row.rowMeta.selected && selectedRows.length > 100 || vSelectedAllRecords" :disabled="(!row.rowMeta.selected && selectedRows.length > 100) || vSelectedAllRecords"
@change="toggleRowSelection(row.rowMeta.rowIndex)" @change="toggleRowSelection(row.rowMeta.rowIndex)"
/> />
</div> </div>

Loading…
Cancel
Save