0
0
Fork 0

Merge branch 'dev' into 6325-tasaClaim

This commit is contained in:
Carlos Satorres 2024-01-12 07:47:39 +00:00
commit bcc35ca0e7
7 changed files with 66 additions and 44 deletions

View File

@ -168,17 +168,17 @@ function getLogTree(data) {
let originLog = null; let originLog = null;
let userLog = null; let userLog = null;
let modelLog = null; let modelLog = null;
let prevLog;
let nLogs; let nLogs;
data.forEach((log) => { for (let i = 0; i < data.length; i++) {
let log = data[i];
let prevLog = i > 0 ? data[i - 1] : null;
const locale = validations[log.changedModel]?.locale || {}; const locale = validations[log.changedModel]?.locale || {};
// Origin // Origin
const originChanged = !prevLog || log.originFk != prevLog.originFk; const originChanged = !prevLog || log.originFk != prevLog.originFk;
if (originChanged) { if (originChanged) {
logs.push((originLog = { originFk: log.originFk, logs: [] })); logs.push((originLog = { originFk: log.originFk, logs: [] }));
prevLog = log;
} }
// User // User
const userChanged = originChanged || log.userFk != prevLog.userFk; const userChanged = originChanged || log.userFk != prevLog.userFk;
@ -197,6 +197,7 @@ function getLogTree(data) {
log.changedModel != prevLog.changedModel || log.changedModel != prevLog.changedModel ||
log.changedModelId != prevLog.changedModelId || log.changedModelId != prevLog.changedModelId ||
nLogs >= 6; nLogs >= 6;
if (modelChanged) { if (modelChanged) {
userLog.logs.push( userLog.logs.push(
(modelLog = { (modelLog = {
@ -221,7 +222,7 @@ function getLogTree(data) {
propNames = [...new Set(propNames)]; propNames = [...new Set(propNames)];
log.props = parseProps(propNames, locale, vals, olds); log.props = parseProps(propNames, locale, vals, olds);
}); }
return logs; return logs;
} }
@ -320,7 +321,6 @@ function selectFilter(type, dateType) {
} }
if (type === 'action' && selectedFilters.value.changedModel === null) { if (type === 'action' && selectedFilters.value.changedModel === null) {
selectedFilters.value.changedModel = undefined; selectedFilters.value.changedModel = undefined;
reload = false;
} }
if (type === 'userRadio') { if (type === 'userRadio') {
selectedFilters.value.userFk = userRadio.value; selectedFilters.value.userFk = userRadio.value;
@ -415,18 +415,19 @@ setLogTree();
<div class="line bg-grey"></div> <div class="line bg-grey"></div>
</QItem> </QItem>
<div <div
class="user-log q-mb-sm row" class="user-log q-mb-sm"
v-for="(userLog, userIndex) in originLog.logs" v-for="(userLog, userIndex) in originLog.logs"
:key="userIndex" :key="userIndex"
> >
<div class="timeline"> <div class="timeline">
<div class="user-avatar"> <div class="user-avatar">
<VnUserLink v-if="userLog.user.image" :worker-id="userLog.user.id"> <VnUserLink :worker-id="userLog.user.id">
<template #link> <template #link>
<VnAvatar <VnAvatar
:class="{ 'cursor-pointer': userLog.user.id }" :class="{ 'cursor-pointer': userLog.user.id }"
:worker-id="userLog.user.id" :worker-id="userLog.user.id"
:title="userLog.user.nickname" :title="userLog.user.nickname"
size="lg"
/> />
</template> </template>
</VnUserLink> </VnUserLink>
@ -665,7 +666,6 @@ setLogTree();
option-label="locale" option-label="locale"
:options="actions" :options="actions"
@update:model-value="selectFilter('action')" @update:model-value="selectFilter('action')"
@clear="() => selectFilter('action')"
hide-selected hide-selected
/> />
</QItem> </QItem>
@ -823,14 +823,30 @@ setLogTree();
.q-item { .q-item {
min-height: 0px; min-height: 0px;
} }
.q-menu {
display: block;
& > .loading {
display: flex;
justify-content: center;
}
& > .q-card {
min-width: 180px;
max-width: 400px;
& > .header {
color: $dark;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.origin-log { .origin-log {
&:first-child > .origin-info { &:first-child > .origin-info {
margin-top: 0; margin-top: 0;
} }
& > .origin-info { & > .origin-info {
width: 100%;
max-width: 42em;
margin-top: 28px; margin-top: 28px;
gap: 6px; gap: 6px;
@ -847,14 +863,15 @@ setLogTree();
} }
} }
.user-log { .user-log {
display: flex;
width: 100%; width: 100%;
max-width: 40em; max-width: 40em;
& > .timeline { & > .timeline {
position: relative; position: relative;
padding-right: 5px; padding-right: 1px;
width: 50px; width: 38px;
min-width: 38px; min-width: 38px;
flex-grow: auto;
& > .arrow { & > .arrow {
height: 8px; height: 8px;
width: 8px; width: 8px;
@ -874,7 +891,7 @@ setLogTree();
position: absolute; position: absolute;
background-color: $primary; background-color: $primary;
width: 2px; width: 2px;
left: 23px; left: 19px;
z-index: -1; z-index: -1;
top: 0; top: 0;
bottom: -8px; bottom: -8px;
@ -893,6 +910,7 @@ setLogTree();
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
min-height: 22px;
.model-value { .model-value {
font-style: italic; font-style: italic;
} }
@ -984,25 +1002,6 @@ setLogTree();
} }
} }
} }
.q-menu {
display: block;
& > .loading {
display: flex;
justify-content: center;
}
& > .q-card {
min-width: 180px;
max-width: 400px;
& > .header {
color: $dark;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
</style> </style>
<i18n> <i18n>
en: en:

View File

@ -1,8 +1,7 @@
<script setup> <script setup>
import { onMounted, useSlots, ref, watch, computed } from 'vue'; import { onMounted, useSlots, watch, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import axios from 'axios';
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';

View File

@ -1,19 +1,37 @@
<script setup> <script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { useColor } from 'src/composables/useColor';
const $props = defineProps({ const $props = defineProps({
workerId: { type: Number, required: true }, workerId: { type: Number, required: true },
description: { type: String, default: null }, description: { type: String, default: null },
size: { type: String, default: null },
title: { type: String, default: null },
}); });
const session = useSession(); const session = useSession();
const token = session.getToken(); const token = session.getToken();
const { t } = useI18n();
const title = computed(() => $props.title ?? t('globals.system'));
const showLetter = ref(false);
</script> </script>
<template> <template>
<div class="avatar-picture column items-center"> <div class="avatar-picture column items-center">
<QAvatar color="orange"> <QAvatar
:style="{
backgroundColor: useColor(title),
}"
:size="$props.size"
:title="title"
>
<template v-if="showLetter">{{ title.charAt(0) }}</template>
<QImg <QImg
v-else
:src="`/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`" :src="`/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`"
spinner-color="white" spinner-color="white"
@error="showLetter = true"
/> />
</QAvatar> </QAvatar>
<div class="description"> <div class="description">

View File

@ -89,18 +89,20 @@ function viewSummary(id) {
<template #list-items> <template #list-items>
<VnLv :label="t('claim.list.customer')" @click.stop> <VnLv :label="t('claim.list.customer')" @click.stop>
<template #value> <template #value>
<span class="link"> <span class="link" @click.stop>
{{ row.clientName }} {{ row.clientName }}
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</span> </span>
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('claim.list.assignedTo')" @click.stop> <VnLv :label="t('claim.list.assignedTo')">
<template #value> <template #value>
<span @click.stop>
<VnUserLink <VnUserLink
:name="row.workerName" :name="row.workerName"
:worker-id="row.workerFk" :worker-id="row.workerFk"
/> />
</span>
</template> </template>
</VnLv> </VnLv>
<VnLv <VnLv

View File

@ -76,7 +76,6 @@ function viewSummary(id) {
data-key="InvoiceInList" data-key="InvoiceInList"
url="InvoiceIns/filter" url="InvoiceIns/filter"
order="issued DESC, id DESC" order="issued DESC, id DESC"
auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<CardList <CardList

View File

@ -9,6 +9,7 @@ describe('InvoiceInList', () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/invoice-in`); cy.visit(`/#/invoice-in`);
cy.clickFilterSearchBtn();
}); });
it('should redirect on clicking a invoice', () => { it('should redirect on clicking a invoice', () => {

View File

@ -183,4 +183,8 @@ Cypress.Commands.add('writeSearchbar', (value) => {
Cypress.Commands.add('validateContent', (selector, expectedValue) => { Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue); cy.get(selector).should('have.text', expectedValue);
}); });
Cypress.Commands.add('clickFilterSearchBtn', () => {
cy.get('.q-item__section > .q-btn > .q-btn__content > .q-icon').click();
});
// registerCommands(); // registerCommands();