{"action":"created","issue":{"url":"https://api.github.com/repos/numenta/nupic.research/issues/548","repository_url":"https://api.github.com/repos/numenta/nupic.research","labels_url":"https://api.github.com/repos/numenta/nupic.research/issues/548/labels{/name}","comments_url":"https://api.github.com/repos/numenta/nupic.research/issues/548/comments","events_url":"https://api.github.com/repos/numenta/nupic.research/issues/548/events","html_url":"https://github.com/numenta/nupic.research/pull/548","id":154331529,"number":548,"title":"DO NOT MERGE - Demo dialog open","user":{"login":"brev","id":208140,"avatar_url":"https://avatars.githubusercontent.com/u/208140?v=3","gravatar_id":"","url":"https://api.github.com/users/brev","html_url":"https://github.com/brev","followers_url":"https://api.github.com/users/brev/followers","following_url":"https://api.github.com/users/brev/following{/other_user}","gists_url":"https://api.github.com/users/brev/gists{/gist_id}","starred_url":"https://api.github.com/users/brev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brev/subscriptions","organizations_url":"https://api.github.com/users/brev/orgs","repos_url":"https://api.github.com/users/brev/repos","events_url":"https://api.github.com/users/brev/events{/privacy}","received_events_url":"https://api.github.com/users/brev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-11T20:09:01Z","updated_at":"2016-05-12T16:06:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numenta/nupic.research/pulls/548","html_url":"https://github.com/numenta/nupic.research/pull/548","diff_url":"https://github.com/numenta/nupic.research/pull/548.diff","patch_url":"https://github.com/numenta/nupic.research/pull/548.patch"},"body":"Hi @BoltzmannBrain sorry for the delay.\r\nQuick working example of a Dialog popup, below.\r\nYou had all the right React/Flux ideas, it can just be a pain to tie them together initially.\r\n\r\n### Code Changes\r\n \r\n1. Created `stores/dialog.js`, a store to hold Dialog state (open/closed, title, body text, action buttons, etc). This store watches for `DIALOG_OPEN` and `DIALOG_CLOSED` actions to make changes to itself.\r\n1. Updated main `browser/app.js` to get access to new Store\r\n1. Created `actions/dialog-open.js` and `actions/dialog-close.js`, which can be called to fire off `DIALOG_OPEN` and `DIALOG_CLOSED`, which will affect the new Store.\r\n1. Created new MUI React Dialog `components/dialog.jsx`, and set it up to watch for changes on the new Store.  Clicking the default \"Close\" button at bottom of the Dialog popup will fire `actions/dialog-close.js`.\r\n1. Inject the new Dialog component (open or closed) into the app via `components/main.jsx`.\r\n1. Change the `components/search-results.jsx` component, adding a click handler on each table row. Click will prep the data for display, and fire `actions/dialog-open.js`.\r\n\r\n### Click path\r\n\r\n1. Click on Table row, `actions/dialog-open` is called, firing `DIALOG_OPEN` with data.\r\n1. New Store catches the Open event, and fills itself with new state/data.\r\n1. Store change triggers observing components to re-render: Results and new Dialog components.\r\n1. Dialog re-renders as Open and Filled with data, based on Store state.\r\n1. Click \"Done\" on Dialog, and `actions/dialog-close` is called, firing `DIALOG_CLOSE`.\r\n1. New Store catches the Close event......   rinse and repeat!\r\n\r\nThere's also a few random changes I didn't really mean to save for you (README updates, alphabetizations, code style tweak, etc.) Feel free to use or ignore. :)\r\n\r\nI think that's it, please let me know of any questions.\r\nthanks"},"comment":{"url":"https://api.github.com/repos/numenta/nupic.research/issues/comments/218805317","html_url":"https://github.com/numenta/nupic.research/pull/548#issuecomment-218805317","issue_url":"https://api.github.com/repos/numenta/nupic.research/issues/548","id":218805317,"user":{"login":"brev","id":208140,"avatar_url":"https://avatars.githubusercontent.com/u/208140?v=3","gravatar_id":"","url":"https://api.github.com/users/brev","html_url":"https://github.com/brev","followers_url":"https://api.github.com/users/brev/followers","following_url":"https://api.github.com/users/brev/following{/other_user}","gists_url":"https://api.github.com/users/brev/gists{/gist_id}","starred_url":"https://api.github.com/users/brev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brev/subscriptions","organizations_url":"https://api.github.com/users/brev/orgs","repos_url":"https://api.github.com/users/brev/repos","events_url":"https://api.github.com/users/brev/events{/privacy}","received_events_url":"https://api.github.com/users/brev/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T16:06:48Z","updated_at":"2016-05-12T16:06:48Z","body":"@BoltzmannBrain please do! thanks"}}