forked from verdnatura/salix-front
Merge pull request '#7193 modified parking to use the scope' (!879) from 7193-ParkingCreateScope into dev
Reviewed-on: verdnatura/salix-front#879 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
30f88070ff
|
@ -278,6 +278,7 @@ globals:
|
||||||
RouteExtendedList: Router
|
RouteExtendedList: Router
|
||||||
wasteRecalc: Waste recaclulate
|
wasteRecalc: Waste recaclulate
|
||||||
operator: Operator
|
operator: Operator
|
||||||
|
parking: Parking
|
||||||
supplier: Supplier
|
supplier: Supplier
|
||||||
created: Created
|
created: Created
|
||||||
worker: Worker
|
worker: Worker
|
||||||
|
@ -663,8 +664,6 @@ parking:
|
||||||
sector: Sector
|
sector: Sector
|
||||||
row: Row
|
row: Row
|
||||||
column: Column
|
column: Column
|
||||||
pageTitles:
|
|
||||||
parking: Parking
|
|
||||||
searchBar:
|
searchBar:
|
||||||
info: You can search by parking code
|
info: You can search by parking code
|
||||||
label: Search parking...
|
label: Search parking...
|
||||||
|
|
|
@ -282,6 +282,7 @@ globals:
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
wasteRecalc: Recalcular mermas
|
wasteRecalc: Recalcular mermas
|
||||||
operator: Operario
|
operator: Operario
|
||||||
|
parking: Parking
|
||||||
supplier: Proveedor
|
supplier: Proveedor
|
||||||
created: Fecha creación
|
created: Fecha creación
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
|
@ -710,8 +711,6 @@ parking:
|
||||||
pickingOrder: Orden de recogida
|
pickingOrder: Orden de recogida
|
||||||
row: Fila
|
row: Fila
|
||||||
column: Columna
|
column: Columna
|
||||||
pageTitles:
|
|
||||||
parking: Parking
|
|
||||||
searchBar:
|
searchBar:
|
||||||
info: Puedes buscar por código de parking
|
info: Puedes buscar por código de parking
|
||||||
label: Buscar parking...
|
label: Buscar parking...
|
||||||
|
|
|
@ -2,17 +2,11 @@
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCard from 'components/common/VnCard.vue';
|
||||||
import ParkingDescriptor from 'pages/Parking/Card/ParkingDescriptor.vue';
|
import ParkingDescriptor from 'pages/Parking/Card/ParkingDescriptor.vue';
|
||||||
import ParkingFilter from 'pages/Parking/ParkingFilter.vue';
|
import ParkingFilter from 'pages/Parking/ParkingFilter.vue';
|
||||||
|
|
||||||
const filter = {
|
|
||||||
fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'],
|
|
||||||
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Parking"
|
data-key="Parking"
|
||||||
base-url="Parkings"
|
base-url="Parkings"
|
||||||
:filter="filter"
|
|
||||||
:descriptor="ParkingDescriptor"
|
:descriptor="ParkingDescriptor"
|
||||||
:filter-panel="ParkingFilter"
|
:filter-panel="ParkingFilter"
|
||||||
search-data-key="ParkingList"
|
search-data-key="ParkingList"
|
||||||
|
|
|
@ -29,6 +29,7 @@ const filter = {
|
||||||
:url="`Parkings/${entityId}`"
|
:url="`Parkings/${entityId}`"
|
||||||
title="code"
|
title="code"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
|
:to-module="{ name: 'ParkingList' }"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.code')" :value="entity.code" />
|
<VnLv :label="t('globals.code')" :value="entity.code" />
|
||||||
|
|
|
@ -22,7 +22,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
|
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
|
||||||
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
|
@ -55,10 +54,9 @@ function exprBuilder(param, value) {
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
data-key="ParkingList"
|
data-key="ParkingList"
|
||||||
url="Parkings"
|
url="Parkings"
|
||||||
:filter="filter"
|
:user-filter="filter"
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:limit="20"
|
:limit="20"
|
||||||
auto-load
|
|
||||||
order="code"
|
order="code"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('ParkingList', () => {
|
describe('ParkingList', () => {
|
||||||
|
const searchbar = '#searchbar input';
|
||||||
const firstCard = '.q-card:nth-child(1)';
|
const firstCard = '.q-card:nth-child(1)';
|
||||||
const firstChipId =
|
const firstChipId =
|
||||||
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
||||||
|
@ -14,6 +15,7 @@ describe('ParkingList', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect on clicking a parking', () => {
|
it('should redirect on clicking a parking', () => {
|
||||||
|
cy.get(searchbar).type('{enter}');
|
||||||
cy.get(firstChipId)
|
cy.get(firstChipId)
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((content) => {
|
.then((content) => {
|
||||||
|
@ -24,6 +26,7 @@ describe('ParkingList', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the details', () => {
|
it('should open the details', () => {
|
||||||
|
cy.get(searchbar).type('{enter}');
|
||||||
cy.get(firstDetailBtn).click();
|
cy.get(firstDetailBtn).click();
|
||||||
cy.get(summaryHeader).contains('Basic data');
|
cy.get(summaryHeader).contains('Basic data');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue