support extra_vars on job template schedules, inherit schedule extra_data field from job template. Resolves #1359

This commit is contained in:
Leigh Johnson
2016-04-14 09:56:05 -04:00
parent 6150addc2e
commit 21e73e5d1b
6 changed files with 107 additions and 11 deletions

View File

@@ -34,7 +34,15 @@ export default
resolve: {
features: ['FeaturesService', function(FeaturesService) {
return FeaturesService.get();
}]
}],
JobTemplateExtraVars: ['Rest', 'GetBasePath', 'ToJSON', '$stateParams', function(Rest, GetBasePath, ToJSON, $stateParams) {
var defaultUrl = GetBasePath('job_templates') + $stateParams.id + '/';
Rest.setUrl(defaultUrl);
return Rest.get().then(function(res){
// handle unescaped newlines
return JSON.parse(JSON.stringify(res.data.extra_vars))
});
}]
}
});
$stateExtender.addState({