{"action":"created","comment":{"url":"https://api.github.com/repos/opf/openproject/pulls/comments/79778490","id":79778490,"diff_hunk":"@@ -0,0 +1,117 @@\n+import {wpDirectivesModule} from '../../../angular-modules';\n+import {WorkPackageResourceInterface} from '../../api/api-v3/hal-resources/work-package-resource.service';\n+import {RelationType} from \"../wp-relations.interfaces\";\n+\n+export class WpRelationsCreateController {","path":"frontend/app/components/wp-relations/wp-relations-create/wp-relations-create.directive.ts","position":5,"original_position":5,"commit_id":"cc37db909675ada7c21723adc5a7682557595daa","original_commit_id":"cc37db909675ada7c21723adc5a7682557595daa","user":{"login":"furinvader","id":4266107,"avatar_url":"https://avatars.githubusercontent.com/u/4266107?v=3","gravatar_id":"","url":"https://api.github.com/users/furinvader","html_url":"https://github.com/furinvader","followers_url":"https://api.github.com/users/furinvader/followers","following_url":"https://api.github.com/users/furinvader/following{/other_user}","gists_url":"https://api.github.com/users/furinvader/gists{/gist_id}","starred_url":"https://api.github.com/users/furinvader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furinvader/subscriptions","organizations_url":"https://api.github.com/users/furinvader/orgs","repos_url":"https://api.github.com/users/furinvader/repos","events_url":"https://api.github.com/users/furinvader/events{/privacy}","received_events_url":"https://api.github.com/users/furinvader/received_events","type":"User","site_admin":false},"body":"Always use full words for class names.\r\nSo it should be `WorkPackageRelationsCreateController`.","created_at":"2016-09-21T08:02:04Z","updated_at":"2016-09-21T08:17:49Z","html_url":"https://github.com/opf/openproject/pull/4748#discussion_r79778490","pull_request_url":"https://api.github.com/repos/opf/openproject/pulls/4748","_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/79778490"},"html":{"href":"https://github.com/opf/openproject/pull/4748#discussion_r79778490"},"pull_request":{"href":"https://api.github.com/repos/opf/openproject/pulls/4748"}}},"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/4748","id":79914116,"html_url":"https://github.com/opf/openproject/pull/4748","diff_url":"https://github.com/opf/openproject/pull/4748.diff","patch_url":"https://github.com/opf/openproject/pull/4748.patch","issue_url":"https://api.github.com/repos/opf/openproject/issues/4748","number":4748,"state":"open","locked":false,"title":"[#23708] - Improve WP Relations Tab","user":{"login":"manuschiller","id":17978263,"avatar_url":"https://avatars.githubusercontent.com/u/17978263?v=3","gravatar_id":"","url":"https://api.github.com/users/manuschiller","html_url":"https://github.com/manuschiller","followers_url":"https://api.github.com/users/manuschiller/followers","following_url":"https://api.github.com/users/manuschiller/following{/other_user}","gists_url":"https://api.github.com/users/manuschiller/gists{/gist_id}","starred_url":"https://api.github.com/users/manuschiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuschiller/subscriptions","organizations_url":"https://api.github.com/users/manuschiller/orgs","repos_url":"https://api.github.com/users/manuschiller/repos","events_url":"https://api.github.com/users/manuschiller/events{/privacy}","received_events_url":"https://api.github.com/users/manuschiller/received_events","type":"User","site_admin":false},"body":"According to [23709](https://community.openproject.com/work_packages/23709/activity) and its child wps [22810](https://community.openproject.com/work_packages/22810/activity) / [23708](https://community.openproject.com/work_packages/23708/activity)\r\n\r\n**This improves the wp relations tab and extends the relations view with a hierachy view for visualizing parent / child relations between workpackages.**\r\n\r\n### Implementation approach\r\n--\r\n\r\n1. The visual implementation is based on the screenshots given in the specification.\r\n2. Code wise the implementation is based on extending the existing relations handling and several changes in the structure of the directives.\r\n\r\n`wp-relations`:\r\n- **currently**\r\nthe directive is being used for displaying one type of relations. it provides the general logic for handling relations (saving, removing, checking authorization levels, ...). \r\n\r\n- **approach**\r\nthe directive will be split into two parts: \r\n\r\n1. displaying one relation type will be separated into a `wp-relation-group` directive.\r\n2. the `wp-relations` will be a parent directive to all the other directives regarding relations and will provide general logic (eg. retrieval, sorting, saving, removing, ... ) to its child directives. \r\nIt will make use of the existing `wp-relations.service` and the current `wp-relation-group`-component (`wp-child-relation-group.service`, `wp-parent-relation-group.service`, `wp-relation-group.service`)\r\n\r\n`add-wp-relation`: \r\n- **currently**: \r\ndisplays a form with a select box (autocomplete) to choose a target wp for the relation and a button to save the relation. \r\n- **approach**:\r\nwill be turned into a `wp-relation-autocomplete` directive that does not need the save-button\r\n\r\n\r\n\r\n**The final structure will look like this:**\r\n`relations-panel.directive` - global layout of the relations panel \r\n`-- wp-relations.directive` - global relations logic provided as `$relationsCtrl` \r\n`---- wp-relations-hierarchy.directive` - hierarchy logic and layout\r\n`---- wp-relations-group.directive` - group logic and layout\r\n`---- wp-relations-create.directive`- create logic and layout\r\n`------ wp-relations-autocomplete.directive` - autocomplete select for target wps\r\n\r\n### Alternatives\r\nno alternatives so far\r\n\r\n### Out of scope\r\n- the specification contains one option that a user may add a custom description to a relation.\r\nThis feature does not block the development of this pr's other aspects and needs work in the backend. [23759](https://community.openproject.com/work_packages/23759/activity)\r\n- labels / wording for the different relation types could be more meaningful in context with the new create solution\r\n\r\n### ToDos\r\n\r\n- [x] hide empty relation types / groups\r\n- [x] adding relations is done via only one global button instead of one form per relation type group\r\n- [x] change styling of the `wp-autocomplete` input\r\n- [x] groups and relations must refresh instantly after any change without the need to hard reload the page (partly done) \r\n- [x] refactor structure and content of directives according to the approach\r\n- [x] development of the hierarchy directive\r\n- [x] enable inline editing for attributes of related wps\r\n- [x] handle relations to existing child wps\r\n- [x] move logic for handling relations to single relations","created_at":"2016-08-03T14:17:56Z","updated_at":"2016-09-21T08:17:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"027094b776f1f2712f1448deb13b50f03052011b","assignee":{"login":"furinvader","id":4266107,"avatar_url":"https://avatars.githubusercontent.com/u/4266107?v=3","gravatar_id":"","url":"https://api.github.com/users/furinvader","html_url":"https://github.com/furinvader","followers_url":"https://api.github.com/users/furinvader/followers","following_url":"https://api.github.com/users/furinvader/following{/other_user}","gists_url":"https://api.github.com/users/furinvader/gists{/gist_id}","starred_url":"https://api.github.com/users/furinvader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furinvader/subscriptions","organizations_url":"https://api.github.com/users/furinvader/orgs","repos_url":"https://api.github.com/users/furinvader/repos","events_url":"https://api.github.com/users/furinvader/events{/privacy}","received_events_url":"https://api.github.com/users/furinvader/received_events","type":"User","site_admin":false},"assignees":[{"login":"furinvader","id":4266107,"avatar_url":"https://avatars.githubusercontent.com/u/4266107?v=3","gravatar_id":"","url":"https://api.github.com/users/furinvader","html_url":"https://github.com/furinvader","followers_url":"https://api.github.com/users/furinvader/followers","following_url":"https://api.github.com/users/furinvader/following{/other_user}","gists_url":"https://api.github.com/users/furinvader/gists{/gist_id}","starred_url":"https://api.github.com/users/furinvader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furinvader/subscriptions","organizations_url":"https://api.github.com/users/furinvader/orgs","repos_url":"https://api.github.com/users/furinvader/repos","events_url":"https://api.github.com/users/furinvader/events{/privacy}","received_events_url":"https://api.github.com/users/furinvader/received_events","type":"User","site_admin":false},{"login":"manuschiller","id":17978263,"avatar_url":"https://avatars.githubusercontent.com/u/17978263?v=3","gravatar_id":"","url":"https://api.github.com/users/manuschiller","html_url":"https://github.com/manuschiller","followers_url":"https://api.github.com/users/manuschiller/followers","following_url":"https://api.github.com/users/manuschiller/following{/other_user}","gists_url":"https://api.github.com/users/manuschiller/gists{/gist_id}","starred_url":"https://api.github.com/users/manuschiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuschiller/subscriptions","organizations_url":"https://api.github.com/users/manuschiller/orgs","repos_url":"https://api.github.com/users/manuschiller/repos","events_url":"https://api.github.com/users/manuschiller/events{/privacy}","received_events_url":"https://api.github.com/users/manuschiller/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/opf/openproject/pulls/4748/commits","review_comments_url":"https://api.github.com/repos/opf/openproject/pulls/4748/comments","review_comment_url":"https://api.github.com/repos/opf/openproject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opf/openproject/issues/4748/comments","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/cc37db909675ada7c21723adc5a7682557595daa","head":{"label":"manuschiller:relations-tab","ref":"relations-tab","sha":"cc37db909675ada7c21723adc5a7682557595daa","user":{"login":"manuschiller","id":17978263,"avatar_url":"https://avatars.githubusercontent.com/u/17978263?v=3","gravatar_id":"","url":"https://api.github.com/users/manuschiller","html_url":"https://github.com/manuschiller","followers_url":"https://api.github.com/users/manuschiller/followers","following_url":"https://api.github.com/users/manuschiller/following{/other_user}","gists_url":"https://api.github.com/users/manuschiller/gists{/gist_id}","starred_url":"https://api.github.com/users/manuschiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuschiller/subscriptions","organizations_url":"https://api.github.com/users/manuschiller/orgs","repos_url":"https://api.github.com/users/manuschiller/repos","events_url":"https://api.github.com/users/manuschiller/events{/privacy}","received_events_url":"https://api.github.com/users/manuschiller/received_events","type":"User","site_admin":false},"repo":{"id":59292123,"name":"openproject","full_name":"manuschiller/openproject","owner":{"login":"manuschiller","id":17978263,"avatar_url":"https://avatars.githubusercontent.com/u/17978263?v=3","gravatar_id":"","url":"https://api.github.com/users/manuschiller","html_url":"https://github.com/manuschiller","followers_url":"https://api.github.com/users/manuschiller/followers","following_url":"https://api.github.com/users/manuschiller/following{/other_user}","gists_url":"https://api.github.com/users/manuschiller/gists{/gist_id}","starred_url":"https://api.github.com/users/manuschiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuschiller/subscriptions","organizations_url":"https://api.github.com/users/manuschiller/orgs","repos_url":"https://api.github.com/users/manuschiller/repos","events_url":"https://api.github.com/users/manuschiller/events{/privacy}","received_events_url":"https://api.github.com/users/manuschiller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manuschiller/openproject","description":"OpenProject is a web-based project management system built on Ruby on Rails","fork":true,"url":"https://api.github.com/repos/manuschiller/openproject","forks_url":"https://api.github.com/repos/manuschiller/openproject/forks","keys_url":"https://api.github.com/repos/manuschiller/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manuschiller/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manuschiller/openproject/teams","hooks_url":"https://api.github.com/repos/manuschiller/openproject/hooks","issue_events_url":"https://api.github.com/repos/manuschiller/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/manuschiller/openproject/events","assignees_url":"https://api.github.com/repos/manuschiller/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/manuschiller/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/manuschiller/openproject/tags","blobs_url":"https://api.github.com/repos/manuschiller/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manuschiller/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manuschiller/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/manuschiller/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manuschiller/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/manuschiller/openproject/languages","stargazers_url":"https://api.github.com/repos/manuschiller/openproject/stargazers","contributors_url":"https://api.github.com/repos/manuschiller/openproject/contributors","subscribers_url":"https://api.github.com/repos/manuschiller/openproject/subscribers","subscription_url":"https://api.github.com/repos/manuschiller/openproject/subscription","commits_url":"https://api.github.com/repos/manuschiller/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/manuschiller/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/manuschiller/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/manuschiller/openproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/manuschiller/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/manuschiller/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manuschiller/openproject/merges","archive_url":"https://api.github.com/repos/manuschiller/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manuschiller/openproject/downloads","issues_url":"https://api.github.com/repos/manuschiller/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/manuschiller/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/manuschiller/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/manuschiller/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manuschiller/openproject/labels{/name}","releases_url":"https://api.github.com/repos/manuschiller/openproject/releases{/id}","deployments_url":"https://api.github.com/repos/manuschiller/openproject/deployments","created_at":"2016-05-20T12:22:38Z","updated_at":"2016-05-20T12:22:48Z","pushed_at":"2016-09-20T14:28:34Z","git_url":"git://github.com/manuschiller/openproject.git","ssh_url":"git@github.com:manuschiller/openproject.git","clone_url":"https://github.com/manuschiller/openproject.git","svn_url":"https://github.com/manuschiller/openproject","homepage":"https://www.openproject.org","size":79850,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"dev"}},"base":{"label":"opf:dev","ref":"dev","sha":"043c04cd38dae4ed92be7e25f24c68eabd5349af","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web-based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","deployments_url":"https://api.github.com/repos/opf/openproject/deployments","created_at":"2012-11-28T09:59:11Z","updated_at":"2016-09-20T22:52:54Z","pushed_at":"2016-09-21T07:19:08Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":187606,"stargazers_count":1132,"watchers_count":1132,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":422,"mirror_url":null,"open_issues_count":13,"forks":422,"open_issues":13,"watchers":1132,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/4748"},"html":{"href":"https://github.com/opf/openproject/pull/4748"},"issue":{"href":"https://api.github.com/repos/opf/openproject/issues/4748"},"comments":{"href":"https://api.github.com/repos/opf/openproject/issues/4748/comments"},"review_comments":{"href":"https://api.github.com/repos/opf/openproject/pulls/4748/comments"},"review_comment":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opf/openproject/pulls/4748/commits"},"statuses":{"href":"https://api.github.com/repos/opf/openproject/statuses/cc37db909675ada7c21723adc5a7682557595daa"}}}}
{"actor":{"display_login":"furinvader"}}