{"action":"created","comment":{"url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/comments/323161745","pull_request_review_id":286682818,"id":323161745,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyMzE2MTc0NQ==","diff_hunk":"@@ -0,0 +1,64 @@\n+import React from 'react';\n+import { MessageDescriptor } from 'react-intl';\n+import buttonMessages from '../../../utils/button-messages';\n+import ModalPage from '../internals/modal-page';\n+import ModalPageHeader from '../internals/modal-page-header';\n+import { ContentWrapper } from '../internals/modal-page.styles';\n+import { Spacings } from '@commercetools-frontend/ui-kit';\n+import {\n+  FormPrimaryButton,\n+  FormSecondaryButton,\n+  FormDeleteButton,\n+} from '../../../utils/default-form-buttons';\n+\n+type Label = string | MessageDescriptor;\n+type Props = {\n+  level?: number;\n+  title: string;\n+  isOpen: boolean;\n+  onClose?: (event: React.SyntheticEvent) => void;\n+  children: React.ReactNode;\n+  zIndex?: number;\n+  baseZIndex?: number;\n+  getParentSelector?: () => HTMLElement;\n+  shouldDelayOnClose?: boolean;\n+  // TopBar Props\n+  topBarCurrentPathLabel?: string;\n+  topBarPreviousPathLabel?: Label;\n+  // Header Props\n+  subtitle?: string | React.ReactElement;\n+  // Controls Props\n+  controls: React.ReactNode;\n+  hideControls?: boolean;\n+};\n+\n+const CustomFormModalPage = (props: Props) => (\n+  <ModalPage\n+    level={props.level}\n+    title={props.title}\n+    isOpen={props.isOpen}\n+    zIndex={props.zIndex}\n+    onClose={props.onClose}\n+    baseZIndex={props.baseZIndex}\n+    currentPathLabel={props.topBarCurrentPathLabel || props.title}\n+    previousPathLabel={props.topBarPreviousPathLabel}\n+    getParentSelector={props.getParentSelector}\n+    shouldDelayOnClose={props.shouldDelayOnClose}\n+  >\n+    <ModalPageHeader title={props.title} subtitle={props.subtitle}>\n+      {!props.hideControls && props.controls && (\n+        <Spacings.Inline alignItems=\"flex-end\">","path":"packages/application-components/src/components/modal-pages/custom-form-modal-page/custom-form-modal-page.tsx","position":50,"original_position":50,"commit_id":"7afc55276197f4646270454836a3845e3cf7055c","original_commit_id":"7afc55276197f4646270454836a3845e3cf7055c","user":{"login":"emmenko","id":1110551,"node_id":"MDQ6VXNlcjExMTA1NTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1110551?v=4","gravatar_id":"","url":"https://api.github.com/users/emmenko","html_url":"https://github.com/emmenko","followers_url":"https://api.github.com/users/emmenko/followers","following_url":"https://api.github.com/users/emmenko/following{/other_user}","gists_url":"https://api.github.com/users/emmenko/gists{/gist_id}","starred_url":"https://api.github.com/users/emmenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emmenko/subscriptions","organizations_url":"https://api.github.com/users/emmenko/orgs","repos_url":"https://api.github.com/users/emmenko/repos","events_url":"https://api.github.com/users/emmenko/events{/privacy}","received_events_url":"https://api.github.com/users/emmenko/received_events","type":"User","site_admin":false},"body":"I'm not sure if we should leave this to the consumer 🤔","created_at":"2019-09-11T10:09:50Z","updated_at":"2019-09-11T10:11:06Z","html_url":"https://github.com/commercetools/merchant-center-application-kit/pull/1008#discussion_r323161745","pull_request_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/comments/323161745"},"html":{"href":"https://github.com/commercetools/merchant-center-application-kit/pull/1008#discussion_r323161745"},"pull_request":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008"}}},"pull_request":{"url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008","id":311460740,"node_id":"MDExOlB1bGxSZXF1ZXN0MzExNDYwNzQw","html_url":"https://github.com/commercetools/merchant-center-application-kit/pull/1008","diff_url":"https://github.com/commercetools/merchant-center-application-kit/pull/1008.diff","patch_url":"https://github.com/commercetools/merchant-center-application-kit/pull/1008.patch","issue_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/1008","number":1008,"state":"open","locked":false,"title":"Rework Form Modal Pages","user":{"login":"jonnybel","id":2941328,"node_id":"MDQ6VXNlcjI5NDEzMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/2941328?v=4","gravatar_id":"","url":"https://api.github.com/users/jonnybel","html_url":"https://github.com/jonnybel","followers_url":"https://api.github.com/users/jonnybel/followers","following_url":"https://api.github.com/users/jonnybel/following{/other_user}","gists_url":"https://api.github.com/users/jonnybel/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnybel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnybel/subscriptions","organizations_url":"https://api.github.com/users/jonnybel/orgs","repos_url":"https://api.github.com/users/jonnybel/repos","events_url":"https://api.github.com/users/jonnybel/events{/privacy}","received_events_url":"https://api.github.com/users/jonnybel/received_events","type":"User","site_admin":false},"body":"#### Summary\r\n\r\nFollowing the discussion from [here](https://github.com/commercetools/merchant-center-frontend/pull/7424#discussion_r314775129), this PR addresses those suggestions.\r\n\r\nThis is still WIP, but let's use this PR to discuss if we're happy with this proposed new approach. \r\n\r\n#### Description\r\n\r\nBecause this is WIP, please focus on the `FormModalPage` and `CustomFormModalPage`, and the `default-form-buttons.tsx` (which I'm still not sure where to place), and let me know if you would prefer an alternative to any of the following key points:\r\n* New component `CustomFormModalPage`, which doesn't expect any default controls but exposes some pre-made control buttons: Confirm, Cancel, and Delete, to ease its use for the most common cases which still require dynamic controls.\r\n* The `controls` prop is an array of React elements.\r\n* `FormModalPage`, which uses `CustomFormModalPage`under the hood, is a simpler version of the latter with all the defaults set (and the possibility to still hide the controls in case of need).\r\n* New prop `hideControls`, which simply acts as a switch that does what it says regardless of anything else (no conditional props).\r\n* I haven't changed much of `TabularModalPage` yet, but I'm thinking of keeping it flexible, with no default controls, but we can discuss if we also want a simpler version with defaults.","created_at":"2019-08-27T16:10:50Z","updated_at":"2019-09-11T10:11:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2de9f45e7955cad6a965f1edf923b9ffd34cbd34","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1083802556,"node_id":"MDU6TGFiZWwxMDgzODAyNTU2","url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/labels/%F0%9F%8F%95%20Type:%20Technical%20Exploration","name":"🏕 Type: Technical Exploration","color":"d876e3","default":false},{"id":1084713639,"node_id":"MDU6TGFiZWwxMDg0NzEzNjM5","url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/labels/%F0%9F%92%A5%20Type:%20Breaking%20Change","name":"💥 Type: Breaking Change","color":"222222","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008/commits","review_comments_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008/comments","review_comment_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/1008/comments","statuses_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/statuses/7afc55276197f4646270454836a3845e3cf7055c","head":{"label":"commercetools:ja-rework-form-modal-page","ref":"ja-rework-form-modal-page","sha":"7afc55276197f4646270454836a3845e3cf7055c","user":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":152089521,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIwODk1MjE=","name":"merchant-center-application-kit","full_name":"commercetools/merchant-center-application-kit","private":false,"owner":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercetools/merchant-center-application-kit","description":"Tools and components for developing Merchant Center Applications 🛠","fork":false,"url":"https://api.github.com/repos/commercetools/merchant-center-application-kit","forks_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/forks","keys_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/teams","hooks_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/hooks","issue_events_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/events","assignees_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/tags","blobs_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/languages","stargazers_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/stargazers","contributors_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/contributors","subscribers_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/subscribers","subscription_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/subscription","commits_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/merges","archive_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/downloads","issues_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/deployments","created_at":"2018-10-08T14:01:18Z","updated_at":"2019-09-11T09:41:25Z","pushed_at":"2019-09-11T09:55:00Z","git_url":"git://github.com/commercetools/merchant-center-application-kit.git","ssh_url":"git@github.com:commercetools/merchant-center-application-kit.git","clone_url":"https://github.com/commercetools/merchant-center-application-kit.git","svn_url":"https://github.com/commercetools/merchant-center-application-kit","homepage":"","size":145273,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":24,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":24,"watchers":24,"default_branch":"master"}},"base":{"label":"commercetools:master","ref":"master","sha":"eac9bc640f18602ae5bab5bdda4e857e3e76ea1b","user":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":152089521,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIwODk1MjE=","name":"merchant-center-application-kit","full_name":"commercetools/merchant-center-application-kit","private":false,"owner":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercetools/merchant-center-application-kit","description":"Tools and components for developing Merchant Center Applications 🛠","fork":false,"url":"https://api.github.com/repos/commercetools/merchant-center-application-kit","forks_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/forks","keys_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/teams","hooks_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/hooks","issue_events_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/events","assignees_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/tags","blobs_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/languages","stargazers_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/stargazers","contributors_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/contributors","subscribers_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/subscribers","subscription_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/subscription","commits_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/merges","archive_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/downloads","issues_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/merchant-center-application-kit/deployments","created_at":"2018-10-08T14:01:18Z","updated_at":"2019-09-11T09:41:25Z","pushed_at":"2019-09-11T09:55:00Z","git_url":"git://github.com/commercetools/merchant-center-application-kit.git","ssh_url":"git@github.com:commercetools/merchant-center-application-kit.git","clone_url":"https://github.com/commercetools/merchant-center-application-kit.git","svn_url":"https://github.com/commercetools/merchant-center-application-kit","homepage":"","size":145273,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":24,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":24,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008"},"html":{"href":"https://github.com/commercetools/merchant-center-application-kit/pull/1008"},"issue":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/1008"},"comments":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/issues/1008/comments"},"review_comments":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008/comments"},"review_comment":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/pulls/1008/commits"},"statuses":{"href":"https://api.github.com/repos/commercetools/merchant-center-application-kit/statuses/7afc55276197f4646270454836a3845e3cf7055c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"emmenko"}}