#6992 add URL params #273
|
@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
|
||||
### Fixed
|
||||
|
||||
- (General) => Se vuelven a mostrar los parámetros en la url al aplicar un filtro
|
||||
|
||||
## [2414.01] - 2024-04-04
|
||||
|
||||
### Added
|
||||
|
|
|
@ -105,7 +105,7 @@ export function useArrayData(key, userOptions) {
|
|||
for (const row of response.data) store.data.push(row);
|
||||
jorgep marked this conversation as resolved
Outdated
|
||||
} else {
|
||||
store.data = response.data;
|
||||
if (!document.querySelectorAll('[role="dialog"]'))
|
||||
if (!document.querySelectorAll('[role="dialog"]').length)
|
||||
jsegarra marked this conversation as resolved
Outdated
jsegarra
commented
Mmm, esa linea lleva ahi desde el 8/2/24...a ti te ha funcionado?Porque quizás habría que darle una vuelta, queryselectorAll siempre devolverá un array. Mmm, esa linea lleva ahi desde el 8/2/24...a ti te ha funcionado?Porque quizás habría que darle una vuelta, queryselectorAll siempre devolverá un array.
a lo mejor hacer length > 0
Así como curiosidad, GPT me ha dicho que use esta sentencia:
` window.Quasar?.dialog?.manager?.__showing?.length > 0` pero no lo tengo claro
jorgep
commented
Sí, la línea funciona. Hacer !array.length es lo mismo que !array.length>0 . he probado eso y no parece existir en el navegador Sí, la línea funciona. Hacer !array.length es lo mismo que !array.length>0 . he probado eso y no parece existir en el navegador
|
||||
updateRouter && updateStateParams();
|
||||
}
|
||||
|
||||
|
@ -188,11 +188,15 @@ export function useArrayData(key, userOptions) {
|
|||
if (store.userParams && Object.keys(store.userParams).length !== 0)
|
||||
query.params = JSON.stringify(store.userParams);
|
||||
|
||||
if (router)
|
||||
jorgep
commented
Esto redirige, por lo que no es lo más correcto. Alex y Juan me dan el ok. Esto redirige, por lo que no es lo más correcto. Alex y Juan me dan el ok.
|
||||
router.replace({
|
||||
path: route.path,
|
||||
query: query,
|
||||
});
|
||||
const url = new URL(window.location.href);
|
||||
const { hash: currentHash } = url;
|
||||
const [currentRoute] = currentHash.split('?');
|
||||
|
||||
const params = new URLSearchParams();
|
||||
for (const param in query) params.append(param, query[param]);
|
||||
|
||||
url.hash = currentRoute + '?' + params.toString();
|
||||
jsegarra marked this conversation as resolved
Outdated
jsegarra
commented
porque no usas currentHash? porque no usas currentHash?
Idem para la siguiente linea
jorgep
commented
Porque currentRoute es solo la ruta . Ej. currentRoute = #/claim/list y currentHash = #/claim/list?order=priority+ASC%2Ccreated+DESC&limit=10¶ms=%7B%22clientName%22%3A%22br%22%7D . CurrentHash es la ruta con los parámetros actuales. Porque currentRoute es solo la ruta . Ej. currentRoute = #/claim/list y currentHash = #/claim/list?order=priority+ASC%2Ccreated+DESC&limit=10¶ms=%7B%22clientName%22%3A%22br%22%7D . CurrentHash es la ruta con los parámetros actuales.
|
||||
window.history.pushState({}, '', url);
|
||||
}
|
||||
|
||||
const totalRows = computed(() => (store.data && store.data.length) || 0);
|
||||
|
|
|
@ -36,7 +36,7 @@ describe('VnSearchBar', () => {
|
|||
const checkCardListAndUrl = (expectedLength) => {
|
||||
cy.get(cardList).then(($cardList) => {
|
||||
expect($cardList.find('.q-card').length).to.equal(expectedLength);
|
||||
cy.url().then((currentUrl) => expect(currentUrl).to.equal(url));
|
||||
cy.url().then((currentUrl) => expect(currentUrl).to.contain(url));
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
Se que no lo has modificado, pero puedes eliminar el warning de la línea 18?