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
d35eea3d
Commit
d35eea3d
authored
Nov 06, 2021
by
Fernando Arias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hit graphql mutation for corpus creation
parent
13ebe8bf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
6 deletions
+21
-6
ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload.vue
...figuration/corpus_management/components/corpus_upload.vue
+5
-1
ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload_form.vue
...ation/corpus_management/components/corpus_upload_form.vue
+1
-1
ee/app/assets/javascripts/security_configuration/corpus_management/graphql/mutations/add_corpus.mutation.graphql
..._management/graphql/mutations/add_corpus.mutation.graphql
+2
-2
ee/app/assets/javascripts/security_configuration/corpus_management/graphql/mutations/corpus_create.mutation.graphql
...nagement/graphql/mutations/corpus_create.mutation.graphql
+5
-0
ee/app/assets/javascripts/security_configuration/corpus_management/graphql/resolvers/resolvers.js
...guration/corpus_management/graphql/resolvers/resolvers.js
+8
-2
No files found.
ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload.vue
View file @
d35eea3d
...
...
@@ -74,7 +74,11 @@ export default {
addCorpus
()
{
this
.
$apollo
.
mutate
({
mutation
:
addCorpusMutation
,
variables
:
{
name
:
this
.
$options
.
i18n
.
newCorpus
,
projectPath
:
this
.
projectFullPath
},
variables
:
{
name
:
this
.
$options
.
i18n
.
newCorpus
,
projectPath
:
this
.
projectFullPath
,
packageId
:
this
.
states
.
uploadState
.
uploadedPackageId
,
},
});
},
resetCorpus
()
{
...
...
ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload_form.vue
View file @
d35eea3d
...
...
@@ -30,7 +30,7 @@ export default {
corpusName
:
s__
(
'
CorpusManagement|Corpus name
'
),
uploadButtonText
:
__
(
'
Choose File...
'
),
uploadMessage
:
s__
(
'
CorpusManagement|New corpus needs to be a upload in *.zip format. Maximum
10
GB
'
,
'
CorpusManagement|New corpus needs to be a upload in *.zip format. Maximum
5
GB
'
,
),
},
data
()
{
...
...
ee/app/assets/javascripts/security_configuration/corpus_management/graphql/mutations/add_corpus.mutation.graphql
View file @
d35eea3d
mutation
addCorpus
(
$projectPath
:
ID
!,
$name
:
String
!)
{
addCorpus
(
projectPath
:
$projectPath
,
name
:
$name
)
@client
{
mutation
addCorpus
(
$projectPath
:
ID
!,
$name
:
String
!
,
$packageId
:
Int
!
)
{
addCorpus
(
projectPath
:
$projectPath
,
name
:
$name
,
packageId
:
$packageId
)
@client
{
errors
}
}
ee/app/assets/javascripts/security_configuration/corpus_management/graphql/mutations/corpus_create.mutation.graphql
0 → 100644
View file @
d35eea3d
mutation
CorpusCreate
(
$input
:
CorpusCreateInput
!)
{
corpusCreate
(
input
:
$input
)
{
errors
}
}
ee/app/assets/javascripts/security_configuration/corpus_management/graphql/resolvers/resolvers.js
View file @
d35eea3d
...
...
@@ -5,6 +5,7 @@ import axios from '~/lib/utils/axios_utils';
import
getCorpusesQuery
from
'
../queries/get_corpuses.query.graphql
'
;
import
updateProgress
from
'
../mutations/update_progress.mutation.graphql
'
;
import
uploadComplete
from
'
../mutations/upload_complete.mutation.graphql
'
;
import
corpusCreate
from
'
../mutations/corpus_create.mutation.graphql
'
;
export
default
{
Query
:
{
...
...
@@ -29,7 +30,7 @@ export default {
},
},
Mutation
:
{
addCorpus
:
(
_
,
{
name
,
projectPath
},
{
cache
})
=>
{
addCorpus
:
(
_
,
{
name
,
projectPath
,
packageId
},
{
cache
,
client
})
=>
{
const
sourceData
=
cache
.
readQuery
({
query
:
getCorpusesQuery
,
variables
:
{
projectPath
},
...
...
@@ -56,6 +57,11 @@ export default {
});
cache
.
writeQuery
({
query
:
getCorpusesQuery
,
data
,
variables
:
{
projectPath
}
});
client
.
mutate
({
mutation
:
corpusCreate
,
variables
:
{
fullPath
:
projectPath
,
packageId
},
});
},
deleteCorpus
:
(
_
,
{
name
,
projectPath
},
{
cache
})
=>
{
const
sourceData
=
cache
.
readQuery
({
...
...
@@ -99,7 +105,7 @@ export default {
uploadState
.
cancelSource
=
source
;
});
cache
.
writeQuery
({
query
:
getCorpusesQuery
,
targetData
,
variables
:
{
projectPath
}
});
cache
.
writeQuery
({
query
:
getCorpusesQuery
,
data
:
targetData
,
variables
:
{
projectPath
}
});
publishPackage
(
{
projectPath
,
name
,
version
:
0
,
fileName
:
name
,
files
},
...
...
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