summaryrefslogtreecommitdiff
path: root/app/views/projects/ci
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 01:45:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 01:45:44 +0000
commit85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch)
tree9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/views/projects/ci
parent15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff)
downloadgitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/views/projects/ci')
-rw-r--r--app/views/projects/ci/builds/_build.html.haml2
-rw-r--r--app/views/projects/ci/lints/_create.html.haml81
-rw-r--r--app/views/projects/ci/lints/_lint_warnings.html.haml12
-rw-r--r--app/views/projects/ci/lints/show.html.haml58
4 files changed, 72 insertions, 81 deletions
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 23f9a6a8f6c..c7ab01a4ef7 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -102,7 +102,7 @@
- if can?(current_user, :update_build, job)
- if job.active?
= link_to cancel_project_job_path(job.project, job, continue: { to: request.fullpath }), method: :post, title: _('Cancel'), class: 'btn btn-build' do
- = icon('remove', class: 'cred')
+ = sprite_icon('close')
- elsif job.scheduled?
.btn-group
.btn.btn-default{ disabled: true }
diff --git a/app/views/projects/ci/lints/_create.html.haml b/app/views/projects/ci/lints/_create.html.haml
index 5cc89343ba3..4b7cda0ef57 100644
--- a/app/views/projects/ci/lints/_create.html.haml
+++ b/app/views/projects/ci/lints/_create.html.haml
@@ -1,10 +1,10 @@
-- if @status
+- if @result.valid?
.bs-callout.bs-callout-success
%p
%b= _("Status:")
= _("syntax is correct")
- = render "projects/ci/lints/lint_warnings", warnings: @warnings
+ = render "projects/ci/lints/lint_warnings", warnings: @result.warnings
.table-holder
%table.table.table-bordered
@@ -13,54 +13,31 @@
%th= _("Parameter")
%th= _("Value")
%tbody
- - if @dry_run
- - @stages.each do |stage|
- - stage.statuses.each do |job|
- %tr
- %td #{stage.name.capitalize} Job - #{job.name}
- %td
- %pre= job.options[:before_script].to_a.join('\n')
- %pre= job.options[:script].to_a.join('\n')
- %pre= job.options[:after_script].to_a.join('\n')
- %br
- %b= _("Tag list:")
- = job.tag_list.to_a.join(", ") if job.is_a?(Ci::Build)
- %br
- %b= _("Environment:")
- = job.options.dig(:environment, :name)
- %br
- %b= _("When:")
- = job.when
- - if job.allow_failure
- %b= _("Allowed to fail")
-
- - else
- - @stages.each do |stage|
- - @builds.select { |build| build[:stage] == stage }.each do |build|
- - job = @jobs[build[:name].to_sym]
- %tr
- %td #{stage.capitalize} Job - #{build[:name]}
- %td
- %pre= job[:before_script].to_a.join('\n')
- %pre= job[:script].to_a.join('\n')
- %pre= job[:after_script].to_a.join('\n')
- %br
- %b= _("Tag list:")
- = build[:tag_list].to_a.join(", ")
- %br
- %b= _("Only policy:")
- = job[:only].to_a.join(", ")
- %br
- %b= _("Except policy:")
- = job[:except].to_a.join(", ")
- %br
- %b= _("Environment:")
- = build[:environment]
- %br
- %b= _("When:")
- = build[:when]
- - if build[:allow_failure]
- %b= _("Allowed to fail")
+ - @result.jobs.each do |job|
+ %tr
+ %td #{job[:stage].capitalize} Job - #{job[:name]}
+ %td
+ %pre= job[:before_script].to_a.join('\n')
+ %pre= job[:script].to_a.join('\n')
+ %pre= job[:after_script].to_a.join('\n')
+ %br
+ %b= _("Tag list:")
+ = job[:tag_list].to_a.join(", ")
+ - unless @dry_run
+ %br
+ %b= _("Only policy:")
+ = job[:only].to_a.join(", ")
+ %br
+ %b= _("Except policy:")
+ = job[:except].to_a.join(", ")
+ %br
+ %b= _("Environment:")
+ = job[:environment]
+ %br
+ %b= _("When:")
+ = job[:when]
+ - if job[:allow_failure]
+ %b= _("Allowed to fail")
- else
.bs-callout.bs-callout-danger
@@ -68,7 +45,7 @@
%b= _("Status:")
= _("syntax is incorrect")
%pre
- - @errors.each do |message|
+ - @result.errors.each do |message|
%p= message
- = render "projects/ci/lints/lint_warnings", warnings: @warnings
+ = render "projects/ci/lints/lint_warnings", warnings: @result.warnings
diff --git a/app/views/projects/ci/lints/_lint_warnings.html.haml b/app/views/projects/ci/lints/_lint_warnings.html.haml
index 0a5bb8f76ef..90db65e6c27 100644
--- a/app/views/projects/ci/lints/_lint_warnings.html.haml
+++ b/app/views/projects/ci/lints/_lint_warnings.html.haml
@@ -1,6 +1,10 @@
- if warnings
- - warnings.each do |warning|
+ - total_warnings = warnings.length
+ - message = warning_header(total_warnings)
+
+ - if warnings.any?
.bs-callout.bs-callout-warning
- %p
- %b= _("Warning:")
- = markdown(warning)
+ %details
+ %summary.gl-mb-2= message
+ - warnings.each do |warning|
+ = markdown(warning)
diff --git a/app/views/projects/ci/lints/show.html.haml b/app/views/projects/ci/lints/show.html.haml
index 0c51c978bfe..2e79852f4c9 100644
--- a/app/views/projects/ci/lints/show.html.haml
+++ b/app/views/projects/ci/lints/show.html.haml
@@ -1,30 +1,40 @@
- page_title _("CI Lint")
- page_description _("Validate your GitLab CI configuration file")
-- content_for :library_javascripts do
- = page_specific_javascript_tag('lib/ace.js')
+- unless Feature.enabled?(:monaco_ci)
+ - content_for :library_javascripts do
+ = page_specific_javascript_tag('lib/ace.js')
%h2.pt-3.pb-3= _("Validate your GitLab CI configuration")
-.project-ci-linter
- = form_tag project_ci_lint_path(@project), method: :post do
- .row
- .col-sm-12
- .file-holder
- .js-file-title.file-title.clearfix
- = _("Contents of .gitlab-ci.yml")
- #ci-editor.ci-editor= @content
- = text_area_tag(:content, @content, class: 'hidden form-control span1', rows: 7, require: true)
- .col-sm-12
- .float-left.gl-mt-3
- = submit_tag(_('Validate'), class: 'btn btn-success submit-yml')
- - if Gitlab::Ci::Features.lint_creates_pipeline_with_dry_run?(@project)
- = check_box_tag(:dry_run, 'true', params[:dry_run])
- = label_tag(:dry_run, _('Simulate a pipeline created for the default branch'))
- = link_to icon('question-circle'), help_page_path('ci/lint', anchor: 'pipeline-simulation'), target: '_blank', rel: 'noopener noreferrer'
- .float-right.prepend-top-10
- = button_tag(_('Clear'), type: 'button', class: 'btn btn-default clear-yml')
+- if Feature.enabled?(:ci_lint_vue, @project)
+ #js-ci-lint{ data: { endpoint: project_ci_lint_path(@project) } }
- .row.prepend-top-20
- .col-sm-12
- .results.project-ci-template
- = render partial: 'create' if defined?(@status)
+- else
+ .project-ci-linter
+ = form_tag project_ci_lint_path(@project), method: :post, class: 'js-ci-lint-form' do
+ .row
+ .col-sm-12
+ .file-holder
+ .js-file-title.file-title.clearfix
+ = _("Contents of .gitlab-ci.yml")
+ - if Feature.enabled?(:monaco_ci)
+ .file-editor.code
+ .js-edit-mode-pane.qa-editor#editor{ data: { 'editor-loading': true } }<
+ %pre.editor-loading-content= params[:content]
+ - else
+ #ci-editor.ci-editor= @content
+ = text_area_tag(:content, @content, class: 'hidden form-control span1', rows: 7, require: true)
+ .col-sm-12
+ .float-left.gl-mt-3
+ = submit_tag(_('Validate'), class: 'btn btn-success submit-yml')
+ - if Gitlab::Ci::Features.lint_creates_pipeline_with_dry_run?(@project)
+ = check_box_tag(:dry_run, 'true', params[:dry_run])
+ = label_tag(:dry_run, _('Simulate a pipeline created for the default branch'))
+ = link_to sprite_icon('question-o'), help_page_path('ci/lint', anchor: 'pipeline-simulation'), target: '_blank', rel: 'noopener noreferrer'
+ .float-right.prepend-top-10
+ = button_tag(_('Clear'), type: 'button', class: 'btn btn-default clear-yml')
+
+ .row.prepend-top-20
+ .col-sm-12
+ .results.project-ci-template
+ = render partial: 'create' if defined?(@result)