forked from ansible/awx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ansible#9960 from mabashian/9955-cred-bool
Fixes bug where credential form checkboxes were erroneously checked SUMMARY link ansible#9955 A couple of things going on here. Updating initialValues.inputs was also modifying credential.inputs because initialValues.inputs was originally a reference to credential.inputs. I changed this so that initialValues.inputs now starts off as a clone of credential.inputs. https://github.com/ansible/awx/compare/devel...mabashian:9955-cred-bool?expand=1#diff-db8df3eaf3e3b3117f845786dea77451fba53e9d6a3f49ae367a26137039fc35L256 <- this line was erroneously evaluating to false when the value of an input was false. We actually just want to make sure the key exists in the object before dropping in to this block. This is what actually fixes the bug. Before this change we would fall in to https://github.com/ansible/awx/compare/devel...mabashian:9955-cred-bool?expand=1#diff-db8df3eaf3e3b3117f845786dea77451fba53e9d6a3f49ae367a26137039fc35R268 where the checkbox value would be erroneously set. ISSUE TYPE Bugfix Pull Request COMPONENT NAME UI Reviewed-by: Jake McDermott <[email protected]> Reviewed-by: Tiago Góes <[email protected]>
- Loading branch information
Showing
4 changed files
with
154 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
awx/ui_next/src/screens/Credential/shared/data.towerCredential.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"id": 4, | ||
"type": "credential", | ||
"url": "/api/v2/credentials/4/", | ||
"related": { | ||
"named_url": "/api/v2/credentials/Tower cred++Ansible Tower+cloud++/", | ||
"created_by": "/api/v2/users/2/", | ||
"modified_by": "/api/v2/users/2/", | ||
"activity_stream": "/api/v2/credentials/4/activity_stream/", | ||
"access_list": "/api/v2/credentials/4/access_list/", | ||
"object_roles": "/api/v2/credentials/4/object_roles/", | ||
"owner_users": "/api/v2/credentials/4/owner_users/", | ||
"owner_teams": "/api/v2/credentials/4/owner_teams/", | ||
"copy": "/api/v2/credentials/4/copy/", | ||
"input_sources": "/api/v2/credentials/4/input_sources/", | ||
"credential_type": "/api/v2/credential_types/15/", | ||
"user": "/api/v2/users/2/" | ||
}, | ||
"summary_fields": { | ||
"credential_type": { | ||
"id": 16, | ||
"name": "Ansible Tower", | ||
"description": "" | ||
}, | ||
"created_by": { | ||
"id": 2, | ||
"username": "test", | ||
"first_name": "", | ||
"last_name": "" | ||
}, | ||
"modified_by": { | ||
"id": 2, | ||
"username": "test", | ||
"first_name": "", | ||
"last_name": "" | ||
}, | ||
"object_roles": { | ||
"admin_role": { | ||
"description": "Can manage all aspects of the credential", | ||
"name": "Admin", | ||
"id": 37 | ||
}, | ||
"use_role": { | ||
"description": "Can use the credential in a job template", | ||
"name": "Use", | ||
"id": 38 | ||
}, | ||
"read_role": { | ||
"description": "May view settings for the credential", | ||
"name": "Read", | ||
"id": 39 | ||
} | ||
}, | ||
"user_capabilities": { | ||
"edit": true, | ||
"delete": true, | ||
"copy": true, | ||
"use": true | ||
}, | ||
"owners": [ | ||
{ | ||
"id": 2, | ||
"type": "user", | ||
"name": "test", | ||
"description": " ", | ||
"url": "/api/v2/users/2/" | ||
} | ||
] | ||
}, | ||
"created": "2021-04-20T14:05:16.538312Z", | ||
"modified": "2021-04-20T14:05:26.177919Z", | ||
"name": "Tower cred", | ||
"description": "", | ||
"organization": null, | ||
"credential_type": 16, | ||
"managed_by_tower": false, | ||
"inputs": { | ||
"host": "https://localhost", | ||
"username": "", | ||
"verify_ssl": false | ||
}, | ||
"kind": "tower", | ||
"cloud": true, | ||
"kubernetes": false | ||
} |