refs #6157 refactor stateColor, updateDestinations, change responsability
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-11-09 13:52:45 +01:00
parent 20bbee8397
commit ae655dabe2
5 changed files with 32 additions and 28 deletions

View File

@ -103,27 +103,17 @@ function getDestination(destinationId) {
return destinationTypes.value.find((type) => type.id == destinationId);
}
async function deleteSale(sale) {
await axios.post(`ClaimEnds/deleteClamedSales`, { sales: [sale] });
claimActionsForm.value.reload();
}
async function updateDestinations(claimDestinationFk) {
if (claimDestinationFk) {
await axios.post('Claims/updateClaimDestination', {
claimDestinationFk,
rows: [...selectedRows.value],
});
claimActionsForm.value.reload();
}
await updateDestination(claimDestinationFk, selectedRows.value, { reload: true });
}
async function updateDestination(claimDestinationFk, row) {
async function updateDestination(claimDestinationFk, row, options = {}) {
if (claimDestinationFk) {
await axios.post('Claims/updateClaimDestination', {
claimDestinationFk,
rows: [row],
rows: Array.isArray(row) ? row : [row],
});
options.reload && claimActionsForm.value.reload();
}
}
@ -251,7 +241,7 @@ async function importToNewRefundTicket() {
class="responsibility { 'background-color:primary': quasar.platform.is.mobile }"
v-model="claim.responsibility"
:label-value="t('claim.summary.responsibility')"
@update:model-value="(value) => save({ responsibility: value })"
@change="(value) => save({ responsibility: value })"
label-always
color="primary"
markers

View File

@ -62,10 +62,15 @@ const filter = {
],
};
const STATE_COLOR = {
pending: 'positive',
managed: 'warning',
resolved: 'negative',
};
function stateColor(code) {
if (code === 'pending') return 'positive';
if (code === 'managed') return 'warning';
if (code === 'resolved') return 'negative';
return STATE_COLOR[code];
}
const data = ref(useCardDescription());
const setData = (entity) => {

View File

@ -85,10 +85,15 @@ const detailsColumns = ref([
},
]);
const STATE_COLOR = {
pending: 'positive',
managed: 'warning',
resolved: 'negative',
};
function stateColor(code) {
if (code === 'pending') return 'green';
if (code === 'managed') return 'orange';
if (code === 'resolved') return 'red';
return STATE_COLOR[code];
}
const developmentColumns = ref([

View File

@ -17,12 +17,16 @@ const router = useRouter();
const quasar = useQuasar();
const { t } = useI18n();
function stateColor(code) {
if (code === 'pending') return 'green';
if (code === 'managed') return 'orange';
if (code === 'resolved') return 'red';
}
const STATE_COLOR = {
pending: 'positive',
managed: 'warning',
resolved: 'negative',
};
function stateColor(code) {
return STATE_COLOR[code];
}
function navigate(id) {
router.push({ path: `/claim/${id}` });
}

View File

@ -1,7 +1,7 @@
/// <reference types="cypress" />
describe('ClaimAction', () => {
const claimId = 2;
const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)';
const firstRow = 'tbody > :nth-child(1)';
beforeEach(() => {
@ -15,7 +15,7 @@ describe('ClaimAction', () => {
});
it('should change destination', () => {
const rowData = [true, null, null, 'Bueno', null, null, null, null, null, null];
const rowData = [true, null, null, 'Bueno'];
cy.fillRow(firstRow, rowData);
});