diff --git a/quasar.config.js b/quasar.config.js index 005a922d7..6e8a8f21c 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -9,7 +9,7 @@ // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js const { configure } = require('quasar/wrappers'); -const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/vite') +const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/vite'); const path = require('path'); module.exports = configure(function (/* ctx */) { @@ -140,6 +140,8 @@ module.exports = configure(function (/* ctx */) { // Quasar plugins plugins: ['Notify', 'Dialog'], + //all: 'auto', + //autoImportComponentCase: 'pascal', }, // animations: 'all', // --- includes all animations diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 80f6dba45..88f8856e6 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -21,7 +21,14 @@ onMounted(() => stateStore.setMounted()); - + {{ t('globals.collapseMenu') }} diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index e2e233d3d..2d41c36a2 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -16,7 +16,7 @@ const props = defineProps({ module: { type: String, required: true, - } + }, }); const slots = useSlots(); @@ -24,14 +24,18 @@ const { t } = useI18n(); onMounted(() => fetch()); +const emit = defineEmits(['onFetch']); + const entity = ref(); async function fetch() { const params = {}; - if (props.filter) params.filter = props.filter; + if (props.filter) params.filter = JSON.stringify(props.filter); const { data } = await axios.get(props.url, { params }); entity.value = data; + + emit('onFetch', data); } watch(props, async () => { @@ -46,9 +50,9 @@ watch(props, async () => { - {{ - t('components.cardDescriptor.mainList') - }} + + {{ t('components.cardDescriptor.mainList') }} + { + - + @@ -98,6 +103,7 @@ watch(props, async () => { + diff --git a/src/components/ui/TeleportSlot.vue b/src/components/ui/TeleportSlot.vue deleted file mode 100644 index 6a3f19ef0..000000000 --- a/src/components/ui/TeleportSlot.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 04f4d7245..5df2bc900 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -87,15 +87,29 @@ async function search() { + + + + +es: + This claim is not associated to any RMA: Esta reclamación no está asociada a ninguna ARM + diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index 071fb83c6..dbc3aa1c1 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -3,12 +3,11 @@ import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import { useQuasar } from 'quasar'; import { useStateStore } from 'stores/useStateStore'; -import { toDate } from 'src/filters/index'; -import Paginate from 'src/components/PaginateData.vue'; +import { toDate } from 'filters/index'; +import Paginate from 'components/PaginateData.vue'; import ClaimSummaryDialog from './Card/ClaimSummaryDialog.vue'; -import CustomerDescriptorPopover from 'src/pages/Customer/Card/CustomerDescriptorPopover.vue'; -import TeleportSlot from 'components/ui/TeleportSlot.vue'; -import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; +import CustomerDescriptorPopover from 'pages/Customer/Card/CustomerDescriptorPopover.vue'; +import VnSearchbar from 'components/ui/VnSearchbar.vue'; import ClaimFilter from './ClaimFilter.vue'; const stateStore = useStateStore(); @@ -37,22 +36,30 @@ function viewSummary(id) { - - - - - - - - {{ t('globals.collapseMenu') }} - - - - + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 010fb7b99..d3fb133cf 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -3,20 +3,19 @@ import { useI18n } from 'vue-i18n'; import { useStateStore } from 'stores/useStateStore'; import CustomerDescriptor from './CustomerDescriptor.vue'; import LeftMenu from 'components/LeftMenu.vue'; -import TeleportSlot from 'components/ui/TeleportSlot.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; const stateStore = useStateStore(); const { t } = useI18n(); - + - + diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index ca5f4adaa..91a644c71 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -4,6 +4,7 @@ import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { toCurrency } from 'src/filters'; import CardDescriptor from 'components/ui/CardDescriptor.vue'; +import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; const $props = defineProps({ id: { @@ -30,7 +31,10 @@ const entityId = computed(() => { {{ t('customer.card.salesPerson') }} - {{ entity.salesPersonUser.name }} + + {{ entity.salesPersonUser.name }} + + diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index 429e15e0e..faa960512 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -5,7 +5,6 @@ import { useQuasar } from 'quasar'; import { useStateStore } from 'stores/useStateStore'; import Paginate from 'src/components/PaginateData.vue'; import CustomerSummaryDialog from './Card/CustomerSummaryDialog.vue'; -import TeleportSlot from 'components/ui/TeleportSlot.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import CustomerFilter from './CustomerFilter.vue'; @@ -29,22 +28,30 @@ function viewSummary(id) { - - - - - - - - {{ t('globals.collapseMenu') }} - - - - + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + @@ -113,7 +120,7 @@ function viewSummary(id) { diff --git a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue index 8e693fd81..de3862835 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue @@ -3,20 +3,19 @@ import { useI18n } from 'vue-i18n'; import { useStateStore } from 'stores/useStateStore'; import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue'; import LeftMenu from 'components/LeftMenu.vue'; -import TeleportSlot from 'components/ui/TeleportSlot.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; const stateStore = useStateStore(); const { t } = useI18n(); - + - + diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 46228e5de..b05376079 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -7,7 +7,6 @@ import { useStateStore } from 'stores/useStateStore'; import Paginate from 'src/components/PaginateData.vue'; import InvoiceOutSummaryDialog from './Card/InvoiceOutSummaryDialog.vue'; import { toDate, toCurrency } from 'src/filters/index'; -import TeleportSlot from 'components/ui/TeleportSlot.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import InvoiceOutFilter from './InvoiceOutFilter.vue'; @@ -34,22 +33,30 @@ function viewSummary(id) { - - - - - - - - {{ t('globals.collapseMenu') }} - - - - + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue index 1a8c5a1af..f644d47b2 100644 --- a/src/pages/Ticket/Card/TicketCard.vue +++ b/src/pages/Ticket/Card/TicketCard.vue @@ -3,20 +3,19 @@ import { useI18n } from 'vue-i18n'; import { useStateStore } from 'stores/useStateStore'; import TicketDescriptor from './TicketDescriptor.vue'; import LeftMenu from 'components/LeftMenu.vue'; -import TeleportSlot from 'components/ui/TeleportSlot.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; const stateStore = useStateStore(); const { t } = useI18n(); - + - + diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index a0fe69b3b..7b5598048 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -7,8 +7,6 @@ import { useStateStore } from 'stores/useStateStore'; import Paginate from 'src/components/PaginateData.vue'; import { toDate, toCurrency } from 'src/filters/index'; import TicketSummaryDialog from './Card/TicketSummaryDialog.vue'; - -import TeleportSlot from 'components/ui/TeleportSlot.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import TicketFilter from './TicketFilter.vue'; @@ -71,22 +69,30 @@ function viewSummary(id) { - - - - - - - - {{ t('globals.collapseMenu') }} - - - - + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue new file mode 100644 index 000000000..02c472d19 --- /dev/null +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + +es: + Search worker: Buscar trabajador + You can search by worker id or name: Puedes buscar por id o nombre del trabajador + diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue new file mode 100644 index 000000000..e138be22e --- /dev/null +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -0,0 +1,138 @@ + + + (worker = data)" + > + + + + + + + + + + {{ t('worker.imageNotFound') }} + + + + + + + + + {{ entity.user.nickname }} + {{ entity.user.nickname }} + + + + + + + {{ t('worker.card.name') }} + {{ entity.user.nickname }} + + + + + + {{ t('worker.card.email') }} + + {{ entity.user.email }} + + + + + + {{ t('worker.list.department') }} + + + {{ entity.department.department.name }} + + + + + + + {{ t('worker.card.phone') }} + + {{ entity.phone }} + + + + + {{ t('worker.summary.sipExtension') }} + + {{ sip }} + + + + + + + + diff --git a/src/pages/Worker/Card/WorkerDescriptorProxy.vue b/src/pages/Worker/Card/WorkerDescriptorProxy.vue new file mode 100644 index 000000000..be03485f7 --- /dev/null +++ b/src/pages/Worker/Card/WorkerDescriptorProxy.vue @@ -0,0 +1,16 @@ + + + + + + + diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue new file mode 100644 index 000000000..39054e6bc --- /dev/null +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -0,0 +1,292 @@ + + + + + + + + + {{ worker.id }} - {{ worker.firstName }} {{ worker.lastName }} + + + + + + {{ t('worker.summary.basicData') }} + + + + ID + {{ worker.id }} + + + + + {{ t('worker.card.name') }} + + + {{ worker.user.nickname }} + + + + + + {{ t('worker.list.department') }} + + {{ + worker.department.department.name + }} + + + + + {{ t('worker.list.email') }} + + {{ worker.user.email }} + + + + + + {{ t('worker.summary.boss') }} + + + + {{ worker.boss.name }} + + + + + + + + {{ t('worker.summary.phoneExtension') }} + + + {{ + worker.mobileExtension == '' + ? worker.mobileExtension + : '-' + }} + + + + + + {{ t('worker.summary.entPhone') }} + + {{ + worker.phone == '' ? worker.phone : '-' + }} + + + + + {{ t('worker.summary.personalPhone') }} + + {{ + worker.client.phone == '' + ? worker.client.phone + : '-' + }} + + + + + + + + {{ t('worker.summary.userData') }} + + + + + {{ t('worker.summary.userId') }} + + {{ worker.user.id }} + + + + + {{ t('worker.card.name') }} + + {{ + worker.user.nickname + }} + + + + + {{ t('worker.summary.role') }} + + {{ + worker.user.role.name + }} + + + + + {{ t('worker.summary.sipExtension') }} + + {{ sipExtension() }} + + + + + + + + + + diff --git a/src/pages/Worker/Card/WorkerSummaryDialog.vue b/src/pages/Worker/Card/WorkerSummaryDialog.vue new file mode 100644 index 000000000..4eedb6f6a --- /dev/null +++ b/src/pages/Worker/Card/WorkerSummaryDialog.vue @@ -0,0 +1,21 @@ + + + + + + + diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue new file mode 100644 index 000000000..24dfec7a5 --- /dev/null +++ b/src/pages/Worker/WorkerFilter.vue @@ -0,0 +1,121 @@ + + + + (departments = data)" auto-load /> + + + + {{ t(`params.${tag.label}`) }}: + {{ formatFn(tag.value) }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +en: + params: + search: Contains + fi: FI + firstName: First name + lastName: Last name + userName: User + extension: Extension +es: + params: + search: Contiene + fi: NIF + firstName: Nombre + lastName: Apellidos + userName: Usuario + extension: Extensión + FI: NIF + First Name: Nombre + Last Name: Apellidos + User Name: Usuario + Department: Departamento + Extension: Extensión + diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue new file mode 100644 index 000000000..8b0d9392c --- /dev/null +++ b/src/pages/Worker/WorkerList.vue @@ -0,0 +1,155 @@ + + + + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + + + + + + + + + + + + + + + {{ row.nickname }} + + #{{ row.id }} + + + + + {{ t('worker.list.name') }} + + {{ + row.userName + }} + + + + + + {{ t('worker.list.email') }} + + {{ row.email }} + + + + + {{ + t('worker.list.department') + }} + + {{ row.department }} + + + + + + + + + + {{ t('components.smartCard.openCard') }} + + + + + {{ t('components.smartCard.openSummary') }} + + + + + + + + + + + + + + +es: + Search worker: Buscar trabajador + You can search by worker id or name: Puedes buscar por id o nombre del trabajador + diff --git a/src/pages/Worker/WorkerMain.vue b/src/pages/Worker/WorkerMain.vue new file mode 100644 index 000000000..2fb079daa --- /dev/null +++ b/src/pages/Worker/WorkerMain.vue @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/src/router/modules/index.js b/src/router/modules/index.js index dcb3fa5c2..ca8b3c958 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -2,10 +2,12 @@ import Customer from './customer'; import Ticket from './ticket'; import Claim from './claim'; import InvoiceOut from './invoiceOut'; +import Worker from './worker'; export default [ Customer, Ticket, Claim, - InvoiceOut + InvoiceOut, + Worker ] diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js new file mode 100644 index 000000000..b1b67fd4d --- /dev/null +++ b/src/router/modules/worker.js @@ -0,0 +1,51 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/worker', + name: 'Worker', + meta: { + title: 'workers', + icon: 'vn:worker', + }, + component: RouterView, + redirect: { name: 'WorkerMain' }, + menus: { + main: ['WorkerList'], + card: [], + }, + children: [ + { + path: '', + name: 'WorkerMain', + component: () => import('src/pages/Worker/WorkerMain.vue'), + redirect: { name: 'WorkerList' }, + children: [ + { + path: 'list', + name: 'WorkerList', + meta: { + title: 'list', + icon: 'view_list', + }, + component: () => import('src/pages/Worker/WorkerList.vue'), + }, + ], + }, + { + name: 'WorkerCard', + path: ':id', + component: () => import('src/pages/Worker/Card/WorkerCard.vue'), + redirect: { name: 'WorkerSummary' }, + children: [ + { + name: 'WorkerSummary', + path: 'summary', + meta: { + title: 'summary', + }, + component: () => import('src/pages/Worker/Card/WorkerSummary.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/routes.js b/src/router/routes.js index a1634b3c7..c92075a82 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,6 +1,7 @@ import customer from './modules/customer'; import ticket from './modules/ticket'; import claim from './modules/claim'; +import worker from './modules/worker'; import invoiceOut from './modules/invoiceOut'; const routes = [ @@ -26,6 +27,7 @@ const routes = [ customer, ticket, claim, + worker, invoiceOut, { path: '/:catchAll(.*)*', diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index 6d1a74326..3b2c7e8a7 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -6,7 +6,7 @@ import { useRole } from 'src/composables/useRole'; import routes from 'src/router/modules'; export const useNavigationStore = defineStore('navigationStore', () => { - const modules = ['customer', 'claim', 'ticket', 'invoiceOut']; + const modules = ['customer', 'claim', 'ticket', 'invoiceOut', 'worker']; const pinnedModules = ref([]); const role = useRole(); diff --git a/test/cypress/integration/workerList.spec.js b/test/cypress/integration/workerList.spec.js new file mode 100644 index 000000000..9f3d62448 --- /dev/null +++ b/test/cypress/integration/workerList.spec.js @@ -0,0 +1,20 @@ +describe('WorkerList', () => { + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('developer'); + cy.visit('/#/worker/list'); + }); + + it('should load workers', () => { + cy.get('div[class="q-item__label text-h6"]').eq(0).should('have.text', 'Jessica Jones'); + cy.get('div[class="q-item__label text-h6"]').eq(1).should('have.text', 'Bruce Banner'); + cy.get('div[class="q-item__label text-h6"]').eq(2).should('have.text', 'Charles Xavier'); + }); + + it('should open the worker summary', () => { + cy.get('div[class="q-item__section column q-item__section--side justify-center q-pa-md"]').eq(0).click(); + cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '1110 - Jessica Jones'); + cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(0).should('have.text', 'Basic data'); + cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(1).should('have.text', 'User data'); + }); +}); diff --git a/test/cypress/integration/workerSummary.spec.js b/test/cypress/integration/workerSummary.spec.js new file mode 100644 index 000000000..ae01378f6 --- /dev/null +++ b/test/cypress/integration/workerSummary.spec.js @@ -0,0 +1,15 @@ +describe('WorkerSummary', () => { + beforeEach(() => { + cy.viewport(1280, 720) + cy.login('developer') + cy.visit('/#/worker/19/summary'); + }); + + it('should load worker summary', () => { + cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '19 - salesBoss'); + cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(0).should('have.text', 'Basic data'); + cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(1).should('have.text', 'User data'); + cy.get('div[class="q-item__section column q-item__section--main justify-center"]').eq(0).should('have.text', 'NamesalesBossNick'); + }); + +}); \ No newline at end of file