Skip to content

Instantly share code, notes, and snippets.

@MeetMartin
Created October 29, 2018 21:13
Show Gist options
  • Save MeetMartin/838540f5a7290b082ecf70a4da99b448 to your computer and use it in GitHub Desktop.
Save MeetMartin/838540f5a7290b082ecf70a4da99b448 to your computer and use it in GitHub Desktop.
ternaries view manager
/**
* Sets active view based on current url
* @param {String} url url to be checked
* @return {String} getActiveView :: String -> String
*/
const getActiveView = url =>
url.includes ('rapidView')
?
url.includes ('view=planning') ? 'Backlog' :
url.includes ('view=reporting') ? 'Reports' :
'Active Sprints'
:
url.includes ('browse') ? 'Open Issue' :
url.includes ('projects') ? 'Projects' :
'Unknown';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment