Browse Source

Fixed show default values sidebar

Nikatlas 5 years ago
parent
commit
22a60c21e0
2 changed files with 15 additions and 12 deletions
  1. 8 5
      Systems/SideBar.js
  2. 7 7
      yarn.lock

+ 8 - 5
Systems/SideBar.js

@@ -43,6 +43,7 @@ export default class SideBar{
 		let CurrentView = this.CoreSystem.getCurrentView();
 		let Routing = this.CoreSystem.Routing;
 		let Structure = {};
+		let viewNodeProps = {};
 		if (tool) {
 			console.log(tool)
 			if (tool.selectedNode && tool.selectedNode.isCol && CurrentView.has(tool.selectedNode)) {
@@ -52,11 +53,14 @@ export default class SideBar{
 				if(tool.selectedNode.content && tool.selectedNode.content.value) {
 					this.viewNode = tool.selectedNode.content;			
 					console.log("NEVERRRRRRRRRRRRRRRR")
+					let ctor = ModuleSystem.get(this.viewNode.value, this.viewNode.namespace);
+					viewNodeProps = ModuleSystem.validateProps(ctor, this.viewNode.props);
+					console.log(viewNodeProps)
 					Structure = ModuleSystem.fromViewNode(this.viewNode).Inputs;
 				}
 			}	
 		}
-		let data = Object.keys(Structure || {}).map((key) => {
+		let data = Object.keys(Structure || {}).map((key,index) => {
 			let Editor = TypeHandler(Structure[key]);
 			let editorProps = {
 				title: key,
@@ -65,19 +69,18 @@ export default class SideBar{
 					this.editNode(value, key);
 				}
 			};
-			console.log(DataTypes)
 			switch(Structure[key].type){
 				case DataTypes.Types.Integer:
-					editorProps.number = this.viewNode.props[key];
+					editorProps.number = viewNodeProps[key];
 					break;
 				case DataTypes.Types.Text:
-					editorProps.text = this.viewNode.props[key];
+					editorProps.text = viewNodeProps[key];
 					break;
 				default:
 					//Must create a generic Vuiew Component
 					return (<View></View>)
 			}
-			return <Editor {...editorProps}/>
+			return <Editor {...editorProps} key={index + key + this.ColNode.id}/>
 		})
 		return (
   			<View>

+ 7 - 7
yarn.lock

@@ -1888,9 +1888,9 @@ [email protected]:
   integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
 
 electron-to-chromium@^1.3.191:
-  version "1.3.236"
-  resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.236.tgz#c7158cbd4d17a3670ac7c9b44da44d752aa193a9"
-  integrity sha512-LWOvuJ80pLO3FtFqTcGuXB0dxdMtzSCkRmbXdY5mHUvXRQGor3sTVmyfU70aD2yF5i+fbHz52ncWr5T3xUYHlA==
+  version "1.3.237"
+  resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.237.tgz#39c5d1da59d6fd16ff705b97e772bb3b5dfda7e4"
+  integrity sha512-SPAFjDr/7iiVK2kgTluwxela6eaWjjFkS9rO/iYpB/KGXgccUom5YC7OIf19c8m8GGptWxLU0Em8xM64A/N7Fg==
 
 encodeurl@~1.0.2:
   version "1.0.2"
@@ -4124,9 +4124,9 @@ node-pre-gyp@^0.12.0:
     tar "^4"
 
 node-releases@^1.1.25:
-  version "1.1.27"
-  resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.27.tgz#b19ec8add2afe9a826a99dceccc516104c1edaf4"
-  integrity sha512-9iXUqHKSGo6ph/tdXVbHFbhRVQln4ZDTIBJCzsa90HimnBYc5jw8RWYt4wBYFHehGyC3koIz5O4mb2fHrbPOuA==
+  version "1.1.28"
+  resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.28.tgz#503c3c70d0e4732b84e7aaa2925fbdde10482d4a"
+  integrity sha512-AQw4emh6iSXnCpDiFe0phYcThiccmkNWMZnFZ+lDJjAP8J0m2fVd59duvUUyuTirQOhIAajTFkzG6FHCLBO59g==
   dependencies:
     semver "^5.3.0"
 
@@ -5619,7 +5619,7 @@ [email protected]:
 
 "trapilib@git+http://git.onarbooks.com/Klapi/TrapiLib.git":
   version "1.0.7"
-  resolved "git+http://git.onarbooks.com/Klapi/TrapiLib.git#a8a49ab6458b649f405ac2eac468e1fbb7ee49eb"
+  resolved "git+http://git.onarbooks.com/Klapi/TrapiLib.git#2714a22f7569beeef4c5e4783d370cc2e37c1875"
   dependencies:
     expo "^34.0.0-experiment.8"
     prop-types "^15.7.2"