Commit 9c498d39 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'dispatcher-if' into 'master'

Convert switch into if statement

See merge request gitlab-org/gitlab-ce!17304
parents 52c56400 ac3b6f14
...@@ -42,31 +42,34 @@ var Dispatcher; ...@@ -42,31 +42,34 @@ var Dispatcher;
}); });
}); });
switch (page) { const shortcutHandlerPages = [
case 'projects:merge_requests:index': 'projects:activity',
case 'projects:issues:index': 'projects:artifacts:browse',
case 'projects:issues:show': 'projects:artifacts:file',
case 'projects:issues:new': 'projects:blame:show',
case 'projects:issues:edit': 'projects:blob:show',
case 'projects:merge_requests:creations:new': 'projects:commit:show',
case 'projects:merge_requests:creations:diffs': 'projects:commits:show',
case 'projects:merge_requests:edit': 'projects:find_file:show',
case 'projects:merge_requests:show': 'projects:issues:edit',
case 'projects:commit:show': 'projects:issues:index',
case 'projects:activity': 'projects:issues:new',
case 'projects:commits:show': 'projects:issues:show',
case 'projects:show': 'projects:merge_requests:creations:diffs',
case 'groups:show': 'projects:merge_requests:creations:new',
case 'projects:tree:show': 'projects:merge_requests:edit',
case 'projects:find_file:show': 'projects:merge_requests:index',
case 'projects:blob:show': 'projects:merge_requests:show',
case 'projects:blame:show': 'projects:network:show',
case 'projects:network:show': 'projects:show',
case 'projects:artifacts:browse': 'projects:tree:show',
case 'projects:artifacts:file': 'groups:show',
];
if (shortcutHandlerPages.indexOf(page) !== -1) {
shortcut_handler = true; shortcut_handler = true;
break;
} }
switch (path[0]) { switch (path[0]) {
case 'admin': case 'admin':
switch (path[1]) { switch (path[1]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment