{"action":"created","comment":{"url":"https://api.github.com/repos/betagouv/competences-pro/pulls/comments/236571911","pull_request_review_id":178662610,"id":236571911,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjU3MTkxMQ==","diff_hunk":"@@ -0,0 +1,50 @@\n+class VueMagasin {\n+\n+  constructor(topologie) {\n+    this.topologie = topologie;\n+  }\n+\n+  afficheMagasin (etageresId, { stock: stock }) {\n+    const vue = this;\n+\n+    let existingContenantList = document.getElementById('contenants');\n+    if(existingContenantList) {\n+      existingContenantList.remove();\n+    }\n+\n+    const etageresImages = document.getElementById(etageresId);\n+    const contenantsElements = document.createElement('div');\n+    contenantsElements.id = \"contenants\"\n+    etageresImages.parentElement.appendChild(contenantsElements);\n+\n+    const etageres = this.topologie.etageres;\n+    const contenants = this.topologie.contenants;\n+\n+    stock.contenants.forEach(function(contenant) {\n+      const left = contenant.posX / 100.0 * etageresImages.width;\n+      const top = contenant.posY / 100.0  * etageresImages.height;\n+      const width = contenants[contenant.type][contenant.sousType].largeur / 100 * etageresImages.width;\n+      const height = contenants[contenant.type][contenant.sousType].hauteur / 100 * etageresImages.height;\n+\n+      let contenantElement = document.createElement(\"div\");\n+      contenantElement.classList.add(\"contenant\");\n+\n+      contenantElement.style.left = left + 'px';\n+      contenantElement.style.top = top + 'px';\n+      contenantElement.style.height = height + 'px';\n+      contenantElement.style.width = width + 'px';\n+      contenantElement.addEventListener('click', function () {\n+        vue.ouvreContenant(contenant);\n+      });\n+      contenantsElements.appendChild(contenantElement);\n+    });\n+  }\n+\n+  ouvreContenant (contenant) {\n+    alert('Contient ' + contenant.quantite + ' ' + (contenant.type === 'ContenantVrac' ? 'litres' : 'bouteilles') + ' ' + 'de ' + contenant.nom);\n+  };","path":"src/vues/magasin.js","position":45,"original_position":45,"commit_id":"38f674dcb293b4c139227d5c90be02bdf0dccfab","original_commit_id":"38f674dcb293b4c139227d5c90be02bdf0dccfab","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":"Je trouve dommage que ce soit la vue qui produise ce message… Il me semblerait plus intéressant que ce soit une classe modèle `Contenant` qui s'en charge, et qu'on appelle `contenant.description()`.","created_at":"2018-11-27T09:06:53Z","updated_at":"2018-11-27T09:15:00Z","html_url":"https://github.com/betagouv/competences-pro/pull/7#discussion_r236571911","pull_request_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/7","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/comments/236571911"},"html":{"href":"https://github.com/betagouv/competences-pro/pull/7#discussion_r236571911"},"pull_request":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/betagouv/competences-pro/pulls/7","id":233718297,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNzE4Mjk3","html_url":"https://github.com/betagouv/competences-pro/pull/7","diff_url":"https://github.com/betagouv/competences-pro/pull/7.diff","patch_url":"https://github.com/betagouv/competences-pro/pull/7.patch","issue_url":"https://api.github.com/repos/betagouv/competences-pro/issues/7","number":7,"state":"open","locked":false,"title":"Afficher contenants","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\nLes contenants sont cliquables, une alerte s'affiche.","created_at":"2018-11-26T22:30:30Z","updated_at":"2018-11-27T09:15:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6a707b780bac4aaf8eafa3d26419751131e8a99","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/7/commits","review_comments_url":"https://api.github.com/repos/betagouv/competences-pro/pulls/7/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/7/comments","statuses_url":"https://api.github.com/repos/betagouv/competences-pro/statuses/38f674dcb293b4c139227d5c90be02bdf0dccfab","head":{"label":"betagouv:afficher-contenants","ref":"afficher-contenants","sha":"38f674dcb293b4c139227d5c90be02bdf0dccfab","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-11-23T09:22:22Z","pushed_at":"2018-11-26T22:30:30Z","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":"","size":232,"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":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"betagouv:master","ref":"master","sha":"621ec9cb50e869c9a689a0483299d0f95fe9b4cf","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-11-23T09:22:22Z","pushed_at":"2018-11-26T22:30:30Z","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":"","size":232,"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":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/7"},"html":{"href":"https://github.com/betagouv/competences-pro/pull/7"},"issue":{"href":"https://api.github.com/repos/betagouv/competences-pro/issues/7"},"comments":{"href":"https://api.github.com/repos/betagouv/competences-pro/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/betagouv/competences-pro/pulls/7/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/7/commits"},"statuses":{"href":"https://api.github.com/repos/betagouv/competences-pro/statuses/38f674dcb293b4c139227d5c90be02bdf0dccfab"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"egaillot"}}