{"action":"created","comment":{"url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/comments/141302252","pull_request_review_id":65457745,"id":141302252,"diff_hunk":"@@ -0,0 +1,88 @@\n+import { ContainerProps, ListView } from \"../components/CheckboxFilterContainer\";\n+\n+export const parseStyle = (style = \"\"): {[key: string]: string} => {\n+    try {\n+        return style.split(\";\").reduce<{[key: string]: string}>((styleObject, line) => {\n+            const pair = line.split(\":\");\n+            if (pair.length === 2) {\n+                const name = pair[0].trim().replace(/(-.)/g, match => match[1].toUpperCase());\n+                styleObject[name] = pair[1].trim();\n+            }\n+            return styleObject;\n+        }, {});\n+    } catch (error) {\n+        // tslint:disable-next-line no-console\n+        window.console.log(\"Failed to parse style\", style, error);\n+    }\n+\n+    return {};\n+};\n+\n+export class Utils {\n+    static validate(props: ContainerProps & { filterNode: HTMLElement; targetListView: ListView; validate: boolean, isModeler?: boolean}): string {\n+        const widgetName = props.friendlyId;\n+        const { targetListView } = props;\n+        const errorMessage = [];\n+        // validate filter values if filterby = attribute, then value should not be empty or \"\" or \" \".\n+        if (!props.filterNode) {\n+            return `${widgetName}: unable to find a listview with to attach to`;\n+        }\n+\n+        if (props.filterBy === \"XPath\" && !props.constraint) {\n+            errorMessage.push(`Filter by 'XPath' requires an 'XPath contraint'`);\n+        }\n+        if (props.filterBy === \"attribute\" && !props.attribute) {\n+            errorMessage.push(`Filter by 'Attribute' requires an 'Attribute'`);\n+        }\n+        if (props.filterBy === \"attribute\" && !props.attributeValue) {\n+            errorMessage.push(`Filter by 'Attribute' requires an 'Attribute value`);\n+        }\n+\n+        if (props.unCheckedFilterBy === \"XPath\" && !props.unCheckedConstraint) {\n+            errorMessage.push(`Unchecked filter by 'XPath' requires an 'XPath contraint'`);\n+        }\n+        if (props.unCheckedFilterBy === \"attribute\" && !props.unCheckedAttribute) {\n+            errorMessage.push(`Unchecked filter by 'Attribute' requires an 'Attribute'`);\n+        }\n+        if (props.unCheckedFilterBy === \"attribute\" && !props.unCheckedAttributeValue) {\n+            errorMessage.push(`Unchecked filter by 'Attribute' requires an 'Attribute value`);\n+        }\n+\n+        if (errorMessage.length) {\n+            return `${widgetName} : ${errorMessage.join(\", \")}`;\n+        }\n+\n+        if (props.isModeler) {\n+            return \"\";\n+        }\n+","path":"src/utils/ContainerUtils.ts","position":58,"original_position":58,"commit_id":"512fb50d85e3c544ba2d74cf2c1a352d29f8ed7d","original_commit_id":"512fb50d85e3c544ba2d74cf2c1a352d29f8ed7d","user":{"login":"edwinmp","id":5672438,"avatar_url":"https://avatars2.githubusercontent.com/u/5672438?v=4","gravatar_id":"","url":"https://api.github.com/users/edwinmp","html_url":"https://github.com/edwinmp","followers_url":"https://api.github.com/users/edwinmp/followers","following_url":"https://api.github.com/users/edwinmp/following{/other_user}","gists_url":"https://api.github.com/users/edwinmp/gists{/gist_id}","starred_url":"https://api.github.com/users/edwinmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwinmp/subscriptions","organizations_url":"https://api.github.com/users/edwinmp/orgs","repos_url":"https://api.github.com/users/edwinmp/repos","events_url":"https://api.github.com/users/edwinmp/events{/privacy}","received_events_url":"https://api.github.com/users/edwinmp/received_events","type":"User","site_admin":false},"body":"And here","created_at":"2017-09-27T10:19:11Z","updated_at":"2017-09-27T10:20:00Z","html_url":"https://github.com/FlockOfBirds/checkbox-filter/pull/1#discussion_r141302252","pull_request_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/comments/141302252"},"html":{"href":"https://github.com/FlockOfBirds/checkbox-filter/pull/1#discussion_r141302252"},"pull_request":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1","id":143139267,"html_url":"https://github.com/FlockOfBirds/checkbox-filter/pull/1","diff_url":"https://github.com/FlockOfBirds/checkbox-filter/pull/1.diff","patch_url":"https://github.com/FlockOfBirds/checkbox-filter/pull/1.patch","issue_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/1","number":1,"state":"open","locked":false,"title":"Initial prototype","user":{"login":"djkwagala","id":5269284,"avatar_url":"https://avatars1.githubusercontent.com/u/5269284?v=4","gravatar_id":"","url":"https://api.github.com/users/djkwagala","html_url":"https://github.com/djkwagala","followers_url":"https://api.github.com/users/djkwagala/followers","following_url":"https://api.github.com/users/djkwagala/following{/other_user}","gists_url":"https://api.github.com/users/djkwagala/gists{/gist_id}","starred_url":"https://api.github.com/users/djkwagala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djkwagala/subscriptions","organizations_url":"https://api.github.com/users/djkwagala/orgs","repos_url":"https://api.github.com/users/djkwagala/repos","events_url":"https://api.github.com/users/djkwagala/events{/privacy}","received_events_url":"https://api.github.com/users/djkwagala/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-26T13:46:31Z","updated_at":"2017-09-27T10:20:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03409ee02ea79fe2ae726a3f28f17a05a655e485","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1/commits","review_comments_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1/comments","review_comment_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/1/comments","statuses_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/statuses/512fb50d85e3c544ba2d74cf2c1a352d29f8ed7d","head":{"label":"FlockOfBirds:feature/MVP","ref":"feature/MVP","sha":"512fb50d85e3c544ba2d74cf2c1a352d29f8ed7d","user":{"login":"FlockOfBirds","id":22542218,"avatar_url":"https://avatars2.githubusercontent.com/u/22542218?v=4","gravatar_id":"","url":"https://api.github.com/users/FlockOfBirds","html_url":"https://github.com/FlockOfBirds","followers_url":"https://api.github.com/users/FlockOfBirds/followers","following_url":"https://api.github.com/users/FlockOfBirds/following{/other_user}","gists_url":"https://api.github.com/users/FlockOfBirds/gists{/gist_id}","starred_url":"https://api.github.com/users/FlockOfBirds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlockOfBirds/subscriptions","organizations_url":"https://api.github.com/users/FlockOfBirds/orgs","repos_url":"https://api.github.com/users/FlockOfBirds/repos","events_url":"https://api.github.com/users/FlockOfBirds/events{/privacy}","received_events_url":"https://api.github.com/users/FlockOfBirds/received_events","type":"Organization","site_admin":false},"repo":{"id":103637092,"name":"checkbox-filter","full_name":"FlockOfBirds/checkbox-filter","owner":{"login":"FlockOfBirds","id":22542218,"avatar_url":"https://avatars2.githubusercontent.com/u/22542218?v=4","gravatar_id":"","url":"https://api.github.com/users/FlockOfBirds","html_url":"https://github.com/FlockOfBirds","followers_url":"https://api.github.com/users/FlockOfBirds/followers","following_url":"https://api.github.com/users/FlockOfBirds/following{/other_user}","gists_url":"https://api.github.com/users/FlockOfBirds/gists{/gist_id}","starred_url":"https://api.github.com/users/FlockOfBirds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlockOfBirds/subscriptions","organizations_url":"https://api.github.com/users/FlockOfBirds/orgs","repos_url":"https://api.github.com/users/FlockOfBirds/repos","events_url":"https://api.github.com/users/FlockOfBirds/events{/privacy}","received_events_url":"https://api.github.com/users/FlockOfBirds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FlockOfBirds/checkbox-filter","description":"Filter list views with a checkbox","fork":true,"url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter","forks_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/forks","keys_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/teams","hooks_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/hooks","issue_events_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/events{/number}","events_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/events","assignees_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/assignees{/user}","branches_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/branches{/branch}","tags_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/tags","blobs_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/refs{/sha}","trees_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/statuses/{sha}","languages_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/languages","stargazers_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/stargazers","contributors_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/contributors","subscribers_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/subscribers","subscription_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/subscription","commits_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/commits{/sha}","git_commits_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/commits{/sha}","comments_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/comments{/number}","issue_comment_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/comments{/number}","contents_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/contents/{+path}","compare_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/merges","archive_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/downloads","issues_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues{/number}","pulls_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls{/number}","milestones_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/milestones{/number}","notifications_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/labels{/name}","releases_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/releases{/id}","deployments_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/deployments","created_at":"2017-09-15T09:05:17Z","updated_at":"2017-09-15T09:05:11Z","pushed_at":"2017-09-26T14:40:22Z","git_url":"git://github.com/FlockOfBirds/checkbox-filter.git","ssh_url":"git@github.com:FlockOfBirds/checkbox-filter.git","clone_url":"https://github.com/FlockOfBirds/checkbox-filter.git","svn_url":"https://github.com/FlockOfBirds/checkbox-filter","homepage":null,"size":182,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"FlockOfBirds:master","ref":"master","sha":"1d8143af95887f41ab34b6c21f6ae9fbec378c23","user":{"login":"FlockOfBirds","id":22542218,"avatar_url":"https://avatars2.githubusercontent.com/u/22542218?v=4","gravatar_id":"","url":"https://api.github.com/users/FlockOfBirds","html_url":"https://github.com/FlockOfBirds","followers_url":"https://api.github.com/users/FlockOfBirds/followers","following_url":"https://api.github.com/users/FlockOfBirds/following{/other_user}","gists_url":"https://api.github.com/users/FlockOfBirds/gists{/gist_id}","starred_url":"https://api.github.com/users/FlockOfBirds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlockOfBirds/subscriptions","organizations_url":"https://api.github.com/users/FlockOfBirds/orgs","repos_url":"https://api.github.com/users/FlockOfBirds/repos","events_url":"https://api.github.com/users/FlockOfBirds/events{/privacy}","received_events_url":"https://api.github.com/users/FlockOfBirds/received_events","type":"Organization","site_admin":false},"repo":{"id":103637092,"name":"checkbox-filter","full_name":"FlockOfBirds/checkbox-filter","owner":{"login":"FlockOfBirds","id":22542218,"avatar_url":"https://avatars2.githubusercontent.com/u/22542218?v=4","gravatar_id":"","url":"https://api.github.com/users/FlockOfBirds","html_url":"https://github.com/FlockOfBirds","followers_url":"https://api.github.com/users/FlockOfBirds/followers","following_url":"https://api.github.com/users/FlockOfBirds/following{/other_user}","gists_url":"https://api.github.com/users/FlockOfBirds/gists{/gist_id}","starred_url":"https://api.github.com/users/FlockOfBirds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlockOfBirds/subscriptions","organizations_url":"https://api.github.com/users/FlockOfBirds/orgs","repos_url":"https://api.github.com/users/FlockOfBirds/repos","events_url":"https://api.github.com/users/FlockOfBirds/events{/privacy}","received_events_url":"https://api.github.com/users/FlockOfBirds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FlockOfBirds/checkbox-filter","description":"Filter list views with a checkbox","fork":true,"url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter","forks_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/forks","keys_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/teams","hooks_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/hooks","issue_events_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/events{/number}","events_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/events","assignees_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/assignees{/user}","branches_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/branches{/branch}","tags_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/tags","blobs_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/refs{/sha}","trees_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/statuses/{sha}","languages_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/languages","stargazers_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/stargazers","contributors_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/contributors","subscribers_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/subscribers","subscription_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/subscription","commits_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/commits{/sha}","git_commits_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/git/commits{/sha}","comments_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/comments{/number}","issue_comment_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/comments{/number}","contents_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/contents/{+path}","compare_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/merges","archive_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/downloads","issues_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues{/number}","pulls_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls{/number}","milestones_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/milestones{/number}","notifications_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/labels{/name}","releases_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/releases{/id}","deployments_url":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/deployments","created_at":"2017-09-15T09:05:17Z","updated_at":"2017-09-15T09:05:11Z","pushed_at":"2017-09-26T14:40:22Z","git_url":"git://github.com/FlockOfBirds/checkbox-filter.git","ssh_url":"git@github.com:FlockOfBirds/checkbox-filter.git","clone_url":"https://github.com/FlockOfBirds/checkbox-filter.git","svn_url":"https://github.com/FlockOfBirds/checkbox-filter","homepage":null,"size":182,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1"},"html":{"href":"https://github.com/FlockOfBirds/checkbox-filter/pull/1"},"issue":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/1"},"comments":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/FlockOfBirds/checkbox-filter/statuses/512fb50d85e3c544ba2d74cf2c1a352d29f8ed7d"}},"author_association":"NONE"}}
{"actor":{"display_login":"edwinmp"}}