Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d9e748d0
Commit
d9e748d0
authored
Jul 17, 2019
by
Phil Hughes
Committed by
Kushal Pandya
Aug 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes design management router and issue note linking
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/64667
parent
8800fb5c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
47 deletions
+61
-47
ee/app/assets/javascripts/design_management/index.js
ee/app/assets/javascripts/design_management/index.js
+3
-2
ee/app/assets/javascripts/design_management/router.js
ee/app/assets/javascripts/design_management/router.js
+46
-43
ee/app/views/projects/issues/_discussion.html.haml
ee/app/views/projects/issues/_discussion.html.haml
+1
-1
ee/config/routes/project.rb
ee/config/routes/project.rb
+7
-0
ee/spec/frontend/design_management/router_spec.js
ee/spec/frontend/design_management/router_spec.js
+4
-1
No files found.
ee/app/assets/javascripts/design_management/index.js
View file @
d9e748d0
import
$
from
'
jquery
'
;
import
Vue
from
'
vue
'
;
import
r
outer
from
'
./router
'
;
import
createR
outer
from
'
./router
'
;
import
App
from
'
./components/app.vue
'
;
import
apolloProvider
from
'
./graphql
'
;
import
allDesigns
from
'
./queries/allDesigns.graphql
'
;
...
...
@@ -8,7 +8,8 @@ import allDesigns from './queries/allDesigns.graphql';
export
default
()
=>
{
const
el
=
document
.
getElementById
(
'
js-design-management
'
);
const
badge
=
document
.
querySelector
(
'
.js-designs-count
'
);
const
{
issueIid
,
projectPath
}
=
el
.
dataset
;
const
{
issueIid
,
projectPath
,
issuePath
}
=
el
.
dataset
;
const
router
=
createRouter
(
issuePath
);
$
(
'
.js-issue-tabs
'
).
on
(
'
shown.bs.tab
'
,
({
target
:
{
id
}
})
=>
{
if
(
id
===
'
designs
'
&&
router
.
currentRoute
.
name
===
'
root
'
)
{
...
...
ee/app/assets/javascripts/design_management/router.js
View file @
d9e748d0
...
...
@@ -7,52 +7,55 @@ import DesignDetail from './pages/design/index.vue';
Vue
.
use
(
VueRouter
);
const
router
=
new
VueRouter
({
base
:
window
.
location
.
pathname
,
routes
:
[
{
name
:
'
root
'
,
path
:
'
/
'
,
component
:
Home
,
meta
:
{
el
:
'
discussion
'
,
},
},
{
name
:
'
designs
'
,
path
:
'
/designs
'
,
component
:
Home
,
meta
:
{
el
:
'
designs
'
,
export
default
function
createRouter
(
base
)
{
const
router
=
new
VueRouter
({
base
,
mode
:
'
history
'
,
routes
:
[
{
name
:
'
root
'
,
path
:
'
/
'
,
component
:
Home
,
meta
:
{
el
:
'
discussion
'
,
},
},
children
:
[
{
name
:
'
design
'
,
path
:
'
:id
'
,
component
:
DesignDetail
,
meta
:
{
el
:
'
designs
'
,
},
beforeEnter
(
{
params
:
{
id
},
{
name
:
'
designs
'
,
path
:
'
/designs
'
,
component
:
Home
,
meta
:
{
el
:
'
designs
'
,
},
children
:
[
{
name
:
'
design
'
,
path
:
'
:id
'
,
component
:
DesignDetail
,
meta
:
{
el
:
'
designs
'
,
},
from
,
next
,
)
{
if
(
_
.
isString
(
id
))
next
();
beforeEnter
(
{
params
:
{
id
},
},
from
,
next
,
)
{
if
(
_
.
isString
(
id
))
next
();
},
props
:
({
params
:
{
id
}
})
=>
({
id
}),
},
props
:
({
params
:
{
id
}
})
=>
({
id
}),
},
],
},
],
});
],
},
],
});
router
.
beforeEach
(({
meta
:
{
el
}
},
from
,
next
)
=>
{
$
(
`#
${
el
}
`
).
tab
(
'
show
'
);
router
.
beforeEach
(({
meta
:
{
el
}
},
from
,
next
)
=>
{
$
(
`#
${
el
}
`
).
tab
(
'
show
'
);
next
();
});
next
();
});
export
default
router
;
return
router
;
}
ee/app/views/projects/issues/_discussion.html.haml
View file @
d9e748d0
...
...
@@ -12,6 +12,6 @@
#discussion-tab
.tab-pane.show.active
{
role:
'tabpanel'
,
'aria-labelledby'
:
'discussion'
}
=
render_ce
'projects/issues/discussion'
#designs-tab
.tab-pane
{
role:
'tabpanel'
,
'aria-labelledby'
:
'designs'
}
#js-design-management
{
data:
{
project_path:
@project
.
full_path
,
issue_iid:
@issue
.
iid
}
}
#js-design-management
{
data:
{
project_path:
@project
.
full_path
,
issue_iid:
@issue
.
iid
,
issue_path:
project_issue_path
(
@project
,
@issue
)
}
}
-
else
=
render_ce
'projects/issues/discussion'
ee/config/routes/project.rb
View file @
d9e748d0
...
...
@@ -72,6 +72,13 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
resources
:issues
,
only:
[],
constraints:
{
id:
/\d+/
}
do
member
do
get
:designs
,
action:
'show'
get
'designs/*vueroute'
,
action:
'show'
,
format:
false
end
end
resource
:insights
,
only:
[
:show
]
do
collection
do
post
:query
...
...
ee/spec/frontend/design_management/router_spec.js
View file @
d9e748d0
...
...
@@ -3,11 +3,12 @@ import VueRouter from 'vue-router';
import
App
from
'
ee/design_management/components/app.vue
'
;
import
Designs
from
'
ee/design_management/pages/index.vue
'
;
import
DesignDetail
from
'
ee/design_management/pages/design/index.vue
'
;
import
r
outer
from
'
ee/design_management/router
'
;
import
createR
outer
from
'
ee/design_management/router
'
;
import
'
~/commons/bootstrap
'
;
describe
(
'
Design management router
'
,
()
=>
{
let
vm
;
let
router
;
function
factory
()
{
const
localVue
=
createLocalVue
();
...
...
@@ -16,6 +17,8 @@ describe('Design management router', () => {
window
.
gon
=
{
sprite_icons
:
''
};
router
=
createRouter
(
'
/
'
);
vm
=
mount
(
App
,
{
localVue
,
router
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment