Skip to content

Instantly share code, notes, and snippets.

@MeetMartin
Created October 29, 2018 21:10
Show Gist options
  • Save MeetMartin/8b5be29add381e2668080c49173aa589 to your computer and use it in GitHub Desktop.
Save MeetMartin/8b5be29add381e2668080c49173aa589 to your computer and use it in GitHub Desktop.
imperative view manager
/**
* 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