Merge branch 'dev' into 7449-claimBeginningQuantity
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
e54dbc3514
|
@ -35,6 +35,7 @@ import { getColAlign } from 'src/composables/getColAlign';
|
||||||
import RightMenu from '../common/RightMenu.vue';
|
import RightMenu from '../common/RightMenu.vue';
|
||||||
import VnScroll from '../common/VnScroll.vue';
|
import VnScroll from '../common/VnScroll.vue';
|
||||||
import VnCheckboxMenu from '../common/VnCheckboxMenu.vue';
|
import VnCheckboxMenu from '../common/VnCheckboxMenu.vue';
|
||||||
|
import VnCheckbox from '../common/VnCheckbox.vue';
|
||||||
|
|
||||||
const arrayData = useArrayData(useAttrs()['data-key']);
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -332,6 +333,7 @@ function stopEventPropagation(event) {
|
||||||
|
|
||||||
function reload(params) {
|
function reload(params) {
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
|
selectAll.value = false;
|
||||||
CrudModelRef.value.reload(params);
|
CrudModelRef.value.reload(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,7 +647,7 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
return () => {};
|
return () => {};
|
||||||
});
|
});
|
||||||
const handleHeaderSelection = (evt, data) => {
|
const handleHeaderSelection = (evt, data) => {
|
||||||
if (evt === 'selected' && data) {
|
if (evt === 'updateSelected' && selectAll.value) {
|
||||||
selected.value = tableRef.value.rows;
|
selected.value = tableRef.value.rows;
|
||||||
} else if (evt === 'selectAll') {
|
} else if (evt === 'selectAll') {
|
||||||
selected.value = data;
|
selected.value = data;
|
||||||
|
@ -680,7 +682,13 @@ const handleHeaderSelection = (evt, data) => {
|
||||||
:class="$attrs['class'] ?? 'q-px-md'"
|
:class="$attrs['class'] ?? 'q-px-md'"
|
||||||
:limit="$attrs['limit'] ?? 100"
|
:limit="$attrs['limit'] ?? 100"
|
||||||
ref="CrudModelRef"
|
ref="CrudModelRef"
|
||||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
@on-fetch="
|
||||||
|
(...args) => {
|
||||||
|
selectAll = false;
|
||||||
|
selected = [];
|
||||||
|
emit('onFetch', ...args);
|
||||||
|
}
|
||||||
|
"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:disable-infinite-scroll="isTableMode"
|
:disable-infinite-scroll="isTableMode"
|
||||||
:before-save-fn="removeTextValue"
|
:before-save-fn="removeTextValue"
|
||||||
|
@ -718,14 +726,23 @@ const handleHeaderSelection = (evt, data) => {
|
||||||
:data-cy
|
:data-cy
|
||||||
>
|
>
|
||||||
<template #header-selection>
|
<template #header-selection>
|
||||||
<VnCheckboxMenu
|
<div class="flex items-center no-wrap" style="display: flex">
|
||||||
:searchUrl="searchUrl"
|
<VnCheckbox
|
||||||
:expand="$props.multiCheck.expand"
|
v-model="selectAll"
|
||||||
v-model="selectAll"
|
@click="handleHeaderSelection('updateSelected', $event)"
|
||||||
:url="$attrs['url']"
|
/>
|
||||||
@update:selected="handleHeaderSelection('selected', $event)"
|
|
||||||
@select:all="handleHeaderSelection('selectAll', $event)"
|
<VnCheckboxMenu
|
||||||
/>
|
v-if="selectAll && $props.multiCheck.expand"
|
||||||
|
:searchUrl="searchUrl"
|
||||||
|
v-model="selectAll"
|
||||||
|
:url="$attrs['url']"
|
||||||
|
@update:selected="
|
||||||
|
handleHeaderSelection('updateSelected', $event)
|
||||||
|
"
|
||||||
|
@select:all="handleHeaderSelection('selectAll', $event)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
|
|
|
@ -9,10 +9,6 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const model = defineModel({ type: [Boolean] });
|
const model = defineModel({ type: [Boolean] });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
expand: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -22,29 +18,26 @@ const props = defineProps({
|
||||||
default: 'table',
|
default: 'table',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const value = ref(false);
|
|
||||||
const menuRef = ref(null);
|
const menuRef = ref(null);
|
||||||
const errorMessage = ref(null);
|
const errorMessage = ref(null);
|
||||||
const rows = ref(0);
|
const rows = ref(0);
|
||||||
const onClick = async () => {
|
const onClick = async () => {
|
||||||
errorMessage.value = null;
|
errorMessage.value = null;
|
||||||
|
|
||||||
if (value.value) {
|
const { filter } = JSON.parse(route.query[props.searchUrl]);
|
||||||
const { filter } = JSON.parse(route.query[props.searchUrl]);
|
filter.limit = 0;
|
||||||
filter.limit = 0;
|
const params = {
|
||||||
const params = {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
};
|
||||||
};
|
try {
|
||||||
try {
|
const { data } = axios.get(props.url, params);
|
||||||
const { data } = await axios.get(props.url, params);
|
rows.value = data;
|
||||||
rows.value = data;
|
} catch (error) {
|
||||||
} catch (error) {
|
const response = error.response;
|
||||||
const response = error.response;
|
if (response.data.error.name === 'UserError') {
|
||||||
if (response.data.error.name === 'UserError') {
|
errorMessage.value = t('tooManyResults');
|
||||||
errorMessage.value = t('tooManyResults');
|
} else {
|
||||||
} else {
|
errorMessage.value = response.data.error.message;
|
||||||
errorMessage.value = response.data.error.message;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -52,57 +45,53 @@ defineEmits(['update:selected', 'select:all']);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex items-center no-wrap" style="display: flex">
|
<QIcon
|
||||||
<VnCheckbox v-model="value" @click="$emit('update:selected', value)" />
|
style="margin-left: -10px"
|
||||||
<QIcon
|
data-cy="btnMultiCheck"
|
||||||
style="margin-left: -10px"
|
name="expand_more"
|
||||||
data-cy="btnMultiCheck"
|
@click="onClick"
|
||||||
v-if="value && $props.expand"
|
class="cursor-pointer"
|
||||||
name="expand_more"
|
color="primary"
|
||||||
@click="onClick"
|
size="xs"
|
||||||
class="cursor-pointer"
|
>
|
||||||
color="primary"
|
<QMenu
|
||||||
size="xs"
|
fit
|
||||||
|
anchor="bottom start"
|
||||||
|
self="top left"
|
||||||
|
ref="menuRef"
|
||||||
|
data-cy="menuMultiCheck"
|
||||||
>
|
>
|
||||||
<QMenu
|
<QList separator>
|
||||||
fit
|
<QItem
|
||||||
anchor="bottom start"
|
data-cy="selectAll"
|
||||||
self="top left"
|
v-ripple
|
||||||
ref="menuRef"
|
clickable
|
||||||
data-cy="menuMultiCheck"
|
@click="
|
||||||
>
|
$refs.menuRef.hide();
|
||||||
<QList separator>
|
$emit('select:all', toRaw(rows));
|
||||||
<QItem
|
"
|
||||||
data-cy="selectAll"
|
>
|
||||||
v-ripple
|
<QItemSection>
|
||||||
clickable
|
<QItemLabel>
|
||||||
@click="
|
<span v-text="t('Select all')" />
|
||||||
$refs.menuRef.hide();
|
</QItemLabel>
|
||||||
$emit('select:all', toRaw(rows));
|
<QItemLabel overline caption>
|
||||||
"
|
<span
|
||||||
>
|
v-if="errorMessage"
|
||||||
<QItemSection>
|
class="text-negative"
|
||||||
<QItemLabel>
|
v-text="errorMessage"
|
||||||
<span v-text="t('Select all')" />
|
/>
|
||||||
</QItemLabel>
|
<span
|
||||||
<QItemLabel overline caption>
|
v-else
|
||||||
<span
|
v-text="t('records', { rows: rows.length ?? 0 })"
|
||||||
v-if="errorMessage"
|
/>
|
||||||
class="text-negative"
|
</QItemLabel>
|
||||||
v-text="errorMessage"
|
</QItemSection>
|
||||||
/>
|
</QItem>
|
||||||
<span
|
<slot name="more-options"></slot>
|
||||||
v-else
|
</QList>
|
||||||
v-text="t('records', { rows: rows.length })"
|
</QMenu>
|
||||||
/>
|
</QIcon>
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<slot name="more-options"></slot>
|
|
||||||
</QList>
|
|
||||||
</QMenu>
|
|
||||||
</QIcon>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<i18n lang="yml">
|
<i18n lang="yml">
|
||||||
en:
|
en:
|
||||||
|
|
|
@ -351,6 +351,7 @@ globals:
|
||||||
vehicleList: Vehicles
|
vehicleList: Vehicles
|
||||||
vehicle: Vehicle
|
vehicle: Vehicle
|
||||||
entryPreAccount: Pre-account
|
entryPreAccount: Pre-account
|
||||||
|
management: Worker management
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Unsaved changes will be lost
|
title: Unsaved changes will be lost
|
||||||
subtitle: Are you sure exit without saving?
|
subtitle: Are you sure exit without saving?
|
||||||
|
|
|
@ -354,6 +354,7 @@ globals:
|
||||||
vehicleList: Vehículos
|
vehicleList: Vehículos
|
||||||
vehicle: Vehículo
|
vehicle: Vehículo
|
||||||
entryPreAccount: Precontabilizar
|
entryPreAccount: Precontabilizar
|
||||||
|
management: Gestión de trabajadores
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Los cambios que no haya guardado se perderán
|
title: Los cambios que no haya guardado se perderán
|
||||||
subtitle: ¿Seguro que quiere salir sin guardar?
|
subtitle: ¿Seguro que quiere salir sin guardar?
|
||||||
|
|
|
@ -33,14 +33,6 @@ const getLocale = (label) => {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params }">
|
<template #body="{ params }">
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput :label="t('FI')" v-model="params.fi" filled
|
|
||||||
><template #prepend>
|
|
||||||
<QIcon name="badge" size="xs"></QIcon> </template
|
|
||||||
></VnInput>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput :label="t('First Name')" v-model="params.firstName" filled />
|
<VnInput :label="t('First Name')" v-model="params.firstName" filled />
|
||||||
|
@ -112,7 +104,6 @@ es:
|
||||||
lastName: Apellidos
|
lastName: Apellidos
|
||||||
userName: Usuario
|
userName: Usuario
|
||||||
extension: Extensión
|
extension: Extensión
|
||||||
FI: NIF
|
|
||||||
First Name: Nombre
|
First Name: Nombre
|
||||||
Last Name: Apellidos
|
Last Name: Apellidos
|
||||||
User Name: Usuario
|
User Name: Usuario
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed, onMounted } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
|
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
import WorkerSummary from './Card/WorkerSummary.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import WorkerManagementFilter from './WorkerManagementFilter.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
const dataKey = 'ManagementList';
|
||||||
|
|
||||||
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('tableColumns.firstName'),
|
||||||
|
name: 'firstName',
|
||||||
|
isTitle: true,
|
||||||
|
columnFilter: {
|
||||||
|
name: 'firstName',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('tableColumns.lastName'),
|
||||||
|
name: 'lastName',
|
||||||
|
columnFilter: {
|
||||||
|
name: 'lastName',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('management.NIF'),
|
||||||
|
name: 'fi',
|
||||||
|
columnFilter: {
|
||||||
|
name: 'fi',
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('tableColumns.email'),
|
||||||
|
name: 'email',
|
||||||
|
columnFilter: {
|
||||||
|
name: 'email',
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('management.ssn'),
|
||||||
|
labelAbbreviation: t('management.ssn'),
|
||||||
|
toolTip: t('management.completeSsn'),
|
||||||
|
name: 'SSN',
|
||||||
|
columnFilter: {
|
||||||
|
name: 'SSN',
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'departmentFk',
|
||||||
|
label: t('tableColumns.department'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
name: 'departmentFk',
|
||||||
|
attrs: {
|
||||||
|
url: 'Departments',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.department),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
label: '',
|
||||||
|
name: 'tableActions',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('globals.pageTitles.summary'),
|
||||||
|
icon: 'preview',
|
||||||
|
action: (row) => viewSummary(row?.id, WorkerSummary),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const canAccess = useAcl().hasAcl('Worker', 'management', 'WRITE');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnSearchbar
|
||||||
|
:data-key
|
||||||
|
url="Workers/filter"
|
||||||
|
:label="t('management.search')"
|
||||||
|
:info="t('management.searchInfo')"
|
||||||
|
/>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<WorkerManagementFilter :data-key />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
url="Workers/filter"
|
||||||
|
:columns="columns"
|
||||||
|
:data-key
|
||||||
|
:right-search="false"
|
||||||
|
order="id DESC"
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -0,0 +1,99 @@
|
||||||
|
<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 VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
|
const { t, te } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const departments = ref();
|
||||||
|
|
||||||
|
const getLocale = (label) => {
|
||||||
|
const globalLocale = `globals.params.${label}`;
|
||||||
|
return te(globalLocale) ? t(globalLocale) : t(`management.${label}`);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData url="Departments" @on-fetch="(data) => (departments = data)" auto-load />
|
||||||
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ getLocale(tag.label) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params }">
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('tableColumns.firstName')"
|
||||||
|
v-model="params.firstName"
|
||||||
|
filled
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('tableColumns.lastName')"
|
||||||
|
v-model="params.lastName"
|
||||||
|
filled
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('management.NIF')"
|
||||||
|
v-model="params.fi"
|
||||||
|
filled
|
||||||
|
data-cy="worker-filter-fi"
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<QIcon name="badge" size="xs" />
|
||||||
|
</template>
|
||||||
|
</VnInput>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('tableColumns.email')"
|
||||||
|
v-model="params.email"
|
||||||
|
filled
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput :label="t('management.ssn')" v-model="params.SSN" filled />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('tableColumns.department')"
|
||||||
|
v-model="params.departmentFk"
|
||||||
|
:options="departments"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
|
@ -13,3 +13,11 @@ tableColumns:
|
||||||
SSN: SSN
|
SSN: SSN
|
||||||
extension: Extension
|
extension: Extension
|
||||||
queue: Queue
|
queue: Queue
|
||||||
|
management:
|
||||||
|
search: Search worker
|
||||||
|
searchInfo: You can search by NIF, NSS or worker name
|
||||||
|
NIF: NIF
|
||||||
|
ssn: SSN
|
||||||
|
completeSsn: National Insurance Number
|
||||||
|
firstName: First Name
|
||||||
|
lastName: Last Name
|
||||||
|
|
|
@ -16,3 +16,11 @@ tableColumns:
|
||||||
SSN: NSS
|
SSN: NSS
|
||||||
extension: Extensión
|
extension: Extensión
|
||||||
queue: Cola
|
queue: Cola
|
||||||
|
management:
|
||||||
|
search: Buscar trabajador
|
||||||
|
searchInfo: Puedes buscar por NIF, NSS o nombre del trabajador
|
||||||
|
NIF: NIF
|
||||||
|
ssn: Núm. SS
|
||||||
|
completeSsn: Número de Seguridad Social
|
||||||
|
firstName: Nombre
|
||||||
|
lastName: Apellidos
|
||||||
|
|
|
@ -239,7 +239,7 @@ export default {
|
||||||
icon: 'vn:worker',
|
icon: 'vn:worker',
|
||||||
moduleName: 'Worker',
|
moduleName: 'Worker',
|
||||||
keyBinding: 'w',
|
keyBinding: 'w',
|
||||||
menu: ['WorkerList', 'WorkerDepartment'],
|
menu: ['WorkerList', 'WorkerDepartment', 'WorkerManagement'],
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'WorkerMain' },
|
redirect: { name: 'WorkerMain' },
|
||||||
|
@ -283,6 +283,22 @@ export default {
|
||||||
departmentCard,
|
departmentCard,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'management',
|
||||||
|
name: 'WorkerManagement',
|
||||||
|
meta: {
|
||||||
|
title: 'management',
|
||||||
|
icon: 'view_list',
|
||||||
|
acls: [
|
||||||
|
{
|
||||||
|
model: 'Worker',
|
||||||
|
props: 'isRoleAdvanced',
|
||||||
|
accessType: 'READ',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Worker/WorkerManagement.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('OrderCatalog', () => {
|
describe.skip('OrderCatalog', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
describe('TicketList', () => {
|
describe('TicketList', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
cy.visit('/#/ticket/list', false);
|
cy.visit('/#/ticket/list', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ describe('TicketList', () => {
|
||||||
});
|
});
|
||||||
}).as('ticket');
|
}).as('ticket');
|
||||||
|
|
||||||
cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse Five');
|
cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse One');
|
||||||
cy.searchBtnFilterPanel();
|
cy.searchBtnFilterPanel();
|
||||||
cy.wait('@ticket').then((interception) => {
|
cy.wait('@ticket').then((interception) => {
|
||||||
const data = interception.response.body[0];
|
const data = interception.response.body[0];
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
describe('WorkerManagement', () => {
|
||||||
|
const nif = '12091201A';
|
||||||
|
const searchButton = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
|
||||||
|
const url = '/#/worker/management';
|
||||||
|
|
||||||
|
it('should not enter the section', () => {
|
||||||
|
cy.login('salesPerson');
|
||||||
|
cy.visit(url);
|
||||||
|
cy.url().should('include', '/dashboard');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should enter the section and filter by NIF, then open the worker summary popup', () => {
|
||||||
|
cy.login('hr');
|
||||||
|
cy.visit(url);
|
||||||
|
cy.dataCy('worker-filter-fi').type(nif);
|
||||||
|
cy.get(searchButton).click();
|
||||||
|
cy.dataCy('tableAction-0').click();
|
||||||
|
cy.get('.summaryHeader').should('exist');
|
||||||
|
cy.get('.summaryHeader').should('be.visible');
|
||||||
|
cy.get('.summaryBody').should('exist');
|
||||||
|
cy.get('.summaryBody').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue