diff --git a/src/frontend/app/profile.component.html b/src/frontend/app/profile.component.html index 13afce9a26e08cc362adebeb8e1a5bafb46e4d0d..b6a4e7966309611b1c1620fd99a4917edb2f1c2a 100755 --- a/src/frontend/app/profile.component.html +++ b/src/frontend/app/profile.component.html @@ -160,6 +160,30 @@ </mat-tab> <mat-tab label="{{lang.myParameters}}"> <mat-accordion> + <mat-expansion-panel> + <mat-expansion-panel-header> + <mat-panel-title> + <mat-icon color="primary" class="fa fa-file-word" + style="font-size:25px;width:50px;"></mat-icon> + <span>{{lang.editorOption}}</span> + </mat-panel-title> + <mat-panel-description *ngIf="!appService.getViewMode()"> + {{lang.editorOptionAdmin}} + </mat-panel-description> + </mat-expansion-panel-header> + + <div style="display:flex; margin-left: 30px"> + <div style="display:flex; align-items: center;">{{lang.documentEditor}}</div> + <div class="col-sm-2" style="display:flex; margin-left: 15px"> + <mat-form-field> + <mat-select name="documentEdition" [(ngModel)]="user.preferences.documentEdition" + (selectionChange)="onSubmit();"> + <mat-option *ngFor='let editor of editorsList' [value]="editor">{{editor}}</mat-option> + </mat-select> + </mat-form-field> + </div> + </div> + </mat-expansion-panel> <mat-expansion-panel> <mat-expansion-panel-header> <mat-panel-title> diff --git a/src/frontend/app/profile.component.ts b/src/frontend/app/profile.component.ts index 7ca25f67ce42aed957ec84f3a5d76b664f92284e..a538e1d1607de38013f293598e37983d98f7d4b7 100755 --- a/src/frontend/app/profile.component.ts +++ b/src/frontend/app/profile.component.ts @@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http'; import { LANG } from './translate.component'; import { NotificationService } from './notification.service'; import { HeaderService } from '../service/header.service'; -import { debounceTime, switchMap, distinctUntilChanged, filter } from 'rxjs/operators'; +import { debounceTime, switchMap, distinctUntilChanged, filter, tap } from 'rxjs/operators'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatExpansionPanel } from '@angular/material/expansion'; import { MatPaginator } from '@angular/material/paginator'; @@ -84,6 +84,7 @@ export class ProfileComponent implements OnInit { //Redirect Baskets selectionBaskets = new SelectionModel<Element>(true, []); myBasketExpansionPanel: boolean = false; + editorsList: any; masterToggleBaskets(event: any) { if (event.checked) { this.user.baskets.forEach((basket: any) => { @@ -184,6 +185,13 @@ export class ProfileComponent implements OnInit { this.dataSourceContactsListAutocomplete.paginator = this.paginatorGroupsListAutocomplete; //this.dataSource.sort = this.sortContactList; }); + + this.http.get("../../rest/documentEditors").pipe( + tap((data: any) => { + this.editorsList = data; + }) + ).subscribe(); + } initComponents(event: any) { @@ -749,6 +757,7 @@ export class ProfileComponent implements OnInit { }, (err) => { this.notify.error(err.error.errors); }); + this.headerService.resfreshCurrentUser(); } regexValidator(regex: RegExp, error: ValidationErrors): ValidatorFn { diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index 5385b9b524da7f62d65b5ccd1bc2c388d41136e2..e811ba374f9365b444f09e22176e9c27bf1bbc66 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1333,4 +1333,7 @@ export const LANG_EN = { "noSelectedContact": "No associated contact", "searchContact": "Search a contact", "acknowledgementReceiptGenerationImpossible": "Acknowledgement receipt generation impossible for resource(s) : ", + "editorOption": "Editor option", + "editorOptionAdmin": "Manage editor option", + "documentEditor": "Document editor", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 36edee59358fc42b8dbe46745c22c680f99d9f3a..ac4abff3063b3f3c469c7e048f78e54b3b8ba3c9 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1371,4 +1371,7 @@ export const LANG_FR = { "noSelectedContact": "Aucun contact associé", "searchContact": "Recherchez un contact", "acknowledgementReceiptGenerationImpossible": "Impossible de générer un accusé de réception pour le(s) courrier(s) : ", + "editorOption": "Option d'édition", + "editorOptionAdmin": "Gérer les paramètres d'édition", + "documentEditor": "Editeur de document", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index 7a97e6d2b919f3b242f6d8b2b3e3c755a1b0997e..86d19ebc31d3a3f583cd5b16779fca58d6704249 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1358,4 +1358,7 @@ export const LANG_NL = { "noSelectedContact": "No associated contact", //_TO_TRANSLATE "searchContact": "Search a contact", //_TO_TRANSLATE "acknowledgementReceiptGenerationImpossible": "Acknowledgement receipt generation impossible for resource(s) : ", //_TO_TRANSLATE + "editorOption": "Editor option", //_TO_TRANSLATE + "editorOptionAdmin": "Manage editor option", //_TO_TRANSLATE + "documentEditor": "Document editor", //_TO_TRANSLATE };