Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/scripts/directives/oscSourceSecrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ angular.module("openshiftConsole")
var lastSecret = _.last($scope.pickedSecrets);
switch ($scope.strategyType) {
case 'Custom':
return lastSecret.secretSource.name;
return _.get(lastSecret, 'secretSource.name');
default:
return lastSecret.secret.name;
return _.get(lastSecret, 'secret.name');
}
};

Expand Down
32 changes: 18 additions & 14 deletions app/views/edit/build-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ <h3 class="with-divider">Image Configuration</h3>
</div>
</div>

<div class="form-group" ng-if="strategyType !== 'JenkinsPipeline'">
<!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
<!-- Wait for project to load since the directive uses `canI` checks that need it. -->
<div class="form-group" ng-if="project && strategyType !== 'JenkinsPipeline'">
<!-- Use ng-show instead of ng-if when checking `view.advancedOptions` so
the form is still marked invalid if a hidden field has errors. -->
<div ng-show="view.advancedOptions">
<osc-secrets model="secrets.picked.pullSecret"
namespace="projectName"
Expand Down Expand Up @@ -401,19 +403,21 @@ <h3 class="with-divider">Image Configuration</h3>
</div>
</div>

<!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
<div class="form-group" ng-show="view.advancedOptions">
<osc-secrets model="secrets.picked.pushSecret"
namespace="projectName"
display-type="push"
type="image"
disable-input="imageOptions.to.type==='None'"
service-account-to-link="builder"
secrets-by-type="secrets.secretsByType"
alerts="alerts">
</osc-secrets>
<!-- Wait for project to load since the directive uses `canI` checks that need it. -->
<div ng-if="project">
<!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
<div class="form-group" ng-show="view.advancedOptions">
<osc-secrets model="secrets.picked.pushSecret"
namespace="projectName"
display-type="push"
type="image"
disable-input="imageOptions.to.type==='None'"
service-account-to-link="builder"
secrets-by-type="secrets.secretsByType"
alerts="alerts">
</osc-secrets>
</div>
</div>

</div>
</dl>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10783,10 +10783,10 @@ b.canAddSourceSecret = function() {
var a = _.last(b.pickedSecrets);
switch (b.strategyType) {
case "Custom":
return a.secretSource.name;
return _.get(a, "secretSource.name");

default:
return a.secret.name;
return _.get(a, "secret.name");
}
}, b.setLastSecretsName = function(a) {
var c = _.last(b.pickedSecrets);
Expand Down
6 changes: 5 additions & 1 deletion dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -9271,7 +9271,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"</div>\n" +
"</div>\n" +
"<div class=\"form-group\" ng-if=\"strategyType !== 'JenkinsPipeline'\">\n" +
"\n" +
"<div class=\"form-group\" ng-if=\"project && strategyType !== 'JenkinsPipeline'\">\n" +
"\n" +
"<div ng-show=\"view.advancedOptions\">\n" +
"<osc-secrets model=\"secrets.picked.pullSecret\" namespace=\"projectName\" display-type=\"pull\" type=\"image\" secrets-by-type=\"secrets.secretsByType\" service-account-to-link=\"builder\" alerts=\"alerts\">\n" +
Expand Down Expand Up @@ -9306,11 +9307,14 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"</div>\n" +
"\n" +
"<div ng-if=\"project\">\n" +
"\n" +
"<div class=\"form-group\" ng-show=\"view.advancedOptions\">\n" +
"<osc-secrets model=\"secrets.picked.pushSecret\" namespace=\"projectName\" display-type=\"push\" type=\"image\" disable-input=\"imageOptions.to.type==='None'\" service-account-to-link=\"builder\" secrets-by-type=\"secrets.secretsByType\" alerts=\"alerts\">\n" +
"</osc-secrets>\n" +
"</div>\n" +
"</div>\n" +
"</div>\n" +
"</dl>\n" +
"</div>\n" +
"<div ng-if=\"!(updatedBuildConfig | isJenkinsPipelineStrategy)\" class=\"section\">\n" +
Expand Down