fix: refs #8222 fix deleteZone #3239
|
@ -240,5 +240,5 @@
|
||||||
"The height must be greater than 50cm": "The height must be greater than 50cm",
|
"The height must be greater than 50cm": "The height must be greater than 50cm",
|
||||||
"The maximum height of the wagon is 200cm": "The maximum height of the wagon is 200cm",
|
"The maximum height of the wagon is 200cm": "The maximum height of the wagon is 200cm",
|
||||||
"The quantity claimed cannot be greater than the quantity of the line": "The quantity claimed cannot be greater than the quantity of the line",
|
"The quantity claimed cannot be greater than the quantity of the line": "The quantity claimed cannot be greater than the quantity of the line",
|
||||||
"There are tickets to be invoiced for this area, please delete them first": "There are tickets to be invoiced for this area, please delete them first"
|
"There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first"
|
||||||
carlossa marked this conversation as resolved
Outdated
|
|||||||
}
|
}
|
||||||
|
|
|
@ -383,5 +383,5 @@
|
||||||
"No valid travel thermograph found": "No se encontró un termógrafo válido",
|
"No valid travel thermograph found": "No se encontró un termógrafo válido",
|
||||||
"The quantity claimed cannot be greater than the quantity of the line": "La cantidad reclamada no puede ser mayor que la cantidad de la línea",
|
"The quantity claimed cannot be greater than the quantity of the line": "La cantidad reclamada no puede ser mayor que la cantidad de la línea",
|
||||||
"type cannot be blank": "Se debe rellenar el tipo",
|
"type cannot be blank": "Se debe rellenar el tipo",
|
||||||
"There are tickets to be invoiced for this area, please delete them first": "Hay tickets para esta sección, borralos primero"
|
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero"
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,9 @@ module.exports = Self => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const ticketList = await models.Ticket.find(filter, myOptions);
|
const ticketList = await models.Ticket.find(filter, myOptions);
|
||||||
const hasRefFkFilled = ticketList.some(ticket => ticket.refFk !== null && ticket.refFk !== undefined);
|
const hasRefFk = ticketList.some(ticket => ticket.refFk !== null && ticket.refFk !== undefined);
|
||||||
carlossa marked this conversation as resolved
Outdated
jgallego
commented
hasRefFk suficient hasRefFk suficient
alexm
commented
const hasRefFk = ticketList.some(ticket => ticket.refFk) const hasRefFk = ticketList.some(ticket => ticket.refFk)
|
|||||||
if (hasRefFkFilled)
|
if (hasRefFk)
|
||||||
throw new UserError('There are tickets to be invoiced for this area, please delete them first');
|
throw new UserError('There are tickets to be invoiced');
|
||||||
|
|
||||||
await models.Zone.destroyById(id, myOptions);
|
await models.Zone.destroyById(id, myOptions);
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@ describe('zone deletezone()', () => {
|
||||||
__: value => value
|
__: value => value
|
||||||
};
|
};
|
||||||
const ctx = {req: activeCtx};
|
const ctx = {req: activeCtx};
|
||||||
const zoneId = 4;
|
|
||||||
const zoneId1 = 1;
|
|
||||||
let ticketIDs;
|
let ticketIDs;
|
||||||
|
|
||||||
carlossa marked this conversation as resolved
Outdated
jgallego
commented
si sols es gasta baix, meneja els const cadascun a la seua seccio si sols es gasta baix, meneja els const cadascun a la seua seccio
|
|||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
|
@ -18,7 +16,7 @@ describe('zone deletezone()', () => {
|
||||||
});
|
});
|
||||||
const originalTickets = await models.Ticket.find({
|
const originalTickets = await models.Ticket.find({
|
||||||
where: {
|
where: {
|
||||||
zoneFk: zoneId
|
zoneFk: 4
|
||||||
jgallego
commented
en el proxim pr, crea de nou la constant, pero en cada una de les seccions en el proxim pr, crea de nou la constant, pero en cada una de les seccions
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
ticketIDs = originalTickets.map(ticket => ticket.id);
|
ticketIDs = originalTickets.map(ticket => ticket.id);
|
||||||
|
@ -32,9 +30,9 @@ describe('zone deletezone()', () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
await models.Zone.deleteZone(ctx, zoneId, options);
|
await models.Zone.deleteZone(ctx, 4, options);
|
||||||
|
|
||||||
const updatedZone = await models.Zone.findById(zoneId, null, options);
|
const updatedZone = await models.Zone.findById(4, null, options);
|
||||||
|
|
||||||
expect(updatedZone).toBeNull();
|
expect(updatedZone).toBeNull();
|
||||||
|
|
||||||
|
@ -51,7 +49,7 @@ describe('zone deletezone()', () => {
|
||||||
let error;
|
let error;
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
await models.Zone.deleteZone(ctx, zoneId1, options);
|
await models.Zone.deleteZone(ctx, 1, options);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e.message;
|
error = e.message;
|
||||||
|
|
Loading…
Reference in New Issue
la clave es molt llarga, ha de ser mes curta, despues el text el pots deixar igual de llarg.
Ademés, el text this area no es intuitiu, canviau per this zone, y la traduccio seria en esa zona