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
aeabd307
Commit
aeabd307
authored
Jun 13, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove js classes from vue component that are not needed in vue component
parent
0d499ce2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
26 deletions
+3
-26
app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue
...ts/javascripts/vue_shared/components/time_ago_tooltip.vue
+2
-14
spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js
...avascripts/vue_shared/components/time_ago_tooltip_spec.js
+1
-12
No files found.
app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue
View file @
aeabd307
...
...
@@ -20,12 +20,6 @@ export default {
default
:
'
top
'
,
},
shortFormat
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
cssClass
:
{
type
:
String
,
required
:
false
,
...
...
@@ -37,18 +31,12 @@ export default {
tooltipMixin
,
timeagoMixin
,
],
computed
:
{
timeagoCssClass
()
{
return
this
.
shortFormat
?
'
js-short-timeago
'
:
'
js-timeago
'
;
},
},
};
</
script
>
<
template
>
<time
:class=
"
[timeagoCssClass, cssClass]
"
class=
"js-
timeago js-timeago-render
"
:class=
"
cssClass
"
class=
"js-
vue-timeago
"
:title=
"tooltipTitle(time)"
:data-placement=
"tooltipPlacement"
data-container=
"body"
...
...
spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js
View file @
aeabd307
...
...
@@ -22,7 +22,7 @@ describe('Time ago with tooltip component', () => {
}).
$mount
();
expect
(
vm
.
$el
.
tagName
).
toEqual
(
'
TIME
'
);
expect
(
vm
.
$el
.
classList
.
contains
(
'
js-timeago
'
)).
toEqual
(
true
);
expect
(
vm
.
$el
.
classList
.
contains
(
'
js-
vue-
timeago
'
)).
toEqual
(
true
);
expect
(
vm
.
$el
.
getAttribute
(
'
data-original-title
'
),
).
toEqual
(
gl
.
utils
.
formatDate
(
'
2017-05-08T14:57:39.781Z
'
));
...
...
@@ -44,17 +44,6 @@ describe('Time ago with tooltip component', () => {
expect
(
vm
.
$el
.
getAttribute
(
'
data-placement
'
)).
toEqual
(
'
bottom
'
);
});
it
(
'
should render short format class
'
,
()
=>
{
vm
=
new
TimeagoTooltip
({
propsData
:
{
time
:
'
2017-05-08T14:57:39.781Z
'
,
shortFormat
:
true
,
},
}).
$mount
();
expect
(
vm
.
$el
.
classList
.
contains
(
'
js-short-timeago
'
)).
toEqual
(
true
);
});
it
(
'
should render provided html class
'
,
()
=>
{
vm
=
new
TimeagoTooltip
({
propsData
:
{
...
...
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