diff --git a/src/frontend/app/list/basket-list.component.ts b/src/frontend/app/list/basket-list.component.ts index db4b18da4de8412946316f4e80b40f7b381b57f7..4a374dcddc1118bfc118e13ea2d1bd567b2f79da 100755 --- a/src/frontend/app/list/basket-list.component.ts +++ b/src/frontend/app/list/basket-list.component.ts @@ -303,7 +303,7 @@ export class BasketListComponent implements OnInit { Object.keys(element).forEach((key) => { if (key == 'statusImage' && element[key] == null) { element[key] = 'fa-question undefined'; - } else if ((element[key] == null || element[key] == '') && ['closingDate', 'countAttachments', 'countNotes', 'display', 'folders', 'hasDocument', 'mailTracking'].indexOf(key) === -1) { + } else if ((element[key] == null || element[key] == '') && ['closingDate', 'countAttachments', 'countNotes', 'display', 'folders', 'hasDocument', 'integrations'].indexOf(key) === -1) { element[key] = this.lang.undefined; } }); diff --git a/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.html b/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.html index a468c259689ffcc992fe092607af774f01586db8..bc499764e88c0c21f36634f38d3f512807411e8a 100644 --- a/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.html +++ b/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.html @@ -58,7 +58,7 @@ <mat-form-field *ngIf="showInvisibleCopies"> <span matPrefix class="attachLabel">Cci : </span> - <mat-chip-list id="invcopies-list" #invCopiesList cdkDropList [cdkDropListConnectedTo]="['recipients-list','copies-list']" [cdkDropListData]="copies" (cdkDropListDropped)="drop($event)"> + <mat-chip-list id="invcopies-list" #invCopiesList cdkDropList [cdkDropListConnectedTo]="['recipients-list','copies-list']" [cdkDropListData]="invisibleCopies" (cdkDropListDropped)="drop($event)"> <mat-chip class="copy" *ngFor="let invCopy of invisibleCopies" [selectable]="selectable" removable (removed)="remove(invCopy, 'invisibleCopies')"> {{invCopy.email}} @@ -76,40 +76,39 @@ </mat-form-field> <mat-form-field floatLabel="never"> <input matInput placeholder="Sujet" [(ngModel)]="emailsubject" maxlength="70"> - <button mat-icon-button matSuffix (click)="$event.stopPropagation();" [matMenuTriggerFor]="mainDocListMenu"> + <button mat-icon-button matSuffix [title]="'Attacher le document principal'" (click)="$event.stopPropagation();" [matMenuTriggerFor]="mainDocListMenu"> <mat-icon class="fa fa-file" color="primary"></mat-icon> </button> - <mat-menu #mainDocListMenu="matMenu"> + <mat-menu #mainDocListMenu="matMenu" [class]="'attachListMenu'"> <button mat-menu-item *ngFor="let doc of mainDocList" (click)="toggleAttachMail(doc,'maindocument','original')">{{doc.label}}</button> </mat-menu> - - <button mat-icon-button matSuffix (click)="$event.stopPropagation();" [matMenuTriggerFor]="notesListMenu"> + <button mat-icon-button matSuffix [title]="'Attacher une annotations'" (click)="$event.stopPropagation();" [matMenuTriggerFor]="notesListMenu"> <mat-icon class="fas fa-pen-square" color="primary"></mat-icon> </button> - <mat-menu #notesListMenu="matMenu"> + <mat-menu #notesListMenu="matMenu" [class]="'attachListMenu'"> <button mat-menu-item *ngFor="let note of notesList" (click)="toggleAttachMail(note,'note','original')">{{note.label}}</button> </mat-menu> - <button mat-icon-button matSuffix (click)="$event.stopPropagation();" [matMenuTriggerFor]="attachListMenu"> + <button mat-icon-button [title]="'Attacher une pièce jointe'" matSuffix (click)="$event.stopPropagation();" [matMenuTriggerFor]="attachListMenu"> <mat-icon class="fa fa-paperclip" color="primary"></mat-icon> </button> - <mat-menu #attachListMenu="matMenu"> - <button mat-menu-item *ngFor="let attach of attachmentsList" (click)="toggleAttachMail(attach,'attachment','original')">{{attach.label}}</button> + <mat-menu #attachListMenu="matMenu" [class]="'attachListMenu'"> + <button mat-menu-item disableRipple *ngFor="let attach of attachmentsList"><span (click)="toggleAttachMail(attach,'attachment','original')">{{attach.label}} - {{attach.format}}</span> <span class="pdfVersion" (click)="toggleAttachMail(attach,'attachment','pdf');">(version PDF)</span></button> </mat-menu> </mat-form-field> <mat-chip-list> <mat-chip class="copy" *ngIf="emailAttach.document.isLinked" [selectable]="selectable" removable (removed)="removeAttachMail(0, 'document')"> - <i class="fa fa-file attachLabel"></i> {{emailAttach.document.label}} + <i class="fa fa-file attachLabel"></i> {{emailAttach.document.label}} <small class="attachLabel">(pdf - 25 Ko)</small> <mat-icon matChipRemove class="fa fa-times"></mat-icon> </mat-chip> <mat-chip class="copy" *ngFor="let item of emailAttach.attachments; let i=index;" [selectable]="selectable" removable (removed)="removeAttachMail(i, 'attachments')"> - <i class="fa fa-paperclip attachLabel"></i> {{item.label}} + <i class="fa fa-paperclip attachLabel"></i> {{item.label}} <small class="attachLabel">({{item.format}} - {{item.size}})</small> <mat-icon matChipRemove class="fa fa-times"></mat-icon> </mat-chip> <mat-chip class="copy" *ngFor="let item of emailAttach.notes; let i=index;" [selectable]="selectable" removable (removed)="removeAttachMail(i, 'notes')"> - <i class="fas fa-pen-square attachLabel"></i> {{item.label}} + <i class="fas fa-pen-square attachLabel"></i> {{item.label}} <small class="attachLabel">({{item.format}})</small> <mat-icon matChipRemove class="fa fa-times"></mat-icon> </mat-chip> </mat-chip-list> diff --git a/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.scss b/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.scss index 6505fb123db563cb9336d29d4be00536d7d34395..4a966ffa34e49aa4656518bb85b7c024f4860404 100644 --- a/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.scss +++ b/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.scss @@ -34,4 +34,14 @@ .attachLabel { color: $primary; +} + +.pdfVersion:hover { + color: $primary; +} + +::ng-deep.attachListMenu { + width: auto; + max-width: initial; + min-height: auto; } \ No newline at end of file diff --git a/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.ts b/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.ts index a2851971c65df58ce38eb85029f56e036c42b34d..f1f307e23ae4eee7949b1081934e606a27d7238c 100644 --- a/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.ts +++ b/src/frontend/app/sendedResource/sended-resource-page/sended-resource-page.component.ts @@ -238,11 +238,13 @@ export class SendedResourcePageComponent implements OnInit { setSender(id: number) { this.http.get(`../../rest/contacts/${id}`).pipe( tap((data: any) => { - this.recipients.push( - { - email: data.email - } - ) + if (!this.functions.empty(data.email)) { + this.recipients.push( + { + email: data.email + } + ) + } }), catchError((err) => { this.notify.handleSoftErrors(err); @@ -269,29 +271,35 @@ export class SendedResourcePageComponent implements OnInit { this.mainDocList = [ { id: 100, + chrono : 'MAARCH/2019A/0001', label: 'Réservation Bal', typeLabel: 'Document principal', - pdfVersion: 131, + isPdfVersion: true, creator: 'Bernard Blier', - size: '40ko' + format: 'pdf', + size: '40 Ko' } ]; this.attachmentsList = [ { id: 100, + chrono : 'MAARCH/2019D/0002', label: 'je suis une pj', typeLabel: 'Projet de réponse', - pdfVersion: 131, + isPdfVersion: true, creator: 'Bernard Blier', + format: 'odt', size: '40ko' }, { id: 102, + chrono : 'MAARCH/2019D/0003', label: 'je suis une pj 2', typeLabel: 'Projet de réponse', - pdfVersion: 131, + isPdfVersion: true, creator: 'Bernard Blier', - size: '40ko' + format: 'docx', + size: '40 Ko' } ]; @@ -300,8 +308,9 @@ export class SendedResourcePageComponent implements OnInit { id: 100, label: 'Je suis une note', typeLabel: 'Note', - pdfVersion: null, + isPdfVersion: true, creator: 'Bernard Blier', + format: 'html', size: null } ]; @@ -403,6 +412,8 @@ export class SendedResourcePageComponent implements OnInit { this.emailAttach.attachments.push({ id: item.id, label: item.label, + format : mode !== 'pdf' ? item.format : 'pdf', + size: item.size, original: mode === 'pdf' ? false : true }); } @@ -410,7 +421,9 @@ export class SendedResourcePageComponent implements OnInit { if (this.emailAttach.notes.filter((noteId: any) => noteId === item.id).length === 0) { this.emailAttach.notes.push({ id: item.id, - label: item.label + label: item.label, + format : mode !== 'pdf' ? item.format : 'pdf', + size: item.size, }); } } @@ -439,8 +452,8 @@ export class SendedResourcePageComponent implements OnInit { const data = { sender: this.currentSender, recipients: this.recipients.map(recipient => recipient.email), - cc: this.copies.map(copy => copy.email), - cci: this.invisibleCopies.map((invCopy => invCopy.email)), + cc: this.showCopies ? this.copies.map(copy => copy.email) : [], + cci: this.showInvisibleCopies ? this.invisibleCopies.map((invCopy => invCopy.email)) : [], object: this.emailsubject, body: this.tinymceInput, isHtml: true, @@ -449,4 +462,8 @@ export class SendedResourcePageComponent implements OnInit { return Object.assign({}, this.emailAttach, data); } + + isSelectedAttachMail() { + + } } \ No newline at end of file