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
2262bd1c
Commit
2262bd1c
authored
Jul 14, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add confidential to graphQL for notes creation
- optional confidentional param - update the documentation
parent
362fa7b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
2 deletions
+60
-2
app/graphql/mutations/notes/create/base.rb
app/graphql/mutations/notes/create/base.rb
+7
-1
changelogs/unreleased/207473-create-confidential-notes-graphql.yml
...s/unreleased/207473-create-confidential-notes-graphql.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+15
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+30
-0
spec/requests/api/graphql/mutations/notes/create/note_spec.rb
.../requests/api/graphql/mutations/notes/create/note_spec.rb
+3
-1
No files found.
app/graphql/mutations/notes/create/base.rb
View file @
2262bd1c
...
@@ -18,6 +18,11 @@ module Mutations
...
@@ -18,6 +18,11 @@ module Mutations
required:
true
,
required:
true
,
description:
copy_field_description
(
Types
::
Notes
::
NoteType
,
:body
)
description:
copy_field_description
(
Types
::
Notes
::
NoteType
,
:body
)
argument
:confidential
,
GraphQL
::
BOOLEAN_TYPE
,
required:
false
,
description:
'The confidentiality flag of a note. Default is false.'
def
resolve
(
args
)
def
resolve
(
args
)
noteable
=
authorized_find!
(
id:
args
[
:noteable_id
])
noteable
=
authorized_find!
(
id:
args
[
:noteable_id
])
...
@@ -40,7 +45,8 @@ module Mutations
...
@@ -40,7 +45,8 @@ module Mutations
def
create_note_params
(
noteable
,
args
)
def
create_note_params
(
noteable
,
args
)
{
{
noteable:
noteable
,
noteable:
noteable
,
note:
args
[
:body
]
note:
args
[
:body
],
confidential:
args
[
:confidential
]
}
}
end
end
end
end
...
...
changelogs/unreleased/207473-create-confidential-notes-graphql.yml
0 → 100644
View file @
2262bd1c
---
title
:
Add confidential attribute to graphQL for notes creation
merge_request
:
36799
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
2262bd1c
...
@@ -1691,6 +1691,11 @@ input CreateDiffNoteInput {
...
@@ -1691,6 +1691,11 @@ input CreateDiffNoteInput {
"""
"""
clientMutationId
:
String
clientMutationId
:
String
"""
The
confidentiality
flag
of
a
note
.
Default
is
false
.
"""
confidential
:
Boolean
"""
"""
The
global
id
of
the
resource
to
add
a
note
to
The
global
id
of
the
resource
to
add
a
note
to
"""
"""
...
@@ -1816,6 +1821,11 @@ input CreateImageDiffNoteInput {
...
@@ -1816,6 +1821,11 @@ input CreateImageDiffNoteInput {
"""
"""
clientMutationId
:
String
clientMutationId
:
String
"""
The
confidentiality
flag
of
a
note
.
Default
is
false
.
"""
confidential
:
Boolean
"""
"""
The
global
id
of
the
resource
to
add
a
note
to
The
global
id
of
the
resource
to
add
a
note
to
"""
"""
...
@@ -1916,6 +1926,11 @@ input CreateNoteInput {
...
@@ -1916,6 +1926,11 @@ input CreateNoteInput {
"""
"""
clientMutationId
:
String
clientMutationId
:
String
"""
The
confidentiality
flag
of
a
note
.
Default
is
false
.
"""
confidential
:
Boolean
"""
"""
The
global
id
of
the
discussion
this
note
is
in
reply
to
The
global
id
of
the
discussion
this
note
is
in
reply
to
"""
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
2262bd1c
...
@@ -4496,6 +4496,16 @@
...
@@ -4496,6 +4496,16 @@
},
},
"defaultValue": null
"defaultValue": null
},
},
{
"name": "confidential",
"description": "The confidentiality flag of a note. Default is false.",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null
},
{
{
"name": "position",
"name": "position",
"description": "The position of this note on a diff",
"description": "The position of this note on a diff",
...
@@ -4834,6 +4844,16 @@
...
@@ -4834,6 +4844,16 @@
},
},
"defaultValue": null
"defaultValue": null
},
},
{
"name": "confidential",
"description": "The confidentiality flag of a note. Default is false.",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null
},
{
{
"name": "position",
"name": "position",
"description": "The position of this note on a diff",
"description": "The position of this note on a diff",
...
@@ -5106,6 +5126,16 @@
...
@@ -5106,6 +5126,16 @@
},
},
"defaultValue": null
"defaultValue": null
},
},
{
"name": "confidential",
"description": "The confidentiality flag of a note. Default is false.",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null
},
{
{
"name": "discussionId",
"name": "discussionId",
"description": "The global id of the discussion this note is in reply to",
"description": "The global id of the discussion this note is in reply to",
spec/requests/api/graphql/mutations/notes/create/note_spec.rb
View file @
2262bd1c
...
@@ -13,7 +13,8 @@ RSpec.describe 'Adding a Note' do
...
@@ -13,7 +13,8 @@ RSpec.describe 'Adding a Note' do
variables
=
{
variables
=
{
noteable_id:
GitlabSchema
.
id_from_object
(
noteable
).
to_s
,
noteable_id:
GitlabSchema
.
id_from_object
(
noteable
).
to_s
,
discussion_id:
(
GitlabSchema
.
id_from_object
(
discussion
).
to_s
if
discussion
),
discussion_id:
(
GitlabSchema
.
id_from_object
(
discussion
).
to_s
if
discussion
),
body:
'Body text'
body:
'Body text'
,
confidential:
true
}
}
graphql_mutation
(
:create_note
,
variables
)
graphql_mutation
(
:create_note
,
variables
)
...
@@ -40,6 +41,7 @@ RSpec.describe 'Adding a Note' do
...
@@ -40,6 +41,7 @@ RSpec.describe 'Adding a Note' do
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
expect
(
mutation_response
[
'note'
][
'body'
]).
to
eq
(
'Body text'
)
expect
(
mutation_response
[
'note'
][
'body'
]).
to
eq
(
'Body text'
)
expect
(
mutation_response
[
'note'
][
'confidential'
]).
to
eq
(
true
)
end
end
describe
'creating Notes in reply to a discussion'
do
describe
'creating Notes in reply to a discussion'
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