const createDeployGroup = (deploys: List<DeployRecord>) => ( deploys.groupBy(deploy => ( createDeployGroupRecord({ status: deploy.status, build: deploy.build }) )) );
( [ codeDeploys, prodDeploys ]: [ List<DeployRecord>, List<DeployRecord> ], [ latestCodeDeploy, oldestProdDeploy ]: [ DeployRecord, DeployRecord ], commits: List<GitHubCommit> ): VirtualDOM.VNode => { const isInSync = oldestProdDeploy.build === latestCodeDeploy.build; return h('.row#root', {}, [ h('h1', [ `Status: ${isInSync ? 'in sync. Ship it!' : 'out of sync.'}` ]), h('hr', {}, []), exp(commits.size > 0) && h('.col', [ h('h1', [ 'Difference (', h('span', { title: 'Oldest PROD deploy' }, `${oldestProdDeploy.build}`), '...', h('span', { title: 'Latest CODE deploy' }, `${latestCodeDeploy.build}`), ')' ]), ih('ul', {}, ( commits .groupBy(commit => commit.authorLogin) .map(commits => headOption(commits.toArray()).map(commit => commit.authorName).getOrElse(() => '')) .map(commitAuthorName => ( h('li', [ h('h2', commitAuthorName) ]) )) .toList() )) ]), h('.col', [ h('h1', 'CODE'), renderGroupDeployListNode(codeDeploys) ]), h('.col', [ h('h1', 'PROD'), renderGroupDeployListNode(prodDeploys) ]) ]) }