summaryrefslogtreecommitdiff
path: root/app/graphql/types/ci/detailed_status_type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/ci/detailed_status_type.rb')
-rw-r--r--app/graphql/types/ci/detailed_status_type.rb47
1 files changed, 31 insertions, 16 deletions
diff --git a/app/graphql/types/ci/detailed_status_type.rb b/app/graphql/types/ci/detailed_status_type.rb
index 90b5283fc9a..f4a50115ee6 100644
--- a/app/graphql/types/ci/detailed_status_type.rb
+++ b/app/graphql/types/ci/detailed_status_type.rb
@@ -6,24 +6,39 @@ module Types
class DetailedStatusType < BaseObject
graphql_name 'DetailedStatus'
- field :group, GraphQL::STRING_TYPE, null: false,
- description: 'Group of the pipeline status'
- field :icon, GraphQL::STRING_TYPE, null: false,
- description: 'Icon of the pipeline status'
- field :favicon, GraphQL::STRING_TYPE, null: false,
- description: 'Favicon of the pipeline status'
- field :details_path, GraphQL::STRING_TYPE, null: false,
- description: 'Path of the details for the pipeline status'
- field :has_details, GraphQL::BOOLEAN_TYPE, null: false,
- description: 'Indicates if the pipeline status has further details',
+ field :group, GraphQL::STRING_TYPE, null: true,
+ description: 'Group of the status'
+ field :icon, GraphQL::STRING_TYPE, null: true,
+ description: 'Icon of the status'
+ field :favicon, GraphQL::STRING_TYPE, null: true,
+ description: 'Favicon of the status'
+ field :details_path, GraphQL::STRING_TYPE, null: true,
+ description: 'Path of the details for the status'
+ field :has_details, GraphQL::BOOLEAN_TYPE, null: true,
+ description: 'Indicates if the status has further details',
method: :has_details?
- field :label, GraphQL::STRING_TYPE, null: false,
- description: 'Label of the pipeline status'
- field :text, GraphQL::STRING_TYPE, null: false,
- description: 'Text of the pipeline status'
- field :tooltip, GraphQL::STRING_TYPE, null: false,
- description: 'Tooltip associated with the pipeline status',
+ field :label, GraphQL::STRING_TYPE, null: true,
+ description: 'Label of the status'
+ field :text, GraphQL::STRING_TYPE, null: true,
+ description: 'Text of the status'
+ field :tooltip, GraphQL::STRING_TYPE, null: true,
+ description: 'Tooltip associated with the status',
method: :status_tooltip
+ field :action, Types::Ci::StatusActionType, null: true,
+ description: 'Action information for the status. This includes method, button title, icon, path, and title',
+ resolve: -> (obj, _args, _ctx) {
+ if obj.has_action?
+ {
+ button_title: obj.action_button_title,
+ icon: obj.icon,
+ method: obj.action_method,
+ path: obj.action_path,
+ title: obj.action_title
+ }
+ else
+ nil
+ end
+ }
end
# rubocop: enable Graphql/AuthorizeTypes
end