From fada97c46deb13cd6a30d469408e47ad3159c4ea Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 25 Mar 2019 11:23:16 +0800 Subject: [PATCH 1/3] Add GTM tags to index.mustache & build.mustache --- gulp/build.js | 3 +++ templates/bot.mustache | 2 ++ templates/index.mustache | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gulp/build.js b/gulp/build.js index 7439507e9b..30ebffc806 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -16,6 +16,9 @@ const getConfig = prefix => ({ binary_style_img: 'image/binary-style', elevio_script : '', + gtm_head : ' ', + gtm_iframe: + ' ', }); const genHtml = min => diff --git a/templates/bot.mustache b/templates/bot.mustache index 339b21e47d..a05359fd65 100644 --- a/templates/bot.mustache +++ b/templates/bot.mustache @@ -7,6 +7,7 @@ {{> bundle_css }} {{> bot_css }} + {{> gtm_head }} @@ -175,6 +176,7 @@ {{> bundle}} {{> bot}} {{> elevio_script }} + {{> gtm_iframe }}
diff --git a/templates/index.mustache b/templates/index.mustache index dbc39e3e1d..9271a2c46a 100644 --- a/templates/index.mustache +++ b/templates/index.mustache @@ -8,6 +8,7 @@ {{> index_css }} +{{> gtm_head }} @@ -51,6 +52,7 @@ - {{> index}} + {{> index}} + {{> gtm_iframe }} From 5c127fb8774d531d74205ff52b81b313326d1bcf Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 25 Mar 2019 11:43:23 +0800 Subject: [PATCH 2/3] Add Only Ups/Only Downs contract type --- src/botPage/common/const.js | 12 +++++++++++- src/botPage/view/blockly/blocks/shared.js | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/botPage/common/const.js b/src/botPage/common/const.js index bd4b246509..dce8ceaeba 100644 --- a/src/botPage/common/const.js +++ b/src/botPage/common/const.js @@ -141,6 +141,14 @@ const config = { RESETPUT: translate('Reset Put'), }, ], + RUNS: [ + { + RUNHIGH: translate('Only Ups'), + }, + { + RUNLOW: translate('Only Downs'), + }, + ], }, barrierTypes: [['Offset +', '+'], ['Offset -', '-']], ohlcFields : [ @@ -176,6 +184,7 @@ const config = { digits : ['matchesdiffers', 'evenodd', 'overunder'], highlowticks: ['highlowticks'], reset : ['reset'], + runs : ['runs'], }, conditionsCategoryName: { callput : translate('Up/Down'), @@ -187,6 +196,7 @@ const config = { staysinout : translate('Stays In/Goes Out'), highlowticks: translate('High/Low Ticks'), reset : translate('Reset Call/Reset Put'), + runs : translate('Only Ups/Only Downs'), }, conditions: [ 'risefall', @@ -203,7 +213,7 @@ const config = { barrierCategories: { euro_atm : ['callput', 'risefall', 'risefallequals'], euro_non_atm : ['endsinout', 'higherlower'], - american : ['staysinout', 'touchnotouch', 'highlowticks'], + american : ['staysinout', 'touchnotouch', 'highlowticks', 'runs'], non_financial: ['digits', 'overunder', 'evenodd', 'matchesdiffers'], asian : ['asian'], reset : ['reset'], diff --git a/src/botPage/view/blockly/blocks/shared.js b/src/botPage/view/blockly/blocks/shared.js index a2ed49c817..f0151c106f 100644 --- a/src/botPage/view/blockly/blocks/shared.js +++ b/src/botPage/view/blockly/blocks/shared.js @@ -353,8 +353,8 @@ export const getBarriersForContracts = (contracts, selectedContractType, selecte }) .shift(); } - const barrierlessCategories = ['reset']; - if (contract && !barrierlessCategories.includes(contract.barrier_category)) { + const barrierlessCategories = ['reset', 'runs']; + if (contract && !barrierlessCategories.includes(contract.contract_category)) { const propName = contract.barriers === 1 ? 'barrier' : barrierProps[index]; if (contract[propName]) { const barrierMatch = contract[propName].toString().match(offsetRegex); From 22605d01ad3b2164f49ca3b68ba6f1ba9f76380c Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 25 Mar 2019 12:05:03 +0800 Subject: [PATCH 3/3] Update test to accommodate new contract type --- src/botPage/common/symbolApi/__tests__/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/botPage/common/symbolApi/__tests__/index.js b/src/botPage/common/symbolApi/__tests__/index.js index 949f6ceaee..df01c7e08e 100644 --- a/src/botPage/common/symbolApi/__tests__/index.js +++ b/src/botPage/common/symbolApi/__tests__/index.js @@ -25,6 +25,7 @@ describe('symbol', () => { 'Stays In/Goes Out', 'High/Low Ticks', 'Reset Call/Reset Put', + 'Only Ups/Only Downs', ]); expect(symbol.getAllowedCategoryNames('FAKE')).to.be.empty; });