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

FEAT #12033 TIME 0:25 fix digest (limit + show more)

parent b2b8940b
No related branches found
No related tags found
No related merge requests found
Showing
with 156 additions and 66 deletions
......@@ -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>
......
......@@ -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
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
......@@ -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>
......
......@@ -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
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
......@@ -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>
......
......@@ -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
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
......@@ -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>
......
......@@ -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
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
......@@ -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>
......
......@@ -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) => {
......
......@@ -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",
};
......@@ -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",
};
......@@ -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
};
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