refactor: refs #8534 simplify title extraction logic and update Cypress command for warehouse selection
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
This commit is contained in:
parent
e662bef717
commit
3fd6eeda49
|
@ -51,14 +51,14 @@ export function setPageTitle(to) {
|
||||||
const matches = to.matched;
|
const matches = to.matched;
|
||||||
if (matches && matches.length > 1) {
|
if (matches && matches.length > 1) {
|
||||||
const module = matches[1];
|
const module = matches[1];
|
||||||
const moduleTitle = module.meta && module.meta.title;
|
const moduleTitle = module.meta?.title;
|
||||||
if (moduleTitle) {
|
if (moduleTitle) {
|
||||||
title = t(`globals.pageTitles.${moduleTitle}`);
|
title = t(`globals.pageTitles.${moduleTitle}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const childPage = to.meta;
|
const childPage = to.meta;
|
||||||
const childPageTitle = childPage && childPage.title;
|
const childPageTitle = childPage?.title;
|
||||||
if (childPageTitle && matches.length > 2) {
|
if (childPageTitle && matches.length > 2) {
|
||||||
if (title != '') title += ': ';
|
if (title != '') title += ': ';
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ export function setPageTitle(to) {
|
||||||
const pageTitle = te(moduleLocale)
|
const pageTitle = te(moduleLocale)
|
||||||
? t(moduleLocale)
|
? t(moduleLocale)
|
||||||
: t(`globals.pageTitles.${childPageTitle}`);
|
: t(`globals.pageTitles.${childPageTitle}`);
|
||||||
const idParam = to.params && to.params.id;
|
const idParam = to.params?.id;
|
||||||
const idPageTitle = `${idParam} - ${pageTitle}`;
|
const idPageTitle = `${idParam} - ${pageTitle}`;
|
||||||
const builtTitle = idParam ? idPageTitle : pageTitle;
|
const builtTitle = idParam ? idPageTitle : pageTitle;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Cypress.Commands.add('selectTravel', (warehouse = '1') => {
|
Cypress.Commands.add('selectTravel', (warehouse = '1') => {
|
||||||
cy.get('i[data-cy="Travel_icon"]').click();
|
cy.get('i[data-cy="Travel_icon"]').click();
|
||||||
cy.get('input[data-cy="Warehouse Out_select"]').type(warehouse);
|
cy.selectOption('input[data-cy="Warehouse Out_select"]', warehouse);
|
||||||
cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click();
|
cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click();
|
||||||
cy.get('button[data-cy="save-filter-travel-form"]').click();
|
cy.get('button[data-cy="save-filter-travel-form"]').click();
|
||||||
cy.get('tr').eq(1).click();
|
cy.get('tr').eq(1).click();
|
||||||
|
@ -9,7 +9,6 @@ Cypress.Commands.add('selectTravel', (warehouse = '1') => {
|
||||||
Cypress.Commands.add('deleteEntry', () => {
|
Cypress.Commands.add('deleteEntry', () => {
|
||||||
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
|
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
|
||||||
cy.waitForElement('div[data-cy="delete-entry"]').click();
|
cy.waitForElement('div[data-cy="delete-entry"]').click();
|
||||||
cy.url().should('include', 'list');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('createEntry', () => {
|
Cypress.Commands.add('createEntry', () => {
|
||||||
|
|
Loading…
Reference in New Issue