fix: AD Sync- und Internal-Checkboxen bei der Gruppenerstellung deaktivieren
This commit is contained in:
@@ -31,13 +31,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div [ngClass]="checkBoxBSClass(3)">
|
<div [ngClass]="checkBoxBSClass(3)">
|
||||||
<mat-checkbox [formControl]="adSync">Ad Sync</mat-checkbox>
|
<mat-checkbox [disabled]="true">Ad Sync</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="checkBoxBSClass(3)">
|
<div [ngClass]="checkBoxBSClass(3)">
|
||||||
<mat-checkbox [formControl]="internal">Internal</mat-checkbox>
|
<mat-checkbox [(ngModel)]="checked" [disabled]="true">Internal</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="checkBoxBSClass(2)">
|
<div [ngClass]="checkBoxBSClass(2)">
|
||||||
<mat-checkbox [formControl]="active">Active</mat-checkbox>
|
<mat-checkbox [formControl]="active" [disabled]="true">Active</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-flex justify-content-center me-4 my-2">
|
<div class="col d-flex justify-content-center me-4 my-2">
|
||||||
<button mat-fab extended (click)="delete()">
|
<button mat-fab extended (click)="delete()">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, signal } from '@angular/core';
|
import { Component, model, signal } from '@angular/core';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
@@ -26,8 +26,6 @@ import Swal from 'sweetalert2';
|
|||||||
export class GroupFormComponent {
|
export class GroupFormComponent {
|
||||||
readonly groupname = new FormControl('', [Validators.required]);
|
readonly groupname = new FormControl('', [Validators.required]);
|
||||||
readonly ecmFkId = new FormControl<number>(1, [Validators.required]);
|
readonly ecmFkId = new FormControl<number>(1, [Validators.required]);
|
||||||
readonly adSync = new FormControl<boolean>(false);
|
|
||||||
readonly internal = new FormControl<boolean>(true);
|
|
||||||
readonly active = new FormControl<boolean>(true);
|
readonly active = new FormControl<boolean>(true);
|
||||||
|
|
||||||
errorMessage = signal('');
|
errorMessage = signal('');
|
||||||
@@ -36,6 +34,8 @@ export class GroupFormComponent {
|
|||||||
public readonly buttonBSClass: string = "d-flex justify-content-center mx-1 my-2"
|
public readonly buttonBSClass: string = "d-flex justify-content-center mx-1 my-2"
|
||||||
public readonly checkBoxBSClass: (colCount: number | undefined) => string = (colCount: number = 2) => `col-${colCount} d-flex justify-content-left mx-1 my-2`
|
public readonly checkBoxBSClass: (colCount: number | undefined) => string = (colCount: number = 2) => `col-${colCount} d-flex justify-content-left mx-1 my-2`
|
||||||
|
|
||||||
|
readonly checked = model(true);
|
||||||
|
|
||||||
constructor(private uService: UserService, private rService: RefreshService, private gService: GroupService) {
|
constructor(private uService: UserService, private rService: RefreshService, private gService: GroupService) {
|
||||||
merge(
|
merge(
|
||||||
this.groupname.statusChanges, this.groupname.valueChanges,
|
this.groupname.statusChanges, this.groupname.valueChanges,
|
||||||
@@ -44,7 +44,6 @@ export class GroupFormComponent {
|
|||||||
.subscribe(() => this.updateErrorMessage());
|
.subscribe(() => this.updateErrorMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
updateErrorMessage() {
|
updateErrorMessage() {
|
||||||
if (this.groupname.hasError('required')) {
|
if (this.groupname.hasError('required')) {
|
||||||
this.errorMessage.set('Wert eingeben');
|
this.errorMessage.set('Wert eingeben');
|
||||||
@@ -58,8 +57,8 @@ export class GroupFormComponent {
|
|||||||
this.gService.create({
|
this.gService.create({
|
||||||
name: this.groupname.value!,
|
name: this.groupname.value!,
|
||||||
ecmFkId: (this.ecmFkId.value!),
|
ecmFkId: (this.ecmFkId.value!),
|
||||||
adSync: this.adSync.value!,
|
adSync: false,
|
||||||
internal: this.internal.value!,
|
internal: true,
|
||||||
active: this.active.value!
|
active: this.active.value!
|
||||||
}).subscribe({
|
}).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
@@ -78,8 +77,6 @@ export class GroupFormComponent {
|
|||||||
delete() {
|
delete() {
|
||||||
this.groupname.setValue('')
|
this.groupname.setValue('')
|
||||||
this.ecmFkId.setValue(1)
|
this.ecmFkId.setValue(1)
|
||||||
this.adSync.setValue(false)
|
|
||||||
this.internal.setValue(true)
|
|
||||||
this.active.setValue(true)
|
this.active.setValue(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user