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:
parent
e6416f0d7f
commit
dfe848100a
@ -11,15 +11,6 @@
|
|||||||
}
|
}
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</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]="formFieldBSClass">
|
||||||
<div [ngClass]="buttonBSClass">
|
<div [ngClass]="buttonBSClass">
|
||||||
<button mat-fab extended (click)="create()">
|
<button mat-fab extended (click)="create()">
|
||||||
|
|||||||
@ -25,7 +25,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 active = new FormControl<boolean>(true);
|
readonly active = new FormControl<boolean>(true);
|
||||||
|
|
||||||
errorMessage = signal('');
|
errorMessage = signal('');
|
||||||
@ -38,8 +37,7 @@ export class GroupFormComponent {
|
|||||||
|
|
||||||
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)
|
||||||
this.ecmFkId.statusChanges, this.ecmFkId.valueChanges)
|
|
||||||
.pipe(takeUntilDestroyed())
|
.pipe(takeUntilDestroyed())
|
||||||
.subscribe(() => this.updateErrorMessage());
|
.subscribe(() => this.updateErrorMessage());
|
||||||
}
|
}
|
||||||
@ -53,10 +51,9 @@ export class GroupFormComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
if (this.groupname.valid && this.ecmFkId.valid) {
|
if (this.groupname.valid) {
|
||||||
this.gService.create({
|
this.gService.create({
|
||||||
name: this.groupname.value!,
|
name: this.groupname.value!,
|
||||||
ecmFkId: (this.ecmFkId.value!),
|
|
||||||
adSync: false,
|
adSync: false,
|
||||||
internal: true,
|
internal: true,
|
||||||
active: this.active.value!
|
active: this.active.value!
|
||||||
@ -76,7 +73,6 @@ export class GroupFormComponent {
|
|||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
this.groupname.setValue('')
|
this.groupname.setValue('')
|
||||||
this.ecmFkId.setValue(1)
|
|
||||||
this.active.setValue(true)
|
this.active.setValue(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -17,7 +17,6 @@ export interface User {
|
|||||||
|
|
||||||
export interface Group {
|
export interface Group {
|
||||||
id?: number;
|
id?: number;
|
||||||
ecmFkId: number;
|
|
||||||
name?: string;
|
name?: string;
|
||||||
adSync?: boolean;
|
adSync?: boolean;
|
||||||
internal?: boolean;
|
internal?: boolean;
|
||||||
|
|||||||
@ -8,7 +8,6 @@ namespace DigitalData.UserManager.Application.DTOs.Group
|
|||||||
bool? AdSync,
|
bool? AdSync,
|
||||||
bool? Internal,
|
bool? Internal,
|
||||||
bool? Active,
|
bool? Active,
|
||||||
string? Comment,
|
string? Comment
|
||||||
int EcmFkId
|
|
||||||
) : BaseCreateDto();
|
) : BaseCreateDto();
|
||||||
}
|
}
|
||||||
@ -26,9 +26,10 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
[StringLength(200)]
|
[StringLength(200)]
|
||||||
public string? Comment { get; set; }
|
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]
|
[Required]
|
||||||
[Column("ECM_FK_ID")]
|
[Column("ECM_FK_ID")]
|
||||||
[DefaultValue(0)]
|
[DefaultValue(-1)]
|
||||||
public int EcmFkId { get; set; }
|
public int EcmFkId { get; init; } = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user