Commit 822f1522 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #14136 TIME 7 lang refactoring (90%)

parent a66abcd1
......@@ -22,22 +22,22 @@
<h3>Maarch Courrier {{applicationVersion}} </h3>
<em>Version : <a target="blank" href="https://labs.maarch.org/maarch/MaarchCourrier/commit/{{commitHash}}">{{commitHash}}</a></em>
<hr />
<p><em>Copyright &copy; 2008-2020 Maarch SAS {{lang.groupeCompany}}</em></p>
<p>{{lang.maarchLicence}}
<p><em>Copyright &copy; 2008-2020 Maarch SAS {{'lang.groupeCompany' | translate}}</em></p>
<p>{{'lang.maarchLicence' | translate}}
<a target="blank" href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">licence GNU GPLv3</a>.</p>
<div>
<ul>
<li>{{lang.officialWebsite}} : <a target="blank" href="https://maarch.com/">https://maarch.com</a></li>
<li>{{lang.community}} : <a target="blank"
<li>{{'lang.officialWebsite' | translate}} : <a target="blank" href="https://maarch.com/">https://maarch.com</a></li>
<li>{{'lang.community' | translate}} : <a target="blank"
href="https://community.maarch.org/">https://community.maarch.org</a></li>
<li>{{lang.documentation}} : <a target="blank"
<li>{{'lang.documentation' | translate}} : <a target="blank"
href="https://docs.maarch.org/">https://docs.maarch.org</a></li>
</ul>
</div>
<p>&nbsp;</p>
<h3>{{lang.externalComponents}}</h3>
<h3>{{'lang.externalComponents' | translate}}</h3>
<hr />
<em>{{lang.thanksToExtDev}}</em>
<em>{{'lang.thanksToExtDev' | translate}}</em>
<p>&nbsp;</p>
<ul>
<li><a target="blank" href="https://angular.io/">Angular</a></li>
......@@ -69,7 +69,7 @@
THIERRY-MIEG,
Cyril VAZQUEZ, Arnaud VEBER, Loic VINET</li>
<br>
<li><em>{{lang.thanksToCommunity}}</em></li>
<li><em>{{'lang.thanksToCommunity' | translate}}</em></li>
</ul>
<p>&nbsp;</p>
<div class="img_credits_maarch_box">
......
import { Component, OnInit } from '@angular/core';
import { LANG } from './translate.component';
import { TranslateService } from '@ngx-translate/core';
import { HeaderService } from '../service/header.service';
import { AppService } from '../service/app.service';
import { environment } from '../environments/environment';
......@@ -19,16 +20,17 @@ export class AboutUsComponent implements OnInit {
loading: boolean = false;
commitHash: string = this.lang.undefined;
commitHash: string = this.translate.instant('lang.undefined');
constructor(
private translate: TranslateService,
public http: HttpClient,
private notify: NotificationService,
private headerService: HeaderService,
public appService: AppService) { }
async ngOnInit() {
this.headerService.setHeader(this.lang.aboutUs);
this.headerService.setHeader(this.translate.instant('lang.aboutUs'));
this.applicationVersion = environment.VERSION;
this.loading = false;
......@@ -40,7 +42,7 @@ export class AboutUsComponent implements OnInit {
return new Promise((resolve) => {
this.http.get('../rest/commitInformation').pipe(
tap((data: any) => {
this.commitHash = data.hash !== null ? data.hash : this.lang.undefined;
this.commitHash = data.hash !== null ? data.hash : this.translate.instant('lang.undefined');
console.log(data);
resolve(true);
}),
......
......@@ -16,7 +16,7 @@
<mat-divider></mat-divider>
<button mat-menu-item class="followAction" (click)="unFollow()" [disabled]="selectedRes.length === 0">
<mat-icon class="far fa-star fa-2x"></mat-icon>
<span>{{lang.untrackThisMail}}</span>
<span>{{'lang.untrackThisMail' | translate}}</span>
</button>
<mat-divider></mat-divider>
<folder-menu [resIds]="selectedRes" [currentFolders]="folderList" (refreshList)="refreshList()" (refreshFolders)="refreshFolders()"></folder-menu>
......
import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../translate.component';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService } from '../../service/notification/notification.service';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { MatMenuTrigger } from '@angular/material/menu';
......@@ -46,6 +47,7 @@ export class ActionsListComponent implements OnInit {
@Output('refreshPanelFolders') refreshPanelFolders = new EventEmitter<string>();
constructor(
private translate: TranslateService,
public http: HttpClient,
private notify: NotificationService,
public dialog: MatDialog,
......@@ -113,7 +115,7 @@ export class ActionsListComponent implements OnInit {
} else {
this.actionsList = [{
id: 0,
label: this.lang.noAction,
label: this.translate.instant('lang.noAction'),
component: ''
}];
}
......@@ -133,13 +135,13 @@ export class ActionsListComponent implements OnInit {
}
unFollow() {
this.dialogRef = this.dialog.open(ConfirmComponent, { panelClass: 'maarch-modal', autoFocus: false, disableClose: true, data: { title: this.lang.delete, msg: this.lang.stopFollowingAlert } });
this.dialogRef = this.dialog.open(ConfirmComponent, { panelClass: 'maarch-modal', autoFocus: false, disableClose: true, data: { title: this.translate.instant('lang.delete'), msg: this.translate.instant('lang.stopFollowingAlert') } });
this.dialogRef.afterClosed().pipe(
filter((data: string) => data === 'ok'),
exhaustMap(() => this.http.request('DELETE', '../rest/resources/unfollow', { body: { resources: this.selectedRes } })),
tap((data: any) => {
this.notify.success(this.lang.removedFromFolder);
this.notify.success(this.translate.instant('lang.removedFromFolder'));
this.headerService.nbResourcesFollowed -= data.unFollowed;
this.refreshList();
})
......
......@@ -40,10 +40,14 @@ import { ValidateAvisParallelComponent } from './avis-parallel-validate-action/v
import { ReconcileActionComponent } from './reconciliation-action/reconcile-action.component';
import { SendAlfrescoActionComponent } from './send-alfresco-action/send-alfresco-action.component';
import { InternationalizationModule } from '../../service/translate/internationalization.module';
import { TranslateService } from '@ngx-translate/core';
@NgModule({
imports: [
SharedModule,
DocumentViewerModule
DocumentViewerModule,
InternationalizationModule
],
declarations: [
CriteriaToolComponent,
......@@ -151,4 +155,8 @@ import { SendAlfrescoActionComponent } from './send-alfresco-action/send-alfresc
ReconcileActionComponent,
]
})
export class ActionsModule { }
export class ActionsModule {
constructor(translate: TranslateService) {
translate.setDefaultLang('fr');
}
}
import { Injectable, OnDestroy } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../../app/translate.component';
import { TranslateService } from '@ngx-translate/core';
import { tap, catchError, filter, finalize, exhaustMap } from 'rxjs/operators';
import { of, Subject, Observable } from 'rxjs';
import { NotificationService } from '../../service/notification/notification.service';
......@@ -63,6 +64,7 @@ export class ActionsService implements OnDestroy {
private eventAction = new Subject<any>();
constructor(
private translate: TranslateService,
public http: HttpClient,
public dialog: MatDialog,
private notify: NotificationService,
......@@ -140,7 +142,7 @@ export class ActionsService implements OnDestroy {
} catch (error) {
console.log(error);
console.log(action.component);
alert(this.lang.actionNotExist);
alert(this.translate.instant('lang.actionNotExist'));
}
}
}
......@@ -165,7 +167,7 @@ export class ActionsService implements OnDestroy {
console.log(error);
console.log(action);
this.unlockResourceAfterActionModal([]);
alert(this.lang.actionNotExist);
alert(this.translate.instant('lang.actionNotExist'));
}
}
}
......@@ -175,7 +177,7 @@ export class ActionsService implements OnDestroy {
} catch (error) {
console.log(error);
console.log(action);
alert(this.lang.actionNotExist);
alert(this.translate.instant('lang.actionNotExist'));
}
}
}
......@@ -185,10 +187,10 @@ export class ActionsService implements OnDestroy {
return new Promise((resolve) => {
this.http.put(`../rest/resourcesList/users/${userId}/groups/${groupId}/baskets/${basketId}/locked`, { resources: resIds }).pipe(
tap((data: any) => {
let msgWarn = this.lang.warnLockRes + ' : ' + data.lockers.join(', ');
let msgWarn = this.translate.instant('lang.warnLockRes') + ' : ' + data.lockers.join(', ');
if (data.countLockedResources != resIds.length) {
msgWarn += this.lang.warnLockRes2 + '.';
msgWarn += this.translate.instant('lang.warnLockRes2') + '.';
}
if (data.countLockedResources > 0) {
......@@ -288,7 +290,7 @@ export class ActionsService implements OnDestroy {
this.headerService.nbResourcesFollowed++;
}
this.notify.success(this.lang.action + ' : "' + this.currentAction.label + '" ' + this.lang.done);
this.notify.success(this.translate.instant('lang.action') + ' : "' + this.currentAction.label + '" ' + this.translate.instant('lang.done'));
this.actionEnded = true;
this.eventAction.next(resIds);
......
......@@ -7,12 +7,12 @@
<mat-sidenav-container autosize style="height:100%;">
<mat-sidenav-content style="background: white;padding:10px;">
<div>
{{lang.makeActionOn}}
{{'lang.makeActionOn' | translate}}
<b *ngIf="data.resIds.length === 0" color="primary"
class="highlight">{{lang.currentIndexingMail}}</b>
class="highlight">{{'lang.currentIndexingMail' | translate}}</b>
<b *ngIf="data.resIds.length == 1" color="primary" class="highlight">{{data.resource.chrono}}</b>
<b *ngIf="data.resIds.length > 1" color="primary" class="highlight">{{data.resIds.length}}
{{lang.elements}}</b> ?
{{'lang.elements' | translate}}</b> ?
</div>
<div class="alert-message alert-message-info" *ngIf="data.resIds.length == 1 && !noResourceToProcess"
role="alert" style="margin-top: 30px;"
......@@ -26,12 +26,12 @@
<div class="alert-message alert-message-info"
*ngIf="data.resIds.length == 1 && appAvisWorkflow !== undefined && appAvisWorkflow.getNextAvisUser() === '' && !noResourceToProcess"
role="alert" style="margin-top: 30px;" [innerHTML]="lang.endWorkflow"></div>
role="alert" style="margin-top: 30px;" [innerHTML]="this.translate.instant('lang.endWorkflow')"></div>
<div *ngIf="resourcesErrors.length > 0" class="alert-message alert-message-danger mailList"
role="alert">
<p>
{{lang.canNotMakeAction}} :
{{'lang.canNotMakeAction' | translate}} :
</p>
<ul>
<li *ngFor="let ressource of resourcesErrors">
......@@ -49,11 +49,11 @@
</div>
<mat-form-field *ngIf="data.resIds.length === 1 && !noResourceToProcess" appearance="outline"
style="cursor:pointer;margin-top: 10px;">
<mat-label>{{lang.opinionLimitDate}}</mat-label>
<mat-label>{{'lang.opinionLimitDate' | translate}}</mat-label>
<input matInput [(ngModel)]="opinionLimitDate" readonly style="cursor:pointer;" disabled>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinion" [resIds]="data.resIds"
<app-note-editor #noteEditor [title]="this.translate.instant('lang.addOpinion')" [resIds]="data.resIds"
[disableRestriction]="true"></app-note-editor>
<app-avis-workflow *ngIf="data.resIds.length == 1" [adminMode]="false" [resId]="data.resIds[0]"
#appAvisWorkflow>
......@@ -64,7 +64,7 @@
<span class="divider-modal"></span>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary" [disabled]="loading || !isValidAction()"
(click)="onSubmit()">{{lang.validate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{lang.cancel}}</button>
(click)="onSubmit()">{{'lang.validate' | translate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{'lang.cancel' | translate}}</button>
</div>
</div>
\ No newline at end of file
import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { LANG } from '../../translate.component';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService } from '../../../service/notification/notification.service';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { HttpClient } from '@angular/common/http';
......@@ -32,6 +33,7 @@ export class ContinueAvisCircuitActionComponent implements OnInit {
@ViewChild('appAvisWorkflow', { static: false }) appAvisWorkflow: AvisWorkflowComponent;
constructor(
private translate: TranslateService,
public http: HttpClient,
private notify: NotificationService,
public dialogRef: MatDialogRef<ContinueAvisCircuitActionComponent>,
......@@ -79,7 +81,7 @@ export class ContinueAvisCircuitActionComponent implements OnInit {
}
executeAction(realResSelected: number[]) {
const noteContent: string = `[${this.lang.avisUserState}] ${this.noteEditor.getNoteContent()}`;
const noteContent: string = `[${this.translate.instant('lang.avisUserState')}] ${this.noteEditor.getNoteContent()}`;
this.noteEditor.setNoteContent(noteContent);
this.http.put(this.data.processActionRoute, {resources : realResSelected, note: this.noteEditor.getNote()}).pipe(
tap((data: any) => {
......
......@@ -7,12 +7,12 @@
<mat-sidenav-container autosize style="height:100%;">
<mat-sidenav-content style="background: white;padding:10px;">
<div>
{{lang.makeActionOn}}
{{'lang.makeActionOn' | translate}}
<b *ngIf="data.resIds.length === 0" color="primary"
class="highlight">{{lang.currentIndexingMail}}</b>
class="highlight">{{'lang.currentIndexingMail' | translate}}</b>
<b *ngIf="data.resIds.length == 1" color="primary" class="highlight">{{data.resource.chrono}}</b>
<b *ngIf="data.resIds.length > 1" color="primary" class="highlight">{{data.resIds.length}}
{{lang.elements}}</b> ?
{{'lang.elements' | translate}}</b> ?
</div>
<div class="alert-message alert-message-info" *ngIf="data.resIds.length == 1 && !noResourceToProcess"
role="alert" style="margin-top: 30px;"
......@@ -20,12 +20,12 @@
</div>
<div class="alert-message alert-message-info" *ngIf="data.resIds.length > 1 && !noResourceToProcess"
role="alert" style="margin-top: 30px;" [innerHTML]="lang.askOpinion"></div>
role="alert" style="margin-top: 30px;" [innerHTML]="this.translate.instant('lang.askOpinion')"></div>
<div *ngIf="resourcesErrors.length > 0" class="alert-message alert-message-danger mailList"
role="alert">
<p>
{{lang.canNotMakeAction}} :
{{'lang.canNotMakeAction' | translate}} :
</p>
<ul>
<li *ngFor="let ressource of resourcesErrors">
......@@ -43,11 +43,11 @@
</div>
<mat-form-field *ngIf="data.resIds.length === 1 && !noResourceToProcess" appearance="outline"
style="cursor:pointer;margin-top: 10px;">
<mat-label>{{lang.opinionLimitDate}}</mat-label>
<mat-label>{{'lang.opinionLimitDate' | translate}}</mat-label>
<input matInput [(ngModel)]="opinionLimitDate" readonly style="cursor:pointer;" disabled>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinion" [resIds]="data.resIds"
<app-note-editor #noteEditor [title]="this.translate.instant('lang.addOpinion')" [resIds]="data.resIds"
[disableRestriction]="true"></app-note-editor>
</mat-sidenav-content>
</mat-sidenav-container>
......@@ -55,7 +55,7 @@
<span class="divider-modal"></span>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary" [disabled]="loading || !isValidAction()"
(click)="onSubmit()">{{lang.validate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{lang.cancel}}</button>
(click)="onSubmit()">{{'lang.validate' | translate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{'lang.cancel' | translate}}</button>
</div>
</div>
\ No newline at end of file
import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { LANG } from '../../translate.component';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService } from '../../../service/notification/notification.service';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { HttpClient } from '@angular/common/http';
......@@ -30,6 +31,7 @@ export class GiveAvisParallelActionComponent implements OnInit {
@ViewChild('noteEditor', { static: true }) noteEditor: NoteEditorComponent;
constructor(
private translate: TranslateService,
public http: HttpClient,
private notify: NotificationService,
public dialogRef: MatDialogRef<GiveAvisParallelActionComponent>,
......@@ -78,7 +80,7 @@ export class GiveAvisParallelActionComponent implements OnInit {
}
executeAction(realResSelected: number[]) {
const noteContent: string = `[${this.lang.avisUserState}] ${this.noteEditor.getNoteContent()}`;
const noteContent: string = `[${this.translate.instant('lang.avisUserState')}] ${this.noteEditor.getNoteContent()}`;
this.noteEditor.setNoteContent(noteContent);
this.http.put(this.data.processActionRoute, { resources: realResSelected, note: this.noteEditor.getNote()}).pipe(
tap((data: any) => {
......
......@@ -7,16 +7,16 @@
<mat-sidenav-container autosize style="height:100%;">
<mat-sidenav-content style="background: white;padding:10px;">
<div>
{{lang.makeActionOn}}
{{'lang.makeActionOn' | translate}}
<b *ngIf="data.resIds.length === 0" color="primary"
class="highlight">{{lang.currentIndexingMail}}</b>
class="highlight">{{'lang.currentIndexingMail' | translate}}</b>
<b *ngIf="data.resIds.length == 1" color="primary" class="highlight">{{data.resource.chrono}}</b>
<b *ngIf="data.resIds.length > 1" color="primary" class="highlight">{{data.resIds.length}}
{{lang.elements}}</b> ?
{{'lang.elements' | translate}}</b> ?
</div>
<div *ngIf="resourcesError.length > 0" class="alert-message alert-message-danger mailList" role="alert">
<p>
{{lang.canNotMakeAction}} :
{{'lang.canNotMakeAction' | translate}} :
</p>
<ul>
<li *ngFor="let ressource of resourcesError">
......@@ -25,19 +25,19 @@
</ul>
</div>
<mat-form-field (click)="picker.open()" appearance="outline" style="cursor:pointer;margin-top: 10px;">
<mat-label>{{lang.opinionLimitDate}}</mat-label>
<mat-label>{{'lang.opinionLimitDate' | translate}}</mat-label>
<input matInput [(ngModel)]="opinionLimitDate" [matDatepicker]="picker"
[placeholder]="lang.chooseDate" [min]="today" readonly style="cursor:pointer;" required>
[placeholder]="this.translate.instant('lang.chooseDate')" [min]="today" readonly style="cursor:pointer;" required>
<mat-datepicker-toggle matSuffix [for]="picker" *ngIf="!opinionLimitDate">
</mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<button mat-button color="warn" matSuffix mat-icon-button *ngIf="opinionLimitDate"
(click)="$event.stopPropagation();opinionLimitDate = null;" [title]="lang.eraseValue">
(click)="$event.stopPropagation();opinionLimitDate = null;" [title]="this.translate.instant('lang.eraseValue')">
<mat-icon color="warn" class="fa fa-calendar-times">
</mat-icon>
</button>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinionReason" [resIds]="data.resIds"
<app-note-editor #noteEditor [title]="this.translate.instant('lang.addOpinionReason')" [resIds]="data.resIds"
[disableRestriction]="true"></app-note-editor>
<app-avis-workflow *ngIf="data.resIds.length == 1 || (!noResourceToProcess && data.resIds.length > 1)"
[adminMode]="true" [mode]="'parallel'" #appAvisWorkflow>
......@@ -48,7 +48,7 @@
<span class="divider-modal"></span>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary" [disabled]="loading || !isValidAction()"
(click)="onSubmit()">{{lang.validate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{lang.cancel}}</button>
(click)="onSubmit()">{{'lang.validate' | translate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{'lang.cancel' | translate}}</button>
</div>
</div>
\ No newline at end of file
import { Component, OnInit, Inject, ViewChild, AfterViewInit } from '@angular/core';
import { LANG } from '../../translate.component';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService } from '../../../service/notification/notification.service';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { HttpClient } from '@angular/common/http';
......@@ -32,6 +33,7 @@ export class SendAvisParallelComponent implements AfterViewInit {
@ViewChild('appAvisWorkflow', { static: false }) appAvisWorkflow: AvisWorkflowComponent;
constructor(
private translate: TranslateService,
public http: HttpClient,
private notify: NotificationService,
public dialogRef: MatDialogRef<SendAvisParallelComponent>,
......@@ -80,7 +82,7 @@ export class SendAvisParallelComponent implements AfterViewInit {
}
executeAction(realResSelected: number[]) {
const noteContent: string = `[${this.lang.avisUserAsk.toUpperCase()}] ${this.noteEditor.getNoteContent()}`;
const noteContent: string = `[${this.translate.instant('lang.avisUserAsk').toUpperCase()}] ${this.noteEditor.getNoteContent()}`;
this.noteEditor.setNoteContent(noteContent);
this.http.put(this.data.processActionRoute, { resources: realResSelected, note: this.noteEditor.getNote(), data: { opinionLimitDate: this.functions.formatDateObjectToDateString(this.opinionLimitDate, true, 'yyyy-mm-dd'), opinionCircuit : this.appAvisWorkflow.getWorkflow() } }).pipe(
tap((data: any) => {
......
......@@ -7,12 +7,12 @@
<mat-sidenav-container autosize style="height:100%;">
<mat-sidenav-content style="background: white;padding:10px;">
<div>
{{lang.makeActionOn}}
{{'lang.makeActionOn' | translate}}
<b *ngIf="data.resIds.length === 0" color="primary"
class="highlight">{{lang.currentIndexingMail}}</b>
class="highlight">{{'lang.currentIndexingMail' | translate}}</b>
<b *ngIf="data.resIds.length == 1" color="primary" class="highlight">{{data.resource.chrono}}</b>
<b *ngIf="data.resIds.length > 1" color="primary" class="highlight">{{data.resIds.length}}
{{lang.elements}}</b> ?
{{'lang.elements' | translate}}</b> ?
</div>
<div class="alert-message alert-message-info" *ngIf="data.resIds.length == 1 && !noResourceToProcess"
role="alert" style="margin-top: 30px;"
......@@ -20,12 +20,12 @@
</div>
<div class="alert-message alert-message-info" *ngIf="data.resIds.length > 1 && !noResourceToProcess"
role="alert" style="margin-top: 30px;" [innerHTML]="lang.validateAvisParallel"></div>
role="alert" style="margin-top: 30px;" [innerHTML]="this.translate.instant('lang.validateAvisParallel')"></div>
<div *ngIf="resourcesErrors.length > 0" class="alert-message alert-message-danger mailList"
role="alert">
<p>
{{lang.canNotMakeAction}} :
{{'lang.canNotMakeAction' | translate}} :
</p>
<ul>
<li *ngFor="let ressource of resourcesErrors">
......@@ -35,20 +35,20 @@
</div>
<mat-form-field *ngIf="data.resIds.length === 1 && !noResourceToProcess" (click)="picker.open()"
appearance="outline" style="cursor:pointer;margin-top: 10px;">
<mat-label>{{lang.opinionLimitDate}}</mat-label>
<mat-label>{{'lang.opinionLimitDate' | translate}}</mat-label>
<input matInput [(ngModel)]="opinionLimitDate" [matDatepicker]="picker"
[placeholder]="lang.chooseDate" [min]="today" readonly style="cursor:pointer;" required>
[placeholder]="this.translate.instant('lang.chooseDate')" [min]="today" readonly style="cursor:pointer;" required>
<mat-datepicker-toggle matSuffix [for]="picker" *ngIf="!opinionLimitDate">
</mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<button mat-button color="warn" matSuffix mat-icon-button *ngIf="opinionLimitDate"
(click)="$event.stopPropagation();opinionLimitDate = null;" [title]="lang.eraseValue">
(click)="$event.stopPropagation();opinionLimitDate = null;" [title]="this.translate.instant('lang.eraseValue')">
<mat-icon color="warn" class="fa fa-calendar-times">
</mat-icon>
</button>
</mat-form-field>
<app-note-editor *ngIf="data.resIds.length === 1 && !noResourceToProcess" #noteEditor
[title]="lang.addOpinionReason" [content]="opinionContent" [resIds]="data.resIds"
[title]="this.translate.instant('lang.addOpinionReason')" [content]="opinionContent" [resIds]="data.resIds"
[disableRestriction]="true"></app-note-editor>
<app-avis-workflow *ngIf="data.resIds.length === 1 && !noResourceToProcess" [adminMode]="true"
[mode]="'parallel'" #appAvisWorkflow>
......@@ -59,7 +59,7 @@
<span class="divider-modal"></span>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary" [disabled]="loading || !isValidAction()"
(click)="onSubmit()">{{lang.validate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{lang.cancel}}</button>
(click)="onSubmit()">{{'lang.validate' | translate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{'lang.cancel' | translate}}</button>
</div>
</div>
\ No newline at end of file
import { Component, OnInit, Inject, ViewChild, AfterViewInit } from '@angular/core';
import { LANG } from '../../translate.component';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService } from '../../../service/notification/notification.service';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { HttpClient } from '@angular/common/http';
......@@ -37,6 +38,7 @@ export class ValidateAvisParallelComponent implements OnInit, AfterViewInit {
@ViewChild('appAvisWorkflow', { static: false }) appAvisWorkflow: AvisWorkflowComponent;
constructor(
private translate: TranslateService,
public http: HttpClient,
private notify: NotificationService,
public dialogRef: MatDialogRef<ValidateAvisParallelComponent>,
......@@ -93,7 +95,7 @@ export class ValidateAvisParallelComponent implements OnInit, AfterViewInit {
}
executeAction(realResSelected: number[]) {
const noteContent: string = `[${this.lang.avisUserAsk.toUpperCase()}] ${this.noteEditor.getNoteContent()}${this.lang.validateBy} ${this.headerService.user.firstname} ${this.headerService.user.lastname}`;
const noteContent: string = `[${this.translate.instant('lang.avisUserAsk').toUpperCase()}] ${this.noteEditor.getNoteContent()}${this.translate.instant('lang.validateBy')} ${this.headerService.user.firstname} ${this.headerService.user.lastname}`;
this.noteEditor.setNoteContent(noteContent);
this.http.put(this.data.processActionRoute, { resources: realResSelected, data: { note: this.noteEditor.getNote(), opinionLimitDate: this.functions.formatDateObjectToDateString(this.opinionLimitDate, true), opinionCircuit: this.appAvisWorkflow.getWorkflow() } }).pipe(
tap((data: any) => {
......
......@@ -7,16 +7,16 @@
<mat-sidenav-container autosize style="height:100%;">
<mat-sidenav-content style="background: white;padding:10px;">
<div>
{{lang.makeActionOn}}
{{'lang.makeActionOn' | translate}}
<b *ngIf="data.resIds.length === 0" color="primary"
class="highlight">{{lang.currentIndexingMail}}</b>
class="highlight">{{'lang.currentIndexingMail' | translate}}</b>
<b *ngIf="data.resIds.length == 1" color="primary" class="highlight">{{data.resource.chrono}}</b>
<b *ngIf="data.resIds.length > 1" color="primary" class="highlight">{{data.resIds.length}}
{{lang.elements}}</b> ?
{{'lang.elements' | translate}}</b> ?
</div>
<div *ngIf="resourcesError.length > 0" class="alert-message alert-message-danger mailList" role="alert">
<p>
{{lang.canNotMakeAction}} :
{{'lang.canNotMakeAction' | translate}} :
</p>
<ul>
<li *ngFor="let ressource of resourcesError">
......@@ -25,19 +25,19 @@
</ul>
</div>
<mat-form-field (click)="picker.open()" appearance="outline" style="cursor:pointer;margin-top: 10px;">