fix(VnFilterPanel): emit userParams better #607

Merged
alexm merged 4 commits from warmFix_vnFilterPanel_setUserParams into dev 2024-08-09 10:38:02 +00:00
Member
No description provided.
alexm added 1 commit 2024-08-09 09:41:07 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
43ca7e1667
fix(VnFilterPanel): emit userParams better
alexm added 1 commit 2024-08-09 09:41:36 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
bd05460b90
console.log
alexm requested review from jorgep 2024-08-09 09:41:40 +00:00
alexm reviewed 2024-08-09 09:42:03 +00:00
@ -83,3 +83,3 @@
function setUserParams(watchedParams) {
if (!watchedParams) return;
if (!watchedParams || Object.keys(watchedParams).length == 0) return;
Author
Member

Hay casos que es objeto vacío y no queremos emitirlo

Hay casos que es objeto vacío y no queremos emitirlo
jorgep marked this conversation as resolved
alexm reviewed 2024-08-09 09:42:37 +00:00
@ -90,2 +95,2 @@
userParams.value = { ...userParams.value, ...watchedParams };
emit('setUserParams', userParams.value);
userParams.value = { ...userParams.value, ...sanitizer(watchedParams) };
emit('setUserParams', userParams.value, order);
Author
Member

Si no emite el order, cuando se actualiza la url quita los ordenes del VnTable

Si no emite el order, cuando se actualiza la url quita los ordenes del VnTable
jorgep marked this conversation as resolved
jorgep reviewed 2024-08-09 09:51:57 +00:00
@ -94,3 +99,3 @@
watch(
() => route.query[$props.searchUrl],
(val) => setUserParams(val)
(val, oldValue) => (val || oldValue) && setUserParams(val)
Member

newVal, oldVal ?

newVal, oldVal ?
alexm marked this conversation as resolved
jorgep reviewed 2024-08-09 09:54:12 +00:00
@ -92,3 +96,4 @@
emit('setUserParams', userParams.value, order);
}
watch(
Member

Puedes crear un watch para observar route.query[$props.searchUrl] y arrayData.store.userParams

Tipo esto:
watch( () => [route.query[$props.searchUrl], arrayData.store.userParams], ([newSearchUrl, newUserParams], [oldSearchUrl, oldUserParams]) => { if (newSearchUrl || oldSearchUrl) { setUserParams(newSearchUrl); } if (newUserParams || oldUserParams) { setUserParams(newUserParams); } } );

Puedes crear un watch para observar **route.query[$props.searchUrl]** y **arrayData.store.userParams** Tipo esto: `watch( () => [route.query[$props.searchUrl], arrayData.store.userParams], ([newSearchUrl, newUserParams], [oldSearchUrl, oldUserParams]) => { if (newSearchUrl || oldSearchUrl) { setUserParams(newSearchUrl); } if (newUserParams || oldUserParams) { setUserParams(newUserParams); } } );`
alexm marked this conversation as resolved
alexm added 1 commit 2024-08-09 10:27:30 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
02cfa54a40
unify watchers
jorgep approved these changes 2024-08-09 10:30:17 +00:00
alexm added 1 commit 2024-08-09 10:37:10 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
08972d62b0
Merge branch 'dev' into warmFix_vnFilterPanel_setUserParams
alexm merged commit 42a490cf18 into dev 2024-08-09 10:38:02 +00:00
alexm deleted branch warmFix_vnFilterPanel_setUserParams 2024-08-09 10:38:02 +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#607
No description provided.