mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1792: #4610 Disable Option to Unselect Selected Customer Type
#4610 Disable Option to Unselect Selected Customer Type
This commit is contained in:
committed by
Lorenz Hilpert
parent
8723f7aa7e
commit
eb6e93149e
@@ -13,7 +13,7 @@
|
||||
*ngIf="option?.enabled !== false"
|
||||
[ngModel]="option.value === customerType"
|
||||
(ngModelChange)="setValue({ customerType: $event ? option.value : undefined })"
|
||||
[disabled]="readonly"
|
||||
[disabled]="isOptionDisabled(option)"
|
||||
[name]="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
|
||||
@@ -200,6 +200,13 @@ export class CustomerTypeSelectorComponent
|
||||
this.disabled = isDisabled;
|
||||
}
|
||||
|
||||
// #4610 Checkbox welche bereits ausgewählt ist soll nicht abgewählt werden können (Ausnahme bei Kundenkarte + Onlinekonto)
|
||||
isOptionDisabled(option: OptionDTO) {
|
||||
const isValueCurrentlySelected = option.value === this.customerType;
|
||||
const isCustomerCardActive = this.p4mUser;
|
||||
return this.readonly || (isValueCurrentlySelected && !isCustomerCardActive);
|
||||
}
|
||||
|
||||
setValue(value: { p4mUser?: boolean; customerType?: string } | string) {
|
||||
const initial = { p4mUser: this.p4mUser, customerType: this.customerType };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user