diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/graphql/types/snippets | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/graphql/types/snippets')
-rw-r--r-- | app/graphql/types/snippets/blob_viewer_type.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/graphql/types/snippets/blob_viewer_type.rb b/app/graphql/types/snippets/blob_viewer_type.rb index 50d0b0522d6..a2ffa144066 100644 --- a/app/graphql/types/snippets/blob_viewer_type.rb +++ b/app/graphql/types/snippets/blob_viewer_type.rb @@ -17,14 +17,12 @@ module Types field :collapsed, GraphQL::BOOLEAN_TYPE, description: 'Shows whether the blob should be displayed collapsed', method: :collapsed?, - null: false, - resolve: -> (viewer, _args, _ctx) { !!viewer&.collapsed? } + null: false field :too_large, GraphQL::BOOLEAN_TYPE, description: 'Shows whether the blob too large to be displayed', method: :too_large?, - null: false, - resolve: -> (viewer, _args, _ctx) { !!viewer&.too_large? } + null: false field :render_error, GraphQL::STRING_TYPE, description: 'Error rendering the blob content', @@ -38,6 +36,14 @@ module Types 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 |