Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-12-09 11:37:52 +00:00
commit f16c45b01a
12 changed files with 135 additions and 27 deletions

6
Jenkinsfile vendored
View File

@ -4,7 +4,8 @@ def PROTECTED_BRANCH
def BRANCH_ENV = [ def BRANCH_ENV = [
test: 'test', test: 'test',
master: 'production' master: 'production',
beta: 'production'
] ]
node { node {
@ -15,7 +16,8 @@ node {
PROTECTED_BRANCH = [ PROTECTED_BRANCH = [
'dev', 'dev',
'test', 'test',
'master' 'master',
'beta'
].contains(env.BRANCH_NAME) ].contains(env.BRANCH_NAME)
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables

View File

@ -2,7 +2,7 @@
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import VnSelectDialog from 'components/common/VnSelectDialog.vue'; import VnSelectDialog from 'components/common/VnSelectDialog.vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { ref } from 'vue'; import { computed } from 'vue';
import { useAttrs } from 'vue'; import { useAttrs } from 'vue';
import { useRequired } from 'src/composables/useRequired'; import { useRequired } from 'src/composables/useRequired';
const { t } = useI18n(); const { t } = useI18n();
@ -43,7 +43,7 @@ const formatLocation = (obj, properties) => {
return filteredParts.join(', '); return filteredParts.join(', ');
}; };
const modelValue = ref( const modelValue = computed(() =>
props.location ? formatLocation(props.location, locationProperties) : null props.location ? formatLocation(props.location, locationProperties) : null
); );

View File

@ -78,7 +78,7 @@ const userParams = ref({});
defineExpose({ search, sanitizer, params: userParams }); defineExpose({ search, sanitizer, params: userParams });
onMounted(() => { onMounted(() => {
userParams.value = $props.modelValue ?? {}; if (!userParams.value) userParams.value = $props.modelValue ?? {};
emit('init', { params: userParams.value }); emit('init', { params: userParams.value });
}); });
@ -104,7 +104,8 @@ watch(
watch( watch(
() => arrayData.store.userParams, () => arrayData.store.userParams,
(val, oldValue) => (val || oldValue) && setUserParams(val) (val, oldValue) => (val || oldValue) && setUserParams(val),
{ immediate: true }
); );
watch( watch(

View File

@ -331,6 +331,7 @@ globals:
fi: FI fi: FI
myTeam: My team myTeam: My team
departmentFk: Department departmentFk: Department
countryFk: Country
changePass: Change password changePass: Change password
deleteConfirmTitle: Delete selected elements deleteConfirmTitle: Delete selected elements
changeState: Change state changeState: Change state

View File

@ -335,6 +335,7 @@ globals:
SSN: NSS SSN: NSS
fi: NIF fi: NIF
myTeam: Mi equipo myTeam: Mi equipo
countryFk: País
changePass: Cambiar contraseña changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado changeState: Cambiar estado

View File

@ -7,6 +7,7 @@ import AccountSummary from './Card/AccountSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import AccountFilter from './AccountFilter.vue'; import AccountFilter from './AccountFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue'; import RightMenu from 'src/components/common/RightMenu.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const tableRef = ref(); const tableRef = ref();
@ -22,10 +23,27 @@ const columns = computed(() => [
field: 'id', field: 'id',
cardVisible: true, cardVisible: true,
}, },
{
align: 'left',
name: 'name',
label: t('Name'),
component: 'input',
columnField: {
component: null,
},
cardVisible: true,
create: true,
},
{ {
align: 'left', align: 'left',
name: 'roleFk', name: 'roleFk',
label: t('role'), label: t('Role'),
component: 'select',
attrs: {
url: 'VnRoles',
optionValue: 'id',
optionLabel: 'name',
},
columnFilter: { columnFilter: {
component: 'select', component: 'select',
name: 'roleFk', name: 'roleFk',
@ -35,7 +53,11 @@ const columns = computed(() => [
optionLabel: 'name', optionLabel: 'name',
}, },
}, },
columnField: {
component: null,
},
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name), format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
create: true,
}, },
{ {
align: 'left', align: 'left',
@ -51,20 +73,32 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'name', name: 'email',
label: t('Name'), label: t('Email'),
component: 'input', component: 'input',
columnField: { columnField: {
component: null, component: null,
}, },
cardVisible: true,
create: true, create: true,
visible: false,
}, },
{ {
align: 'left', align: 'left',
name: 'email', name: 'password',
label: t('email'), label: t('Password'),
component: 'input', columnField: {
component: null,
},
attrs: {},
required: true,
visible: false,
},
{
align: 'left',
name: 'active',
label: t('Active'),
component: 'checkbox',
create: true, create: true,
visible: false, visible: false,
}, },
@ -101,7 +135,6 @@ const exprBuilder = (param, value) => {
} }
}; };
</script> </script>
<template> <template>
<VnSearchbar <VnSearchbar
data-key="AccountList" data-key="AccountList"
@ -119,6 +152,12 @@ const exprBuilder = (param, value) => {
ref="tableRef" ref="tableRef"
data-key="AccountList" data-key="AccountList"
url="VnUsers/preview" url="VnUsers/preview"
:create="{
urlCreate: 'VnUsers',
title: t('Create user'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
:filter="filter" :filter="filter"
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
@ -127,7 +166,19 @@ const exprBuilder = (param, value) => {
:use-model="true" :use-model="true"
:right-search="false" :right-search="false"
auto-load auto-load
>
<template #more-create-dialog="{ data }">
<QCardSection>
<VnInput
:label="t('Password')"
v-model="data.password"
type="password"
:required="true"
autocomplete="new-password"
/> />
</QCardSection>
</template>
</VnTable>
</template> </template>
<i18n> <i18n>
@ -135,4 +186,7 @@ const exprBuilder = (param, value) => {
Id: Id Id: Id
Nickname: Nickname Nickname: Nickname
Name: Nombre Name: Nombre
Password: Contraseña
Active: Activo
Role: Rol
</i18n> </i18n>

View File

@ -29,7 +29,8 @@ async function hasCustomerRole() {
:filter="filter" :filter="filter"
model="customer" model="customer"
:mapper=" :mapper="
({ active, name, email }) => { ({ account }) => {
const { name, email, active } = account;
return { return {
active, active,
name, name,

View File

@ -52,7 +52,9 @@ const columns = computed(() => [
label: t('invoiceOutList.tableVisibleColumns.id'), label: t('invoiceOutList.tableVisibleColumns.id'),
chip: { condition: () => true }, chip: { condition: () => true },
isId: true, isId: true,
columnFilter: { name: 'search' }, columnFilter: {
name: 'id',
},
}, },
{ {
align: 'left', align: 'left',
@ -84,8 +86,15 @@ const columns = computed(() => [
label: t('globals.client'), label: t('globals.client'),
cardVisible: true, cardVisible: true,
component: 'select', component: 'select',
attrs: { url: 'Clients', fields: ['id', 'name'] }, attrs: {
columnField: { component: null }, url: 'Clients',
fields: ['id', 'socialName'],
optionLabel: 'socialName',
optionValue: 'id',
},
columnField: {
component: null,
},
}, },
{ {
align: 'left', align: 'left',

View File

@ -59,7 +59,11 @@ const getLocale = (label) => {
</template> </template>
<template #customTags="{ params, searchFn, formatFn }"> <template #customTags="{ params, searchFn, formatFn }">
<VnFilterPanelChip <VnFilterPanelChip
v-if="params.scopeDays !== null" v-if="
params.scopeDays !== undefined ||
params.scopeDays !== '' ||
params.scopeDays !== null
"
removable removable
@remove="handleScopeDays(params, null, searchFn)" @remove="handleScopeDays(params, null, searchFn)"
> >
@ -197,6 +201,18 @@ const getLocale = (label) => {
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem>
<QItemSection>
<VnSelect
outlined
dense
rounded
:label="t('globals.params.countryFk')"
v-model="params.countryFk"
url="Countries"
/>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnSelect <VnSelect

View File

@ -770,7 +770,7 @@ watch(
</template> </template>
<template #column-item="{ row }"> <template #column-item="{ row }">
<div class="row column full-width justify-between items-start"> <div class="row column full-width justify-between items-start">
{{ row?.item?.name }} {{ row?.concept }}
<div v-if="row?.item?.subName" class="subName"> <div v-if="row?.item?.subName" class="subName">
{{ row?.item?.subName.toUpperCase() }} {{ row?.item?.subName.toUpperCase() }}
</div> </div>

View File

@ -57,7 +57,7 @@ const travelKgPercentages = ref([]);
const tableColumnComponents = { const tableColumnComponents = {
id: { id: {
component: QBtn, component: QBtn,
attrs: { flat: true, color: 'primary' }, attrs: { flat: true, color: 'primary', dense: true },
}, },
cargoSupplierNickname: { cargoSupplierNickname: {
component: QBtn, component: QBtn,
@ -178,6 +178,7 @@ const columns = computed(() => [
align: 'left', align: 'left',
showValue: false, showValue: false,
sortable: true, sortable: true,
style: 'min-width: 170px;',
}, },
{ {
label: t('globals.packages'), label: t('globals.packages'),
@ -237,7 +238,7 @@ const columns = computed(() => [
format: (value) => toDate(value), format: (value) => toDate(value),
}, },
{ {
label: t('globals.wareHhuseIn'), label: t('globals.warehouseIn'),
field: 'warehouseInName', field: 'warehouseInName',
name: 'warehouseInName', name: 'warehouseInName',
align: 'left', align: 'left',
@ -506,7 +507,7 @@ const getColor = (percentage) => {
:key="col.name" :key="col.name"
:props="props" :props="props"
@click="stopEventPropagation($event, col)" @click="stopEventPropagation($event, col)"
auto-width :style="col.style"
> >
<component <component
:is="tableColumnComponents[col.name].component" :is="tableColumnComponents[col.name].component"
@ -581,7 +582,7 @@ const getColor = (percentage) => {
}" }"
> >
<QTd> <QTd>
<QBtn flat class="link">{{ entry.id }} </QBtn> <QBtn dense flat class="link">{{ entry.id }} </QBtn>
<EntryDescriptorProxy :id="entry.id" /> <EntryDescriptorProxy :id="entry.id" />
</QTd> </QTd>
<QTd> <QTd>
@ -637,6 +638,18 @@ const getColor = (percentage) => {
:deep(.q-table) { :deep(.q-table) {
border-collapse: collapse; border-collapse: collapse;
th {
padding: 0;
}
tbody tr td {
&:nth-child(1) {
max-width: 65px;
}
&:nth-child(4) {
padding: 0;
}
}
} }
.q-td :deep(input) { .q-td :deep(input) {
@ -684,7 +697,6 @@ const getColor = (percentage) => {
width: max-content; width: max-content;
} }
</style> </style>
<i18n> <i18n>
en: en:
searchExtraCommunity: Search for extra community shipping searchExtraCommunity: Search for extra community shipping

View File

@ -44,7 +44,18 @@ vi.mock('vue-router', () => ({
vi.mock('axios'); vi.mock('axios');
vi.spyOn(useValidator, 'useValidator').mockImplementation(() => { vi.spyOn(useValidator, 'useValidator').mockImplementation(() => {
return { validate: vi.fn() }; return {
validate: vi.fn(),
validations: () => ({
format: vi.fn(),
presence: vi.fn(),
required: vi.fn(),
length: vi.fn(),
numericality: vi.fn(),
min: vi.fn(),
custom: vi.fn(),
}),
};
}); });
class FormDataMock { class FormDataMock {