Commit 5ce093a7 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17812 TIME 0:15 display delegation message in sendAvisParallel action + translate

parent 3e57817c
......@@ -15,6 +15,6 @@
<img src="assets/spinner.gif"/>
</div>
</app-root>
<script src="runtime-es2015.497d8eb67297abf47895.js" type="module"></script><script src="runtime-es5.497d8eb67297abf47895.js" nomodule defer></script><script src="polyfills-es5.c174c1516561194600a5.js" nomodule defer></script><script src="polyfills-es2015.b86be9c6fde12488a69f.js" type="module"></script><script src="scripts.b9f328a06b6423d59d32.js" defer></script><script src="main-es2015.792585df43ad12e9807f.js" type="module"></script><script src="main-es5.792585df43ad12e9807f.js" nomodule defer></script></body>
<script src="runtime-es2015.497d8eb67297abf47895.js" type="module"></script><script src="runtime-es5.497d8eb67297abf47895.js" nomodule defer></script><script src="polyfills-es5.c174c1516561194600a5.js" nomodule defer></script><script src="polyfills-es2015.b86be9c6fde12488a69f.js" type="module"></script><script src="scripts.b9f328a06b6423d59d32.js" defer></script><script src="main-es2015.e8f82aa66d3b23a7ede4.js" type="module"></script><script src="main-es5.e8f82aa66d3b23a7ede4.js" nomodule defer></script></body>
</html>
\ No newline at end of file
......@@ -120,7 +120,7 @@
.delegationMsg {
color: var(--maarch-color-danger);;
font-size: 12px;
font-size: 14px;
margin-top: 20px;
display: flex !important;
}
\ No newline at end of file
......@@ -91,9 +91,8 @@ export class GiveAvisParallelActionComponent implements OnInit {
}
executeAction(realResSelected: number[]) {
const delegateMsg: string = this.translate.instant('lang.insteadOf').replace(/^.{1}/g, this.translate.instant('lang.insteadOf')[0].toLowerCase());
const opinionUserState: string = this.delegation.isDelegated ? `${this.translate.instant('lang.opinionUserState').toUpperCase()} ${delegateMsg} ${this.delegation.userDelegated}` : this.translate.instant('lang.opinionUserState');
const noteContent: string = `[${opinionUserState}] ${this.noteEditor.getNoteContent()}`;
const opinionUserState: string = this.translate.instant('lang.delegatedOpinion').concat(' ', this.delegation.userDelegated);
const noteContent: string = this.delegation.isDelegated ? `[${this.translate.instant('lang.opinionUserState')}] ${this.noteEditor.getNoteContent()}${opinionUserState}` : `[${this.translate.instant('lang.opinionUserState')}] ${this.noteEditor.getNoteContent()}`;
this.noteEditor.setNoteContent(noteContent);
this.http.put(this.data.processActionRoute, { resources: realResSelected, note: this.noteEditor.getNote()}).pipe(
tap((data: any) => {
......
......@@ -14,6 +14,9 @@
<b *ngIf="data.resIds.length > 1" color="primary" class="highlight">{{data.resIds.length}}
{{'lang.elements' | translate}}</b> ?
</div>
<app-maarch-message *ngIf="delegation.isDelegated && !noResourceToProcess" mode="danger">
{{'lang.signInsteadOf' | translate}}&nbsp;<b style="overflow: hidden;text-overflow: ellipsis;" [title]="delegation.userDelegated">{{ delegation.userDelegated }}</b>
</app-maarch-message>
<div *ngIf="resourcesError.length > 0" class="alert-message alert-message-danger mailList" role="alert">
<p>
{{'lang.canNotMakeAction' | translate}} :
......
......@@ -8,6 +8,7 @@ import { tap, finalize, catchError } from 'rxjs/operators';
import { of } from 'rxjs';
import { FunctionsService } from '@service/functions.service';
import { AvisWorkflowComponent } from '../../avis/avis-workflow.component';
import { HeaderService } from '@service/header.service';
@Component({
templateUrl: 'send-avis-parallel-action.component.html',
......@@ -28,6 +29,11 @@ export class SendAvisParallelComponent implements AfterViewInit {
availableRoles: any[] = [];
delegation: any = {
isDelegated: false,
userDelegated: null
};
@ViewChild('noteEditor', { static: true }) noteEditor: NoteEditorComponent;
@ViewChild('appAvisWorkflow', { static: false }) appAvisWorkflow: AvisWorkflowComponent;
......@@ -36,6 +42,7 @@ export class SendAvisParallelComponent implements AfterViewInit {
public http: HttpClient,
private notify: NotificationService,
public dialogRef: MatDialogRef<SendAvisParallelComponent>,
public headerService: HeaderService,
@Inject(MAT_DIALOG_DATA) public data: any,
public functions: FunctionsService) { }
......@@ -45,6 +52,15 @@ export class SendAvisParallelComponent implements AfterViewInit {
if (this.appAvisWorkflow.emptyWorkflow()) {
this.appAvisWorkflow.loadDefaultWorkflow(this.data.resIds[0]);
}
const userId: number = parseInt(this.data.userId, 10);
this.delegation.isDelegated = userId !== this.headerService.user.id ? true : false;
if (this.delegation.isDelegated && !this.noResourceToProcess) {
this.http.get('../rest/users/' + userId).pipe(
tap((user: any) => {
this.delegation.userDelegated = `${user.firstname} ${user.lastname}`;
})
).subscribe();
}
}
}
......
......@@ -2488,5 +2488,6 @@
"interconnectionTest": "Test the configuration of the <b> Maarch Courrier / Maarch RM interconnection </b> configured in the <b> config.json </b> file",
"interconnectionFailed": "<b>Interconnection with Maarch RM failed.</b> Error when calling Maarch RM server",
"interconnectionSuccess": "<b>Successful interconnection with Maarch RM.</b>",
"startTest": "Start the test"
"startTest": "Start the test",
"delegatedOpinion": "Opinion given instead of"
}
......@@ -2483,5 +2483,6 @@
"interconnectionTest": "Tester le paramétrage de <b>l'interconnexion Maarch Courrier / Maarch RM</b> configuré dans le fichier <b>config.json</b>",
"interconnectionFailed": "<b>L'interconnexion avec Maarch RM a échouée.</b> Erreur lors de l'appel au serveur Maarch RM",
"interconnectionSuccess": "<b>Interconnexion réussie avec Maarch RM.</b>",
"startTest": "Lancer le test"
"startTest": "Lancer le test",
"delegatedOpinion": "Avis donné à la place de"
}
Supports Markdown
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