{"action":"created","comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/185878053","pull_request_review_id":117356997,"id":185878053,"diff_hunk":"@@ -93,17 +93,31 @@ private void EditCustomNodeProperties()\n \n             if (args.Success)\n             {\n-                CustomNodeWorkspaceModel ws;\n-                model.CustomNodeManager.TryGetFunctionWorkspace(\n-                    functionNodeModel.Definition.FunctionId,\n-                    DynamoModel.IsTestMode,\n-                    out ws);\n-                ws.SetInfo(args.Name, args.Category, args.Description);\n-\n-                if (!string.IsNullOrEmpty(ws.FileName))\n-                {\n-                    ws.Save(ws.FileName, false, dynamoViewModel.EngineController);\n-                }\n+                SerializeCustomNodeWorkspaceWithNewInfo(args, dynamoViewModel, functionNodeModel);\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Serialize and update dyf based on FunctionNamePromptEventArgs\n+        /// </summary>\n+        /// <param name=\"args\">FunctionNamePromptEventArgs which contains updated dyf info</param>\n+        /// <param name=\"dynamoViewModel\">Dynamo View Model</param>\n+        /// <param name=\"functionNodeModel\">Custom Node</param>\n+        internal void SerializeCustomNodeWorkspaceWithNewInfo(FunctionNamePromptEventArgs args, DynamoViewModel dynamoViewModel, Function functionNodeModel)\n+        {\n+            CustomNodeWorkspaceModel ws;\n+            dynamoViewModel.Model.CustomNodeManager.TryGetFunctionWorkspace(\n+                functionNodeModel.Definition.FunctionId,\n+                DynamoModel.IsTestMode,\n+                out ws);\n+            ws.SetInfo(args.Name, args.Category, args.Description);\n+\n+            if (!string.IsNullOrEmpty(ws.FileName))\n+            {\n+                // Construct a temp WorkspaceViewModel based on for serializing\n+                WorkspaceViewModel temp = new WorkspaceViewModel(ws, dynamoViewModel);","path":"src/DynamoCoreWpf/NodeViewCustomization/NodeViewCustomizations/FunctionNodeViewCustomization.cs","position":37,"original_position":37,"commit_id":"909877cca0f60978c3f3757c38064888c5ce3b54","original_commit_id":"909877cca0f60978c3f3757c38064888c5ce3b54","user":{"login":"QilongTang","id":3942418,"avatar_url":"https://avatars2.githubusercontent.com/u/3942418?v=4","gravatar_id":"","url":"https://api.github.com/users/QilongTang","html_url":"https://github.com/QilongTang","followers_url":"https://api.github.com/users/QilongTang/followers","following_url":"https://api.github.com/users/QilongTang/following{/other_user}","gists_url":"https://api.github.com/users/QilongTang/gists{/gist_id}","starred_url":"https://api.github.com/users/QilongTang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QilongTang/subscriptions","organizations_url":"https://api.github.com/users/QilongTang/orgs","repos_url":"https://api.github.com/users/QilongTang/repos","events_url":"https://api.github.com/users/QilongTang/events{/privacy}","received_events_url":"https://api.github.com/users/QilongTang/received_events","type":"User","site_admin":false},"body":"@ramramps The currentWorksapceViewModel point to the homeworkspace containing the custom node so calling save there will update the dyn only, user is trying to update the dyf which may or may not be opened at all","created_at":"2018-05-03T17:26:06Z","updated_at":"2018-05-03T17:26:06Z","html_url":"https://github.com/DynamoDS/Dynamo/pull/8812#discussion_r185878053","pull_request_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/185878053"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/8812#discussion_r185878053"},"pull_request":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812"}},"in_reply_to_id":185869993},"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812","id":185132646,"html_url":"https://github.com/DynamoDS/Dynamo/pull/8812","diff_url":"https://github.com/DynamoDS/Dynamo/pull/8812.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/8812.patch","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/8812","number":8812,"state":"open","locked":false,"title":"Save View info during Custom Node Info edition","user":{"login":"QilongTang","id":3942418,"avatar_url":"https://avatars2.githubusercontent.com/u/3942418?v=4","gravatar_id":"","url":"https://api.github.com/users/QilongTang","html_url":"https://github.com/QilongTang","followers_url":"https://api.github.com/users/QilongTang/followers","following_url":"https://api.github.com/users/QilongTang/following{/other_user}","gists_url":"https://api.github.com/users/QilongTang/gists{/gist_id}","starred_url":"https://api.github.com/users/QilongTang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QilongTang/subscriptions","organizations_url":"https://api.github.com/users/QilongTang/orgs","repos_url":"https://api.github.com/users/QilongTang/repos","events_url":"https://api.github.com/users/QilongTang/events{/privacy}","received_events_url":"https://api.github.com/users/QilongTang/received_events","type":"User","site_admin":false},"body":"Please Note:\r\n1. Before submitting the PR, please review [How to Contribute to Dynamo](https://github.com/DynamoDS/Dynamo/blob/master/CONTRIBUTING.md)\r\n2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)\r\n3. PRs will be reviewed from oldest to newest\r\n4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team\r\n5. PRs should use either Dynamo's default PR template or [one of these other template options](https://github.com/DynamoDS/Dynamo/wiki/Choosing-a-Pull-Request-Template) in order to be considered for review.\r\n6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.\r\n7. PRs made to the `DynamoRevit` repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a `LGTM` label is added to the PR.\r\n\r\n### Purpose\r\n\r\n[QNTM-4180](https://jira.autodesk.com/browse/QNTM-4180)\r\nGithub Issue: Node coordinates in custom nodes are set to 0,0 when editing node properties\r\n\r\nPer: https://github.com/DynamoDS/Dynamo/issues/8803\r\n\r\nThis PR will preserve the same dyf **View** block when editing custom node workspace.\r\n\r\nThis is a proposed fix. View info will be lost if we use `CustomNodeWorkspace.Save()` so ideally we want to call `WorkspaceViewModel.Save()` while WorkspaceModel is the only thing available here, I have looked at the possibility of keeping a dictionary of ViewModel under `CustomNodeManager` but seems not worth it and over complicate stuff. In that case, what else can we use rather than our Save() function? I think appending the original **View** block can work strictly because we know in this case user only modifies CustomNodeInfo without touching view info. Other suggestions are welcome.\r\n\r\nNeed unit testing 😉 \r\n\r\n### Declarations\r\n\r\nCheck these if you believe they are true\r\n\r\n- [x] The code base is in a better state after this PR\r\n- [x] Is documented according to the [standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)\r\n- [x] The level of testing this PR includes is appropriate\r\n- [ ] User facing strings, if any, are extracted into `*.resx` files\r\n- [x] All tests pass using the self-service CI.\r\nhttps://ecwest.autodesk.com/commander/link/jobDetails/jobs/6f1300bb-4edf-11e8-b04f-a0d3c1eff5a4?\r\n- [ ] Snapshot of UI changes, if any.\r\n- [ ] Changes to the API follow [Semantic Versioning](https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Versions), and are documented in the [API Changes](https://github.com/DynamoDS/Dynamo/wiki/API-Changes) document.\r\n\r\n### Reviewers\r\n\r\n@ramramps @mjkkirschner \r\n\r\n### FYIs\r\n\r\n@smangarole @jnealb @andydandy74 \r\n","created_at":"2018-05-01T07:16:35Z","updated_at":"2018-05-03T17:26:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19e674747f48db362865422e4d33c722f23d8f13","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":906198236,"url":"https://api.github.com/repos/DynamoDS/Dynamo/labels/2.0.1%20Release","name":"2.0.1 Release","color":"ba2a51","default":false},{"id":270895791,"url":"https://api.github.com/repos/DynamoDS/Dynamo/labels/Waiting%20for%20feedback","name":"Waiting for feedback","color":"006b75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812/commits","review_comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812/comments","review_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/8812/comments","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/909877cca0f60978c3f3757c38064888c5ce3b54","head":{"label":"DynamoDS:CustomNodeInfoEdit","ref":"CustomNodeInfoEdit","sha":"909877cca0f60978c3f3757c38064888c5ce3b54","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars3.githubusercontent.com/u/6528209?v=4","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars3.githubusercontent.com/u/6528209?v=4","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Open Source Graphical Programming for Design","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","deployments_url":"https://api.github.com/repos/DynamoDS/Dynamo/deployments","created_at":"2012-02-09T07:35:33Z","updated_at":"2018-05-03T17:21:56Z","pushed_at":"2018-05-03T17:21:52Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":1064485,"stargazers_count":577,"watchers_count":577,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":347,"mirror_url":null,"archived":false,"open_issues_count":647,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":347,"open_issues":647,"watchers":577,"default_branch":"master"}},"base":{"label":"DynamoDS:RC2.0.1_master","ref":"RC2.0.1_master","sha":"656ea739b1fe96b08b0f5466ebea3b9ca56c152c","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars3.githubusercontent.com/u/6528209?v=4","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars3.githubusercontent.com/u/6528209?v=4","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Open Source Graphical Programming for Design","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","deployments_url":"https://api.github.com/repos/DynamoDS/Dynamo/deployments","created_at":"2012-02-09T07:35:33Z","updated_at":"2018-05-03T17:21:56Z","pushed_at":"2018-05-03T17:21:52Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":1064485,"stargazers_count":577,"watchers_count":577,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":347,"mirror_url":null,"archived":false,"open_issues_count":647,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":347,"open_issues":647,"watchers":577,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/8812"},"issue":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/8812"},"comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/8812/comments"},"review_comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812/comments"},"review_comment":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/8812/commits"},"statuses":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/909877cca0f60978c3f3757c38064888c5ce3b54"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"QilongTang"}}