diff --git a/db/changes/10190-PostErte/00-ACL.sql b/db/changes/10190-PostErte/00-ACL.sql deleted file mode 100644 index 8ef44224a..000000000 --- a/db/changes/10190-PostErte/00-ACL.sql +++ /dev/null @@ -1,5 +0,0 @@ -UPDATE `salix`.`ACL` SET `accessType`='WRITE' WHERE `id`='213'; -UPDATE `salix`.`ACL` SET `property` = 'deleteSales' WHERE (`id` = '80'); - -INSERT IGNORE INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('CustomsAgent', '*', '*', 'ALLOW', 'ROLE', 'employee'); - diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index a7b24e4a3..08ff97b96 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -211,12 +211,16 @@ describe('Ticket Edit sale path', () => { it('should search for a ticket then access to the sales section', async() => { await page.accessToSearchResult('16'); await page.accessToSection('ticket.card.sale'); + await page.wait(2000); }); it('should select the third sale and delete it', async() => { await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox); + await page.wait(2000); await page.waitToClick(selectors.ticketSales.deleteSaleButton); + await page.wait(2000); await page.waitToClick(selectors.ticketSales.acceptDeleteLineButton); + await page.wait(2000); await page.waitForSpinnerLoad(); const message = await page.waitForSnackbar(); diff --git a/loopback/common/models/loggable.js b/loopback/common/models/loggable.js index 99a1ad39b..eaa44f9ba 100644 --- a/loopback/common/models/loggable.js +++ b/loopback/common/models/loggable.js @@ -249,7 +249,6 @@ module.exports = function(Self) { let newInstance = {}; if (ctx.hookState.newInstance) Object.assign(newInstance, ctx.hookState.newInstance); - let userFk; if (loopBackContext) userFk = loopBackContext.active.accessToken.userId; diff --git a/modules/client/back/methods/client/getCard.js b/modules/client/back/methods/client/getCard.js index 6c69d32a8..121534b02 100644 --- a/modules/client/back/methods/client/getCard.js +++ b/modules/client/back/methods/client/getCard.js @@ -27,11 +27,11 @@ module.exports = function(Self) { { relation: 'salesPerson', scope: { - fields: ['userFk'], + fields: ['userFk', 'firstName'], include: { relation: 'user', scope: { - fields: ['nickname'] + fields: ['name', 'nickname'] } } } @@ -45,6 +45,12 @@ module.exports = function(Self) { scope: { fields: ['id', 'name'] } + }, { + }, { + relation: 'salesPersonUser', + scope: { + fields: ['id', 'name'] + } }, { relation: 'country', scope: { diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json index c62ae3832..6f108d640 100644 --- a/modules/client/back/models/client.json +++ b/modules/client/back/models/client.json @@ -136,6 +136,11 @@ "model": "Worker", "foreignKey": "salesPersonFk" }, + "salesPersonUser": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "salesPersonFk" + }, "province": { "type": "belongsTo", "model": "Province",