{"action":"created","issue":{"url":"https://api.github.com/repos/Contiamo/operational-ui/issues/319","repository_url":"https://api.github.com/repos/Contiamo/operational-ui","labels_url":"https://api.github.com/repos/Contiamo/operational-ui/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/Contiamo/operational-ui/issues/319/comments","events_url":"https://api.github.com/repos/Contiamo/operational-ui/issues/319/events","html_url":"https://github.com/Contiamo/operational-ui/issues/319","id":299724827,"number":319,"title":"Select component improvements","user":{"login":"peterszerzo","id":6738398,"avatar_url":"https://avatars1.githubusercontent.com/u/6738398?v=4","gravatar_id":"","url":"https://api.github.com/users/peterszerzo","html_url":"https://github.com/peterszerzo","followers_url":"https://api.github.com/users/peterszerzo/followers","following_url":"https://api.github.com/users/peterszerzo/following{/other_user}","gists_url":"https://api.github.com/users/peterszerzo/gists{/gist_id}","starred_url":"https://api.github.com/users/peterszerzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterszerzo/subscriptions","organizations_url":"https://api.github.com/users/peterszerzo/orgs","repos_url":"https://api.github.com/users/peterszerzo/repos","events_url":"https://api.github.com/users/peterszerzo/events{/privacy}","received_events_url":"https://api.github.com/users/peterszerzo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"peterszerzo","id":6738398,"avatar_url":"https://avatars1.githubusercontent.com/u/6738398?v=4","gravatar_id":"","url":"https://api.github.com/users/peterszerzo","html_url":"https://github.com/peterszerzo","followers_url":"https://api.github.com/users/peterszerzo/followers","following_url":"https://api.github.com/users/peterszerzo/following{/other_user}","gists_url":"https://api.github.com/users/peterszerzo/gists{/gist_id}","starred_url":"https://api.github.com/users/peterszerzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterszerzo/subscriptions","organizations_url":"https://api.github.com/users/peterszerzo/orgs","repos_url":"https://api.github.com/users/peterszerzo/repos","events_url":"https://api.github.com/users/peterszerzo/events{/privacy}","received_events_url":"https://api.github.com/users/peterszerzo/received_events","type":"User","site_admin":false},"assignees":[{"login":"peterszerzo","id":6738398,"avatar_url":"https://avatars1.githubusercontent.com/u/6738398?v=4","gravatar_id":"","url":"https://api.github.com/users/peterszerzo","html_url":"https://github.com/peterszerzo","followers_url":"https://api.github.com/users/peterszerzo/followers","following_url":"https://api.github.com/users/peterszerzo/following{/other_user}","gists_url":"https://api.github.com/users/peterszerzo/gists{/gist_id}","starred_url":"https://api.github.com/users/peterszerzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterszerzo/subscriptions","organizations_url":"https://api.github.com/users/peterszerzo/orgs","repos_url":"https://api.github.com/users/peterszerzo/repos","events_url":"https://api.github.com/users/peterszerzo/events{/privacy}","received_events_url":"https://api.github.com/users/peterszerzo/received_events","type":"User","site_admin":false},{"login":"TejasQ","id":9947422,"avatar_url":"https://avatars1.githubusercontent.com/u/9947422?v=4","gravatar_id":"","url":"https://api.github.com/users/TejasQ","html_url":"https://github.com/TejasQ","followers_url":"https://api.github.com/users/TejasQ/followers","following_url":"https://api.github.com/users/TejasQ/following{/other_user}","gists_url":"https://api.github.com/users/TejasQ/gists{/gist_id}","starred_url":"https://api.github.com/users/TejasQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TejasQ/subscriptions","organizations_url":"https://api.github.com/users/TejasQ/orgs","repos_url":"https://api.github.com/users/TejasQ/repos","events_url":"https://api.github.com/users/TejasQ/events{/privacy}","received_events_url":"https://api.github.com/users/TejasQ/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-02-23T14:15:35Z","updated_at":"2018-02-28T13:01:26Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"* options are currently specified as `{ value: string, option?: string }`. Actually, options are treated in the code as always specified, and there are runtime errors when they are omitted.\r\n* we should consider removing options altogether, and have the component simply take a list of strings. This would make the component much easier to use, and leave the minimal responsibility of mapping the labels to raw values to the library user. If need be, they can produce a wrapper that restores the current API with very minimal code.\r\n* a redesign to match `DatePicker` is in order, adding a minimum width to look good.\r\n* when the values pop up, their design should match `ContextMenu`. "},"comment":{"url":"https://api.github.com/repos/Contiamo/operational-ui/issues/comments/369232191","html_url":"https://github.com/Contiamo/operational-ui/issues/319#issuecomment-369232191","issue_url":"https://api.github.com/repos/Contiamo/operational-ui/issues/319","id":369232191,"user":{"login":"peterszerzo","id":6738398,"avatar_url":"https://avatars1.githubusercontent.com/u/6738398?v=4","gravatar_id":"","url":"https://api.github.com/users/peterszerzo","html_url":"https://github.com/peterszerzo","followers_url":"https://api.github.com/users/peterszerzo/followers","following_url":"https://api.github.com/users/peterszerzo/following{/other_user}","gists_url":"https://api.github.com/users/peterszerzo/gists{/gist_id}","starred_url":"https://api.github.com/users/peterszerzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterszerzo/subscriptions","organizations_url":"https://api.github.com/users/peterszerzo/orgs","repos_url":"https://api.github.com/users/peterszerzo/repos","events_url":"https://api.github.com/users/peterszerzo/events{/privacy}","received_events_url":"https://api.github.com/users/peterszerzo/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T13:01:26Z","updated_at":"2018-02-28T13:01:26Z","author_association":"CONTRIBUTOR","body":"Maybe it's helpful to write it out a bit better how you would use the new API in the mindset of the old one:\r\n```\r\nrender() {\r\n  const optionsByOldApi = [\r\n    { value: \"v1\", label: \"l1\" },\r\n    { value: \"v2\", label: \"l2\" },\r\n    { value: \"v3\", label: \"l3\" }\r\n  ]\r\n  return (\r\n    <Select options={optionsByOldApi.map(o => o.label)} onChange={(newLabel, newIndex) => {\r\n      // Either find the value by matching against the label, or just go by index\r\n      // Keep doing business as usual\r\n    } />\r\n  )\r\n}\r\n```\r\nSelect is easier to use now, the `<option>` tag still gets a semantic value, and you can map things back quickly."}}
{"actor":{"display_login":"peterszerzo"}}