{"action":"created","comment":{"url":"https://api.github.com/repos/betagouv/pop/pulls/comments/285989268","pull_request_review_id":239999360,"id":285989268,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NTk4OTI2OA==","diff_hunk":"@@ -0,0 +1,164 @@\n+import { bucket_url } from \"./config\";\n+\n+/*\n+On a du faire cette fonction \"utils.getInformations\" pour gérer les principales informations des notices dissiminées dans l'app et qui nécessitait du traitement \"fastidieux\"\n+*/\n+\n+export function getInformations(notice) {\n+  const base = notice.BASE;\n+  switch (base) {\n+    case \"Collections des musées de France (Joconde)\": {\n+      let title = \"\";\n+      if (notice.TITR) {\n+        title = notice.TITR;\n+      } else if ((notice.DENO || []).length) {\n+        title = notice.DENO.join(\", \");\n+      } else {\n+        title = (notice.DOMN || []).join(\", \");\n+      }\n+      title = capitalizeFirstLetter(title);\n+\n+      const subtitle = !notice.TITR && notice.DENO ? \"\" : notice.DENO.join(\", \");\n+\n+      let metadescription = \"\";\n+      if (notice.REPR) {\n+        metadescription = notice.REPR;\n+      }\n+\n+      const image = getImageUrl(notice);\n+      return { title, subtitle, metadescription, image };\n+    }\n+    case \"Photographies (Mémoire)\": {\n+      let title = notice.TICO || notice.LEG || `${notice.EDIF || \"\"} ${notice.OBJ || \"\"}`.trim();\n+      title = capitalizeFirstLetter(title);\n+\n+      let logo = \"\";\n+      if (notice.PRODUCTEUR === \"CRMH\") {\n+        logo = \"/static/mh.png\";\n+      } else if (notice.PRODUCTEUR === \"SAP\") {\n+        logo = \"/static/map.png\";\n+      }\n+\n+      const subtitle = notice.TECH;\n+\n+      let metadescription = \"\";\n+      if (notice.LEG) {\n+        metadescription = notice.LEG;\n+      }\n+\n+      const image = getImageUrl(notice);\n+      return { title, subtitle, metadescription, logo, image };\n+    }\n+    case \"Musées de france (MUSEO)\": {\n+      let title = notice.NOMOFF || notice.NOMANC || notice.NOMUSAGE;\n+      title = capitalizeFirstLetter(title);\n+\n+      let metadescription = \"\";\n+\n+      const image = getImageUrl(notice);\n+      return { title, metadescription, image };\n+    }\n+    case \"Enluminures (Enluminures)\": {\n+      let title = `${notice.TITR} - ${notice.SUJET}`;\n+      title = capitalizeFirstLetter(title);\n+\n+      const subtitle = notice.SUJET;\n+\n+      let metadescription = \"\";\n+\n+      const image = getImageUrl(notice);\n+      return { title, subtitle, metadescription, image };\n+    }\n+    case \"Récupération artistique (MNR Rose-Valland)\": {\n+      let title = notice.TICO || notice.TITR;\n+      title = capitalizeFirstLetter(title);\n+\n+      const subtitle = notice.DENO ? notice.DENO.join(\", \") : \"\";\n+\n+      let metadescription = \"\";\n+\n+      const image = getImageUrl(notice);\n+      return { title, subtitle, metadescription, image };\n+    }\n+    case \"Patrimoine mobilier (Palissy)\": {\n+      let title = notice.TICO || notice.TITR;\n+      title = capitalizeFirstLetter(title);\n+\n+      let logo = \"\";\n+      if (notice.PRODUCTEUR === \"Inventaire\") {\n+        logo = \"/static/inventaire.jpg\";\n+      } else if (notice.PRODUCTEUR === \"Monuments Historiques\") {\n+        logo = \"/static/mh.png\";\n+      }\n+\n+      let metadescription = \"\";\n+\n+      const subtitle = notice.DENO ? notice.DENO.join(\", \") : \"\";\n+\n+      const image = getImageUrl(notice);\n+      return { title, subtitle, metadescription, logo, image };\n+    }\n+    case \"Patrimoine architectural (Mérimée)\": {\n+      let title = notice.TICO || notice.TITR;\n+      title = capitalizeFirstLetter(title);\n+\n+      let logo = \"\";\n+      if (notice.PRODUCTEUR === \"Inventaire\") {\n+        logo = \"/static/inventaire.jpg\";\n+      } else if (notice.PRODUCTEUR === \"Monuments Historiques\") {\n+        logo = \"/static/mh.png\";\n+      }\n+\n+      const subtitle = notice.DENO ? notice.DENO.join(\", \") : \"\";\n+\n+      let metadescription = \"\";\n+      /*\n+          const titre = this.props.notice.TICO || this.props.notice.TITR || \"\";\n+    const datation = this.props.notice.SCLE ? this.props.notice.SCLE.join(\" \") : \"\";\n+    if (this.props.notice.DENO && this.props.notice.DENO.length === 1) {\n+      const category = this.props.notice.DENO[0];\n+      if (category.toLowerCase() === \"église\") {\n+        return `Découvrez ${titre}, cette ${category} du ${datation}.`;\n+      }\n+    }\n+    return `Découvrez ${titre}, du ${datation}.`;\n+    */","path":"apps/diffusion/src/utils.js","position":125,"original_position":125,"commit_id":"d32c22a3fe782709dcc5ace8b4b44312ae1cf79e","original_commit_id":"d32c22a3fe782709dcc5ace8b4b44312ae1cf79e","user":{"login":"goffle","id":28667787,"node_id":"MDQ6VXNlcjI4NjY3Nzg3","avatar_url":"https://avatars1.githubusercontent.com/u/28667787?v=4","gravatar_id":"","url":"https://api.github.com/users/goffle","html_url":"https://github.com/goffle","followers_url":"https://api.github.com/users/goffle/followers","following_url":"https://api.github.com/users/goffle/following{/other_user}","gists_url":"https://api.github.com/users/goffle/gists{/gist_id}","starred_url":"https://api.github.com/users/goffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goffle/subscriptions","organizations_url":"https://api.github.com/users/goffle/orgs","repos_url":"https://api.github.com/users/goffle/repos","events_url":"https://api.github.com/users/goffle/events{/privacy}","received_events_url":"https://api.github.com/users/goffle/received_events","type":"User","site_admin":false},"body":"en fait j'ai ca a bosser","created_at":"2019-05-21T12:06:02Z","updated_at":"2019-05-21T12:06:02Z","html_url":"https://github.com/betagouv/pop/pull/301#discussion_r285989268","pull_request_url":"https://api.github.com/repos/betagouv/pop/pulls/301","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/betagouv/pop/pulls/comments/285989268"},"html":{"href":"https://github.com/betagouv/pop/pull/301#discussion_r285989268"},"pull_request":{"href":"https://api.github.com/repos/betagouv/pop/pulls/301"}},"in_reply_to_id":285983701},"pull_request":{"url":"https://api.github.com/repos/betagouv/pop/pulls/301","id":280449197,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgwNDQ5MTk3","html_url":"https://github.com/betagouv/pop/pull/301","diff_url":"https://github.com/betagouv/pop/pull/301.diff","patch_url":"https://github.com/betagouv/pop/pull/301.patch","issue_url":"https://api.github.com/repos/betagouv/pop/issues/301","number":301,"state":"open","locked":false,"title":"Title harmonisation","user":{"login":"goffle","id":28667787,"node_id":"MDQ6VXNlcjI4NjY3Nzg3","avatar_url":"https://avatars1.githubusercontent.com/u/28667787?v=4","gravatar_id":"","url":"https://api.github.com/users/goffle","html_url":"https://github.com/goffle","followers_url":"https://api.github.com/users/goffle/followers","following_url":"https://api.github.com/users/goffle/following{/other_user}","gists_url":"https://api.github.com/users/goffle/gists{/gist_id}","starred_url":"https://api.github.com/users/goffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goffle/subscriptions","organizations_url":"https://api.github.com/users/goffle/orgs","repos_url":"https://api.github.com/users/goffle/repos","events_url":"https://api.github.com/users/goffle/events{/privacy}","received_events_url":"https://api.github.com/users/goffle/received_events","type":"User","site_admin":false},"body":"Premiere salve !\r\n\r\n\r\n","created_at":"2019-05-20T15:51:20Z","updated_at":"2019-05-21T12:06:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08c3c0b30af37d54ff9a5f9bc751a964baf113c8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/betagouv/pop/pulls/301/commits","review_comments_url":"https://api.github.com/repos/betagouv/pop/pulls/301/comments","review_comment_url":"https://api.github.com/repos/betagouv/pop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/betagouv/pop/issues/301/comments","statuses_url":"https://api.github.com/repos/betagouv/pop/statuses/d32c22a3fe782709dcc5ace8b4b44312ae1cf79e","head":{"label":"betagouv:titleHarmonisation","ref":"titleHarmonisation","sha":"d32c22a3fe782709dcc5ace8b4b44312ae1cf79e","user":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"repo":{"id":164409197,"node_id":"MDEwOlJlcG9zaXRvcnkxNjQ0MDkxOTc=","name":"pop","full_name":"betagouv/pop","private":false,"owner":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/betagouv/pop","description":"Plateforme Ouverte du Patrimoine","fork":false,"url":"https://api.github.com/repos/betagouv/pop","forks_url":"https://api.github.com/repos/betagouv/pop/forks","keys_url":"https://api.github.com/repos/betagouv/pop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/pop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/pop/teams","hooks_url":"https://api.github.com/repos/betagouv/pop/hooks","issue_events_url":"https://api.github.com/repos/betagouv/pop/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/pop/events","assignees_url":"https://api.github.com/repos/betagouv/pop/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/pop/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/pop/tags","blobs_url":"https://api.github.com/repos/betagouv/pop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/pop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/pop/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/pop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/pop/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/pop/languages","stargazers_url":"https://api.github.com/repos/betagouv/pop/stargazers","contributors_url":"https://api.github.com/repos/betagouv/pop/contributors","subscribers_url":"https://api.github.com/repos/betagouv/pop/subscribers","subscription_url":"https://api.github.com/repos/betagouv/pop/subscription","commits_url":"https://api.github.com/repos/betagouv/pop/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/pop/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/pop/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/pop/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/pop/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/pop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/pop/merges","archive_url":"https://api.github.com/repos/betagouv/pop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/pop/downloads","issues_url":"https://api.github.com/repos/betagouv/pop/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/pop/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/pop/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/pop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/pop/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/pop/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/pop/deployments","created_at":"2019-01-07T09:31:05Z","updated_at":"2019-05-21T12:04:11Z","pushed_at":"2019-05-21T12:04:12Z","git_url":"git://github.com/betagouv/pop.git","ssh_url":"git@github.com:betagouv/pop.git","clone_url":"https://github.com/betagouv/pop.git","svn_url":"https://github.com/betagouv/pop","homepage":"https://pop.culture.gouv.fr/","size":42091,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":5,"watchers":4,"default_branch":"master"}},"base":{"label":"betagouv:master","ref":"master","sha":"2dc4a782bc3dfd7d88789f8215cb8b21d8bb6b02","user":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"repo":{"id":164409197,"node_id":"MDEwOlJlcG9zaXRvcnkxNjQ0MDkxOTc=","name":"pop","full_name":"betagouv/pop","private":false,"owner":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/betagouv/pop","description":"Plateforme Ouverte du Patrimoine","fork":false,"url":"https://api.github.com/repos/betagouv/pop","forks_url":"https://api.github.com/repos/betagouv/pop/forks","keys_url":"https://api.github.com/repos/betagouv/pop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/pop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/pop/teams","hooks_url":"https://api.github.com/repos/betagouv/pop/hooks","issue_events_url":"https://api.github.com/repos/betagouv/pop/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/pop/events","assignees_url":"https://api.github.com/repos/betagouv/pop/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/pop/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/pop/tags","blobs_url":"https://api.github.com/repos/betagouv/pop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/pop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/pop/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/pop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/pop/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/pop/languages","stargazers_url":"https://api.github.com/repos/betagouv/pop/stargazers","contributors_url":"https://api.github.com/repos/betagouv/pop/contributors","subscribers_url":"https://api.github.com/repos/betagouv/pop/subscribers","subscription_url":"https://api.github.com/repos/betagouv/pop/subscription","commits_url":"https://api.github.com/repos/betagouv/pop/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/pop/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/pop/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/pop/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/pop/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/pop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/pop/merges","archive_url":"https://api.github.com/repos/betagouv/pop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/pop/downloads","issues_url":"https://api.github.com/repos/betagouv/pop/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/pop/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/pop/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/pop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/pop/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/pop/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/pop/deployments","created_at":"2019-01-07T09:31:05Z","updated_at":"2019-05-21T12:04:11Z","pushed_at":"2019-05-21T12:04:12Z","git_url":"git://github.com/betagouv/pop.git","ssh_url":"git@github.com:betagouv/pop.git","clone_url":"https://github.com/betagouv/pop.git","svn_url":"https://github.com/betagouv/pop","homepage":"https://pop.culture.gouv.fr/","size":42091,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/betagouv/pop/pulls/301"},"html":{"href":"https://github.com/betagouv/pop/pull/301"},"issue":{"href":"https://api.github.com/repos/betagouv/pop/issues/301"},"comments":{"href":"https://api.github.com/repos/betagouv/pop/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/betagouv/pop/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/betagouv/pop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/betagouv/pop/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/betagouv/pop/statuses/d32c22a3fe782709dcc5ace8b4b44312ae1cf79e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"goffle"}}