{"action":"created","comment":{"url":"https://api.github.com/repos/entando/entando-cms/pulls/comments/324648171","pull_request_review_id":288589814,"id":324648171,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyNDY0ODE3MQ==","diff_hunk":"@@ -0,0 +1,109 @@\n+import { createSelector } from 'reselect';\n+import { get } from 'lodash';\n+import { getLocale } from 'state/locale/selectors';\n+\n+export const getCategories = state => state.categories;\n+export const getCategoriesIdList = state => state.categories.list;\n+export const getCategoriesMap = state => state.categories.map;\n+export const getChildrenMap = state => state.categories.childrenMap;\n+export const getStatusMap = state => state.categories.statusMap;\n+export const getTitlesMap = state => state.categories.titlesMap;\n+export const getSelected = state => get(state.categories, 'selected', {});\n+export const getSelectedRefs = state => get(state.categories, 'selected.references', {});\n+export const getReferenceKeyList = state => get(state.categories, 'selected.referenceKeyList', []);\n+export const getReferenceMap = state => get(state.categories, 'selected.referenceMap', {});\n+\n+const CATEGORY_STATUS_DEFAULTS = {\n+  expanded: false,\n+  loading: false,\n+  loaded: false,\n+};\n+\n+const getCategoriesOrder = (categoriesChildren) => {\n+  const fifo = ['home'];\n+  const sorted = [];\n+  while (fifo.length) {\n+    const curCategoryCode = fifo.pop();\n+    sorted.push(curCategoryCode);\n+    if (categoriesChildren[curCategoryCode]) {\n+      categoriesChildren[curCategoryCode]\n+        .slice()\n+        .reverse()\n+        .forEach((code) => {\n+          fifo.push(code);\n+        });\n+    }\n+  }\n+  return sorted;\n+};\n+\n+const isVisible = (categoryCode, categories, categoriesStatus) => {\n+  let curCategoryCode = categoryCode;\n+  if (categories[curCategoryCode]) {\n+    while (curCategoryCode !== 'home') {\n+      curCategoryCode = categories[curCategoryCode].parentCode;\n+      if (categoriesStatus[curCategoryCode] && !categoriesStatus[curCategoryCode].expanded) {\n+        return false;\n+      }\n+    }\n+    return true;\n+  }\n+  return false;\n+};\n+\n+const getDepth = (categories, categoryCode) => {\n+  let curCategoryCode = categoryCode;\n+  let depth = 0;\n+  if (categories[curCategoryCode]) {\n+    while (curCategoryCode !== 'home') {\n+      curCategoryCode = categories[curCategoryCode].parentCode;\n+      depth += 1;\n+    }\n+  }\n+  return depth;\n+};\n+\n+export const getCategoryTree = createSelector(\n+  [getCategoriesMap, getChildrenMap, getStatusMap, getTitlesMap, getLocale],\n+  // eslint-disable-next-line max-len\n+  (categories, categoryChildren, categoriesStatus, categoriesTitles, locale) => getCategoriesOrder(categoryChildren)\n+    .filter(categoryCode => isVisible(categoryCode, categories, categoriesStatus))\n+    .map(categoryCode => ({\n+      ...categories[categoryCode],\n+      ...CATEGORY_STATUS_DEFAULTS,\n+      ...categoriesStatus[categoryCode],\n+      depth: getDepth(categories, categoryCode),\n+      children: categoryChildren[categoryCode],\n+      isEmpty: !(categoryChildren[categoryCode] && categoryChildren[categoryCode].length),\n+      title: categoriesTitles[categoryCode][locale],\n+    })),\n+);\n+\n+export const getAllCategories = createSelector(\n+  [getCategoriesMap, getChildrenMap, getStatusMap, getTitlesMap, getLocale],\n+  // eslint-disable-next-line max-len\n+  (categories, categoryChildren, categoriesStatus) => getCategoriesOrder(categoryChildren).map(categoryCode => ({","path":"src/state/categories/selectors.js","position":85,"original_position":85,"commit_id":"86592683d2fe803613b53b757ad77fcd80870d8d","original_commit_id":"86592683d2fe803613b53b757ad77fcd80870d8d","user":{"login":"nicpuddu","id":28562595,"node_id":"MDQ6VXNlcjI4NTYyNTk1","avatar_url":"https://avatars2.githubusercontent.com/u/28562595?v=4","gravatar_id":"","url":"https://api.github.com/users/nicpuddu","html_url":"https://github.com/nicpuddu","followers_url":"https://api.github.com/users/nicpuddu/followers","following_url":"https://api.github.com/users/nicpuddu/following{/other_user}","gists_url":"https://api.github.com/users/nicpuddu/gists{/gist_id}","starred_url":"https://api.github.com/users/nicpuddu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicpuddu/subscriptions","organizations_url":"https://api.github.com/users/nicpuddu/orgs","repos_url":"https://api.github.com/users/nicpuddu/repos","events_url":"https://api.github.com/users/nicpuddu/events{/privacy}","received_events_url":"https://api.github.com/users/nicpuddu/received_events","type":"User","site_admin":false},"body":"same applies here","created_at":"2019-09-16T12:35:52Z","updated_at":"2019-09-16T12:43:32Z","html_url":"https://github.com/entando/entando-cms/pull/11#discussion_r324648171","pull_request_url":"https://api.github.com/repos/entando/entando-cms/pulls/11","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/entando/entando-cms/pulls/comments/324648171"},"html":{"href":"https://github.com/entando/entando-cms/pull/11#discussion_r324648171"},"pull_request":{"href":"https://api.github.com/repos/entando/entando-cms/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/entando/entando-cms/pulls/11","id":317691550,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE3NjkxNTUw","html_url":"https://github.com/entando/entando-cms/pull/11","diff_url":"https://github.com/entando/entando-cms/pull/11.diff","patch_url":"https://github.com/entando/entando-cms/pull/11.patch","issue_url":"https://api.github.com/repos/entando/entando-cms/issues/11","number":11,"state":"open","locked":false,"title":"En6-81 Create add new content creation support page","user":{"login":"ichalagashvili","id":54527977,"node_id":"MDQ6VXNlcjU0NTI3OTc3","avatar_url":"https://avatars2.githubusercontent.com/u/54527977?v=4","gravatar_id":"","url":"https://api.github.com/users/ichalagashvili","html_url":"https://github.com/ichalagashvili","followers_url":"https://api.github.com/users/ichalagashvili/followers","following_url":"https://api.github.com/users/ichalagashvili/following{/other_user}","gists_url":"https://api.github.com/users/ichalagashvili/gists{/gist_id}","starred_url":"https://api.github.com/users/ichalagashvili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichalagashvili/subscriptions","organizations_url":"https://api.github.com/users/ichalagashvili/orgs","repos_url":"https://api.github.com/users/ichalagashvili/repos","events_url":"https://api.github.com/users/ichalagashvili/events{/privacy}","received_events_url":"https://api.github.com/users/ichalagashvili/received_events","type":"User","site_admin":false},"body":"This PR contains code for Adding a new content. It's a outer frame for content creation. Consists of the field like: content type, content description, categories to join, groups to join, main owner group, versioning info and a sticky footer. This code should be merged with content attributes, once it's finished, then submitting a new content form should be finalized, currently it's just a mock function, because without content attributes user cannot add a new content. Just as in \"admin console\" , the URL locally for both Add/Edit is: `http://localhost:3000/cms/content/edit` .","created_at":"2019-09-16T01:43:02Z","updated_at":"2019-09-16T12:43:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85402901b667f4bbe6adee99b037a78147aadccc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/entando/entando-cms/pulls/11/commits","review_comments_url":"https://api.github.com/repos/entando/entando-cms/pulls/11/comments","review_comment_url":"https://api.github.com/repos/entando/entando-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/entando/entando-cms/issues/11/comments","statuses_url":"https://api.github.com/repos/entando/entando-cms/statuses/86592683d2fe803613b53b757ad77fcd80870d8d","head":{"label":"entando:EN6-81_add_content","ref":"EN6-81_add_content","sha":"86592683d2fe803613b53b757ad77fcd80870d8d","user":{"login":"entando","id":673103,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MzEwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/673103?v=4","gravatar_id":"","url":"https://api.github.com/users/entando","html_url":"https://github.com/entando","followers_url":"https://api.github.com/users/entando/followers","following_url":"https://api.github.com/users/entando/following{/other_user}","gists_url":"https://api.github.com/users/entando/gists{/gist_id}","starred_url":"https://api.github.com/users/entando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/entando/subscriptions","organizations_url":"https://api.github.com/users/entando/orgs","repos_url":"https://api.github.com/users/entando/repos","events_url":"https://api.github.com/users/entando/events{/privacy}","received_events_url":"https://api.github.com/users/entando/received_events","type":"Organization","site_admin":false},"repo":{"id":195347425,"node_id":"MDEwOlJlcG9zaXRvcnkxOTUzNDc0MjU=","name":"entando-cms","full_name":"entando/entando-cms","private":false,"owner":{"login":"entando","id":673103,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MzEwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/673103?v=4","gravatar_id":"","url":"https://api.github.com/users/entando","html_url":"https://github.com/entando","followers_url":"https://api.github.com/users/entando/followers","following_url":"https://api.github.com/users/entando/following{/other_user}","gists_url":"https://api.github.com/users/entando/gists{/gist_id}","starred_url":"https://api.github.com/users/entando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/entando/subscriptions","organizations_url":"https://api.github.com/users/entando/orgs","repos_url":"https://api.github.com/users/entando/repos","events_url":"https://api.github.com/users/entando/events{/privacy}","received_events_url":"https://api.github.com/users/entando/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/entando/entando-cms","description":"contains the app-builder cms app","fork":false,"url":"https://api.github.com/repos/entando/entando-cms","forks_url":"https://api.github.com/repos/entando/entando-cms/forks","keys_url":"https://api.github.com/repos/entando/entando-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/entando/entando-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/entando/entando-cms/teams","hooks_url":"https://api.github.com/repos/entando/entando-cms/hooks","issue_events_url":"https://api.github.com/repos/entando/entando-cms/issues/events{/number}","events_url":"https://api.github.com/repos/entando/entando-cms/events","assignees_url":"https://api.github.com/repos/entando/entando-cms/assignees{/user}","branches_url":"https://api.github.com/repos/entando/entando-cms/branches{/branch}","tags_url":"https://api.github.com/repos/entando/entando-cms/tags","blobs_url":"https://api.github.com/repos/entando/entando-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/entando/entando-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/entando/entando-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/entando/entando-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/entando/entando-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/entando/entando-cms/languages","stargazers_url":"https://api.github.com/repos/entando/entando-cms/stargazers","contributors_url":"https://api.github.com/repos/entando/entando-cms/contributors","subscribers_url":"https://api.github.com/repos/entando/entando-cms/subscribers","subscription_url":"https://api.github.com/repos/entando/entando-cms/subscription","commits_url":"https://api.github.com/repos/entando/entando-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/entando/entando-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/entando/entando-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/entando/entando-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/entando/entando-cms/contents/{+path}","compare_url":"https://api.github.com/repos/entando/entando-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/entando/entando-cms/merges","archive_url":"https://api.github.com/repos/entando/entando-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/entando/entando-cms/downloads","issues_url":"https://api.github.com/repos/entando/entando-cms/issues{/number}","pulls_url":"https://api.github.com/repos/entando/entando-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/entando/entando-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/entando/entando-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/entando/entando-cms/labels{/name}","releases_url":"https://api.github.com/repos/entando/entando-cms/releases{/id}","deployments_url":"https://api.github.com/repos/entando/entando-cms/deployments","created_at":"2019-07-05T05:58:02Z","updated_at":"2019-09-05T07:33:03Z","pushed_at":"2019-09-16T01:43:02Z","git_url":"git://github.com/entando/entando-cms.git","ssh_url":"git@github.com:entando/entando-cms.git","clone_url":"https://github.com/entando/entando-cms.git","svn_url":"https://github.com/entando/entando-cms","homepage":null,"size":423,"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,"disabled":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"entando:master","ref":"master","sha":"dd6a0a15237e800eb3e2e5be41f91629720a131b","user":{"login":"entando","id":673103,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MzEwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/673103?v=4","gravatar_id":"","url":"https://api.github.com/users/entando","html_url":"https://github.com/entando","followers_url":"https://api.github.com/users/entando/followers","following_url":"https://api.github.com/users/entando/following{/other_user}","gists_url":"https://api.github.com/users/entando/gists{/gist_id}","starred_url":"https://api.github.com/users/entando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/entando/subscriptions","organizations_url":"https://api.github.com/users/entando/orgs","repos_url":"https://api.github.com/users/entando/repos","events_url":"https://api.github.com/users/entando/events{/privacy}","received_events_url":"https://api.github.com/users/entando/received_events","type":"Organization","site_admin":false},"repo":{"id":195347425,"node_id":"MDEwOlJlcG9zaXRvcnkxOTUzNDc0MjU=","name":"entando-cms","full_name":"entando/entando-cms","private":false,"owner":{"login":"entando","id":673103,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MzEwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/673103?v=4","gravatar_id":"","url":"https://api.github.com/users/entando","html_url":"https://github.com/entando","followers_url":"https://api.github.com/users/entando/followers","following_url":"https://api.github.com/users/entando/following{/other_user}","gists_url":"https://api.github.com/users/entando/gists{/gist_id}","starred_url":"https://api.github.com/users/entando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/entando/subscriptions","organizations_url":"https://api.github.com/users/entando/orgs","repos_url":"https://api.github.com/users/entando/repos","events_url":"https://api.github.com/users/entando/events{/privacy}","received_events_url":"https://api.github.com/users/entando/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/entando/entando-cms","description":"contains the app-builder cms app","fork":false,"url":"https://api.github.com/repos/entando/entando-cms","forks_url":"https://api.github.com/repos/entando/entando-cms/forks","keys_url":"https://api.github.com/repos/entando/entando-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/entando/entando-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/entando/entando-cms/teams","hooks_url":"https://api.github.com/repos/entando/entando-cms/hooks","issue_events_url":"https://api.github.com/repos/entando/entando-cms/issues/events{/number}","events_url":"https://api.github.com/repos/entando/entando-cms/events","assignees_url":"https://api.github.com/repos/entando/entando-cms/assignees{/user}","branches_url":"https://api.github.com/repos/entando/entando-cms/branches{/branch}","tags_url":"https://api.github.com/repos/entando/entando-cms/tags","blobs_url":"https://api.github.com/repos/entando/entando-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/entando/entando-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/entando/entando-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/entando/entando-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/entando/entando-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/entando/entando-cms/languages","stargazers_url":"https://api.github.com/repos/entando/entando-cms/stargazers","contributors_url":"https://api.github.com/repos/entando/entando-cms/contributors","subscribers_url":"https://api.github.com/repos/entando/entando-cms/subscribers","subscription_url":"https://api.github.com/repos/entando/entando-cms/subscription","commits_url":"https://api.github.com/repos/entando/entando-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/entando/entando-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/entando/entando-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/entando/entando-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/entando/entando-cms/contents/{+path}","compare_url":"https://api.github.com/repos/entando/entando-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/entando/entando-cms/merges","archive_url":"https://api.github.com/repos/entando/entando-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/entando/entando-cms/downloads","issues_url":"https://api.github.com/repos/entando/entando-cms/issues{/number}","pulls_url":"https://api.github.com/repos/entando/entando-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/entando/entando-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/entando/entando-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/entando/entando-cms/labels{/name}","releases_url":"https://api.github.com/repos/entando/entando-cms/releases{/id}","deployments_url":"https://api.github.com/repos/entando/entando-cms/deployments","created_at":"2019-07-05T05:58:02Z","updated_at":"2019-09-05T07:33:03Z","pushed_at":"2019-09-16T01:43:02Z","git_url":"git://github.com/entando/entando-cms.git","ssh_url":"git@github.com:entando/entando-cms.git","clone_url":"https://github.com/entando/entando-cms.git","svn_url":"https://github.com/entando/entando-cms","homepage":null,"size":423,"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,"disabled":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/entando/entando-cms/pulls/11"},"html":{"href":"https://github.com/entando/entando-cms/pull/11"},"issue":{"href":"https://api.github.com/repos/entando/entando-cms/issues/11"},"comments":{"href":"https://api.github.com/repos/entando/entando-cms/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/entando/entando-cms/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/entando/entando-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/entando/entando-cms/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/entando/entando-cms/statuses/86592683d2fe803613b53b757ad77fcd80870d8d"}},"author_association":"NONE"}}
{"actor":{"display_login":"nicpuddu"}}