💄 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" />
|
<p-button (click)="closeDialog()" [disabled]="notes.pristine" label="Confirm" />
|
||||||
} @else {
|
} @else {
|
||||||
<div></div>
|
<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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -14,6 +14,7 @@ import { TextareaModule } from 'primeng/textarea';
|
|||||||
})
|
})
|
||||||
export class TripNotesModalComponent {
|
export class TripNotesModalComponent {
|
||||||
notes = new FormControl('');
|
notes = new FormControl('');
|
||||||
|
isArchived = false;
|
||||||
isEditing: boolean = false;
|
isEditing: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -21,7 +22,8 @@ export class TripNotesModalComponent {
|
|||||||
private config: DynamicDialogConfig,
|
private config: DynamicDialogConfig,
|
||||||
) {
|
) {
|
||||||
if (this.config.data) {
|
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