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
2e4cac94
Commit
2e4cac94
authored
Jun 07, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass `presetType` prop
parent
8c53f838
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
20 deletions
+47
-20
ee/app/assets/javascripts/roadmap/components/app.vue
ee/app/assets/javascripts/roadmap/components/app.vue
+6
-0
ee/app/assets/javascripts/roadmap/components/epic_item.vue
ee/app/assets/javascripts/roadmap/components/epic_item.vue
+5
-0
ee/app/assets/javascripts/roadmap/components/epics_list_section.vue
...ets/javascripts/roadmap/components/epics_list_section.vue
+5
-0
ee/app/assets/javascripts/roadmap/components/roadmap_shell.vue
...p/assets/javascripts/roadmap/components/roadmap_shell.vue
+7
-3
spec/javascripts/roadmap/components/app_spec.js
spec/javascripts/roadmap/components/app_spec.js
+5
-2
spec/javascripts/roadmap/components/epic_item_spec.js
spec/javascripts/roadmap/components/epic_item_spec.js
+6
-2
spec/javascripts/roadmap/components/epics_list_section_spec.js
...javascripts/roadmap/components/epics_list_section_spec.js
+7
-4
spec/javascripts/roadmap/components/roadmap_shell_spec.js
spec/javascripts/roadmap/components/roadmap_shell_spec.js
+6
-9
No files found.
ee/app/assets/javascripts/roadmap/components/app.vue
View file @
2e4cac94
...
...
@@ -22,6 +22,10 @@
type
:
Object
,
required
:
true
,
},
presetType
:
{
type
:
String
,
required
:
true
,
},
hasFiltersApplied
:
{
type
:
Boolean
,
required
:
true
,
...
...
@@ -129,12 +133,14 @@
/>
<roadmap-shell
v-if=
"showRoadmap"
:preset-type=
"presetType"
:epics=
"epics"
:timeframe=
"timeframe"
:current-group-id=
"currentGroupId"
/>
<epics-list-empty
v-if=
"isEpicsListEmpty"
:preset-type=
"presetType"
:timeframe-start=
"timeframeStart"
:timeframe-end=
"timeframeEnd"
:has-filters-applied=
"hasFiltersApplied"
...
...
ee/app/assets/javascripts/roadmap/components/epic_item.vue
View file @
2e4cac94
...
...
@@ -8,6 +8,10 @@
epicItemTimeline
,
},
props
:
{
presetType
:
{
type
:
String
,
required
:
true
,
},
epic
:
{
type
:
Object
,
required
:
true
,
...
...
@@ -41,6 +45,7 @@
<epic-item-timeline
v-for=
"(timeframeItem, index) in timeframe"
:key=
"index"
:preset-type=
"presetType"
:timeframe=
"timeframe"
:timeframe-item=
"timeframeItem"
:epic=
"epic"
...
...
ee/app/assets/javascripts/roadmap/components/epics_list_section.vue
View file @
2e4cac94
...
...
@@ -13,6 +13,10 @@
SectionMixin
,
],
props
:
{
presetType
:
{
type
:
String
,
required
:
true
,
},
epics
:
{
type
:
Array
,
required
:
true
,
...
...
@@ -148,6 +152,7 @@
<epic-item
v-for=
"(epic, index) in epics"
:key=
"index"
:preset-type=
"presetType"
:epic=
"epic"
:timeframe=
"timeframe"
:current-group-id=
"currentGroupId"
...
...
ee/app/assets/javascripts/roadmap/components/roadmap_shell.vue
View file @
2e4cac94
...
...
@@ -12,6 +12,10 @@
roadmapTimelineSection
,
},
props
:
{
presetType
:
{
type
:
String
,
required
:
true
,
},
epics
:
{
type
:
Array
,
required
:
true
,
...
...
@@ -65,9 +69,7 @@
},
handleScroll
()
{
const
{
scrollTop
,
scrollLeft
,
clientHeight
,
scrollHeight
}
=
this
.
$el
;
if
(
!
this
.
noScroll
)
{
eventHub
.
$emit
(
'
epicsListScrolled
'
,
{
scrollTop
,
scrollLeft
,
clientHeight
,
scrollHeight
});
}
eventHub
.
$emit
(
'
epicsListScrolled
'
,
{
scrollTop
,
scrollLeft
,
clientHeight
,
scrollHeight
});
},
},
};
...
...
@@ -81,12 +83,14 @@
@scroll="handleScroll"
>
<roadmap-timeline-section
:preset-type=
"presetType"
:epics=
"epics"
:timeframe=
"timeframe"
:shell-width=
"shellWidth"
:list-scrollable=
"!noScroll"
/>
<epics-list-section
:preset-type=
"presetType"
:epics=
"epics"
:timeframe=
"timeframe"
:shell-width=
"shellWidth"
...
...
spec/javascripts/roadmap/components/app_spec.js
View file @
2e4cac94
...
...
@@ -7,12 +7,14 @@ import appComponent from 'ee/roadmap/components/app.vue';
import
RoadmapStore
from
'
ee/roadmap/store/roadmap_store
'
;
import
RoadmapService
from
'
ee/roadmap/service/roadmap_service
'
;
import
{
PRESET_TYPES
}
from
'
ee/roadmap/constants
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
mockTimeframe
,
mockGroupId
,
epicsPath
,
mockNewEpicEndpoint
,
rawEpics
,
mockSvgPath
}
from
'
../mock_data
'
;
import
{
mockTimeframe
Months
,
mockGroupId
,
epicsPath
,
mockNewEpicEndpoint
,
rawEpics
,
mockSvgPath
}
from
'
../mock_data
'
;
const
createComponent
=
()
=>
{
const
Component
=
Vue
.
extend
(
appComponent
);
const
timeframe
=
mockTimeframe
;
const
timeframe
=
mockTimeframe
Months
;
const
store
=
new
RoadmapStore
(
mockGroupId
,
timeframe
);
const
service
=
new
RoadmapService
(
epicsPath
);
...
...
@@ -20,6 +22,7 @@ const createComponent = () => {
return
mountComponent
(
Component
,
{
store
,
service
,
presetType
:
PRESET_TYPES
.
MONTHS
,
hasFiltersApplied
:
true
,
newEpicEndpoint
:
mockNewEpicEndpoint
,
emptyStateIllustrationPath
:
mockSvgPath
,
...
...
spec/javascripts/roadmap/components/epic_item_spec.js
View file @
2e4cac94
...
...
@@ -2,12 +2,15 @@ import Vue from 'vue';
import
epicItemComponent
from
'
ee/roadmap/components/epic_item.vue
'
;
import
{
PRESET_TYPES
}
from
'
ee/roadmap/constants
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
mockTimeframe
,
mockEpic
,
mockGroupId
,
mockShellWidth
,
mockItemWidth
}
from
'
../mock_data
'
;
import
{
mockTimeframe
Months
,
mockEpic
,
mockGroupId
,
mockShellWidth
,
mockItemWidth
}
from
'
../mock_data
'
;
const
createComponent
=
({
presetType
=
PRESET_TYPES
.
MONTHS
,
epic
=
mockEpic
,
timeframe
=
mockTimeframe
,
timeframe
=
mockTimeframe
Months
,
currentGroupId
=
mockGroupId
,
shellWidth
=
mockShellWidth
,
itemWidth
=
mockItemWidth
,
...
...
@@ -15,6 +18,7 @@ const createComponent = ({
const
Component
=
Vue
.
extend
(
epicItemComponent
);
return
mountComponent
(
Component
,
{
presetType
,
epic
,
timeframe
,
currentGroupId
,
...
...
spec/javascripts/roadmap/components/epics_list_section_spec.js
View file @
2e4cac94
...
...
@@ -3,23 +3,26 @@ import Vue from 'vue';
import
epicsListSectionComponent
from
'
ee/roadmap/components/epics_list_section.vue
'
;
import
RoadmapStore
from
'
ee/roadmap/store/roadmap_store
'
;
import
eventHub
from
'
ee/roadmap/event_hub
'
;
import
{
PRESET_TYPES
}
from
'
ee/roadmap/constants
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
rawEpics
,
mockTimeframe
,
mockGroupId
,
mockShellWidth
}
from
'
../mock_data
'
;
import
{
rawEpics
,
mockTimeframe
Months
,
mockGroupId
,
mockShellWidth
}
from
'
../mock_data
'
;
const
store
=
new
RoadmapStore
(
mockGroupId
,
mockTimeframe
);
const
store
=
new
RoadmapStore
(
mockGroupId
,
mockTimeframe
Months
,
PRESET_TYPES
.
MONTHS
);
store
.
setEpics
(
rawEpics
);
const
mockEpics
=
store
.
getEpics
();
const
createComponent
=
({
epics
=
mockEpics
,
timeframe
=
mockTimeframe
,
timeframe
=
mockTimeframe
Months
,
currentGroupId
=
mockGroupId
,
shellWidth
=
mockShellWidth
,
listScrollable
=
false
,
presetType
=
PRESET_TYPES
.
MONTHS
,
})
=>
{
const
Component
=
Vue
.
extend
(
epicsListSectionComponent
);
return
mountComponent
(
Component
,
{
presetType
,
epics
,
timeframe
,
currentGroupId
,
...
...
@@ -59,7 +62,7 @@ describe('EpicsListSectionComponent', () => {
describe
(
'
emptyRowCellStyles
'
,
()
=>
{
it
(
'
returns computed style object based on sectionItemWidth prop value
'
,
()
=>
{
expect
(
vm
.
emptyRowCellStyles
.
width
).
toBe
(
'
2
8
0px
'
);
expect
(
vm
.
emptyRowCellStyles
.
width
).
toBe
(
'
2
4
0px
'
);
});
});
...
...
spec/javascripts/roadmap/components/roadmap_shell_spec.js
View file @
2e4cac94
...
...
@@ -3,17 +3,20 @@ import Vue from 'vue';
import
roadmapShellComponent
from
'
ee/roadmap/components/roadmap_shell.vue
'
;
import
eventHub
from
'
ee/roadmap/event_hub
'
;
import
{
PRESET_TYPES
}
from
'
ee/roadmap/constants
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
mockEpic
,
mockTimeframe
,
mockGroupId
,
mockScrollBarSize
}
from
'
../mock_data
'
;
import
{
mockEpic
,
mockTimeframe
Months
,
mockGroupId
,
mockScrollBarSize
}
from
'
../mock_data
'
;
const
createComponent
=
({
epics
=
[
mockEpic
],
timeframe
=
mockTimeframe
,
timeframe
=
mockTimeframe
Months
,
currentGroupId
=
mockGroupId
,
},
el
)
=>
{
const
Component
=
Vue
.
extend
(
roadmapShellComponent
);
return
mountComponent
(
Component
,
{
presetType
:
PRESET_TYPES
.
MONTHS
,
epics
,
timeframe
,
currentGroupId
,
...
...
@@ -82,17 +85,11 @@ describe('RoadmapShellComponent', () => {
spyOn
(
eventHub
,
'
$emit
'
);
});
it
(
'
emits `epicsListScrolled` event via eventHub
when `noScroll` prop is false
'
,
()
=>
{
it
(
'
emits `epicsListScrolled` event via eventHub
'
,
()
=>
{
vm
.
noScroll
=
false
;
vm
.
handleScroll
();
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
epicsListScrolled
'
,
jasmine
.
any
(
Object
));
});
it
(
'
does not emit any event via eventHub when `noScroll` prop is true
'
,
()
=>
{
vm
.
noScroll
=
true
;
vm
.
handleScroll
();
expect
(
eventHub
.
$emit
).
not
.
toHaveBeenCalled
();
});
});
});
...
...
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