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
a8304104
Commit
a8304104
authored
Sep 15, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open sidebar after user creates a new item in boards
Changelog: fixed
parent
dbf27167
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
40 deletions
+77
-40
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+4
-1
ee/spec/features/boards/new_issue_spec.rb
ee/spec/features/boards/new_issue_spec.rb
+0
-8
ee/spec/features/epic_boards/new_epic_spec.rb
ee/spec/features/epic_boards/new_epic_spec.rb
+54
-0
spec/features/boards/new_issue_spec.rb
spec/features/boards/new_issue_spec.rb
+1
-19
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+18
-12
No files found.
app/assets/javascripts/boards/stores/actions.js
View file @
a8304104
...
@@ -603,7 +603,7 @@ export default {
...
@@ -603,7 +603,7 @@ export default {
});
});
},
},
addListItem
:
({
commit
},
{
list
,
item
,
position
,
inProgress
=
false
})
=>
{
addListItem
:
({
commit
,
dispatch
},
{
list
,
item
,
position
,
inProgress
=
false
})
=>
{
commit
(
types
.
ADD_BOARD_ITEM_TO_LIST
,
{
commit
(
types
.
ADD_BOARD_ITEM_TO_LIST
,
{
listId
:
list
.
id
,
listId
:
list
.
id
,
itemId
:
item
.
id
,
itemId
:
item
.
id
,
...
@@ -611,6 +611,9 @@ export default {
...
@@ -611,6 +611,9 @@ export default {
inProgress
,
inProgress
,
});
});
commit
(
types
.
UPDATE_BOARD_ITEM
,
item
);
commit
(
types
.
UPDATE_BOARD_ITEM
,
item
);
if
(
!
inProgress
)
{
dispatch
(
'
setActiveId
'
,
{
id
:
item
.
id
,
sidebarType
:
ISSUABLE
});
}
},
},
removeListItem
:
({
commit
},
{
listId
,
itemId
})
=>
{
removeListItem
:
({
commit
},
{
listId
,
itemId
})
=>
{
...
...
ee/spec/features/boards/new_issue_spec.rb
View file @
a8304104
...
@@ -30,10 +30,6 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -30,10 +30,6 @@ RSpec.describe 'Issue Boards new issue', :js do
it
'successfully assigns weight to newly-created issue'
do
it
'successfully assigns weight to newly-created issue'
do
create_issue_in_board_list
(
0
)
create_issue_in_board_list
(
0
)
page
.
within
(
first
(
'.board'
))
do
find
(
'.board-card'
).
click
end
page
.
within
(
first
(
'[data-testid="issue-boards-sidebar"]'
))
do
page
.
within
(
first
(
'[data-testid="issue-boards-sidebar"]'
))
do
find
(
'.weight [data-testid="edit-button"]'
).
click
find
(
'.weight [data-testid="edit-button"]'
).
click
find
(
'.weight .form-control'
).
set
(
"10
\n
"
)
find
(
'.weight .form-control'
).
set
(
"10
\n
"
)
...
@@ -50,10 +46,6 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -50,10 +46,6 @@ RSpec.describe 'Issue Boards new issue', :js do
it
'successfuly loads milestone to be added to newly created issue'
do
it
'successfuly loads milestone to be added to newly created issue'
do
create_issue_in_board_list
(
1
)
create_issue_in_board_list
(
1
)
page
.
within
(
all
(
'.board'
)[
1
])
do
find
(
'.board-card'
).
click
end
page
.
within
(
'[data-testid="sidebar-milestones"]'
)
do
page
.
within
(
'[data-testid="sidebar-milestones"]'
)
do
click_button
'Edit'
click_button
'Edit'
...
...
ee/spec/features/epic_boards/new_epic_spec.rb
0 → 100644
View file @
a8304104
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'create epic in board'
,
:js
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:epic_board
)
{
create
(
:epic_board
,
group:
group
)
}
let_it_be
(
:label
)
{
create
(
:group_label
,
group:
group
,
name:
'Label1'
)
}
let_it_be
(
:label_list
)
{
create
(
:epic_list
,
epic_board:
epic_board
,
label:
label
,
position:
0
)
}
let_it_be
(
:backlog_list
)
{
create
(
:epic_list
,
epic_board:
epic_board
,
list_type: :backlog
)
}
let_it_be
(
:closed_list
)
{
create
(
:epic_list
,
epic_board:
epic_board
,
list_type: :closed
)
}
context
'new epics in board list'
do
before
do
stub_licensed_features
(
epics:
true
)
group
.
add_maintainer
(
user
)
sign_in
(
user
)
visit_epic_boards_page
end
it
'creates new epic and opens sidebar'
do
page
.
within
(
first
(
'.board'
))
do
click_button
'New epic'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
find
(
'.form-control'
).
set
(
'epic bug'
)
click_button
'Create epic'
end
wait_for_requests
page
.
within
(
first
(
'.board .issue-count-badge-count'
))
do
expect
(
page
).
to
have_content
(
'1'
)
end
page
.
within
(
first
(
'.board-card'
))
do
epic
=
group
.
epics
.
find_by_title
(
'epic bug'
)
expect
(
page
).
to
have_content
(
epic
.
to_reference
)
expect
(
page
).
to
have_link
(
epic
.
title
,
href:
/
#{
epic_path
(
epic
)
}
/
)
end
expect
(
page
).
to
have_selector
(
'[data-testid="epic-boards-sidebar"]'
)
end
def
visit_epic_boards_page
visit
group_epic_boards_path
(
group
)
wait_for_requests
end
end
end
spec/features/boards/new_issue_spec.rb
View file @
a8304104
...
@@ -56,7 +56,7 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -56,7 +56,7 @@ RSpec.describe 'Issue Boards new issue', :js do
end
end
end
end
it
'creates new issue'
do
it
'creates new issue
and opens sidebar
'
do
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
do
click_button
'New issue'
click_button
'New issue'
end
end
...
@@ -78,20 +78,6 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -78,20 +78,6 @@ RSpec.describe 'Issue Boards new issue', :js do
expect
(
page
).
to
have_content
(
issue
.
to_reference
)
expect
(
page
).
to
have_content
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
title
,
href:
/
#{
issue_path
(
issue
)
}
/
)
expect
(
page
).
to
have_link
(
issue
.
title
,
href:
/
#{
issue_path
(
issue
)
}
/
)
end
end
end
# TODO https://gitlab.com/gitlab-org/gitlab/-/issues/323446
xit
'shows sidebar when creating new issue'
do
page
.
within
(
first
(
'.board'
))
do
click_button
'New issue'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
find
(
'.form-control'
).
set
(
'bug'
)
click_button
'Create issue'
end
wait_for_requests
expect
(
page
).
to
have_selector
(
'[data-testid="issue-boards-sidebar"]'
)
expect
(
page
).
to
have_selector
(
'[data-testid="issue-boards-sidebar"]'
)
end
end
...
@@ -108,10 +94,6 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -108,10 +94,6 @@ RSpec.describe 'Issue Boards new issue', :js do
wait_for_requests
wait_for_requests
page
.
within
(
first
(
'.board'
))
do
find
(
'.board-card'
).
click
end
page
.
within
(
'[data-testid="sidebar-labels"]'
)
do
page
.
within
(
'[data-testid="sidebar-labels"]'
)
do
click_button
'Edit'
click_button
'Edit'
...
...
spec/frontend/boards/stores/actions_spec.js
View file @
a8304104
...
@@ -1326,14 +1326,18 @@ describe('setAssignees', () => {
...
@@ -1326,14 +1326,18 @@ describe('setAssignees', () => {
});
});
describe
(
'
addListItem
'
,
()
=>
{
describe
(
'
addListItem
'
,
()
=>
{
it
(
'
should commit ADD_BOARD_ITEM_TO_LIST and UPDATE_BOARD_ITEM mutations
'
,
()
=>
{
it
(
'
should commit ADD_BOARD_ITEM_TO_LIST and UPDATE_BOARD_ITEM mutations
, dispatch setActiveId action when inProgress is false
'
,
()
=>
{
const
payload
=
{
const
payload
=
{
list
:
mockLists
[
0
],
list
:
mockLists
[
0
],
item
:
mockIssue
,
item
:
mockIssue
,
position
:
0
,
position
:
0
,
};
};
testAction
(
actions
.
addListItem
,
payload
,
{},
[
testAction
(
actions
.
addListItem
,
payload
,
{},
[
{
{
type
:
types
.
ADD_BOARD_ITEM_TO_LIST
,
type
:
types
.
ADD_BOARD_ITEM_TO_LIST
,
payload
:
{
payload
:
{
...
@@ -1344,7 +1348,9 @@ describe('addListItem', () => {
...
@@ -1344,7 +1348,9 @@ describe('addListItem', () => {
},
},
},
},
{
type
:
types
.
UPDATE_BOARD_ITEM
,
payload
:
mockIssue
},
{
type
:
types
.
UPDATE_BOARD_ITEM
,
payload
:
mockIssue
},
]);
],
[{
type
:
'
setActiveId
'
,
payload
:
{
id
:
mockIssue
.
id
,
sidebarType
:
ISSUABLE
}
}],
);
});
});
});
});
...
...
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