setValue of Tokens implemented
This commit is contained in:
1 parent
612b9f30ee
commit
dd8176d34e
4 files changed
+77
-7
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"type": "Referrer",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
"Use Reference Parent"
|
||||
],
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{\n \"description\": \"\"\n}"
|
||||
},
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->User Profile->"
|
||||
},
|
||||
"referencingRules": {
|
||||
"compatibleTypes": "->User Profile->"
|
||||
},
|
||||
"propertyNameAtParent": "referrer",
|
||||
"icon": "github-api"
|
||||
}
|
||||
@@ -38,6 +38,14 @@
|
||||
"label": "Add Civic Contributions",
|
||||
"relatedUiObject": "Civic Contributions"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "referrer",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add Referrer",
|
||||
"relatedUiObject": "Referrer"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
@@ -88,6 +96,12 @@
|
||||
"type": "array",
|
||||
"childType": "Civic Contributions",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "referrer",
|
||||
"type": "node",
|
||||
"childType": "Referrer",
|
||||
"autoAdd": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -15,17 +15,13 @@ function newGovernanceUserProfileSpace() {
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize() {
|
||||
thisObject.container.finalize()
|
||||
thisObject.container = undefined
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
|
||||
}
|
||||
|
||||
function physics() {
|
||||
|
||||
function finalize() {
|
||||
thisObject.container.finalize()
|
||||
thisObject.container = undefined
|
||||
}
|
||||
|
||||
function getContainer(point) {
|
||||
@@ -38,6 +34,26 @@ function newGovernanceUserProfileSpace() {
|
||||
}
|
||||
}
|
||||
|
||||
function physics() {
|
||||
if (UI.projects.superalgos.spaces.designSpace.workspace === undefined) {return}
|
||||
|
||||
let userProfiles = UI.projects.superalgos.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
|
||||
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
userProfilePhysics(userProfile)
|
||||
}
|
||||
}
|
||||
|
||||
function userProfilePhysics(userProfile) {
|
||||
let tokens = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(userProfile.payload, 'tokens')
|
||||
tokens = new Intl.NumberFormat().format(tokens) + ' ' + 'SA'
|
||||
if ( userProfile.payload !== undefined) {
|
||||
userProfile.payload.uiObject.valueAtAngle = false
|
||||
userProfile.payload.uiObject.setValue(tokens)
|
||||
}
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user