diff --git a/src/frontend/app/attachments/attachments-resume/attachments-resume.component.html b/src/frontend/app/attachments/attachments-resume/attachments-resume.component.html index 49f77dda04b445b1282d2ea8470b493bc220acd4..ce84e2bb533ae3cd0d743be01df82e189f4d2a31 100644 --- a/src/frontend/app/attachments/attachments-resume/attachments-resume.component.html +++ b/src/frontend/app/attachments/attachments-resume/attachments-resume.component.html @@ -4,27 +4,25 @@ </div> </ng-container> <ng-template #elseTemplate> - <ng-container *ngFor="let attachment of attachments"> - <div class="attachmentsList" (click)="showAttachment(attachment)"> - <ng-container *ngIf="attachment.update_date !== null; else elseTemplate"> - <div class="date" [title]="attachment.update_date | fullDate"> - {{attachment.update_date | timeAgo}} - </div> - </ng-container> - <ng-template #elseTemplate> - <div class="date" [title]="attachment.creation_date | fullDate"> - {{attachment.creation_date | timeAgo}} - </div> - </ng-template> - <div class="info"> - {{attachment.title}} + <div class="attachmentsList" *ngFor="let attachment of attachments" (click)="showAttachment(attachment)"> + <ng-container *ngIf="attachment.update_date !== null; else elseTemplate"> + <div class="date" [title]="attachment.update_date | fullDate"> + {{attachment.update_date | timeAgo}} </div> - <div class="attachmentType"> - {{attachment.typeLabel}} + </ng-container> + <ng-template #elseTemplate> + <div class="date" [title]="attachment.creation_date | fullDate"> + {{attachment.creation_date | timeAgo}} </div> + </ng-template> + <div class="info"> + {{attachment.title}} </div> - <mat-divider></mat-divider> - </ng-container> + <div class="attachmentType"> + {{attachment.typeLabel}} + </div> + </div> + <button mat-button *ngIf="attachments.length === 3" class="showMore" (click)="showMore()">{{lang.showMore}}</button> <div class="noData" *ngIf="attachments.length === 0"> {{lang.noAttachment}} </div> diff --git a/src/frontend/app/attachments/attachments-resume/attachments-resume.component.scss b/src/frontend/app/attachments/attachments-resume/attachments-resume.component.scss index 8edeb08880c4ed4c4705057a730803120b47a6ff..92d43247cbcdde74745177582198ccc8267eff71 100644 --- a/src/frontend/app/attachments/attachments-resume/attachments-resume.component.scss +++ b/src/frontend/app/attachments/attachments-resume/attachments-resume.component.scss @@ -7,6 +7,10 @@ display: grid; grid-template-columns: 15% 65% 20%; align-items: center; + + &:nth-child(2n) { + background: rgba($primary, .1); + } } .date { @@ -33,4 +37,17 @@ display: flex; justify-content: center; height: 100%; +} + +.showMore { + float: right; + font-size: 10px; + position: absolute; + right: 10px; + margin-top: -2px; + padding: 0; + line-height: 20px; + width: 35px; + color: $secondary; + font-weight: bold; } \ No newline at end of file diff --git a/src/frontend/app/attachments/attachments-resume/attachments-resume.component.ts b/src/frontend/app/attachments/attachments-resume/attachments-resume.component.ts index 96889925ca1536f51808d415ed009a952d1488a8..5cefd4debbfe279fba37d6a91dfec081674fe190 100644 --- a/src/frontend/app/attachments/attachments-resume/attachments-resume.component.ts +++ b/src/frontend/app/attachments/attachments-resume/attachments-resume.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { LANG } from '../../translate.component'; import { catchError, tap, finalize } from 'rxjs/operators'; @@ -25,6 +25,7 @@ export class AttachmentsResumeComponent implements OnInit { attachments: any[] = []; @Input('resId') resId: number = null; + @Output('goTo') goTo = new EventEmitter<string>(); constructor( public http: HttpClient, @@ -40,7 +41,7 @@ export class AttachmentsResumeComponent implements OnInit { loadAttachments(resId: number) { this.loading = true; - this.http.get(`../../rest/resources/${resId}/attachments?limit=2`).pipe( + this.http.get(`../../rest/resources/${resId}/attachments?limit=3`).pipe( tap((data: any) => { this.attachments = data.attachments; }), @@ -55,4 +56,8 @@ export class AttachmentsResumeComponent implements OnInit { showAttachment(attachment: any) { this.dialog.open(AttachmentShowModalComponent, { data: { attachment: attachment } }); } + + showMore() { + this.goTo.emit(); + } } \ No newline at end of file diff --git a/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.html b/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.html index 3966321b5dc40caddfe5ab571f0282546fd2ed22..7ce47be4ee6a5c13c4dda73623134560cbf21a57 100644 --- a/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.html +++ b/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.html @@ -4,17 +4,15 @@ </div> </ng-container> <ng-template #elseTemplate> - <ng-container *ngFor="let history of histories"> - <div class="historyList"> - <div class="date" [title]="history.event_date | fullDate"> - {{history.event_date | timeAgo}} - </div> - <div class="info"> - {{history.info}} - </div> + <div class="historyList" *ngFor="let history of histories"> + <div class="date" [title]="history.event_date | fullDate"> + {{history.event_date | timeAgo}} </div> - <mat-divider></mat-divider> - </ng-container> + <div class="info"> + {{history.info}} + </div> + </div> + <button mat-button *ngIf="histories.length === 3" class="showMore" (click)="showMore()">{{lang.showMore}}</button> <div class="noData" *ngIf="histories.length === 0"> {{lang.noEvent}} </div> diff --git a/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.scss b/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.scss index 8a6d80264dfe4388fbd26be45008bb8b8b079db1..99a77e53d899bb413657e0d1a6ce385f0e836441 100644 --- a/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.scss +++ b/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.scss @@ -6,6 +6,10 @@ display: grid; grid-template-columns: 15% 85%; align-items: center; + + &:nth-child(2n) { + background: rgba($primary, .1); + } } .date { @@ -28,4 +32,17 @@ display: flex; justify-content: center; height: 100%; +} + +.showMore { + float: right; + font-size: 10px; + position: absolute; + right: 10px; + margin-top: -2px; + padding: 0; + line-height: 20px; + width: 35px; + color: $secondary; + font-weight: bold; } \ No newline at end of file diff --git a/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.ts b/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.ts index a35ed2a601cbdcb93a02b48ba3867eca5b6d96b6..34d5ee84dc4a9788cd9297b02565ef37d2079355 100644 --- a/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.ts +++ b/src/frontend/app/history/history-workflow-resume/history-workflow-resume.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { LANG } from '../../translate.component'; import { catchError, tap, finalize } from 'rxjs/operators'; @@ -23,6 +23,7 @@ export class HistoryWorkflowResumeComponent implements OnInit { histories: any[] = []; @Input('resId') resId: number = null; + @Output('goTo') goTo = new EventEmitter<string>(); constructor( public http: HttpClient, @@ -37,7 +38,7 @@ export class HistoryWorkflowResumeComponent implements OnInit { loadHistory(resId: number) { this.loading = true; - this.http.get(`../../rest/histories/resources/${resId}/workflow?limit=2`).pipe( + this.http.get(`../../rest/histories/resources/${resId}/workflow?limit=3`).pipe( tap((data: any) => { this.histories = data.history; }), @@ -48,4 +49,8 @@ export class HistoryWorkflowResumeComponent implements OnInit { }) ).subscribe(); } + + showMore() { + this.goTo.emit(); + } } \ No newline at end of file diff --git a/src/frontend/app/mail/mail-resume/mail-resume.component.html b/src/frontend/app/mail/mail-resume/mail-resume.component.html index af5fb0853b9d14cd894e0c6402dcd96af4767863..e27238fab2c3b0878cbace20ff2159649899a649 100644 --- a/src/frontend/app/mail/mail-resume/mail-resume.component.html +++ b/src/frontend/app/mail/mail-resume/mail-resume.component.html @@ -4,20 +4,18 @@ </div> </ng-container> <ng-template #elseTemplate> - <ng-container *ngFor="let mail of mails"> - <div class="mailList"> - <div class="date" [title]="mail.creation_date | fullDate"> - {{mail.send_date | timeAgo}} - </div> - <div class="info"> - {{mail.object}} - </div> - <div class="date"> - {{mail.userInfo}} - </div> + <div class="mailList" *ngFor="let mail of mails"> + <div class="date" [title]="mail.creation_date | fullDate"> + {{mail.send_date | timeAgo}} </div> - <mat-divider></mat-divider> - </ng-container> + <div class="info"> + {{mail.object}} + </div> + <div class="date"> + {{mail.userInfo}} + </div> + </div> + <button mat-button *ngIf="mails.length === 3" class="showMore" (click)="showMore()">{{lang.showMore}}</button> <div class="noData" *ngIf="mails.length === 0"> {{lang.noSendmail}} </div> diff --git a/src/frontend/app/mail/mail-resume/mail-resume.component.scss b/src/frontend/app/mail/mail-resume/mail-resume.component.scss index 61b296c982b24e565884e2fb26754d9f27457d61..4362deb31e547055508f66027c80d3ae8e3a764c 100644 --- a/src/frontend/app/mail/mail-resume/mail-resume.component.scss +++ b/src/frontend/app/mail/mail-resume/mail-resume.component.scss @@ -6,6 +6,10 @@ display: grid; grid-template-columns: 15% 70% 15%; align-items: center; + + &:nth-child(2n) { + background: rgba($primary, .1); + } } .date { @@ -28,4 +32,17 @@ display: flex; justify-content: center; height: 100%; +} + +.showMore { + float: right; + font-size: 10px; + position: absolute; + right: 10px; + margin-top: -2px; + padding: 0; + line-height: 20px; + width: 35px; + color: $secondary; + font-weight: bold; } \ No newline at end of file diff --git a/src/frontend/app/mail/mail-resume/mail-resume.component.ts b/src/frontend/app/mail/mail-resume/mail-resume.component.ts index b56de933c366f973ac5ecbaa521d33e77dcb1b70..5adea2cf954f7669fde8115a98b672442e94db00 100644 --- a/src/frontend/app/mail/mail-resume/mail-resume.component.ts +++ b/src/frontend/app/mail/mail-resume/mail-resume.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { LANG } from '../../translate.component'; import { catchError, tap, finalize } from 'rxjs/operators'; @@ -23,6 +23,7 @@ export class MailResumeComponent implements OnInit { mails: any[] = []; @Input('resId') resId: number = null; + @Output('goTo') goTo = new EventEmitter<string>(); constructor( public http: HttpClient, @@ -37,7 +38,7 @@ export class MailResumeComponent implements OnInit { loadMails(resId: number) { this.loading = true; - this.http.get(`../../rest/externalSummary/${resId}?limit=2`).pipe( + this.http.get(`../../rest/externalSummary/${resId}?limit=3`).pipe( tap((data: any) => { this.mails = data.elementsSend; }), @@ -48,4 +49,8 @@ export class MailResumeComponent implements OnInit { }) ).subscribe(); } + + showMore() { + this.goTo.emit(); + } } \ No newline at end of file diff --git a/src/frontend/app/notes/note-resume/note-resume.component.html b/src/frontend/app/notes/note-resume/note-resume.component.html index dba777db3af0e98674205ed7b5c1a5eb9fe8f780..9c791285fa222e95e19d0d137d8be6d7d5432093 100644 --- a/src/frontend/app/notes/note-resume/note-resume.component.html +++ b/src/frontend/app/notes/note-resume/note-resume.component.html @@ -4,20 +4,18 @@ </div> </ng-container> <ng-template #elseTemplate> - <ng-container *ngFor="let note of notes"> - <div class="noteList"> - <div class="date" [title]="note.creation_date | fullDate"> - {{note.creation_date | timeAgo}} - </div> - <div class="info"> - {{note.value}} - </div> - <div class="date"> - {{note.firstname}} {{note.lastname}} - </div> + <div class="noteList" *ngFor="let note of notes"> + <div class="date" [title]="note.creation_date | fullDate"> + {{note.creation_date | timeAgo}} </div> - <mat-divider></mat-divider> - </ng-container> + <div class="info"> + {{note.value}} + </div> + <div class="date"> + {{note.firstname}} {{note.lastname}} + </div> + </div> + <button mat-button *ngIf="notes.length === 3" class="showMore" (click)="showMore()">{{lang.showMore}}</button> <div class="noData" *ngIf="notes.length === 0"> {{lang.noNote}} </div> diff --git a/src/frontend/app/notes/note-resume/note-resume.component.scss b/src/frontend/app/notes/note-resume/note-resume.component.scss index e3b8791997a2b4a1db8e4ff11ee1208899efb15f..fe772e0b38ef756e3d75d9b132a8210a9ad18947 100644 --- a/src/frontend/app/notes/note-resume/note-resume.component.scss +++ b/src/frontend/app/notes/note-resume/note-resume.component.scss @@ -6,6 +6,10 @@ display: grid; grid-template-columns: 15% 70% 15%; align-items: center; + + &:nth-child(2n) { + background: rgba($primary, .1); + } } .date { @@ -29,4 +33,17 @@ display: flex; justify-content: center; height: 100%; +} + +.showMore { + float: right; + font-size: 10px; + position: absolute; + right: 10px; + margin-top: -2px; + padding: 0; + line-height: 20px; + width: 35px; + color: $secondary; + font-weight: bold; } \ No newline at end of file diff --git a/src/frontend/app/notes/note-resume/note-resume.component.ts b/src/frontend/app/notes/note-resume/note-resume.component.ts index 3765fc7545a83f04d220f7e87670e5b2506698a6..4f23e18a604739f78ccddd0f294c2b94f9b0ecd4 100644 --- a/src/frontend/app/notes/note-resume/note-resume.component.ts +++ b/src/frontend/app/notes/note-resume/note-resume.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { LANG } from '../../translate.component'; import { catchError, tap, finalize } from 'rxjs/operators'; @@ -23,6 +23,7 @@ export class NoteResumeComponent implements OnInit { notes: any[] = []; @Input('resId') resId: number = null; + @Output('goTo') goTo = new EventEmitter<string>(); constructor( public http: HttpClient, @@ -37,7 +38,7 @@ export class NoteResumeComponent implements OnInit { loadNotes(resId: number) { this.loading = true; - this.http.get(`../../rest/resources/${resId}/notes?limit=2`).pipe( + this.http.get(`../../rest/resources/${resId}/notes?limit=3`).pipe( tap((data: any) => { this.notes = data.notes; }), @@ -48,4 +49,8 @@ export class NoteResumeComponent implements OnInit { }) ).subscribe(); } + + showMore() { + this.goTo.emit(); + } } \ No newline at end of file diff --git a/src/frontend/app/process/process.component.html b/src/frontend/app/process/process.component.html index 2ef14dc5ba46261dc3f6a2b93a809d5a80f6ddb5..d92b56ab8f9f57e31dd7f0e973647805eda74a30 100644 --- a/src/frontend/app/process/process.component.html +++ b/src/frontend/app/process/process.component.html @@ -36,7 +36,7 @@ <div class="title-divider"></div> </div> <div class="content"> - <app-history-workflow-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"> + <app-history-workflow-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'history'"> </app-history-workflow-resume> </div> </div> @@ -46,7 +46,7 @@ <div class="title-divider"></div> </div> <div class="content"> - <app-note-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"></app-note-resume> + <app-note-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'notes'"></app-note-resume> </div> </div> <div class="banner" [style.borderColor]="currentPriorityColor"> @@ -55,7 +55,7 @@ <div class="title-divider"></div> </div> <div class="content"> - <app-attachments-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"> + <app-attachments-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'attachments'"> </app-attachments-resume> </div> </div> @@ -65,7 +65,7 @@ <div class="title-divider"></div> </div> <div class="content"> - <app-mail-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"></app-mail-resume> + <app-mail-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'mails'"></app-mail-resume> </div> </div> </ng-container> diff --git a/src/frontend/app/process/process.component.ts b/src/frontend/app/process/process.component.ts index 231f4a54ea3b92732df8c70e74c9c30ed40c10f8..be8ab8fa1135dc7d17aeec8f38715edd1c7e9c02 100644 --- a/src/frontend/app/process/process.component.ts +++ b/src/frontend/app/process/process.component.ts @@ -190,6 +190,13 @@ export class ProcessComponent implements OnInit { } lockResource() { + this.http.put(`../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/lock`, { resources: [this.currentResourceInformations.resId] }).pipe( + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + this.currentResourceLock = setInterval(() => { this.http.put(`../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/lock`, { resources: [this.currentResourceInformations.resId] }).pipe( catchError((err: any) => { diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index aefc5a7b61469c9787d082dda14fb0c1d3f2418c..81d713666c4eb5b2c68659c1714cbff09fb827ec 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1249,4 +1249,5 @@ export const LANG_EN = { "backBasket" : "Back to basket", "openInExternalModal" : "Open in external modal", "openedInExternalModal" : "Opened in external modal", + "showMore" : "Show more", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 0a2758dfa3d764fa09cb6aed565bc558f7d0c955..03bbb1697024ac9f2da7cd89075f14236fbd42b2 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1286,4 +1286,5 @@ export const LANG_FR = { "backBasket" : "Retour bannette", "openInExternalModal" : "Ouvrir dans une nouvelle modale", "openedInExternalModal" : "Ouvert dans une modale", + "showMore" : "Voir plus", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index 9e00f0d607e44fa9dfc50f97b968b2c5e0495307..c9d8821b4626e8e2c934cc141baf2eae4d82a880 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1274,4 +1274,5 @@ export const LANG_NL = { "backBasket" : "Back to basket", //_TO_TRANSLATE "openInExternalModal" : "Open in external modal", //_TO_TRANSLATE "openedInExternalModal" : "Opened in external modal", //_TO_TRANSLATE + "showMore" : "Show more", //_TO_TRANSLATE };