From 2f607e00b387ca883dae54db34d05c2fbe6047a9 Mon Sep 17 00:00:00 2001 From: a-jaillet Date: Wed, 3 Feb 2021 22:41:55 +0100 Subject: [PATCH] Client: Fix bug due to stockevents permissions --- .../inventory-tools/services/parse.service.ts | 5 +++++ .../stock-events/list/list.component.html | 2 +- .../stock-events/stock-events-routing.module.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/client/src/app/inventory-management/inventory-tools/services/parse.service.ts b/packages/client/src/app/inventory-management/inventory-tools/services/parse.service.ts index 25906afd8..9d5a70268 100644 --- a/packages/client/src/app/inventory-management/inventory-tools/services/parse.service.ts +++ b/packages/client/src/app/inventory-management/inventory-tools/services/parse.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { setHours } from 'date-fns'; import * as PDFJS from 'pdfjs-dist/build/pdf'; import PDFJSWorker from 'pdfjs-dist/build/pdf.worker.entry'; +import { ToasterService } from 'src/app/core/services/toaster.service'; @Injectable() @@ -14,6 +15,9 @@ export class ParseService { csvtext = ""; fileReader = new FileReader(); + constructor( + private readonly toasterService: ToasterService, + ) {} async fromFilestoText(invoices: File[]): Promise { this.listarticle = []; @@ -69,6 +73,7 @@ export class ParseService { } }); if(errorInCsv){ + this.toasterService.showToaster('Erreur durant le parsing du fichier. Chaque ligne ne contient pas exactement 3 colonnes \n Check les virgules (pas autorisées)'); this.listarticle = []; this.articleSum = []; } diff --git a/packages/client/src/app/inventory-management/stock-events/list/list.component.html b/packages/client/src/app/inventory-management/stock-events/list/list.component.html index f3aac2026..58fb97e86 100644 --- a/packages/client/src/app/inventory-management/stock-events/list/list.component.html +++ b/packages/client/src/app/inventory-management/stock-events/list/list.component.html @@ -44,7 +44,7 @@

Liste des évènements

diff --git a/packages/client/src/app/inventory-management/stock-events/stock-events-routing.module.ts b/packages/client/src/app/inventory-management/stock-events/stock-events-routing.module.ts index 0bcfaab92..73c9ad369 100644 --- a/packages/client/src/app/inventory-management/stock-events/stock-events-routing.module.ts +++ b/packages/client/src/app/inventory-management/stock-events/stock-events-routing.module.ts @@ -17,7 +17,7 @@ const routes: Routes = [ path: ':id/edit', component: EditComponent, canActivate: [NgxPermissionsGuard], - data: { permissions: { only: ['inventory-management:stock-events:create'] } }, + data: { permissions: { only: ['inventory-management:stock-events:add'] } }, resolve: { stockEvent: StockEventDetailResolverService }