Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/snippets')
-rw-r--r--app/graphql/types/snippets/blob_viewer_type.rb44
-rw-r--r--app/graphql/types/snippets/type_enum.rb4
2 files changed, 5 insertions, 43 deletions
diff --git a/app/graphql/types/snippets/blob_viewer_type.rb b/app/graphql/types/snippets/blob_viewer_type.rb
index 9e77457c843..8b73234bbd9 100644
--- a/app/graphql/types/snippets/blob_viewer_type.rb
+++ b/app/graphql/types/snippets/blob_viewer_type.rb
@@ -2,48 +2,10 @@
module Types
module Snippets
- class BlobViewerType < BaseObject # rubocop:disable Graphql/AuthorizeTypes
+ # Kept to avoid changing the type of existing fields. New fields should use
+ # ::Types::BlobViewerType directly
+ class BlobViewerType < ::Types::BlobViewerType # rubocop:disable Graphql/AuthorizeTypes
graphql_name 'SnippetBlobViewer'
- description 'Represents how the blob content should be displayed'
-
- field :type, Types::BlobViewers::TypeEnum,
- description: 'Type of blob viewer.',
- null: false
-
- field :load_async, GraphQL::BOOLEAN_TYPE,
- description: 'Shows whether the blob content is loaded asynchronously.',
- null: false
-
- field :collapsed, GraphQL::BOOLEAN_TYPE,
- description: 'Shows whether the blob should be displayed collapsed.',
- method: :collapsed?,
- null: false
-
- field :too_large, GraphQL::BOOLEAN_TYPE,
- description: 'Shows whether the blob too large to be displayed.',
- method: :too_large?,
- null: false
-
- field :render_error, GraphQL::STRING_TYPE,
- description: 'Error rendering the blob content.',
- null: true
-
- field :file_type, GraphQL::STRING_TYPE,
- description: 'Content file type.',
- method: :partial_name,
- null: false
-
- field :loading_partial_name, GraphQL::STRING_TYPE,
- description: 'Loading partial name.',
- null: false
-
- def collapsed
- !!object&.collapsed?
- end
-
- def too_large
- !!object&.too_large?
- end
end
end
end
diff --git a/app/graphql/types/snippets/type_enum.rb b/app/graphql/types/snippets/type_enum.rb
index 243f05359db..0ddd73d278d 100644
--- a/app/graphql/types/snippets/type_enum.rb
+++ b/app/graphql/types/snippets/type_enum.rb
@@ -3,8 +3,8 @@
module Types
module Snippets
class TypeEnum < BaseEnum
- value 'personal', value: 'personal'
- value 'project', value: 'project'
+ value 'personal', description: 'Snippet created independent of any project.', value: 'personal'
+ value 'project', description: 'Snippet related to a specific project.', value: 'project'
end
end
end