Skip to content

Commit 01a4bed

Browse files
author
OpenShift Bot
authored
Merge pull request #1146 from spadgett/one-line-post-commit-script
Merged by openshift-bot
2 parents 709cca2 + 1209ad3 commit 01a4bed

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

app/views/directives/build-hooks.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Use `dl-horizontal left` style unless there's a script.
33
Otherwise use the default `dl` style because it looks strange with the block editor.
44
-->
5-
<dl ng-class="{ 'dl-horizontal left': !build.spec.postCommit.script }">
5+
<dl ng-class="{ 'dl-horizontal left': !build.spec.postCommit.script || !(build.spec.postCommit.script | isMultiline)}">
66
<dt ng-if-start="build.spec.postCommit.command">Command:</dt>
77
<dd ng-if-end>
88
<code class="command">
@@ -17,7 +17,16 @@
1717
</dd>
1818
<dt ng-if-start="build.spec.postCommit.script">Script:</dt>
1919
<dd ng-if-end>
20+
<code ng-if="!(build.spec.postCommit.script | isMultiline)" class="command">
21+
<truncate-long-text
22+
content="build.spec.postCommit.script"
23+
limit="80"
24+
expandable="true"
25+
use-word-boundary="false">
26+
</truncate-long-text>
27+
</code>
2028
<div
29+
ng-if="build.spec.postCommit.script | isMultiline"
2130
ui-ace="{
2231
mode: 'sh',
2332
theme: 'eclipse',

dist/scripts/templates.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -6058,7 +6058,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
60586058

60596059

60606060
$templateCache.put('views/directives/build-hooks.html',
6061-
" <dl ng-class=\"{ 'dl-horizontal left': !build.spec.postCommit.script }\">\n" +
6061+
" <dl ng-class=\"{ 'dl-horizontal left': !build.spec.postCommit.script || !(build.spec.postCommit.script | isMultiline)}\">\n" +
60626062
"<dt ng-if-start=\"build.spec.postCommit.command\">Command:</dt>\n" +
60636063
"<dd ng-if-end>\n" +
60646064
"<code class=\"command\">\n" +
@@ -6068,7 +6068,11 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
60686068
"</dd>\n" +
60696069
"<dt ng-if-start=\"build.spec.postCommit.script\">Script:</dt>\n" +
60706070
"<dd ng-if-end>\n" +
6071-
"<div ui-ace=\"{\n" +
6071+
"<code ng-if=\"!(build.spec.postCommit.script | isMultiline)\" class=\"command\">\n" +
6072+
"<truncate-long-text content=\"build.spec.postCommit.script\" limit=\"80\" expandable=\"true\" use-word-boundary=\"false\">\n" +
6073+
"</truncate-long-text>\n" +
6074+
"</code>\n" +
6075+
"<div ng-if=\"build.spec.postCommit.script | isMultiline\" ui-ace=\"{\n" +
60726076
" mode: 'sh',\n" +
60736077
" theme: 'eclipse',\n" +
60746078
" rendererOptions: {\n" +

0 commit comments

Comments
 (0)