Commit 6eb859af authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent b1b3153437d3
......@@ -8,6 +8,7 @@
# Frontend maintainers should see everything in `app/assets/`
app/assets/ @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter @wortschi @ntepluhina @iamphill
*.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter @wortschi @ntepluhina @iamphill
/scripts/frontend/ @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter @wortschi @ntepluhina @iamphill
# Database maintainers should review changes in `db/`
db/ @gitlab-org/maintainers/database
......
......@@ -20,6 +20,27 @@ $spacing-scale: (
5: #{4 * $grid-size}
);
/*
* Why another sizing scale???
* Great question, friend!
* This size scale is a "backport" of the equivalent set of "named" sizes
* (e.g. `xl` versus `70`) that came from the following design document as of 2019-10-23:
*
* https://gitlab-org.gitlab.io/gitlab-design/hosted/design-gitlab-specs/forms-spec-previews/
*
* (See `input-` items at the bottom)
*
* The presumption here is that these sizes will be standardized in GitLab UI and thus will be
* broadly useful here in the GitLab product when not using the GitLab UI components.
*/
$size-scale: (
'xs': #{10 * $grid-size},
's': #{20 * $grid-size},
'm': #{30 * $grid-size},
'l': #{40 * $grid-size},
'xl': #{70 * $grid-size}
);
/*
* Color schema
*/
......
......@@ -252,6 +252,7 @@
.fa-caret-down {
margin-left: 3px;
line-height: 0;
&.dropdown-btn-icon {
margin-left: 0;
......@@ -269,7 +270,7 @@
}
.count-badge,
.btn-xs {
.btn {
height: 24px;
}
......
......@@ -16,6 +16,12 @@
}
}
@each $index, $size in $size-scale {
#{'.mw-#{$index}'} {
max-width: $size;
}
}
.border-width-1px { border-width: 1px; }
.border-style-dashed { border-style: dashed; }
.border-style-solid { border-style: solid; }
......
......@@ -16,12 +16,7 @@ def update
@notification_setting = current_user.notification_settings.find(params[:id])
@saved = @notification_setting.update(notification_setting_params_for(@notification_setting.source))
if params[:hide_label].present?
btn_class = params[:project_id].present? ? 'btn-xs' : ''
render_response("shared/notifications/_new_button", btn_class)
else
render_response
end
render_response
end
private
......@@ -42,7 +37,16 @@ def can_read?(resource)
can?(current_user, ability_name, resource)
end
def render_response(response_template = "shared/notifications/_button", btn_class = nil)
def render_response
btn_class = nil
if params[:hide_label].present?
btn_class = 'btn-xs' if params[:project_id].present?
response_template = 'shared/notifications/_new_button'
else
response_template = 'shared/notifications/_button'
end
render json: {
html: view_to_html_string(response_template, notification_setting: @notification_setting, btn_class: btn_class),
saved: @saved
......
......@@ -8,23 +8,31 @@ class CommitType < BaseObject
present_using CommitPresenter
field :id, type: GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :sha, type: GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :title, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :description, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :message, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :authored_date, type: Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
field :web_url, type: GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :signature_html, type: GraphQL::STRING_TYPE,
null: true, calls_gitaly: true, description: 'Rendered html for the commit signature'
field :id, type: GraphQL::ID_TYPE, null: false,
description: 'ID (global ID) of the commit'
field :sha, type: GraphQL::STRING_TYPE, null: false,
description: 'SHA1 ID of the commit'
field :title, type: GraphQL::STRING_TYPE, null: true,
description: 'Title of the commit message'
field :description, type: GraphQL::STRING_TYPE, null: true,
description: 'Description of the commit message'
field :message, type: GraphQL::STRING_TYPE, null: true,
description: 'Raw commit message'
field :authored_date, type: Types::TimeType, null: true,
description: 'Timestamp of when the commit was authored'
field :web_url, type: GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the commit'
field :signature_html, type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true,
description: 'Rendered HTML of the commit signature'
# models/commit lazy loads the author by email
field :author, type: Types::UserType, null: true # rubocop:disable Graphql/Descriptions
field :author, type: Types::UserType, null: true,
description: 'Author of the commit'
field :latest_pipeline,
type: Types::Ci::PipelineType,
null: true,
description: "Latest pipeline for this commit",
description: "Latest pipeline of the commit",
resolve: -> (obj, ctx, args) do
Gitlab::Graphql::Loaders::PipelineForShaLoader.new(obj.project, obj.sha).find_last
end
......
......@@ -8,14 +8,17 @@ class GroupType < NamespaceType
expose_permissions Types::PermissionTypes::Group
field :web_url, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the group'
field :avatar_url, GraphQL::STRING_TYPE, null: true, resolve: -> (group, args, ctx) do # rubocop:disable Graphql/Descriptions
group.avatar_url(only_path: false)
end
field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: 'Avatar URL of the group',
resolve: -> (group, args, ctx) do
group.avatar_url(only_path: false)
end
field :parent, GroupType, # rubocop:disable Graphql/Descriptions
null: true,
field :parent, GroupType, null: true,
description: 'Parent group',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Group, obj.parent_id).find }
end
end
......
......@@ -12,53 +12,77 @@ class IssueType < BaseObject
present_using IssuePresenter
field :iid, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :title, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :iid, GraphQL::ID_TYPE, null: false,
description: "Internal ID of the issue"
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the issue'
markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the issue'
markdown_field :description_html, null: true
field :state, IssueStateEnum, null: false # rubocop:disable Graphql/Descriptions
field :reference, GraphQL::STRING_TYPE, null: false, method: :to_reference do # rubocop:disable Graphql/Descriptions
argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false # rubocop:disable Graphql/Descriptions
field :state, IssueStateEnum, null: false,
description: 'State of the issue'
field :reference, GraphQL::STRING_TYPE, null: false,
description: 'Internal reference of the issue. Returned in shortened format by default',
method: :to_reference do
argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false,
description: 'Boolean option specifying whether the reference should be returned in full'
end
field :author, Types::UserType, # rubocop:disable Graphql/Descriptions
null: false,
field :author, Types::UserType, null: false,
description: 'User that created the issue',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(User, obj.author_id).find }
# Remove complexity when BatchLoader is used
field :assignees, Types::UserType.connection_type, null: true, complexity: 5 # rubocop:disable Graphql/Descriptions
field :assignees, Types::UserType.connection_type, null: true, complexity: 5,
description: 'Assignees of the issue'
# Remove complexity when BatchLoader is used
field :labels, Types::LabelType.connection_type, null: true, complexity: 5 # rubocop:disable Graphql/Descriptions
field :milestone, Types::MilestoneType, # rubocop:disable Graphql/Descriptions
null: true,
field :labels, Types::LabelType.connection_type, null: true, complexity: 5,
description: 'Labels of the issue'
field :milestone, Types::MilestoneType, null: true,
description: 'Milestone of the issue',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Milestone, obj.milestone_id).find }
field :due_date, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
field :confidential, GraphQL::BOOLEAN_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :discussion_locked, GraphQL::BOOLEAN_TYPE, # rubocop:disable Graphql/Descriptions
null: false,
field :due_date, Types::TimeType, null: true,
description: 'Due date of the issue'
field :confidential, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates the issue is confidential'
field :discussion_locked, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates discussion is locked on the issue',
resolve: -> (obj, _args, _ctx) { !!obj.discussion_locked }
field :upvotes, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :downvotes, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :user_notes_count, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :web_path, GraphQL::STRING_TYPE, null: false, method: :issue_path # rubocop:disable Graphql/Descriptions
field :web_url, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :relative_position, GraphQL::INT_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :participants, Types::UserType.connection_type, null: true, complexity: 5, description: 'List of participants for the issue'
field :time_estimate, GraphQL::INT_TYPE, null: false, description: 'The time estimate on the issue'
field :total_time_spent, GraphQL::INT_TYPE, null: false, description: 'Total time reported as spent on the issue'
field :closed_at, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
field :created_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :updated_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :task_completion_status, Types::TaskCompletionStatus, null: false # rubocop:disable Graphql/Descriptions
field :upvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of upvotes the issue has received'
field :downvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of downvotes the issue has received'
field :user_notes_count, GraphQL::INT_TYPE, null: false,
description: 'Number of user notes of the issue'
field :web_path, GraphQL::STRING_TYPE, null: false, method: :issue_path,
description: 'Web path of the issue'
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the issue'
field :relative_position, GraphQL::INT_TYPE, null: true,
description: 'Relative position of the issue (used for positioning in epic tree and issue boards)'
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue'
field :time_estimate, GraphQL::INT_TYPE, null: false,
description: 'Time estimate of the issue'
field :total_time_spent, GraphQL::INT_TYPE, null: false,
description: 'Total time reported as spent on the issue'
field :closed_at, Types::TimeType, null: true,
description: 'Timestamp of when the issue was closed'
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of when the issue was created'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of when the issue was last updated'
field :task_completion_status, Types::TaskCompletionStatus, null: false,
description: 'Task completion status of the issue'
end
end
......
......@@ -6,10 +6,14 @@ class LabelType < BaseObject
authorize :read_label
field :description, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the label (markdown rendered as HTML for caching)'
markdown_field :description_html, null: true
field :title, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :color, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :text_color, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Content of the label'
field :color, GraphQL::STRING_TYPE, null: false,
description: 'Background color of the label'
field :text_color, GraphQL::STRING_TYPE, null: false,
description: 'Text color of the label'
end
end
......@@ -12,70 +12,116 @@ class MergeRequestType < BaseObject
present_using MergeRequestPresenter
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :iid, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :title, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the merge request'
field :iid, GraphQL::STRING_TYPE, null: false,
description: 'Internal ID of the merge request'
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the merge request'
markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the merge request (markdown rendered as HTML for caching)'
markdown_field :description_html, null: true
field :state, MergeRequestStateEnum, null: false # rubocop:disable Graphql/Descriptions
field :created_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :updated_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :source_project, Types::ProjectType, null: true # rubocop:disable Graphql/Descriptions
field :target_project, Types::ProjectType, null: false # rubocop:disable Graphql/Descriptions
field :diff_refs, Types::DiffRefsType, null: true # rubocop:disable Graphql/Descriptions
# Alias for target_project
field :project, Types::ProjectType, null: false # rubocop:disable Graphql/Descriptions
field :project_id, GraphQL::INT_TYPE, null: false, method: :target_project_id # rubocop:disable Graphql/Descriptions
field :source_project_id, GraphQL::INT_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :target_project_id, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :source_branch, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :target_branch, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :work_in_progress, GraphQL::BOOLEAN_TYPE, method: :work_in_progress?, null: false # rubocop:disable Graphql/Descriptions
field :merge_when_pipeline_succeeds, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :diff_head_sha, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :merge_commit_sha, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :user_notes_count, GraphQL::INT_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :should_remove_source_branch, GraphQL::BOOLEAN_TYPE, method: :should_remove_source_branch?, null: true # rubocop:disable Graphql/Descriptions
field :force_remove_source_branch, GraphQL::BOOLEAN_TYPE, method: :force_remove_source_branch?, null: true # rubocop:disable Graphql/Descriptions
field :merge_status, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :in_progress_merge_commit_sha, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :merge_error, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :allow_collaboration, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :should_be_rebased, GraphQL::BOOLEAN_TYPE, method: :should_be_rebased?, null: false # rubocop:disable Graphql/Descriptions
field :rebase_commit_sha, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :rebase_in_progress, GraphQL::BOOLEAN_TYPE, method: :rebase_in_progress?, null: false, calls_gitaly: true # rubocop:disable Graphql/Descriptions
# rubocop:disable Graphql/Descriptions
field :merge_commit_message, GraphQL::STRING_TYPE, method: :default_merge_commit_message, null: true, deprecation_reason: "Renamed to defaultMergeCommitMessage"
# rubocop:enable Graphql/Descriptions
field :default_merge_commit_message, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :merge_ongoing, GraphQL::BOOLEAN_TYPE, method: :merge_ongoing?, null: false # rubocop:disable Graphql/Descriptions
field :source_branch_exists, GraphQL::BOOLEAN_TYPE, method: :source_branch_exists?, null: false # rubocop:disable Graphql/Descriptions
field :mergeable_discussions_state, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :web_url, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :upvotes, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :downvotes, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :state, MergeRequestStateEnum, null: false,
description: 'State of the merge request'
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of when the merge request was created'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of when the merge request was last updated'
field :source_project, Types::ProjectType, null: true,
description: 'Source project of the merge request'
field :target_project, Types::ProjectType, null: false,
description: 'Target project of the merge request'
field :diff_refs, Types::DiffRefsType, null: true,
description: 'References of the base SHA, the head SHA, and the start SHA for this merge request'
field :project, Types::ProjectType, null: false,
description: 'Alias for target_project'
field :project_id, GraphQL::INT_TYPE, null: false, method: :target_project_id,
description: 'ID of the merge request project'
field :source_project_id, GraphQL::INT_TYPE, null: true,
description: 'ID of the merge request source project'
field :target_project_id, GraphQL::INT_TYPE, null: false,
description: 'ID of the merge request target project'
field :source_branch, GraphQL::STRING_TYPE, null: false,
description: 'Source branch of the merge request'
field :target_branch, GraphQL::STRING_TYPE, null: false,
description: 'Target branch of the merge request'
field :work_in_progress, GraphQL::BOOLEAN_TYPE, method: :work_in_progress?, null: false,
description: 'Indicates if the merge request is a work in progress (WIP)'
field :merge_when_pipeline_succeeds, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if the merge has been set to be merged when its pipeline succeeds (MWPS)'
field :diff_head_sha, GraphQL::STRING_TYPE, null: true,
description: 'Diff head SHA of the merge request'
field :merge_commit_sha, GraphQL::STRING_TYPE, null: true,
description: 'SHA of the merge request commit (set once merged)'
field :user_notes_count, GraphQL::INT_TYPE, null: true,
description: 'User notes count of the merge request'
field :should_remove_source_branch, GraphQL::BOOLEAN_TYPE, method: :should_remove_source_branch?, null: true,
description: 'Indicates if the source branch of the merge request will be deleted after merge'
field :force_remove_source_branch, GraphQL::BOOLEAN_TYPE, method: :force_remove_source_branch?, null: true,
description: 'Indicates if the project settings will lead to source branch deletion after merge'
field :merge_status, GraphQL::STRING_TYPE, null: true,
description: 'Status of the merge request'
field :in_progress_merge_commit_sha, GraphQL::STRING_TYPE, null: true,
description: 'Commit SHA of the merge request if merge is in progress'
field :merge_error, GraphQL::STRING_TYPE, null: true,
description: 'Error message due to a merge error'
field :allow_collaboration, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if members of the target project can push to the fork'
field :should_be_rebased, GraphQL::BOOLEAN_TYPE, method: :should_be_rebased?, null: false,
description: 'Indicates if the merge request will be rebased'
field :rebase_commit_sha, GraphQL::STRING_TYPE, null: true,
description: 'Rebase commit SHA of the merge request'
field :rebase_in_progress, GraphQL::BOOLEAN_TYPE, method: :rebase_in_progress?, null: false, calls_gitaly: true,
description: 'Indicates if there is a rebase currently in progress for the merge request'
field :merge_commit_message, GraphQL::STRING_TYPE, method: :default_merge_commit_message, null: true, deprecation_reason: "Renamed to defaultMergeCommitMessage",
description: 'Deprecated - renamed to defaultMergeCommitMessage'
field :default_merge_commit_message, GraphQL::STRING_TYPE, null: true,
description: 'Default merge commit message of the merge request'
field :merge_ongoing, GraphQL::BOOLEAN_TYPE, method: :merge_ongoing?, null: false,
description: 'Indicates if a merge is currently occurring'
field :source_branch_exists, GraphQL::BOOLEAN_TYPE, method: :source_branch_exists?, null: false,
description: 'Indicates if the source branch of the merge request exists'
field :mergeable_discussions_state, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if all discussions in the merge request have been resolved, allowing the merge request to be merged'
field :web_url, GraphQL::STRING_TYPE, null: true,
description: 'Web URL of the merge request'
field :upvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of upvotes for the merge request'
field :downvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of downvotes for the merge request'
field :head_pipeline, Types::Ci::PipelineType, null: true, method: :actual_head_pipeline # rubocop:disable Graphql/Descriptions
field :pipelines, Types::Ci::PipelineType.connection_type, # rubocop:disable Graphql/Descriptions
field :head_pipeline, Types::Ci::PipelineType, null: true, method: :actual_head_pipeline,
description: 'The pipeline running on the branch HEAD of the merge request'
field :pipelines, Types::Ci::PipelineType.connection_type,
description: 'Pipelines for the merge request',
resolver: Resolvers::MergeRequestPipelinesResolver
field :milestone, Types::MilestoneType, description: 'The milestone this merge request is linked to',
null: true,
field :milestone, Types::MilestoneType, null: true,
description: 'The milestone of the merge request',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Milestone, obj.milestone_id).find }
field :assignees, Types::UserType.connection_type, null: true, complexity: 5, description: 'The list of assignees for the merge request'
field :participants, Types::UserType.connection_type, null: true, complexity: 5, description: 'The list of participants on the merge request'
field :assignees, Types::UserType.connection_type, null: true, complexity: 5,
description: 'Assignees of the merge request'
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'Participants in the merge request'
field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5,
description: 'Boolean flag for whether the currently logged in user is subscribed to this MR'
field :labels, Types::LabelType.connection_type, null: true, complexity: 5, description: 'The list of labels on the merge request'
field :discussion_locked, GraphQL::BOOLEAN_TYPE, description: 'Boolean flag determining if comments on the merge request are locked to members only',
description: 'Indicates if the currently logged in user is subscribed to this merge request'
field :labels, Types::LabelType.connection_type, null: true, complexity: 5,
description: 'Labels of the merge request'
field :discussion_locked, GraphQL::BOOLEAN_TYPE,
description: 'Indicates if comments on the merge request are locked to members only',
null: false,
resolve: -> (obj, _args, _ctx) { !!obj.discussion_locked }
field :time_estimate, GraphQL::INT_TYPE, null: false, description: 'The time estimate for the merge request'
field :total_time_spent, GraphQL::INT_TYPE, null: false, description: 'Total time reported as spent on the merge request'
field :reference, GraphQL::STRING_TYPE, null: false, method: :to_reference, description: 'Internal merge request reference. Returned in shortened format by default' do
argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false, description: 'Boolean option specifying whether the reference should be returned in full'
field :time_estimate, GraphQL::INT_TYPE, null: false,
description: 'Time estimate of the merge request'
field :total_time_spent, GraphQL::INT_TYPE, null: false,
description: 'Total time reported as spent on the merge request'
field :reference, GraphQL::STRING_TYPE, null: false, method: :to_reference,
description: 'Internal reference of the merge request. Returned in shortened format by default' do
argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false,
description: 'Boolean option specifying whether the reference should be returned in full'
end
field :task_completion_status, Types::TaskCompletionStatus, null: false # rubocop:disable Graphql/Descriptions
field :task_completion_status, Types::TaskCompletionStatus, null: false,
description: Types::TaskCompletionStatus.description
end
end
......@@ -6,7 +6,9 @@ class MetadataType < ::Types::BaseObject
authorize :read_instance_metadata
field :version, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :revision, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :version, GraphQL::STRING_TYPE, null: false,
description: 'Version'
field :revision, GraphQL::STRING_TYPE, null: false,
description: 'Revision'
end
end
......@@ -6,14 +6,21 @@ class MilestoneType < BaseObject
authorize :read_milestone
field :description, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :title, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :state, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the milestone'
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the milestone'
field :state, GraphQL::STRING_TYPE, null: false,
description: 'State of the milestone'
field :due_date, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
field :start_date, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
field :due_date, Types::TimeType, null: true,
description: 'Timestamp of the milestone due date'
field :start_date, Types::TimeType, null: true,
description: 'Timestamp of the milestone start date'
field :created_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :updated_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of milestone creation'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of last milestone update'
end
end
......@@ -6,27 +6,35 @@ class NamespaceType < BaseObject
authorize :read_namespace
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the namespace'
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :full_name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :full_path, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :name, GraphQL::STRING_TYPE, null: false,
description: 'Name of the namespace'
field :path, GraphQL::STRING_TYPE, null: false,
description: 'Path of the namespace'
field :full_name, GraphQL::STRING_TYPE, null: false,
description: 'Full name of the namespace'
field :full_path, GraphQL::ID_TYPE, null: false,
description: 'Full path of the namespace'
field :description, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the namespace'
markdown_field :description_html, null: true
field :visibility, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true, method: :lfs_enabled? # rubocop:disable Graphql/Descriptions
field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :visibility, GraphQL::STRING_TYPE, null: true,
description: 'Visibility of the namespace'
field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true, method: :lfs_enabled?,
description: 'Indicates if Large File Storage (LFS) is enabled for namespace'
field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if users can request access to namespace'
field :root_storage_statistics, Types::RootStorageStatisticsType,
null: true,
description: 'The aggregated storage statistics. Only available for root namespaces',
description: 'Aggregated storage statistics of the namespace. Only available for root namespaces',
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader.new(obj.id).find }
field :projects, # rubocop:disable Graphql/Descriptions
Types::ProjectType.connection_type,
null: false,
field :projects, Types::ProjectType.connection_type, null: false,
description: 'Projects within this namespace',
resolver: ::Resolvers::NamespaceProjectsResolver
end
end
......@@ -6,13 +6,20 @@ class ProjectStatisticsType < BaseObject
authorize :read_statistics
field :commit_count, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :commit_count, GraphQL::INT_TYPE, null: false,
description: 'Commit count of the project'
field :storage_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :repository_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :lfs_objects_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions