Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EE detail Edit when include_tags not an array #1736

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Mar 8, 2022

Creating a remote execution environmnent and then editing it already works (as the UI will always send include_tags: [], exclude_tags: [] when not set).

But creating one through the API, you can skip include_tags or exclude_tags without getting a validation error.
After that, editing that EE only works from the list screen, but yields a blank screen when editing from the detail screen.

Fixing by adding a || [] to the detail screen as well.

No-Issue

(corresponding code in list screen edit: https://github.com/ansible/ansible-hub-ui/blob/master/src/containers/execution-environment-list/execution_environment_list.tsx#L433-L434 )

Creating a remote execution environmnent and then editing it already works (as the UI will always send include_tags: [], exclude_tags: [] when not set).

But creating one through the API, you can skip include_tags or exclude_tags without getting a validation error.
After that, editing that EE only works from the list screen, but yields a blank screen when editing from the detail screen.

Fixing by adding a `|| []` to the detail screen as well.

No-Issue
@himdel
Copy link
Collaborator Author

himdel commented Mar 8, 2022

Reproduce..

REGISTRY_PK=`curl 'http://localhost:8002/api/automation-hub/_ui/v1/execution-environments/registries/' \
  -u admin:admin \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"docker1736","url":"https://registry.hub.docker.com/"}' \
  | jq -r .pk`

curl 'http://localhost:8002/api/automation-hub/_ui/v1/execution-environments/remotes/' \
  -u admin:admin \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"evil1736","upstream_name":"library/alpine","registry":"'"$REGISTRY_PK"'"}'

(creates a docker1736 RR, and an evil1736 remote EE)

Then go to EE list, click evil1736, and click Edit on the detail screen.
Expected: form
Actual: blank screen

@himdel himdel merged commit efefc68 into ansible:master Mar 9, 2022
@himdel himdel deleted the ee-detail-edit-include-tags branch March 9, 2022 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants