Skip to content

Commit

Permalink
feat(front): add cruved Import srvc into synthese
Browse files Browse the repository at this point in the history
Check permission Import in order to hidde/display Import btn

Reviewed-by: andriacap
  • Loading branch information
andriacap committed Feb 19, 2024
1 parent 5fdc954 commit 647c6e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div class="row mt-3 justify-content-end">
<div class="col-auto">
<button
*ngIf="userCruved?.C != '0'"
*ngIf="canImport"
id="upload-btn"
mat-raised-button
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class SyntheseListComponent implements OnInit, OnChanges, AfterContentChe
public destinationImportCode: string;

public userCruved: any;
public canImport: boolean = false;

constructor(
public mapListService: MapListService,
Expand All @@ -60,14 +61,18 @@ export class SyntheseListComponent implements OnInit, OnChanges, AfterContentChe
private _moduleService: ModuleService
) {
this.SYNTHESE_CONFIG = this.config.SYNTHESE;
}

ngOnInit() {
const currentModule = this._moduleService.currentModule;
this.destinationImportCode = currentModule.module_code.toLowerCase();

// get user cruved
this.userCruved = currentModule.cruved;
}
const cruvedImport = this._cruvedStore.cruved.IMPORT.module_objects.IMPORT.cruved;
const canCreateImport = cruvedImport.C > 0;
const canCreateSynthese = this.userCruved.C > 0;

ngOnInit() {
this.canImport = canCreateImport && canCreateSynthese;
// get wiewport height to set the number of rows in the tabl
const h = document.documentElement.clientHeight;
this.rowNumber = Math.trunc(h / 37);
Expand Down

0 comments on commit 647c6e4

Please sign in to comment.