{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/comments/130317325","pull_request_review_id":53177281,"id":130317325,"diff_hunk":"@@ -4,25 +4,31 @@ define([\n   'common/lodash',","path":"uk.co.compucorp.civicrm.hrleaveandabsences/js/angular/src/leave-absences/shared/components/leave-request-popup-files-tab.js","position":1,"original_position":1,"commit_id":"6293d1e51a86a49d9f2ce5ab0d0e649279301f31","original_commit_id":"6293d1e51a86a49d9f2ce5ab0d0e649279301f31","user":{"login":"deb1990","id":5058867,"avatar_url":"https://avatars1.githubusercontent.com/u/5058867?v=4","gravatar_id":"","url":"https://api.github.com/users/deb1990","html_url":"https://github.com/deb1990","followers_url":"https://api.github.com/users/deb1990/followers","following_url":"https://api.github.com/users/deb1990/following{/other_user}","gists_url":"https://api.github.com/users/deb1990/gists{/gist_id}","starred_url":"https://api.github.com/users/deb1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deb1990/subscriptions","organizations_url":"https://api.github.com/users/deb1990/orgs","repos_url":"https://api.github.com/users/deb1990/repos","events_url":"https://api.github.com/users/deb1990/events{/privacy}","received_events_url":"https://api.github.com/users/deb1990/received_events","type":"User","site_admin":false},"body":"As discussed, not making any style guide fixes in this PR.","created_at":"2017-07-31T10:16:19Z","updated_at":"2017-07-31T10:16:19Z","html_url":"https://github.com/civicrm/civihr/pull/2019#discussion_r130317325","pull_request_url":"https://api.github.com/repos/civicrm/civihr/pulls/2019","_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments/130317325"},"html":{"href":"https://github.com/civicrm/civihr/pull/2019#discussion_r130317325"},"pull_request":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/2019"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/2019","id":131768951,"html_url":"https://github.com/civicrm/civihr/pull/2019","diff_url":"https://github.com/civicrm/civihr/pull/2019.diff","patch_url":"https://github.com/civicrm/civihr/pull/2019.patch","issue_url":"https://api.github.com/repos/civicrm/civihr/issues/2019","number":2019,"state":"open","locked":false,"title":"PCHR-2164: Option group values for extensions","user":{"login":"deb1990","id":5058867,"avatar_url":"https://avatars1.githubusercontent.com/u/5058867?v=4","gravatar_id":"","url":"https://api.github.com/users/deb1990","html_url":"https://github.com/deb1990","followers_url":"https://api.github.com/users/deb1990/followers","following_url":"https://api.github.com/users/deb1990/following{/other_user}","gists_url":"https://api.github.com/users/deb1990/gists{/gist_id}","starred_url":"https://api.github.com/users/deb1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deb1990/subscriptions","organizations_url":"https://api.github.com/users/deb1990/orgs","repos_url":"https://api.github.com/users/deb1990/repos","events_url":"https://api.github.com/users/deb1990/events{/privacy}","received_events_url":"https://api.github.com/users/deb1990/received_events","type":"User","site_admin":false},"body":"## Overview\r\nPreviously the supported file types for upload was hardcoded into the code, added support to get it from Option Groups.\r\n\r\n**Changes to the following files needs to be moved to 1.6 before merging,**\r\n1. org.civicrm.reqangular/src/common/bundles/services.js\r\n2. file-mime-types.js\r\n3. file-mime-types_test.js\r\n\r\n## Technical Details\r\n1. `file-mime-types` service has been created, it is used to map file extensions with mime types. `getMimeTypeFor()` method is present in the service for the same reason. **It will be moved to 1.6**\r\n\r\n2. The `FileUploader` object has been moved out of `leave-request-instance.js` to `leave-request-popup-files-tab.js`. Similarly the uploading logic has been moved too. \r\nThis is done because all the logic related to fetching Allowed File extensions should be in one place which is `leave-request-popup-files-tab.js`.\r\n\r\n3. `allowedMimeTypes` has been deleted from `shared-settings` as it is moved to `file-mime-types` service.\r\n\r\n4. `loadSupportedFileTypes` added in `leave-request-popup-files-tab` to fetch the allowed extensions and initialise the `file-uploader.`\r\n\r\n5. Life cycle method `$onDestroy` added to `leave-request-popup-files-tab` to destroy all listeners.\r\n\r\n6. While the `fileUploader` is defined in `leave-request-popup-files-tab`, the main object is defined in `request-ctrl` and passed via attributes. This is done because the `request-ctrl` needs access to the `fileUploader` object to determine whether the leave request has changed or not.\r\n\r\n7. `setInitialAttributes()` is defined in `request-ctrl` which is the listener for `Request Updated` event, which broadcasted both from `leave-request-popup-files-tab` and `leave-request-popup-comments-tab`. It is used to update the `initialLeaveRequestAttributes` object which needs to get updated when comments and files are loaded.\r\n\r\n8. `initChildProcess`added to `request-ctrl`, which broadcasts an event to start all child process, and subscribed by any child component which needs to do some steps after the request is saved and before the popup is closed. For now `leave-request-popup-files-tab` needs to upload the files, so it starts the upload and passes the response back to `request-ctrl` via `$rootScope.$broadcast('LeaveRequestModal::childProcess::success')` or `LeaveRequestModal::childProcess::error')` event.\r\n\r\n9. Mock data added for `safe_file_extension` Option Group.\r\n\r\n10. A loader has been added to the Files tab until the files and uploader is set. For same reason `filesLoaded` variable has been created.\r\n\r\n## Comments\r\nRight now the `safe_file_extension` OptionGroup does not have the correct OptionValues, a backend fix is necessary for that.\r\n\r\n## Additional Bug Fix\r\nFound a bug in the leave popup of admin dashboard, where the uploader in files tab was not visible.\r\n**Before**\r\n![dashboard___hr17-1](https://user-images.githubusercontent.com/5058867/28465169-7445e2e4-6e45-11e7-92d8-fdc00a15c8db.png)\r\n\r\n**After**\r\n![dashboard___hr17-1](https://user-images.githubusercontent.com/5058867/28465145-6070757c-6e45-11e7-85e5-91944c92df1b.png)\r\n\r\n**Fix**\r\nAdded `'leave-absences/shared/components/leave-request-popup-files-tab'` to `leave-absences/admin-dashboard/app.js`\r\n\r\n---\r\n\r\n- [x] Tests Pass\r\n","created_at":"2017-07-21T13:00:48Z","updated_at":"2017-07-31T10:16:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2ef93886cd07f2378cdd515f9b2e5d8a1401e44","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civihr/pulls/2019/commits","review_comments_url":"https://api.github.com/repos/civicrm/civihr/pulls/2019/comments","review_comment_url":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civihr/issues/2019/comments","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/6293d1e51a86a49d9f2ce5ab0d0e649279301f31","head":{"label":"civicrm:PCHR-2164-uploader-extentions","ref":"PCHR-2164-uploader-extentions","sha":"6293d1e51a86a49d9f2ce5ab0d0e649279301f31","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2017-07-24T09:17:58Z","pushed_at":"2017-07-28T16:55:18Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":49756,"stargazers_count":17,"watchers_count":17,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":18,"forks":33,"open_issues":18,"watchers":17,"default_branch":"staging"}},"base":{"label":"civicrm:la-milestone-3","ref":"la-milestone-3","sha":"470ab46bf959cb97fdf440afd4c5851ff460149b","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2017-07-24T09:17:58Z","pushed_at":"2017-07-28T16:55:18Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":49756,"stargazers_count":17,"watchers_count":17,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":18,"forks":33,"open_issues":18,"watchers":17,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/2019"},"html":{"href":"https://github.com/civicrm/civihr/pull/2019"},"issue":{"href":"https://api.github.com/repos/civicrm/civihr/issues/2019"},"comments":{"href":"https://api.github.com/repos/civicrm/civihr/issues/2019/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/2019/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/2019/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civihr/statuses/6293d1e51a86a49d9f2ce5ab0d0e649279301f31"}}}}
{"actor":{"display_login":"deb1990"}}