Merge remote-tracking branch 'origin/updates'
This commit is contained in:
commit
9d1cdea98b
17
src/lib/listing/models/entity.model.ts
Normal file
17
src/lib/listing/models/entity.model.ts
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
export * from './listable';
|
export * from './listable';
|
||||||
|
export * from './entity.model';
|
||||||
export * from './table-column-config.model';
|
export * from './table-column-config.model';
|
||||||
export * from './listing-modes';
|
export * from './listing-modes';
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
forwardRef,
|
forwardRef,
|
||||||
@ -63,6 +64,7 @@ export class WorkflowComponent<T extends IListable, K extends string> extends Au
|
|||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => ListingComponent)) readonly listingComponent: ListingComponent<T>,
|
@Inject(forwardRef(() => ListingComponent)) readonly listingComponent: ListingComponent<T>,
|
||||||
private readonly _loadingService: LoadingService,
|
private readonly _loadingService: LoadingService,
|
||||||
|
private readonly _changeRef: ChangeDetectorRef,
|
||||||
readonly listingService: ListingService<T>,
|
readonly listingService: ListingService<T>,
|
||||||
readonly entitiesService: EntitiesService<T>,
|
readonly entitiesService: EntitiesService<T>,
|
||||||
) {
|
) {
|
||||||
@ -152,6 +154,8 @@ export class WorkflowComponent<T extends IListable, K extends string> extends Au
|
|||||||
this._addEntity(entity);
|
this._addEntity(entity);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._changeRef.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _addEntity(entity: T): void {
|
private _addEntity(entity: T): void {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user