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
59a6f8df
Commit
59a6f8df
authored
Aug 13, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix due date tooltip on milestone in sidebar
Changelog: fixed
parent
cbfce37a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
1 deletion
+21
-1
app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
...avascripts/sidebar/components/sidebar_dropdown_widget.vue
+5
-0
app/assets/javascripts/sidebar/queries/milestone.fragment.graphql
...ts/javascripts/sidebar/queries/milestone.fragment.graphql
+1
-0
ee/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
...avascripts/sidebar/components/sidebar_dropdown_widget.vue
+1
-0
spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
...ontend/sidebar/components/sidebar_dropdown_widget_spec.js
+11
-1
spec/frontend/sidebar/mock_data.js
spec/frontend/sidebar/mock_data.js
+3
-0
No files found.
app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
View file @
59a6f8df
...
...
@@ -13,6 +13,7 @@ import {
import
createFlash
from
'
~/flash
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
timeFor
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
SidebarEditableItem
from
'
~/sidebar/components/sidebar_editable_item.vue
'
;
import
{
...
...
@@ -204,6 +205,9 @@ export default {
attributeTypeIcon
()
{
return
this
.
icon
||
this
.
issuableAttribute
;
},
tooltipText
()
{
return
timeFor
(
this
.
currentAttribute
?.
dueDate
);
},
i18n
()
{
return
{
noAttribute
:
sprintf
(
s__
(
'
DropdownWidget|No %{issuableAttribute}
'
),
{
...
...
@@ -346,6 +350,7 @@ export default {
:currentAttribute=
"currentAttribute"
>
<gl-link
v-gl-tooltip=
"tooltipText"
class=
"gl-text-gray-900! gl-font-weight-bold"
:href=
"attributeUrl"
:data-qa-selector=
"`$
{issuableAttribute}_link`"
...
...
app/assets/javascripts/sidebar/queries/milestone.fragment.graphql
View file @
59a6f8df
...
...
@@ -2,5 +2,6 @@ fragment MilestoneFragment on Milestone {
id
title
webUrl
:
webPath
dueDate
expired
}
ee/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
View file @
59a6f8df
...
...
@@ -19,6 +19,7 @@ export default {
[
IssuableAttributeType
.
Iteration
]:
__
(
'
Iteration
'
),
[
IssuableAttributeType
.
Epic
]:
__
(
'
Epic
'
),
none
:
__
(
'
None
'
),
expired
:
__
(
'
(expired)
'
),
},
props
:
{
issuableAttribute
:
{
...
...
spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
View file @
59a6f8df
...
...
@@ -12,11 +12,13 @@ import { createLocalVue, shallowMount, mount } from '@vue/test-utils';
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
createFlash
from
'
~/flash
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
timeFor
}
from
'
~/lib/utils/datetime_utility
'
;
import
SidebarDropdownWidget
from
'
~/sidebar/components/sidebar_dropdown_widget.vue
'
;
import
SidebarEditableItem
from
'
~/sidebar/components/sidebar_editable_item.vue
'
;
import
{
IssuableAttributeType
}
from
'
~/sidebar/constants
'
;
...
...
@@ -54,6 +56,7 @@ describe('SidebarDropdownWidget', () => {
const
mutationSuccessWithErrors
=
()
=>
jest
.
fn
().
mockResolvedValue
({
data
:
promiseWithErrors
});
const
findGlLink
=
()
=>
wrapper
.
findComponent
(
GlLink
);
const
findDateTooltip
=
()
=>
getBinding
(
findGlLink
().
element
,
'
gl-tooltip
'
);
const
findDropdown
=
()
=>
wrapper
.
findComponent
(
GlDropdown
);
const
findDropdownText
=
()
=>
wrapper
.
findComponent
(
GlDropdownText
);
const
findSearchBox
=
()
=>
wrapper
.
findComponent
(
GlSearchBoxByType
);
...
...
@@ -155,6 +158,9 @@ describe('SidebarDropdownWidget', () => {
},
},
},
directives
:
{
GlTooltip
:
createMockDirective
(),
},
stubs
:
{
SidebarEditableItem
,
GlSearchBoxByType
,
...
...
@@ -177,7 +183,7 @@ describe('SidebarDropdownWidget', () => {
beforeEach
(()
=>
{
createComponent
({
data
:
{
currentAttribute
:
{
id
:
'
id
'
,
title
:
'
title
'
,
webUrl
:
'
webUrl
'
},
currentAttribute
:
{
id
:
'
id
'
,
title
:
'
title
'
,
webUrl
:
'
webUrl
'
,
dueDate
:
'
2021-09-09
'
},
},
stubs
:
{
GlDropdown
,
...
...
@@ -223,6 +229,10 @@ describe('SidebarDropdownWidget', () => {
expect
(
findSelectedAttribute
().
text
()).
toBe
(
'
Some milestone title
'
);
});
it
(
'
displays time for milestone due date in tooltip
'
,
()
=>
{
expect
(
findDateTooltip
().
value
).
toBe
(
timeFor
(
'
2021-09-09
'
));
});
describe
(
'
when current attribute does not exist
'
,
()
=>
{
it
(
'
renders "None" as the selected attribute title
'
,
()
=>
{
createComponent
();
...
...
spec/frontend/sidebar/mock_data.js
View file @
59a6f8df
...
...
@@ -562,6 +562,7 @@ export const mockMilestone1 = {
webUrl
:
'
http://gdk.test:3000/groups/gitlab-org/-/milestones/1
'
,
state
:
'
active
'
,
expired
:
false
,
dueDate
:
'
2030-09-09
'
,
};
export
const
mockMilestone2
=
{
...
...
@@ -571,6 +572,7 @@ export const mockMilestone2 = {
webUrl
:
'
http://gdk.test:3000/groups/gitlab-org/-/milestones/2
'
,
state
:
'
active
'
,
expired
:
false
,
dueDate
:
'
2030-09-09
'
,
};
export
const
mockProjectMilestonesResponse
=
{
...
...
@@ -618,6 +620,7 @@ export const mockMilestoneMutationResponse = {
title
:
'
Awesome Milestone
'
,
state
:
'
active
'
,
expired
:
false
,
dueDate
:
'
2030-09-09
'
,
__typename
:
'
Milestone
'
,
},
__typename
:
'
Issue
'
,
...
...
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