From d30fc437ac014b1c68e6dcc0835ae10b68c58f87 Mon Sep 17 00:00:00 2001 From: Steve Azzopardi Date: Fri, 1 Mar 2019 15:24:23 +0100 Subject: Fix showing empty block in ci lint When a user does not have a `before_script` or `after_script` defined which is fairly common we are showing an empty block which can be a bit confusing to the user. --- app/views/projects/ci/lints/_create.html.haml | 9 ++++++--- changelogs/unreleased/fix-showing-emptry-blocks-in-ci-lint.yml | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/fix-showing-emptry-blocks-in-ci-lint.yml diff --git a/app/views/projects/ci/lints/_create.html.haml b/app/views/projects/ci/lints/_create.html.haml index 59b5b9f8a30..f62d7bec629 100644 --- a/app/views/projects/ci/lints/_create.html.haml +++ b/app/views/projects/ci/lints/_create.html.haml @@ -17,9 +17,12 @@ %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') + - if job[:before_script] + %pre= job[:before_script].to_a.join('\n') + - if job[:script] + %pre= job[:script].to_a.join('\n') + - if job[:after_script] + %pre= job[:after_script].to_a.join('\n') %br %b= _("Tag list:") diff --git a/changelogs/unreleased/fix-showing-emptry-blocks-in-ci-lint.yml b/changelogs/unreleased/fix-showing-emptry-blocks-in-ci-lint.yml new file mode 100644 index 00000000000..04ae74bb000 --- /dev/null +++ b/changelogs/unreleased/fix-showing-emptry-blocks-in-ci-lint.yml @@ -0,0 +1,5 @@ +--- +title: Fix showing empty blocks in ci lint +merge_request: +author: +type: fixed -- cgit v1.2.1