Skip to content
Snippets Groups Projects
Commit dcebf703 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #12091 TIME 1:30 disable note restriction in avis

parent d41ed76e
No related branches found
No related tags found
No related merge requests found
Showing
with 16 additions and 12 deletions
......@@ -51,7 +51,7 @@
readonly style="cursor:pointer;" disabled>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinion" [resIds]="data.resIds"></app-note-editor>
<app-note-editor #noteEditor [title]="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>
</app-avis-workflow>
......
......@@ -79,7 +79,7 @@ export class ContinueAvisCircuitActionComponent implements OnInit {
}
executeAction(realResSelected: number[]) {
const noteContent: string = `[avis] ${this.noteEditor.getNoteContent()}`;
const noteContent: string = `[${this.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) => {
......
......@@ -46,7 +46,7 @@
readonly style="cursor:pointer;" disabled>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinion" [resIds]="data.resIds"></app-note-editor>
<app-note-editor #noteEditor [title]="lang.addOpinion" [resIds]="data.resIds" [disableRestriction]="true"></app-note-editor>
</mat-sidenav-content>
</mat-sidenav-container>
</div>
......
......@@ -35,7 +35,7 @@
</mat-icon>
</button>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinionReason" [resIds]="data.resIds"></app-note-editor>
<app-note-editor #noteEditor [title]="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>
</app-avis-workflow>
......@@ -46,4 +46,4 @@
<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>
</div>
\ No newline at end of file
</div>
......@@ -45,7 +45,7 @@
</mat-icon>
</button>
</mat-form-field>
<app-note-editor *ngIf="data.resIds.length === 1 && !noResourceToProcess" #noteEditor [title]="lang.addOpinionReason" [content]="opinionContent" [resIds]="data.resIds"></app-note-editor>
<app-note-editor *ngIf="data.resIds.length === 1 && !noResourceToProcess" #noteEditor [title]="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>
</app-avis-workflow>
......@@ -56,4 +56,4 @@
<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>
</div>
\ No newline at end of file
</div>
......@@ -35,7 +35,7 @@
</mat-icon>
</button>
</mat-form-field>
<app-note-editor #noteEditor [title]="lang.addOpinionReason" [resIds]="data.resIds"></app-note-editor>
<app-note-editor #noteEditor [title]="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" #appAvisWorkflow>
</app-avis-workflow>
......@@ -46,4 +46,4 @@
<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>
</div>
\ No newline at end of file
</div>
......@@ -36,7 +36,7 @@
</div>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary"
[disabled]="loading || (resourcesInfo.noAttachmentsNotes.length > 0 && !checkNote())"
[disabled]="loading || (resourcesInfo.noAttachmentsNotes !== undefined && resourcesInfo.noAttachmentsNotes.length > 0 && !checkNote())"
(click)="onSubmit()">{{lang.validate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{lang.cancel}}</button>
</div>
......@@ -46,7 +46,7 @@ export class closeMailWithAttachmentsOrNotesActionComponent implements OnInit {
checkNote () {
if (this.noteEditor) {
if (this.noteEditor.getNote()) {
if (this.noteEditor.getNoteContent()) {
return true;
}
}
......
......@@ -7,7 +7,7 @@
<button mat-menu-item [matMenuTriggerFor]="menuTemplates" (menuOpened)="getTemplatesNote()">
<span>{{lang.noteTemplates}}</span>
</button>
<button mat-menu-item [matMenuTriggerFor]="menuEntities">
<button mat-menu-item [matMenuTriggerFor]="menuEntities" *ngIf="!disableRestriction">
<span>{{lang.visibleBy}}</span>
</button>
</mat-menu>
......
......@@ -34,6 +34,7 @@ export class NoteEditorComponent implements OnInit {
@Input('entitiesNoteRestriction') entitiesNoteRestriction: string[];
@Input('noteId') noteId: number;
@Input('defaultRestriction') defaultRestriction: boolean;
@Input('disableRestriction') disableRestriction: boolean = false;
@Output('refreshNotes') refreshNotes = new EventEmitter<string>();
searchTerm: FormControl = new FormControl();
......@@ -55,6 +56,9 @@ export class NoteEditorComponent implements OnInit {
if (this.upMode) {
this.content = this.noteContent;
if (this.content.startsWith(`[${this.lang.avisUserState}]`) || this.content.startsWith(`[${this.lang.avisUserAsk.toUpperCase()}]`)) {
this.disableRestriction = true;
}
this.entitiesRestriction = this.entitiesNoteRestriction;
}
......
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