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
ccde8c3d
Commit
ccde8c3d
authored
Oct 22, 2020
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swimlanes - Fix url encoding when adding group_by param
parent
031cd454
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+2
-2
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+15
-2
No files found.
ee/app/assets/javascripts/boards/stores/actions.js
View file @
ccde8c3d
...
...
@@ -4,7 +4,7 @@ import axios from '~/lib/utils/axios_utils';
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
historyPushState
,
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
set
UrlParams
,
removeParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
merge
UrlParams
,
removeParams
}
from
'
~/lib/utils/url_utility
'
;
import
actionsCE
from
'
~/boards/stores/actions
'
;
import
{
BoardType
,
ListType
}
from
'
~/boards/constants
'
;
import
{
EpicFilterType
,
GroupByParamType
}
from
'
../constants
'
;
...
...
@@ -307,7 +307,7 @@ export default {
commit
(
types
.
TOGGLE_EPICS_SWIMLANES
);
if
(
state
.
isShowingEpicsSwimlanes
)
{
historyPushState
(
set
UrlParams
({
group_by
:
GroupByParamType
.
epic
},
window
.
location
.
href
));
historyPushState
(
merge
UrlParams
({
group_by
:
GroupByParamType
.
epic
},
window
.
location
.
href
));
dispatch
(
'
fetchEpicsSwimlanes
'
,
{});
}
else
if
(
!
gon
.
features
.
graphqlBoardLists
)
{
historyPushState
(
removeParams
([
'
group_by
'
]));
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
ccde8c3d
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
boardsStoreEE
from
'
ee/boards/stores/boards_store_ee
'
;
import
actions
,
{
gqlClient
}
from
'
ee/boards/stores/actions
'
;
import
*
as
types
from
'
ee/boards/stores/mutation_types
'
;
...
...
@@ -7,7 +8,7 @@ import { GroupByParamType } from 'ee/boards/constants';
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
*
as
typesCE
from
'
~/boards/stores/mutation_types
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
{
set
UrlParams
,
removeParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
merge
UrlParams
,
removeParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
ListType
}
from
'
~/boards/constants
'
;
import
{
formatListIssues
}
from
'
~/boards/boards_util
'
;
import
{
...
...
@@ -448,6 +449,10 @@ describe('fetchIssuesForEpic', () => {
describe
(
'
toggleEpicSwimlanes
'
,
()
=>
{
it
(
'
should commit mutation TOGGLE_EPICS_SWIMLANES
'
,
()
=>
{
global
.
jsdom
.
reconfigure
({
url
:
`
${
TEST_HOST
}
/groups/gitlab-org/-/boards/1?group_by=epic`
,
});
const
state
=
{
isShowingEpicsSwimlanes
:
false
,
endpoints
:
{
...
...
@@ -464,11 +469,16 @@ describe('toggleEpicSwimlanes', () => {
[],
()
=>
{
expect
(
commonUtils
.
historyPushState
).
toHaveBeenCalledWith
(
removeParams
([
'
group_by
'
]));
expect
(
global
.
window
.
location
.
href
).
toBe
(
`
${
TEST_HOST
}
/groups/gitlab-org/-/boards/1`
);
},
);
});
it
(
'
should dispatch fetchEpicsSwimlanes action when isShowingEpicsSwimlanes is true
'
,
()
=>
{
global
.
jsdom
.
reconfigure
({
url
:
`
${
TEST_HOST
}
/groups/gitlab-org/-/boards/1`
,
});
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
({});
const
state
=
{
...
...
@@ -487,7 +497,10 @@ describe('toggleEpicSwimlanes', () => {
[{
type
:
'
fetchEpicsSwimlanes
'
,
payload
:
{}
}],
()
=>
{
expect
(
commonUtils
.
historyPushState
).
toHaveBeenCalledWith
(
setUrlParams
({
group_by
:
GroupByParamType
.
epic
},
window
.
location
.
href
),
mergeUrlParams
({
group_by
:
GroupByParamType
.
epic
},
window
.
location
.
href
),
);
expect
(
global
.
window
.
location
.
href
).
toBe
(
`
${
TEST_HOST
}
/groups/gitlab-org/-/boards/1?group_by=epic`
,
);
},
);
...
...
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