Skip to content

Commit 0d92433

Browse files
author
OpenShift Bot
authored
Merge pull request #1825 from spadgett/runtime-error-no-sample-pipeline
Merged by openshift-bot
2 parents 977c76b + 83bacdc commit 0d92433

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: app/scripts/controllers/pipelines.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ angular.module('openshiftConsole')
109109
$scope.buildConfigs = _.pick(buildConfigData.by("metadata.name"), isPipeline);
110110
if (_.isEmpty($scope.buildConfigs) && !checkedForSampleTemplate) {
111111
checkedForSampleTemplate = true;
112-
var sampleName = Constants.SAMPLE_PIPELINE_TEMPLATE.name;
113-
var sampleNamespace = Constants.SAMPLE_PIPELINE_TEMPLATE.namespace;
114-
DataService.get("templates", sampleName, {namespace: sampleNamespace}, {errorNotification: false}).then(
115-
function(template) {
116-
$scope.createSampleURL = Navigate.createFromTemplateURL(template, $scope.projectName);
117-
});
112+
if (Constants.SAMPLE_PIPELINE_TEMPLATE) {
113+
var sampleName = Constants.SAMPLE_PIPELINE_TEMPLATE.name;
114+
var sampleNamespace = Constants.SAMPLE_PIPELINE_TEMPLATE.namespace;
115+
DataService.get("templates", sampleName, {namespace: sampleNamespace}, {errorNotification: false}).then(
116+
function(template) {
117+
$scope.createSampleURL = Navigate.createFromTemplateURL(template, $scope.projectName);
118+
});
119+
}
118120
}
119121
update();
120122
}));

Diff for: dist/scripts/scripts.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -4994,8 +4994,7 @@ c.buildsLoaded = !0, i = a.by("metadata.name"), p();
49944994
}));
49954995
var q = !1;
49964996
j.push(g.watch("buildconfigs", h, function(a) {
4997-
if (c.buildConfigsLoaded = !0, c.buildConfigs = _.pick(a.by("metadata.name"), m), _.isEmpty(c.buildConfigs) && !q) {
4998-
q = !0;
4997+
if (c.buildConfigsLoaded = !0, c.buildConfigs = _.pick(a.by("metadata.name"), m), _.isEmpty(c.buildConfigs) && !q && (q = !0, d.SAMPLE_PIPELINE_TEMPLATE)) {
49994998
var b = d.SAMPLE_PIPELINE_TEMPLATE.name, f = d.SAMPLE_PIPELINE_TEMPLATE.namespace;
50004999
g.get("templates", b, {
50015000
namespace:f

0 commit comments

Comments
 (0)