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
7389c105
Commit
7389c105
authored
Sep 22, 2020
by
Luke Duncalfe
Committed by
Dmytro Zaporozhets (DZ)
Sep 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose copyState on GraphQL DesignCollection type
https://gitlab.com/gitlab-org/gitlab/-/issues/13426
parent
9930ad74
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
127 additions
and
1 deletion
+127
-1
app/graphql/types/design_management/design_collection_copy_state_enum.rb
...es/design_management/design_collection_copy_state_enum.rb
+27
-0
app/graphql/types/design_management/design_collection_type.rb
...graphql/types/design_management/design_collection_type.rb
+4
-0
changelogs/unreleased/13426-graphql.yml
changelogs/unreleased/13426-graphql.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+25
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+43
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+11
-0
spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb
...sign_management/design_collection_copy_state_enum_spec.rb
+11
-0
spec/graphql/types/design_management/design_collection_type_spec.rb
...ql/types/design_management/design_collection_type_spec.rb
+1
-1
No files found.
app/graphql/types/design_management/design_collection_copy_state_enum.rb
0 → 100644
View file @
7389c105
# frozen_string_literal: true
module
Types
module
DesignManagement
class
DesignCollectionCopyStateEnum
<
BaseEnum
graphql_name
'DesignCollectionCopyState'
description
'Copy state of a DesignCollection'
DESCRIPTION_VARIANTS
=
{
in_progress:
'is being copied'
,
error:
'encountered an error during a copy'
,
ready:
'has no copy in progress'
}.
freeze
def
self
.
description_variant
(
copy_state
)
DESCRIPTION_VARIANTS
[
copy_state
.
to_sym
]
||
(
raise
ArgumentError
,
"Unknown copy state:
#{
copy_state
}
"
)
end
::
DesignManagement
::
DesignCollection
.
state_machines
[
:copy_state
].
states
.
keys
.
each
do
|
copy_state
|
value
copy_state
.
upcase
,
value:
copy_state
.
to_s
,
description:
"The DesignCollection
#{
description_variant
(
copy_state
)
}
"
end
end
end
end
app/graphql/types/design_management/design_collection_type.rb
View file @
7389c105
...
...
@@ -39,6 +39,10 @@ module Types
null:
true
,
resolver:
::
Resolvers
::
DesignManagement
::
DesignResolver
,
description:
'Find a specific design'
field
:copy_state
,
::
Types
::
DesignManagement
::
DesignCollectionCopyStateEnum
,
null:
true
,
description:
'Copy state of the design collection'
end
end
end
changelogs/unreleased/13426-graphql.yml
0 → 100644
View file @
7389c105
---
title
:
Add DesignCollection copyState GraphQL field
merge_request
:
42919
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
7389c105
...
...
@@ -3919,6 +3919,11 @@ type DesignAtVersionEdge {
A collection of designs
"""
type
DesignCollection
{
"""
Copy
state
of
the
design
collection
"""
copyState
:
DesignCollectionCopyState
"""
Find
a
specific
design
"""
...
...
@@ -4046,6 +4051,26 @@ type DesignCollection {
):
DesignVersionConnection
!
}
"""
Copy state of a DesignCollection
"""
enum
DesignCollectionCopyState
{
"""
The
DesignCollection
encountered
an
error
during
a
copy
"""
ERROR
"""
The
DesignCollection
is
being
copied
"""
IN_PROGRESS
"""
The
DesignCollection
has
no
copy
in
progress
"""
READY
}
"""
The connection type for Design.
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
7389c105
...
...
@@ -10789,6 +10789,20 @@
"name": "DesignCollection",
"description": "A collection of designs",
"fields": [
{
"name": "copyState",
"description": "Copy state of the design collection",
"args": [
],
"type": {
"kind": "ENUM",
"name": "DesignCollectionCopyState",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "design",
"description": "Find a specific design",
...
...
@@ -11106,6 +11120,35 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "DesignCollectionCopyState",
"description": "Copy state of a DesignCollection",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "READY",
"description": "The DesignCollection has no copy in progress",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "IN_PROGRESS",
"description": "The DesignCollection is being copied",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "ERROR",
"description": "The DesignCollection encountered an error during a copy",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "DesignConnection",
doc/api/graphql/reference/index.md
View file @
7389c105
...
...
@@ -685,6 +685,7 @@ A collection of designs.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`copyState`
| DesignCollectionCopyState | Copy state of the design collection |
|
`design`
| Design | Find a specific design |
|
`designAtVersion`
| DesignAtVersion | Find a design as of a version |
|
`issue`
| Issue! | Issue associated with the design collection |
...
...
@@ -3027,6 +3028,16 @@ Mode of a commit action.
|
`PASSED_VALIDATION`
| Site validation process finished successfully |
|
`PENDING_VALIDATION`
| Site validation process has not started |
### DesignCollectionCopyState
Copy state of a DesignCollection.
| Value | Description |
| ----- | ----------- |
|
`ERROR`
| The DesignCollection encountered an error during a copy |
|
`IN_PROGRESS`
| The DesignCollection is being copied |
|
`READY`
| The DesignCollection has no copy in progress |
### DesignVersionEvent
Mutation event of a design within a version.
...
...
spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb
0 → 100644
View file @
7389c105
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'DesignCollectionCopyState'
]
do
it
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'DesignCollectionCopyState'
)
}
it
'exposes the correct event states'
do
expect
(
described_class
.
values
.
keys
).
to
match_array
(
%w(READY IN_PROGRESS ERROR)
)
end
end
spec/graphql/types/design_management/design_collection_type_spec.rb
View file @
7389c105
...
...
@@ -6,7 +6,7 @@ RSpec.describe GitlabSchema.types['DesignCollection'] do
it
{
expect
(
described_class
).
to
require_graphql_authorizations
(
:read_design
)
}
it
'has the expected fields'
do
expected_fields
=
%i[project issue designs versions version designAtVersion design]
expected_fields
=
%i[project issue designs versions version designAtVersion design
copyState
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
end
...
...
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