{"action":"created","comment":{"url":"https://api.github.com/repos/agrc/electrofishing/pulls/comments/193749074","pull_request_review_id":126783214,"id":193749074,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzc0OTA3NA==","diff_hunk":"@@ -483,6 +505,68 @@ define([\n \n                 return lang.mixin(this.transects[key], obj);\n             }.bind(this));\n+        },\n+        showValidation(width) {\n+            // summary:\n+            //      shows validation messages\n+            console.info('app/habitat/Habitat:showValidation', arguments);\n+\n+            const validation = this._validateWidth(width);\n+\n+            domClass.remove(this.validateMsg, 'alert-info alert-danger');\n+            domClass.add(this.validateMsg, 'hidden');\n+\n+            let type = 'danger';\n+            if (validation.result) {\n+                type = 'info';\n+            }\n+\n+            if (validation.message) {\n+                domClass.add(this.validateMsg, `alert alert-${type}`);\n+                domClass.remove(this.validateMsg, 'hidden');\n+                this.validateMsg.innerHTML = validation.message;\n+            } else {\n+                domClass.add(this.validateMsg, 'hidden');\n+            }\n+        },\n+        _validateWidth(wettedWidth) {\n+            // summary:\n+            //      vlidation function\n+            // boolean\n+            console.info('app/habitat/Habitat:_validateWidth', arguments);\n+\n+            if (!wettedWidth) {\n+                let message = null;\n+\n+                const hasStartDistances = this.store.data.some(row => {\n+                    return row[FN.transectMeasurements.DISTANCE_START];\n+                });\n+\n+                if (hasStartDistances) {\n+                    message = 'Wetted Width does not have a value. Remember that the ' +\n+                             'distance from starting bank needs to be less than the wetted width.';\n+                }\n+\n+                return {\n+                    result: true,\n+                    message: message\n+                };\n+            }\n+\n+            const isValid = this.store.data.every(row => {\n+                const start = row[FN.transectMeasurements.DISTANCE_START];\n+\n+                return !isNaN(start) && start < wettedWidth;\n+            });\n+\n+            let message = isValid ?\n+                null :\n+                'The distance from the starting bank cannot be greater than the wetted width.';","path":"_src/app/habitat/Habitat.js","position":133,"original_position":133,"commit_id":"2e681a24ad8fa2143a26aac092abf38f442aa236","original_commit_id":"2e681a24ad8fa2143a26aac092abf38f442aa236","user":{"login":"stdavis","id":1326248,"node_id":"MDQ6VXNlcjEzMjYyNDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1326248?v=4","gravatar_id":"","url":"https://api.github.com/users/stdavis","html_url":"https://github.com/stdavis","followers_url":"https://api.github.com/users/stdavis/followers","following_url":"https://api.github.com/users/stdavis/following{/other_user}","gists_url":"https://api.github.com/users/stdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/stdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stdavis/subscriptions","organizations_url":"https://api.github.com/users/stdavis/orgs","repos_url":"https://api.github.com/users/stdavis/repos","events_url":"https://api.github.com/users/stdavis/events{/privacy}","received_events_url":"https://api.github.com/users/stdavis/received_events","type":"User","site_admin":false},"body":"Might want to change this to \"greater than _or equal to_\".","created_at":"2018-06-07T13:37:49Z","updated_at":"2018-06-07T13:46:50Z","html_url":"https://github.com/agrc/electrofishing/pull/162#discussion_r193749074","pull_request_url":"https://api.github.com/repos/agrc/electrofishing/pulls/162","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/agrc/electrofishing/pulls/comments/193749074"},"html":{"href":"https://github.com/agrc/electrofishing/pull/162#discussion_r193749074"},"pull_request":{"href":"https://api.github.com/repos/agrc/electrofishing/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/agrc/electrofishing/pulls/162","id":193081647,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMDgxNjQ3","html_url":"https://github.com/agrc/electrofishing/pull/162","diff_url":"https://github.com/agrc/electrofishing/pull/162.diff","patch_url":"https://github.com/agrc/electrofishing/pull/162.patch","issue_url":"https://api.github.com/repos/agrc/electrofishing/issues/162","number":162,"state":"open","locked":false,"title":"Wetted restricts distance from","user":{"login":"steveoh","id":325813,"node_id":"MDQ6VXNlcjMyNTgxMw==","avatar_url":"https://avatars0.githubusercontent.com/u/325813?v=4","gravatar_id":"","url":"https://api.github.com/users/steveoh","html_url":"https://github.com/steveoh","followers_url":"https://api.github.com/users/steveoh/followers","following_url":"https://api.github.com/users/steveoh/following{/other_user}","gists_url":"https://api.github.com/users/steveoh/gists{/gist_id}","starred_url":"https://api.github.com/users/steveoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveoh/subscriptions","organizations_url":"https://api.github.com/users/steveoh/orgs","repos_url":"https://api.github.com/users/steveoh/repos","events_url":"https://api.github.com/users/steveoh/events{/privacy}","received_events_url":"https://api.github.com/users/steveoh/received_events","type":"User","site_admin":false},"body":"This assumes that the wetted width > distance from start\r\n\r\nWarnings are shown when wetted width is empty. \r\nErrors are shown when wetted width <= distance from start\r\n\r\nThis is not included in the submission report checks. That will be a part of #69 \r\n\r\ncloses #146 \r\n","created_at":"2018-06-06T17:08:28Z","updated_at":"2018-06-07T13:46:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3146425b78ea23dee4a91bea136f88cd8392e2d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/agrc/electrofishing/pulls/162/commits","review_comments_url":"https://api.github.com/repos/agrc/electrofishing/pulls/162/comments","review_comment_url":"https://api.github.com/repos/agrc/electrofishing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agrc/electrofishing/issues/162/comments","statuses_url":"https://api.github.com/repos/agrc/electrofishing/statuses/2e681a24ad8fa2143a26aac092abf38f442aa236","head":{"label":"agrc:wetted-restricts-distance-from","ref":"wetted-restricts-distance-from","sha":"2e681a24ad8fa2143a26aac092abf38f442aa236","user":{"login":"agrc","id":709415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcwOTQxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/709415?v=4","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"repo":{"id":59032969,"node_id":"MDEwOlJlcG9zaXRvcnk1OTAzMjk2OQ==","name":"electrofishing","full_name":"agrc/electrofishing","owner":{"login":"agrc","id":709415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcwOTQxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/709415?v=4","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agrc/electrofishing","description":"Application for recording electrofishing surveys. Built for DWR.","fork":false,"url":"https://api.github.com/repos/agrc/electrofishing","forks_url":"https://api.github.com/repos/agrc/electrofishing/forks","keys_url":"https://api.github.com/repos/agrc/electrofishing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agrc/electrofishing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agrc/electrofishing/teams","hooks_url":"https://api.github.com/repos/agrc/electrofishing/hooks","issue_events_url":"https://api.github.com/repos/agrc/electrofishing/issues/events{/number}","events_url":"https://api.github.com/repos/agrc/electrofishing/events","assignees_url":"https://api.github.com/repos/agrc/electrofishing/assignees{/user}","branches_url":"https://api.github.com/repos/agrc/electrofishing/branches{/branch}","tags_url":"https://api.github.com/repos/agrc/electrofishing/tags","blobs_url":"https://api.github.com/repos/agrc/electrofishing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agrc/electrofishing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agrc/electrofishing/git/refs{/sha}","trees_url":"https://api.github.com/repos/agrc/electrofishing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agrc/electrofishing/statuses/{sha}","languages_url":"https://api.github.com/repos/agrc/electrofishing/languages","stargazers_url":"https://api.github.com/repos/agrc/electrofishing/stargazers","contributors_url":"https://api.github.com/repos/agrc/electrofishing/contributors","subscribers_url":"https://api.github.com/repos/agrc/electrofishing/subscribers","subscription_url":"https://api.github.com/repos/agrc/electrofishing/subscription","commits_url":"https://api.github.com/repos/agrc/electrofishing/commits{/sha}","git_commits_url":"https://api.github.com/repos/agrc/electrofishing/git/commits{/sha}","comments_url":"https://api.github.com/repos/agrc/electrofishing/comments{/number}","issue_comment_url":"https://api.github.com/repos/agrc/electrofishing/issues/comments{/number}","contents_url":"https://api.github.com/repos/agrc/electrofishing/contents/{+path}","compare_url":"https://api.github.com/repos/agrc/electrofishing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agrc/electrofishing/merges","archive_url":"https://api.github.com/repos/agrc/electrofishing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agrc/electrofishing/downloads","issues_url":"https://api.github.com/repos/agrc/electrofishing/issues{/number}","pulls_url":"https://api.github.com/repos/agrc/electrofishing/pulls{/number}","milestones_url":"https://api.github.com/repos/agrc/electrofishing/milestones{/number}","notifications_url":"https://api.github.com/repos/agrc/electrofishing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agrc/electrofishing/labels{/name}","releases_url":"https://api.github.com/repos/agrc/electrofishing/releases{/id}","deployments_url":"https://api.github.com/repos/agrc/electrofishing/deployments","created_at":"2016-05-17T15:07:20Z","updated_at":"2018-06-05T21:16:51Z","pushed_at":"2018-06-06T17:08:28Z","git_url":"git://github.com/agrc/electrofishing.git","ssh_url":"git@github.com:agrc/electrofishing.git","clone_url":"https://github.com/agrc/electrofishing.git","svn_url":"https://github.com/agrc/electrofishing","homepage":null,"size":21453,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":25,"watchers":0,"default_branch":"master"}},"base":{"label":"agrc:master","ref":"master","sha":"09d2ccd7b502872c645bca65ef85dbd8a363953b","user":{"login":"agrc","id":709415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcwOTQxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/709415?v=4","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"repo":{"id":59032969,"node_id":"MDEwOlJlcG9zaXRvcnk1OTAzMjk2OQ==","name":"electrofishing","full_name":"agrc/electrofishing","owner":{"login":"agrc","id":709415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcwOTQxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/709415?v=4","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agrc/electrofishing","description":"Application for recording electrofishing surveys. Built for DWR.","fork":false,"url":"https://api.github.com/repos/agrc/electrofishing","forks_url":"https://api.github.com/repos/agrc/electrofishing/forks","keys_url":"https://api.github.com/repos/agrc/electrofishing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agrc/electrofishing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agrc/electrofishing/teams","hooks_url":"https://api.github.com/repos/agrc/electrofishing/hooks","issue_events_url":"https://api.github.com/repos/agrc/electrofishing/issues/events{/number}","events_url":"https://api.github.com/repos/agrc/electrofishing/events","assignees_url":"https://api.github.com/repos/agrc/electrofishing/assignees{/user}","branches_url":"https://api.github.com/repos/agrc/electrofishing/branches{/branch}","tags_url":"https://api.github.com/repos/agrc/electrofishing/tags","blobs_url":"https://api.github.com/repos/agrc/electrofishing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agrc/electrofishing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agrc/electrofishing/git/refs{/sha}","trees_url":"https://api.github.com/repos/agrc/electrofishing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agrc/electrofishing/statuses/{sha}","languages_url":"https://api.github.com/repos/agrc/electrofishing/languages","stargazers_url":"https://api.github.com/repos/agrc/electrofishing/stargazers","contributors_url":"https://api.github.com/repos/agrc/electrofishing/contributors","subscribers_url":"https://api.github.com/repos/agrc/electrofishing/subscribers","subscription_url":"https://api.github.com/repos/agrc/electrofishing/subscription","commits_url":"https://api.github.com/repos/agrc/electrofishing/commits{/sha}","git_commits_url":"https://api.github.com/repos/agrc/electrofishing/git/commits{/sha}","comments_url":"https://api.github.com/repos/agrc/electrofishing/comments{/number}","issue_comment_url":"https://api.github.com/repos/agrc/electrofishing/issues/comments{/number}","contents_url":"https://api.github.com/repos/agrc/electrofishing/contents/{+path}","compare_url":"https://api.github.com/repos/agrc/electrofishing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agrc/electrofishing/merges","archive_url":"https://api.github.com/repos/agrc/electrofishing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agrc/electrofishing/downloads","issues_url":"https://api.github.com/repos/agrc/electrofishing/issues{/number}","pulls_url":"https://api.github.com/repos/agrc/electrofishing/pulls{/number}","milestones_url":"https://api.github.com/repos/agrc/electrofishing/milestones{/number}","notifications_url":"https://api.github.com/repos/agrc/electrofishing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agrc/electrofishing/labels{/name}","releases_url":"https://api.github.com/repos/agrc/electrofishing/releases{/id}","deployments_url":"https://api.github.com/repos/agrc/electrofishing/deployments","created_at":"2016-05-17T15:07:20Z","updated_at":"2018-06-05T21:16:51Z","pushed_at":"2018-06-06T17:08:28Z","git_url":"git://github.com/agrc/electrofishing.git","ssh_url":"git@github.com:agrc/electrofishing.git","clone_url":"https://github.com/agrc/electrofishing.git","svn_url":"https://github.com/agrc/electrofishing","homepage":null,"size":21453,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":25,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/agrc/electrofishing/pulls/162"},"html":{"href":"https://github.com/agrc/electrofishing/pull/162"},"issue":{"href":"https://api.github.com/repos/agrc/electrofishing/issues/162"},"comments":{"href":"https://api.github.com/repos/agrc/electrofishing/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/agrc/electrofishing/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/agrc/electrofishing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agrc/electrofishing/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/agrc/electrofishing/statuses/2e681a24ad8fa2143a26aac092abf38f442aa236"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"stdavis"}}