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
47302502
Commit
47302502
authored
Aug 18, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate epic sidebar ancestors to widget
Changelog: changed EE: true
parent
a89ca44b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
42 deletions
+17
-42
ee/app/assets/javascripts/epic/components/epic_sidebar.vue
ee/app/assets/javascripts/epic/components/epic_sidebar.vue
+8
-6
ee/app/assets/javascripts/epic/store/getters.js
ee/app/assets/javascripts/epic/store/getters.js
+0
-2
ee/app/assets/javascripts/epic/store/state.js
ee/app/assets/javascripts/epic/store/state.js
+0
-1
ee/spec/frontend/epic/components/epic_sidebar_spec.js
ee/spec/frontend/epic/components/epic_sidebar_spec.js
+9
-16
ee/spec/frontend/epic/store/getters_spec.js
ee/spec/frontend/epic/store/getters_spec.js
+0
-17
No files found.
ee/app/assets/javascripts/epic/components/epic_sidebar.vue
View file @
47302502
<
script
>
<
script
>
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
AncestorsTree
from
'
ee/sidebar/components/ancestors_tree/ancestors_tree
.vue
'
;
import
SidebarAncestorsWidget
from
'
ee_component/sidebar/components/ancestors_tree/sidebar_ancestors_widget
.vue
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
notesEventHub
from
'
~/notes/event_hub
'
;
import
notesEventHub
from
'
~/notes/event_hub
'
;
...
@@ -27,7 +27,7 @@ export default {
...
@@ -27,7 +27,7 @@ export default {
SidebarDatePicker
,
SidebarDatePicker
,
SidebarDatePickerCollapsed
,
SidebarDatePickerCollapsed
,
SidebarLabels
,
SidebarLabels
,
AncestorsTree
,
SidebarAncestorsWidget
,
SidebarParticipants
,
SidebarParticipants
,
SidebarConfidentialityWidget
,
SidebarConfidentialityWidget
,
SidebarSubscriptionsWidget
,
SidebarSubscriptionsWidget
,
...
@@ -70,7 +70,6 @@ export default {
...
@@ -70,7 +70,6 @@ export default {
'
dueDateTimeFromMilestones
'
,
'
dueDateTimeFromMilestones
'
,
'
dueDateTime
'
,
'
dueDateTime
'
,
'
dueDateForCollapsedSidebar
'
,
'
dueDateForCollapsedSidebar
'
,
'
ancestors
'
,
]),
]),
issuableType
()
{
issuableType
()
{
return
IssuableType
.
Epic
;
return
IssuableType
.
Epic
;
...
@@ -236,9 +235,12 @@ export default {
...
@@ -236,9 +235,12 @@ export default {
@
expandSidebar=
"handleSidebarToggle"
@
expandSidebar=
"handleSidebarToggle"
@
confidentialityUpdated=
"updateConfidentialityOnIssuable($event)"
@
confidentialityUpdated=
"updateConfidentialityOnIssuable($event)"
/>
/>
<div
v-if=
"allowSubEpics"
class=
"block ancestors"
>
<sidebar-ancestors-widget
<ancestors-tree
:ancestors=
"ancestors"
:is-fetching=
"false"
data-testid=
"ancestors"
/>
v-if=
"allowSubEpics"
</div>
:iid=
"String(iid)"
:full-path=
"fullPath"
:issuable-type=
"issuableType"
/>
<div
class=
"block participants"
>
<div
class=
"block participants"
>
<sidebar-participants
<sidebar-participants
:participants=
"participants"
:participants=
"participants"
...
...
ee/app/assets/javascripts/epic/store/getters.js
View file @
47302502
...
@@ -54,5 +54,3 @@ export const isDateInvalid = (state, getters) => {
...
@@ -54,5 +54,3 @@ export const isDateInvalid = (state, getters) => {
getters
.
dueDateTimeFromMilestones
,
getters
.
dueDateTimeFromMilestones
,
);
);
};
};
export
const
ancestors
=
(
state
)
=>
(
state
.
ancestors
?
[...
state
.
ancestors
].
reverse
()
:
[]);
ee/app/assets/javascripts/epic/store/state.js
View file @
47302502
...
@@ -55,7 +55,6 @@ export default () => ({
...
@@ -55,7 +55,6 @@ export default () => ({
dueDateFromMilestones
:
''
,
dueDateFromMilestones
:
''
,
dueDate
:
''
,
dueDate
:
''
,
labels
:
[],
labels
:
[],
ancestors
:
[],
participants
:
[],
participants
:
[],
subscribed
:
false
,
subscribed
:
false
,
confidential
:
false
,
confidential
:
false
,
...
...
ee/spec/frontend/epic/components/epic_sidebar_spec.js
View file @
47302502
...
@@ -8,12 +8,14 @@ import { getStoreConfig } from 'ee/epic/store';
...
@@ -8,12 +8,14 @@ import { getStoreConfig } from 'ee/epic/store';
import
epicUtils
from
'
ee/epic/utils/epic_utils
'
;
import
epicUtils
from
'
ee/epic/utils/epic_utils
'
;
import
SidebarAncestorsWidget
from
'
ee_component/sidebar/components/ancestors_tree/sidebar_ancestors_widget.vue
'
;
import
{
parsePikadayDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
parsePikadayDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
SidebarReferenceWidget
from
'
~/sidebar/components/reference/sidebar_reference_widget.vue
'
;
import
SidebarReferenceWidget
from
'
~/sidebar/components/reference/sidebar_reference_widget.vue
'
;
import
SidebarSubscriptionsWidget
from
'
~/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
'
;
import
SidebarSubscriptionsWidget
from
'
~/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
'
;
import
{
mockEpicMeta
,
mockEpicData
,
mockAncestors
}
from
'
../mock_data
'
;
import
{
mockEpicMeta
,
mockEpicData
}
from
'
../mock_data
'
;
describe
(
'
EpicSidebarComponent
'
,
()
=>
{
describe
(
'
EpicSidebarComponent
'
,
()
=>
{
const
originalUserId
=
gon
.
current_user_id
;
const
originalUserId
=
gon
.
current_user_id
;
...
@@ -28,7 +30,6 @@ describe('EpicSidebarComponent', () => {
...
@@ -28,7 +30,6 @@ describe('EpicSidebarComponent', () => {
...
state
,
...
state
,
...
mockEpicMeta
,
...
mockEpicMeta
,
...
mockEpicData
,
...
mockEpicData
,
ancestors
:
mockAncestors
,
},
},
actions
:
{
...
actions
,
...
actionMocks
},
actions
:
{
...
actions
,
...
actionMocks
},
...
@@ -218,9 +219,8 @@ describe('EpicSidebarComponent', () => {
...
@@ -218,9 +219,8 @@ describe('EpicSidebarComponent', () => {
expect
(
wrapper
.
find
(
SidebarReferenceWidget
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
SidebarReferenceWidget
).
exists
()).
toBe
(
true
);
});
});
describe
(
'
when sub-epics feature is available
'
,
()
=>
{
describe
(
'
when sub-epics feature is not available
'
,
()
=>
{
it
(
'
renders ancestors list
'
,
async
()
=>
{
it
(
'
does not renders ancestors list
'
,
async
()
=>
{
store
.
dispatch
(
'
toggleSidebarFlag
'
,
false
);
store
.
dispatch
(
'
setEpicMeta
'
,
{
store
.
dispatch
(
'
setEpicMeta
'
,
{
...
mockEpicMeta
,
...
mockEpicMeta
,
allowSubEpics
:
false
,
allowSubEpics
:
false
,
...
@@ -228,20 +228,13 @@ describe('EpicSidebarComponent', () => {
...
@@ -228,20 +228,13 @@ describe('EpicSidebarComponent', () => {
await
nextTick
();
await
nextTick
();
expect
(
wrapper
.
find
(
'
.block.ancestors
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
SidebarAncestorsWidget
).
exists
()).
toBe
(
false
);
});
});
});
});
describe
(
'
when sub-epics feature is not available
'
,
()
=>
{
describe
(
'
when sub-epics feature is available
'
,
()
=>
{
it
(
'
does not render ancestors list
'
,
async
()
=>
{
it
(
'
renders ancestors list
'
,
()
=>
{
wrapper
.
vm
.
$store
.
dispatch
(
'
toggleSidebarFlag
'
,
false
);
expect
(
wrapper
.
find
(
SidebarAncestorsWidget
).
exists
()).
toBe
(
true
);
await
nextTick
();
const
ancestorsEl
=
wrapper
.
find
(
'
[data-testid="ancestors"]
'
);
expect
(
ancestorsEl
.
exists
()).
toBe
(
true
);
expect
(
ancestorsEl
.
props
(
'
ancestors
'
)).
toEqual
([...
mockAncestors
].
reverse
());
});
});
});
});
...
...
ee/spec/frontend/epic/store/getters_spec.js
View file @
47302502
...
@@ -259,21 +259,4 @@ describe('Epic Store Getters', () => {
...
@@ -259,21 +259,4 @@ describe('Epic Store Getters', () => {
).
toBe
(
false
);
).
toBe
(
false
);
});
});
});
});
describe
(
'
ancestors
'
,
()
=>
{
it
(
'
returns `ancestors` from state when ancestors is not null
'
,
()
=>
{
const
ancestors
=
getters
.
ancestors
({
ancestors
:
[{
id
:
1
,
title
:
'
Parent
'
}],
});
expect
(
ancestors
).
toHaveLength
(
1
);
});
it
(
'
returns empty array when `ancestors` within state is null
'
,
()
=>
{
const
ancestors
=
getters
.
ancestors
({});
expect
(
ancestors
).
not
.
toBeNull
();
expect
(
ancestors
).
toHaveLength
(
0
);
});
});
});
});
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