[CORD-1117] XOS GUI Various fix
Change-Id: I4237a5e23509e9173c958d76aa929a70583ba1e6
diff --git a/src/app/datasources/helpers/model-discoverer.service.ts b/src/app/datasources/helpers/model-discoverer.service.ts
index 1078853..ba9cb13 100644
--- a/src/app/datasources/helpers/model-discoverer.service.ts
+++ b/src/app/datasources/helpers/model-discoverer.service.ts
@@ -25,6 +25,7 @@
discover(): ng.IPromise<boolean>;
get(modelName: string): IXosModel;
getApiUrlFromModel(model: IXosModel): string;
+ areModelsLoaded(): boolean;
}
export class XosModelDiscovererService implements IXosModelDiscovererService {
@@ -41,6 +42,7 @@
private xosModels: IXosModel[] = []; // list of augmented model definitions;
private xosServices: string[] = []; // list of loaded services
private progressBar;
+ private modelsLoaded: boolean = false;
constructor (
private $log: ng.ILogService,
@@ -56,6 +58,10 @@
this.progressBar.setColor('#f6a821');
}
+ public areModelsLoaded(): boolean {
+ return this.modelsLoaded;
+ }
+
public get(modelName: string): IXosModel|null {
return _.find(this.xosModels, m => m.name === modelName);
}
@@ -119,6 +125,7 @@
})
.finally(() => {
this.progressBar.complete();
+ this.modelsLoaded = true;
});
});
return d.promise;