{"action":"created","comment":{"url":"https://api.github.com/repos/betagouv/competences-pro/pulls/comments/242522419","pull_request_review_id":186049741,"id":242522419,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjUyMjQxOQ==","diff_hunk":"@@ -0,0 +1,34 @@\n+import pluralize from 'pluralize';\n+import '../styles/contenu.scss';\n+\n+export class VueContenu {\n+  constructor (pointInsertion) {\n+    this.element = document.createElement('div');\n+    this.element.id = 'contenu';\n+    pointInsertion.appendChild(this.element);\n+    this.element.classList.add('contenu');\n+    this.element.classList.add('invisible');\n+    const vue = this;\n+    this.element.addEventListener('click', function (event) {\n+      vue.element.classList.add('invisible');\n+      event.stopPropagation();\n+    });\n+  }\n+\n+  estVisible () {\n+    return !this.element.classList.contains('invisible');\n+  }\n+\n+  affiche (contenant) {\n+    this.element.innerHTML = `\n+      <div class=\"etiquette\">\n+        <label class=\"type\" id=\"nom\">${contenant.nom}</label>\n+        <div class=\"quantite\">\n+          <label id=\"quantite\">${contenant.quantite}</label>\n+          <label id=\"unite\">${pluralize('litre', contenant.quantite)}</label>","path":"src/vues/contenu.js","position":28,"original_position":28,"commit_id":"23962f1cc188c51f3068bec7a8c3fc2156f3f387","original_commit_id":"14b6ea6e6adcf30304da8aae22c9f2bf4f0615c9","user":{"login":"egaillot","id":105624,"node_id":"MDQ6VXNlcjEwNTYyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/105624?v=4","gravatar_id":"","url":"https://api.github.com/users/egaillot","html_url":"https://github.com/egaillot","followers_url":"https://api.github.com/users/egaillot/followers","following_url":"https://api.github.com/users/egaillot/following{/other_user}","gists_url":"https://api.github.com/users/egaillot/gists{/gist_id}","starred_url":"https://api.github.com/users/egaillot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egaillot/subscriptions","organizations_url":"https://api.github.com/users/egaillot/orgs","repos_url":"https://api.github.com/users/egaillot/repos","events_url":"https://api.github.com/users/egaillot/events{/privacy}","received_events_url":"https://api.github.com/users/egaillot/received_events","type":"User","site_admin":false},"body":"Ok faisons comme ça.","created_at":"2018-12-18T12:45:47Z","updated_at":"2018-12-18T12:45:48Z","html_url":"https://github.com/betagouv/competences-pro/pull/11#discussion_r242522419","pull_request_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/11","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/comments/242522419"},"html":{"href":"https://github.com/betagouv/competences-pro/pull/11#discussion_r242522419"},"pull_request":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/11"}},"in_reply_to_id":242316908},"pull_request":{"url":"https://api.github.com/repos/betagouv/competences-pro/pulls/11","id":237391242,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MzkxMjQy","html_url":"https://github.com/betagouv/competences-pro/pull/11","diff_url":"https://github.com/betagouv/competences-pro/pull/11.diff","patch_url":"https://github.com/betagouv/competences-pro/pull/11.patch","issue_url":"https://api.github.com/repos/betagouv/competences-pro/issues/11","number":11,"state":"open","locked":false,"title":"Afficher le contenu d'un contenant sur une étiquette","user":{"login":"etienneCharignon","id":298214,"node_id":"MDQ6VXNlcjI5ODIxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/298214?v=4","gravatar_id":"","url":"https://api.github.com/users/etienneCharignon","html_url":"https://github.com/etienneCharignon","followers_url":"https://api.github.com/users/etienneCharignon/followers","following_url":"https://api.github.com/users/etienneCharignon/following{/other_user}","gists_url":"https://api.github.com/users/etienneCharignon/gists{/gist_id}","starred_url":"https://api.github.com/users/etienneCharignon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etienneCharignon/subscriptions","organizations_url":"https://api.github.com/users/etienneCharignon/orgs","repos_url":"https://api.github.com/users/etienneCharignon/repos","events_url":"https://api.github.com/users/etienneCharignon/events{/privacy}","received_events_url":"https://api.github.com/users/etienneCharignon/received_events","type":"User","site_admin":false},"body":"Cette PR participe à la résolution de l'issue #5 \r\n\r\nCette PR rends possible de cliquer sur n'importe quel contenant du stock pour afficher son contenu sur une étiquette. \r\n\r\nL'étiquette s'affiche au centre de l'écran.\r\n\r\nCette PR introduit la notion de \"vue contenu\". Une vue unique, réactualisé en fonction du contenu que l'on désire afficher au moment de l'affichage.\r\n\r\nCette PR contient une généralisation d'un pattern pour les vues. \r\nToutes les vues, `VueStock`, `VueContenant` et `VueContenu` :   \r\n* proposent une fonction `init()` permettant de créer le point d'ancrage de la vue (la div principale de la vue), \r\n* proposent une fonction de la forme `afficheXXX()` ou simplement une fonction `affiche()`.\r\n\r\nQuand un contenu est affiché, il faut cliquer n'importe où pour le refermer avant de pouvoir afficher un autre contenu.\r\n\r\nLa responsabilité de coordonner les événements d'ouverture et de fermeture de contenant est localisée entièrement dans la vue stock. ","created_at":"2018-12-10T16:50:16Z","updated_at":"2018-12-18T12:45:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"658ffffb82fe83efd5070505e2aa5187e193cf5d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/11/commits","review_comments_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/11/comments","review_comment_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/betagouv/competences-pro/issues/11/comments","statuses_url":"https://api.github.com/repos/betagouv/competences-pro/statuses/23962f1cc188c51f3068bec7a8c3fc2156f3f387","head":{"label":"betagouv:afficher-contenants","ref":"afficher-contenants","sha":"23962f1cc188c51f3068bec7a8c3fc2156f3f387","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":136347369,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYzNDczNjk=","name":"competences-pro","full_name":"betagouv/competences-pro","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/competences-pro","description":"Évaluer en ligne les compétences pro à travers des mises en situation","fork":false,"url":"https://api.github.com/repos/betagouv/competences-pro","forks_url":"https://api.github.com/repos/betagouv/competences-pro/forks","keys_url":"https://api.github.com/repos/betagouv/competences-pro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/competences-pro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/competences-pro/teams","hooks_url":"https://api.github.com/repos/betagouv/competences-pro/hooks","issue_events_url":"https://api.github.com/repos/betagouv/competences-pro/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/competences-pro/events","assignees_url":"https://api.github.com/repos/betagouv/competences-pro/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/competences-pro/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/competences-pro/tags","blobs_url":"https://api.github.com/repos/betagouv/competences-pro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/competences-pro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/competences-pro/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/competences-pro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/competences-pro/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/competences-pro/languages","stargazers_url":"https://api.github.com/repos/betagouv/competences-pro/stargazers","contributors_url":"https://api.github.com/repos/betagouv/competences-pro/contributors","subscribers_url":"https://api.github.com/repos/betagouv/competences-pro/subscribers","subscription_url":"https://api.github.com/repos/betagouv/competences-pro/subscription","commits_url":"https://api.github.com/repos/betagouv/competences-pro/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/competences-pro/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/competences-pro/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/competences-pro/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/competences-pro/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/competences-pro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/competences-pro/merges","archive_url":"https://api.github.com/repos/betagouv/competences-pro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/competences-pro/downloads","issues_url":"https://api.github.com/repos/betagouv/competences-pro/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/competences-pro/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/competences-pro/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/competences-pro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/competences-pro/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/competences-pro/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/competences-pro/deployments","created_at":"2018-06-06T15:18:28Z","updated_at":"2018-12-14T14:11:04Z","pushed_at":"2018-12-18T12:11:57Z","git_url":"git://github.com/betagouv/competences-pro.git","ssh_url":"git@github.com:betagouv/competences-pro.git","clone_url":"https://github.com/betagouv/competences-pro.git","svn_url":"https://github.com/betagouv/competences-pro","homepage":"http://51.75.207.76/","size":303,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"betagouv:master","ref":"master","sha":"17a5030ac2236a36aafa36853e34a6b84547c706","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":136347369,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYzNDczNjk=","name":"competences-pro","full_name":"betagouv/competences-pro","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/competences-pro","description":"Évaluer en ligne les compétences pro à travers des mises en situation","fork":false,"url":"https://api.github.com/repos/betagouv/competences-pro","forks_url":"https://api.github.com/repos/betagouv/competences-pro/forks","keys_url":"https://api.github.com/repos/betagouv/competences-pro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/competences-pro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/competences-pro/teams","hooks_url":"https://api.github.com/repos/betagouv/competences-pro/hooks","issue_events_url":"https://api.github.com/repos/betagouv/competences-pro/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/competences-pro/events","assignees_url":"https://api.github.com/repos/betagouv/competences-pro/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/competences-pro/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/competences-pro/tags","blobs_url":"https://api.github.com/repos/betagouv/competences-pro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/competences-pro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/competences-pro/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/competences-pro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/competences-pro/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/competences-pro/languages","stargazers_url":"https://api.github.com/repos/betagouv/competences-pro/stargazers","contributors_url":"https://api.github.com/repos/betagouv/competences-pro/contributors","subscribers_url":"https://api.github.com/repos/betagouv/competences-pro/subscribers","subscription_url":"https://api.github.com/repos/betagouv/competences-pro/subscription","commits_url":"https://api.github.com/repos/betagouv/competences-pro/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/competences-pro/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/competences-pro/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/competences-pro/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/competences-pro/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/competences-pro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/competences-pro/merges","archive_url":"https://api.github.com/repos/betagouv/competences-pro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/competences-pro/downloads","issues_url":"https://api.github.com/repos/betagouv/competences-pro/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/competences-pro/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/competences-pro/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/competences-pro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/competences-pro/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/competences-pro/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/competences-pro/deployments","created_at":"2018-06-06T15:18:28Z","updated_at":"2018-12-14T14:11:04Z","pushed_at":"2018-12-18T12:11:57Z","git_url":"git://github.com/betagouv/competences-pro.git","ssh_url":"git@github.com:betagouv/competences-pro.git","clone_url":"https://github.com/betagouv/competences-pro.git","svn_url":"https://github.com/betagouv/competences-pro","homepage":"http://51.75.207.76/","size":303,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/11"},"html":{"href":"https://github.com/betagouv/competences-pro/pull/11"},"issue":{"href":"https://api.github.com/repos/betagouv/competences-pro/issues/11"},"comments":{"href":"https://api.github.com/repos/betagouv/competences-pro/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/betagouv/competences-pro/statuses/23962f1cc188c51f3068bec7a8c3fc2156f3f387"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"egaillot"}}