Commit 07eadb00 authored by Paul durand's avatar Paul durand
Browse files

merge tckt 18167 in 20.10_TMA1

parents 9378b36d a9efcf3e
......@@ -15,6 +15,6 @@
<img src="assets/spinner.gif"/>
</div>
</app-root>
<script src="runtime-es2015.4ac42fef445445e6f3d0.js" type="module"></script><script src="runtime-es5.4ac42fef445445e6f3d0.js" nomodule defer></script><script src="polyfills-es5.8c2a86db22bc37211976.js" nomodule defer></script><script src="polyfills-es2015.f8f86766446f4344eec7.js" type="module"></script><script src="scripts.3f995a62571f9f668311.js" defer></script><script src="main-es2015.3b0e5c88b8a41cf73e94.js" type="module"></script><script src="main-es5.3b0e5c88b8a41cf73e94.js" nomodule defer></script></body>
<script src="runtime-es2015.4ac42fef445445e6f3d0.js" type="module"></script><script src="runtime-es5.4ac42fef445445e6f3d0.js" nomodule defer></script><script src="polyfills-es5.8c2a86db22bc37211976.js" nomodule defer></script><script src="polyfills-es2015.f8f86766446f4344eec7.js" type="module"></script><script src="scripts.3f995a62571f9f668311.js" defer></script><script src="main-es2015.3ae33a2f2b7056a4634a.js" type="module"></script><script src="main-es5.3ae33a2f2b7056a4634a.js" nomodule defer></script></body>
</html>
\ No newline at end of file
6164c2aeed1e491fda55056d7de8c7020f5b78e8 {"key":"0.1002.0|6673616|sha1-9Id1kK5OCCfl4JJqW7nJ8DvL9H4=|dl","integrity":"sha512-oGefJQppd7sMicN9LcEQ9nM+J7BlF09kIPwtldL5jMROS/pHFbQQUXWormIo/S1SIj1uOYtNIL0Ux5rP45rSVw==","time":1634631743812,"size":5110713,"metadata":{}}
\ No newline at end of file
e58b2eb27eb0a6cf6c9af7cbe1f13d3f489382ba {"key":"0.1002.0|6673616|sha1-9Id1kK5OCCfl4JJqW7nJ8DvL9H4=|orig","integrity":"sha512-AMdh7EfEH39PHrIBRW7E6BIWYhrLVYPyKoIGU6lrCu+vAqpAZmOaqg8f/rGDjjlDJdJksiOjd53waNfZpN9CLQ==","time":1634631753009,"size":4804633,"metadata":{}}
\ No newline at end of file
3b3021ca360e95bdb4bcefe581686ef99c7f0d1b {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"polyfills-es2015.f8f86766446f4344eec7.js\",\"contentHash\":\"ef8ed518af3a8574a07f\"}","integrity":"sha512-UEhCgJLbqChsFkP7HZSIWJtn2N3xQp+wleWSSiHHRBk81cOQp9T2UTAFLCdX/Fz/hHIXB7G5zJ1bEkH4DPY+MA==","time":1634631641876,"size":65517}
\ No newline at end of file
cc4c45f45b477295e37bda122270427196248ae7 {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"styles-es2015.bc41b50cd4bef3766a47.js\",\"contentHash\":\"d9bb24ff361d4d83bdc8\"}","integrity":"sha512-kVdJt8XxtKvPQdcdG9o4PpKoggnL9jSMK0GVDMxk+wtxUEccEA/g7t6hesOtQCQ9oUGdis1voeEiS9kpoqI/vA==","time":1634631640644,"size":993}
\ No newline at end of file
409491e4470061b51e3c8cf7374cc651a93b69db {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"pdfjsWorker-es2015.665ace94e399ff4cfebb.js\",\"contentHash\":\"7c4a1d295e6c20255379\"}","integrity":"sha512-xSynTwgbxPZ00gcr3GzkornNnkYzTMKELYkBG+9JRoTsXHyE7Qf3HG6k92cEEYn/6Tu7PQkFhhbP8DwL3UV/AQ==","time":1634631652460,"size":1051457}
\ No newline at end of file
8f775f06a30535738e2e95140a1327b756eed087 {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"main-es2015.3ae33a2f2b7056a4634a.js\",\"contentHash\":\"10ea1efe7534712ac11a\"}","integrity":"sha512-tel1Pfp9uIH5AEvW9IvdjiHNGDjR6/zCcsbVSXM3S3FPZav8x4N4vYF+8Mc1x95vU766sn+6chDU1ijO42xkLA==","time":1634631676705,"size":6859051}
\ No newline at end of file
0af98c183daa786dcb1bf079cf8dce3917db9ec0 {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"polyfills-es5.8c2a86db22bc37211976.js\",\"contentHash\":\"b6e326b3f0ae4811bc8c\"}","integrity":"sha512-V3mSbr07F6S37qTKIEWxzRQ0hru2hiTGzcSAC9hWJNsnN56C4oF0RtExGF7AYezULRWi0B3YmQd5Y9Fn9QKwiw==","time":1634631643922,"size":244175}
\ No newline at end of file
2cf7009dbbcb35dd6570e8ca6f816492c0e2cd36 {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"6-es2015.b7f34bc9554a5bd5d172.js\",\"contentHash\":\"66cc656feabbb5cc7f65\"}","integrity":"sha512-k1nEcBaQ5c37KMeUbY7sHG1CGtVMGD7eslx+xBbEzojAfGz3KTh9PsuC6zULIvBQAlZtzPF7a26/jAwt5B3liw==","time":1634631641901,"size":73526}
\ No newline at end of file
204d7d30c821ee585fcb4e40ca9adac103865b0e {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":undefined,\"exclude\":[\"scripts\"],\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":false}},\"nodeVersion\":\"v14.17.6\",\"name\":\"runtime-es2015.4ac42fef445445e6f3d0.js\",\"contentHash\":\"d384b2999937dc4816ec\"}","integrity":"sha512-KVD/MGNHKCgdqITQNo4Hs+slqhAjY8LlDcud+szi3WjcUmjSeTcGO5VLP/NRCEDMXkg6USyLlJX+HdXPRftNVg==","time":1634631640567,"size":4442}
\ No newline at end of file
5dea43c6c7f1980bccc783038d5db187fa8877ec {"key":"{\"terser\":\"5.3.0\",\"terser-webpack-plugin\":\"4.1.0\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.m?js(\\\\?.*)?$\", \"i\"),\"extractComments\":false,\"sourceMap\":false,\"cache\":\"\\u002Fvar\\u002Fwww\\u002Fhtml\\u002FMaarchCourrier2010_TMA1-2\\u002Fnode_modules\\u002F.cache\\u002Fterser-webpack\",\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":7,\"include\":[\"scripts\"],\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"warnings\":false,\"safari10\":true,\"output\":{\"ecma\":5,\"ascii_only\":false,\"comments\":false,\"webkit\":true,\"beautify\":false},\"compress\":{\"ecma\":5,\"pure_getters\":true,\"passes\":3,\"global_defs\":{\"ngDevMode\":false,\"ngI18nClosureMode\":false,\"ngJitMode\":false}},\"mangle\":true}},\"nodeVersion\":\"v14.17.6\",\"name\":\"scripts.3f995a62571f9f668311.js\",\"contentHash\":\"3f995a62571f9f668311\"}","integrity":"sha512-GtZHg6S8hnheF3EC3Chpt5srcqjVGv0Z2TQpP7ObwGQpAegkQCqZF4MBhjo5yI9fNBo1Dv35SYyUrSsPDJr7TQ==","time":1634631684968,"size":699326}
\ No newline at end of file
......@@ -2,14 +2,18 @@
<i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i>
</div>
<div *ngIf="!loading" class='visaContent'>
<!-- Header circuit visa -->
<div class="titleSignatureBook">
<!-- header tab -->
<div id="tabSignatureBook">
<div *ngIf="signatureBook.documents[0] && !signatureBook.documents[0].inSignatureBook"
<!-- SGAMI NGIF -->
<div *ngIf="signatureBook.documents[0] && !signatureBook.documents[0].inSignatureBook || letIconDisplay"
title="{{'lang.mail' | translate}}" class="item"
[ngClass]="{'activeTabSignatureBook': headerTab == 'document'}"
(click)="changeSignatureBookLeftContent('document')">
<i class="fa fa-file-alt fa-2x"></i>
</div>
<!-- END SGAMI NGIF -->
<div *ngFor="let module of processTool" title="{{module.label}}" class="item"
[ngClass]="{'activeTabSignatureBook': headerTab == module.id}"
[class.tool-disabled]="!isToolEnabled(module.id)"
......@@ -18,6 +22,7 @@
<i *ngIf="module.count > 0" class="fas fa-circle haveContent"></i>
</div>
</div>
<!-- End header tab -->
<div id="labelSignatureBook" title="{{signatureBook.documents[0].title}}">
<div>{{signatureBook.documents[0].alt_id}} : {{signatureBook.documents[0].title}}</div>
</div>
......@@ -40,6 +45,7 @@
</span>
</div>
</div>
<!-- end header -->
<div class="contentSignatureBook">
<div class="resListContent" [ngStyle]="{'display': showResLeftPanel ? 'inline-block' : 'none'}"
id="resListContent">
......@@ -74,6 +80,7 @@
<i class="fa fa-spinner fa-spin fa-4x"></i>
</div>
</div>
<!-- Leftview -->
<div *ngIf="showLeftPanel" class="contentLeft" [ngStyle]="{'width': leftContentWidth}" id="contentLeft">
<div *ngIf="showLeftPanel && showRightPanel" class="hideresListContent" (click)="displayPanel('RESLEFT')">
<i class="fa fa-chevron-left" aria-hidden="true" *ngIf="showResLeftPanel"></i>
......@@ -103,7 +110,8 @@
id="leftPanelShowDocumentIframe" #leftPanelShowDocumentIframe
[src]="leftViewerLink | secureUrl | async" [render-text]="true" [fit-to-page]="false"
[original-size]="true" [ngStyle]="{'height': showTopLeftPanel ? '84%' : '99%'}" [show-all]="true"
(error)="pdfViewerError(leftViewerLink)"></pdf-viewer>
(error)="pdfViewerError(leftViewerLink)">
</pdf-viewer>
<div *ngIf="leftSelectedThumbnail > 0 && signatureBook.documents[leftSelectedThumbnail].format != 'pdf' && !signatureBook.documents[leftSelectedThumbnail].isConverted"
[ngStyle]="{'height': showTopLeftPanel ? '79%' : '96%'}" class="visaNoPdfWarning">
<div style="padding-top: 25%;">
......@@ -119,6 +127,17 @@
</div>
</div>
</div>
<!-- SGAMI -->
<!-- <div *ngIf="headerTab == 'document'" class="contentShow" style="width:98%;">
<app-document-viewer #appDocumentViewerLeft id="leftPanelShowDocumentIframe"
*ngIf="signatureBook.attachments[leftSelectedThumbnail].isConverted"
style="height:100%;width:100%;" [editMode]="true" [hideTools]="true"
[mode]="'mainDocument'"
[resId]="signatureBook.attachments[leftSelectedThumbnail].signed ? signatureBook.attachments[leftSelectedThumbnail].viewerId : signatureBook.attachments[leftSelectedThumbnail].res_id"
[title]="signatureBook.attachments[leftSelectedThumbnail].identifier">
</app-document-viewer>
</div> -->
<!-- End SGAMI -->
<div *ngIf="headerTab == 'notes'" class="contentShow" style="width:98%;">
<app-notes-list #appNotesList [editMode]="true" [resId]="resId"
(reloadBadgeNotes)="refreshBadge($event,'notes')">
......@@ -148,6 +167,7 @@
<i class="fa fa-chevron-left" aria-hidden="true" *ngIf="!showRightPanel"></i>
</div>
</div>
<!-- END Leftview -->
<div *ngIf="showRightPanel" class="contentRight" id="contentRight" [ngStyle]="{'width': rightContentWidth}">
<div class="hideLeftContent" (click)="displayPanel('LEFT')" id="hideLeftContent"
[ngStyle]="{'margin-left': showLeftPanel ? '-13px' : '-2px'}">
......@@ -277,7 +297,6 @@
</span>
</div>
</div>
<app-attachments-list *ngIf="showAttachmentPanel" #appAttachmentsList [resId]="resId"
[target]="'process'" [canModify]="canUpdateDocument" (reloadBadgeAttachments)="refreshAttachments()"
(afterActionAttachment)="refreshAttachments()">
......@@ -291,11 +310,16 @@
</div>
</div>
<div class="panelRight">
<!-- RightPanel affiche les docs -->
<!-- SGAMI -->
<div *ngIf="signatureBook.attachments" id="rightPanelContent" class="panelRightContent">
<div title="[{{attachment.attachment_type}}] {{attachment.title}}" style="position: relative;"
class="item" *ngFor="let attachment of signatureBook.attachments; let i = index"
(click)="changeRightViewer(i)"
[ngClass]="{'panelSelectedThumbnail': i == rightSelectedThumbnail && !showAttachmentPanel}">
class="item unSelectetableItem" *ngFor="let attachment of signatureBook.attachments; let i = index"
(click)="i == 0 && leftDocumentDisplay ? false : changeRightViewer(i)"
[ngClass]="{'panelSelectedThumbnail': i == rightSelectedThumbnail && !showAttachmentPanel, 'visaDisabledButton': i == 0 && leftDocumentDisplay && !showAttachmentPanel}"
[ngStyle]="{'cursor': i == 0 && leftDocumentDisplay ? 'not-allowed': '', 'backgroundColor': i == 0 && leftDocumentDisplay ? 'inherit': ''} "
>
<!-- END -->
<span class="fa-stack fa-lg">
<i class="far fa-file fa-stack-2x"></i><i
style="font-weight:bold;letter-spacing: -1px;">{{attachment.icon}}</i>
......@@ -307,9 +331,14 @@
class="far fa-circle"></i>
<i *ngIf="attachment.sign && attachment.status == 'TMP'"
style="color:green;-ms-transform: rotate(-35deg);-webkit-transform: rotate(-35deg);transform: rotate(-35deg);position: absolute;top: 39px;right: 1px;">{{'lang.draft' | translate}}</i>
<!-- SGAMI -->
<i *ngIf="i == 0 && leftDocumentDisplay"
style="color:red;-ms-transform: rotate(-35deg);-webkit-transform: rotate(-35deg);transform: rotate(-35deg);position: absolute;top: 25px;right: 2px;"> Déjà affiché </i>
<!-- END -->
<br /><i style="position: absolute;margin-left: -9px;">.{{attachment.format}}</i>
</div>
</div>
<!-- End RightPanel affiche les docs -->
<div style="bottom: 0px;position: absolute;width:100%;">
<div class="panelRightListPj" (click)="displayAttachmentPanel()"
title="{{'lang.displayAtt' | translate}}"
......@@ -336,7 +365,6 @@
</div>
</div>
</div>
<div class="tooltip_templates" style="display: none">
<span id="obsVersionTooltip">
<div
......
......@@ -313,6 +313,7 @@
padding-bottom: 20px;
}
.contentRight .contentShow {
display: inline-block;
height: 91vh;
......
......@@ -55,6 +55,10 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
loading: boolean = false;
loadingSign: boolean = false;
canUpdateDocument: boolean = false;
// SGAMI
leftDocumentDisplay : boolean = false;
letIconDisplay: boolean = false;
// END
subscription: Subscription;
currentResourceLock: any = null;
......@@ -92,6 +96,9 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
@ViewChild('appVisaWorkflow', { static: false }) appVisaWorkflow: VisaWorkflowComponent;
@ViewChild('appDocumentViewer', { static: false }) appDocumentViewer: DocumentViewerComponent;
// SGAMI
@ViewChild('appDocumentViewerLeft', { static: false }) appDocumentViewerLeft: DocumentViewerComponent;
// END
@ViewChild('appNotesList', { static: false }) appNotesList: NotesListComponent;
constructor(
......@@ -116,7 +123,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
});
}
ngOnInit(): void {
ngOnInit(): void {
this.loading = true;
this.route.params.subscribe(params => {
......@@ -137,6 +144,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
return;
}
this.signatureBook = data;
console.dir("this.signatureBook", this.signatureBook);
this.canUpdateDocument = data.canUpdateDocuments;
this.headerTab = 'document';
this.leftSelectedThumbnail = 0;
......@@ -152,15 +160,22 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
this.leftContentWidth = '44%';
this.rightContentWidth = '44%';
// SGAMI
if (this.signatureBook.attachments[1]) {
this.rightSelectedThumbnail = 1;
this.rightViewerLink = this.signatureBook.attachments[1].viewerLink;
this.leftDocumentDisplay = true;
this.letIconDisplay = true;
}
if (this.signatureBook.documents[0]) {
this.leftViewerLink = this.signatureBook.documents[0].viewerLink;
if (this.signatureBook.documents[0].inSignatureBook) {
this.leftViewerLink = this.signatureBook.attachments[0].viewerLink;
if (this.signatureBook.documents[0].inSignatureBook && this.leftDocumentDisplay == false) {
this.headerTab = 'visaCircuit';
}
}
if (this.signatureBook.attachments[0]) {
this.rightViewerLink = this.signatureBook.attachments[0].viewerLink;
}
// END
this.signatureBook.resListIndex = this.signatureBook.resList.map((e: any) => e.res_id).indexOf(this.resId);
......@@ -179,8 +194,9 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
}, 0);
this.loadBadges();
this.loadActions();
if (this.appDocumentViewer !== undefined) {
this.appDocumentViewer.loadRessource(this.signatureBook.attachments[this.rightSelectedThumbnail].signed ? this.signatureBook.attachments[this.rightSelectedThumbnail].viewerId : this.signatureBook.attachments[this.rightSelectedThumbnail].res_id, this.signatureBook.attachments[this.rightSelectedThumbnail].isResource ? 'mainDocument' : 'attachment');
this.appDocumentViewer.loadRessource(this.signatureBook.attachments[this.rightSelectedThumbnail].signed ? this.signatureBook.attachments[this.rightSelectedThumbnail].viewerId : this.signatureBook.attachments[this.rightSelectedThumbnail].res_id, this.signatureBook.attachments[this.rightSelectedThumbnail].isResource ? 'mainDocument' : 'attachment');
}
}, (err) => {
this.notify.error(err.error.errors);
......@@ -192,7 +208,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
});
}
loadActions() {
loadActions() {
this.http.get('../rest/resourcesList/users/' + this.userId + '/groups/' + this.groupId + '/baskets/' + this.basketId + '/actions?resId=' + this.resId)
.subscribe((data: any) => {
this.signatureBook.actions = data.actions;
......@@ -228,7 +244,20 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
}
changeSignatureBookLeftContent(id: string) {
if (this.isToolModified()) {
// SGAMI
if(id === 'document') {
this.leftDocumentDisplay = true;
if(this.rightSelectedThumbnail == 0){
this.rightSelectedThumbnail = 1;
this.appDocumentViewer.loadRessource(this.signatureBook.attachments[this.rightSelectedThumbnail].signed ? this.signatureBook.attachments[this.rightSelectedThumbnail].viewerId : this.signatureBook.attachments[this.rightSelectedThumbnail].res_id, 'attachment');
}
}
else if(id !== 'document' && this.letIconDisplay == true ) {
this.leftDocumentDisplay = false;
}
// END SGAMI
if (this.isToolModified()) {
const dialogRef = this.openConfirmModification();
dialogRef.afterClosed().pipe(
......@@ -287,7 +316,9 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
this.rightViewerLink = '';
}
this.rightSelectedThumbnail = index;
// SGAMI
this.appDocumentViewer.loadRessource(this.signatureBook.attachments[this.rightSelectedThumbnail].signed ? this.signatureBook.attachments[this.rightSelectedThumbnail].viewerId : this.signatureBook.attachments[this.rightSelectedThumbnail].res_id, this.signatureBook.attachments[this.rightSelectedThumbnail].isResource ? 'mainDocument' : 'attachment');
// END SGAMI
}
changeLeftViewer(index: number) {
......@@ -386,12 +417,25 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
}
this.signatureBook.attachments = data;
if (mode === 'add' || mode === 'edit') {
this.changeRightViewer(i);
// SGAMI
this.leftDocumentDisplay = true;
this.letIconDisplay = true;
if(this.signatureBook.attachments.length === 2) {
this.changeSignatureBookLeftContent('document');
}
} else if (mode === 'del') {
this.changeRightViewer(0);
if(this.signatureBook.attachments.length >= 2) {
this.changeRightViewer(1);
} else {
this.changeRightViewer(0);
this.changeSignatureBookLeftContent('visaCircuit');
this.leftDocumentDisplay = false;
this.letIconDisplay = false;
}
}
// END
});
}
......@@ -455,7 +499,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
}
}
unsignFile(attachment: any) {
unsignFile(attachment: any) {
if (attachment.isResource) {
this.unSignMainDocument(attachment);
} else {
......@@ -463,7 +507,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
}
}
unSignMainDocument(attachment: any) {
unSignMainDocument(attachment: any) {
this.http.put(`../rest/resources/${attachment.res_id}/unsign`, {}).pipe(
tap(() => {
this.appDocumentViewer.loadRessource(attachment.res_id, 'maintDocument');
......@@ -473,6 +517,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
if (this.signatureBook.resList.length > 0) {
this.signatureBook.resList[this.signatureBook.resListIndex].allSigned = false;
}
if (this.headerTab === 'visaCircuit') {
this.changeSignatureBookLeftContent('document');
setTimeout(() => {
......@@ -491,7 +536,7 @@ export class SignatureBookComponent implements OnInit, OnDestroy {
).subscribe();
}
unSignAttachment(attachment: any) {
unSignAttachment(attachment: any) {
this.http.put('../rest/attachments/' + attachment.res_id + '/unsign', {}).pipe(
tap(() => {
this.appDocumentViewer.loadRessource(attachment.res_id, 'attachment');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment