Skip to content
Snippets Groups Projects
Commit d2ec70cf authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4310 OZG-7099 Add disabling to checkbox component

parent 5a1c9bf1
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ export class UserAddFormService extends AbstractFormService { ...@@ -37,7 +37,7 @@ export class UserAddFormService extends AbstractFormService {
[UserAddFormService.ADMIN]: new FormControl(false), [UserAddFormService.ADMIN]: new FormControl(false),
}), }),
[UserAddFormService.ALFA_GROUP]: this.formBuilder.group({ [UserAddFormService.ALFA_GROUP]: this.formBuilder.group({
[UserAddFormService.LOESCHEN]: new FormControl({}), [UserAddFormService.LOESCHEN]: new FormControl(false),
[UserAddFormService.USER]: new FormControl(false), [UserAddFormService.USER]: new FormControl(false),
[UserAddFormService.POSTSTELLE]: new FormControl(false), [UserAddFormService.POSTSTELLE]: new FormControl(false),
}), }),
...@@ -69,7 +69,7 @@ export class UserAddFormService extends AbstractFormService { ...@@ -69,7 +69,7 @@ export class UserAddFormService extends AbstractFormService {
updateCheckboxStates(alfaGroup: UntypedFormGroup): void { updateCheckboxStates(alfaGroup: UntypedFormGroup): void {
for (const control of Object.values<AbstractControl>(alfaGroup.controls)) { for (const control of Object.values<AbstractControl>(alfaGroup.controls)) {
Boolean(control.value) ? control.enable({ emitEvent: false }) : control.disable({ emitEvent: false }); control[!!control.value ? 'enable' : 'disable']({ emitEvent: false });
} }
} }
......
...@@ -24,5 +24,5 @@ ...@@ -24,5 +24,5 @@
</div> </div>
</div> </div>
<ods-button-with-spinner text="Speichern" dataTestId="save-button" (clickEmitter)="test()" /> <ods-button-with-spinner text="Speichern" dataTestId="save-button" />
</div> </div>
...@@ -22,8 +22,4 @@ import { UserAddFormService } from '../user-add-form-service'; ...@@ -22,8 +22,4 @@ import { UserAddFormService } from '../user-add-form-service';
export class UserAddFormComponent { export class UserAddFormComponent {
formService = inject(UserAddFormService); formService = inject(UserAddFormService);
protected readonly UserAddFormService = UserAddFormService; protected readonly UserAddFormService = UserAddFormService;
test() {
console.log(this.formService.form.value);
}
} }
<ods-checkbox <ods-checkbox
[fieldControl]="fieldControl" [fieldControl]="control.control"
[inputId]="inputId" [inputId]="inputId"
[label]="label" [label]="label"
[disabled]="fieldControl.disabled" [disabled]="control.disabled"
[hasError]="hasError" [hasError]="hasError"
> >
<ods-validation-error <ods-validation-error
......
...@@ -24,8 +24,7 @@ import { twMerge } from 'tailwind-merge'; ...@@ -24,8 +24,7 @@ import { twMerge } from 'tailwind-merge';
</button> </button>
<div <div
*ngIf="isPopupOpen" *ngIf="isPopupOpen"
class="bg-dropdownBg absolute max-h-120 min-w-44 max-w-80 class="absolute z-50 max-h-120 min-w-44 max-w-80 animate-fadeIn overflow-y-auto rounded bg-dropdownBg shadow-md focus:outline-none"
animate-fadeIn overflow-y-auto rounded shadow-md focus:outline-none"
[ngClass]="alignTo === 'left' ? 'right-0' : 'left-0'" [ngClass]="alignTo === 'left' ? 'right-0' : 'left-0'"
role="menu" role="menu"
aria-modal="true" aria-modal="true"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment