|
|
|
@ -60,6 +60,16 @@ export class EntityDataService { |
|
|
|
constructor(private telemetryService: TelemetryWebsocketService, |
|
|
|
private utils: UtilsService) {} |
|
|
|
|
|
|
|
private static isUnresolvedDatasource(datasource: Datasource, pageLink: EntityDataPageLink): boolean { |
|
|
|
if (datasource.type === DatasourceType.entity) { |
|
|
|
return !datasource.entityFilter || !pageLink; |
|
|
|
} else if (datasource.type === DatasourceType.entityCount) { |
|
|
|
return !datasource.entityFilter; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public prepareSubscription(listener: EntityDataListener, |
|
|
|
ignoreDataUpdateOnIntervalTick = false): Observable<EntityDataLoadResult> { |
|
|
|
const datasource = listener.configDatasource; |
|
|
|
@ -71,7 +81,7 @@ export class EntityDataService { |
|
|
|
null, |
|
|
|
false, |
|
|
|
ignoreDataUpdateOnIntervalTick); |
|
|
|
if (datasource.type === DatasourceType.entity && (!datasource.entityFilter || !datasource.pageLink)) { |
|
|
|
if (EntityDataService.isUnresolvedDatasource(datasource, datasource.pageLink)) { |
|
|
|
return of(null); |
|
|
|
} |
|
|
|
listener.subscription = new EntityDataSubscription(listener, this.telemetryService, this.utils); |
|
|
|
@ -100,7 +110,7 @@ export class EntityDataService { |
|
|
|
keyFilters, |
|
|
|
true, |
|
|
|
ignoreDataUpdateOnIntervalTick); |
|
|
|
if (datasource.type === DatasourceType.entity && (!datasource.entityFilter || !pageLink)) { |
|
|
|
if (EntityDataService.isUnresolvedDatasource(datasource, pageLink)) { |
|
|
|
listener.dataLoaded(emptyPageData<EntityData>(), [], |
|
|
|
listener.configDatasourceIndex, listener.subscriptionOptions.pageLink); |
|
|
|
return of(null); |
|
|
|
|