💄 Trip notes: disable edition if trip is archived
This commit is contained in:
parent
920fc43719
commit
0a2d0d5c6f
@ -24,7 +24,7 @@
|
||||
<p-button (click)="closeDialog()" [disabled]="notes.pristine" label="Confirm" />
|
||||
} @else {
|
||||
<div></div>
|
||||
<p-button text label="Edit" icon="pi pi-pencil" (click)="toggleEditing()" />
|
||||
<p-button text label="Edit" [disabled]="isArchived" icon="pi pi-pencil" (click)="toggleEditing()" />
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
@ -14,6 +14,7 @@ import { TextareaModule } from 'primeng/textarea';
|
||||
})
|
||||
export class TripNotesModalComponent {
|
||||
notes = new FormControl('');
|
||||
isArchived = false;
|
||||
isEditing: boolean = false;
|
||||
|
||||
constructor(
|
||||
@ -21,7 +22,8 @@ export class TripNotesModalComponent {
|
||||
private config: DynamicDialogConfig,
|
||||
) {
|
||||
if (this.config.data) {
|
||||
this.notes.setValue(this.config.data);
|
||||
if (this.config.data.notes) this.notes.setValue(this.config.data.notes);
|
||||
this.isArchived = this.config.data.archived;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user