Skip to content

Commit

Permalink
add any config.schemes to the list.
Browse files Browse the repository at this point in the history
  • Loading branch information
baracudda committed Mar 6, 2024
1 parent 08060a3 commit b83e104
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config/typeConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -162,6 +162,8 @@ export const SCHEMES: Scheme[] = [
path: i18n.t('schemes.external.path', 'External ID')
}
];
//<*((==<
export var SCHEMES: Scheme[] = DEFAULT_SCHEMES;

export const typeConfigList: Type[] = [
{
Expand Down
4 changes: 4 additions & 0 deletions src/flowTypes.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -68,6 +69,9 @@ export interface FlowEditorConfig {
forceSaveOnLoad?: boolean;

filters?: string[];

//<*((==<
schemes?: Scheme[];
}

export interface LocalizationMap {
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ReactDOM from 'react-dom';

import * as serviceWorker from './serviceWorker';
import { setHTTPTimeout } from 'external';
import {SCHEMES} from "./config/typeConfigs";

// bring in our temba-components if they aren't already registered
var componentsExist =
Expand All @@ -22,6 +23,10 @@ window.showFlowEditor = (ele, config) => {
if (config.httpTimeout) {
setHTTPTimeout(config.httpTimeout);
}
//<*((==<
if ( config.schemes ) {
SCHEMES.concat(config.schemes);
}

ReactDOM.render(<FlowEditor config={config} />, ele);
};
Expand Down

0 comments on commit b83e104

Please sign in to comment.