Merge pull request #2895 from AlanCoding/scm_vars

Allow SCM overwrite vars in the UI

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-01-21 19:13:47 +00:00 committed by GitHub
commit d98c60519e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 12 deletions

View File

@ -185,10 +185,6 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
if (source === 'scm') {
$scope.projectBasePath = GetBasePath('projects') + '?not__status=never updated';
$scope.overwrite_vars = true;
$scope.inventory_source_form.inventory_file.$setPristine();
} else {
$scope.overwrite_vars = false;
}
// reset fields
@ -201,6 +197,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
$scope.credential_name = null;
$scope.group_by = null;
$scope.group_by_choices = [];
$scope.overwrite_vars = false;
initRegionSelect();
};
// region / source options callback

View File

@ -392,13 +392,6 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
});
}
if (source === 'scm') {
$scope.overwrite_vars = true;
$scope.inventory_source_form.inventory_file.$setPristine();
} else {
$scope.overwrite_vars = false;
}
// reset fields
$scope.group_by_choices = source === 'ec2' ? $scope.ec2_group_by : null;
// azure_rm regions choices are keyed as "azure" in an OPTIONS request to the inventory_sources endpoint
@ -409,6 +402,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
$scope.credential_name = null;
$scope.group_by = null;
$scope.group_by_choices = [];
$scope.overwrite_vars = false;
initRegionSelect();

View File

@ -367,7 +367,7 @@ return {
dataTitle: i18n._('Overwrite Variables'),
dataContainer: 'body',
dataPlacement: 'right',
ngDisabled: "(!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd) || source.value === 'scm')"
ngDisabled: "(!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd))"
}, {
name: 'update_on_launch',
label: i18n._('Update on Launch'),