Browse Source

[frontend] Expose additional functionality on the QueryEditorWebComponents

Johan Åhlén 4 years ago
parent
commit
f81653a300

+ 8 - 0
desktop/core/src/desktop/js/apps/editor/components/QueryEditorWebComponents.ts

@@ -27,7 +27,9 @@ import SqlAssistPanel from 'components/assist/SqlAssistPanel.vue';
 import HueIcons from 'components/icons/HueIcons.vue';
 import HueIcons from 'components/icons/HueIcons.vue';
 import SqlContextSelector from 'components/SqlContextSelector.vue';
 import SqlContextSelector from 'components/SqlContextSelector.vue';
 import { getNamespaces } from 'catalog/contextCatalog';
 import { getNamespaces } from 'catalog/contextCatalog';
+import dataCatalog from 'catalog/dataCatalog';
 import { findEditorConnector, refreshConfig } from 'config/hueConfig';
 import { findEditorConnector, refreshConfig } from 'config/hueConfig';
+import { Connector } from 'config/types';
 import { wrap } from 'vue/webComponentWrap';
 import { wrap } from 'vue/webComponentWrap';
 import 'utils/json.bigDataParse';
 import 'utils/json.bigDataParse';
 import { hueWindow } from 'types/types';
 import { hueWindow } from 'types/types';
@@ -55,7 +57,13 @@ const configure = (config: HueComponentConfig): void => {
 
 
 const createExecutor = (options: ExecutorOptions): Executor => new Executor(options);
 const createExecutor = (options: ExecutorOptions): Executor => new Executor(options);
 
 
+const clearContextCatalogCache = async (connector: Connector): Promise<void> => {
+  await getNamespaces({ connector, clearCache: true });
+};
+
 export default {
 export default {
+  dataCatalog,
+  clearContextCatalogCache,
   configure,
   configure,
   createExecutor,
   createExecutor,
   findEditorConnector,
   findEditorConnector,

+ 12 - 0
desktop/core/src/desktop/js/apps/editor/execution/executable.ts

@@ -101,6 +101,14 @@ export default abstract class Executable {
     this.logs = new ExecutionLogs(this);
     this.logs = new ExecutionLogs(this);
   }
   }
 
 
+  getLogs(): ExecutionLogs | undefined {
+    return this.logs;
+  }
+
+  getResult(): ExecutionResult | undefined {
+    return this.result;
+  }
+
   setStatus(status: ExecutionStatus): void {
   setStatus(status: ExecutionStatus): void {
     const oldStatus = this.status;
     const oldStatus = this.status;
     this.status = status;
     this.status = status;
@@ -119,6 +127,10 @@ export default abstract class Executable {
     this.notify();
     this.notify();
   }
   }
 
 
+  getExecutionStatus(): ExecutionStatus {
+    return this.status;
+  }
+
   getExecutionTime(): number {
   getExecutionTime(): number {
     return (this.executeEnded || Date.now()) - this.executeStarted;
     return (this.executeEnded || Date.now()) - this.executeStarted;
   }
   }