feat: refs #6475 open descriptor proxy an show summary dialog button
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Pablo Natek 2023-12-11 06:35:54 +01:00
parent fd1f46ffc6
commit 1c3fc57e3d
6 changed files with 34 additions and 51 deletions

View File

@ -7,6 +7,7 @@ import { useState } from 'src/composables/useState';
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
@ -113,7 +114,7 @@ const setData = (entity) => {
<template #value>
<span class="link">
{{ entity.worker.user.name }}
<WorkerDescriptorProxy :id="entity.worker.userFk" />
<WorkerDescriptorProxy :id="entity.worker.user.id" />
</span>
</template>
</VnLv>
@ -121,7 +122,7 @@ const setData = (entity) => {
<template #value>
<span class="link">
{{ entity.client.salesPersonUser.name }}
<WorkerDescriptorProxy :id="entity.client.salesPersonFk" />
<CustomerDescriptorProxy :id="entity.client.salesPersonFk" />
</span>
</template>
</VnLv>

View File

@ -10,8 +10,8 @@ import ClaimFilter from './ClaimFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
import ClaimSummaryDialog from './Card/ClaimSummaryDialog.vue';
import WorkerSummaryDialog from 'src/pages/Worker/Card/WorkerSummaryDialog.vue';
import CustomerSummaryDialog from 'src/pages/Customer/Card/CustomerSummaryDialog.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
const stateStore = useStateStore();
const router = useRouter();
@ -28,25 +28,18 @@ function navigate(id) {
router.push({ path: `/claim/${id}` });
}
function viewSummary(id, summaryDialog) {
let dialogComponent;
switch (summaryDialog) {
case 'worker':
dialogComponent = WorkerSummaryDialog;
break;
case 'customer':
dialogComponent = CustomerSummaryDialog;
break;
case 'claim':
dialogComponent = ClaimSummaryDialog;
break;
default:
return;
}
function viewSummary(id) {
quasar.dialog({
component: dialogComponent,
component: ClaimSummaryDialog,
componentProps: {
id,
},
});
}
function viewDescriptor(id) {
quasar.dialog({
component: CustomerDescriptorProxy,
componentProps: {
id,
},
@ -101,23 +94,19 @@ function viewSummary(id, summaryDialog) {
>
<template #list-items>
<VnLv label="ID" :value="row.id" />
<VnLv
:label="t('claim.list.customer')"
@click.stop="viewSummary(row.clientFk, 'customer')"
>
<VnLv :label="t('claim.list.customer')" @click.stop>
<template #value>
<span class="link">
{{ row.clientName }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('claim.list.assignedTo')"
@click.stop="viewSummary(row.workerFk, 'worker')"
>
<VnLv :label="t('claim.list.assignedTo')" @click.stop>
<template #value>
<span class="link">
{{ row.workerName }}
<WorkerDescriptorProxy :id="row.workerFk" />
</span>
</template>
</VnLv>
@ -147,11 +136,7 @@ function viewSummary(id, summaryDialog) {
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
icon="preview"
@click.stop="viewSummary(row.id, 'claim')"
>
<QBtn flat icon="preview" @click.stop="viewSummary(row.id)">
<QTooltip>
{{ t('components.smartCard.openSummary') }}
</QTooltip>

View File

@ -9,6 +9,7 @@ const $props = defineProps({
},
});
</script>
<template>
<QPopupProxy>
<CustomerDescriptor

View File

@ -12,6 +12,10 @@ const $props = defineProps({
required: false,
default: null,
},
summary: {
type: Object,
default: null,
},
});
const route = useRoute();
@ -51,7 +55,7 @@ const sip = computed(() => worker.value.sip && worker.value.sip.extension);
function getWorkerAvatar() {
const token = getToken();
return `/api/Images/user/160x160/${route.params.id}/download?access_token=${token}`;
return `/api/Images/user/160x160/${entityId.value}/download?access_token=${token}`;
}
const data = ref(useCardDescription());
const setData = (entity) =>
@ -64,6 +68,7 @@ const setData = (entity) =>
:filter="filter"
:title="data.title"
:subtitle="data.subtitle"
:summary="$props.summary"
@on-fetch="
(data) => {
worker = data;

View File

@ -1,5 +1,6 @@
<script setup>
import WorkerDescriptor from './WorkerDescriptor.vue';
import WorkerSummaryDialog from './WorkerSummaryDialog.vue';
const $props = defineProps({
id: {
@ -11,6 +12,10 @@ const $props = defineProps({
<template>
<QPopupProxy>
<WorkerDescriptor v-if="$props.id" :id="$props.id" />
<WorkerDescriptor
v-if="$props.id"
:id="$props.id"
:summary="WorkerSummaryDialog"
/>
</QPopupProxy>
</template>

View File

@ -17,18 +17,4 @@ describe('TicketBoxing', () => {
cy.get('div[class="q-item__label text-h6"]').eq(0).click();
cy.get('.q-notification__message').should('have.text', 'No videos available');
});
it('should show select time and video if have video list', () => {
cy.intercept(
{
method: 'GET',
url: '/api/Boxings/*',
},
['2022-01-01T01-01-00.mp4', '2022-02-02T02-02-00.mp4', '2022-03-03T03-03-00.mp4']
).as('getVideoList');
cy.get('.q-list').eq(3).find('.q-item').eq(2).click();
cy.get('.q-list').eq(3).find('.q-item').eq(0).find('.q-range');
cy.get('.q-list').eq(3).find('.q-item').eq(1).find('.q-select');
});
});