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
168d295e
Commit
168d295e
authored
Jul 09, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swimlanes - Fetch more epics button
Review feedback
parent
0b9519b3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
30 deletions
+30
-30
ee/app/assets/javascripts/boards/components/epic_lane.vue
ee/app/assets/javascripts/boards/components/epic_lane.vue
+7
-5
ee/app/assets/javascripts/boards/components/epics_swimlanes.vue
.../assets/javascripts/boards/components/epics_swimlanes.vue
+1
-5
ee/app/assets/javascripts/boards/stores/mutations.js
ee/app/assets/javascripts/boards/stores/mutations.js
+1
-0
ee/spec/frontend/boards/components/epic_lane_spec.js
ee/spec/frontend/boards/components/epic_lane_spec.js
+15
-16
ee/spec/frontend/boards/components/epics_swimlanes_spec.js
ee/spec/frontend/boards/components/epics_swimlanes_spec.js
+3
-3
ee/spec/frontend/boards/stores/mutations_spec.js
ee/spec/frontend/boards/stores/mutations_spec.js
+3
-1
No files found.
ee/app/assets/javascripts/boards/components/epic_lane.vue
View file @
168d295e
...
@@ -87,11 +87,14 @@ export default {
...
@@ -87,11 +87,14 @@ export default {
shouldDisplay
()
{
shouldDisplay
()
{
return
this
.
issuesCount
>
0
||
this
.
isLoading
;
return
this
.
issuesCount
>
0
||
this
.
isLoading
;
},
},
showUnassignedLane
()
{
return
!
this
.
isCollapsed
&&
this
.
issuesCount
>
0
;
},
},
},
watch
:
{
watch
:
{
filterParams
:
{
'
filterParams.epicId
'
:
{
handler
()
{
handler
(
epicId
)
{
if
(
!
this
.
filterParams
.
epicId
||
this
.
filterParams
.
epicId
===
this
.
epic
.
id
)
{
if
(
!
epicId
||
epicId
===
this
.
epic
.
id
)
{
this
.
fetchIssuesForEpic
(
this
.
epic
.
id
);
this
.
fetchIssuesForEpic
(
this
.
epic
.
id
);
}
}
},
},
...
@@ -134,7 +137,6 @@ export default {
...
@@ -134,7 +137,6 @@ export default {
class=
"gl-mr-2 gl-cursor-pointer"
class=
"gl-mr-2 gl-cursor-pointer"
category=
"tertiary"
category=
"tertiary"
size=
"small"
size=
"small"
data-testid=
"epic-lane-chevron"
@
click=
"toggleCollapsed"
@
click=
"toggleCollapsed"
/>
/>
<h4
<h4
...
@@ -165,7 +167,7 @@ export default {
...
@@ -165,7 +167,7 @@ export default {
</div>
</div>
</div>
</div>
<div
<div
v-if=
"
!isCollapsed && issuesCount > 0
"
v-if=
"
showUnassignedLane
"
class=
"gl-display-flex gl-pb-5 board-epic-lane-issues"
class=
"gl-display-flex gl-pb-5 board-epic-lane-issues"
data-testid=
"board-epic-lane-issues"
data-testid=
"board-epic-lane-issues"
>
>
...
...
ee/app/assets/javascripts/boards/components/epics_swimlanes.vue
View file @
168d295e
...
@@ -123,11 +123,7 @@ export default {
...
@@ -123,11 +123,7 @@ export default {
watch
:
{
watch
:
{
filterParams
:
{
filterParams
:
{
handler
()
{
handler
()
{
Promise
.
all
(
Promise
.
all
(
this
.
epics
.
map
((
epic
)
=>
this
.
fetchIssuesForEpic
(
epic
.
id
)))
this
.
epics
.
map
((
epic
)
=>
{
return
this
.
fetchIssuesForEpic
(
epic
.
id
);
}),
)
.
then
(()
=>
this
.
doneLoadingSwimlanesItems
())
.
then
(()
=>
this
.
doneLoadingSwimlanesItems
())
.
catch
(()
=>
{});
.
catch
(()
=>
{});
},
},
...
...
ee/app/assets/javascripts/boards/stores/mutations.js
View file @
168d295e
...
@@ -92,6 +92,7 @@ export default {
...
@@ -92,6 +92,7 @@ export default {
...
state
.
epicsSwimlanesFetchInProgress
,
...
state
.
epicsSwimlanesFetchInProgress
,
listItemsFetchInProgress
:
false
,
listItemsFetchInProgress
:
false
,
});
});
state
.
error
=
undefined
;
},
},
[
mutationTypes
.
RECEIVE_BOARD_LISTS_SUCCESS
]:
(
state
,
boardLists
)
=>
{
[
mutationTypes
.
RECEIVE_BOARD_LISTS_SUCCESS
]:
(
state
,
boardLists
)
=>
{
...
...
ee/spec/frontend/boards/components/epic_lane_spec.js
View file @
168d295e
import
{
GlIcon
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlIcon
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
EpicLane
from
'
ee/boards/components/epic_lane.vue
'
;
import
EpicLane
from
'
ee/boards/components/epic_lane.vue
'
;
import
IssuesLaneList
from
'
ee/boards/components/issues_lane_list.vue
'
;
import
IssuesLaneList
from
'
ee/boards/components/issues_lane_list.vue
'
;
import
getters
from
'
ee/boards/stores/getters
'
;
import
getters
from
'
ee/boards/stores/getters
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
mockEpic
,
mockLists
,
mockIssuesByListId
,
issues
}
from
'
../mock_data
'
;
import
{
mockEpic
,
mockLists
,
mockIssuesByListId
,
issues
}
from
'
../mock_data
'
;
Vue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
...
@@ -15,6 +14,8 @@ describe('EpicLane', () => {
...
@@ -15,6 +14,8 @@ describe('EpicLane', () => {
const
updateBoardEpicUserPreferencesSpy
=
jest
.
fn
();
const
updateBoardEpicUserPreferencesSpy
=
jest
.
fn
();
const
findChevronButton
=
()
=>
wrapper
.
findComponent
(
GlButton
);
const
createStore
=
({
boardItemsByListId
=
mockIssuesByListId
,
isLoading
=
false
})
=>
{
const
createStore
=
({
boardItemsByListId
=
mockIssuesByListId
,
isLoading
=
false
})
=>
{
return
new
Vuex
.
Store
({
return
new
Vuex
.
Store
({
actions
:
{
actions
:
{
...
@@ -47,15 +48,13 @@ describe('EpicLane', () => {
...
@@ -47,15 +48,13 @@ describe('EpicLane', () => {
disabled
:
false
,
disabled
:
false
,
};
};
wrapper
=
extendedWrapper
(
wrapper
=
shallowMountExtended
(
EpicLane
,
{
shallowMount
(
EpicLane
,
{
propsData
:
{
propsData
:
{
...
defaultProps
,
...
defaultProps
,
...
props
,
...
props
,
},
},
store
,
store
,
}),
});
);
};
};
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -87,7 +86,7 @@ describe('EpicLane', () => {
...
@@ -87,7 +86,7 @@ describe('EpicLane', () => {
expect
(
wrapper
.
findAll
(
IssuesLaneList
)).
toHaveLength
(
wrapper
.
props
(
'
lists
'
).
length
);
expect
(
wrapper
.
findAll
(
IssuesLaneList
)).
toHaveLength
(
wrapper
.
props
(
'
lists
'
).
length
);
expect
(
wrapper
.
vm
.
isCollapsed
).
toBe
(
false
);
expect
(
wrapper
.
vm
.
isCollapsed
).
toBe
(
false
);
wrapper
.
findByTestId
(
'
epic-lane-chevron
'
).
vm
.
$emit
(
'
click
'
);
findChevronButton
(
).
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
findAll
(
IssuesLaneList
)).
toHaveLength
(
0
);
expect
(
wrapper
.
findAll
(
IssuesLaneList
)).
toHaveLength
(
0
);
...
@@ -96,12 +95,12 @@ describe('EpicLane', () => {
...
@@ -96,12 +95,12 @@ describe('EpicLane', () => {
});
});
it
(
'
does not display loading icon when issues are not loading
'
,
()
=>
{
it
(
'
does not display loading icon when issues are not loading
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
});
});
it
(
'
displays loading icon and hides issues count when issues are loading
'
,
()
=>
{
it
(
'
displays loading icon and hides issues count when issues are loading
'
,
()
=>
{
createComponent
({
isLoading
:
true
});
createComponent
({
isLoading
:
true
});
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
findByTestId
(
'
epic-lane-issue-count
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
findByTestId
(
'
epic-lane-issue-count
'
).
exists
()).
toBe
(
false
);
});
});
...
@@ -110,7 +109,7 @@ describe('EpicLane', () => {
...
@@ -110,7 +109,7 @@ describe('EpicLane', () => {
expect
(
wrapper
.
vm
.
isCollapsed
).
toBe
(
collapsedValue
);
expect
(
wrapper
.
vm
.
isCollapsed
).
toBe
(
collapsedValue
);
wrapper
.
findByTestId
(
'
epic-lane-chevron
'
).
vm
.
$emit
(
'
click
'
);
findChevronButton
(
).
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
updateBoardEpicUserPreferencesSpy
).
toHaveBeenCalled
();
expect
(
updateBoardEpicUserPreferencesSpy
).
toHaveBeenCalled
();
...
...
ee/spec/frontend/boards/components/epics_swimlanes_spec.js
View file @
168d295e
...
@@ -146,15 +146,15 @@ describe('EpicsSwimlanes', () => {
...
@@ -146,15 +146,15 @@ describe('EpicsSwimlanes', () => {
});
});
it
(
'
displays IssueLaneList component when toggling unassigned issues lane
'
,
async
()
=>
{
it
(
'
displays IssueLaneList component when toggling unassigned issues lane
'
,
async
()
=>
{
wrapper
.
vm
.
toggleUnassignedLane
(
);
wrapper
.
findByTestId
(
'
unassigned-lane-toggle
'
).
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
findComponent
(
IssueLaneList
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
findComponent
(
IssueLaneList
).
exists
()).
toBe
(
true
);
});
});
it
(
'
displays issues icon and count for unassigned issue
'
,
()
=>
{
it
(
'
displays issues icon and count for unassigned issue
'
,
()
=>
{
expect
(
wrapper
.
findComponent
(
GlIcon
).
props
(
'
name
'
)).
to
Equal
(
'
issues
'
);
expect
(
wrapper
.
findComponent
(
GlIcon
).
props
(
'
name
'
)).
to
Be
(
'
issues
'
);
expect
(
wrapper
.
findByTestId
(
'
issues-lane-issue-count
'
).
text
()).
to
Equal
(
'
2
'
);
expect
(
wrapper
.
findByTestId
(
'
issues-lane-issue-count
'
).
text
()).
to
Be
(
'
2
'
);
});
});
it
(
'
makes non preset lists draggable
'
,
()
=>
{
it
(
'
makes non preset lists draggable
'
,
()
=>
{
...
...
ee/spec/frontend/boards/stores/mutations_spec.js
View file @
168d295e
...
@@ -140,17 +140,19 @@ describe('SET_EPICS_SWIMLANES', () => {
...
@@ -140,17 +140,19 @@ describe('SET_EPICS_SWIMLANES', () => {
});
});
describe
(
'
DONE_LOADING_SWIMLANES_ITEMS
'
,
()
=>
{
describe
(
'
DONE_LOADING_SWIMLANES_ITEMS
'
,
()
=>
{
it
(
'
set listItemsFetchInProgress to false
'
,
()
=>
{
it
(
'
set listItemsFetchInProgress to false
ans resets error
'
,
()
=>
{
state
=
{
state
=
{
...
state
,
...
state
,
epicsSwimlanesFetchInProgress
:
{
epicsSwimlanesFetchInProgress
:
{
listItemsFetchInProgress
:
true
,
listItemsFetchInProgress
:
true
,
},
},
error
:
'
Houston, we have a problem.
'
,
};
};
mutations
.
DONE_LOADING_SWIMLANES_ITEMS
(
state
);
mutations
.
DONE_LOADING_SWIMLANES_ITEMS
(
state
);
expect
(
state
.
epicsSwimlanesFetchInProgress
.
listItemsFetchInProgress
).
toBe
(
false
);
expect
(
state
.
epicsSwimlanesFetchInProgress
.
listItemsFetchInProgress
).
toBe
(
false
);
expect
(
state
.
error
).
toBe
(
undefined
);
});
});
});
});
...
...
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