From 30073b4ad9c2cf63255dde79b900c5692db24fe1 Mon Sep 17 00:00:00 2001 From: Damien <damien.burel@maarch.org> Date: Fri, 17 Jan 2020 10:46:06 +0100 Subject: [PATCH] FEAT #11788 TIME 0:50 Front fixes --- lang/fr.json | 1 + .../app/document/document.component.html | 199 +++++++++--------- .../app/document/document.component.scss | 16 +- .../app/profile/profile.component.html | 5 +- src/frontend/app/profile/profile.component.ts | 4 - .../app/signatures/signatures.component.scss | 10 +- 6 files changed, 131 insertions(+), 104 deletions(-) diff --git a/lang/fr.json b/lang/fr.json index 722b82e00e..d3b66bd425 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -159,6 +159,7 @@ "search": "Rechercher", "substitution": "Délégation", "substitute": "Utilisateur délégataire", + "signSubstituted": "Signatures à déléguer", "chooseSubstitute": "Choisissez un utilisateur", "noResult": "Aucun résultat", "circuit": "Circuit", diff --git a/src/frontend/app/document/document.component.html b/src/frontend/app/document/document.component.html index 1dd55e6c59..a0de5cacdb 100755 --- a/src/frontend/app/document/document.component.html +++ b/src/frontend/app/document/document.component.html @@ -1,102 +1,109 @@ <div *ngIf="enterApp" class="enterApp" [@enterApp]> - <mat-icon svgIcon="maarchLogo" class="maarchLogo"></mat-icon> + <mat-icon svgIcon="maarchLogo" class="maarchLogo"></mat-icon> </div> <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"> - <app-sidebar [snavLeftComponent]="this.snav" [snavRightComponent]="this.snavRight"></app-sidebar> - </mat-sidenav> - <mat-sidenav-content class="mainView"> - <div *ngIf="signaturesService.mainLoading" - style="position: absolute;z-index: 2;display: flex;background: #fffc;width: 100%;height: 100%;justify-content: center;align-items: center;"> - <mat-spinner></mat-spinner> - </div> - <header class="header" *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose" [@slideDown]> - <article class="header-infos"> - <section class="header-action"> - <button *ngIf="signaturesService.mobileMode" mat-icon-button (click)="this.snav.toggle();" - style="width:70px;"> - <mat-icon fontSet="fas" fontIcon="fa-bars"></mat-icon> - </button> - <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> - </button> - </section> - - <section class="header-action"> - <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> - </button> - <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> - </button> - <button mat-button [matMenuTriggerFor]="menu"> - <i class="fas fa-cog fa-2x"></i><span - style="display: block;line-height: 10px;">{{'lang.actions' | translate}}</span> - </button> - <mat-menu #menu="matMenu"> - <button [disabled]="checkEmptiness()" mat-menu-item - (click)="removeTags();">{{'lang.deleteAll' | translate}}</button> - <button [disabled]="checkEmptyNote()" mat-menu-item - (click)="undoTag();">{{'lang.cancelPreviousNote' | translate}}</button> - </mat-menu> - </section> - </article> - </header> - <app-overlay *ngIf="this.signaturesService.annotationMode" [appDocumentNotePad]="appDocumentNotePad"></app-overlay> - <ng-container *ngIf="!freezeSidenavClose && !loadingUI"> - <button class="btn-previous" (tap)="prevPage()" *ngIf="pageNum > 1 && !this.signaturesService.annotationMode"><i - class="fas fa-chevron-left fa-3x"></i></button> - <button class="btn-next" (tap)="nextPage()" - *ngIf="pageNum < totalPages && !this.signaturesService.annotationMode"><i - class="fas fa-chevron-right fa-3x"></i></button> - </ng-container> + <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> + </mat-sidenav> + <mat-sidenav-content class="mainView"> + <div *ngIf="signaturesService.mainLoading" + style="position: absolute;z-index: 2;display: flex;background: #fffc;width: 100%;height: 100%;justify-content: center;align-items: center;"> + <mat-spinner></mat-spinner> + </div> + <header class="header" *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose" [@slideDown]> + <article class="header-infos"> + <section class="header-action"> + <button *ngIf="signaturesService.mobileMode" mat-icon-button (click)="this.snav.toggle();" + style="width:70px;"> + <mat-icon fontSet="fas" fontIcon="fa-bars"></mat-icon> + </button> + <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> + </button> + </section> + <section class="header-action"> + <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> + </button> + <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> + </button> + <button mat-button [matMenuTriggerFor]="menu"> + <i class="fas fa-cog fa-2x"></i><span + style="display: block;line-height: 10px;">{{'lang.actions' | translate}}</span> + </button> + <mat-menu #menu="matMenu"> + <button [disabled]="checkEmptiness()" mat-menu-item + (click)="removeTags();">{{'lang.deleteAll' | translate}}</button> + <button [disabled]="checkEmptyNote()" mat-menu-item + (click)="undoTag();">{{'lang.cancelPreviousNote' | translate}}</button> + </mat-menu> + </section> + </article> + </header> + <div class="substitutedInformations" *ngIf="authService.user.substitute !== null && !this.signaturesService.annotationMode && docList[currentDoc]"> + <div>{{'lang.substitutionInfo' | translate}}</div> + </div> + <app-overlay *ngIf="this.signaturesService.annotationMode" + [appDocumentNotePad]="appDocumentNotePad"></app-overlay> + <ng-container *ngIf="!freezeSidenavClose && !loadingUI"> + <button class="btn-previous" (tap)="prevPage()" + *ngIf="pageNum > 1 && !this.signaturesService.annotationMode"><i + class="fas fa-chevron-left fa-3x"></i></button> + <button class="btn-next" (tap)="nextPage()" + *ngIf="pageNum < totalPages && !this.signaturesService.annotationMode"><i + class="fas fa-chevron-right fa-3x"></i></button> + </ng-container> - <div [style.width]="widthDoc" style="height:100%;overflow:hidden;background:grey;"> - <div *ngIf="!resetDragPos" #dragElem class="example-box" cdkDragLockAxis="y" cdkDrag - [cdkDragDisabled]="this.signaturesService.annotationMode" - style="width: 100%;transform: translate3d(0px, 80px, 0px)" (cdkDragEnded)="testDrag($event)"> - <app-document-note-list (tap)="addAnnotation($event)" *ngIf="currentDoc == 0"> - </app-document-note-list> - <app-document-sign-list *ngIf="currentDoc == 0"></app-document-sign-list> - <img *ngIf="!signaturesService.mainLoading && !freezeSidenavClose" (tap)="addAnnotation($event)" id="snapshotPdf" - [src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64, '+docList[currentDoc].imgContent[pageNum])" - style="width:100%;" class="zoom"/> - <app-document-note-pad (triggerEvent)="zoomForView()" #appDocumentNotePad *ngIf="currentDoc == 0"> - </app-document-note-pad> - </div> - </div> + <div [style.width]="widthDoc" style="height:100%;overflow:hidden;background:grey;"> + <div *ngIf="!resetDragPos" #dragElem class="example-box" cdkDragLockAxis="y" cdkDrag + [cdkDragDisabled]="this.signaturesService.annotationMode" + style="width: 100%;transform: translate3d(0px, 80px, 0px)" (cdkDragEnded)="testDrag($event)"> + <app-document-note-list (tap)="addAnnotation($event)" *ngIf="currentDoc == 0"> + </app-document-note-list> + <app-document-sign-list *ngIf="currentDoc == 0"></app-document-sign-list> + <img *ngIf="!signaturesService.mainLoading && !freezeSidenavClose" (tap)="addAnnotation($event)" + id="snapshotPdf" + [src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64, '+docList[currentDoc].imgContent[pageNum])" + style="width:100%;" class="zoom"/> + <app-document-note-pad (triggerEvent)="zoomForView()" #appDocumentNotePad *ngIf="currentDoc == 0"> + </app-document-note-pad> + </div> + </div> - <section class="page-info" *ngIf="!this.signaturesService.annotationMode && docList[currentDoc]"> - <div class="page-info-doc">{{docList[currentDoc].title}}</div> - <div class="page-info-page">{{'lang.page' | translate}} {{ pageNum }} / {{ totalPages }}</div> - </section> - <footer class="footer" - *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose && currentDoc === 0" - [@slideUp]> - <ng-container *ngFor="let action of actionsList;"> - <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> - </ng-container> - </footer> - <app-drawer></app-drawer> - </mat-sidenav-content> - <mat-sidenav #snavRight disableClose [mode]="this.signaturesService.mobileMode ? 'over': 'side'" - [opened]="!signaturesService.mobileMode" fixedInViewport="true" - [style.width]="signaturesService.sideNavRigtDatas.width" position='end' - [disableClose]='signaturesService.sideNavRigtDatas.locked' (closedStart)="backToDetails()"> - <app-my-profile *ngIf="signaturesService.sideNavRigtDatas.mode == 'profile'" [snavLeftComponent]="this.snav" - [snavRightComponent]="this.snavRight"></app-my-profile> - <app-visa-workflow [visaWorkflow]="mainDocument.workflow" [snavRightComponent]="this.snavRight" - *ngIf="signaturesService.sideNavRigtDatas.mode == 'visaWorkflow'"></app-visa-workflow> - <app-document-list #appDocumentList [currentDocId]="currentDoc" [snavRightComponent]="this.snavRight" - [docList]="docList" *ngIf="signaturesService.sideNavRigtDatas.mode == 'documentList'" - (triggerEvent)="loadDoc($event)"></app-document-list> - <app-main-document-detail #appMainDocumentDetail [snavRightComponent]="this.snavRight" [mainDocument]="mainDocument" - *ngIf="signaturesService.sideNavRigtDatas.mode == 'mainDocumentDetail'"></app-main-document-detail> - </mat-sidenav> + <section class="page-info" *ngIf="!this.signaturesService.annotationMode && docList[currentDoc]"> + <div class="page-info-doc">{{docList[currentDoc].title}}</div> + <div class="page-info-page">{{'lang.page' | translate}} {{ pageNum }} / {{ totalPages }}</div> + </section> + <footer class="footer" + *ngIf="!this.signaturesService.annotationMode && !freezeSidenavClose && currentDoc === 0" + [@slideUp]> + <ng-container *ngFor="let action of actionsList;"> + <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> + </ng-container> + </footer> + <app-drawer></app-drawer> + </mat-sidenav-content> + <mat-sidenav #snavRight disableClose [mode]="this.signaturesService.mobileMode ? 'over': 'side'" + [opened]="!signaturesService.mobileMode" fixedInViewport="true" + [style.width]="signaturesService.sideNavRigtDatas.width" position='end' + [disableClose]='signaturesService.sideNavRigtDatas.locked' (closedStart)="backToDetails()"> + <app-my-profile *ngIf="signaturesService.sideNavRigtDatas.mode == 'profile'" [snavLeftComponent]="this.snav" + [snavRightComponent]="this.snavRight"></app-my-profile> + <app-visa-workflow [visaWorkflow]="mainDocument.workflow" [snavRightComponent]="this.snavRight" + *ngIf="signaturesService.sideNavRigtDatas.mode == 'visaWorkflow'"></app-visa-workflow> + <app-document-list #appDocumentList [currentDocId]="currentDoc" [snavRightComponent]="this.snavRight" + [docList]="docList" *ngIf="signaturesService.sideNavRigtDatas.mode == 'documentList'" + (triggerEvent)="loadDoc($event)"></app-document-list> + <app-main-document-detail #appMainDocumentDetail [snavRightComponent]="this.snavRight" + [mainDocument]="mainDocument" + *ngIf="signaturesService.sideNavRigtDatas.mode == 'mainDocumentDetail'"></app-main-document-detail> + </mat-sidenav> </mat-sidenav-container> diff --git a/src/frontend/app/document/document.component.scss b/src/frontend/app/document/document.component.scss index a1bdb1f07c..3f56043a1a 100644 --- a/src/frontend/app/document/document.component.scss +++ b/src/frontend/app/document/document.component.scss @@ -290,4 +290,18 @@ button.disabled { text-align: center; flex: 1; } -} \ No newline at end of file +} + +.substitutedInformations { + position: fixed; + top: 95px; + background-color: #F1F4F4; + border-radius: 14px; + padding: 0 20px; + z-index: 1; + white-space: pre; + overflow: hidden; + text-overflow: ellipsis; + margin-left: 15px; + color: #135F7F; +} diff --git a/src/frontend/app/profile/profile.component.html b/src/frontend/app/profile/profile.component.html index 2dfb918d7e..dbbb669a01 100644 --- a/src/frontend/app/profile/profile.component.html +++ b/src/frontend/app/profile/profile.component.html @@ -218,10 +218,13 @@ </plugin-autocomplete> </div> </div> + <br/> <fieldset *ngIf="authService.user.substitute != null && signaturesService.signaturesList.length > 0"> <legend align="left">{{'lang.signSubstituted' | translate}} :</legend> <ng-container> - <button type="button" class="signListButton" mat-stroked-button *ngFor="let signature of signaturesService.signaturesList; let i=index" (click)="toggleSignature(i)" [class.selected]="signature.substituted"><img [src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + signature.encodedSignature)"/></button> + <button type="button" class="signListButton" mat-stroked-button *ngFor="let signature of signaturesService.signaturesList; let i=index" (click)="toggleSignature(i)" [class.selected]="signature.substituted"> + <img style="width: 190px;" [src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + signature.encodedSignature)"/> + </button> </ng-container> </fieldset> </fieldset> diff --git a/src/frontend/app/profile/profile.component.ts b/src/frontend/app/profile/profile.component.ts index 29a2fe3b8e..a749f688f5 100644 --- a/src/frontend/app/profile/profile.component.ts +++ b/src/frontend/app/profile/profile.component.ts @@ -279,10 +279,6 @@ export class ProfileComponent implements OnInit { selectSubstitute(newUserSubtituted: any) { - if (this.profileInfo.substitute !== null) { - alert(this.translate.instant('lang.substitutionWarn')); - } - this.http.put('../rest/users/' + this.authService.user.id + '/substitute', { substitute: newUserSubtituted.id }) .subscribe(() => { this.authService.updateUserInfoWithTokenRefresh(); diff --git a/src/frontend/app/signatures/signatures.component.scss b/src/frontend/app/signatures/signatures.component.scss index 8a220389db..fd5ff1fa5e 100644 --- a/src/frontend/app/signatures/signatures.component.scss +++ b/src/frontend/app/signatures/signatures.component.scss @@ -36,7 +36,13 @@ display: flex; justify-content: center; align-items: center; - + .substituteInfo { + color: #F99830; + font-size: 10px; + position: absolute; + top: 0px; + left: 10px; + } &.create { background-color: #F1F4F4; flex-direction: column; @@ -69,4 +75,4 @@ .remove_icon { left: 5px; -} \ No newline at end of file +} -- GitLab