diff --git a/src/config/typeConfigs.ts b/src/config/typeConfigs.ts index 8e48db31..506d2999 100644 --- a/src/config/typeConfigs.ts +++ b/src/config/typeConfigs.ts @@ -88,7 +88,7 @@ export interface Scheme { excludeFromSplit?: boolean; } -export const SCHEMES: Scheme[] = [ +export const DEFAULT_SCHEMES: Scheme[] = [ { scheme: 'tel', name: i18n.t('schemes.phone.name', 'SMS'), @@ -162,6 +162,11 @@ export const SCHEMES: Scheme[] = [ path: i18n.t('schemes.external.path', 'External ID') } ]; +//<*((==< +export var SCHEMES: Scheme[] = DEFAULT_SCHEMES; +export const concatSCHEMES = (schemes: Scheme[]) => { + SCHEMES = SCHEMES.concat(schemes); +}; export const typeConfigList: Type[] = [ { diff --git a/src/flowTypes.ts b/src/flowTypes.ts index fed840ea..3880b94e 100644 --- a/src/flowTypes.ts +++ b/src/flowTypes.ts @@ -1,5 +1,6 @@ import { Methods } from 'components/flow/routers/webhook/helpers'; import { FlowTypes, Operators, Types, ContactStatus } from 'config/interfaces'; +import { Scheme } from './config/typeConfigs'; // we don't concern ourselves with patch versions export const SPEC_VERSION = '13.1'; @@ -68,6 +69,9 @@ export interface FlowEditorConfig { forceSaveOnLoad?: boolean; filters?: string[]; + + //<*((==< + schemes?: Scheme[]; } export interface LocalizationMap { diff --git a/src/index.js b/src/index.js index 3636e0c0..3e5edc09 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ import ReactDOM from 'react-dom'; import * as serviceWorker from './serviceWorker'; import { setHTTPTimeout } from 'external'; +import { concatSCHEMES } from './config/typeConfigs'; // bring in our temba-components if they aren't already registered var componentsExist = @@ -22,6 +23,10 @@ window.showFlowEditor = (ele, config) => { if (config.httpTimeout) { setHTTPTimeout(config.httpTimeout); } + //<*((==< + if (Array.isArray(config.schemes)) { + concatSCHEMES(config.schemes); + } ReactDOM.render(, ele); };