All files / src index.ts

71.42% Statements 5/7
75% Branches 3/4
50% Functions 1/2
71.42% Lines 5/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46        1x         1x                                               1x           1x     1x      
import type { OctopusHost } from '@ska-octopus-widget-sdk/widget-sdk';
import { makeWidgetDef } from '@ska-octopus-widget-sdk/widget-sdk';
import DataPipelineWidget from './DataPipelineWidget';
import pkg from '../package.json' assert { type: 'json' };
const { version } = pkg;
 
/* ------------------------------------------------------------------ */
/*  Widget metadata                                                    */
/* ------------------------------------------------------------------ */
export const widgetDef = makeWidgetDef({
  key: 'dataPipeline',
  component: DataPipelineWidget,
  label: 'Data Pipeline',
  layout: { x: 0, y: 0, w: 20, h: 20 },
  config: { schema: { type: 'object', properties: {} } },
  polls: true,
  version,
  docsUrl: 'https://developer.skao.int/projects/ska-octopus-data-pipeline-widget/en/latest/'
});
 
/* ------------------------------------------------------------------ */
/*  Public exports                                                     */
/* ------------------------------------------------------------------ */
export { DataPipelineWidget };
 
/* ------------------------------------------------------------------ */
/*  Registration helper                                                */
/* ------------------------------------------------------------------ */
function register(O: OctopusHost) {
  /* mount a slice here if you add one:
       O.addReducer?.('dataPipeline', yourReducer); */
 
  O.registerWidget(widgetDef as any);
}
 
/* ------------------------------------------------------------------ */
/*  Wait for the Octopus host to be ready                              */
/* ------------------------------------------------------------------ */
(function wait(h: any) {
  Iif (typeof h.registerWidget === 'function') {
    register(h as OctopusHost);
  } else {
    setTimeout(wait, 50, h);
  }
})((globalThis as any).Octopus || ((globalThis as any).Octopus = {}));