diff --git a/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.html b/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.html index eb239746b35de494ca64a1fd69ae98586cf57bf8..f4e26f2940ad0288ef896c0bcc1b75992581ee30 100644 --- a/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.html +++ b/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.html @@ -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> diff --git a/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.ts b/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.ts index 3e0764e92a25a22f6da9e760be8f2263bd1b4464..bc181182fcae0242a199741ba3bd8ecca8f65b83 100644 --- a/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.ts +++ b/src/frontend/app/actions/avis-continue-circuit-action/continue-avis-circuit-action.component.ts @@ -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) => { diff --git a/src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.html b/src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.html index b8f5809ab56d737f97bbebcc067f4cc2e99516c0..67a3c663cc7772ca8b01b67df0ec5d9762e4e38b 100644 --- a/src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.html +++ b/src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.html @@ -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> diff --git a/src/frontend/app/actions/avis-parallel-send-action/send-avis-parallel-action.component.html b/src/frontend/app/actions/avis-parallel-send-action/send-avis-parallel-action.component.html index f5982e0a980024f56f1e6dd198f84da0d67c0cfc..83078a2193379d7d92a95b17a9a34b2f6b697e9d 100644 --- a/src/frontend/app/actions/avis-parallel-send-action/send-avis-parallel-action.component.html +++ b/src/frontend/app/actions/avis-parallel-send-action/send-avis-parallel-action.component.html @@ -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> diff --git a/src/frontend/app/actions/avis-parallel-validate-action/validate-avis-parallel-action.component.html b/src/frontend/app/actions/avis-parallel-validate-action/validate-avis-parallel-action.component.html index 70b3fb6355079764cf53df3e468778f5bfce4058..94255e76dbcd985184d341df7739b410a12b8c7d 100644 --- a/src/frontend/app/actions/avis-parallel-validate-action/validate-avis-parallel-action.component.html +++ b/src/frontend/app/actions/avis-parallel-validate-action/validate-avis-parallel-action.component.html @@ -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> diff --git a/src/frontend/app/actions/avis-workflow-send-action/send-avis-workflow-action.component.html b/src/frontend/app/actions/avis-workflow-send-action/send-avis-workflow-action.component.html index 7b65e8093b51c0fe96def2d91343bed8b495997f..463126d2dd73369a12c3a1c1959a4d192df4ab55 100644 --- a/src/frontend/app/actions/avis-workflow-send-action/send-avis-workflow-action.component.html +++ b/src/frontend/app/actions/avis-workflow-send-action/send-avis-workflow-action.component.html @@ -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> diff --git a/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.html b/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.html index dc57b1a6b8cf9edc7b0097f9aef37feda8ef4793..b844452d49527ddab4d16d0767b07f9dc6c50719 100644 --- a/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.html +++ b/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.html @@ -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> diff --git a/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.ts b/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.ts index ad50d8d8767a0ecb5d945000a57ae509b3510179..fd6d73af81b0a0f6f942f86cb2b022dc37c43a09 100644 --- a/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.ts +++ b/src/frontend/app/actions/close-mail-with-attachments-or-notes-action/close-mail-with-attachments-or-notes-action.component.ts @@ -46,7 +46,7 @@ export class closeMailWithAttachmentsOrNotesActionComponent implements OnInit { checkNote () { if (this.noteEditor) { - if (this.noteEditor.getNote()) { + if (this.noteEditor.getNoteContent()) { return true; } } diff --git a/src/frontend/app/notes/note-editor.component.html b/src/frontend/app/notes/note-editor.component.html index 4ee88a9758dcd62099c7b9e3822a969a1da5b1bf..e8dcd4b92d7af4af9875640c28975594c424359e 100644 --- a/src/frontend/app/notes/note-editor.component.html +++ b/src/frontend/app/notes/note-editor.component.html @@ -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> diff --git a/src/frontend/app/notes/note-editor.component.ts b/src/frontend/app/notes/note-editor.component.ts index 3333794abb110613df1457268f19c03b9be53715..6b8b25efc118bcadfbc20795d9a3c864ea48ff7b 100644 --- a/src/frontend/app/notes/note-editor.component.ts +++ b/src/frontend/app/notes/note-editor.component.ts @@ -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; }