diff --git a/back/methods/vn-user/renew-token.js b/back/methods/vn-user/renew-token.js index 41470dfea..ee50d06d4 100644 --- a/back/methods/vn-user/renew-token.js +++ b/back/methods/vn-user/renew-token.js @@ -22,11 +22,13 @@ module.exports = Self => { const tokenId = ctx.req.accessToken.id; const now = new Date(); - const differenceMilliseconds = now - created; + const differenceMilliseconds = now - new Date(created); const differenceSeconds = Math.floor(differenceMilliseconds / 1000); const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']}); + console.log(userId, created, now, differenceMilliseconds, differenceSeconds, accessTokenConfig.renewPeriod, differenceSeconds <= accessTokenConfig.renewPeriod); + if (differenceSeconds <= accessTokenConfig.renewPeriod) throw new UserError(`The renew period has not been exceeded`); diff --git a/e2e/paths/10-travel/03_descriptor.spec.js b/e2e/paths/10-travel/03_descriptor.spec.js index 3752400c6..4723cc4a3 100644 --- a/e2e/paths/10-travel/03_descriptor.spec.js +++ b/e2e/paths/10-travel/03_descriptor.spec.js @@ -9,7 +9,7 @@ describe('Travel descriptor path', () => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('buyer', 'travel'); - await page.write(selectors.travelIndex.generalSearchFilter, '1'); + await page.write(selectors.travelIndex.generalSearchFilter, '3'); await page.keyboard.press('Enter'); await page.waitForState('travel.card.summary'); }); @@ -23,7 +23,7 @@ describe('Travel descriptor path', () => { await page.waitForState('travel.index'); const result = await page.countElement(selectors.travelIndex.anySearchResult); - expect(result).toBeGreaterThanOrEqual(7); + expect(result).toBeGreaterThanOrEqual(1); }); it('should navigate to the first search result', async() => { diff --git a/front/salix/components/layout/index.js b/front/salix/components/layout/index.js index dc2313f4f..008d31ab2 100644 --- a/front/salix/components/layout/index.js +++ b/front/salix/components/layout/index.js @@ -49,6 +49,7 @@ export class Layout extends Component { const differenceMilliseconds = now - new Date(this.vnToken.created); const differenceSeconds = Math.floor(differenceMilliseconds / 1000); + console.log(this.vnToken.created, now, differenceMilliseconds, differenceSeconds, this.renewPeriod, differenceSeconds > this.renewPeriod); if (differenceSeconds > this.renewPeriod) { this.$http.post('VnUsers/renewToken') .then(json => { diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index d6e230ebe..59b8e8953 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -156,7 +156,7 @@ icon="install_mobile" ng-show="$ctrl.totalChecked > 0" ng-click="$ctrl.sendDocuware()" - vn-tooltip="Set as delivered and open delivery note(s)" + vn-tooltip="Set as delivered and send delivery note(s) to the tablet" tooltip-position="left"> { if (param && this.model._orgData.length === 1) diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html index 5d38ed08f..d9dbb0f90 100644 --- a/modules/travel/front/summary/index.html +++ b/modules/travel/front/summary/index.html @@ -92,7 +92,7 @@ {{entry.supplierName}} - {{entry.ref}} + {{entry.reference}} {{entry.hb}} {{entry.freightValue | currency: 'EUR': 2}} {{entry.packageValue | currency: 'EUR': 2}}