fixes #4945 Dejar de buscar por tag 'Nombre temporal' #1258
|
@ -0,0 +1,8 @@
|
||||||
|
ALTER TABLE `vn`.`itemConfig` ADD defaultTag INT DEFAULT 56 NOT NULL;
|
||||||
|
ALTER TABLE `vn`.`itemConfig` ADD CONSTRAINT itemConfig_FK FOREIGN KEY (defaultTag) REFERENCES vn.tag(id);
|
||||||
|
ALTER TABLE `vn`.`itemConfig` ADD validPriorities varchar(50) DEFAULT '[1,2,3]' NOT NULL;
|
||||||
|
ALTER TABLE `vn`.`itemConfig` ADD defaultPriority INT DEFAULT 2 NOT NULL;
|
||||||
|
|
||||||
|
INSERT INTO `salix`.`ACL`
|
||||||
|
(model, property, accessType, permission, principalType, principalId)
|
||||||
|
VALUES('ItemConfig', '*', 'READ', 'ALLOW', 'ROLE', 'buyer');
|
|
@ -2719,6 +2719,10 @@ INSERT INTO `vn`.`collection` (`id`, `created`, `workerFk`, `stateFk`, `itemPack
|
||||||
VALUES
|
VALUES
|
||||||
(3, util.VN_NOW(), 1107, 5, NULL, 0, 0, 1, NULL, NULL);
|
(3, util.VN_NOW(), 1107, 5, NULL, 0, 0, 1, NULL, NULL);
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`itemConfig` (`id`, `isItemTagTriggerDisabled`, `monthToDeactivate`, `wasteRecipients`, `validPriorities`, `defaultPriority`, `defaultTag`)
|
||||||
|
VALUES
|
||||||
|
(0, 0, 24, '', '[1,2,3]', 2, 56);
|
||||||
|
|||||||
|
|
||||||
INSERT INTO `vn`.`ticketCollection` (`ticketFk`, `collectionFk`, `created`, `level`, `wagon`, `smartTagFk`, `usedShelves`, `itemCount`, `liters`)
|
INSERT INTO `vn`.`ticketCollection` (`ticketFk`, `collectionFk`, `created`, `level`, `wagon`, `smartTagFk`, `usedShelves`, `itemCount`, `liters`)
|
||||||
VALUES
|
VALUES
|
||||||
(9, 3, util.VN_NOW(), NULL, 0, NULL, NULL, NULL, NULL);
|
(9, 3, util.VN_NOW(), NULL, 0, NULL, NULL, NULL, NULL);
|
||||||
|
|
|
@ -522,7 +522,7 @@ export default {
|
||||||
},
|
},
|
||||||
itemLog: {
|
itemLog: {
|
||||||
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
|
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
|
||||||
fourthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(4) table tr:nth-child(3) td.after',
|
fifthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(5) table tr:nth-child(2) td.after',
|
||||||
},
|
},
|
||||||
ticketSummary: {
|
ticketSummary: {
|
||||||
header: 'vn-ticket-summary > vn-card > h5',
|
header: 'vn-ticket-summary > vn-card > h5',
|
||||||
|
|
|
@ -48,17 +48,17 @@ describe('Item log path', () => {
|
||||||
await page.accessToSection('item.card.log');
|
await page.accessToSection('item.card.log');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should confirm the log is showing 4 entries`, async() => {
|
it(`should confirm the log is showing 5 entries`, async() => {
|
||||||
await page.waitForSelector(selectors.itemLog.anyLineCreated);
|
await page.waitForSelector(selectors.itemLog.anyLineCreated);
|
||||||
const anyLineCreatedCount = await page.countElement(selectors.itemLog.anyLineCreated);
|
const anyLineCreatedCount = await page.countElement(selectors.itemLog.anyLineCreated);
|
||||||
|
|
||||||
expect(anyLineCreatedCount).toEqual(4);
|
expect(anyLineCreatedCount).toEqual(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should confirm the log is showing the intrastat for the created item`, async() => {
|
it(`should confirm the log is showing the intrastat for the created item`, async() => {
|
||||||
const fourthLineCreatedProperty = await page
|
const fifthLineCreatedProperty = await page
|
||||||
.waitToGetProperty(selectors.itemLog.fourthLineCreatedProperty, 'innerText');
|
.waitToGetProperty(selectors.itemLog.fifthLineCreatedProperty, 'innerText');
|
||||||
|
|
||||||
expect(fourthLineCreatedProperty).toEqual('Coral y materiales similares');
|
expect(fifthLineCreatedProperty).toEqual('Coral y materiales similares');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,6 @@ module.exports = Self => {
|
||||||
'typeFk',
|
'typeFk',
|
||||||
'intrastatFk',
|
'intrastatFk',
|
||||||
'originFk',
|
'originFk',
|
||||||
'relevancy',
|
|
||||||
jgallego
commented
perque s'ha lleva't la relevancia? perque s'ha lleva't la relevancia?
|
|||||||
'priority',
|
'priority',
|
||||||
'tag'
|
'tag'
|
||||||
];
|
];
|
||||||
|
@ -48,9 +47,9 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const validPriorities = new Set([1, 2, 3]);
|
const itemConfig = await models.ItemConfig.findOne({fields: ['validPriorities']}, myOptions);
|
||||||
if (!validPriorities.has(params.priority))
|
if (!itemConfig.validPriorities.includes(params.priority))
|
||||||
jgallego
commented
açò? pregunta a Juan pero jo no ho veig, crec que deuria estar en taula config açò? pregunta a Juan pero jo no ho veig, crec que deuria estar en taula config
|
|||||||
throw new UserError(`Valid priorities: ${[...validPriorities]}`);
|
throw new UserError(`Valid priorities: ${[...itemConfig.validPriorities]}`);
|
||||||
|
|
||||||
const provisionalName = params.provisionalName;
|
const provisionalName = params.provisionalName;
|
||||||
delete params.provisionalName;
|
delete params.provisionalName;
|
||||||
|
|
|
@ -16,6 +16,22 @@
|
||||||
"wasteRecipients": {
|
"wasteRecipients": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Buyers waste report recipients"
|
"description": "Buyers waste report recipients"
|
||||||
|
},
|
||||||
|
"validPriorities": {
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
|
"defaultPriority": {
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
"defaultTag": {
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"tag": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Tag",
|
||||||
|
"foreignKey": "defaultTag"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,12 +4,21 @@ import Section from 'salix/components/section';
|
||||||
class Controller extends Section {
|
class Controller extends Section {
|
||||||
constructor($element, $) {
|
constructor($element, $) {
|
||||||
super($element, $);
|
super($element, $);
|
||||||
|
this.fetchDefaultPriorityTag();
|
||||||
|
}
|
||||||
|
|
||||||
jgallego
commented
Has de vore la forma de llevar el 2 del codi Has de vore la forma de llevar el 2 del codi
|
|||||||
|
fetchDefaultPriorityTag() {
|
||||||
|
const filter = {fields: ['defaultPriority', 'defaultTag'], limit: 1};
|
||||||
|
this.$http.get(`ItemConfigs`, {filter})
|
||||||
|
.then(res => {
|
||||||
|
if (res.data) {
|
||||||
this.item = {
|
this.item = {
|
||||||
relevancy: 0,
|
priority: res.data[0].defaultPriority,
|
||||||
priority: 2,
|
tag: res.data[0].defaultTag
|
||||||
tag: 1
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.$.watcher.submit().then(
|
this.$.watcher.submit().then(
|
||||||
|
|
Loading…
Reference in New Issue
A comentar en Juan en la revisio semanal de hui