Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8581-invoiceinE2e
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-03-12 09:15:21 +01:00
commit b86ba0c67b
31 changed files with 111 additions and 87 deletions

View File

@ -188,7 +188,7 @@ const selectItem = ({ id }) => {
>
<template #body-cell-id="{ row }">
<QTd auto-width @click.stop>
<QBtn flat color="blue">{{ row.id }}</QBtn>
<QBtn flat class="link">{{ row.id }}</QBtn>
<ItemDescriptorProxy :id="row.id" />
</QTd>
</template>

View File

@ -196,7 +196,7 @@ const selectTravel = ({ id }) => {
>
<template #body-cell-id="{ row }">
<QTd auto-width @click.stop data-cy="travelFk-travel-form">
<QBtn flat color="blue">{{ row.id }}</QBtn>
<QBtn flat class="link">{{ row.id }}</QBtn>
<TravelDescriptorProxy :id="row.id" />
</QTd>
</template>

View File

@ -6,6 +6,7 @@ import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'components/common/VnInputTime.vue';
import VnCheckbox from 'components/common/VnCheckbox.vue';
import VnColumn from 'components/VnTable/VnColumn.vue';
const $props = defineProps({
@ -106,7 +107,7 @@ const components = {
},
},
checkbox: {
component: markRaw(QCheckbox),
component: markRaw(VnCheckbox),
event: updateEvent,
attrs: {
class: $props.showTitle ? 'q-py-sm' : 'q-px-md q-py-xs fit',

View File

@ -54,7 +54,7 @@ const $props = defineProps({
default: 'table',
},
redirect: {
type: Boolean,
type: [String, Boolean],
default: true,
},
arrayData: {

View File

@ -15,6 +15,7 @@ body.body--light {
--vn-empty-tag: #acacac;
--vn-black-text-color: black;
--vn-text-color-contrast: white;
--vn-link-color: #1e90ff;
background-color: var(--vn-page-color);
@ -38,6 +39,7 @@ body.body--dark {
--vn-empty-tag: #2d2d2d;
--vn-black-text-color: black;
--vn-text-color-contrast: black;
--vn-link-color: #66bfff;
background-color: var(--vn-page-color);
@ -49,7 +51,7 @@ a {
}
.link {
color: $color-link;
color: var(--vn-link-color);
cursor: pointer;
&--white {
@ -58,14 +60,14 @@ a {
}
.tx-color-link {
color: $color-link !important;
color: var(--vn-link-color) !important;
}
.tx-color-font {
color: $color-link !important;
color: var(--vn-link-color) !important;
}
.header-link {
color: $color-link !important;
color: var(--vn-link-color) !important;
cursor: pointer;
border-bottom: solid $primary;
border-width: 2px;

View File

@ -24,7 +24,6 @@ $alert: $negative;
$white: #fff;
$dark: #3d3d3d;
// custom
$color-link: #66bfff;
$color-spacer-light: #a3a3a31f;
$color-spacer: #7979794d;
$border-thin-light: 1px solid $color-spacer-light;

View File

@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const route = useRoute();
const { t } = useI18n();
@ -27,13 +28,10 @@ const entityId = computed(() => $props.id || route.params.id);
<template #body="{ entity: alias }">
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<router-link
:to="{ name: 'AliasBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" />
</router-link>
<VnTitle
:url="`#/account/alias/${entityId}/basic-data`"
:text="t('globals.summary.basicData')"
/>
</QCardSection>
<VnLv :label="t('role.id')" :value="alias.id" />
<VnLv :label="t('role.description')" :value="alias.description" />

View File

@ -5,6 +5,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import filter from './AccountFilter.js';
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const $props = defineProps({ id: { type: Number, default: 0 } });
@ -26,13 +27,10 @@ const entityId = computed(() => $props.id || route.params.id);
<template #body="{ entity }">
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<router-link
:to="{ name: 'AccountBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ $t('globals.pageTitles.basicData') }}
<QIcon name="open_in_new" />
</router-link>
<VnTitle
:url="`#/account/${entityId}/basic-data`"
:text="$t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="$t('account.card.nickname')" :value="entity.name" />
<VnLv :label="$t('account.card.role')" :value="entity.role?.name" />

View File

@ -4,6 +4,7 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const route = useRoute();
const { t } = useI18n();
@ -29,13 +30,10 @@ const entityId = computed(() => $props.id || route.params.id);
<template #body="{ entity }">
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<a
class="header header-link"
:href="`#/VnUser/${entityId}/basic-data`"
>
{{ t('globals.pageTitles.basicData') }}
<QIcon name="open_in_new" />
</a>
<VnTitle
:url="`#/account/role/${entityId}/basic-data`"
:text="$t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('role.id')" :value="entity.id" />
<VnLv :label="t('globals.name')" :value="entity.name" />

View File

@ -271,7 +271,7 @@ function claimUrl(section) {
</VnLv>
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.customer')">
<template #value>
<span class="link cursor-pointer">
<span class="link">
{{ claim.client?.name }}
<CustomerDescriptorProxy :id="claim.clientFk" />
</span>

View File

@ -86,12 +86,12 @@ const tableColumnComponents = {
},
file: {
component: QBtn,
props: () => ({ flat: true, color: 'blue' }),
props: () => ({ flat: true }),
event: ({ row }) => downloadFile(row.dmsFk),
},
employee: {
component: QBtn,
props: () => ({ flat: true, color: 'blue' }),
props: () => ({ flat: true }),
event: () => {},
},
created: {
@ -214,8 +214,17 @@ const toCustomerFileManagementCreate = () => {
v-bind="tableColumnComponents[props.col.name].props(props)"
>
<template v-if="props.col.name !== 'original'">
{{ props.value }}
<span
:class="{
link:
props.col.name === 'employee' ||
props.col.name === 'file',
}"
>
{{ props.value }}
</span>
</template>
<WorkerDescriptorProxy
:id="props.row.dms.workerFk"
v-if="props.col.name === 'employee'"

View File

@ -7,6 +7,7 @@ import filter from './ItemTypeFilter.js';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
onUpdated(() => summaryRef.value.fetch());
@ -62,13 +63,10 @@ async function setItemTypeData(data) {
</template>
<template #body>
<QCard class="vn-one">
<router-link
:to="{ name: 'ItemTypeBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" />
</router-link>
<VnTitle
:url="`#/item/item-type/${entityId}/basic-data`"
:text="$t('globals.summary.basicData')"
/>
<VnLv :label="t('itemType.summary.id')" :value="itemType.id" />
<VnLv :label="t('itemType.shared.code')" :value="itemType.code" />
<VnLv :label="t('itemType.shared.name')" :value="itemType.name" />

View File

@ -2,10 +2,13 @@
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import AgencySummary from 'pages/Route/Agency/Card/AgencySummary.vue';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const router = useRouter();
const dataKey = 'AgencyList';
function navigate(id) {
@ -60,7 +63,8 @@ const columns = computed(() => [
{
title: t('Client ticket list'),
icon: 'preview',
action: (row) => navigate(row.id),
action: (row) => viewSummary(row?.id, AgencySummary),
isPrimary: true,
},
],
},
@ -82,7 +86,7 @@ const columns = computed(() => [
<VnTable
:data-key
:columns="columns"
is-editable="false"
:is-editable="false"
:right-search="false"
:use-model="true"
redirect="route/agency"

View File

@ -21,7 +21,7 @@ const warehouses = ref([]);
@on-fetch="(data) => (warehouses = data)"
auto-load
/>
<FormModel :update-url="`Agencies/${routeId}`" model="Agency" auto-load>
<FormModel :url-update="`Agencies/${routeId}`" model="Agency" auto-load>
<template #form="{ data }">
<VnRow>
<VnInput v-model="data.name" :label="t('globals.name')" />

View File

@ -7,19 +7,20 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const route = useRoute();
const $props = defineProps({ id: { type: Number, default: 0 } });
const { t } = useI18n();
const entityId = computed(() => $props.id || useRoute().params.id);
const entityId = computed(() => $props.id || route.params.id);
</script>
<template>
<div class="q-pa-md">
<CardSummary :url="`Agencies/${entityId}`" data-key="Agency">
<CardSummary :url="`Agencies/${entityId}`" data-key="Agency" module-name="Agency">
<template #header="{ entity: agency }">{{ agency.name }}</template>
<template #body="{ entity: agency }">
<QCard class="vn-one">
<VnTitle
:url="`#/agency/${entityId}/basic-data`"
:url="`#/${route.meta.moduleName.toLowerCase()}/agency/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv :label="t('globals.name')" :value="agency.name" />

View File

@ -135,7 +135,7 @@ const ticketColumns = ref([
<template #body="{ entity }">
<QCard class="vn-max">
<VnTitle
:url="`#/route/${entityId}/basic-data`"
:url="`#/${route.meta.moduleName.toLowerCase()}/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
</QCard>
@ -168,7 +168,7 @@ const ticketColumns = ref([
<VnLv
:label="t('route.summary.volume')"
:value="`${dashIfEmpty(entity?.route?.m3)} / ${dashIfEmpty(
entity?.route?.vehicle?.m3
entity?.route?.vehicle?.m3,
)} `"
/>
<VnLv
@ -221,7 +221,7 @@ const ticketColumns = ref([
<template #body-cell-city="{ value, row }">
<QTd auto-width>
<span
class="link cursor-pointer"
class="link"
@click="openBuscaman(entity?.route?.vehicleFk, [row])"
>
{{ value }}
@ -230,7 +230,7 @@ const ticketColumns = ref([
</template>
<template #body-cell-client="{ value, row }">
<QTd auto-width>
<span class="link cursor-pointer">
<span class="link">
{{ value }}
<CustomerDescriptorProxy :id="row?.clientFk" />
</span>
@ -238,7 +238,7 @@ const ticketColumns = ref([
</template>
<template #body-cell-ticket="{ value, row }">
<QTd auto-width class="text-center">
<span class="link cursor-pointer">
<span class="link">
{{ value }}
<TicketDescriptorProxy :id="row?.id" />
</span>

View File

@ -17,7 +17,7 @@ const onSave = (data, response) => {
</script>
<template>
<FormModel
:update-url="`Roadmaps/${$route.params?.id}`"
:url-update="`Roadmaps/${$route.params?.id}`"
:url="`Roadmaps/${$route.params?.id}`"
observe-form-changes
model="Roadmap"

View File

@ -15,6 +15,10 @@ const $props = defineProps({
required: false,
default: null,
},
summary: {
type: Object,
default: null,
},
});
const route = useRoute();
@ -26,7 +30,12 @@ const entityId = computed(() => {
</script>
<template>
<CardDescriptor :url="`Roadmaps/${entityId}`" :filter="filter" data-key="Roadmap">
<CardDescriptor
:url="`Roadmaps/${entityId}`"
:filter="filter"
data-key="Roadmap"
:summary="summary"
>
<template #body="{ entity }">
<VnLv :label="t('Roadmap')" :value="entity?.name" />
<VnLv :label="t('ETD')" :value="toDateHourMin(entity?.etd)" />

View File

@ -98,7 +98,7 @@ const columns = computed(() => [
label: t('route.hourStarted'),
cardVisible: true,
columnFilter: false,
format: (row) => toHour(row.started),
format: ({ started }) => toHour(started),
},
{
align: 'left',
@ -106,7 +106,7 @@ const columns = computed(() => [
label: t('route.hourFinished'),
cardVisible: true,
columnFilter: false,
format: (row) => toHour(row.started),
format: ({ finished }) => toHour(finished),
},
{
align: 'left',

View File

@ -8,7 +8,6 @@ import { useSummaryDialog } from 'composables/useSummaryDialog';
import toCurrency from 'filters/toCurrency';
import axios from 'axios';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import RoadmapSummary from 'pages/Route/Roadmap/RoadmapSummary.vue';

View File

@ -11,7 +11,6 @@ const { notify } = useNotify();
:url="`Vehicles/${$route.params.id}`"
data-key="Vehicle"
title="numberPlate"
:to-module="{ name: 'VehicleList' }"
>
<template #menu="{ entity }">
<QItem

View File

@ -13,12 +13,13 @@ const props = defineProps({ id: { type: [Number, String], default: null } });
const route = useRoute();
const entityId = computed(() => props.id || +route.params.id);
const baseLink = `#/${route.meta.moduleName.toLowerCase()}/vehicle/${entityId.value}`;
const links = {
'basic-data': `#/vehicle/${entityId.value}/basic-data`,
notes: `#/vehicle/${entityId.value}/notes`,
dms: `#/vehicle/${entityId.value}/dms`,
'invoice-in': `#/vehicle/${entityId.value}/invoice-in`,
events: `#/vehicle/${entityId.value}/events`,
'basic-data': `${baseLink}/basic-data`,
notes: `${baseLink}/notes`,
dms: `${baseLink}/dms`,
'invoice-in': `${baseLink}/invoice-in`,
events: `${baseLink}/events`,
};
</script>
<template>
@ -54,7 +55,10 @@ const links = {
<template #value>
<span class="link">
{{ entity.supplier?.name }}
<SupplierDescriptorProxy :id="entity.supplierFk" />
<SupplierDescriptorProxy
v-if="entity.supplierFk"
:id="entity.supplierFk"
/>
</span>
</template>
</VnLv>
@ -63,6 +67,7 @@ const links = {
<span class="link">
{{ entity.supplierCooler?.name }}
<SupplierDescriptorProxy
v-if="entity.supplierCoolerFk"
:id="entity.supplierCoolerFk"
/>
</span>

View File

@ -116,6 +116,7 @@ const columns = computed(() => [
title: t('components.smartCard.openSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, VehicleSummary),
isPrimary: true,
},
],
},

View File

@ -6,6 +6,7 @@ import VnLv from 'components/ui/VnLv.vue';
import VnUserLink from 'components/ui/VnUserLink.vue';
import filter from './ShelvingFilter.js';
import ShelvingDescriptorMenu from './ShelvingDescriptorMenu.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const $props = defineProps({
id: {
@ -38,13 +39,10 @@ const entityId = computed(() => $props.id || route.params.id);
</template>
<template #body="{ entity }">
<QCard class="vn-one">
<RouterLink
class="header header-link"
:to="{ name: 'ShelvingBasicData', params: { id: entityId } }"
>
{{ $t('globals.pageTitles.basicData') }}
<QIcon name="open_in_new" />
</RouterLink>
<VnTitle
:url="`#/shelving/${entityId}/basic-data`"
:text="$t('globals.pageTitles.basicData')"
/>
<VnLv :label="$t('globals.code')" :value="entity.code" />
<VnLv
:label="$t('shelving.list.parking')"

View File

@ -4,6 +4,7 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const $props = defineProps({
id: {
@ -28,13 +29,10 @@ const filter = {
<template #body="{ entity }">
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<a
class="header header-link"
:href="`#/parking/${entityId}/basic-data`"
>
{{ t('globals.pageTitles.basicData') }}
<QIcon name="open_in_new" />
</a>
<VnTitle
:url="`#/shelving/parking/${entityId}/basic-data`"
:text="$t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.code')" :value="entity.code" />
<VnLv

View File

@ -203,7 +203,7 @@ onMounted(async () => {
</QTr>
<QTr v-for="(buy, index) in row.buys" :key="index">
<QTd no-hover>
<QBtn flat color="blue" dense no-caps>{{ buy.itemName }}</QBtn>
<QBtn flat class="link" dense no-caps>{{ buy.itemName }}</QBtn>
<ItemDescriptorProxy :id="buy.itemFk" />
</QTd>

View File

@ -225,7 +225,7 @@ function onBuysFetched(data) {
/>
</div>
<div class="flex column left" style="align-items: flex-start">
<QBtn flat class="link text-blue">
<QBtn flat class="link">
{{ item?.longName ?? item.name }}
<ItemDescriptorProxy :id="entityId" />
<FetchedTags class="q-ml-md" :item="item" :columns="7" />

View File

@ -23,6 +23,10 @@ const $props = defineProps({
required: false,
default: 'Worker',
},
summary: {
type: Object,
default: null,
},
});
const image = ref(null);
@ -51,6 +55,7 @@ const handlePhotoUpdated = (evt = false) => {
<CardDescriptor
ref="cardDescriptorRef"
:data-key="dataKey"
:summary="$props.summary"
url="Workers/summary"
:filter="{ where: { id: entityId } }"
title="user.nickname"

View File

@ -220,7 +220,6 @@ export default {
path: '',
name: 'RouteIndexMain',
redirect: { name: 'RouteList' },
component: () => import('src/pages/Route/RouteList.vue'),
children: [
{
name: 'RouteList',
@ -229,6 +228,7 @@ export default {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Route/RouteList.vue'),
},
routeCard,
],
@ -268,7 +268,6 @@ export default {
title: 'RouteRoadmap',
icon: 'vn:troncales',
},
component: () => import('src/pages/Route/RouteRoadmap.vue'),
children: [
{
name: 'RoadmapList',
@ -277,6 +276,7 @@ export default {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Route/RouteRoadmap.vue'),
},
roadmapCard,
],
@ -298,7 +298,6 @@ export default {
title: 'agency',
icon: 'garage_home',
},
component: () => import('src/pages/Route/Agency/AgencyList.vue'),
children: [
{
name: 'AgencyList',
@ -307,6 +306,8 @@ export default {
title: 'list',
icon: 'view_list',
},
component: () =>
import('src/pages/Route/Agency/AgencyList.vue'),
},
agencyCard,
],
@ -319,7 +320,6 @@ export default {
title: 'vehicle',
icon: 'directions_car',
},
component: () => import('src/pages/Route/Vehicle/VehicleList.vue'),
children: [
{
path: 'list',
@ -328,6 +328,8 @@ export default {
title: 'vehicleList',
icon: 'directions_car',
},
component: () =>
import('src/pages/Route/Vehicle/VehicleList.vue'),
},
vehicleCard,
],

View File

@ -2,7 +2,7 @@
describe('ParkingList', () => {
const searchbar = '#searchbar input';
const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
const summaryHeader = '.summaryBody .header';
const summaryHeader = '.header-link';
beforeEach(() => {
cy.viewport(1920, 1080);

View File

@ -16,8 +16,8 @@ describe('ShelvingList', () => {
it('should redirect from preview to basic-data', () => {
cy.typeSearchbar('{enter}');
cy.dataCy('cardBtn').eq(0).click();
cy.get('.q-card > .header').click();
cy.url().should('include', '/shelving/1/basic-data');
cy.get('.summaryHeader > .header > .q-icon').click();
cy.url().should('include', '/shelving/1/summary');
});
it('should filter and redirect if only one result', () => {