refs #6335 style(ticketAdvance): fix with split-progress
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-11-03 07:57:53 +01:00
parent 740d2fb976
commit a523e32373
10 changed files with 23 additions and 47 deletions

View File

@ -722,7 +722,7 @@ export default {
isFullMovable: 'vn-check[ng-model="filter.isFullMovable"]',
warehouseFk: 'vn-autocomplete[label="Warehouse"]',
tableButtonSearch: 'vn-button[vn-tooltip="Search"]',
moveButton: 'vn-button[vn-tooltip="Advance tickets"]',
moveButton: 'vn-button[vn-tooltip="Advance tickets with negatives"]',
acceptButton: '.vn-confirm.shown button[response="accept"]',
firstCheck: 'tbody > tr:nth-child(2) > td > vn-check',
tableId: 'vn-textfield[name="id"]',

View File

@ -196,6 +196,7 @@
"Negative basis of tickets: 23": "Negative basis of tickets: 23",
"Booking completed": "Booking complete",
"The ticket is in preparation": "The ticket [{{ticketId}}]({{{ticketUrl}}}) of the sales person {{salesPersonId}} is in preparation",
"You can only add negative amounts in refund tickets": "You can only add negative amounts in refund tickets"
"You can only add negative amounts in refund tickets": "You can only add negative amounts in refund tickets",
"newTicket": "New ticket",
"keepPrice": "Keep prices"
}

View File

@ -111,7 +111,6 @@ module.exports = Self => {
Self.componentUpdate = async(ctx, options) => {
const args = ctx.args;
const originalTicketId = args.id;
const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
@ -284,7 +283,6 @@ module.exports = Self => {
}
response.id = args.id;
console.log(originalTicketId, args.newTicket ? ` TRANSFER TO → ` : ` CREATE NEW TICKET → `, args.id);
if (tx) await tx.commit();
return response;

View File

@ -210,7 +210,7 @@ describe('ticket componentUpdate()', () => {
}
});
describe('ticket componentUpdate()', () => {
describe('componentUpdate() keepPrice', () => {
it('should change shipped and keep price', async() => {
const tx = await models.Ticket.beginTransaction({});

View File

@ -156,13 +156,7 @@
</td>
<td>{{::ticket.futureLiters | dashIfEmpty}}</td>
<td>{{::ticket.futureZoneName | dashIfEmpty}}</td>
<td>
<span
class="chip"
ng-class="{success: !ticket.notMovableLines}">
{{::ticket.notMovableLines | dashIfEmpty}}
</span>
</td>
<td>{{::ticket.notMovableLines | dashIfEmpty}}</td>
<td>{{::ticket.futureLines | dashIfEmpty}}</td>
<td>
<span
@ -194,7 +188,7 @@
<vn-dialog
vn-id="splitProgress"
message="Progress">
<tpl-body>
<tpl-body class="split-progress">
<vn-vertical>
<vn-spinner
enable="splitProgress.enable">

View File

@ -153,11 +153,10 @@ export default class Controller extends Section {
return this.$http.get(query, {params}).then(res => {
if (res.data)
return res.data;
else {
return this.vnApp.showError(
this.$t(`No delivery zone available for this landing date`)
);
}
return this.vnApp.showError(
this.$t(`No delivery zone available for this landing date`)
);
});
}
@ -201,7 +200,6 @@ export default class Controller extends Section {
async requestComponentUpdate(ticket, isWithoutNegatives) {
const query = `tickets/${ticket.futureId}/componentUpdate`;
if (!ticket.landed) {
console.log(ticket);
const newLanded = await this.getLanded({
shipped: this.$.model.userParams.dateToAdvance,
addressFk: ticket.addressFk,
@ -229,7 +227,7 @@ export default class Controller extends Section {
newTicket: ticket.id ?? undefined,
keepPrice: true
};
console.log(params);
return {query, params};
}

View File

@ -24,31 +24,6 @@ describe('Component vnTicketAdvance', () => {
}];
}));
describe('compareDate()', () => {
it('should return warning when the date is the present', () => {
let today = Date.vnNew();
let result = controller.compareDate(today);
expect(result).toEqual('warning');
});
it('should return sucess when the date is in the future', () => {
let futureDate = Date.vnNew();
futureDate = futureDate.setDate(futureDate.getDate() + 10);
let result = controller.compareDate(futureDate);
expect(result).toEqual('success');
});
it('should return undefined when the date is in the past', () => {
let pastDate = Date.vnNew();
pastDate = pastDate.setDate(pastDate.getDate() - 10);
let result = controller.compareDate(pastDate);
expect(result).toEqual(undefined);
});
});
describe('checked()', () => {
it('should return an array of checked tickets', () => {
const result = controller.checked;

View File

@ -1,4 +1,6 @@
Advance tickets: Adelantar tickets
Advance tickets with negatives: Adelantar tickets con negativos
Advance tickets without negatives: Adelantar tickets sin negativos
Search advance tickets by date: Busca tickets para adelantar por fecha
Advance confirmation: ¿Desea adelantar {{checked}} tickets?
Success: "{{tickets}} Tickets movidos correctamente"

View File

@ -5,3 +5,12 @@ vn-ticket-advance{
color: #f7931e
}
}
.split-progress {
width: 40em;
}
@media screen and (max-width: 600px) {
.split-progress {
width: 100%;
}
}

View File

@ -115,7 +115,6 @@ class Controller extends Component {
option: parseInt(this.ticket.option),
isWithoutNegatives: this.ticket.withoutNegatives,
withWarningAccept: this.ticket.withWarningAccept,
newTicket: null,
keepPrice: false
};