Compare commits

...

24 Commits

Author SHA1 Message Date
Robert Ferrús a350de9119 Merge branch 'dev' into 6679-addCreateIcon
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-10 11:30:21 +00:00
Jon Elias 81d0e397f0 Merge pull request '#7186 - tabIndexVATExpenses' (!277) from 7186-tabIndexVATExpenses into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #277
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-04-10 07:37:01 +00:00
Jon Elias e3e6c74afa Merge branch 'dev' into 7186-tabIndexVATExpenses
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-10 07:36:17 +00:00
Jon Elias 09ceefb7c5 style: refs #7186 fixed style
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-10 08:49:54 +02:00
Jorge Penadés a153146f82 Merge pull request '#6992 add URL params' (!273) from 6992-addQueryParamsUrl into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #273
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-04-10 06:45:14 +00:00
Jon Elias f9de26933a refactor: refs #7186 fill-icon change
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-10 08:00:36 +02:00
Jorge Penadés 83bf8183f0 fix: refs #6992 warning console & formModel hook
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 15:12:54 +02:00
Jorge Penadés 6349a3e790 feat: refs #6992 comments
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 15:08:54 +02:00
Jon Elias 15d4b54dda refactor: refs #7186 fixed changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 13:34:45 +02:00
Jon Elias 65626446fd refactor: refs #7186 fixed style and tab
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 13:01:29 +02:00
Jon Elias c217e8a1a7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7186-tabIndexVATExpenses 2024-04-09 11:44:11 +02:00
Jorge Penadés 50bce40613 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6992-addQueryParamsUrl
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 10:09:41 +02:00
Guillermo Bonet be9dd8b2b7 Merge pull request 'feat: refs #6636 Added pickup in claim' (!268) from 6636-pickup into dev
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-dev This commit looks good Details
Reviewed-on: #268
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-04-09 08:04:58 +00:00
Guillermo Bonet 4b9e69625b Merge branch 'dev' into 6636-pickup
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 08:02:30 +00:00
Jorge Penadés fdfa99c718 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6992-addQueryParamsUrl
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-09 09:55:44 +02:00
Jon Elias 0e064b3305 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6899-endInvoiceOutMigration 2024-04-09 08:45:12 +02:00
Jorge Penadés 16548dadef feat: refs #6992 add test
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-08 16:38:36 +02:00
Jorge Penadés 8de3ea16a6 fix: refs #6992 add queryParams
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-08 15:15:18 +02:00
Guillermo Bonet b2ef381f1d Merge branch 'dev' into 6636-pickup
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-08 05:18:34 +00:00
Guillermo Bonet 1a15ccec2c fix: refs #6636 Call getEnumValues method
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-05 11:01:48 +02:00
Guillermo Bonet 9310d863aa fix: refs #6636 Icon save and reset
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-05 07:39:05 +02:00
Guillermo Bonet 58b9eb1c78 feat: refs #6636 Requested changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-05 07:29:25 +02:00
Guillermo Bonet 8d7670cc85 Merge branch 'dev' into 6636-pickup
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-05 05:24:31 +00:00
Guillermo Bonet b09ecefad4 feat: refs #6636 Added pickup in claim
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-04-04 14:12:16 +02:00
13 changed files with 129 additions and 46 deletions

View File

@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
### Fixed
- (General) => Se vuelven a mostrar los parámetros en la url al aplicar un filtro
## [2414.01] - 2024-04-04
### Added

View File

@ -101,16 +101,16 @@ onMounted(async () => {
});
onBeforeRouteLeave((to, from, next) => {
if (!hasChanges.value) next();
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('Unsaved changes will be lost'),
message: t('Are you sure exit without saving?'),
promise: () => next(),
},
});
if (hasChanges.value)
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('Unsaved changes will be lost'),
message: t('Are you sure exit without saving?'),
promise: () => next(),
},
});
else next();
});
onUnmounted(() => {
@ -132,12 +132,12 @@ const formUrl = computed(() => $props.url);
const defaultButtons = computed(() => ({
save: {
color: 'primary',
icon: 'restart_alt',
icon: 'save',
label: 'globals.save',
},
reset: {
color: 'primary',
icon: 'save',
icon: 'restart_alt',
label: 'globals.reset',
},
...$props.defaultButtons,

View File

@ -5,7 +5,7 @@ import { useCapitalize } from 'src/composables/useCapitalize';
import VnInput from 'src/components/common/VnInput.vue';
const props = defineProps({
modelValue: { type: String, default: '' },
modelValue: { type: [String, Number], default: '' },
});
const { t } = useI18n();

View File

@ -1030,7 +1030,7 @@ en:
ticketCreated: Created
created: Created
isChargedToMana: Charged to mana
hasToPickUp: Has to pick Up
pickup: Type of pickup
dmsFk: Document ID
text: Description
claimStateFk: Claim State
@ -1069,7 +1069,7 @@ es:
ticketCreated: Creado
created: Creado
isChargedToMana: Cargado a maná
hasToPickUp: Se debe recoger
pickup: Se debe recoger
dmsFk: ID documento
text: Descripción
claimStateFk: Estado de la reclamación

View File

@ -1,5 +1,5 @@
import { onMounted, ref, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { useRoute } from 'vue-router';
import axios from 'axios';
import { useArrayDataStore } from 'stores/useArrayDataStore';
import { buildFilter } from 'filters/filterPanel';
@ -15,7 +15,6 @@ export function useArrayData(key, userOptions) {
const store = arrayDataStore.get(key);
const hasMoreData = ref(false);
const router = useRouter();
const route = useRoute();
let canceller = null;
@ -105,7 +104,7 @@ export function useArrayData(key, userOptions) {
for (const row of response.data) store.data.push(row);
} else {
store.data = response.data;
if (!document.querySelectorAll('[role="dialog"]'))
if (!document.querySelectorAll('[role="dialog"]').length)
updateRouter && updateStateParams();
}
@ -188,11 +187,15 @@ export function useArrayData(key, userOptions) {
if (store.userParams && Object.keys(store.userParams).length !== 0)
query.params = JSON.stringify(store.userParams);
if (router)
router.replace({
path: route.path,
query: query,
});
const url = new URL(window.location.href);
const { hash: currentHash } = url;
const [currentRoute] = currentHash.split('?');
const params = new URLSearchParams();
for (const param in query) params.append(param, query[param]);
url.hash = currentRoute + '?' + params.toString();
window.history.pushState({}, '', url.hash);
}
const totalRows = computed(() => (store.data && store.data.length) || 0);

View File

@ -544,6 +544,7 @@ export default {
assignedTo: 'Assigned',
attendedBy: 'Attended by',
created: 'Created',
pickup: 'Pickup',
state: 'State',
details: 'Details',
item: 'Item',
@ -565,13 +566,19 @@ export default {
responsible: 'Responsible',
worker: 'Worker',
redelivery: 'Redelivery',
null: 'No',
agency: 'Agency',
delivery: 'Delivery',
},
basicData: {
customer: 'Customer',
assignedTo: 'Assigned',
created: 'Created',
state: 'State',
picked: 'Picked',
pickup: 'Pickup',
null: 'No',
agency: 'Agency',
delivery: 'Delivery',
},
photo: {
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',

View File

@ -543,6 +543,7 @@ export default {
assignedTo: 'Asignada a',
attendedBy: 'Atendida por',
created: 'Creada',
pickup: 'Recogida',
state: 'Estado',
details: 'Detalles',
item: 'Artículo',
@ -564,13 +565,19 @@ export default {
responsible: 'Responsable',
worker: 'Trabajador',
redelivery: 'Devolución',
null: 'No',
agency: 'Agencia',
delivery: 'Reparto',
},
basicData: {
customer: 'Cliente',
assignedTo: 'Asignada a',
created: 'Creada',
state: 'Estado',
picked: 'Recogida',
pickup: 'Recogida',
null: 'No',
agency: 'Agencia',
delivery: 'Reparto',
},
photo: {
fileDescription:

View File

@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import axios from 'axios';
import { useSession } from 'src/composables/useSession';
const route = useRoute();
@ -24,7 +25,7 @@ const claimFilter = {
'workerFk',
'claimStateFk',
'packages',
'hasToPickUp',
'pickup',
],
include: [
{
@ -50,6 +51,20 @@ function setClaimStates(data) {
claimStates.value = data;
claimStatesCopy.value = data;
}
let optionsList;
async function getEnumValues() {
optionsList = [{ id: null, description: t('claim.basicData.null') }];
const { data } = await axios.get(`Applications/get-enum-values`, {
params: {
schema: 'vn',
table: 'claim',
column: 'pickup',
},
});
for (let value of data)
optionsList.push({ id: value, description: t(`claim.basicData.${value}`) });
}
getEnumValues();
const workerFilter = {
options: workers,
@ -168,13 +183,19 @@ const statesFilter = {
type="number"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox
v-model="data.hasToPickUp"
:label="t('claim.basicData.picked')"
/>
<QSelect
v-model="data.pickup"
:options="optionsList"
option-value="id"
option-label="description"
emit-value
:label="t('claim.basicData.pickup')"
map-options
use-input
:input-debounce="0"
>
</QSelect>
</div>
</VnRow>
</template>

View File

@ -220,10 +220,9 @@ function openDialog(dmsId) {
/>
</template>
</VnLv>
<QCheckbox
:label="t('claim.basicData.picked')"
v-model="claim.hasToPickUp"
:disable="true"
<VnLv
:label="t('claim.summary.pickup')"
:value="t(`claim.summary.${claim.pickup}`)"
/>
</QCard>
<QCard class="vn-three">

View File

@ -32,6 +32,13 @@ const invoiceInFormRef = ref();
const expensesRef = ref();
const newExpenseRef = ref();
defineProps({
actionIcon: {
type: String,
default: 'add',
},
});
const columns = computed(() => [
{
name: 'expense',
@ -207,17 +214,16 @@ async function addExpense() {
@click.stop="value = null"
class="cursor-pointer"
/>
<QBtn
padding="xs"
round
flat
icon="add_circle"
@click.stop="newExpenseRef.show()"
<QIcon
@click.stop.prevent="newExpenseRef.show()"
:name="actionIcon"
size="xs"
class="default-icon"
>
<QTooltip>
{{ t('Create expense') }}
</QTooltip>
</QBtn>
</QIcon>
</template>
</VnSelectFilter>
</QTd>
@ -470,6 +476,11 @@ async function addExpense() {
.q-item {
min-height: 0;
}
.default-icon {
cursor: pointer;
border-radius: 50px;
background-color: $primary;
}
</style>
<i18n>
es:

View File

@ -36,7 +36,7 @@ describe('VnSearchBar', () => {
const checkCardListAndUrl = (expectedLength) => {
cy.get(cardList).then(($cardList) => {
expect($cardList.find('.q-card').length).to.equal(expectedLength);
cy.url().then((currentUrl) => expect(currentUrl).to.equal(url));
cy.url().then((currentUrl) => expect(currentUrl).to.contain(url));
});
};
});

View File

@ -38,10 +38,10 @@ describe('VnLog', () => {
action: 'update',
changedModel: 'Claim',
oldInstance: {
hasToPickUp: false,
pickup: null,
},
newInstance: {
hasToPickUp: true,
pickup: 'agency',
},
creationDate: '2023-09-18T12:25:34.000Z',
changedModelId: '1',

View File

@ -0,0 +1,31 @@
import { describe, expect, it, beforeAll } from 'vitest';
import { axios } from 'app/test/vitest/helper';
import { useArrayData } from 'composables/useArrayData';
describe('useArrayData', () => {
let arrayData;
beforeAll(() => {
axios.get.mockResolvedValue({ data: [] });
arrayData = useArrayData('InvoiceIn', { url: 'invoice-in/list' });
Object.defineProperty(window.location, 'href', {
writable: true,
value: 'localhost:9000/invoice-in/list',
});
// Mock the window.history.pushState method within useArrayData
window.history.pushState = (data, title, url) => (window.location.href = url);
// Mock the URL constructor within useArrayData
global.URL = class URL {
constructor(url) {
this.hash = url.split('localhost:9000/')[1];
}
};
});
it('should add the params to the url', async () => {
arrayData.store.userParams = { supplierFk: 2 };
arrayData.updateStateParams();
expect(window.location.href).contain('params=%7B%22supplierFk%22%3A2%7D');
});
});