Skip to content
Snippets Groups Projects
Verified Commit a051987a authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #10741 TIME 0:45 hide actions if substitution

parent 916de501
No related branches found
No related tags found
No related merge requests found
...@@ -158,6 +158,8 @@ ...@@ -158,6 +158,8 @@
"addNote": "Add note", "addNote": "Add note",
"filterInfo": "Filter by subject / reference", "filterInfo": "Filter by subject / reference",
"attachment": "attachment", "attachment": "attachment",
"deleteSubtitution": "Delete subtitution" "deleteSubstitution": "Delete subtitution",
"substitutionDeleted": "Substitution deleted",
"substitutionInfo": "You are in substitution mode, you can't make any action"
} }
} }
...@@ -158,6 +158,8 @@ ...@@ -158,6 +158,8 @@
"addNote": "Ajouter un commentaire", "addNote": "Ajouter un commentaire",
"filterInfo": "Filtrer par objet / référence", "filterInfo": "Filtrer par objet / référence",
"attachment": "annexe", "attachment": "annexe",
"deleteSubtitution": "Supprimer la délégation" "deleteSubstitution": "Supprimer la délégation",
"substitutionDeleted": "Délégation supprimée",
"substitutionInfo": "Vous êtes en mode délégation, vous ne pouvez pas faire d'action sur ce document"
} }
} }
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<mat-icon svgIcon="maarchLogo" class="maarchLogo"></mat-icon> <mat-icon svgIcon="maarchLogo" class="maarchLogo"></mat-icon>
</div> </div>
<mat-sidenav-container autosize> <mat-sidenav-container autosize>
<mat-sidenav #snav disableClose [mode]="signaturesService.mobileMode ? 'over': 'side'" [opened]="!signaturesService.mobileMode || freezeSidenavClose" fixedInViewport="true" [disableClose]="freezeSidenavClose" [style.width.px]="350"> <mat-sidenav #snav disableClose [mode]="signaturesService.mobileMode ? 'over': 'side'"
[opened]="!signaturesService.mobileMode || freezeSidenavClose" fixedInViewport="true"
[disableClose]="freezeSidenavClose" [style.width.px]="350">
<app-sidebar [snavLeftComponent]="this.snav" [snavRightComponent]="this.snavRight"></app-sidebar> <app-sidebar [snavLeftComponent]="this.snav" [snavRightComponent]="this.snavRight"></app-sidebar>
</mat-sidenav> </mat-sidenav>
<mat-sidenav-content class="mainView"> <mat-sidenav-content class="mainView">
...@@ -13,23 +15,28 @@ ...@@ -13,23 +15,28 @@
<header class="header" *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose" [@slideDown]> <header class="header" *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose" [@slideDown]>
<article class="header-infos"> <article class="header-infos">
<section class="header-action"> <section class="header-action">
<button *ngIf="signaturesService.mobileMode" mat-icon-button (click)="this.snav.toggle();" style="width:70px;"> <button *ngIf="signaturesService.mobileMode" mat-icon-button (click)="this.snav.toggle();"
style="width:70px;">
<mat-icon fontSet="fas" fontIcon="fa-bars"></mat-icon> <mat-icon fontSet="fas" fontIcon="fa-bars"></mat-icon>
</button> </button>
<button mat-button (click)="openMainDocumentDetail();"> <button mat-button (click)="openMainDocumentDetail();">
<i class="fas fa-info-circle fa-2x"></i><span style="display: block;line-height: 10px;">{{'lang.informations' | translate}}</span> <i class="fas fa-info-circle fa-2x"></i><span
style="display: block;line-height: 10px;">{{'lang.informations' | translate}}</span>
</button> </button>
</section> </section>
<section class="header-action"> <section class="header-action">
<button mat-button (click)="openDocumentList();"> <button mat-button (click)="openDocumentList();">
<i class="fas fa-file fa-2x" [matBadge]="mainDocument.attachments.length + 1"></i><span style="display: block;line-height: 10px;">{{'lang.documents' | translate | titlecase}}</span> <i class="fas fa-file fa-2x" [matBadge]="mainDocument.attachments.length + 1"></i><span
style="display: block;line-height: 10px;">{{'lang.documents' | translate | titlecase}}</span>
</button> </button>
<button mat-button (click)="openVisaWorkflow();"> <button mat-button (click)="openVisaWorkflow();">
<i class="fas fa-list-ol fa-2x" [matBadge]="mainDocument.workflow.length"></i><span style="display: block;line-height: 10px;">{{'lang.circuit' | translate}}</span> <i class="fas fa-list-ol fa-2x" [matBadge]="mainDocument.workflow.length"></i><span
style="display: block;line-height: 10px;">{{'lang.circuit' | translate}}</span>
</button> </button>
<button mat-button [matMenuTriggerFor]="menu"> <button mat-button [matMenuTriggerFor]="menu">
<i class="fas fa-cog fa-2x"></i><span style="display: block;line-height: 10px;">{{'lang.actions' | translate}}</span> <i class="fas fa-cog fa-2x"></i><span
style="display: block;line-height: 10px;">{{'lang.actions' | translate}}</span>
</button> </button>
<mat-menu #menu="matMenu"> <mat-menu #menu="matMenu">
<button [disabled]="checkEmptiness()" mat-menu-item <button [disabled]="checkEmptiness()" mat-menu-item
...@@ -42,8 +49,8 @@ ...@@ -42,8 +49,8 @@
</header> </header>
<app-overlay *ngIf="this.signaturesService.annotationMode" [appDocumentNotePad]="appDocumentNotePad"></app-overlay> <app-overlay *ngIf="this.signaturesService.annotationMode" [appDocumentNotePad]="appDocumentNotePad"></app-overlay>
<ng-container *ngIf="!freezeSidenavClose && !loadingUI"> <ng-container *ngIf="!freezeSidenavClose && !loadingUI">
<button class="btn-previous" (tap)="prevPage()" <button class="btn-previous" (tap)="prevPage()" *ngIf="pageNum > 1 && !this.signaturesService.annotationMode"><i
*ngIf="pageNum > 1 && !this.signaturesService.annotationMode"><i class="fas fa-chevron-left fa-3x"></i></button> class="fas fa-chevron-left fa-3x"></i></button>
<button class="btn-next" (tap)="nextPage()" <button class="btn-next" (tap)="nextPage()"
*ngIf="pageNum < totalPages && !this.signaturesService.annotationMode"><i *ngIf="pageNum < totalPages && !this.signaturesService.annotationMode"><i
class="fas fa-chevron-right fa-3x"></i></button> class="fas fa-chevron-right fa-3x"></i></button>
...@@ -56,7 +63,8 @@ ...@@ -56,7 +63,8 @@
<app-document-note-list (tap)="addAnnotation($event)" *ngIf="currentDoc == 0"> <app-document-note-list (tap)="addAnnotation($event)" *ngIf="currentDoc == 0">
</app-document-note-list> </app-document-note-list>
<app-document-sign-list *ngIf="currentDoc == 0"></app-document-sign-list> <app-document-sign-list *ngIf="currentDoc == 0"></app-document-sign-list>
<img *ngIf="!loadingDoc && !freezeSidenavClose" (tap)="addAnnotation($event)" id="snapshotPdf" [src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64, '+docList[currentDoc].imgContent[pageNum])" <img *ngIf="!loadingDoc && !freezeSidenavClose" (tap)="addAnnotation($event)" id="snapshotPdf"
[src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64, '+docList[currentDoc].imgContent[pageNum])"
style="width:100%;" /> style="width:100%;" />
<app-document-note-pad (triggerEvent)="zoomForView()" #appDocumentNotePad *ngIf="currentDoc == 0"> <app-document-note-pad (triggerEvent)="zoomForView()" #appDocumentNotePad *ngIf="currentDoc == 0">
</app-document-note-pad> </app-document-note-pad>
...@@ -67,16 +75,30 @@ ...@@ -67,16 +75,30 @@
<div class="page-info-doc">{{docList[currentDoc].title}}</div> <div class="page-info-doc">{{docList[currentDoc].title}}</div>
<div class="page-info-page">{{'lang.page' | translate}} {{ pageNum }} / {{ totalPages }}</div> <div class="page-info-page">{{'lang.page' | translate}} {{ pageNum }} / {{ totalPages }}</div>
</section> </section>
<footer class="footer" *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose && currentDoc === 0" [@slideUp]> <footer class="footer"
*ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose && currentDoc === 0 && signaturesService.userLogged.substitute === null"
[@slideUp]>
<ng-container *ngFor="let action of actionsList;"> <ng-container *ngFor="let action of actionsList;">
<button [style.color]="action.color" [style.borderColor]="action.color" class="btn" <button [style.color]="action.color" [style.borderColor]="action.color" class="btn"
(click)="launchEvent(action)"><i class="{{action.logo}} fa-2x"></i>{{action.label | translate}}</button> (click)="launchEvent(action)"><i class="{{action.logo}} fa-2x"></i>{{action.label | translate}}</button>
</ng-container> </ng-container>
</footer> </footer>
<footer class="footer substutionModal" *ngIf="!freezeSidenavClose && currentDoc === 0 && signaturesService.userLogged.substitute !== null" [@slideUp]>
<div class="msgModal">
{{'lang.substitutionInfo' | translate}}
</div>
<div>
<button mat-icon-button title="{{'lang.deleteSubstitution' | translate}}" (click)="deleteSubstution()">
<mat-icon fontSet="fas" fontIcon="fa-times"></mat-icon>
</button>
</div>
</footer>
<app-drawer></app-drawer> <app-drawer></app-drawer>
</mat-sidenav-content> </mat-sidenav-content>
<mat-sidenav #snavRight disableClose [mode]="this.signaturesService.mobileMode ? 'over': 'side'" [opened]="!signaturesService.mobileMode" fixedInViewport="true" [style.width]="signaturesService.sideNavRigtDatas.width" <mat-sidenav #snavRight disableClose [mode]="this.signaturesService.mobileMode ? 'over': 'side'"
position='end' [disableClose]='signaturesService.sideNavRigtDatas.locked'> [opened]="!signaturesService.mobileMode" fixedInViewport="true"
[style.width]="signaturesService.sideNavRigtDatas.width" position='end'
[disableClose]='signaturesService.sideNavRigtDatas.locked'>
<app-my-profile *ngIf="signaturesService.sideNavRigtDatas.mode == 'profile'" [snavLeftComponent]="this.snav" <app-my-profile *ngIf="signaturesService.sideNavRigtDatas.mode == 'profile'" [snavLeftComponent]="this.snav"
[snavRightComponent]="this.snavRight"></app-my-profile> [snavRightComponent]="this.snavRight"></app-my-profile>
<app-visa-workflow [visaWorkflow]="mainDocument.workflow" [snavRightComponent]="this.snavRight" <app-visa-workflow [visaWorkflow]="mainDocument.workflow" [snavRightComponent]="this.snavRight"
...@@ -84,7 +106,7 @@ ...@@ -84,7 +106,7 @@
<app-document-list #appDocumentList [currentDocId]="currentDoc" [snavRightComponent]="this.snavRight" <app-document-list #appDocumentList [currentDocId]="currentDoc" [snavRightComponent]="this.snavRight"
[docList]="docList" *ngIf="signaturesService.sideNavRigtDatas.mode == 'documentList'" [docList]="docList" *ngIf="signaturesService.sideNavRigtDatas.mode == 'documentList'"
(triggerEvent)="loadDoc($event)"></app-document-list> (triggerEvent)="loadDoc($event)"></app-document-list>
<app-main-document-detail #appMainDocumentDetail [snavRightComponent]="this.snavRight" <app-main-document-detail #appMainDocumentDetail [snavRightComponent]="this.snavRight" [mainDocument]="mainDocument"
[mainDocument]="mainDocument" *ngIf="signaturesService.sideNavRigtDatas.mode == 'mainDocumentDetail'"></app-main-document-detail> *ngIf="signaturesService.sideNavRigtDatas.mode == 'mainDocumentDetail'"></app-main-document-detail>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
\ No newline at end of file
...@@ -276,4 +276,18 @@ button.disabled { ...@@ -276,4 +276,18 @@ button.disabled {
.mat-badge-content { .mat-badge-content {
background: $warn; background: $warn;
}
.substutionModal {
color: white;
background: $primary;
div {
padding:10px;
}
.msgModal {
text-align: center;
flex: 1;
}
} }
\ No newline at end of file
...@@ -323,7 +323,7 @@ export class DocumentComponent implements OnInit { ...@@ -323,7 +323,7 @@ export class DocumentComponent implements OnInit {
addAnnotation(e: any) { addAnnotation(e: any) {
if (!this.signaturesService.annotationMode && this.currentDoc === 0) { if (!this.signaturesService.annotationMode && this.currentDoc === 0 && this.signaturesService.userLogged.substitute === null) {
const posX = e.srcEvent.layerX - this.signaturesService.x; const posX = e.srcEvent.layerX - this.signaturesService.x;
const posY = e.srcEvent.layerY - this.signaturesService.y; const posY = e.srcEvent.layerY - this.signaturesService.y;
...@@ -493,4 +493,21 @@ export class DocumentComponent implements OnInit { ...@@ -493,4 +493,21 @@ export class DocumentComponent implements OnInit {
locked : false, locked : false,
}; };
} }
deleteSubstution() {
const r = confirm(this.translate.instant('lang.deleteSubstitution') + ' ?');
if (r) {
const oldId = this.signaturesService.userLogged.subtitute;
this.signaturesService.userLogged.substitute = null;
this.http.put('../rest/users/' + this.signaturesService.userLogged.id, this.signaturesService.userLogged)
.subscribe((data: any) => {
this.notificationService.success('lang.substitutionDeleted');
}, (err) => {
this.signaturesService.userLogged.subtitute = oldId;
this.notificationService.handleErrors(err);
});
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment