Created
October 29, 2018 21:10
-
-
Save MeetMartin/8b5be29add381e2668080c49173aa589 to your computer and use it in GitHub Desktop.
imperative view manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sets active view based on current url | |
* @param {String} url url to be checked | |
* @return {String} getActiveView :: String -> String | |
*/ | |
function getActiveView(url) { | |
if(url.includes('rapidView')) { | |
if(url.includes('view=planning')) { | |
return 'Backlog'; | |
} else if (url.includes('view=reporting')) { | |
return 'Reports'; | |
} else { | |
return 'Active Sprints'; | |
} | |
} else if (url.includes('browse')) { | |
return 'Open Issue'; | |
} else if (url.includes('projects')) { | |
return 'Projects'; | |
} else { | |
return 'Unknown'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment