Merge remote-tracking branch 'origin/updates'

This commit is contained in:
Dan Percic 2021-11-11 20:14:38 +02:00
commit 9d1cdea98b
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import { IListable } from './listable';
export abstract class Entity<I> implements IListable {
abstract readonly id: string;
abstract readonly routerLink?: string;
abstract readonly searchKey: string;
protected constructor(private readonly _interface: I) {}
get model(): I {
return this._interface;
}
isEqual(entity: Entity<I>): boolean {
return JSON.stringify(this._interface) === JSON.stringify(entity?._interface);
}
}

View File

@ -1,3 +1,4 @@
export * from './listable';
export * from './entity.model';
export * from './table-column-config.model';
export * from './listing-modes';

View File

@ -1,5 +1,6 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
EventEmitter,
forwardRef,
@ -63,6 +64,7 @@ export class WorkflowComponent<T extends IListable, K extends string> extends Au
constructor(
@Inject(forwardRef(() => ListingComponent)) readonly listingComponent: ListingComponent<T>,
private readonly _loadingService: LoadingService,
private readonly _changeRef: ChangeDetectorRef,
readonly listingService: ListingService<T>,
readonly entitiesService: EntitiesService<T>,
) {
@ -152,6 +154,8 @@ export class WorkflowComponent<T extends IListable, K extends string> extends Au
this._addEntity(entity);
}
});
this._changeRef.detectChanges();
}
private _addEntity(entity: T): void {