Compare commits

..

32 Commits

Author SHA1 Message Date
Jose Antonio Tubau d943529f75 refactor: refs #6683 remove 'only' from Worker pop-ups test suite to include all tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-14 09:37:09 +02:00
Jose Antonio Tubau 601b8d8d64 fix: refs #6683 add search-url to VnDmsList for proper worker link redirection
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-14 09:35:23 +02:00
Jose Antonio Tubau 5527a7fea8 refactor: refs #6683 update dmsType field and add formatting for date in VnDmsList
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-14 09:09:59 +02:00
Jose Antonio Tubau 49218511d9 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6683-createPropertiesSection 2025-04-14 09:08:05 +02:00
Jose Antonio Tubau 80d56a5468 fix: refs #6683 add formatting for user name in DMS columns
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 14:40:01 +02:00
Jose Antonio Tubau db3d17179e Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6683-createPropertiesSection 2025-04-11 14:39:15 +02:00
Jose Antonio Tubau 36fa2c72e0 refactor: refs #6683 remove search function calls from property filter inputs
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-11 14:14:24 +02:00
Jose Antonio Tubau 0ea9381287 chore: refs #6683 add general search parameter to property locale files in English and Spanish
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-08 08:57:51 +02:00
Jose Antonio Tubau a2fdd6820c feat: refs #6683 add notary selection and related functionality to property filter and list
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-08 08:08:15 +02:00
Jose Antonio Tubau 561b607163 refactor: refs #6683 add notary information to property descriptor and summary; update translations and tests
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-07 14:59:03 +02:00
Jose Antonio Tubau bcf5750619 test: refs #6683 add Cypress tests for property basic data and summary; update DMS and list tests
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-07 13:51:57 +02:00
Jose Antonio Tubau 46826b6b95 test: refs #6683 add Cypress integration tests for property DMS, list, and notes
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-02 14:14:07 +02:00
Jose Antonio Tubau 5690ab7ce1 Merge branch 'dev' into 6683-createPropertiesSection
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-02 12:42:25 +02:00
Jose Antonio Tubau 1fc0e4d958 test: refs #6683 add Cypress integration tests files for property section
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-02 12:10:21 +02:00
Jose Antonio Tubau 2bfa8368ab chore: refs #6683 update icon for property route to use 'apartment' 2025-04-02 12:09:54 +02:00
Jose Antonio Tubau 56c1373b8e feat: refs #6683 add createForm 2025-04-02 12:09:35 +02:00
Jose Antonio Tubau c4b76b465e refactor: refs #6683 update PropertySummary component to improve code readability and add copy functionality
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-02 10:17:18 +02:00
Jose Antonio Tubau 105e95e68a refactor: refs #6683 update PropertyList component to enhance checkbox visibility and organization 2025-04-02 10:17:13 +02:00
Jose Antonio Tubau 223890a1bc feat: refs #6683 add search functionality to PropertyFilter inputs 2025-04-02 10:17:04 +02:00
Jose Antonio Tubau bf6d4f0c5f feat: refs #6683 add localization for document management features in English and Spanish 2025-04-02 10:16:45 +02:00
Jose Antonio Tubau c34af4d888 refactor: refs #6683 update Property components for improved data handling and display
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-02 08:55:13 +02:00
Jose Antonio Tubau a4be25c24e Merge branch 'dev' into 6683-createPropertiesSection
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-01 15:15:47 +02:00
Jose Antonio Tubau c4a95c8d4e feat: refs #6683 add localization for Property pages in English and Spanish
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-01 15:10:43 +02:00
Jose Antonio Tubau 23c42ba33c feat: refs #6683 add PropertyLog and PropertyNotes components 2025-04-01 15:10:38 +02:00
Jose Antonio Tubau 37cf083b7a feat: refs #6683 add PropertyDms and PropertyDmsImportForm components 2025-04-01 15:10:19 +02:00
Jose Antonio Tubau 56ce26223f feat: refs #6683 add PropertyFilter component for advanced property filtering options 2025-04-01 15:09:57 +02:00
Jose Antonio Tubau c0c8500063 feat: refs #6683 add PropertyList component for displaying list of properties with filters 2025-04-01 15:09:50 +02:00
Jose Antonio Tubau c6b9b3646f feat: refs #6683 add PropertySummary component for detailed property overview 2025-04-01 15:09:39 +02:00
Jose Antonio Tubau 5847734ef7 feat: refs #6683 add PropertyBasicData component for property details form 2025-04-01 15:09:32 +02:00
Jose Antonio Tubau 5619e9c2ca feat: refs #6683 add PropertyDescriptor component for enhanced property details display 2025-04-01 15:09:11 +02:00
Jose Antonio Tubau 70298cb96a feat: refs #6683 add PropertyCard component for displaying property details 2025-04-01 15:09:00 +02:00
Jose Antonio Tubau 3c467c8c0e feat: refs #6683 add property module and routes to navigation 2025-04-01 15:08:01 +02:00
64 changed files with 2134 additions and 426 deletions

View File

@ -1,6 +1,6 @@
{
"name": "salix-front",
"version": "25.18.0",
"version": "25.16.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",

View File

@ -2,7 +2,6 @@
import { onMounted } from 'vue';
import { useQuasar, Dark } from 'quasar';
import { useI18n } from 'vue-i18n';
import VnScroll from './components/common/VnScroll.vue';
const quasar = useQuasar();
const { availableLocales, locale, fallbackLocale } = useI18n();
@ -39,7 +38,6 @@ quasar.iconMapFn = (iconName) => {
<template>
<RouterView />
<VnScroll/>
</template>
<style lang="scss">

View File

@ -406,7 +406,6 @@ defineExpose({
</QBtnDropdown>
<QBtn
v-else
data-cy="saveDefaultBtn"
:label="tMobile('globals.save')"
color="primary"
icon="save"

View File

@ -69,7 +69,7 @@ const refresh = () => window.location.reload();
'no-visible': !stateQuery.isLoading().value,
}"
size="sm"
data-cy="navBar-spinner"
data-cy="loading-spinner"
/>
<QSpace />
<div id="searchbar" class="searchbar"></div>

View File

@ -33,7 +33,6 @@ import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
import VnTableFilter from './VnTableFilter.vue';
import { getColAlign } from 'src/composables/getColAlign';
import RightMenu from '../common/RightMenu.vue';
import VnScroll from '../common/VnScroll.vue'
const arrayData = useArrayData(useAttrs()['data-key']);
const $props = defineProps({
@ -169,7 +168,6 @@ const params = ref(useFilterParams($attrs['data-key']).params);
const orders = ref(useFilterParams($attrs['data-key']).orders);
const app = inject('app');
const tableHeight = useTableHeight();
const vnScrollRef = ref(null);
const editingRow = ref(null);
const editingField = ref(null);
@ -191,17 +189,6 @@ const tableModes = [
},
];
const onVirtualScroll = ({ to }) => {
handleScroll();
const virtualScrollContainer = tableRef.value?.$el?.querySelector('.q-table__middle');
if (virtualScrollContainer) {
virtualScrollContainer.dispatchEvent(new CustomEvent('scroll'));
if (vnScrollRef.value) {
vnScrollRef.value.updateScrollContainer(virtualScrollContainer);
}
}
};
onBeforeMount(() => {
const urlParams = route.query[$props.searchUrl];
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
@ -340,13 +327,16 @@ function handleOnDataSaved(_) {
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
else $props.create.onDataSaved(_);
}
function handleScroll() {
if ($props.crudModel.disableInfiniteScroll) return;
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
}
function handleSelection({ evt, added, rows: selectedRows }, rows) {
if (evt?.shiftKey && added) {
const rowIndex = selectedRows[0].$index;
@ -679,9 +669,9 @@ const rowCtrlClickFunction = computed(() => {
ref="tableRef"
v-bind="table"
:class="[
'vnTable',
table ? 'selection-cell' : '',
$props.footer ? 'last-row-sticky' : '',
'vnTable',
table ? 'selection-cell' : '',
$props.footer ? 'last-row-sticky' : '',
]"
wrap-cells
:columns="splittedColumns.columns"
@ -693,7 +683,7 @@ const rowCtrlClickFunction = computed(() => {
flat
:style="isTableMode && `max-height: ${$props.tableHeight || tableHeight}`"
:virtual-scroll="isTableMode"
@virtual-scroll="onVirtualScroll"
@virtual-scroll="handleScroll"
@row-click="(event, row) => handleRowClick(event, row)"
@update:selected="emit('update:selected', $event)"
@selection="(details) => handleSelection(details, rows)"
@ -751,7 +741,6 @@ const rowCtrlClickFunction = computed(() => {
withFilters
"
:column="col"
:data-cy="`column-filter-${col.name}`"
:show-title="true"
:data-key="$attrs['data-key']"
v-model="params[columnName(col)]"
@ -1098,11 +1087,6 @@ const rowCtrlClickFunction = computed(() => {
</template>
</FormModelPopup>
</QDialog>
<VnScroll
ref="vnScrollRef"
v-if="isTableMode"
:scroll-target="tableRef?.$el?.querySelector('.q-table__middle')"
/>
</template>
<i18n>
en:

View File

@ -13,6 +13,7 @@ import VnDms from 'src/components/common/VnDms.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import { useSession } from 'src/composables/useSession';
import { toDate } from 'src/filters/index';
const route = useRoute();
const quasar = useQuasar();
@ -118,7 +119,7 @@ const columns = computed(() => [
},
{
align: 'left',
field: 'type',
field: 'dmsType',
label: t('globals.type'),
name: 'type',
component: QInput,
@ -127,6 +128,7 @@ const columns = computed(() => [
borderless: true,
'model-value': prop.row.dmsType?.name,
}),
format: (row) => row.name,
},
{
align: 'left',
@ -172,6 +174,7 @@ const columns = computed(() => [
name: prop.row.worker?.user?.name.toLowerCase(),
workerId: prop.row.worker?.id,
}),
format: (row) => row?.user?.name,
},
{
align: 'left',
@ -183,6 +186,7 @@ const columns = computed(() => [
disable: true,
'model-value': prop.row.created,
}),
format: (row) => toDate(row),
},
{
field: 'options',
@ -298,6 +302,7 @@ defineExpose({
:data-key="$props.model"
:url="$props.model"
:user-filter="dmsFilter"
search-url="dmsFilter"
:order="['dmsFk DESC']"
auto-load
@on-fetch="setData"

View File

@ -1,100 +0,0 @@
<script setup>
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
const props = defineProps({
scrollTarget: { type: [String, Object], default: 'window' }
});
const scrollPosition = ref(0);
const showButton = ref(false);
let scrollContainer = null;
const onScroll = () => {
if (!scrollContainer) return;
scrollPosition.value =
typeof props.scrollTarget === 'object'
? scrollContainer.scrollTop
: window.scrollY;
};
watch(scrollPosition, (newValue) => {
showButton.value = newValue > 0;
});
const scrollToTop = () => {
if (scrollContainer) {
scrollContainer.scrollTo({ top: 0, behavior: 'smooth' });
}
};
const updateScrollContainer = (container) => {
if (container) {
if (scrollContainer) {
scrollContainer.removeEventListener('scroll', onScroll);
}
scrollContainer = container;
scrollContainer.addEventListener('scroll', onScroll);
onScroll();
}
};
defineExpose({
updateScrollContainer
});
const initScrollContainer = async () => {
await nextTick();
if (typeof props.scrollTarget === 'object') {
scrollContainer = props.scrollTarget;
} else {
scrollContainer = window;
}
if (!scrollContainer) return
scrollContainer.addEventListener('scroll', onScroll);
};
onMounted(() => {
initScrollContainer();
});
onUnmounted(() => {
if (scrollContainer) {
scrollContainer.removeEventListener('scroll', onScroll);
scrollContainer = null;
}
});
</script>
<template>
<QIcon
v-if="showButton"
color="primary"
name="keyboard_arrow_up"
class="scroll-to-top"
@click="scrollToTop"
>
<QTooltip>{{ $t('globals.scrollToTop') }}</QTooltip>
</QIcon>
</template>
<style scoped>
.scroll-to-top {
position: fixed;
top: 70px;
font-size: 65px;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
transition: transform 0.2s ease-in-out;
}
.scroll-to-top:hover {
transform: translateX(-50%) scale(1.2);
cursor: pointer;
filter: brightness(0.8);
}
</style>

View File

@ -232,7 +232,7 @@ fr:
pt: Portugais
pt:
Send SMS: Enviar SMS
CustomerDefaultLanguage: Este cliente utiliza o {locale} como seu idioma padrão
CustomerDefaultLanguage: Este cliente utiliza o <strong>{locale}</strong> como seu idioma padrão
Language: Linguagem
Phone: Móvel
Subject: Assunto

View File

@ -212,7 +212,6 @@ const getLocale = (label) => {
color="primary"
style="position: fixed; z-index: 1; right: 0; bottom: 0"
icon="search"
data-cy="vnFilterPanel_search"
@click="search()"
>
<QTooltip bottom anchor="bottom right">
@ -230,7 +229,6 @@ const getLocale = (label) => {
<QItemSection top side>
<QBtn
@click="clearFilters"
data-cy="clearFilters"
color="primary"
dense
flat
@ -294,7 +292,6 @@ const getLocale = (label) => {
</QList>
</QForm>
<QInnerLoading
data-cy="filterPanel-spinner"
:label="t('globals.pleaseWait')"
:showing="isLoading"
color="primary"

View File

@ -6,7 +6,6 @@ globals:
quantity: Quantity
entity: Entity
preview: Preview
scrollToTop: Go up
user: User
details: Details
collapseMenu: Collapse lateral menu
@ -161,6 +160,9 @@ globals:
department: Department
noData: No data available
vehicle: Vehicle
selectDocumentId: Select document id
import: Import from existing
document: Document
pageTitles:
logIn: Login
addressEdit: Update address
@ -342,6 +344,7 @@ globals:
parking: Parking
vehicleList: Vehicles
vehicle: Vehicle
properties: Properties
unsavedPopup:
title: Unsaved changes will be lost
subtitle: Are you sure exit without saving?
@ -390,6 +393,7 @@ errors:
updateUserConfig: Error updating user config
tokenConfig: Error fetching token config
writeRequest: The requested operation could not be completed
documentIdEmpty: The document identifier can't be empty
login:
title: Login
username: Username

View File

@ -6,7 +6,6 @@ globals:
quantity: Cantidad
entity: Entidad
preview: Vista previa
scrollToTop: Ir arriba
user: Usuario
details: Detalles
collapseMenu: Contraer menú lateral
@ -165,6 +164,9 @@ globals:
noData: Datos no disponibles
department: Departamento
vehicle: Vehículo
selectDocumentId: Introduzca id de gestión documental
import: Importar desde existente
document: Documento
pageTitles:
logIn: Inicio de sesión
addressEdit: Modificar consignatario
@ -345,6 +347,7 @@ globals:
parking: Parking
vehicleList: Vehículos
vehicle: Vehículo
properties: Propiedades
unsavedPopup:
title: Los cambios que no haya guardado se perderán
subtitle: ¿Seguro que quiere salir sin guardar?
@ -386,6 +389,7 @@ errors:
updateUserConfig: Error al actualizar la configuración de usuario
tokenConfig: Error al obtener configuración de token
writeRequest: No se pudo completar la operación solicitada
documentIdEmpty: El número de documento no puede estar vacío
login:
title: Inicio de sesión
username: Nombre de usuario

View File

@ -11,7 +11,7 @@ const $props = defineProps({
</script>
<template>
<QPopupProxy data-cy="CustomerDescriptor">
<QPopupProxy>
<CustomerDescriptor v-if="$props.id" :id="$props.id" :summary="CustomerSummary" />
</QPopupProxy>
</template>

View File

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { QBtn, useQuasar } from 'quasar';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { toDateTimeFormat } from 'src/filters/date';
import VnTable from 'src/components/VnTable/VnTable.vue';
@ -73,11 +74,12 @@ const tableRef = ref();
<template>
<VnTable
ref="tableRef"
data-key="CustomerSamples"
data-key="ClientSamples"
auto-load
:user-filter="filter"
:filter="filter"
url="ClientSamples"
:columns="columns"
:pagination="{ rowsPerPage: 12 }"
:disable-option="{ card: true }"
:right-search="false"
:rows="rows"

View File

@ -228,15 +228,11 @@ async function handleTicketConfig(data) {
url="TicketConfigs"
:filter="{ fields: ['lackAlertPrice'] }"
@on-fetch="handleTicketConfig"
></FetchData>
<QInnerLoading
:showing="isLoading"
:label="t && t('globals.pleaseWait')"
color="primary"
auto-load
/>
<VnTable
v-if="!isLoading"
v-if="ticketConfig"
auto-load
data-cy="proposalTable"
ref="proposalTableRef"

View File

@ -8,14 +8,14 @@ import VnRow from 'src/components/ui/VnRow.vue';
class="q-pa-md"
:style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }"
>
<div style="flex: 0.3" data-cy="clientsOnWebsite">
<div style="flex: 0.3">
<span
class="q-ml-md text-body1"
v-text="$t('salesMonitor.clientsOnWebsite')"
/>
<SalesClientTable />
</div>
<div style="flex: 0.7" data-cy="recentOrderActions">
<div style="flex: 0.7">
<span
class="q-ml-md text-body1"
v-text="$t('salesMonitor.recentOrderActions')"

View File

@ -9,7 +9,6 @@ import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
import { toCurrency } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
import useOpenURL from 'src/composables/useOpenURL';
const { t } = useI18n();
@ -166,7 +165,16 @@ const openTab = (id) => useOpenURL(`#/order/${id}/summary`);
</div>
</template>
<template #column-dateSend="{ row }">
<VnDateBadge :date="row.date_send" />
<QTd>
<QBadge
:color="getBadgeColor(row.date_send)"
text-color="black"
class="q-pa-sm"
style="font-size: 14px"
>
{{ toDateFormat(row.date_send) }}
</QBadge>
</QTd>
</template>
<template #column-clientFk="{ row }">

View File

@ -9,7 +9,6 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import FetchData from 'src/components/FetchData.vue';
import { dateRange } from 'src/filters';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
defineProps({ dataKey: { type: String, required: true } });
const { t, te } = useI18n();
@ -210,7 +209,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
<QCheckbox
:label="t('params.myTeam')"
v-model="params.myTeam"
toggle-indeterminate
@ -219,7 +218,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
<QCheckbox
:label="t('params.problems')"
v-model="params.problems"
toggle-indeterminate
@ -228,7 +227,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
<QCheckbox
:label="t('params.pending')"
v-model="params.pending"
toggle-indeterminate

View File

@ -1,6 +1,7 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
@ -167,11 +168,9 @@ const columns = computed(() => [
component: 'select',
name: 'provinceFk',
attrs: {
url: 'Provinces',
fields: ['id', 'name'],
sortBy: ['name ASC'],
optionValue: 'id',
optionLabel: 'name',
options: provinceOpts.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
@ -184,11 +183,9 @@ const columns = computed(() => [
component: 'select',
name: 'stateFk',
attrs: {
sortBy: ['name ASC'],
url: 'States',
fields: ['id', 'name'],
optionValue: 'id',
optionLabel: 'name',
options: stateOpts.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
@ -215,12 +212,9 @@ const columns = computed(() => [
component: 'select',
name: 'zoneFk',
attrs: {
url: 'Zones',
fields: ['id', 'name'],
sortBy: ['name ASC'],
optionValue: 'id',
optionLabel: 'name',
options: zoneOpts.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
@ -231,12 +225,11 @@ const columns = computed(() => [
align: 'left',
columnFilter: {
component: 'select',
url: 'PayMethods',
attrs: {
url: 'PayMethods',
fields: ['id', 'name'],
sortBy: ['id ASC'],
optionLabel: 'name',
options: PayMethodOpts.value,
optionValue: 'id',
optionLabel: 'name',
dense: true,
},
},
@ -261,9 +254,7 @@ const columns = computed(() => [
columnFilter: {
component: 'select',
attrs: {
url: 'Departments',
fields: ['id', 'name'],
sortBy: ['id ASC'],
options: DepartmentOpts.value,
dense: true,
},
},
@ -274,12 +265,11 @@ const columns = computed(() => [
align: 'left',
columnFilter: {
component: 'select',
url: 'ItemPackingTypes',
attrs: {
url: 'ItemPackingTypes',
fields: ['code'],
sortBy: ['code ASC'],
optionValue: 'code',
optionCode: 'code',
options: ItemPackingTypeOpts.value,
'option-value': 'code',
'option-label': 'code',
dense: true,
},
},
@ -334,6 +324,60 @@ const totalPriceColor = (ticket) => {
const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
</script>
<template>
<FetchData
url="Provinces"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
auto-load
@on-fetch="(data) => (provinceOpts = data)"
/>
<FetchData
url="States"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
auto-load
@on-fetch="(data) => (stateOpts = data)"
/>
<FetchData
url="Zones"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
auto-load
@on-fetch="(data) => (zoneOpts = data)"
/>
<FetchData
url="ItemPackingTypes"
:filter="{
fields: ['code'],
order: 'code ASC',
}"
auto-load
@on-fetch="(data) => (ItemPackingTypeOpts = data)"
/>
<FetchData
url="Departments"
:filter="{
fields: ['id', 'name'],
order: 'id ASC',
}"
auto-load
@on-fetch="(data) => (DepartmentOpts = data)"
/>
<FetchData
url="PayMethods"
:filter="{
fields: ['id', 'name'],
order: 'id ASC',
}"
auto-load
@on-fetch="(data) => (PayMethodOpts = data)"
/>
<MonitorTicketSearchbar />
<RightMenu>
<template #right-panel>

View File

@ -0,0 +1,191 @@
<script setup>
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const { t } = useI18n();
const route = useRoute();
const isNew = Boolean(!route.params.id);
</script>
<template>
<VnSubToolbar v-if="isNew" />
<div class="q-pa-md">
<FormModel
:url-update="`Properties/${route.params.id}`"
model="Property"
auto-load
>
<template #form="{ data }">
<VnRow>
<VnInput
:label="t('property.name')"
v-model="data.name"
fill-input
/>
<VnInput
:label="t('property.cadaster')"
v-model="data.cadaster"
fill-input
/>
</VnRow>
<VnRow>
<VnSelect
url="propertyGroups"
:label="t('property.group')"
v-model="data.propertyGroupFk"
option-value="id"
option-label="description"
hide-selected
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ `${scope.opt.id}: ${scope.opt.description}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
url="Companies"
:label="t('property.owner')"
v-model="data.companyFk"
option-value="id"
option-label="code"
hide-selected
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ `${scope.opt.id}: ${scope.opt.code}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</VnRow>
<VnRow>
<VnInput
:label="t('property.map')"
v-model="data.url"
fill-input
/>
</VnRow>
<VnRow>
<VnInputDate
placeholder="dd-mm-aaa"
:label="t('property.purchased')"
v-model="data.purchased"
fill-input
/>
<VnInput
:label="t('property.value')"
v-model="data.value"
fill-input
/>
<VnInput
:label="t('property.protocol')"
v-model="data.protocol"
fill-input
/>
</VnRow>
<VnRow>
<VnInput
:label="t('property.smallHolding')"
v-model="data.smallHolding"
fill-input
/>
<VnInput
:label="t('property.area')"
v-model="data.area"
fill-input
/>
<VnInput
:label="t('property.allocation')"
v-model="data.allocation"
fill-input
/>
</VnRow>
<VnRow>
<VnSelect
url="Towns"
:label="t('property.town')"
v-model="data.townFk"
option-value="id"
option-label="name"
hide-selected
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ `${scope.opt.id}: ${scope.opt.name}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnInput
:label="t('property.m2')"
v-model="data.m2"
fill-input
/>
<VnInput
:label="t('property.registry')"
v-model="data.registry"
fill-input
/>
</VnRow>
<VnRow>
<VnInput
:label="t('property.tome')"
v-model="data.tome"
fill-input
/>
<VnInput
:label="t('property.book')"
v-model="data.book"
fill-input
/>
<VnInput
:label="t('property.page')"
v-model="data.page"
fill-input
/>
<VnInput
:label="t('property.farm')"
v-model="data.farm"
fill-input
/>
</VnRow>
<VnRow>
<VnInput
:label="t('property.registration')"
v-model="data.registration"
fill-input
/>
<VnInputDate
placeholder="dd-mm-aaa"
:label="t('property.booked')"
v-model="data.booked"
fill-input
/>
<VnInput
:label="t('property.volume')"
v-model="data.volume"
fill-input
/>
</VnRow>
</template>
</FormModel>
</div>
</template>

View File

@ -0,0 +1,12 @@
<script setup>
import VnCard from 'components/common/VnCard.vue';
import PropertyDescriptor from 'pages/Property/Card/PropertyDescriptor.vue';
</script>
<template>
<VnCard
data-key="Property"
url="Properties"
:descriptor="PropertyDescriptor"
:filter="{ where: { id: $route.params.id } }"
/>
</template>

View File

@ -0,0 +1,60 @@
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
import PropertyCard from './PropertyCard.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
const { notify } = useNotify();
const { t } = useI18n();
const route = useRoute();
const entityId = computed(() => {
return Number(props.id || route.params.id);
});
const props = defineProps({
id: {
type: Number,
required: false,
default: null,
},
summary: {
type: Object,
default: null,
},
});
</script>
<template>
<CardDescriptor
v-bind="$attrs"
:id="entityId"
:card="PropertyCard"
title="name"
module="Property"
>
<template #body="{ entity }">
<VnLv :label="$t('property.owner')" :value="entity.company.code" />
<VnLv
:label="$t('property.group')"
:value="entity.propertyGroup.description"
/>
<VnLv :label="$t('property.notary')">
<template #value>
<span class="link">
{{ entity?.supplier?.name || '-' }}
<SupplierDescriptorProxy :id="entity?.supplierFk" />
</span>
</template>
</VnLv>
<VnLv :label="$t('property.protocol')" :value="entity.protocol" copy />
<VnLv :label="$t('property.cadaster')" :value="entity.cadaster" copy />
<VnLv :label="$t('property.farm')" :value="entity.farm" />
<VnLv :label="$t('property.area')" :value="entity.area" />
</template>
</CardDescriptor>
</template>

View File

@ -0,0 +1,42 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnDmsList from 'src/components/common/VnDmsList.vue';
import PropertyDmsImportForm from 'src/pages/Property/Card/PropertyDmsImportForm.vue';
const { t } = useI18n();
const dmsListRef = ref(null);
const showImportDialog = ref(false);
const onDataSaved = () => dmsListRef.value.dmsRef.fetch();
</script>
<template>
<VnDmsList
ref="dmsListRef"
model="PropertyDms"
update-model="PropertyDms"
delete-model="PropertyDms"
download-model="dms"
default-dms-code="property"
filter="propertyFk"
/>
<QDialog v-model="showImportDialog">
<PropertyDmsImportForm @on-data-saved="onDataSaved()" />
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 90]">
<QBtn
fab
color="primary"
icon="file_copy"
@click="showImportDialog = true"
class="fill-icon"
data-cy="importBtn"
>
<QTooltip>
{{ t('globals.import') }}
</QTooltip>
</QBtn>
</QPageSticky>
</template>

View File

@ -0,0 +1,65 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnSelect from 'src/components/common/VnSelect.vue';
import FormModelPopup from 'components/FormModelPopup.vue';
import FetchData from 'components/FetchData.vue';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
const emit = defineEmits(['onDataSaved']);
const { t } = useI18n();
const { notify } = useNotify();
const route = useRoute();
const dmsOptions = ref([]);
const dmsId = ref(null);
const importDms = async () => {
try {
if (!dmsId.value) throw new Error(t(`globals.errors.documentIdEmpty`));
const data = {
propertyFk: route.params.id,
dmsFk: dmsId.value,
};
await axios.post('propertyDms', data);
notify(t('globals.dataSaved'), 'positive');
dmsId.value = null;
emit('onDataSaved');
} catch (e) {
throw e;
}
};
</script>
<template>
<FetchData
url="Dms"
:filter="{ fields: ['id'], order: 'id ASC' }"
auto-load
@on-fetch="(data) => (dmsOptions = data)"
/>
<FormModelPopup
model="DmsImport"
:title="t('globals.selectDocumentId')"
:form-initial-data="{}"
:save-fn="importDms"
>
<template #form-inputs>
<VnSelect
:label="t('globals.document')"
:options="dmsOptions"
hide-selected
option-label="id"
option-value="id"
v-model="dmsId"
/>
</template>
</FormModelPopup>
</template>

View File

@ -0,0 +1,6 @@
<script setup>
import VnLog from 'src/components/common/VnLog.vue';
</script>
<template>
<VnLog model="Property" url="/PropertyLogs" />
</template>

View File

@ -0,0 +1,33 @@
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import VnNotes from 'src/components/ui/VnNotes.vue';
const route = useRoute();
const state = useState();
const user = state.getUser();
const propertyId = computed(() => route.params.id);
const noteFilter = computed(() => {
return {
order: 'created DESC',
where: { propertyFk: propertyId.value },
};
});
const body = {
propertyFk: propertyId.value,
workerFk: user.value.id,
};
</script>
<template>
<VnNotes
url="propertyObservations"
:add-note="true"
:filter="noteFilter"
:body="body"
required
/>
</template>

View File

@ -0,0 +1,349 @@
<script setup>
import { onMounted, ref, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import { getUrl } from 'src/composables/getUrl';
import useNotify from 'src/composables/useNotify.js';
import { useArrayData } from 'composables/useArrayData';
import VnTitle from 'src/components/common/VnTitle.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
import FetchData from 'src/components/FetchData.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
const route = useRoute();
const { notify } = useNotify();
const { t } = useI18n();
const $props = defineProps({
id: {
type: Number,
default: null,
},
});
const dmsColumns = ref([
{
align: 'left',
label: t('globals.id'),
name: 'id',
field: ({ id }) => id,
},
{
align: 'left',
label: t('globals.type'),
name: 'type',
field: ({ type }) => type?.name,
},
{
align: 'left',
label: t('globals.order'),
name: 'order',
field: ({ hardCopyNumber }) => dashIfEmpty(hardCopyNumber),
},
{
align: 'left',
label: t('globals.reference'),
name: 'reference',
field: ({ reference }) => dashIfEmpty(reference),
},
{
align: 'left',
label: t('globals.description'),
name: 'description',
field: ({ description }) => dashIfEmpty(description),
},
{
align: 'left',
label: t('globals.original'),
name: 'hasFile',
toolTip: t('The documentation is available in paper form'),
component: 'checkbox',
field: ({ hasFile }) => hasFile,
},
{
align: 'left',
label: t('globals.worker'),
name: 'worker',
field: ({ worker }) => worker?.name,
},
{
align: 'left',
label: t('globals.created'),
name: 'created',
field: ({ created }) => toDate(created),
},
]);
const entityId = computed(() => $props.id || route.params.id);
const summary = ref();
const property = computed(() => summary.value?.entity);
const propertyUrl = ref();
const propertyDms = ref(null);
const descriptorData = useArrayData('Property');
onMounted(async () => {
propertyUrl.value = (await getUrl('property/')) + entityId.value + '/';
});
function toPropertyUrl(section) {
return '#/property/' + entityId.value + '/' + section;
}
</script>
<template>
<FetchData
ref="propertyDms"
:url="`Properties/${entityId}/dms`"
@on-fetch="
(data) => {
propertyDms.value = data;
}
"
/>
<CardSummary
ref="summary"
:url="`Properties/${entityId}/summary`"
data-key="PropertySummary"
v-bind="$attrs.width"
>
<template #header-left>
<VnToSummary
v-if="route?.name !== 'PropertySummary'"
:route-name="'PropertySummary'"
:entity-id="entityId"
:url="PropertyUrl"
/>
</template>
<template #header="{ entity }">
<div>Property #{{ entity.id }} - {{ entity.name }}</div>
</template>
<template #menu="{ entity }">
<!-- <PropertyDescriptorMenu :ticket="entity" /> -->
</template>
<template #body="{ entity }">
<QCard class="vn-one">
<VnTitle
:url="toPropertyUrl('basic-data')"
:text="t('globals.summary.basicData')"
data-cy="titleBasicDataBlock1"
/>
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv
:label="t('property.owner')"
:value="dashIfEmpty(entity.company.code)"
/>
<VnLv
:label="t('property.map')"
:value="dashIfEmpty(entity.url)"
copy
>
<template #value>
<a
v-if="entity?.url"
:href="`${entity?.url}`"
target="_blank"
class="grafana"
data-cy="propertyMapLink"
>
{{ t('property.goToMap') }}
</a>
</template>
</VnLv>
<VnLv
:label="t('property.value')"
:value="toCurrency(entity.value)"
/>
<VnLv :label="$t('property.notary')">
<template #value>
<span class="link">
{{ entity?.supplier?.name || '-' }}
<SupplierDescriptorProxy :id="entity?.supplierFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('property.protocol')"
:value="dashIfEmpty(entity.protocol)"
copy
/>
<VnLv
:label="t('property.purchased')"
:value="toDate(entity.purchased)"
/>
<VnLv
:label="t('property.booked')"
:value="toDate(entity.booked)"
/>
</div>
</div>
</QCard>
<QCard class="vn-one">
<VnTitle
:url="toPropertyUrl('basic-data')"
:text="t('globals.summary.basicData')"
data-cy="titleBasicDataBlock2"
/>
<div class="vn-card-content">
<VnLv
:label="t('property.cadaster')"
:value="dashIfEmpty(entity.cadaster)"
copy
/>
<VnLv
:label="t('property.smallHolding')"
:value="dashIfEmpty(entity.smallHolding)"
/>
<VnLv :label="t('property.area')" :value="dashIfEmpty(entity.area)" />
<VnLv
:label="t('property.allocation')"
:value="dashIfEmpty(entity.allocation)"
/>
<VnLv
:label="t('property.town')"
:value="dashIfEmpty(entity.town.name)"
/>
<VnLv :label="t('property.m2')" :value="dashIfEmpty(entity.m2)" />
</div>
</QCard>
<QCard class="vn-one">
<VnTitle
:url="toPropertyUrl('basic-data')"
:text="t('globals.summary.basicData')"
data-cy="titleBasicDataBlock3"
/>
<div class="vn-card-content">
<VnLv
:label="t('property.registry')"
:value="dashIfEmpty(entity.registry)"
/>
<VnLv :label="t('property.tome')" :value="dashIfEmpty(entity.tome)" />
<VnLv :label="t('property.book')" :value="dashIfEmpty(entity.book)" />
<VnLv :label="t('property.page')" :value="dashIfEmpty(entity.page)" />
<VnLv :label="t('property.farm')" :value="dashIfEmpty(entity.farm)" />
<VnLv
:label="t('property.registration')"
:value="dashIfEmpty(entity.registration)"
/>
</div>
</QCard>
<QCard v-if="entity?.propertyDms.length > 0" class="vn-max">
<VnTitle
:url="toPropertyUrl('dms')"
:text="t('globals.pageTitles.dms')"
data-cy="titleDmsBlock"
/>
<QTable :columns="dmsColumns" :rows="entity?.propertyDms" flat>
<template #header="props">
<QTr :props="props">
<QTh auto-width class="text-left">{{ t('globals.id') }}</QTh>
<QTh auto-width class="text-left">{{
t('globals.type')
}}</QTh>
<QTh auto-width class="text-left">{{
t('globals.order')
}}</QTh>
<QTh auto-width class="text-left">{{
t('globals.reference')
}}</QTh>
<QTh auto-width class="text-left">{{
t('globals.description')
}}</QTh>
<QTh auto-width class="text-center">{{
t('globals.original')
}}</QTh>
<QTh auto-width class="text-left">{{
t('globals.worker')
}}</QTh>
<QTh auto-width class="text-center">{{
t('globals.created')
}}</QTh>
</QTr>
</template>
<template #body="props">
<QTr :props="props">
<QTd class="text-left">{{ props.row.dms.id }}</QTd>
<QTd class="text-left">{{ props.row.dms.dmsType.name }}</QTd>
<QTd class="text-left">{{
props.row.dms.hardCopyNumber
}}</QTd>
<QTd class="text-left">{{ props.row.dms.reference }}</QTd>
<QTd class="text-left">{{ props.row.dms.description }}</QTd>
<QTd class="text-center"
><VnCheckbox
:disable="true"
v-model="props.row.dms.hasFile"
/></QTd>
<QTd class="text-left"
><span class="link" @click.stop
>{{ props.row.dms.worker.firstName
}}<WorkerDescriptorProxy
:id="props.row.dms.worker.id" /></span
></QTd>
<QTd class="text-center">{{
toDate(props.row.dms.created)
}}</QTd>
</QTr>
</template>
</QTable>
</QCard>
<QCard v-if="entity?.notes.length > 0" class="vn-max">
<VnTitle
:url="toPropertyUrl('notes')"
:text="t('globals.notes')"
data-cy="titleNotesBlock"
/>
<QCardSection
v-if="entity?.notes"
v-for="note in entity?.notes"
horizontal
class="q-pb-sm"
>
<VnAvatar
:descriptor="false"
:worker-id="note.workerFk"
size="md"
:title="note.worker?.user.nickname"
class="q-pr-xs"
/>
<VnUserLink
:name="`${note.worker.user.name}`"
:worker-id="note.worker.id"
/>
<span class="q-pr-xs">{{ ':' }}</span>
<span class="no-margin">
{{ note.text }}
</span>
</QCardSection>
</QCard>
</template>
</CardSummary>
</template>
<style lang="scss" scoped>
.q-card.q-card--dark.q-dark.vn-one {
& > .bodyCard {
padding: 1%;
}
}
.q-table {
tr,
th,
.q-td {
border-bottom: 1px solid black;
}
}
.grafana {
color: $primary-light;
}
</style>

View File

@ -0,0 +1,182 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
const { t } = useI18n();
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
</script>
<template>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`property.params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInput
v-model="params.id"
:label="t('property.id')"
dense
filled
data-cy="idInput"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.name"
:label="t('property.name')"
dense
filled
data-cy="nameInput"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
url="PropertyGroups"
:label="t('property.group')"
v-model="params.propertyGroupFk"
option-value="id"
option-label="description"
dense
filled
data-cy="propertyGroupSelect"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
url="Suppliers"
:label="t('property.notary')"
v-model="params.supplierFk"
option-value="id"
option-label="name"
dense
filled
data-cy="notarySelect"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.protocol"
:label="t('property.protocol')"
dense
filled
data-cy="protocolInput"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.cadaster"
:label="t('property.cadaster')"
filled
dense
data-cy="cadasterInput"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
url="Companies"
:label="t('property.owner')"
v-model="params.companyFk"
option-value="id"
option-label="code"
dense
filled
data-cy="ownerSelect"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.purchased"
:label="t('property.purchased')"
dense
filled
data-cy="purchasedDateInput"
/>
</QItemSection>
<QItemSection>
<VnInputDate
v-model="params.booked"
:label="t('property.booked')"
dense
filled
data-cy="bookedDateInput"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
v-model="params.hasFormalization"
:label="t('property.hasFormalization')"
dense
filled
data-cy="hasFormalizationCheckbox"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
v-model="params.hasSimpleCopy"
:label="t('property.hasSimpleCopy')"
dense
filled
data-cy="hasSimpleCopyCheckbox"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
v-model="params.hasOriginalPropertyDeed"
:label="t('property.hasOriginalPropertyDeed')"
dense
filled
data-cy="hasOriginalPropertyDeedCheckbox"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
v-model="params.hasFundProvision"
:label="t('property.hasFundProvision')"
dense
filled
data-cy="hasFundProvisionCheckbox"
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>

View File

@ -0,0 +1,307 @@
<script setup>
import { computed, ref } from 'vue';
import { toDate } from 'src/filters/index';
import { useI18n } from 'vue-i18n';
import VnTable from 'src/components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import PropertyFilter from './PropertyFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'src/components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnRow from 'src/components/ui/VnRow.vue';
import SupplierDescriptorProxy from '../Supplier/Card/SupplierDescriptorProxy.vue';
const { t } = useI18n();
const tableRef = ref();
const dataKey = 'PropertyList';
const columns = computed(() => [
{
align: 'right',
name: 'id',
label: t('property.id'),
width: '35px',
chip: {
condition: () => true,
},
isId: true,
},
{
align: 'left',
name: 'name',
label: t('property.name'),
isTitle: true,
},
{
align: 'left',
name: 'propertyGroupFk',
label: t('property.group'),
component: 'select',
attrs: {
url: 'propertyGroups',
fields: ['id', 'description'],
optionValue: 'id',
optionLabel: 'description',
hideSelected: true,
},
format: ({ propertyGroup }) => propertyGroup,
},
{
label: t('property.group'),
name: 'propertyGroup',
cardVisible: true,
visible: false,
},
{
align: 'left',
name: 'notary',
label: t('property.notary'),
cardVisible: true,
},
{
align: 'left',
name: 'protocol',
label: t('property.protocol'),
cardVisible: true,
},
{
align: 'left',
name: 'cadaster',
label: t('property.cadaster'),
cardVisible: true,
},
{
align: 'left',
name: 'companyFk',
label: t('property.owner'),
component: 'select',
attrs: {
url: 'Companies',
fields: ['id', 'code'],
optionValue: 'id',
optionLabel: 'code',
hideSelected: true,
},
format: ({ companyCode }) => companyCode,
},
{
label: t('property.owner'),
name: 'companyCode',
cardVisible: true,
visible: false,
},
{
align: 'left',
name: 'purchased',
label: t('property.purchased'),
component: 'date',
format: ({ purchased }) => toDate(purchased),
},
{
label: t('property.purchased'),
name: 'purchased',
format: ({ purchased }) => toDate(purchased),
cardVisible: true,
visible: false,
},
{
align: 'left',
name: 'booked',
label: t('property.booked'),
component: 'date',
format: ({ booked }) => toDate(booked),
},
{
label: t('property.booked'),
name: 'booked',
format: ({ booked }) => toDate(booked),
cardVisible: true,
visible: false,
},
{
labelAbbreviation: 'Fo',
label: t('property.hasFormalization'),
toolTip: t('property.hasFormalization'),
name: 'hasFormalization',
component: 'checkbox',
width: '35px',
cardVisible: true,
},
{
labelAbbreviation: 'SC',
label: t('property.hasSimpleCopy'),
toolTip: t('property.hasSimpleCopy'),
name: 'hasSimpleCopy',
component: 'checkbox',
width: '35px',
cardVisible: true,
},
{
labelAbbreviation: 'OP',
label: t('property.hasOriginalPropertyDeed'),
toolTip: t('property.hasOriginalPropertyDeed'),
name: 'hasOriginalPropertyDeed',
component: 'checkbox',
width: '35px',
cardVisible: true,
},
{
labelAbbreviation: 'FP',
label: t('property.hasFundProvision'),
toolTip: t('property.hasFundProvision'),
name: 'hasFundProvision',
component: 'checkbox',
width: '35px',
cardVisible: true,
},
]);
</script>
<template>
<VnSection
:data-key="dataKey"
:columns="columns"
prefix="property"
:array-data-props="{
url: 'Properties/filter',
}"
>
<template #advanced-menu>
<PropertyFilter :data-key="dataKey" />
</template>
<template #body>
<VnTable
ref="tableRef"
:data-key="dataKey"
:columns="columns"
redirect="property"
search-url="PropertyList"
:create="{
urlCreate: 'Properties',
title: t('property.createProperty'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
:with-filters="false"
:right-search="false"
>
<template #column-name="{ row }">
<span>
{{ row.name }}
<QTooltip>
{{ row.name }}
</QTooltip>
</span>
</template>
<template #column-notary="{ row }">
<span class="link" @click.stop>
{{ row.notary }}
<SupplierDescriptorProxy :id="row.supplierFk" />
</span>
</template>
<template #more-create-dialog="{ data }">
<div class="col-span-2">
<VnRow>
<VnInput v-model="data.name" :label="$t('property.name')" />
</VnRow>
<VnRow>
<VnSelect
url="Suppliers"
v-model="data.supplierFk"
:label="$t('property.notary')"
:fields="['id', 'name']"
hide-selected
/>
<VnInput
v-model="data.protocol"
:label="$t('property.protocol')"
/>
</VnRow>
<VnRow>
<VnSelect
url="Companies"
:fields="['id', 'code']"
v-model="data.companyFk"
:label="$t('property.owner')"
option-value="id"
option-label="code"
hide-selected
/>
<VnSelect
url="PropertyGroups"
:fields="['id', 'description']"
v-model="data.propertyGroupFk"
:label="$t('property.group')"
option-value="id"
option-label="description"
hide-selected
/>
</VnRow>
<VnRow>
<VnInput v-model="data.url" :label="$t('property.map')" />
</VnRow>
<VnRow>
<VnInput v-model="data.value" :label="$t('property.value')" />
<VnInputDate
placeholder="dd-mm-aaa"
:label="$t('property.purchased')"
v-model="data.purchased"
/>
<VnInputDate
placeholder="dd-mm-aaa"
:label="$t('property.booked')"
v-model="data.booked"
/>
</VnRow>
<VnRow>
<VnInput
v-model="data.cadaster"
:label="$t('property.cadaster')"
/>
</VnRow>
<VnRow>
<VnInput
v-model="data.smallHolding"
:label="$t('property.smallHolding')"
/>
<VnInput v-model="data.area" :label="$t('property.area')" />
<VnInput
v-model="data.allocation"
:label="$t('property.allocation')"
/>
</VnRow>
<VnRow>
<VnSelect
url="Towns"
v-model="data.townFk"
:label="$t('property.town')"
:fields="['id', 'name']"
:options="towns"
option-value="id"
option-label="name"
hide-selected
/>
<VnInput v-model="data.m2" :label="$t('property.m2')" />
<VnInput
v-model="data.registry"
:label="$t('property.registry')"
/>
</VnRow>
<VnRow>
<VnInput v-model="data.tome" :label="$t('property.tome')" />
<VnInput v-model="data.book" :label="$t('property.book')" />
<VnInput v-model="data.page" :label="$t('property.page')" />
<VnInput v-model="data.farm" :label="$t('property.farm')" />
</VnRow>
<VnInput
v-model="data.registration"
:label="$t('property.registration')"
/>
</div>
</template>
</VnTable>
</template>
</VnSection>
</template>

View File

@ -0,0 +1,47 @@
property:
search: Search property
searchInfo: Search property by id or name
id: Id
name: Name
cadaster: Cadaster
smallHolding: Small holding
area: Area
town: Town
registry: Registry
volume: Volume
book: Book
page: Page
farm: Farm
registration: Registration
value: Value
group: Group
m2: m2
owner: Owner
allocation: Allocation
tome: Tome
map: Map
notary: Notary
protocol: Notarial protocol
purchased: Purchased date
booked: Booked date
createProperty: Create property
goToMap: Link to map
hasFormalization: Formalization
hasSimpleCopy: Simple copy
hasOriginalPropertyDeed: Original property deed
hasFundProvision: Fund provision
params:
search: General search
id: Id
name: Name
supplierFk: Notary
propertyGroupFk: Group
protocol: Notarial protocol
companyFk: Owner
purchased: Purchased date
booked: Booked date
cadaster: Cadaster
hasFormalization: Formalization
hasSimpleCopy: Simple copy
hasOriginalPropertyDeed: Original property deed
hasFundProvision: Fund provision

View File

@ -0,0 +1,47 @@
property:
search: Buscar propiedad
searchInfo: Buscar propiedad por id o nombre
id: Id
name: Nombre
cadaster: Ref. catastral
smallHolding: Parcela
area: Polígono
town: Municipio
registry: Registro urbanístico
volume: Volumen
book: Libro
page: Folio
farm: Finca
registration: Inscripción
value: Valor
group: Grupo
m2: m2
owner: Propietario
allocation: Partida
tome: Volumen
map: Mapa
notary: Notario
protocol: Prot. notarial
purchased: F. compra
booked: F. finalización
createProperty: Nueva propiedad
goToMap: Ir al mapa
hasFormalization: Formalización
hasSimpleCopy: Copia simple
hasOriginalPropertyDeed: Escritura original
hasFundProvision: Provisión de fondos
params:
search: Búsqueda general
id: Id
name: Nombre
supplierFk: Notario
propertyGroupFk: Grupo
protocol: Prot. notarial
companyFk: Propietario
purchased: F. compra
booked: F. finalización
cadaster: Ref. catastral
hasFormalization: Formalización
hasSimpleCopy: Copia simple
hasOriginalPropertyDeed: Escritura original
hasFundProvision: Provisión de fondos

View File

@ -28,7 +28,6 @@ const body = {
:add-note="true"
:filter="noteFilter"
:body="body"
style="overflow-y: auto"
required
deletable
/>

View File

@ -10,7 +10,7 @@ const $props = defineProps({
});
</script>
<template>
<QPopupProxy data-cy="TicketDescriptor">
<QPopupProxy>
<TicketDescriptor v-if="$props.id" :id="$props.id" :summary="TicketSummary" />
</QPopupProxy>
</template>

View File

@ -35,13 +35,8 @@ const onDataSaved = () => dmsListRef.value.dmsRef.fetch();
class="fill-icon"
>
<QTooltip>
{{ t('Import from existing') }}
{{ t('globals.import') }}
</QTooltip>
</QBtn>
</QPageSticky>
</template>
<i18n>
es:
Import from existing: Importar desde existente
</i18n>

View File

@ -22,7 +22,7 @@ const dmsId = ref(null);
const importDms = async () => {
try {
if (!dmsId.value) throw new Error(t(`The document identifier can't be empty`));
if (!dmsId.value) throw new Error(t(`globals.errors.documentIdEmpty`));
const data = {
ticketFk: route.params.id,
@ -34,7 +34,7 @@ const importDms = async () => {
dmsId.value = null;
emit('onDataSaved');
} catch (e) {
throw new Error(e.message);
throw e;
}
};
</script>
@ -49,14 +49,14 @@ const importDms = async () => {
<FormModelPopup
url-create="genera"
model="DmsImport"
:title="t('Select document id')"
:title="t('globals.selectDocumentId')"
:form-initial-data="{}"
:save-fn="importDms"
>
<template #form-inputs>
<VnRow>
<VnSelect
:label="t('Document')"
:label="t('globals.document')"
:options="dmsOptions"
hide-selected
option-label="id"
@ -67,10 +67,3 @@ const importDms = async () => {
</template>
</FormModelPopup>
</template>
<i18n>
es:
Select document id: Introduzca id de gestion documental
Document: Documento
The document indentifier can't be empty: El número de documento no puede estar vacío
</i18n>

View File

@ -42,11 +42,7 @@ const groupedStates = ref([]);
auto-load
/>
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:unremovableParams="['from', 'to']"
>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>

View File

@ -11,7 +11,7 @@ const $props = defineProps({
</script>
<template>
<QPopupProxy data-cy="DepartmentDescriptor">
<QPopupProxy>
<DepartmentDescriptor
v-if="$props.id"
:id="$props.id"

View File

@ -68,7 +68,7 @@ const arrayData = useArrayData('ZoneEvents');
const exclusionGeoCreate = async () => {
const params = {
zoneFk: parseInt(route.params.id),
date: dated.value,
date: dated,
geoIds: tickedNodes.value,
};
await axios.post('Zones/exclusionGeo', params);
@ -101,17 +101,9 @@ const exclusionCreate = async () => {
const existsEvent = data.events.find(
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
);
const existsGeoEvent = data.geoExclusions.find(
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
);
if (existsEvent) {
await axios.delete(`Zones/${existsEvent?.zoneFk}/events/${existsEvent?.id}`);
}
if (existsGeoEvent) {
await axios.delete(
`Zones/${existsGeoEvent?.zoneFk}/exclusions/${existsGeoEvent?.zoneExclusionFk}`,
);
}
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
else await axios.put(`${url}/${props.event?.id}`, body);
@ -130,21 +122,8 @@ const onSubmit = async () => {
const deleteEvent = async () => {
if (!props.event) return;
if (!props.event.created) {
const filter = {
where: {
dated: dated.value,
},
};
const params = { filter: JSON.stringify(filter) };
const { data: res } = await axios.get(`Zones/${route.params.id}/exclusions`, {
params,
});
if (res) await axios.delete(`Zones/${route.params.id}/exclusions/${res[0].id}`);
} else {
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
}
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
await refetchEvents();
};
@ -156,7 +135,7 @@ const refetchEvents = async () => {
};
onMounted(() => {
if (props.event && props.event.dated) {
if (props.event) {
dated.value = props.event?.dated;
excludeType.value =
props.eventType === 'geoExclusion' ? 'specificLocations' : 'all';

View File

@ -56,7 +56,6 @@ const isNew = computed(() => props.isNewMode);
const eventInclusionFormData = ref({ wdays: [] });
const dated = ref(props.date || Date.vnNew());
const _inclusionType = ref('indefinitely');
const hasDeletedEvent = ref(false);
const inclusionType = computed({
get: () => _inclusionType.value,
set: (val) => {
@ -85,7 +84,7 @@ const createEvent = async () => {
}
const zoneIds = props.zoneIds?.length ? props.zoneIds : [route.params.id];
for (const zoneId of zoneIds) {
for (const id of zoneIds) {
let today = eventInclusionFormData.value.dated
? moment(eventInclusionFormData.value.dated)
: moment(dated.value);
@ -93,7 +92,7 @@ const createEvent = async () => {
const { data } = await axios.get(`Zones/getEventsFiltered`, {
params: {
zoneFk: zoneId,
zoneFk: id,
started: today,
ended: lastDay,
},
@ -107,19 +106,15 @@ const createEvent = async () => {
await axios.delete(
`Zones/${existsExclusion?.zoneFk}/exclusions/${existsExclusion?.id}`,
);
await refetchEvents();
hasDeletedEvent.value = true;
}
delete eventInclusionFormData.value.id;
if (isNew.value || hasDeletedEvent.value)
await axios.post(`Zones/${zoneId}/events`, eventInclusionFormData.value);
if (isNew.value)
await axios.post(`Zones/${id}/events`, eventInclusionFormData.value);
else
await axios.put(
`Zones/${zoneId}/events/${props.event?.id}`,
`Zones/${id}/events/${props.event?.id}`,
eventInclusionFormData.value,
);
hasDeletedEvent.value = false;
}
quasar.notify({
message: t('globals.dataSaved'),

View File

@ -15,6 +15,7 @@ import Entry from './entry';
import Zone from './zone';
import Account from './account';
import Monitor from './monitor';
import Property from './property';
export default [
Item,
@ -34,4 +35,5 @@ export default [
Zone,
Account,
Monitor,
Property,
];

View File

@ -0,0 +1,100 @@
import { RouterView } from 'vue-router';
const propertyCard = {
name: 'PropertyCard',
path: ':id',
component: () => import('src/pages/Property/Card/PropertyCard.vue'),
redirect: { name: 'PropertySummary' },
meta: {
menu: ['PropertyBasicData', 'PropertyDms', 'PropertyNotes', 'PropertyLog'],
},
children: [
{
name: 'PropertySummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'view_list',
},
component: () => import('pages/Property/Card/PropertySummary.vue'),
},
{
name: 'PropertyBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Property/Card/PropertyBasicData.vue'),
},
{
name: 'PropertyDms',
path: 'dms',
meta: {
title: 'dms',
icon: 'cloud_upload',
},
component: () => import('pages/Property/Card/PropertyDms.vue'),
},
{
name: 'PropertyNotes',
path: 'notes',
meta: {
title: 'notes',
icon: 'note',
},
component: () => import('pages/Property/Card/PropertyNotes.vue'),
},
{
name: 'PropertyLog',
path: 'history',
meta: {
title: 'history',
icon: 'history',
},
component: () => import('pages/Property/Card/PropertyLog.vue'),
},
],
};
export default {
name: 'Property',
path: '/property',
meta: {
title: 'properties',
icon: 'apartment',
moduleName: 'Property',
menu: ['PropertyList'],
},
component: RouterView,
redirect: { name: 'PropertyMain' },
children: [
{
name: 'PropertyMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'PropertyIndexMain' },
children: [
{
path: '',
name: 'PropertyIndexMain',
component: () => import('src/pages/Property/PropertyList.vue'),
redirect: { name: 'PropertyList' },
children: [
{
name: 'PropertyList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
component: () =>
import('src/pages/Property/PropertyList.vue'),
},
propertyCard,
],
},
],
},
],
};

View File

@ -15,6 +15,7 @@ import entry from 'src/router/modules/entry';
import zone from 'src/router/modules/zone';
import account from './modules/account';
import monitor from 'src/router/modules/monitor';
import property from 'src/router/modules/property';
const routes = [
{
@ -83,6 +84,7 @@ const routes = [
entry,
zone,
account,
property,
{
path: '/:catchAll(.*)*',
name: 'NotFound',

View File

@ -18,6 +18,7 @@ export const useNavigationStore = defineStore('navigationStore', () => {
'monitor',
'supplier',
'claim',
'property',
'route',
'ticket',
'worker',

View File

@ -53,7 +53,7 @@ describe('invoiceInCorrective', () => {
it('should show/hide the section if it is a corrective invoice', () => {
cy.visit('/#/invoice-in/1/summary');
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('not.exist');
cy.clickDescriptorAction(4);
cy.clicDescriptorAction(4);
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('exist');
});
});

View File

@ -64,17 +64,17 @@ describe('InvoiceInDescriptor', () => {
beforeEach(() => cy.visit('/#/invoice-in/1/summary'));
it('should navigate to the supplier summary', () => {
cy.clickDescriptorAction(1);
cy.clicDescriptorAction(1);
cy.url().should('to.match', /supplier\/\d+\/summary/);
});
it('should navigate to the entry summary', () => {
cy.clickDescriptorAction(2);
cy.clicDescriptorAction(2);
cy.url().should('to.match', /entry\/\d+\/summary/);
});
it('should navigate to the invoiceIn list', () => {
cy.clickDescriptorAction(3);
cy.clicDescriptorAction(3);
cy.url().should('to.match', /invoice-in\/list\?table=\{.*supplierFk.+\}/);
});
});
@ -93,7 +93,7 @@ describe('InvoiceInDescriptor', () => {
createCorrective();
redirect(originalId);
cy.clickDescriptorAction(4);
cy.clicDescriptorAction(4);
cy.validateVnTableRows({
cols: [
{
@ -141,7 +141,7 @@ function createCorrective() {
function redirect(subtitle) {
const regex = new RegExp(`InvoiceIns/${subtitle}\\?filter=.*`);
cy.intercept('GET', regex).as('getOriginal');
cy.clickDescriptorAction(4);
cy.clicDescriptorAction(4);
cy.wait('@getOriginal');
cy.validateDescriptor({ subtitle });
}

View File

@ -28,7 +28,7 @@ describe('InvoiceOut list', () => {
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
});
it.skip('should open the invoice descriptor from table icon', () => {
it('should open the invoice descriptor from table icon', () => {
cy.get(firstSummaryIcon).click();
cy.get('.cardSummary').should('be.visible');
cy.get('.summaryHeader > div').should('include.text', 'A1111111');

View File

@ -15,7 +15,7 @@ describe('InvoiceOut summary', () => {
cy.login('developer');
cy.visit(`/#/invoice-out/1/summary`);
});
it.skip('open the descriptors', () => {
it('open the descriptors', () => {
cy.get(firstRowDescriptors(1)).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1');
@ -30,7 +30,7 @@ describe('InvoiceOut summary', () => {
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
it.skip('should open the ticket list', () => {
it('should open the ticket list', () => {
cy.get(toTicketList).click();
cy.get('[data-col-field="stateFk"]').each(($el) => {
cy.wrap($el).contains('T1111111');

View File

@ -1,47 +0,0 @@
/// <reference types="cypress" />
describe('Monitor Clients actions', () => {
beforeEach(() => {
cy.login('salesPerson');
cy.intercept('GET', '**/Departments**').as('departments');
cy.visit('/#/monitor/clients-actions');
cy.waitForElement('.q-page');
cy.wait('@departments').then((xhr) => {
cy.window().then((win) => {
const user = JSON.parse(win.sessionStorage.getItem('user'));
const { where } = JSON.parse(xhr.request.query.filter);
expect(where.id.like).to.include(user.departmentFk.toString());
});
});
cy.intercept('GET', '**/SalesMonitors/ordersFilter*').as('ordersFilter');
cy.intercept('GET', '**/SalesMonitors/clientsFilter*').as('clientsFilter');
});
it('Should filter by field', () => {
cy.get('.q-page').should('be.visible');
cy.dataCy('clientsOnWebsite')
.find('[data-cy="column-filter-departmentFk"] [data-cy="_select"]')
.click();
cy.dataCy('recentOrderActions').within(() => {
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
});
cy.checkVisibleDescriptor('Customer');
cy.dataCy('recentOrderActions').within(() => {
cy.getRowCol('departmentFk', 2)
.find('span')
.should('have.class', 'link')
.click();
});
cy.checkVisibleDescriptor('Department');
cy.dataCy('clientsOnWebsite')
.find('.q-ml-md')
.should('have.text', 'Clients on website');
cy.dataCy('recentOrderActions')
.find('.q-ml-md')
.should('have.text', 'Recent order actions');
cy.dataCy('From_inputDate').should('have.value', '01/01/2001');
cy.dataCy('To_inputDate').should('have.value', '01/01/2001');
});
});

View File

@ -1,69 +0,0 @@
/// <reference types="cypress" />
describe('Monitor Tickets Table', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('salesPerson');
cy.visit('/#/monitor/tickets');
cy.waitForElement('.q-page');
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
cy.openRightMenu();
});
it('should open new tab when ctrl+click on client link', () => {
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
});
cy.getRowCol('provinceFk').click({ ctrlKey: true });
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
});
it('should open the descriptorProxy and SummaryPopup', () => {
cy.getRowCol('totalProblems');
cy.getRowCol('id').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Ticket');
cy.getRowCol('zoneFk').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Zone');
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Customer');
cy.getRowCol('departmentFk').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Department');
cy.getRowCol('shippedDate').find('.q-badge');
cy.tableActions().click({ ctrlKey: true });
cy.tableActions(1).click();
cy.get('.summaryHeader').should('exist');
});
it('clear scopeDays', () => {
cy.get('[data-cy="Days onward_input"]').clear().type('2');
cy.searchInFilterPanel();
cy.get('.q-chip__content > span').should('have.text', '"2"');
cy.waitSpinner();
checkScopeDays(2);
cy.get('[data-cy="Days onward_input"]').clear();
cy.searchInFilterPanel();
cy.get('.q-chip__content > span').should('have.text', '"0"');
cy.waitSpinner();
checkScopeDays(0);
});
});
function checkScopeDays(scopeDays) {
cy.url().then((url) => {
const urlParams = new URLSearchParams(url.split('?')[1]);
const saleMonitorTickets = JSON.parse(
decodeURIComponent(urlParams.get('saleMonitorTickets')),
);
expect(saleMonitorTickets.scopeDays).to.equal(scopeDays);
const fromDate = new Date(saleMonitorTickets.from);
const toDate = new Date(saleMonitorTickets.to);
expect(toDate.getDate() - fromDate.getDate()).to.equal(
saleMonitorTickets.scopeDays,
);
});
}

View File

@ -2,7 +2,7 @@
describe('OrderCatalog', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.viewport(1920, 720);
cy.visit('/#/order/8/catalog');
});

View File

@ -11,15 +11,14 @@ describe('OrderList', () => {
it('create order', () => {
cy.get('[data-cy="vnTableCreateBtn"]').click();
cy.selectOption('[data-cy="Client_select"]', 1101);
cy.dataCy('landedDate').find('input').type('06/01/2001');
cy.get('[data-cy="Address_select"]').click();
cy.selectOption(clientCreateSelect, 1101);
cy.get(addressCreateSelect).click();
cy.get(
'.q-menu > div> div.q-item:nth-child(1) >div.q-item__section--avatar > i',
).should('have.text', 'star');
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
cy.get('.q-card [data-cy="Agency_select"]').click();
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
cy.dataCy('landedDate').find('input').type('06/01/2001');
cy.selectOption(agencyCreateSelect, 1);
cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
cy.wait('@orderSale');

View File

@ -0,0 +1,53 @@
describe('Property basic data', () => {
const selectors = {
resetBtn: '#st-actions > .q-btn-group > .q-btn[title="Reset"]',
saveBtn: '#st-actions > .q-btn-group > .q-btn[title="Save"]',
labelName: '[data-cy="Name_input"]',
};
const updateData = {
Name: { val: 'Palacio de Asgard' },
Cadaster: { val: 'REF-123-456' },
Owner: { val: 'VNL', type: 'select' },
Map: { val: 'http://www.google.com' },
'Purchase date': { val: '01-01-2001', type: 'date' },
Value: { val: 500000 },
'Notarial protocol': { val: '1291/2025' },
'Small holding': { val: 195 },
Area: { val: 5 },
Allocation: { val: 'COTES' },
Town: { val: 'Alzira', type: 'select' },
m2: { val: 5000 },
Registry: { val: 'Asgard' },
Tome: { val: 1 },
Book: { val: 1 },
Page: { val: 1 },
Farm: { val: 1 },
Registration: { val: 5 },
'Booked date': { val: '02-02-2002', type: 'date' },
Volume: { val: 1 },
};
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/property/2/basic-data');
});
it('Should reset property basic data', () => {
cy.get(selectors.labelName)
.should('be.visible')
.click().invoke('text').then((name) => {
name= name.trim();
cy.get(selectors.labelName).click().type(`{selectall}{backspace}Tony Stark`);
cy.get(selectors.resetBtn).click();
cy.containContent(selectors.labelName, name);
});
});
it('Should edit property basic data', () => {
cy.fillInForm(updateData);
cy.get(selectors.saveBtn).click();
cy.checkNotification('Data saved');
});
});

View File

@ -0,0 +1,45 @@
describe('Property descriptor', () => {
const selectors = {
notaryLink: '.descriptor [data-cy="vnLvNotario"] .link',
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
descriptorGoToSummaryBtn: '.q-menu > .descriptor [data-cy="goToSummaryBtn"]',
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
descriptorTitle: '[data-cy="vnDescriptor_description"]',
};
const notarySummaryUrlRegex = /supplier\/\d+\/summary/;
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/property/1/summary');
});
it('Should redirect to the notary summary from notary descriptor pop-up', () => {
cy.get(selectors.notaryLink)
.should('be.visible')
.click()
.invoke('text')
.then((notaryName) => {
notaryName = notaryName.trim();
cy.log('Notary name: ', notaryName);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.location().should('match', notarySummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, notaryName);
});
});
it('Should redirect to the notary summary from summary pop-up from the notary descriptor pop-up', () => {
cy.get(selectors.notaryLink)
.should('be.visible')
.click()
.invoke('text')
.then((notaryName) => {
notaryName = notaryName.trim();
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.location().should('match', notarySummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, notaryName);
});
});
});

View File

@ -0,0 +1,135 @@
describe('Property DMS', () => {
const getBtnSelector = (trPosition, btnPosition) =>
`tr:${trPosition}-child > .text-right > .no-wrap > :nth-child(${btnPosition}) > .q-btn > .q-btn__content > .q-icon`;
const selectors = {
lastRowDownloadBtn: getBtnSelector('last', 1),
firstRowEditBtn: getBtnSelector('first', 2),
lastRowDeleteBtn: getBtnSelector('last', 3),
firstRowDeleteBtn: getBtnSelector('first', 3),
lastRowReference: 'tr:last-child > :nth-child(5) > .q-tr > :nth-child(1) > span',
firstRowReference:
'tr:first-child > :nth-child(5) > .q-tr > :nth-child(1) > span',
firstRowId: 'tr:first-child > :nth-child(2) > .q-tr > :nth-child(1) > span',
lastRowWorkerLink: 'tr:last-child > :nth-child(8) > .q-tr > .link',
descriptorTitle: '.descriptor .title',
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
descriptorGoToSummaryBtn: '.q-menu .descriptor [data-cy="goToSummaryBtn"]',
summaryTitle: '.summaryHeader',
referenceInput: 'Reference_input',
companySelect: 'Company_select',
warehouseSelect: 'Warehouse_select',
typeSelect: 'Type_select',
fileInput: 'VnDms_inputFile',
importBtn: 'importBtn',
addBtn: 'addButton',
saveFormBtn: 'FormModelPopup_save',
};
const data = {
Reference: { val: 'Property:Peter Parker' },
Company: { val: 'VNL', type: 'select' },
Warehouse: { val: 'Warehouse One', type: 'select' },
Type: { val: 'Copia simple', type: 'select' },
};
const updateData = {
Reference: { val: 'Property:Peter Parker House' },
Company: { val: 'CCs', type: 'select' },
Warehouse: { val: 'Warehouse Two', type: 'select' },
Type: { val: 'Escritura original', type: 'select' },
};
const workerSummaryUrlRegex = /worker\/\d+\/summary/;
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/property/1/dms`);
});
it('should display vehicle DMS', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should create new DMS', () => {
cy.dataCy(selectors.addBtn).click();
cy.fillInForm(data);
cy.dataCy(selectors.fileInput).selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.dataCy(selectors.saveFormBtn).click();
cy.checkNotification('Data saved');
});
it('Should edit DMS', () => {
cy.get(selectors.firstRowEditBtn).click();
cy.fillInForm(updateData);
cy.dataCy(selectors.saveFormBtn).click();
cy.checkNotification('Data saved');
cy.validateContent(selectors.firstRowReference, updateData.Reference.val);
});
it('Should delete DMS', () => {
cy.get(selectors.firstRowDeleteBtn).click();
cy.clickConfirm();
cy.checkNotification('Data deleted');
cy.validateContent(selectors.firstRowReference, '1');
});
it('Should import DMS', () => {
const data = {
Document: { val: '10', type: 'select' },
};
cy.dataCy(selectors.importBtn).click();
cy.fillInForm(data);
cy.dataCy(selectors.saveFormBtn).click();
cy.checkNotification('Data saved');
cy.validateContent(selectors.lastRowReference, '1');
cy.get(selectors.lastRowDeleteBtn).click();
cy.clickConfirm();
});
it('Should download DMS', () => {
const downloadsFolder = Cypress.config('downloadsFolder');
cy.get(selectors.lastRowDownloadBtn).click();
cy.wait(3000);
const fileName = '1.txt';
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
});
describe('Worker pop-ups', () => {
it('Should redirect to the worker summary from worker descriptor pop-up', () => {
cy.get(selectors.lastRowWorkerLink)
.should('be.visible')
.click()
.invoke('text')
.then((workerName) => {
workerName = workerName.trim();
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.location().should('match', workerSummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, workerName);
});
});
it('Should redirect to the worker summary from summary pop-up from the worker descriptor pop-up', () => {
cy.get(selectors.lastRowWorkerLink)
.should('be.visible')
.click()
.invoke('text')
.then((workerName) => {
workerName = workerName.trim();
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.location().should('match', workerSummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, workerName);
});
});
});
});

View File

@ -0,0 +1,102 @@
describe('Property list', () => {
const selectors = {
firstRow: 'tr:first-child > [data-col-field="name"]',
firstRowNotaryLink: 'tr:first-child > [data-col-field="notary"] > .no-padding > .link',
descriptorTitle: '[data-cy="vnDescriptor_title"]',
notaryDescriptorTitle: '[data-cy="vnDescriptor_description"]',
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
descriptorGoToSummaryBtn: '.q-menu > .descriptor [data-cy="goToSummaryBtn"]',
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
};
const summaryUrlRegex = /property\/\d+\/summary/;
const notarySummaryUrlRegex = /supplier\/\d+\/summary/;
const data = {
Name: { val: 'Palacio de Asgard' },
Notary: { val: 'VNL', type: 'select' },
'Notarial protocol': { val: '1291/2025' },
Owner: { val: 'VNL', type: 'select' },
Group: { val: 'Cotes', type: 'select' },
Map: { val: 'http://www.google.com' },
Value: { val: 150000 },
'Purchase date': { val: '01-01-2001', type: 'date' },
'Booked date': { val: '01-01-2002', type: 'date' },
Cadaster: { val: 'REF-123-456' },
'Small holding': { val: 195 },
Area: { val: 3 },
Allocation: { val: 'COTES' },
Town: { val: 'Alzira', type: 'select' },
m2: { val: 120000 },
Registry: { val: 'Asgard' },
Tome: { val: 1 },
Book: { val: 1 },
Page: { val: 1 },
Farm: { val: 1 },
Registration: { val: 2 },
};
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit('/#/property/list');
cy.typeSearchbar('{enter}');
});
it('Should list properties', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should redirect to the property summary when clicking the row', () => {
cy.get(selectors.firstRow)
.should('be.visible')
.click()
.invoke('text')
.then((name) => {
name = name.trim();
cy.location().should('match', summaryUrlRegex);
cy.containContent(selectors.descriptorTitle, name);
});
});
it('Should create new property', () => {
cy.addBtnClick();
cy.fillInForm(data);
cy.dataCy('FormModelPopup_save').should('be.visible').click();
cy.checkNotification('Data created');
cy.location().should('match', summaryUrlRegex);
cy.containContent(selectors.descriptorTitle, data.Name.val);
});
describe('Notary pop-ups', () => {
it('Should redirect to the notary summary from notary descriptor pop-up', () => {
cy.get(selectors.firstRowNotaryLink)
.should('be.visible')
.click()
.invoke('text')
.then((notaryName) => {
notaryName = notaryName.trim();
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.location().should('match', notarySummaryUrlRegex);
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
});
});
it('Should redirect to the notary summary from summary pop-up from the notary descriptor pop-up', () => {
cy.get(selectors.firstRowNotaryLink)
.should('be.visible')
.click()
.invoke('text')
.then((notaryName) => {
notaryName = notaryName.trim();
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.location().should('match', notarySummaryUrlRegex);
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
});
});
});
});

View File

@ -0,0 +1,26 @@
describe('Property notes', () => {
const selectors = {
addNoteInput: 'Add note here..._input',
saveNoteBtn: 'saveNote',
noteCard: '.column.full-width > :nth-child(1) > .q-card__section--vert',
};
const newNoteText = 'Cristal ventana salon roto';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/property/1/notes');
});
it('Should show the property notes', () => {
cy.get(selectors.noteCard)
.first()
.should('contain', 'Golpe en la puerta de entrada');
});
it('Should add a new note', () => {
cy.dataCy(selectors.addNoteInput).should('be.visible').type(newNoteText);
cy.dataCy(selectors.saveNoteBtn).click();
cy.get(selectors.noteCard).last().should('contain', newNoteText);
});
});

View File

@ -0,0 +1,146 @@
describe('Property summary', () => {
const selectors = {
summaryTitle: '.summaryHeader',
descriptorTitle: '[data-cy="vnDescriptor_title"]',
notaryDescriptorTitle: '[data-cy="vnDescriptor_description"]',
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
descriptorGoToSummaryBtn: '.q-menu > .descriptor [data-cy="goToSummaryBtn"]',
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
summaryBasicDataBlock1Link: 'a.link[data-cy="titleBasicDataBlock1"]',
summaryBasicDataBlock2Link: 'a.link[data-cy="titleBasicDataBlock2"]',
summaryBasicDataBlock3Link: 'a.link[data-cy="titleBasicDataBlock3"]',
summaryDmsBlockLink: 'a.link[data-cy="titleDmsBlock"]',
summaryNotesBlockLink: 'a.link[data-cy="titleNotesBlock"]',
summaryPropertyMapLink: 'a.grafana[data-cy="propertyMapLink"]',
dmsFirstRowWorkerLink: '.summaryBody :nth-child(1) > :nth-child(7) .link',
basicDataIcon: 'PropertyBasicData-menu-item',
dmsIcon: 'PropertyDms-menu-item',
notesIcon: 'PropertyNotes-menu-item',
logIcon: 'PropertyLog-menu-item',
notaryLink: '.summaryBody [data-cy="vnLvNotario"] .link',
};
const url = '/#/property/1/summary';
const basicDataUrlRegex = /property\/1\/basic-data/;
const dmsUrlRegex = /property\/1\/dms/;
const notesUrlRegex = /property\/1\/notes/;
const logUrlRegex = /property\/1\/history/;
const workerSummaryUrlRegex = /worker\/\d+\/summary/;
const notarySummaryUrlRegex = /supplier\/\d+\/summary/;
const propertyName = 'Stark Tower';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(url);
});
it('Should load summary', () => {
cy.containContent(selectors.summaryTitle, propertyName);
cy.containContent(selectors.descriptorTitle, propertyName);
});
it('Should redirect to the corresponding section when clicking on the icons in the left menu', () => {
cy.dataCy(selectors.basicDataIcon).click();
cy.location().should('match', basicDataUrlRegex);
cy.visit(url);
cy.dataCy(selectors.dmsIcon).click();
cy.location().should('match', dmsUrlRegex);
cy.visit(url);
cy.dataCy(selectors.notesIcon).click();
cy.location().should('match', notesUrlRegex);
cy.visit(url);
cy.dataCy(selectors.logIcon).click();
cy.location().should('match', logUrlRegex);
});
it('Should redirect to property basic-data when clicking on basic-data title links', () => {
cy.get(selectors.summaryBasicDataBlock1Link).click();
cy.location().should('match', basicDataUrlRegex);
cy.visit(url);
cy.get(selectors.summaryBasicDataBlock2Link).click();
cy.location().should('match', basicDataUrlRegex);
cy.visit(url);
cy.get(selectors.summaryBasicDataBlock3Link).click();
cy.location().should('match', basicDataUrlRegex);
});
it('Should redirect to property DMS when clicking on DMS title', () => {
cy.get(selectors.summaryDmsBlockLink).click();
cy.location().should('match', dmsUrlRegex);
});
it('Should redirect to property notes when clicking on notes title', () => {
cy.get(selectors.summaryNotesBlockLink).click();
cy.location().should('match', notesUrlRegex);
});
it('Should redirect to property map', () => {
cy.get(selectors.summaryPropertyMapLink).invoke('removeAttr', 'target').click();
cy.origin('https://www1.sedecatastro.gob.es', () => {
cy.location().should('match', /sedecatastro.gob.es/);
});
});
describe('Notary pop-ups', () => {
it('Should redirect to the notary summary from notary descriptor pop-up', () => {
cy.get(selectors.notaryLink)
.should('be.visible')
.click()
.invoke('text')
.then((notaryName) => {
notaryName = notaryName.trim();
cy.log('Notary name: ', notaryName);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.location().should('match', notarySummaryUrlRegex);
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
});
});
it('Should redirect to the notary summary from summary pop-up from the notary descriptor pop-up', () => {
cy.get(selectors.notaryLink)
.should('be.visible')
.click()
.invoke('text')
.then((notaryName) => {
notaryName = notaryName.trim();
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.location().should('match', notarySummaryUrlRegex);
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
});
});
});
describe('Worker pop-ups', () => {
it('Should redirect to the worker summary from worker descriptor pop-up', () => {
cy.get(selectors.dmsFirstRowWorkerLink)
.should('be.visible')
.click()
.invoke('text')
.then((workerName) => {
workerName = workerName.trim();
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.location().should('match', workerSummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, workerName);
});
});
it('Should redirect to the worker summary from summary pop-up from the worker descriptor pop-up', () => {
cy.get(selectors.dmsFirstRowWorkerLink)
.should('be.visible')
.click()
.invoke('text')
.then((workerName) => {
workerName = workerName.trim();
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.location().should('match', workerSummaryUrlRegex);
cy.containContent(selectors.descriptorTitle, workerName);
});
});
});
});

View File

@ -114,7 +114,7 @@ describe.skip('Route extended list', () => {
fillField(selector, type, value);
});
cy.get('[title="Reset"]').click();
cy.get(selectors.resetBtn).click();
originalFields.forEach(({ selector, value }) => {
cy.validateContent(selector, value);

View File

@ -6,7 +6,9 @@ describe('ParkingBasicData', () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
cy.get('[data-cy="navBar-spinner"]', { timeout: 10000 }).should('not.be.visible');
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should(
'not.be.visible',
);
});
it('should give an error if the code aldready exists', () => {

View File

@ -2,7 +2,7 @@
const firstRow = 'tbody > :nth-child(1)';
describe('TicketSale', () => {
describe.skip('Ticket #23', () => {
describe('#23', () => {
beforeEach(() => {
cy.login('claimManager');
cy.viewport(1920, 1080);

View File

@ -1,6 +0,0 @@
Cypress.Commands.add('checkVisibleDescriptor', (alias) =>
cy
.get(`[data-cy="${alias}Descriptor"] [data-cy="vnDescriptor"] > .header`)
.should('exist')
.and('be.visible'),
);

View File

@ -2,7 +2,9 @@ Cypress.Commands.add('getRow', (index = 1) =>
cy.get(`.vnTable .q-virtual-scroll__content tr:nth-child(${index})`),
);
Cypress.Commands.add('getRowCol', (field, index = 1) =>
cy.getRow(index).find(`[data-col-field="${field}"]`),
cy.get(
`.vnTable .q-virtual-scroll__content > :nth-child(${index}) > [data-col-field="${field}"]`,
),
);
Cypress.Commands.add('vnTableCreateBtn', () =>
@ -12,9 +14,3 @@ Cypress.Commands.add('vnTableCreateBtn', () =>
Cypress.Commands.add('waitTableScrollLoad', () =>
cy.waitForElement('[data-q-vs-anchor]'),
);
Cypress.Commands.add('tableActions', (n = 0, child = 1) =>
cy.get(
`:nth-child(${child}) > .q-table--col-auto-width > [data-cy="tableAction-${n}"] > .q-btn__content > .q-icon`,
),
);

View File

@ -10,7 +10,7 @@ describe('WagonTypeEdit', () => {
cy.get('.q-card');
cy.get('input').first().type(' changed');
cy.get('div.q-checkbox__bg').first().click();
cy.dataCy('saveDefaultBtn').click();
cy.get('.q-btn--standard').click();
});
it('should delete a tray', () => {

View File

@ -78,21 +78,20 @@ Cypress.Commands.add('waitForElement', (element) => {
Cypress.Commands.add('getValue', (selector) => {
cy.get(selector).then(($el) => {
if ($el.find('.q-checkbox__inner').length > 0) {
return cy.get(`${selector}.q-checkbox__inner`);
return cy.get(selector + '.q-checkbox__inner');
}
// Si es un QSelect
if ($el.find('.q-select__dropdown-icon').length) {
return cy
.get(
`${
selector
}> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input`,
selector +
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input',
)
.invoke('val');
}
// Si es un QSelect
if ($el.find('span').length) {
return cy.get(`${selector} span`).then(($span) => {
return cy.get(selector + ' span').then(($span) => {
return $span[0].innerText;
});
}
@ -101,15 +100,10 @@ Cypress.Commands.add('getValue', (selector) => {
});
});
Cypress.Commands.add('waitSpinner', (_spinner = 'navBar') => {
const spinners = {
navBar: '[data-cy="navBar-spinner"]',
filterPanel: '[data-cy="filterPanel-spinner"]',
};
const spinner = spinners[_spinner];
Cypress.Commands.add('waitSpinner', () => {
cy.get('body').then(($body) => {
if ($body.find(spinner).length) {
cy.get(spinner).should('not.be.visible');
if ($body.find('[data-cy="loading-spinner"]').length) {
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
}
});
});
@ -148,7 +142,7 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
// Se intenta obtener la lista de opciones del desplegable de manera recursiva
return cy
.get(`#${ariaControl}`, { timeout })
.get('#' + ariaControl, { timeout })
.should('exist')
.find('.q-item')
.should('exist')
@ -358,21 +352,11 @@ Cypress.Commands.add('openListSummary', (row) => {
cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(row).click();
});
Cypress.Commands.add('openRightMenu', (element = 'toggle-right-drawer') => {
if (element) cy.waitForElement(`[data-cy="${element}"]`);
cy.dataCy(element).click();
Cypress.Commands.add('openRightMenu', (element) => {
if (element) cy.waitForElement(element);
cy.get('[data-cy="toggle-right-drawer"]').click();
});
Cypress.Commands.add('cleanFilterPanel', (element = 'clearFilters') => {
cy.get('#filterPanelForm').scrollIntoView();
if (element) cy.waitForElement(`[data-cy="${element}"]`);
cy.dataCy(element).click();
});
Cypress.Commands.add('searchInFilterPanel', (element = 'vnFilterPanel_search') => {
if (element) cy.waitForElement(`[data-cy="${element}"]`);
cy.dataCy(element).click();
});
Cypress.Commands.add('openLeftMenu', (element) => {
if (element) cy.waitForElement(element);
cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
@ -470,9 +454,9 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
cy.waitForElement('[data-cy="descriptor_actions"]');
cy.waitSpinner();
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
cy.get('.q-btn')
.filter((index, el) => Cypress.$(el).find(`.q-icon.${iconClass}`).length > 0)
.filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
.then(($btn) => {
cy.wrap($btn).click();
});
@ -607,7 +591,7 @@ Cypress.Commands.add('validatePdfDownload', (match, trigger) => {
});
});
Cypress.Commands.add('clickDescriptorAction', (index = 1) => {
Cypress.Commands.add('clicDescriptorAction', (index = 1) => {
cy.get(`[data-cy="descriptor_actions"] .q-btn:nth-of-type(${index})`).click();
});

View File

@ -68,7 +68,6 @@ const waitForApiReady = (url, maxRetries = 20, delay = 1000) => {
};
before(() => {
cy.viewport(1920, 1080);
waitForApiReady('/api/Applications/status');
});