{"action":"created","comment":{"url":"https://api.github.com/repos/Normation/rudder/pulls/comments/101535908","pull_request_review_id":22266908,"id":101535908,"diff_hunk":"@@ -655,21 +655,34 @@ object DisplayNode extends Loggable {\n     }\n \n     private def displayTabVariable(jsId:JsNodeId,sm:FullInventory) : NodeSeq = {\n-    val title = sm.node.inventoryDate.map(date => \"Environment variable status on %s\".format(DateFormaterService.getFormatedDate(date)))\n-    displayTabGrid(jsId)(\"var\", Full(sm.node.environmentVariables),title){\n+      val title = sm.node.inventoryDate.map(date => \"Environment variable status on %s\".format(DateFormaterService.getFormatedDate(date)))\n+      displayTabGrid(jsId)(\"var\", Full(sm.node.environmentVariables),title){\n         (\"Name\", {x:EnvironmentVariable => Text(x.name)}) ::\n         (\"Value\", {x:EnvironmentVariable => Text(x.value.getOrElse(\"Unspecified\"))}) ::\n         Nil\n-    }\n+      }\n     }\n \n     private def displayTabProperties(jsId:JsNodeId, node: NodeInfo) : NodeSeq = {\n+      import com.normation.rudder.domain.nodes.JsonSerialisation._\n+      import com.normation.rudder.authorization._\n       import net.liftweb.json._\n-      displayTabGrid(jsId)(\"props\", Full(node.properties)){\n-        (\"Name\", {x:NodeProperty => Text(x.name)}) ::\n-        (\"Value\", {x:NodeProperty => <pre class=\"json-beautify\" onclick=\"$(this).toggleClass('toggle')\">{prettyRender(x.value)}</pre>}) ::\n-        Nil\n-      }\n+      val nodeId = node.id.value\n+      val jsonProperties = compactRender(node.properties.toApiJson())\n+      val userHasRights = CurrentUser.checkRights(Write(\"node\"))\n+      def tabProperties = ChooseTemplate(List(\"templates-hidden\", \"components\", \"ComponentNodeProperties\") , \"nodeproperties-tab\")\n+\n+      val css: CssSel =  \"#tabPropsId [id]\" #> htmlId(jsId,\"sd_props_\")\n+      css(tabProperties) ++ Script(OnLoad(JsRaw(s\"\"\"\n+        angular.bootstrap('#nodeProp', ['nodeProperties']);\n+        var scope  = angular.element($$(\"#nodeProp\")).scope();\n+        var props  = ${jsonProperties};\n+        var nodeId = \"${nodeId}\"","path":"rudder-web/src/main/scala/com/normation/rudder/web/services/DisplayNode.scala","position":34,"original_position":34,"commit_id":"e0ec571538677c5f83a2225ef6af4ea3fb73c4d5","original_commit_id":"e0ec571538677c5f83a2225ef6af4ea3fb73c4d5","user":{"login":"VinceMacBuche","id":1238978,"avatar_url":"https://avatars.githubusercontent.com/u/1238978?v=3","gravatar_id":"","url":"https://api.github.com/users/VinceMacBuche","html_url":"https://github.com/VinceMacBuche","followers_url":"https://api.github.com/users/VinceMacBuche/followers","following_url":"https://api.github.com/users/VinceMacBuche/following{/other_user}","gists_url":"https://api.github.com/users/VinceMacBuche/gists{/gist_id}","starred_url":"https://api.github.com/users/VinceMacBuche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VinceMacBuche/subscriptions","organizations_url":"https://api.github.com/users/VinceMacBuche/orgs","repos_url":"https://api.github.com/users/VinceMacBuche/repos","events_url":"https://api.github.com/users/VinceMacBuche/events{/privacy}","received_events_url":"https://api.github.com/users/VinceMacBuche/received_events","type":"User","site_admin":false},"body":"dangerous to create those variables here they will be sent into global scope, maybe modifying global variabled used \r\n\r\neither put the values directly (no vars) or encapsulate into a scope/function","created_at":"2017-02-16T14:52:52Z","updated_at":"2017-02-16T14:52:52Z","html_url":"https://github.com/Normation/rudder/pull/1503#discussion_r101535908","pull_request_url":"https://api.github.com/repos/Normation/rudder/pulls/1503","_links":{"self":{"href":"https://api.github.com/repos/Normation/rudder/pulls/comments/101535908"},"html":{"href":"https://github.com/Normation/rudder/pull/1503#discussion_r101535908"},"pull_request":{"href":"https://api.github.com/repos/Normation/rudder/pulls/1503"}}},"pull_request":{"url":"https://api.github.com/repos/Normation/rudder/pulls/1503","id":106486271,"html_url":"https://github.com/Normation/rudder/pull/1503","diff_url":"https://github.com/Normation/rudder/pull/1503.diff","patch_url":"https://github.com/Normation/rudder/pull/1503.patch","issue_url":"https://api.github.com/repos/Normation/rudder/issues/1503","number":1503,"state":"open","locked":false,"title":"Fixes #10169: UI to define node properties","user":{"login":"RaphaelGauthier","id":9928447,"avatar_url":"https://avatars.githubusercontent.com/u/9928447?v=3","gravatar_id":"","url":"https://api.github.com/users/RaphaelGauthier","html_url":"https://github.com/RaphaelGauthier","followers_url":"https://api.github.com/users/RaphaelGauthier/followers","following_url":"https://api.github.com/users/RaphaelGauthier/following{/other_user}","gists_url":"https://api.github.com/users/RaphaelGauthier/gists{/gist_id}","starred_url":"https://api.github.com/users/RaphaelGauthier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaphaelGauthier/subscriptions","organizations_url":"https://api.github.com/users/RaphaelGauthier/orgs","repos_url":"https://api.github.com/users/RaphaelGauthier/repos","events_url":"https://api.github.com/users/RaphaelGauthier/events{/privacy}","received_events_url":"https://api.github.com/users/RaphaelGauthier/received_events","type":"User","site_admin":false},"body":"https://www.rudder-project.org/redmine/issues/10169","created_at":"2017-02-16T09:37:49Z","updated_at":"2017-02-16T14:52:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f03f8cc7b2556287832b1a8476872eb1bdd244ef","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Normation/rudder/pulls/1503/commits","review_comments_url":"https://api.github.com/repos/Normation/rudder/pulls/1503/comments","review_comment_url":"https://api.github.com/repos/Normation/rudder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Normation/rudder/issues/1503/comments","statuses_url":"https://api.github.com/repos/Normation/rudder/statuses/e0ec571538677c5f83a2225ef6af4ea3fb73c4d5","head":{"label":"RaphaelGauthier:ust_10169/ui_to_define_node_properties","ref":"ust_10169/ui_to_define_node_properties","sha":"e0ec571538677c5f83a2225ef6af4ea3fb73c4d5","user":{"login":"RaphaelGauthier","id":9928447,"avatar_url":"https://avatars.githubusercontent.com/u/9928447?v=3","gravatar_id":"","url":"https://api.github.com/users/RaphaelGauthier","html_url":"https://github.com/RaphaelGauthier","followers_url":"https://api.github.com/users/RaphaelGauthier/followers","following_url":"https://api.github.com/users/RaphaelGauthier/following{/other_user}","gists_url":"https://api.github.com/users/RaphaelGauthier/gists{/gist_id}","starred_url":"https://api.github.com/users/RaphaelGauthier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaphaelGauthier/subscriptions","organizations_url":"https://api.github.com/users/RaphaelGauthier/orgs","repos_url":"https://api.github.com/users/RaphaelGauthier/repos","events_url":"https://api.github.com/users/RaphaelGauthier/events{/privacy}","received_events_url":"https://api.github.com/users/RaphaelGauthier/received_events","type":"User","site_admin":false},"repo":{"id":55509669,"name":"rudder","full_name":"RaphaelGauthier/rudder","owner":{"login":"RaphaelGauthier","id":9928447,"avatar_url":"https://avatars.githubusercontent.com/u/9928447?v=3","gravatar_id":"","url":"https://api.github.com/users/RaphaelGauthier","html_url":"https://github.com/RaphaelGauthier","followers_url":"https://api.github.com/users/RaphaelGauthier/followers","following_url":"https://api.github.com/users/RaphaelGauthier/following{/other_user}","gists_url":"https://api.github.com/users/RaphaelGauthier/gists{/gist_id}","starred_url":"https://api.github.com/users/RaphaelGauthier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaphaelGauthier/subscriptions","organizations_url":"https://api.github.com/users/RaphaelGauthier/orgs","repos_url":"https://api.github.com/users/RaphaelGauthier/repos","events_url":"https://api.github.com/users/RaphaelGauthier/events{/privacy}","received_events_url":"https://api.github.com/users/RaphaelGauthier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RaphaelGauthier/rudder","description":null,"fork":true,"url":"https://api.github.com/repos/RaphaelGauthier/rudder","forks_url":"https://api.github.com/repos/RaphaelGauthier/rudder/forks","keys_url":"https://api.github.com/repos/RaphaelGauthier/rudder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RaphaelGauthier/rudder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RaphaelGauthier/rudder/teams","hooks_url":"https://api.github.com/repos/RaphaelGauthier/rudder/hooks","issue_events_url":"https://api.github.com/repos/RaphaelGauthier/rudder/issues/events{/number}","events_url":"https://api.github.com/repos/RaphaelGauthier/rudder/events","assignees_url":"https://api.github.com/repos/RaphaelGauthier/rudder/assignees{/user}","branches_url":"https://api.github.com/repos/RaphaelGauthier/rudder/branches{/branch}","tags_url":"https://api.github.com/repos/RaphaelGauthier/rudder/tags","blobs_url":"https://api.github.com/repos/RaphaelGauthier/rudder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RaphaelGauthier/rudder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RaphaelGauthier/rudder/git/refs{/sha}","trees_url":"https://api.github.com/repos/RaphaelGauthier/rudder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RaphaelGauthier/rudder/statuses/{sha}","languages_url":"https://api.github.com/repos/RaphaelGauthier/rudder/languages","stargazers_url":"https://api.github.com/repos/RaphaelGauthier/rudder/stargazers","contributors_url":"https://api.github.com/repos/RaphaelGauthier/rudder/contributors","subscribers_url":"https://api.github.com/repos/RaphaelGauthier/rudder/subscribers","subscription_url":"https://api.github.com/repos/RaphaelGauthier/rudder/subscription","commits_url":"https://api.github.com/repos/RaphaelGauthier/rudder/commits{/sha}","git_commits_url":"https://api.github.com/repos/RaphaelGauthier/rudder/git/commits{/sha}","comments_url":"https://api.github.com/repos/RaphaelGauthier/rudder/comments{/number}","issue_comment_url":"https://api.github.com/repos/RaphaelGauthier/rudder/issues/comments{/number}","contents_url":"https://api.github.com/repos/RaphaelGauthier/rudder/contents/{+path}","compare_url":"https://api.github.com/repos/RaphaelGauthier/rudder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RaphaelGauthier/rudder/merges","archive_url":"https://api.github.com/repos/RaphaelGauthier/rudder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RaphaelGauthier/rudder/downloads","issues_url":"https://api.github.com/repos/RaphaelGauthier/rudder/issues{/number}","pulls_url":"https://api.github.com/repos/RaphaelGauthier/rudder/pulls{/number}","milestones_url":"https://api.github.com/repos/RaphaelGauthier/rudder/milestones{/number}","notifications_url":"https://api.github.com/repos/RaphaelGauthier/rudder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RaphaelGauthier/rudder/labels{/name}","releases_url":"https://api.github.com/repos/RaphaelGauthier/rudder/releases{/id}","deployments_url":"https://api.github.com/repos/RaphaelGauthier/rudder/deployments","created_at":"2016-04-05T13:22:22Z","updated_at":"2016-04-05T13:22:26Z","pushed_at":"2017-02-16T14:41:19Z","git_url":"git://github.com/RaphaelGauthier/rudder.git","ssh_url":"git@github.com:RaphaelGauthier/rudder.git","clone_url":"https://github.com/RaphaelGauthier/rudder.git","svn_url":"https://github.com/RaphaelGauthier/rudder","homepage":"http://www.rudder-project.org/","size":23261,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Normation:branches/rudder/4.1","ref":"branches/rudder/4.1","sha":"665efa8adb5b95bb42e9c67b75905411277acd68","user":{"login":"Normation","id":695105,"avatar_url":"https://avatars.githubusercontent.com/u/695105?v=3","gravatar_id":"","url":"https://api.github.com/users/Normation","html_url":"https://github.com/Normation","followers_url":"https://api.github.com/users/Normation/followers","following_url":"https://api.github.com/users/Normation/following{/other_user}","gists_url":"https://api.github.com/users/Normation/gists{/gist_id}","starred_url":"https://api.github.com/users/Normation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Normation/subscriptions","organizations_url":"https://api.github.com/users/Normation/orgs","repos_url":"https://api.github.com/users/Normation/repos","events_url":"https://api.github.com/users/Normation/events{/privacy}","received_events_url":"https://api.github.com/users/Normation/received_events","type":"Organization","site_admin":false},"repo":{"id":2528254,"name":"rudder","full_name":"Normation/rudder","owner":{"login":"Normation","id":695105,"avatar_url":"https://avatars.githubusercontent.com/u/695105?v=3","gravatar_id":"","url":"https://api.github.com/users/Normation","html_url":"https://github.com/Normation","followers_url":"https://api.github.com/users/Normation/followers","following_url":"https://api.github.com/users/Normation/following{/other_user}","gists_url":"https://api.github.com/users/Normation/gists{/gist_id}","starred_url":"https://api.github.com/users/Normation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Normation/subscriptions","organizations_url":"https://api.github.com/users/Normation/orgs","repos_url":"https://api.github.com/users/Normation/repos","events_url":"https://api.github.com/users/Normation/events{/privacy}","received_events_url":"https://api.github.com/users/Normation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Normation/rudder","description":"Continuous configuration for effective compliance","fork":false,"url":"https://api.github.com/repos/Normation/rudder","forks_url":"https://api.github.com/repos/Normation/rudder/forks","keys_url":"https://api.github.com/repos/Normation/rudder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Normation/rudder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Normation/rudder/teams","hooks_url":"https://api.github.com/repos/Normation/rudder/hooks","issue_events_url":"https://api.github.com/repos/Normation/rudder/issues/events{/number}","events_url":"https://api.github.com/repos/Normation/rudder/events","assignees_url":"https://api.github.com/repos/Normation/rudder/assignees{/user}","branches_url":"https://api.github.com/repos/Normation/rudder/branches{/branch}","tags_url":"https://api.github.com/repos/Normation/rudder/tags","blobs_url":"https://api.github.com/repos/Normation/rudder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Normation/rudder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Normation/rudder/git/refs{/sha}","trees_url":"https://api.github.com/repos/Normation/rudder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Normation/rudder/statuses/{sha}","languages_url":"https://api.github.com/repos/Normation/rudder/languages","stargazers_url":"https://api.github.com/repos/Normation/rudder/stargazers","contributors_url":"https://api.github.com/repos/Normation/rudder/contributors","subscribers_url":"https://api.github.com/repos/Normation/rudder/subscribers","subscription_url":"https://api.github.com/repos/Normation/rudder/subscription","commits_url":"https://api.github.com/repos/Normation/rudder/commits{/sha}","git_commits_url":"https://api.github.com/repos/Normation/rudder/git/commits{/sha}","comments_url":"https://api.github.com/repos/Normation/rudder/comments{/number}","issue_comment_url":"https://api.github.com/repos/Normation/rudder/issues/comments{/number}","contents_url":"https://api.github.com/repos/Normation/rudder/contents/{+path}","compare_url":"https://api.github.com/repos/Normation/rudder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Normation/rudder/merges","archive_url":"https://api.github.com/repos/Normation/rudder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Normation/rudder/downloads","issues_url":"https://api.github.com/repos/Normation/rudder/issues{/number}","pulls_url":"https://api.github.com/repos/Normation/rudder/pulls{/number}","milestones_url":"https://api.github.com/repos/Normation/rudder/milestones{/number}","notifications_url":"https://api.github.com/repos/Normation/rudder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Normation/rudder/labels{/name}","releases_url":"https://api.github.com/repos/Normation/rudder/releases{/id}","deployments_url":"https://api.github.com/repos/Normation/rudder/deployments","created_at":"2011-10-06T19:27:50Z","updated_at":"2017-02-14T21:04:05Z","pushed_at":"2017-02-16T14:41:21Z","git_url":"git://github.com/Normation/rudder.git","ssh_url":"git@github.com:Normation/rudder.git","clone_url":"https://github.com/Normation/rudder.git","svn_url":"https://github.com/Normation/rudder","homepage":"http://www.rudder-project.org/","size":23257,"stargazers_count":119,"watchers_count":119,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":119,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Normation/rudder/pulls/1503"},"html":{"href":"https://github.com/Normation/rudder/pull/1503"},"issue":{"href":"https://api.github.com/repos/Normation/rudder/issues/1503"},"comments":{"href":"https://api.github.com/repos/Normation/rudder/issues/1503/comments"},"review_comments":{"href":"https://api.github.com/repos/Normation/rudder/pulls/1503/comments"},"review_comment":{"href":"https://api.github.com/repos/Normation/rudder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Normation/rudder/pulls/1503/commits"},"statuses":{"href":"https://api.github.com/repos/Normation/rudder/statuses/e0ec571538677c5f83a2225ef6af4ea3fb73c4d5"}}}}
{"actor":{"display_login":"VinceMacBuche"}}