feat: refs #8534 implement navigation and state query guards for improved routing control #1621
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix-front#1621
Loading…
Reference in New Issue
No description provided.
Delete Branch "8534-wait_queries"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +1,93 @@
import { useRole } from 'src/composables/useRole';
He separado las funciones del router asi se puede testear las funciones sin pasar por el router real de vue
@ -0,0 +38,4 @@
next();
}
export async function stateQueryGuard(next) {
Esta es la nueva
@ -29,4 +29,2 @@
.eq(2)
.should('have.text', 'Entry prices recalculated');
cy.get('[data-cy="descriptor-more-opts"]').click();
deleteEntry ya tiene
cy.get('[data-cy="descriptor-more-opts"]').click();
dentro@ -0,0 +38,4 @@
next();
}
export async function stateQueryGuard(to, from, next) {
Esta es la nueva, todo lo demás está movido
@ -0,0 +1,39 @@
import { describe, it, expect, vi } from 'vitest';
import { ref, nextTick } from 'vue';
import { stateQueryGuard } from 'src/router/hooks';
import { __test as testStateQuery } from 'src/stores/useStateQueryStore';
esto es nuevo?
@ -101,3 +25,1 @@
}
document.title = title;
});
Router.beforeEach((to, from, next) => navigationGuard(to, from, next, Router, state));
esta es una lastima que aqui no
@ -102,2 +25,2 @@
document.title = title;
});
Router.beforeEach((to, from, next) => navigationGuard(to, from, next, Router, state));
Router.beforeEach((to, from, next) => stateQueryGuard(to, from, next));
Router.beforeEach( stateQueryGuard);
@ -103,1 +25,3 @@
});
Router.beforeEach((to, from, next) => navigationGuard(to, from, next, Router, state));
Router.beforeEach((to, from, next) => stateQueryGuard(to, from, next));
Router.afterEach((to) => setPageTitle(to));
Router.afterEach(setPageTitle);
Cuando funcione gitea subo el commit