{"action":"created","comment":{"url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/comments/177349813","pull_request_review_id":107200675,"id":177349813,"diff_hunk":"@@ -0,0 +1,91 @@\n+// (C) 2007-2018 GoodData Corporation\n+import React, { Component } from 'react';\n+import { keyBy, mapValues } from 'lodash';\n+import { Kpi } from '@gooddata/react-components';\n+import { factory } from 'gooddata';\n+import '@gooddata/react-components/styles/css/main.css';\n+\n+import { totalSalesIdentifier, projectId } from '../utils/fixtures';\n+\n+export class MultipleDomainsExample extends Component {\n+    constructor() {\n+        super();\n+        this.state = {\n+            sdk2Config: { projectId: '', measureId: '' },\n+            sdk2LoginError: '',\n+            sdk2: false\n+        };\n+        this.setSdk2 = this.setSdk2.bind(this);\n+    }\n+\n+    setSdk2(e) {\n+        const formRef = e.target;\n+        const inputs = formRef.querySelectorAll('[name]');\n+        const inputsByName = keyBy(inputs, 'name');\n+        const formValues = mapValues(inputsByName, 'value');\n+\n+        const sdk2 = factory({ domain: formValues.domain });\n+        sdk2.user.login(formValues.sdk2Username, formValues.sdk2Password)\n+            .then(() => {\n+                this.setState({ sdk2LoginError: '' });\n+                this.setState({ sdk2, sdk2Config: formValues });\n+            }).catch((error) => {\n+                this.setState({ sdk2LoginError: error.toString() });\n+                console.log(error); // eslint-disable-line no-console\n+            });\n+\n+        e.preventDefault();\n+        return false;\n+    }\n+\n+    render() {\n+        return (\n+            <div>\n+                <h2>Default SDK:</h2>\n+                <Kpi\n+                    projectId={projectId}\n+                    measure={totalSalesIdentifier}\n+                />\n+\n+                <hr className=\"separator\" />\n+                <h2>Second SDK:</h2>\n+                <Kpi\n+                    projectId={this.state.sdk2Config.projectId}\n+                    measure={this.state.sdk2Config.measureId}\n+                    sdk={this.state.sdk2}\n+                />\n+\n+                <div className=\"alert\">{this.state.sdk2LoginError}</div>\n+\n+                <form action=\"?\" method=\"get\" onSubmit={this.setSdk2}>\n+                    <p><strong>Login to second SDK first:</strong></p>\n+                    Careful - cookies ignore port, you have to use different hostname to log in.<br />\n+\n+                    <table>\n+                        <tbody>\n+                            <tr><td>Domain: </td><td><input type=\"text\" name=\"domain\" /></td></tr>\n+                            <tr><td>Username: </td><td><input type=\"text\" name=\"sdk2Username\" /></td></tr>\n+                            <tr><td>Password: </td><td><input type=\"password\" name=\"sdk2Password\" /></td></tr>\n+                            <tr><td>KPI project id: </td><td><input type=\"text\" name=\"projectId\" /></td></tr>\n+                            <tr><td>KPI measure id: </td><td><input type=\"text\" name=\"measureId\" /></td></tr>","path":"examples/src/components/MultipleDomainsExample.jsx","position":70,"original_position":70,"commit_id":"d360f709d212c29b93983e31c31936ff1d2b62e7","original_commit_id":"d360f709d212c29b93983e31c31936ff1d2b62e7","user":{"login":"tomasreichmann","id":10447001,"avatar_url":"https://avatars0.githubusercontent.com/u/10447001?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasreichmann","html_url":"https://github.com/tomasreichmann","followers_url":"https://api.github.com/users/tomasreichmann/followers","following_url":"https://api.github.com/users/tomasreichmann/following{/other_user}","gists_url":"https://api.github.com/users/tomasreichmann/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasreichmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasreichmann/subscriptions","organizations_url":"https://api.github.com/users/tomasreichmann/orgs","repos_url":"https://api.github.com/users/tomasreichmann/repos","events_url":"https://api.github.com/users/tomasreichmann/events{/privacy}","received_events_url":"https://api.github.com/users/tomasreichmann/received_events","type":"User","site_admin":false},"body":"Consider adding default value to the inputs (giraffes)","created_at":"2018-03-27T08:45:42Z","updated_at":"2018-03-27T08:45:42Z","html_url":"https://github.com/gooddata/gooddata-react-components/pull/244#discussion_r177349813","pull_request_url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/comments/177349813"},"html":{"href":"https://github.com/gooddata/gooddata-react-components/pull/244#discussion_r177349813"},"pull_request":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244"}}},"pull_request":{"url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244","id":176851872,"html_url":"https://github.com/gooddata/gooddata-react-components/pull/244","diff_url":"https://github.com/gooddata/gooddata-react-components/pull/244.diff","patch_url":"https://github.com/gooddata/gooddata-react-components/pull/244.patch","issue_url":"https://api.github.com/repos/gooddata/gooddata-react-components/issues/244","number":244,"state":"open","locked":false,"title":"RELATED: RAIL-714 add hidden example for multiple domains","user":{"login":"zbycz","id":385047,"avatar_url":"https://avatars2.githubusercontent.com/u/385047?v=4","gravatar_id":"","url":"https://api.github.com/users/zbycz","html_url":"https://github.com/zbycz","followers_url":"https://api.github.com/users/zbycz/followers","following_url":"https://api.github.com/users/zbycz/following{/other_user}","gists_url":"https://api.github.com/users/zbycz/gists{/gist_id}","starred_url":"https://api.github.com/users/zbycz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbycz/subscriptions","organizations_url":"https://api.github.com/users/zbycz/orgs","repos_url":"https://api.github.com/users/zbycz/repos","events_url":"https://api.github.com/users/zbycz/events{/privacy}","received_events_url":"https://api.github.com/users/zbycz/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-22T17:21:07Z","updated_at":"2018-03-27T08:45:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd7e4a48fef64f2eb999cede04878eac603940c8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":600734146,"url":"https://api.github.com/repos/gooddata/gooddata-react-components/labels/do%20not%20merge","name":"do not merge","color":"e11d21","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244/commits","review_comments_url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244/comments","review_comment_url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gooddata/gooddata-react-components/issues/244/comments","statuses_url":"https://api.github.com/repos/gooddata/gooddata-react-components/statuses/d360f709d212c29b93983e31c31936ff1d2b62e7","head":{"label":"zbycz:pzb-714-multidomain-example","ref":"pzb-714-multidomain-example","sha":"d360f709d212c29b93983e31c31936ff1d2b62e7","user":{"login":"zbycz","id":385047,"avatar_url":"https://avatars2.githubusercontent.com/u/385047?v=4","gravatar_id":"","url":"https://api.github.com/users/zbycz","html_url":"https://github.com/zbycz","followers_url":"https://api.github.com/users/zbycz/followers","following_url":"https://api.github.com/users/zbycz/following{/other_user}","gists_url":"https://api.github.com/users/zbycz/gists{/gist_id}","starred_url":"https://api.github.com/users/zbycz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbycz/subscriptions","organizations_url":"https://api.github.com/users/zbycz/orgs","repos_url":"https://api.github.com/users/zbycz/repos","events_url":"https://api.github.com/users/zbycz/events{/privacy}","received_events_url":"https://api.github.com/users/zbycz/received_events","type":"User","site_admin":false},"repo":{"id":106822126,"name":"gooddata-react-components","full_name":"zbycz/gooddata-react-components","owner":{"login":"zbycz","id":385047,"avatar_url":"https://avatars2.githubusercontent.com/u/385047?v=4","gravatar_id":"","url":"https://api.github.com/users/zbycz","html_url":"https://github.com/zbycz","followers_url":"https://api.github.com/users/zbycz/followers","following_url":"https://api.github.com/users/zbycz/following{/other_user}","gists_url":"https://api.github.com/users/zbycz/gists{/gist_id}","starred_url":"https://api.github.com/users/zbycz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbycz/subscriptions","organizations_url":"https://api.github.com/users/zbycz/orgs","repos_url":"https://api.github.com/users/zbycz/repos","events_url":"https://api.github.com/users/zbycz/events{/privacy}","received_events_url":"https://api.github.com/users/zbycz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zbycz/gooddata-react-components","description":"GoodData React Components","fork":true,"url":"https://api.github.com/repos/zbycz/gooddata-react-components","forks_url":"https://api.github.com/repos/zbycz/gooddata-react-components/forks","keys_url":"https://api.github.com/repos/zbycz/gooddata-react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zbycz/gooddata-react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zbycz/gooddata-react-components/teams","hooks_url":"https://api.github.com/repos/zbycz/gooddata-react-components/hooks","issue_events_url":"https://api.github.com/repos/zbycz/gooddata-react-components/issues/events{/number}","events_url":"https://api.github.com/repos/zbycz/gooddata-react-components/events","assignees_url":"https://api.github.com/repos/zbycz/gooddata-react-components/assignees{/user}","branches_url":"https://api.github.com/repos/zbycz/gooddata-react-components/branches{/branch}","tags_url":"https://api.github.com/repos/zbycz/gooddata-react-components/tags","blobs_url":"https://api.github.com/repos/zbycz/gooddata-react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zbycz/gooddata-react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zbycz/gooddata-react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/zbycz/gooddata-react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zbycz/gooddata-react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/zbycz/gooddata-react-components/languages","stargazers_url":"https://api.github.com/repos/zbycz/gooddata-react-components/stargazers","contributors_url":"https://api.github.com/repos/zbycz/gooddata-react-components/contributors","subscribers_url":"https://api.github.com/repos/zbycz/gooddata-react-components/subscribers","subscription_url":"https://api.github.com/repos/zbycz/gooddata-react-components/subscription","commits_url":"https://api.github.com/repos/zbycz/gooddata-react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/zbycz/gooddata-react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/zbycz/gooddata-react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/zbycz/gooddata-react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/zbycz/gooddata-react-components/contents/{+path}","compare_url":"https://api.github.com/repos/zbycz/gooddata-react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zbycz/gooddata-react-components/merges","archive_url":"https://api.github.com/repos/zbycz/gooddata-react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zbycz/gooddata-react-components/downloads","issues_url":"https://api.github.com/repos/zbycz/gooddata-react-components/issues{/number}","pulls_url":"https://api.github.com/repos/zbycz/gooddata-react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/zbycz/gooddata-react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/zbycz/gooddata-react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zbycz/gooddata-react-components/labels{/name}","releases_url":"https://api.github.com/repos/zbycz/gooddata-react-components/releases{/id}","deployments_url":"https://api.github.com/repos/zbycz/gooddata-react-components/deployments","created_at":"2017-10-13T12:34:47Z","updated_at":"2017-10-13T12:34:50Z","pushed_at":"2018-03-26T17:01:49Z","git_url":"git://github.com/zbycz/gooddata-react-components.git","ssh_url":"git@github.com:zbycz/gooddata-react-components.git","clone_url":"https://github.com/zbycz/gooddata-react-components.git","svn_url":"https://github.com/zbycz/gooddata-react-components","homepage":"","size":3756,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gooddata:next-5.0.0","ref":"next-5.0.0","sha":"9b34c7df01970652ab62f6f6522972b76786e5bd","user":{"login":"gooddata","id":291394,"avatar_url":"https://avatars2.githubusercontent.com/u/291394?v=4","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"repo":{"id":90664084,"name":"gooddata-react-components","full_name":"gooddata/gooddata-react-components","owner":{"login":"gooddata","id":291394,"avatar_url":"https://avatars2.githubusercontent.com/u/291394?v=4","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gooddata/gooddata-react-components","description":"GoodData React Components","fork":false,"url":"https://api.github.com/repos/gooddata/gooddata-react-components","forks_url":"https://api.github.com/repos/gooddata/gooddata-react-components/forks","keys_url":"https://api.github.com/repos/gooddata/gooddata-react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gooddata/gooddata-react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gooddata/gooddata-react-components/teams","hooks_url":"https://api.github.com/repos/gooddata/gooddata-react-components/hooks","issue_events_url":"https://api.github.com/repos/gooddata/gooddata-react-components/issues/events{/number}","events_url":"https://api.github.com/repos/gooddata/gooddata-react-components/events","assignees_url":"https://api.github.com/repos/gooddata/gooddata-react-components/assignees{/user}","branches_url":"https://api.github.com/repos/gooddata/gooddata-react-components/branches{/branch}","tags_url":"https://api.github.com/repos/gooddata/gooddata-react-components/tags","blobs_url":"https://api.github.com/repos/gooddata/gooddata-react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gooddata/gooddata-react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gooddata/gooddata-react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/gooddata/gooddata-react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gooddata/gooddata-react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/gooddata/gooddata-react-components/languages","stargazers_url":"https://api.github.com/repos/gooddata/gooddata-react-components/stargazers","contributors_url":"https://api.github.com/repos/gooddata/gooddata-react-components/contributors","subscribers_url":"https://api.github.com/repos/gooddata/gooddata-react-components/subscribers","subscription_url":"https://api.github.com/repos/gooddata/gooddata-react-components/subscription","commits_url":"https://api.github.com/repos/gooddata/gooddata-react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/gooddata/gooddata-react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/gooddata/gooddata-react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/gooddata/gooddata-react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/gooddata/gooddata-react-components/contents/{+path}","compare_url":"https://api.github.com/repos/gooddata/gooddata-react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gooddata/gooddata-react-components/merges","archive_url":"https://api.github.com/repos/gooddata/gooddata-react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gooddata/gooddata-react-components/downloads","issues_url":"https://api.github.com/repos/gooddata/gooddata-react-components/issues{/number}","pulls_url":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/gooddata/gooddata-react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/gooddata/gooddata-react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gooddata/gooddata-react-components/labels{/name}","releases_url":"https://api.github.com/repos/gooddata/gooddata-react-components/releases{/id}","deployments_url":"https://api.github.com/repos/gooddata/gooddata-react-components/deployments","created_at":"2017-05-08T19:18:42Z","updated_at":"2018-03-19T00:14:12Z","pushed_at":"2018-03-26T17:01:50Z","git_url":"git://github.com/gooddata/gooddata-react-components.git","ssh_url":"git@github.com:gooddata/gooddata-react-components.git","clone_url":"https://github.com/gooddata/gooddata-react-components.git","svn_url":"https://github.com/gooddata/gooddata-react-components","homepage":"","size":3770,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":24,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244"},"html":{"href":"https://github.com/gooddata/gooddata-react-components/pull/244"},"issue":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/issues/244"},"comments":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/issues/244/comments"},"review_comments":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244/comments"},"review_comment":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/pulls/244/commits"},"statuses":{"href":"https://api.github.com/repos/gooddata/gooddata-react-components/statuses/d360f709d212c29b93983e31c31936ff1d2b62e7"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tomasreichmann"}}