Skip to content
Snippets Groups Projects
Verified Commit 6b86812c authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-7507 remove unknown type

parent 8de3618f
No related branches found
No related tags found
1 merge request!82OZG-7507 use new open dialog button
Showing with 14 additions and 13 deletions
......@@ -65,7 +65,7 @@ export abstract class KeycloakResourceService<T> {
protected abstract _saveInKeycloak(item: T): Observable<T>;
public delete(id: string): Observable<StateResource<unknown>> {
public delete(id: string): Observable<StateResource<void>> {
return this.handleLoading(this._deleteInKeycloak(id));
}
......
......@@ -51,7 +51,7 @@ describe('OrganisationsEinheitDeleteDialogContainerComponent', () => {
describe('template', () => {
describe('organisations einheit delete dialog', () => {
it('should exist', () => {
const stateResource: StateResource<unknown> = createEmptyStateResource();
const stateResource: StateResource<void> = createEmptyStateResource();
component.deleteStateResource$ = of(stateResource);
component.organisationsEinheitName = dialogData.organisationsEinheitName;
......@@ -104,10 +104,10 @@ describe('OrganisationsEinheitDeleteDialogContainerComponent', () => {
});
describe('delete', () => {
const stateResource: StateResource<unknown> = createEmptyStateResource();
const stateResource$: Observable<StateResource<unknown>> = of(stateResource);
const loadingStateResource: StateResource<unknown> = createEmptyStateResource(true);
const loadingStateResource$: Observable<StateResource<unknown>> = of(loadingStateResource);
const stateResource: StateResource<void> = createEmptyStateResource();
const stateResource$: Observable<StateResource<void>> = of(stateResource);
const loadingStateResource: StateResource<void> = createEmptyStateResource(true);
const loadingStateResource$: Observable<StateResource<void>> = of(loadingStateResource);
beforeEach(() => {
organisationsEinheitService.delete.mockReturnValue(stateResource$);
......
......@@ -31,19 +31,20 @@ export class OrganisationsEinheitDeleteDialogContainerComponent {
this.organisationsEinheitId = this.dialogData.organisationsEinheitId;
}
public deleteStateResource$: Observable<StateResource<unknown>> = of(createEmptyStateResource());
public deleteStateResource$: Observable<StateResource<void>> = of(createEmptyStateResource<void>());
public closeDialog(): void {
this.dialogService.closeAll();
}
public delete(): void {
this.deleteStateResource$ = this.organisationsEinheitService
.delete(this.organisationsEinheitId)
.pipe(tap((stateResource: StateResource<unknown>) => this.closeDialogOnDeleteDone(stateResource)));
this.deleteStateResource$ = this.organisationsEinheitService.delete(this.organisationsEinheitId).pipe(
tap(console.info),
tap((stateResource: StateResource<void>) => this.closeDialogOnDeleteDone(stateResource)),
);
}
private closeDialogOnDeleteDone(stateResource: StateResource<unknown>): void {
private closeDialogOnDeleteDone(stateResource: StateResource<void>): void {
if (isNotLoading(stateResource)) {
this.dialogService.closeAll();
}
......
......@@ -58,7 +58,7 @@ describe('OrganisationsEinheitDeleteDialogComponent', () => {
});
it('should have inputs', () => {
const stateResource: StateResource<unknown> = createEmptyStateResource();
const stateResource: StateResource<void> = createEmptyStateResource();
component.deleteStateResource = stateResource;
fixture.detectChanges();
......
......@@ -11,7 +11,7 @@ import { ButtonComponent } from '@ods/system';
})
export class OrganisationsEinheitDeleteDialogComponent {
@Input() organisationsEinheitName: string;
@Input() deleteStateResource: StateResource<unknown>;
@Input() deleteStateResource: StateResource<void>;
@Output() cancel: EventEmitter<void> = new EventEmitter<void>();
@Output() delete: EventEmitter<void> = new EventEmitter<void>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment