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
e3f23968
Commit
e3f23968
authored
Jan 13, 2021
by
Natalia Tepluhina
Committed by
Nicolò Maria Mezzopera
Jan 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make swimlanes choice persisting after board has been edited [RUN AS-IF-FOSS]
parent
4d647a21
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
36 deletions
+53
-36
app/assets/javascripts/boards/components/board_form.vue
app/assets/javascripts/boards/components/board_form.vue
+13
-8
app/assets/javascripts/boards/graphql/board_create.mutation.graphql
.../javascripts/boards/graphql/board_create.mutation.graphql
+2
-0
app/assets/javascripts/boards/graphql/board_update.mutation.graphql
.../javascripts/boards/graphql/board_update.mutation.graphql
+2
-2
changelogs/unreleased/282299-grouping-swimlanes-choice-should-persist-after-board-has-been-edit.yml
...lanes-choice-should-persist-after-board-has-been-edit.yml
+5
-0
spec/frontend/boards/components/board_form_spec.js
spec/frontend/boards/components/board_form_spec.js
+31
-26
No files found.
app/assets/javascripts/boards/components/board_form.vue
View file @
e3f23968
...
...
@@ -2,8 +2,9 @@
import
{
GlModal
}
from
'
@gitlab/ui
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
import
{
deprecatedCreateFlash
as
Flash
}
from
'
~/flash
'
;
import
{
visitUrl
,
stripFinalUrlSegment
}
from
'
~/lib/utils/url_utility
'
;
import
{
getIdFromGraphQLId
,
convertToGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
import
{
getParameterByName
}
from
'
~/lib/utils/common_utils
'
;
import
{
convertToGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
{
fullLabelId
,
fullBoardId
}
from
'
../boards_util
'
;
...
...
@@ -216,9 +217,15 @@ export default {
variables
:
{
input
:
this
.
mutationVariables
},
});
return
this
.
board
.
id
?
getIdFromGraphQLId
(
response
.
data
.
updateBoard
.
board
.
id
)
:
getIdFromGraphQLId
(
response
.
data
.
createBoard
.
board
.
id
);
if
(
!
this
.
board
.
id
)
{
return
response
.
data
.
createBoard
.
board
.
webPath
;
}
const
path
=
response
.
data
.
updateBoard
.
board
.
webPath
;
const
param
=
getParameterByName
(
'
group_by
'
)
?
`?group_by=
${
getParameterByName
(
'
group_by
'
)}
`
:
''
;
return
`
${
path
}${
param
}
`
;
},
async
submit
()
{
if
(
this
.
board
.
name
.
length
===
0
)
return
;
...
...
@@ -239,9 +246,7 @@ export default {
}
}
else
{
try
{
const
path
=
await
this
.
createOrUpdateBoard
();
const
strippedUrl
=
stripFinalUrlSegment
(
window
.
location
.
href
);
const
url
=
strippedUrl
.
includes
(
'
boards
'
)
?
`
${
path
}
`
:
`boards/
${
path
}
`
;
const
url
=
await
this
.
createOrUpdateBoard
();
visitUrl
(
url
);
}
catch
{
Flash
(
this
.
$options
.
i18n
.
saveErrorMessage
);
...
...
app/assets/javascripts/boards/graphql/board_create.mutation.graphql
View file @
e3f23968
...
...
@@ -2,6 +2,8 @@ mutation createBoard($input: CreateBoardInput!) {
createBoard
(
input
:
$input
)
{
board
{
id
webPath
}
errors
}
}
app/assets/javascripts/boards/graphql/board_update.mutation.graphql
View file @
e3f23968
...
...
@@ -2,8 +2,8 @@ mutation UpdateBoard($input: UpdateBoardInput!) {
updateBoard
(
input
:
$input
)
{
board
{
id
hideClosedList
hideBacklogList
webPath
}
errors
}
}
changelogs/unreleased/282299-grouping-swimlanes-choice-should-persist-after-board-has-been-edit.yml
0 → 100644
View file @
e3f23968
---
title
:
Resolve Grouping/swimlanes choice should persist after board has been edited
merge_request
:
51317
author
:
type
:
changed
spec/frontend/boards/components/board_form_spec.js
View file @
e3f23968
...
...
@@ -159,7 +159,7 @@ describe('BoardForm', () => {
beforeEach
(()
=>
{
mutate
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
createBoard
:
{
board
:
{
id
:
'
gid://gitlab/Board/123
'
}
},
createBoard
:
{
board
:
{
id
:
'
gid://gitlab/Board/123
'
,
webPath
:
'
test-path
'
}
},
},
});
});
...
...
@@ -174,27 +174,6 @@ describe('BoardForm', () => {
});
it
(
'
calls a correct GraphQL mutation and redirects to correct page from existing board
'
,
async
()
=>
{
window
.
location
=
new
URL
(
'
https://test/boards/1
'
);
createComponent
({
canAdminBoard
:
true
});
fillForm
();
await
waitForPromises
();
expect
(
mutate
).
toHaveBeenCalledWith
({
mutation
:
createBoardMutation
,
variables
:
{
input
:
expect
.
objectContaining
({
name
:
'
test
'
,
}),
},
});
await
waitForPromises
();
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
123
'
);
});
it
(
'
calls a correct GraphQL mutation and redirects to correct page from boards list
'
,
async
()
=>
{
window
.
location
=
new
URL
(
'
https://test/boards
'
);
createComponent
({
canAdminBoard
:
true
});
fillForm
();
...
...
@@ -210,7 +189,7 @@ describe('BoardForm', () => {
});
await
waitForPromises
();
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
boards/123
'
);
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
test-path
'
);
});
it
(
'
shows an error flash if GraphQL mutation fails
'
,
async
()
=>
{
...
...
@@ -261,10 +240,10 @@ describe('BoardForm', () => {
});
});
it
(
'
calls GraphQL mutation with correct parameters
'
,
async
()
=>
{
it
(
'
calls GraphQL mutation with correct parameters
when issues are not grouped
'
,
async
()
=>
{
mutate
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
updateBoard
:
{
board
:
{
id
:
'
gid://gitlab/Board/321
'
}
},
updateBoard
:
{
board
:
{
id
:
'
gid://gitlab/Board/321
'
,
webPath
:
'
test-path
'
}
},
},
});
window
.
location
=
new
URL
(
'
https://test/boards/1
'
);
...
...
@@ -284,7 +263,33 @@ describe('BoardForm', () => {
});
await
waitForPromises
();
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
321
'
);
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
test-path
'
);
});
it
(
'
calls GraphQL mutation with correct parameters when issues are grouped by epic
'
,
async
()
=>
{
mutate
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
updateBoard
:
{
board
:
{
id
:
'
gid://gitlab/Board/321
'
,
webPath
:
'
test-path
'
}
},
},
});
window
.
location
=
new
URL
(
'
https://test/boards/1?group_by=epic
'
);
createComponent
({
canAdminBoard
:
true
});
findInput
().
trigger
(
'
keyup.enter
'
,
{
metaKey
:
true
});
await
waitForPromises
();
expect
(
mutate
).
toHaveBeenCalledWith
({
mutation
:
updateBoardMutation
,
variables
:
{
input
:
expect
.
objectContaining
({
id
:
`gid://gitlab/Board/
${
currentBoard
.
id
}
`
,
}),
},
});
await
waitForPromises
();
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
test-path?group_by=epic
'
);
});
it
(
'
shows an error flash if GraphQL mutation fails
'
,
async
()
=>
{
...
...
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