Commit e127da24 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 140b20fd e6f8e120
......@@ -87,6 +87,7 @@ gem 'rack-cors', '~> 1.0.0', require: 'rack/cors'
gem 'graphql', '~> 1.8.0'
gem 'graphiql-rails', '~> 1.4.10'
gem 'apollo_upload_server', '~> 2.0.0.beta3'
gem 'graphql-docs', '~> 1.6.0', group: [:development, :test]
# Disable strong_params so that Mash does not respond to :permitted?
gem 'hashie-forbidden_attributes'
......
......@@ -238,6 +238,8 @@ GEM
excon (0.62.0)
execjs (2.6.0)
expression_parser (0.9.0)
extended-markdown-filter (0.6.0)
html-pipeline (~> 2.0)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
factory_bot_rails (4.8.2)
......@@ -315,6 +317,7 @@ GEM
fuubar (2.2.0)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
gemoji (3.0.1)
gemojione (3.3.0)
json
get_process_mem (0.2.3)
......@@ -396,6 +399,14 @@ GEM
railties
sprockets-rails
graphql (1.8.1)
graphql-docs (1.6.0)
commonmarker (~> 0.16)
escape_utils (~> 1.2)
extended-markdown-filter (~> 0.4)
gemoji (~> 3.0)
graphql (~> 1.6)
html-pipeline (~> 2.8)
sass (~> 3.4)
grpc (1.19.0)
google-protobuf (~> 3.1)
googleapis-common-protos-types (~> 1.0.0)
......@@ -1157,6 +1168,7 @@ DEPENDENCIES
grape_logging (~> 1.7)
graphiql-rails (~> 1.4.10)
graphql (~> 1.8.0)
graphql-docs (~> 1.6.0)
grpc (~> 1.19.0)
gssapi
haml_lint (~> 0.31.0)
......
......@@ -265,7 +265,6 @@ ul.controls {
}
.issuable-pipeline-broken a,
.issuable-pipeline-status a,
.author-link {
display: flex;
}
......
- status = local_assigns.fetch(:status)
- size = local_assigns.fetch(:size, 16)
- type = local_assigns.fetch(:type, 'pipeline')
- tooltip_placement = local_assigns.fetch(:tooltip_placement, "left")
- path = local_assigns.fetch(:path, status.has_details? ? status.details_path : nil)
- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} has-tooltip"
- status = local_assigns.fetch(:status)
- size = local_assigns.fetch(:size, 16)
- type = local_assigns.fetch(:type, 'pipeline')
- tooltip_placement = local_assigns.fetch(:tooltip_placement, "left")
- path = local_assigns.fetch(:path, status.has_details? ? status.details_path : nil)
- option_css_classes = local_assigns.fetch(:option_css_classes, '')
- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} has-tooltip #{option_css_classes}"
- title = s_("PipelineStatusTooltip|Pipeline: %{ci_status}") % {ci_status: status.label}
- if type == 'commit'
- title = s_("PipelineStatusTooltip|Commit: %{ci_status}") % {ci_status: status.label}
......
......@@ -38,7 +38,7 @@
= link_to_label(label, type: :merge_request, css_class: 'label-link')
.issuable-meta
%ul.controls
%ul.controls.d-flex.align-items-end
- if merge_request.merged?
%li.issuable-status.d-none.d-sm-inline-block
MERGED
......@@ -47,14 +47,14 @@
= icon('ban')
CLOSED
- if can?(current_user, :read_pipeline, merge_request.head_pipeline)
%li.issuable-pipeline-status.d-none.d-sm-inline-block
= render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user)
%li.issuable-pipeline-status.d-none.d-sm-flex
= render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), option_css_classes: 'd-flex'
- if merge_request.open? && merge_request.broken?
%li.issuable-pipeline-broken.d-none.d-sm-inline-block
%li.issuable-pipeline-broken.d-none.d-sm-flex
= link_to merge_request_path(merge_request), class: "has-tooltip", title: _('Cannot be merged automatically') do
= icon('exclamation-triangle')
- if merge_request.assignees.any?
%li
%li.d-flex
= render 'shared/issuable/assignees', project: merge_request.project, issuable: merge_request
= render_if_exists 'projects/merge_requests/approvals_count', merge_request: merge_request
......
......@@ -58,7 +58,7 @@
.description.d-none.d-sm-block.append-right-default
= markdown_field(project, :description)
.controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0{ class: css_controls_class }
.controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0.text-secondary{ class: css_controls_class }
.icon-container.d-flex.align-items-center
- if project.archived
%span.d-flex.icon-wrapper.badge.badge-warning archived
......
---
title: Aligns CI icon in Merge Request dashboard
merge_request: 30558
author:
type: fixed
---
title: Add text-secondary to controls in project list
merge_request: 30567
author:
type: fixed
......@@ -47,6 +47,12 @@ info about multiplexed queries is also available for
[graphql-ruby](https://graphql-ruby.org/queries/multiplex.html) the
library GitLab uses on the backend.
## Reference
GitLab's GraphQL reference [is available](reference/index.md).
It is automatically generated from GitLab's GraphQL schema and embedded in a Markdown file.
## GraphiQL
The API can be explored by using the GraphiQL IDE, it is available on your
......
This diff is collapsed.
# frozen_string_literal: true
return if Rails.env.production?
module Gitlab
module Graphql
module Docs
# Helper with functions to be used by HAML templates
# This includes graphql-docs gem helpers class.
# You can check the included module on: https://github.com/gjtorikian/graphql-docs/blob/v1.6.0/lib/graphql-docs/helpers.rb
module Helper
include GraphQLDocs::Helpers
def auto_generated_comment
<<-MD.strip_heredoc
<!---
This documentation is auto generated by a script.
Please do not edit this file directly, check compile_docs task on lib/tasks/gitlab/graphql.rake.
--->
MD
end
# Some fields types are arrays of other types and are displayed
# on docs wrapped in square brackets, for example: [String!].
# This makes GitLab docs renderer thinks they are links so here
# we change them to be rendered as: String! => Array.
def render_field_type(type)
array_type = type[/\[(.+)\]/, 1]
if array_type
"#{array_type} => Array"
else
type
end
end
# We are ignoring connections and built in types for now,
# they should be added when queries are generated.
def objects
graphql_object_types.select do |object_type|
!object_type[:name]["Connection"] &&
!object_type[:name]["Edge"] &&
!object_type[:name]["__"]
end
end
end
end
end
end
# frozen_string_literal: true
return if Rails.env.production?
module Gitlab
module Graphql
module Docs
# Gitlab renderer for graphql-docs.
# Uses HAML templates to parse markdown and generate .md files.
# It uses graphql-docs helpers and schema parser, more information in https://github.com/gjtorikian/graphql-docs.
#
# Arguments:
# schema - the GraphQL schema defition. For GitLab should be: GitlabSchema.graphql_definition
# output_dir: The folder where the markdown files will be saved
# template: The path of the haml template to be parsed
class Renderer
include Gitlab::Graphql::Docs::Helper
def initialize(schema, output_dir:, template:)
@output_dir = output_dir
@template = template
@layout = Haml::Engine.new(File.read(template))
@parsed_schema = GraphQLDocs::Parser.new(schema, {}).parse
end
def render
contents = @layout.render(self)
write_file(contents)
end
private
def write_file(contents)
filename = File.join(@output_dir, 'index.md')
FileUtils.mkdir_p(@output_dir)
File.write(filename, contents)
end
end
end
end
end
-# haml-lint:disable UnnecessaryStringOutput
= auto_generated_comment
:plain
# GraphQL API Resources
This documentation is self-generated based on GitLab current GraphQL schema.
The API can be explored interactively using the [GraphiQL IDE](../index.md#graphiql).
## Objects
\
- objects.each do |type|
- unless type[:fields].empty?
= "### #{type[:name]}"
\
~ "| Name | Type | Description |"
~ "| --- | ---- | ---------- |"
- type[:fields].each do |field|
= "| `#{field[:name]}` | #{render_field_type(field[:type][:info])} | #{field[:description]} |"
\
# frozen_string_literal: true
return if Rails.env.production?
namespace :gitlab do
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference").freeze
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'.freeze
namespace :graphql do
desc 'GitLab | Generate GraphQL docs'
task compile_docs: :environment do
renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options)
renderer.render
puts "Documentation compiled."
end
end
end
def render_options
{
output_dir: OUTPUT_DIR,
template: Rails.root.join(TEMPLATES_DIR, 'default.md.haml')
}
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment