feat: Entfernen der EcmFkId-Eigenschaft aus GroupCreateDto und dem Formular zur Gruppenerstellung

- `EcmFkId`-Eigenschaft aus dem `GroupCreateDto` im Backend entfernt.
- Anpassungen im Frontend vorgenommen, um das `EcmFkId`-Feld im Formular zur Gruppenerstellung zu entfernen.
- `EcmFkId` wird im Entity standardmäßig auf `-1` gesetzt.
This commit is contained in:
Developer 02 2024-09-09 13:23:45 +02:00
parent e6416f0d7f
commit dfe848100a
5 changed files with 6 additions and 20 deletions

View File

@ -11,15 +11,6 @@
}
</mat-form-field>
</div>
<div [ngClass]="formFieldBSClass">
<mat-form-field>
<mat-label>ECM FK ID</mat-label>
<input matInput type="number" [formControl]="ecmFkId" (blur)="updateErrorMessage()" required />
@if (groupname.invalid) {
<mat-error>{{errorMessage()}}</mat-error>
}
</mat-form-field>
</div>
<div [ngClass]="formFieldBSClass">
<div [ngClass]="buttonBSClass">
<button mat-fab extended (click)="create()">

View File

@ -25,7 +25,6 @@ import Swal from 'sweetalert2';
})
export class GroupFormComponent {
readonly groupname = new FormControl('', [Validators.required]);
readonly ecmFkId = new FormControl<number>(1, [Validators.required]);
readonly active = new FormControl<boolean>(true);
errorMessage = signal('');
@ -38,8 +37,7 @@ export class GroupFormComponent {
constructor(private uService: UserService, private rService: RefreshService, private gService: GroupService) {
merge(
this.groupname.statusChanges, this.groupname.valueChanges,
this.ecmFkId.statusChanges, this.ecmFkId.valueChanges)
this.groupname.statusChanges, this.groupname.valueChanges)
.pipe(takeUntilDestroyed())
.subscribe(() => this.updateErrorMessage());
}
@ -53,10 +51,9 @@ export class GroupFormComponent {
}
create() {
if (this.groupname.valid && this.ecmFkId.valid) {
if (this.groupname.valid) {
this.gService.create({
name: this.groupname.value!,
ecmFkId: (this.ecmFkId.value!),
adSync: false,
internal: true,
active: this.active.value!
@ -76,7 +73,6 @@ export class GroupFormComponent {
delete() {
this.groupname.setValue('')
this.ecmFkId.setValue(1)
this.active.setValue(true)
}
}

View File

@ -17,7 +17,6 @@ export interface User {
export interface Group {
id?: number;
ecmFkId: number;
name?: string;
adSync?: boolean;
internal?: boolean;

View File

@ -8,7 +8,6 @@ namespace DigitalData.UserManager.Application.DTOs.Group
bool? AdSync,
bool? Internal,
bool? Active,
string? Comment,
int EcmFkId
string? Comment
) : BaseCreateDto();
}

View File

@ -26,9 +26,10 @@ namespace DigitalData.UserManager.Domain.Entities
[StringLength(200)]
public string? Comment { get; set; }
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
[Required]
[Column("ECM_FK_ID")]
[DefaultValue(0)]
public int EcmFkId { get; set; }
[DefaultValue(-1)]
public int EcmFkId { get; init; } = -1;
}
}