From b71d24cf3d47edcda32e6a7734112796b5510cde Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 21 Aug 2024 14:13:36 +0200 Subject: [PATCH] feat: refs #7346 sonarLint warnings --- src/css/app.scss | 4 ---- src/pages/InvoiceOut/InvoiceOutGlobal.vue | 12 +++++++----- src/stores/invoiceOutGlobal.js | 9 ++------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/css/app.scss b/src/css/app.scss index c233b14f0..b2976b86a 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -103,10 +103,6 @@ select:-webkit-autofill { border-radius: 8px; } -.card-width { - width: 770px; -} - .vn-card-list { width: 100%; max-width: 60em; diff --git a/src/pages/InvoiceOut/InvoiceOutGlobal.vue b/src/pages/InvoiceOut/InvoiceOutGlobal.vue index eecc61bc2..5f2eb3c02 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobal.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobal.vue @@ -94,11 +94,13 @@ const selectCustomerId = (id) => { }; const statusText = computed(() => { - return status.value === 'invoicing' - ? `${t(`status.${status.value}`)} ${ - addresses.value[getAddressNumber.value]?.clientId - }` - : t(`status.${status.value}`); + const baseStatus = t(`status.${status.value}`); + const clientId = + status.value === 'invoicing' + ? addresses.value[getAddressNumber.value]?.clientId || '' + : ''; + + return clientId ? `${baseStatus} ${clientId}`.trim() : baseStatus; }); onMounted(() => (stateStore.rightDrawer = true)); diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js index 669d65728..42acac013 100644 --- a/src/stores/invoiceOutGlobal.js +++ b/src/stores/invoiceOutGlobal.js @@ -200,12 +200,7 @@ export const useInvoiceOutGlobalStore = defineStore({ this.addressIndex++; this.isInvoicing = false; } catch (err) { - if ( - err && - err.response && - err.response.status >= 400 && - err.response.status < 500 - ) { + if (err?.response?.status >= 400 && err?.response?.status < 500) { this.invoiceClientError(address, err.response?.data?.error?.message); return; } else { @@ -252,7 +247,7 @@ export const useInvoiceOutGlobalStore = defineStore({ params, }); - if (data.data && data.data.error) throw new Error(); + if (data?.data?.error) throw new Error(); const status = exportFile('negativeBases.csv', data, { encoding: 'windows-1252',