diff --git a/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html b/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html
index 9cb364ffbe2..f1b771de1a0 100644
--- a/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html
+++ b/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html
@@ -12,6 +12,8 @@
Show JSON
Edit as JSON
+ Show configuration JSON
+ Edit configuration as JSON
Loading History...
Show Revision History
No version history found
diff --git a/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js b/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js
index a25f9a84963..89cf9861293 100644
--- a/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js
+++ b/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js
@@ -166,14 +166,14 @@ module.exports = angular.module('spinnaker.core.pipeline.config.pipelineConfigur
}).catch(() => {});
};
- this.editPipelineJson = () => {
+ this.editPipelineJson = (editPipelineConfiguration = false) => {
$uibModal.open({
templateUrl: require('./actions/json/editPipelineJsonModal.html'),
controller: EditPipelineJsonModalCtrl,
controllerAs: '$ctrl',
size: 'lg modal-fullscreen',
resolve: {
- pipeline: () => $scope.renderablePipeline,
+ pipeline: () => editPipelineConfiguration ? $scope.pipeline : $scope.renderablePipeline,
}
}).result.then(() => {
$scope.$broadcast('pipeline-json-edited');
diff --git a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts
index 9291488230e..07bbe57a111 100644
--- a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts
+++ b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts
@@ -109,7 +109,7 @@ export class ConfigurePipelineTemplateModalController implements IController {
}
private loadTemplate(): IPromise {
- return ReactInjector.pipelineTemplateService.getPipelineTemplateFromSourceUrl(this.source)
+ return ReactInjector.pipelineTemplateService.getPipelineTemplateFromSourceUrl(this.source, this.pipelineId)
.then(template => { this.template = template });
}
diff --git a/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts b/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts
index bfa2786e2ea..2de885a5974 100644
--- a/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts
+++ b/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts
@@ -79,8 +79,8 @@ export class PipelineTemplateService {
'ngInject';
}
- public getPipelineTemplateFromSourceUrl(source: string): IPromise {
- return this.API.one('pipelineTemplates').one('resolve').withParams({ source }).get()
+ public getPipelineTemplateFromSourceUrl(source: string, pipelineConfigId: String = null): IPromise {
+ return this.API.one('pipelineTemplates').one('resolve').withParams({ source: source, pipelineConfigId: pipelineConfigId }).get()
.then((template: IPipelineTemplate) => {
template.selfLink = source;
return template;