All files / src index.ts

100% Statements 8/8
75% Branches 3/4
100% Functions 2/2
100% Lines 8/8

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 47 48 49 50 51 52 53          2x       2x                                         2x                       2x 2x     3x 2x   1x      
import { makeWidgetDef } from '@ska-octopus-widget-sdk/widget-sdk';
import type { OctopusHost } from '@ska-octopus-widget-sdk/widget-sdk';
import SkaOctopusCoverageWidget from './SkaOctopusCoverageWidget';
import pkg from '../package.json';
 
const { version } = pkg;
 
export { SkaOctopusCoverageWidget };
 
const schema = {
  type: 'object',
  properties: {
    progressChannel: {
      type: 'string',
      title: 'progressChannel',
      propertyType: 'functionality',
      level: 2,
      default: '1234'
    },
    ignore: {
      type: 'array',
      title: 'ignore',
      propertyType: 'functionality',
      level: 2,
      items: { type: 'string' },
      default: ['ska-octopus-suite', 'ska-octopus-build-widgets']
    }
  }
} as const;
 
const widgetDef = makeWidgetDef({
  key: 'skaOctopusCoverage',
  component: SkaOctopusCoverageWidget,
  label: 'SkaOctopusCoverage',
  layout: { x: 0, y: 0, w: 30, h: 23 },
  config: { schema },
  polls: true,
  version,
  docsUrl: 'https://developer.skao.int/projects/ska-octopus-coverage-widget/en/latest/?badge=latest'
});
 
function register(O: OctopusHost) {
  O.registerWidget(widgetDef as any);
}
 
(function wait(h: any) {
  if (typeof h.registerWidget === 'function') {
    register(h as OctopusHost);
  } else {
    setTimeout(wait, 50, h);
  }
})((globalThis as any).Octopus || ((globalThis as any).Octopus = {}));