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
af250f0d
Commit
af250f0d
authored
Oct 16, 2020
by
Pedro Moreira da Silva
Committed by
Natalia Tepluhina
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate MR merged/closed time tooltip to GitLab UI
parent
af5d7e13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_author_time.vue
...merge_request_widget/components/mr_widget_author_time.vue
+4
-3
spec/frontend/vue_mr_widget/components/mr_widget_author_time_spec.js
...nd/vue_mr_widget/components/mr_widget_author_time_spec.js
+1
-3
spec/frontend/vue_mr_widget/components/states/mr_widget_merged_spec.js
.../vue_mr_widget/components/states/mr_widget_merged_spec.js
+1
-3
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_author_time.vue
View file @
af250f0d
<
script
>
<
script
>
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
{
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
MrWidgetAuthor
from
'
./mr_widget_author.vue
'
;
import
MrWidgetAuthor
from
'
./mr_widget_author.vue
'
;
export
default
{
export
default
{
...
@@ -8,7 +8,7 @@ export default {
...
@@ -8,7 +8,7 @@ export default {
MrWidgetAuthor
,
MrWidgetAuthor
,
},
},
directives
:
{
directives
:
{
tooltip
,
GlTooltip
:
GlTooltipDirective
,
},
},
props
:
{
props
:
{
actionText
:
{
actionText
:
{
...
@@ -34,6 +34,7 @@ export default {
...
@@ -34,6 +34,7 @@ export default {
<h4
class=
"js-mr-widget-author"
>
<h4
class=
"js-mr-widget-author"
>
{{
actionText
}}
{{
actionText
}}
<mr-widget-author
:author=
"author"
/>
<mr-widget-author
:author=
"author"
/>
<time
v-tooltip
:title=
"dateTitle"
data-container=
"body"
>
{{
dateReadable
}}
</time>
<span
class=
"sr-only"
>
{{
dateReadable
}}
(
{{
dateTitle
}}
)
</span>
<time
v-gl-tooltip
.
hover
aria-hidden
:title=
"dateTitle"
>
{{
dateReadable
}}
</time>
</h4>
</h4>
</
template
>
</
template
>
spec/frontend/vue_mr_widget/components/mr_widget_author_time_spec.js
View file @
af250f0d
...
@@ -35,9 +35,7 @@ describe('MrWidgetAuthorTime', () => {
...
@@ -35,9 +35,7 @@ describe('MrWidgetAuthorTime', () => {
});
});
it
(
'
renders provided time
'
,
()
=>
{
it
(
'
renders provided time
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
time
'
).
getAttribute
(
'
data-original-title
'
)).
toEqual
(
expect
(
vm
.
$el
.
querySelector
(
'
time
'
).
getAttribute
(
'
title
'
)).
toEqual
(
'
2017-03-23T23:02:00.807Z
'
);
'
2017-03-23T23:02:00.807Z
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
time
'
).
textContent
.
trim
()).
toEqual
(
'
12 hours ago
'
);
expect
(
vm
.
$el
.
querySelector
(
'
time
'
).
textContent
.
trim
()).
toEqual
(
'
12 hours ago
'
);
});
});
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_merged_spec.js
View file @
af250f0d
...
@@ -212,8 +212,6 @@ describe('MRWidgetMerged', () => {
...
@@ -212,8 +212,6 @@ describe('MRWidgetMerged', () => {
});
});
it
(
'
should use mergedEvent mergedAt as tooltip title
'
,
()
=>
{
it
(
'
should use mergedEvent mergedAt as tooltip title
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
time
'
).
getAttribute
(
'
data-original-title
'
)).
toBe
(
expect
(
vm
.
$el
.
querySelector
(
'
time
'
).
getAttribute
(
'
title
'
)).
toBe
(
'
Jan 24, 2018 1:02pm GMT+0000
'
);
'
Jan 24, 2018 1:02pm GMT+0000
'
,
);
});
});
});
});
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