{"action":"created","issue":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/1150","labels_url":"https://api.github.com/repos/keystonejs/keystone/issues/1150/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/keystone/issues/1150/comments","events_url":"https://api.github.com/repos/keystonejs/keystone/issues/1150/events","html_url":"https://github.com/keystonejs/keystone/issues/1150","id":59921482,"number":1150,"title":"Refactor out field type switch statements","user":{"login":"JedWatson","id":872310,"avatar_url":"https://avatars.githubusercontent.com/u/872310?v=3","gravatar_id":"","url":"https://api.github.com/users/JedWatson","html_url":"https://github.com/JedWatson","followers_url":"https://api.github.com/users/JedWatson/followers","following_url":"https://api.github.com/users/JedWatson/following{/other_user}","gists_url":"https://api.github.com/users/JedWatson/gists{/gist_id}","starred_url":"https://api.github.com/users/JedWatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JedWatson/subscriptions","organizations_url":"https://api.github.com/users/JedWatson/orgs","repos_url":"https://api.github.com/users/JedWatson/repos","events_url":"https://api.github.com/users/JedWatson/events{/privacy}","received_events_url":"https://api.github.com/users/JedWatson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-05T08:44:30Z","updated_at":"2015-03-07T07:52:02Z","closed_at":null,"body":"We have a lot of switch statements throughout Keystone where certain field types have special behaviours, e.g.\r\n\r\n```\r\nswitch(field.type){\r\n  case \"markdown\": //do something\r\n}\r\n```\r\n\r\nThese are a major blocker for being able to implement custom field types, and contain field-specific logic in the wrong places.\r\n\r\nWe need to identify where and why these exist, and replace them with hooks that FieldTypes can attach to as required."},"comment":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/comments/77678338","html_url":"https://github.com/keystonejs/keystone/issues/1150#issuecomment-77678338","issue_url":"https://api.github.com/repos/keystonejs/keystone/issues/1150","id":77678338,"user":{"login":"creynders","id":436347,"avatar_url":"https://avatars.githubusercontent.com/u/436347?v=3","gravatar_id":"","url":"https://api.github.com/users/creynders","html_url":"https://github.com/creynders","followers_url":"https://api.github.com/users/creynders/followers","following_url":"https://api.github.com/users/creynders/following{/other_user}","gists_url":"https://api.github.com/users/creynders/gists{/gist_id}","starred_url":"https://api.github.com/users/creynders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creynders/subscriptions","organizations_url":"https://api.github.com/users/creynders/orgs","repos_url":"https://api.github.com/users/creynders/repos","events_url":"https://api.github.com/users/creynders/events{/privacy}","received_events_url":"https://api.github.com/users/creynders/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T07:52:02Z","updated_at":"2015-03-07T07:52:02Z","body":"So, conceptually this translates to field-specific\r\n\r\n* mongoose query parameters for searching\r\n* error handling upon document updates\r\n* column rendering on list pages\r\n* filter rendering on list pages\r\n* not entirely sure what lib/content/page is used for ATM"}}