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
fd315c20
Commit
fd315c20
authored
Jun 14, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove href link from pending references with a empty path
parent
0269d05c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
app/assets/javascripts/issuable/related_issues/components/issue_token.vue
...cripts/issuable/related_issues/components/issue_token.vue
+10
-3
app/assets/stylesheets/pages/issues.scss
app/assets/stylesheets/pages/issues.scss
+6
-0
spec/javascripts/issuable/related_issues/components/issue_token_spec.js
...ts/issuable/related_issues/components/issue_token_spec.js
+6
-1
No files found.
app/assets/javascripts/issuable/related_issues/components/issue_token.vue
View file @
fd315c20
...
@@ -50,6 +50,12 @@ export default {
...
@@ -50,6 +50,12 @@ export default {
hasTitle
()
{
hasTitle
()
{
return
this
.
title
.
length
>
0
;
return
this
.
title
.
length
>
0
;
},
},
computedLinkElementType
()
{
return
this
.
path
.
length
>
0
?
'
a
'
:
'
span
'
;
},
computedPath
()
{
return
this
.
path
.
length
?
this
.
path
:
null
;
},
},
},
methods
:
{
methods
:
{
...
@@ -79,10 +85,11 @@ export default {
...
@@ -79,10 +85,11 @@ export default {
<
template
>
<
template
>
<div
class=
"issue-token"
>
<div
class=
"issue-token"
>
<a
<component
:is=
"this.computedLinkElementType"
ref=
"link"
ref=
"link"
class=
"issue-token-link"
class=
"issue-token-link"
:href=
"
p
ath"
:href=
"
computedP
ath"
:title=
"title"
:title=
"title"
data-toggle=
"tooltip"
data-toggle=
"tooltip"
data-placement=
"top"
>
data-placement=
"top"
>
...
@@ -110,7 +117,7 @@ export default {
...
@@ -110,7 +117,7 @@ export default {
{{
title
}}
{{
title
}}
</span>
</span>
</span>
</span>
</
a
>
</
component
>
<button
<button
ref=
"removeButton"
ref=
"removeButton"
v-if=
"canRemove"
v-if=
"canRemove"
...
...
app/assets/stylesheets/pages/issues.scss
View file @
fd315c20
...
@@ -292,6 +292,12 @@ ul.related-merge-requests > li {
...
@@ -292,6 +292,12 @@ ul.related-merge-requests > li {
display
:
inline-flex
;
display
:
inline-flex
;
min-width
:
0
;
min-width
:
0
;
color
:
$gl-text-color-secondary
;
&
[
href
]
{
color
:
$gl-link-color
;
}
&
:hover
,
&
:hover
,
&
:focus
{
&
:focus
{
outline
:
none
;
outline
:
none
;
...
...
spec/javascripts/issuable/related_issues/components/issue_token_spec.js
View file @
fd315c20
...
@@ -3,7 +3,7 @@ import eventHub from '~/issuable/related_issues/event_hub';
...
@@ -3,7 +3,7 @@ import eventHub from '~/issuable/related_issues/event_hub';
import
issueToken
from
'
~/issuable/related_issues/components/issue_token.vue
'
;
import
issueToken
from
'
~/issuable/related_issues/components/issue_token.vue
'
;
describe
(
'
IssueToken
'
,
()
=>
{
describe
(
'
IssueToken
'
,
()
=>
{
const
idKey
=
'
200
'
;
const
idKey
=
200
;
const
displayReference
=
'
foo/bar#123
'
;
const
displayReference
=
'
foo/bar#123
'
;
const
title
=
'
some title
'
;
const
title
=
'
some title
'
;
let
IssueToken
;
let
IssueToken
;
...
@@ -32,6 +32,11 @@ describe('IssueToken', () => {
...
@@ -32,6 +32,11 @@ describe('IssueToken', () => {
it
(
'
shows reference
'
,
()
=>
{
it
(
'
shows reference
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
displayReference
);
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
displayReference
);
});
});
it
(
'
does not link without path specified
'
,
()
=>
{
expect
(
vm
.
$refs
.
link
.
tagName
.
toLowerCase
()).
toEqual
(
'
span
'
);
expect
(
vm
.
$refs
.
link
.
getAttribute
(
'
href
'
)).
toBeNull
();
});
});
});
describe
(
'
with reference and title supplied
'
,
()
=>
{
describe
(
'
with reference and title supplied
'
,
()
=>
{
...
...
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