1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Hide Ansible Environment form fields when there are no custom venvs

This commit is contained in:
Marliana Lara 2018-03-26 12:20:36 -04:00
parent 4740f90dc7
commit 9b30b02acb
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
4 changed files with 23 additions and 17 deletions

View File

@ -52,7 +52,8 @@ export default ['NotificationsList', 'i18n',
dataTitle: i18n._('Ansible Environment'),
dataContainer: 'body',
dataPlacement: 'right',
ngDisabled: '!(organization_obj.summary_fields.user_capabilities.edit || canAdd)'
ngDisabled: '!(organization_obj.summary_fields.user_capabilities.edit || canAdd)',
ngShow: 'custom_virtualenvs_options.length > 0'
}
},

View File

@ -52,17 +52,6 @@ export default ['i18n', 'NotificationsList', 'TemplateList',
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd) || !canEditOrg',
awLookupWhen: '(project_obj.summary_fields.user_capabilities.edit || canAdd) && canEditOrg'
},
custom_virtualenv: {
label: i18n._('Ansible Environment'),
type: 'select',
defaultText: i18n._('Select Ansible Environment'),
ngOptions: 'venv for venv in custom_virtualenvs_options track by venv',
awPopOver: "<p>" + i18n._("Select the custom Python virtual environment for this project to run on.") + "</p>",
dataTitle: i18n._('Ansible Environment'),
dataContainer: 'body',
dataPlacement: 'right',
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)'
},
scm_type: {
label: i18n._('SCM Type'),
type: 'select',
@ -211,8 +200,21 @@ export default ['i18n', 'NotificationsList', 'TemplateList',
dataTitle: i18n._('Cache Timeout'),
dataPlacement: 'right',
dataContainer: "body",
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)'
}
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
},
custom_virtualenv: {
label: i18n._('Ansible Environment'),
type: 'select',
defaultText: i18n._('Select Ansible Environment'),
ngOptions: 'venv for venv in custom_virtualenvs_options track by venv',
awPopOver: "<p>" + i18n._("Select the custom Python virtual environment for this project to run on.") + "</p>",
dataTitle: i18n._('Ansible Environment'),
dataContainer: 'body',
dataPlacement: 'right',
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)',
ngShow: 'custom_virtualenvs_options.length > 0'
},
},
buttons: {

View File

@ -1,15 +1,17 @@
.at-Upgrade--panel {
align-items: center;
background-color: @at-color-body-background-light;
border-radius: 10px;
color: @at-color-body-text;
display: flex;
flex-direction: column;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: @at-font-size-jumbotron-text;
height: ~"calc(100vh - 40px)";
justify-content: center;
margin-top: @at-space-10x;
margin: @at-space-4x;
padding: @at-space-10x;
}
}
.at-Upgrade--header {
display: flex;

View File

@ -240,7 +240,8 @@ function(NotificationsList, i18n) {
dataTitle: i18n._('Ansible Environment'),
dataContainer: 'body',
dataPlacement: 'right',
ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAdd)'
ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAdd)',
ngShow: 'custom_virtualenvs_options.length > 0'
},
instance_groups: {
label: i18n._('Instance Groups'),