#8078 enable multi choice #848

Merged
jorgep merged 17 commits from 8078-enableMultiSelection into dev 2024-11-05 10:20:05 +00:00
Member
No description provided.
jorgep added 1 commit 2024-10-27 13:53:34 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
0cc0e82aaa
feat: refs #8078 add shortcut multi selection
jorgep reviewed 2024-10-28 11:08:27 +00:00
@ -334,0 +334,4 @@
function handleSelection({ evt, added, rows: selectedRows }, rows) {
if (evt?.shiftKey && added) {
const rowIndex = selectedRows[0].$index;
Author
Member

Solo selecciona 1, en el unico momento en que se pueden seleccionar más, es cuando le das al checkbox para seleccionarlas todas y evt es undefined. Además, quasar siempre añade la propiedad $index.

Solo selecciona 1, en el unico momento en que se pueden seleccionar más, es cuando le das al checkbox para seleccionarlas todas y **evt es undefined**. Además, quasar siempre añade la propiedad **$index**.
Member
Quasar o CrudModel? https://gitea.verdnatura.es/verdnatura/salix-front/src/commit/6248a4117d06e60ee4f141dcb5b65969c590bfbe/src/components/CrudModel.vue#L123 😏
jorgep reviewed 2024-10-28 11:09:00 +00:00
@ -334,0 +335,4 @@
function handleSelection({ evt, added, rows: selectedRows }, rows) {
if (evt?.shiftKey && added) {
const rowIndex = selectedRows[0].$index;
for (const row of rows) {
Author
Member

Podría hacer un filter, pero creo que mejor un for para no recorrerlas todas , en caso de que hayan muchos registros.

Podría hacer un filter, pero creo que mejor un for para no recorrerlas todas , en caso de que hayan muchos registros.
jorgep added 1 commit 2024-10-28 12:26:45 +00:00
jorgep added 1 commit 2024-10-28 13:45:49 +00:00
jorgep added 1 commit 2024-10-28 14:40:43 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
d5639471cf
feat: refs #8078 add tests
jorgep reviewed 2024-10-28 14:42:12 +00:00
@ -0,0 +28,4 @@
expect(vm.selected).toEqual([{ $index: 0 }, { $index: 1 }]);
});
it('should not add rows to selected when shift key is not pressed', () => {
Author
Member

No se añade dentro de la fn, pero si que se selecciona la fila en el evt @update:selected , se ejecuta después de @selection

No se añade dentro de la fn, pero si que se selecciona la fila en el evt **@update:selected** , se ejecuta después de **@selection**
jorgep reviewed 2024-10-28 14:43:14 +00:00
@ -0,0 +36,4 @@
expect(vm.selected).toEqual([]);
});
it('should not add rows to selected when rows are not added', () => {
Author
Member

Si es la acción de desmarcar added está a false.

Si es la acción de desmarcar added está a false.
jorgep changed title from WIP: #8078 enable multi choice to #8078 enable multi choice 2024-10-28 14:43:25 +00:00
jorgep requested review from alexm 2024-10-28 14:43:33 +00:00
jorgep added 3 commits 2024-10-28 15:21:05 +00:00
jorgep reviewed 2024-10-28 15:22:01 +00:00
@ -34,3 +34,3 @@
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
useDialogPluginComponent();
defineExpose({ dialogRef });
Author
Member

Se ha quitado y se rompía el test de TicketDescriptor.

Se ha quitado y se rompía el test de TicketDescriptor.
Member

Quitar

Quitar
jorgep reviewed 2024-10-28 15:22:39 +00:00
@ -261,7 +261,7 @@ Cypress.Commands.add('openActionDescriptor', (opt) => {
});
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
Author
Member

Fallaba

Fallaba
jorgep added the
CR / Tests passed
label 2024-10-28 15:24:13 +00:00
Member

Lo he probado en invoiceOut y la peticion duplica el primero y el ultimo que seleccionas:
:[1,1,2,3,5,6,6],

Puedes revisarlo?

Lo he probado en invoiceOut y la peticion duplica el primero y el ultimo que seleccionas: :[1,1,2,3,5,6,6], Puedes revisarlo?
alexm requested changes 2024-10-29 06:55:25 +00:00
Dismissed
alexm left a comment
Member

.

.
jorgep added 1 commit 2024-10-29 08:27:35 +00:00
jorgep added 1 commit 2024-10-29 08:38:45 +00:00
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
77cb2d84be
fix: refs #8078 handleSelection
Author
Member

Lo he probado en invoiceOut y la peticion duplica el primero y el ultimo que seleccionas:
:[1,1,2,3,5,6,6],

Puedes revisarlo?

Listo.

> Lo he probado en invoiceOut y la peticion duplica el primero y el ultimo que seleccionas: > :[1,1,2,3,5,6,6], > > Puedes revisarlo? Listo.
jorgep added 1 commit 2024-10-29 08:40:00 +00:00
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
19a7e52605
fix: refs #8078 handleSelection
jorgep added 1 commit 2024-10-29 08:56:10 +00:00
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
e39f85ff4b
fix: refs #8078 improve handleSelection
jorgep reviewed 2024-10-29 09:06:14 +00:00
@ -334,0 +338,4 @@
const selectedIndexes = new Set(selected.value.map((row) => row.$index));
for (const row of rows) {
if (row.$index == rowIndex) break;
if (!selectedIndexes.has(row.$index)) {
Author
Member

Así se comprueba si la fila ya está seleccionada y no se recorren todas las filas.

Así se comprueba si la fila ya está seleccionada y no se recorren todas las filas.
jorgep requested review from alexm 2024-10-29 09:06:36 +00:00
alexm added 1 commit 2024-10-29 11:44:08 +00:00
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
fa5750bce4
Merge branch 'dev' into 8078-enableMultiSelection
alexm approved these changes 2024-10-29 11:44:31 +00:00
Dismissed
alexm requested changes 2024-10-29 11:44:44 +00:00
Dismissed
@ -660,3 +660,3 @@
</QMenu>
</QItem>
<QItem @click="$refs.weightDialog.show()" v-ripple clickable>
<QItem @click="$refs.weightDialog.dialogRef.show()" v-ripple clickable>
Member

Quitar

Quitar
jorgep marked this conversation as resolved
jorgep added 3 commits 2024-11-05 09:02:37 +00:00
jorgep added 1 commit 2024-11-05 09:37:41 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
86e6bef90f
chore: refs #8078 fiz tests
jorgep dismissed alexm’s review 2024-11-05 09:37:41 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

jorgep reviewed 2024-11-05 09:41:20 +00:00
@ -0,0 +25,4 @@
{ evt: { shiftKey: true }, added: true, rows: selectedRows },
rows
);
expect(vm.selected).toEqual([{ $index: 0 }]);
Author
Member

El de index 1 no lo pongo xq se añade desde el evt update:selected no desde esta fn.

El de index 1 no lo pongo xq se añade desde el evt update:selected no desde esta fn.
jorgep requested review from alexm 2024-11-05 09:41:27 +00:00
alexm approved these changes 2024-11-05 09:56:56 +00:00
jorgep added 1 commit 2024-11-05 10:18:49 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
ca9a7f2932
Merge branch 'dev' into 8078-enableMultiSelection
jorgep merged commit 9ee05721a4 into dev 2024-11-05 10:20:05 +00:00
jorgep deleted branch 8078-enableMultiSelection 2024-11-05 10:20:05 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix-front#848
No description provided.