summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Azzopardi <steveazz@outlook.com>2019-03-01 15:24:23 +0100
committerSteve Azzopardi <steveazz@outlook.com>2019-03-01 15:24:23 +0100
commitd30fc437ac014b1c68e6dcc0835ae10b68c58f87 (patch)
treec89eb32d2703f99cbcd1c24e41f86e93ae33fe7f
parentd86de642d16e0f7518c7f508b5282c89128e9a58 (diff)
downloadgitlab-ce-fix-showing-emptry-blocks-in-ci-lint.tar.gz
Fix showing empty block in ci lintfix-showing-emptry-blocks-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.
-rw-r--r--app/views/projects/ci/lints/_create.html.haml9
-rw-r--r--changelogs/unreleased/fix-showing-emptry-blocks-in-ci-lint.yml5
2 files changed, 11 insertions, 3 deletions
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