Skip to content

[AAP-80860] Fix EDA role wizard resource type dropdown and search#3322

Open
amasolov wants to merge 1 commit into
ansible:develfrom
amasolov:fix/eda-resource-type-dropdown
Open

[AAP-80860] Fix EDA role wizard resource type dropdown and search#3322
amasolov wants to merge 1 commit into
ansible:develfrom
amasolov:fix/eda-resource-type-dropdown

Conversation

@amasolov

@amasolov amasolov commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Type of Change

  • Bug fix
  • Enhancement
  • Tests
  • Documentation
  • Other (please specify)

Risk Analysis - REQUIRED

  • High — Broad platform impact (e.g., SWR config, shared framework components, authentication, routing, API wrappers, build/bundler config). Changes affect multiple workspaces or could cause widespread regressions.
  • Medium — Scoped but cross-cutting (e.g., shared utility functions, changes to multiple pages within one workspace, component library updates, test infrastructure). Limited blast radius but touches common code paths.
  • Low — Narrowly scoped (e.g., single page fix, styling tweak, documentation, test-only changes, copy/string updates). Minimal risk of unintended side effects.

Testing

Manual Testing

  • Navigate to EDA > Users, select a user, click "Add roles"
  • Verify the "Resource type" dropdown now lists EDA resource types (Credentials, Projects, Rulebook Activations, Decision Environments, etc.)
  • Select a resource type and verify the resource list loads
  • Search for a resource by name using different case and verify it is found

Relates to #3122

The EdaSelectResourceTypeStep parsed the OPTIONS response content_type
choices as objects ({value, display_name}) but the Django REST Framework
backend returns them as tuples ([value, display_name]).  This caused
the .filter() to get undefined for every item, producing an empty
"Resource type" dropdown and blocking all EDA role assignments.

Align the EDA implementation with the AWX equivalent by using a tuple
type and array destructuring.

Additionally, switch the resource selection toolbar filter from 'name'
to 'name__icontains' for case-insensitive search (missed in ansible#3122).

Signed-off-by: Alexey Masolov <[email protected]>
Co-authored-by: Cursor <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions github-actions Bot added community Community contribution from fork size/S Small PR EDA Changes in frontend/eda labels Jul 2, 2026
@amasolov

amasolov commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

After further investigation using Playwright against a live AAP 2.7 instance, the "Resource type" dropdown in the unified "Assign roles" wizard (/access/users/{id}/roles) populates correctly with all 18 resource types from Automation Execution, Automation Decisions, Automation Content, and System.

The unified wizard uses GET /api/gateway/v1/service-index/role-types/ (a gateway-level API) to populate the dropdown, and does not call OPTIONS /api/eda/v1/role_definitions/ at all. The EdaSelectResourceTypeStep.tsx component (modified in this PR) does not appear to be rendered in the AAP 2.7 unified UI.

This suggests the original report may have been against a standalone EDA development server or older codebase where that component was still active. Leaving this PR open for team discussion, as the fix may still be valid for standalone EDA UI contexts.

@jon-nfc

jon-nfc commented Jul 3, 2026

Copy link
Copy Markdown

@amasolov

This PR is blocked by: ansible/eda-server-operator#331

This suggests the original report may have been against a standalone EDA development server or older codebase where that component was still active. Leaving this PR open for team discussion, as the fix may still be valid for standalone EDA UI contexts.

That is correct and why I included the site header in my report (#3122 (comment)).

The version of the EDA server being used is ansible/eda-server@b4030df, due to a bug somewhere after this commit because login does not work. see bug report ansible/eda-server#1504.

Currently no newer version of EDA Server can be used until this bug is addressed. There is a PR open, ansible/eda-server-operator#331. However no one appears to be interested in addressing.

As such no newer version of EDA server can be used to confirm if this PR is relevant/"still an issue" for EDA server, as the eda-server cant be logged on to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix community Community contribution from fork e2e: pending E2E tests not yet triggered EDA Changes in frontend/eda size/S Small PR waiting-on-author PR requires author attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants