Base Asset Slitted into 4 icons

This commit is contained in:
Luis Fernando Molina committed 2019-08-24 10:58:18 +02:00
1 parent 98e34a1119
commit 316ea0ab77
10 files changed
+449 -2

No files matched your search

+171
View File
@@ -603,6 +603,165 @@ function newStrategyPartConstructor () {
)
break
}
case 'Time Range': {
strategyPart.codeEditor = newCodeEditor()
strategyPart.codeEditor.isVisibleFunction = strategyPart.isVisibleFunction
strategyPart.codeEditor.initialize()
strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false)
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Delete Time Range',
askConfirmation: true,
confirmationLabel: 'Confirm to Delete',
actionFunction: payload.onMenuItemClick,
label: 'Delete Time Range',
visible: false,
iconPathOn: 'delete',
iconPathOff: 'delete',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -40
}
)
menuItemsInitialValues.push(
{
action: 'Edit Time Range',
actionFunction: strategyPart.codeEditor.activate,
label: 'Edit Time Range',
visible: false,
iconPathOn: 'settings',
iconPathOff: 'settings',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 0
}
)
menuItemsInitialValues.push(
{
action: 'Share',
actionFunction: payload.onMenuItemClick,
label: 'Share',
visible: false,
iconPathOn: 'menu-share',
iconPathOff: 'menu-share',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 40
}
)
break
}
case 'Slippage': {
strategyPart.codeEditor = newCodeEditor()
strategyPart.codeEditor.isVisibleFunction = strategyPart.isVisibleFunction
strategyPart.codeEditor.initialize()
strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false)
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Delete Slippage',
askConfirmation: true,
confirmationLabel: 'Confirm to Delete',
actionFunction: payload.onMenuItemClick,
label: 'Delete Slippage',
visible: false,
iconPathOn: 'delete',
iconPathOff: 'delete',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -40
}
)
menuItemsInitialValues.push(
{
action: 'Edit Slippage',
actionFunction: strategyPart.codeEditor.activate,
label: 'Edit Slippage',
visible: false,
iconPathOn: 'settings',
iconPathOff: 'settings',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 0
}
)
menuItemsInitialValues.push(
{
action: 'Share',
actionFunction: payload.onMenuItemClick,
label: 'Share',
visible: false,
iconPathOn: 'menu-share',
iconPathOff: 'menu-share',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 40
}
)
break
}
case 'Fee Structure': {
strategyPart.codeEditor = newCodeEditor()
strategyPart.codeEditor.isVisibleFunction = strategyPart.isVisibleFunction
strategyPart.codeEditor.initialize()
strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false)
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Delete Fee Structure',
askConfirmation: true,
confirmationLabel: 'Confirm to Delete',
actionFunction: payload.onMenuItemClick,
label: 'Delete Fee Structure',
visible: false,
iconPathOn: 'delete',
iconPathOff: 'delete',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -40
}
)
menuItemsInitialValues.push(
{
action: 'Edit Fee Structure',
actionFunction: strategyPart.codeEditor.activate,
label: 'Edit Fee Structure',
visible: false,
iconPathOn: 'settings',
iconPathOff: 'settings',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 0
}
)
menuItemsInitialValues.push(
{
action: 'Share',
actionFunction: payload.onMenuItemClick,
label: 'Share',
visible: false,
iconPathOn: 'menu-share',
iconPathOff: 'menu-share',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 40
}
)
break
}
case 'Strategy': {
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
@@ -1653,6 +1812,18 @@ function newStrategyPartConstructor () {
level_3()
break
}
case 'Time Range': {
level_3()
break
}
case 'Slippage': {
level_3()
break
}
case 'Fee Structure': {
level_3()
break
}
case 'Strategy': {
level_1()
break
+9
View File
@@ -78,6 +78,15 @@ function newStrategyPartTitle () {
case 'Base Asset': {
break
}
case 'Time Range': {
break
}
case 'Slippage': {
break
}
case 'Fee Structure': {
break
}
case 'Strategy': {
thisObject.allwaysVisible = true
break
+4 -1
View File
@@ -47,7 +47,10 @@ function newStrategySpace () {
['Workspace', 'design-tool'],
['Trading System', 'analysis'],
['Parameters', 'settings'],
['Base Asset', 'sitemap'],
['Base Asset', 'loading'],
['Time Range', 'chronometer'],
['Slippage', 'support'],
['Fee Structure', 'sitemap'],
['Strategy', 'quality'],
['Trigger Stage', 'stage-trigger'],
['Open Stage', 'stage-open'],
@@ -59,6 +59,21 @@ function newAttachDetach () {
completeDetachment(node, rootNodes)
return
}
case 'Time Period': {
node.payload.parentNode.baseAsset = undefined
completeDetachment(node, rootNodes)
return
}
case 'Slippage': {
node.payload.parentNode.baseAsset = undefined
completeDetachment(node, rootNodes)
return
}
case 'Fee Structure': {
node.payload.parentNode.baseAsset = undefined
completeDetachment(node, rootNodes)
return
}
case 'Strategy': {
let payload = node.payload
for (let i = 0; i < payload.parentNode.strategies.length; i++) {
@@ -245,6 +260,27 @@ function newAttachDetach () {
completeAttachment(node, rootNodes)
}
break
case 'Time Range': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
node.payload.parentNode.timeRange = node
completeAttachment(node, rootNodes)
}
break
case 'Slippage': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
node.payload.parentNode.slippage = node
completeAttachment(node, rootNodes)
}
break
case 'Fee Structure': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
node.payload.parentNode.feeStructure = node
completeAttachment(node, rootNodes)
}
break
case 'Trading System': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
@@ -32,6 +32,15 @@ function newNodeChildren () {
case 'Base Asset': {
return countChildrenBaseAsset(parentNode, childNode)
}
case 'Time Range': {
return countChildrenTimeRange(parentNode, childNode)
}
case 'Slippage': {
return countChildrenSlippage(parentNode, childNode)
}
case 'Fee Structure': {
return countChildrenFeeStructure(parentNode, childNode)
}
case 'Strategy': {
return countChildrenStrategy(parentNode, childNode)
}
@@ -211,6 +220,24 @@ function newNodeChildren () {
response.childIndex = response.childrenCount
}
}
if (parentNode.timeRange !== undefined) {
response.childrenCount++
if (parentNode.timeRange.id === childNode.id) {
response.childIndex = response.childrenCount
}
}
if (parentNode.slippage !== undefined) {
response.childrenCount++
if (parentNode.slippage.id === childNode.id) {
response.childIndex = response.childrenCount
}
}
if (parentNode.feeStructure !== undefined) {
response.childrenCount++
if (parentNode.feeStructure.id === childNode.id) {
response.childIndex = response.childrenCount
}
}
return response
}
@@ -222,6 +249,30 @@ function newNodeChildren () {
return response
}
function countChildrenTimeRange (parentNode, childNode) {
let response = {
childrenCount: 0,
childIndex: undefined
}
return response
}
function countChildrenSlippage (parentNode, childNode) {
let response = {
childrenCount: 0,
childIndex: undefined
}
return response
}
function countChildrenFeeStructure (parentNode, childNode) {
let response = {
childrenCount: 0,
childIndex: undefined
}
return response
}
function countChildrenStrategy (parentNode, childNode) {
let response = {
childrenCount: 0,
@@ -9,6 +9,9 @@ function newNodeDeleter () {
deleteTradingSystem: deleteTradingSystem,
deleteParameters: deleteParameters,
deleteBaseAsset: deleteBaseAsset,
deleteTimeRange: deleteTimeRange,
deleteSlippage: deleteSlippage,
deleteFeeStructure: deleteFeeStructure,
deleteStrategy: deleteStrategy,
deleteTriggerStage: deleteTriggerStage,
deleteOpenStage: deleteOpenStage,
@@ -71,6 +74,18 @@ function newNodeDeleter () {
deleteBaseAsset(rootNode, rootNodes)
break
}
case 'Time Range': {
deleteTimeRange(rootNode, rootNodes)
break
}
case 'Slippage': {
deleteSlippage(rootNode, rootNodes)
break
}
case 'Fee Structure': {
deleteFeeStructure(rootNode, rootNodes)
break
}
case 'Strategy': {
deleteStrategy(rootNode, rootNodes)
break
@@ -280,6 +295,15 @@ function newNodeDeleter () {
if (node.baseAsset !== undefined) {
deleteBaseAsset(node.baseAsset, rootNodes)
}
if (node.timeRange !== undefined) {
deleteTimeRange(node.timeRange, rootNodes)
}
if (node.slippage !== undefined) {
deleteSlippage(node.slippage, rootNodes)
}
if (node.feeStructure !== undefined) {
deleteFeeStructure(node.feeStructure, rootNodes)
}
destroyPart(node)
cleanNode(node)
}
@@ -295,6 +319,39 @@ function newNodeDeleter () {
cleanNode(node)
}
function deleteTimeRange (node, rootNodes) {
let payload = node.payload
if (payload.parentNode !== undefined) {
payload.parentNode.timeRange = undefined
} else {
completeDeletion(node, rootNodes)
}
destroyPart(node)
cleanNode(node)
}
function deleteSlippage (node, rootNodes) {
let payload = node.payload
if (payload.parentNode !== undefined) {
payload.parentNode.slippage = undefined
} else {
completeDeletion(node, rootNodes)
}
destroyPart(node)
cleanNode(node)
}
function deleteFeeStructure (node, rootNodes) {
let payload = node.payload
if (payload.parentNode !== undefined) {
payload.parentNode.feeStructure = undefined
} else {
completeDeletion(node, rootNodes)
}
destroyPart(node)
cleanNode(node)
}
function deleteStrategy (node, rootNodes) {
let payload = node.payload
if (payload.parentNode !== undefined) {
@@ -246,11 +246,32 @@ function newPartsFromNodes () {
createPart('Base Asset', node.name, node, parentNode, chainParent, 'Base Asset')
return
}
case 'Time Range': {
createPart('Time Range', node.name, node, parentNode, chainParent, 'Time Range')
return
}
case 'Slippage': {
createPart('Slippage', node.name, node, parentNode, chainParent, 'Slippage')
return
}
case 'Fee Structure': {
createPart('Fee Structure', node.name, node, parentNode, chainParent, 'Fee Structure')
return
}
case 'Parameters': {
createPart('Parameters', node.name, node, parentNode, chainParent, 'Parameters')
if (node.baseAsset !== undefined) {
createPartFromNode(node.baseAsset, node, node)
}
if (node.timeRange !== undefined) {
createPartFromNode(node.timeRange, node, node)
}
if (node.slippage !== undefined) {
createPartFromNode(node.slippage, node, node)
}
if (node.feeStructure !== undefined) {
createPartFromNode(node.feeStructure, node, node)
}
return
}
case 'Trading System': {
@@ -441,6 +462,27 @@ function newPartsFromNodes () {
}
createPart('Base Asset', '', node.baseAsset, node, node)
}
if (node.timeRange === undefined) {
node.timeRange = {
name: 'Time Range',
code: DEFAULT_CONFIG_TEXT
}
createPart('Time Range', '', node.timeRange, node, node)
}
if (node.slippage === undefined) {
node.slippage = {
name: 'Slippage',
code: DEFAULT_CONFIG_TEXT
}
createPart('Slippage', '', node.slippage, node, node)
}
if (node.feeStructure === undefined) {
node.feeStructure = {
name: 'Fee Structure',
code: DEFAULT_CONFIG_TEXT
}
createPart('Fee Structure', '', node.feeStructure, node, node)
}
}
function addMissingStages (node) {
@@ -252,12 +252,42 @@ function newProtocolNode () {
}
return object
}
case 'Time Range': {
let object = {
type: node.type,
subType: node.subType,
name: node.name,
code: node.code
}
return object
}
case 'Slippage': {
let object = {
type: node.type,
subType: node.subType,
name: node.name,
code: node.code
}
return object
}
case 'Fee Structure': {
let object = {
type: node.type,
subType: node.subType,
name: node.name,
code: node.code
}
return object
}
case 'Parameters': {
let object = {
type: node.type,
subType: node.subType,
name: node.name,
baseAsset: getProtocolNode(node.baseAsset, removePersonalData)
baseAsset: getProtocolNode(node.baseAsset, removePersonalData),
timeRange: getProtocolNode(node.timeRange, removePersonalData),
slippage: getProtocolNode(node.slippage, removePersonalData),
feeStructure: getProtocolNode(node.feeStructure, removePersonalData)
}
return object
}
@@ -298,6 +298,39 @@ function newStringifyNode () {
}
return object
}
case 'Time Range': {
let object = {
id: node.id,
type: node.type,
subType: node.subType,
name: node.name,
code: node.code,
savedPayload: getSavedPayload(node)
}
return object
}
case 'Slippage': {
let object = {
id: node.id,
type: node.type,
subType: node.subType,
name: node.name,
code: node.code,
savedPayload: getSavedPayload(node)
}
return object
}
case 'Fee Structure': {
let object = {
id: node.id,
type: node.type,
subType: node.subType,
name: node.name,
code: node.code,
savedPayload: getSavedPayload(node)
}
return object
}
case 'Parameters': {
let object = {
id: node.id,
@@ -305,6 +338,9 @@ function newStringifyNode () {
subType: node.subType,
name: node.name,
baseAsset: prepareForStringify(node.baseAsset, removePersonalData),
timeRange: prepareForStringify(node.timeRange, removePersonalData),
slippage: prepareForStringify(node.slippage, removePersonalData),
feeStructure: prepareForStringify(node.feeStructure, removePersonalData),
savedPayload: getSavedPayload(node)
}
return object
+12
View File
@@ -321,6 +321,18 @@ function newWorkspace () {
functionLibraryNodeDeleter.deleteBaseAsset(payload.node, workspaceNode.rootNodes)
break
}
case 'Delete Time Range': {
functionLibraryNodeDeleter.deleteTimeRange(payload.node, workspaceNode.rootNodes)
break
}
case 'Delete Slippage': {
functionLibraryNodeDeleter.deleteSlippage(payload.node, workspaceNode.rootNodes)
break
}
case 'Delete Fee Structure': {
functionLibraryNodeDeleter.deleteFeeStructure(payload.node, workspaceNode.rootNodes)
break
}
case 'Delete Strategy': {
functionLibraryNodeDeleter.deleteStrategy(payload.node, workspaceNode.rootNodes)
break