Commit 835038a0 authored by Alex ORLUC's avatar Alex ORLUC

FEAT #12074 TIME 2:30 add light resources banner

parent 0987d8ef
......@@ -2,7 +2,9 @@
<mat-sidenav #snavLeft class="panel-left" #snav [mode]="appService.getViewMode() ? 'over' : 'side'"
[fixedInViewport]="appService.getViewMode()" [opened]="appService.getViewMode() ? false : true"
autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '95%' : '600px'}">
<header-panel [snavLeft]="snav" [navButton]="{icon: 'fa fa-inbox', label: lang.backBasket, route : '/basketList/users/'+currentUserId+'/groups/'+currentGroupId+'/baskets/'+currentBasketId}"></header-panel>
<header-panel [snavLeft]="snav"
[navButton]="{icon: 'fa fa-inbox', label: lang.backBasket, route : '/basketList/users/'+currentUserId+'/groups/'+currentGroupId+'/baskets/'+currentBasketId}">
</header-panel>
<div class="listModels">
<div class="processTool">
<div class="processTool-module jiggle" *ngFor="let module of processTool"
......@@ -36,7 +38,8 @@
<div class="title-divider"></div>
</div>
<div class="content">
<app-history-workflow-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'history'">
<app-history-workflow-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"
(goTo)="currentTool = 'history'">
</app-history-workflow-resume>
</div>
</div>
......@@ -46,7 +49,8 @@
<div class="title-divider"></div>
</div>
<div class="content">
<app-note-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'notes'"></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 +59,8 @@
<div class="title-divider"></div>
</div>
<div class="content">
<app-attachments-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'attachments'">
<app-attachments-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"
(goTo)="currentTool = 'attachments'">
</app-attachments-resume>
</div>
</div>
......@@ -65,7 +70,8 @@
<div class="title-divider"></div>
</div>
<div class="content">
<app-mail-resume *ngIf="!loading" [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'mails'"></app-mail-resume>
<app-mail-resume *ngIf="!loading" [resId]="currentResourceInformations.resId"
(goTo)="currentTool = 'mails'"></app-mail-resume>
</div>
</div>
</ng-container>
......@@ -134,39 +140,54 @@
</div>
<div class="bg-head-content" [class.fullContainer]="appService.getViewMode()" style="padding-bottom: 20px;">
<div class="resourceInfo">
<div class="title">
{{this.currentResourceInformations.subject}}
<div class="title-divider"></div>
</div>
<div class="content">
<div class="content-item">
<b><i class="fas fa-flag" style="font-size: 25px;padding-right: 20px;"></i> {{this.currentResourceInformations.priorityLabel}}</b>
</div>
<div class="content-item">
<div>{{lang.chronoNumberShort}} :</div>
<div class="content-item-value">{{this.currentResourceInformations.chrono}}</div>
<ng-container *ngIf="!loading; else elseInfoRes">
<div class="title">
{{this.currentResourceInformations.subject}}
<div class="title-divider"></div>
</div>
<div class="content-item">
<div>{{lang.senders}} :</div>
<div class="content-item-value">??? <i class="fas fa-circle"
style="color:green;font-size: 8px;"></i></div>
<div class="content">
<div class="content-item" *ngIf="this.currentResourceInformations.priority !== undefined">
<b><i class="fas fa-flag" [style.color]="this.currentResourceInformations.priorityColor"
style="font-size: 25px;padding-right: 20px;"></i>
{{this.currentResourceInformations.priorityLabel}}</b>
</div>
<div class="content-item">
<div>{{lang.chronoNumberShort}} :</div>
<div class="content-item-value" [title]="'N° '+this.currentResourceInformations.resId">{{this.currentResourceInformations.chrono}}</div>
</div>
<div class="content-item">
<div>{{lang.senders}} :</div>
<div class="content-item-value">??? <i class="fas fa-circle"
style="color:#00CB55;font-size: 8px;"></i></div>
</div>
<div class="content-item" *ngIf="this.currentResourceInformations.processLimitDate !== undefined">
<ng-container
*ngIf="this.currentResourceInformations.closingDate !== null; else elseLimitDate">
<div style="font-weight: bold;" [title]="this.currentResourceInformations.closingDate | fullDate">{{this.lang.closed}} {{this.lang.onRange}} {{this.currentResourceInformations.closingDate | timeAgo}}&nbsp;&nbsp;<i
class="fa fa-lock"></i></div>
</ng-container>
<ng-template #elseLimitDate>
<div>{{lang.processLimitDate}} :</div>
<div class="content-item-value"
[title]="this.currentResourceInformations.processLimitDate | fullDate"
[innerHTML]="this.currentResourceInformations.processLimitDate | timeLimit : 'badge'">
</div>
</ng-template>
</div>
</div>
<div class="content-item">
<div>{{lang.processLimitDate}} :</div>
<div class="content-item-value" [innerHTML]="this.currentResourceInformations.processLimitDate | timeLimit"> <i class="fas fa-circle"
style="color:red;font-size: 8px;"></i></div>
</div>
<div class="content-item">
<div>Autre info :</div>
<div class="content-item-value">Bla bla</div>
</ng-container>
<ng-template #elseInfoRes>
<div>
</div>
</div>
</ng-template>
</div>
</div>
</div>
<div class="document-container" [class.fullContainer]="appService.getViewMode()">
<div class="content">
<app-document-viewer #appDocumentViewer style="height:100%;width:100%;" [editMode]="false" [resId]="currentResourceInformations.resId">
<app-document-viewer #appDocumentViewer style="height:100%;width:100%;" [editMode]="false"
[resId]="currentResourceInformations.resId">
</app-document-viewer>
</div>
</div>
......@@ -177,7 +198,8 @@
[ngStyle]="{'width': appService.getViewMode() ? '80%' : '30%'}" autoFocus="false">
</mat-sidenav>
</mat-sidenav-container>
<div class="modal-module" cdkDrag *ngFor="let modal of modalModule; let i=index" [class.largeModal]="modal.id === 'info'">
<div class="modal-module" cdkDrag *ngFor="let modal of modalModule; let i=index"
[class.largeModal]="modal.id === 'info'">
<div class="modal-module-title" cdkDragHandle>
<span>
{{modal.label}}
......
......@@ -212,7 +212,7 @@
.content {
display: flex;
font-size: 16px;
font-size: 15px;
overflow: auto;
&-item {
......
......@@ -130,7 +130,7 @@ export class ProcessComponent implements OnInit {
ngOnInit(): void {
this.loading = true;
this.headerService.setHeader("Traitement d'un courrier");
this.headerService.setHeader(this.lang.eventProcessDoc);
this.route.params.subscribe(params => {
this.currentUserId = params['userSerialId'];
......@@ -139,7 +139,6 @@ export class ProcessComponent implements OnInit {
this.currentResourceInformations = {
resId: params['resId'],
category: 'outgoing',
mailtracking: false
};
......@@ -180,6 +179,7 @@ export class ProcessComponent implements OnInit {
this.http.get(`../../rest/resources/${this.currentResourceInformations.resId}?light=true`).pipe(
tap((data: any) => {
this.currentResourceInformations = data;
this.headerService.setHeader(this.lang.eventProcessDoc, this.lang[this.currentResourceInformations.categoryId]);
}),
catchError((err: any) => {
this.notify.handleErrors(err);
......
......@@ -135,3 +135,17 @@ html,body {
height: auto;
}
.badgePipe_accent{
color: #00CB55;
font-size: 8px;
}
.badgePipe_secondary{
color: #EF8717;
font-size: 8px;
}
.badgePipe_warn{
color: red;
font-size: 8px;
}
\ No newline at end of file
......@@ -1264,4 +1264,5 @@ export const LANG_EN = {
"diffListPrivilegeMsgIndexing" : "in indexing page.",
"diffListPrivilegeMsgProcess" : "in process page.",
"recordMail" : "Record a mail",
"closed" : "Closed",
};
......@@ -1301,4 +1301,5 @@ export const LANG_FR = {
"diffListPrivilegeMsgIndexing" : "lors de l'enregistrement du courrier.",
"diffListPrivilegeMsgProcess" : "lors du traitement du courrier.",
"recordMail" : "Enregistrer un courrier",
"closed" : "Clôturé",
};
......@@ -1289,4 +1289,5 @@ export const LANG_NL = {
"diffListPrivilegeMsgIndexing" : "in indexing page.", //_TO_TRANSLATE
"diffListPrivilegeMsgProcess" : "in process page.", //_TO_TRANSLATE
"recordMail" : "Record a mail", //_TO_TRANSLATE
"closed" : "Closed", //_TO_TRANSLATE
};
......@@ -8,8 +8,11 @@ import { LANG } from '../app/translate.component';
export class TimeLimitPipe implements PipeTransform, OnDestroy {
private timer: number;
lang: any = LANG;
constructor(private changeDetectorRef: ChangeDetectorRef, private ngZone: NgZone) {}
transform(value:string) {
constructor(
private changeDetectorRef: ChangeDetectorRef,
private ngZone: NgZone) {}
transform(value:string, args: string = null) {
this.removeTimer();
let d = new Date(value);
let dayNumber = ('0' + d.getDate()).slice(-2);
......@@ -49,20 +52,22 @@ export class TimeLimitPipe implements PipeTransform, OnDestroy {
if(value == null) {
return '<span>' + this.lang.undefined + '</span>';
} else if(now > d) {
return '<span class="timeDanger" color="warn"><b>' + this.lang.outdated + ' !</b></span>';
if (args === 'badge') {
return this.getFormatedDate('', '<b>' + this.lang.outdated + ' ' + this.lang.fromRange + ' ' + (days-1) + ' '+ this.lang.dayS +' !</b>', 'warn', args);
} else {
return this.getFormatedDate('', '<b>' + this.lang.outdated + ' !</b>', 'warn', args);
}
} else {
if (Number.isNaN(seconds)){
return '';
} else if (minutes <= 59){
return '<span color="warn"><b>'+ minutes + ' ' + this.lang.minutes +'</b></span>';
return this.getFormatedDate(this.lang.in[0].toUpperCase() + this.lang.in.substr(1).toLowerCase(), minutes + ' ' + this.lang.minutes, 'warn', args);
} else if (hours <= 23){
return '<span color="warn"><b>'+ hours + ' ' + this.lang.hours +'</b></span>';
} else if (days <= 3) {
return '<span color="warn"><b>'+ days + ' ' + this.lang.dayS +'</b></span>';
} else if (days <= 7) {
return '<span class="timeWarn">'+ days + ' ' + this.lang.dayS +'</span>';
return this.getFormatedDate(this.lang.in[0].toUpperCase() + this.lang.in.substr(1).toLowerCase(), hours + ' ' + this.lang.hours, 'secondary', args);
} else if (days <= 5) {
return this.getFormatedDate(this.lang.in[0].toUpperCase() + this.lang.in.substr(1).toLowerCase(), days + ' ' + this.lang.dayS, 'secondary', args);
} else if (days <= 345) {
return '<span color="accent">'+d.getDate()+' '+ month[d.getMonth()]+'</span>';
return this.getFormatedDate(this.lang.onRange[0].toUpperCase() + this.lang.onRange.substr(1).toLowerCase(), d.getDate()+' '+ month[d.getMonth()], 'accent', args);
} else if (days <= 545) {
return dayNumber + '/' + monthNumber + '/' + d.getFullYear();
} else { // (days > 545)
......@@ -93,4 +98,12 @@ export class TimeLimitPipe implements PipeTransform, OnDestroy {
return 3600;
}
}
getFormatedDate(prefix: string,content: string, color: string, mode: string) {
if (mode === 'badge') {
return `${prefix} ${content}&nbsp;<i class="fas fa-circle badgePipe_${color}"></i>`;
} else {
return `<span color="${color}">${content}</span>`;
}
}
}
\ No newline at end of file
Markdown is supported
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