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
2c71dd5b
Commit
2c71dd5b
authored
Apr 29, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add confidentiality widget to graphql board sidebar
Allow user to edit issue confidentiality from board sidebar
parent
4ac79201
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
39 deletions
+66
-39
app/assets/javascripts/boards/components/board_content_sidebar.vue
...s/javascripts/boards/components/board_content_sidebar.vue
+9
-1
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+9
-0
ee/app/assets/javascripts/boards/components/epic_board_content_sidebar.vue
...ascripts/boards/components/epic_board_content_sidebar.vue
+2
-2
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+0
-9
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+0
-27
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+27
-0
spec/support/shared_examples/features/sidebar_shared_examples.rb
...pport/shared_examples/features/sidebar_shared_examples.rb
+19
-0
No files found.
app/assets/javascripts/boards/components/board_content_sidebar.vue
View file @
2c71dd5b
...
...
@@ -10,6 +10,7 @@ import BoardSidebarTitle from '~/boards/components/sidebar/board_sidebar_title.v
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
{
contentTop
}
from
'
~/lib/utils/common_utils
'
;
import
SidebarAssigneesWidget
from
'
~/sidebar/components/assignees/sidebar_assignees_widget.vue
'
;
import
SidebarConfidentialityWidget
from
'
~/sidebar/components/confidential/sidebar_confidentiality_widget.vue
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
export
default
{
...
...
@@ -18,6 +19,7 @@ export default {
GlDrawer
,
BoardSidebarTitle
,
SidebarAssigneesWidget
,
SidebarConfidentialityWidget
,
BoardSidebarTimeTracker
,
BoardSidebarLabelsSelect
,
BoardSidebarDueDate
,
...
...
@@ -50,7 +52,7 @@ export default {
},
},
methods
:
{
...
mapActions
([
'
toggleBoardItem
'
,
'
setAssignees
'
]),
...
mapActions
([
'
toggleBoardItem
'
,
'
setAssignees
'
,
'
setActiveItemConfidential
'
]),
handleClose
()
{
this
.
toggleBoardItem
({
boardItem
:
this
.
activeBoardItem
,
sidebarType
:
this
.
sidebarType
});
},
...
...
@@ -90,6 +92,12 @@ export default {
<board-sidebar-due-date
/>
<board-sidebar-labels-select
class=
"labels"
/>
<board-sidebar-weight-input
v-if=
"glFeatures.issueWeights"
class=
"weight"
/>
<sidebar-confidentiality-widget
:iid=
"activeBoardItem.iid"
:full-path=
"fullPath"
:issuable-type=
"issuableType"
@
confidentialityUpdated=
"setActiveItemConfidential($event)"
/>
<board-sidebar-subscription
class=
"subscriptions"
/>
</
template
>
</gl-drawer>
...
...
app/assets/javascripts/boards/stores/actions.js
View file @
2c71dd5b
...
...
@@ -652,6 +652,15 @@ export default {
});
},
setActiveItemConfidential
:
({
commit
,
getters
},
confidential
)
=>
{
const
{
activeBoardItem
}
=
getters
;
commit
(
types
.
UPDATE_BOARD_ITEM_BY_ID
,
{
itemId
:
activeBoardItem
.
id
,
prop
:
'
confidential
'
,
value
:
confidential
,
});
},
fetchGroupProjects
:
({
commit
,
state
},
{
search
=
''
,
fetchNext
=
false
})
=>
{
commit
(
types
.
REQUEST_GROUP_PROJECTS
,
fetchNext
);
...
...
ee/app/assets/javascripts/boards/components/epic_board_content_sidebar.vue
View file @
2c71dd5b
...
...
@@ -30,7 +30,7 @@ export default {
},
},
methods
:
{
...
mapActions
([
'
toggleBoardItem
'
,
'
setActive
Epic
Confidential
'
]),
...
mapActions
([
'
toggleBoardItem
'
,
'
setActive
Item
Confidential
'
]),
handleClose
()
{
this
.
toggleBoardItem
({
boardItem
:
this
.
activeBoardItem
,
sidebarType
:
this
.
sidebarType
});
},
...
...
@@ -67,7 +67,7 @@ export default {
:iid=
"activeBoardItem.iid"
:full-path=
"fullPath"
issuable-type=
"epic"
@
confidentialityUpdated=
"setActive
Epic
Confidential($event)"
@
confidentialityUpdated=
"setActive
Item
Confidential($event)"
/>
<board-sidebar-subscription
class=
"subscriptions"
/>
</
template
>
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
2c71dd5b
...
...
@@ -781,13 +781,4 @@ export default {
value
:
data
.
updateEpic
.
epic
.
labels
.
nodes
,
});
},
setActiveEpicConfidential
:
({
commit
,
getters
},
confidential
)
=>
{
const
{
activeBoardItem
}
=
getters
;
commit
(
typesCE
.
UPDATE_BOARD_ITEM_BY_ID
,
{
itemId
:
activeBoardItem
.
id
,
prop
:
'
confidential
'
,
value
:
confidential
,
});
},
};
ee/spec/frontend/boards/stores/actions_spec.js
View file @
2c71dd5b
...
...
@@ -1389,30 +1389,3 @@ describe('setActiveEpicLabels', () => {
await
expect
(
actions
.
setActiveEpicLabels
({
getters
},
input
)).
rejects
.
toThrow
(
Error
);
});
});
describe
(
'
setActiveEpicConfidential
'
,
()
=>
{
const
state
=
{
boardItems
:
{
[
mockEpic
.
id
]:
mockEpic
}
};
const
getters
=
{
activeBoardItem
:
mockEpic
};
it
(
'
set confidential value on epic
'
,
(
done
)
=>
{
const
payload
=
{
itemId
:
getters
.
activeBoardItem
.
id
,
prop
:
'
confidential
'
,
value
:
true
,
};
testAction
(
actions
.
setActiveEpicConfidential
,
true
,
{
...
state
,
...
getters
},
[
{
type
:
typesCE
.
UPDATE_BOARD_ITEM_BY_ID
,
payload
,
},
],
[],
done
,
);
});
});
spec/frontend/boards/stores/actions_spec.js
View file @
2c71dd5b
...
...
@@ -1535,6 +1535,33 @@ describe('setActiveItemTitle', () => {
});
});
describe
(
'
setActiveItemConfidential
'
,
()
=>
{
const
state
=
{
boardItems
:
{
[
mockIssue
.
id
]:
mockIssue
}
};
const
getters
=
{
activeBoardItem
:
mockIssue
};
it
(
'
set confidential value on board item
'
,
(
done
)
=>
{
const
payload
=
{
itemId
:
getters
.
activeBoardItem
.
id
,
prop
:
'
confidential
'
,
value
:
true
,
};
testAction
(
actions
.
setActiveItemConfidential
,
true
,
{
...
state
,
...
getters
},
[
{
type
:
types
.
UPDATE_BOARD_ITEM_BY_ID
,
payload
,
},
],
[],
done
,
);
});
});
describe
(
'
fetchGroupProjects
'
,
()
=>
{
const
state
=
{
fullPath
:
'
gitlab-org
'
,
...
...
spec/support/shared_examples/features/sidebar_shared_examples.rb
View file @
2c71dd5b
...
...
@@ -78,6 +78,25 @@ RSpec.shared_examples 'issue boards sidebar' do
end
end
context
'confidentiality'
do
it
'make issue confidential'
do
page
.
within
(
'.confidentiality'
)
do
expect
(
page
).
to
have_content
(
'Not confidential'
)
click_button
'Edit'
expect
(
page
).
to
have_css
(
'.sidebar-item-warning-message'
)
within
(
'.sidebar-item-warning-message'
)
do
click_button
'Turn on'
end
wait_for_requests
expect
(
page
).
to
have_content
(
'This issue is confidential'
)
end
end
end
context
'in time tracking'
do
it
'displays time tracking feature with default message'
do
page
.
within
(
'[data-testid="time-tracker"]'
)
do
...
...
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