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
20b65ceb
Commit
20b65ceb
authored
Nov 30, 2018
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle state param in JS
parent
f061facc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
24 deletions
+7
-24
ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js
ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js
+2
-3
ee/app/views/groups/roadmap/show.html.haml
ee/app/views/groups/roadmap/show.html.haml
+1
-1
ee/spec/javascripts/roadmap/utils/roadmap_utils_spec.js
ee/spec/javascripts/roadmap/utils/roadmap_utils_spec.js
+4
-20
No files found.
ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js
View file @
20b65ceb
...
...
@@ -184,6 +184,7 @@ export const getEpicsPathForPreset = ({
filterQueryString
=
''
,
presetType
=
''
,
timeframe
=
[],
state
=
'
all
'
,
})
=>
{
let
start
;
let
end
;
...
...
@@ -213,9 +214,7 @@ export const getEpicsPathForPreset = ({
const
startDate
=
`
${
start
.
getFullYear
()}
-
${
start
.
getMonth
()
+
1
}
-
${
start
.
getDate
()}
`
;
const
endDate
=
`
${
end
.
getFullYear
()}
-
${
end
.
getMonth
()
+
1
}
-
${
end
.
getDate
()}
`
;
epicsPath
+=
epicsPath
.
indexOf
(
'
?
'
)
>
-
1
?
'
&
'
:
'
?
'
;
epicsPath
+=
`start_date=
${
startDate
}
&end_date=
${
endDate
}
`
;
epicsPath
+=
`?state=
${
state
}
&start_date=
${
startDate
}
&end_date=
${
endDate
}
`
;
if
(
filterQueryString
)
{
epicsPath
+=
`&
${
filterQueryString
}
`
;
...
...
ee/app/views/groups/roadmap/show.html.haml
View file @
20b65ceb
...
...
@@ -9,6 +9,6 @@
-
if
@epics_count
!=
0
=
render
'shared/epic/search_bar'
,
type: :epics
,
show_roadmap_presets:
true
#js-roadmap
{
data:
{
epics_path:
group_epics_path
(
@group
,
state:
'all'
,
format: :json
),
group_id:
@group
.
id
,
empty_state_illustration:
image_path
(
'illustrations/epics/roadmap.svg'
),
has_filters_applied:
"#{has_filters_applied}"
,
new_epic_endpoint:
group_epics_path
(
@group
),
preset_type:
roadmap_layout
}
}
#js-roadmap
{
data:
{
epics_path:
group_epics_path
(
@group
,
format: :json
),
group_id:
@group
.
id
,
empty_state_illustration:
image_path
(
'illustrations/epics/roadmap.svg'
),
has_filters_applied:
"#{has_filters_applied}"
,
new_epic_endpoint:
group_epics_path
(
@group
),
preset_type:
roadmap_layout
}
}
-
else
=
render
'shared/empty_states/roadmap'
ee/spec/javascripts/roadmap/utils/roadmap_utils_spec.js
View file @
20b65ceb
...
...
@@ -149,7 +149,7 @@ describe('getEpicsPathForPreset', () => {
presetType
:
PRESET_TYPES
.
QUARTERS
,
});
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?start_date=2017-10-1&end_date=2019-3-31`
);
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?sta
te=all&sta
rt_date=2017-10-1&end_date=2019-3-31`
);
});
it
(
'
returns epics path string based on provided basePath and timeframe for Months
'
,
()
=>
{
...
...
@@ -160,7 +160,7 @@ describe('getEpicsPathForPreset', () => {
presetType
:
PRESET_TYPES
.
MONTHS
,
});
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?start_date=2017-12-1&end_date=2018-6-30`
);
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?sta
te=all&sta
rt_date=2017-12-1&end_date=2018-6-30`
);
});
it
(
'
returns epics path string based on provided basePath and timeframe for Weeks
'
,
()
=>
{
...
...
@@ -171,7 +171,7 @@ describe('getEpicsPathForPreset', () => {
presetType
:
PRESET_TYPES
.
WEEKS
,
});
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?start_date=2017-12-24&end_date=2018-2-3`
);
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?sta
te=all&sta
rt_date=2017-12-24&end_date=2018-2-3`
);
});
it
(
'
returns epics path string while preserving filterQueryString
'
,
()
=>
{
...
...
@@ -184,23 +184,7 @@ describe('getEpicsPathForPreset', () => {
});
expect
(
epicsPath
).
toBe
(
`
${
basePath
}
?start_date=2017-12-1&end_date=2018-6-30&scope=all&utf8=✓&state=opened&label_name[]=Bug`
,
);
});
it
(
'
returns epics path string when basePath already contains a query param
'
,
()
=>
{
const
basePathWithQuery
=
`
${
basePath
}
?state=all`
;
const
timeframeMonths
=
getTimeframeForMonthsView
(
new
Date
(
2018
,
0
,
1
));
const
epicsPath
=
getEpicsPathForPreset
({
basePath
:
basePathWithQuery
,
filterQueryString
,
timeframe
:
timeframeMonths
,
presetType
:
PRESET_TYPES
.
MONTHS
,
});
expect
(
epicsPath
).
toBe
(
`
${
basePathWithQuery
}
&start_date=2017-12-1&end_date=2018-6-30&scope=all&utf8=✓&state=opened&label_name[]=Bug`
,
`
${
basePath
}
?state=all&start_date=2017-12-1&end_date=2018-6-30&scope=all&utf8=✓&state=opened&label_name[]=Bug`
,
);
});
});
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