mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Merge pull request #6087 from jakemcdermott/fix-6054
Fix several ui_next bugs related to unexpected data types Reviewed-by: Jake McDermott <yo@jakemcdermott.me> https://github.com/jakemcdermott
This commit is contained in:
@@ -15,6 +15,8 @@ function FormSubmitError({ error }) {
|
|||||||
setErrors(errorMessages);
|
setErrors(errorMessages);
|
||||||
if (errorMessages.__all__) {
|
if (errorMessages.__all__) {
|
||||||
setErrorMessage(errorMessages.__all__);
|
setErrorMessage(errorMessages.__all__);
|
||||||
|
} else if (errorMessages.detail) {
|
||||||
|
setErrorMessage(errorMessages.detail);
|
||||||
} else {
|
} else {
|
||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class ResourceAccessList extends React.Component {
|
|||||||
onClick={this.handleAddOpen}
|
onClick={this.handleAddOpen}
|
||||||
/>,
|
/>,
|
||||||
]
|
]
|
||||||
: null
|
: []
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ function ProjectAdd() {
|
|||||||
if (values.scm_type === 'manual') {
|
if (values.scm_type === 'manual') {
|
||||||
values.scm_type = '';
|
values.scm_type = '';
|
||||||
}
|
}
|
||||||
|
if (!values.credential) {
|
||||||
|
// Depending on the permissions of the user submitting the form,
|
||||||
|
// the API might throw an unexpected error if our creation request
|
||||||
|
// has a zero-length string as its credential field. As a work-around,
|
||||||
|
// normalize falsey credential fields by deleting them.
|
||||||
|
delete values.credential;
|
||||||
|
}
|
||||||
setFormSubmitError(null);
|
setFormSubmitError(null);
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ function ProjectEdit({ project }) {
|
|||||||
if (values.scm_type === 'manual') {
|
if (values.scm_type === 'manual') {
|
||||||
values.scm_type = '';
|
values.scm_type = '';
|
||||||
}
|
}
|
||||||
|
if (!values.credential) {
|
||||||
|
// Depending on the permissions of the user submitting the form,
|
||||||
|
// the API might throw an unexpected error if our creation request
|
||||||
|
// has a zero-length string as its credential field. As a work-around,
|
||||||
|
// normalize falsey credential fields by deleting them.
|
||||||
|
delete values.credential;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
data: { id },
|
data: { id },
|
||||||
|
|||||||
Reference in New Issue
Block a user