Commit bbe1f76c authored by Robert Speicher's avatar Robert Speicher

Revert "Merge branch 'ph/fixSlashAndHashVueRouter' into 'master'"

This reverts commit ce4b77a3, reversing
changes made to 6e7cc33b.
parent 8aeef00c
...@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) { ...@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) {
base: joinPaths(gon.relative_url_root || '', base), base: joinPaths(gon.relative_url_root || '', base),
routes: [ routes: [
{ {
path: `(/-)?/tree/(${encodeURIComponent(baseRef).replace(/%2F/g, '/')}|${baseRef})/:path*`, path: `(/-)?/tree/(${encodeURIComponent(baseRef)}|${baseRef})/:path*`,
name: 'treePath', name: 'treePath',
component: TreePage, component: TreePage,
props: route => ({ props: route => ({
......
...@@ -4,15 +4,14 @@ import createRouter from '~/repository/router'; ...@@ -4,15 +4,14 @@ import createRouter from '~/repository/router';
describe('Repository router spec', () => { describe('Repository router spec', () => {
it.each` it.each`
path | branch | component | componentName path | component | componentName
${'/'} | ${'master'} | ${IndexPage} | ${'IndexPage'} ${'/'} | ${IndexPage} | ${'IndexPage'}
${'/tree/master'} | ${'master'} | ${TreePage} | ${'TreePage'} ${'/tree/master'} | ${TreePage} | ${'TreePage'}
${'/-/tree/master'} | ${'master'} | ${TreePage} | ${'TreePage'} ${'/-/tree/master'} | ${TreePage} | ${'TreePage'}
${'/-/tree/master/app/assets'} | ${'master'} | ${TreePage} | ${'TreePage'} ${'/-/tree/master/app/assets'} | ${TreePage} | ${'TreePage'}
${'/-/tree/feature/test-%23/app/assets'} | ${'feature/test-#'} | ${TreePage} | ${'TreePage'} ${'/-/tree/123/app/assets'} | ${null} | ${'null'}
${'/-/tree/123/app/assets'} | ${'master'} | ${null} | ${'null'} `('sets component as $componentName for path "$path"', ({ path, component }) => {
`('sets component as $componentName for path "$path"', ({ path, component, branch }) => { const router = createRouter('', 'master');
const router = createRouter('', branch);
const componentsForRoute = router.getMatchedComponents(path); const componentsForRoute = router.getMatchedComponents(path);
......
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