Skip to content

Fixes #39397 - Update AnsibleRolesSwitcher components to use DualList#792

Merged
kmalyjur merged 1 commit into
theforeman:masterfrom
pondrejk:listview
Jun 15, 2026
Merged

Fixes #39397 - Update AnsibleRolesSwitcher components to use DualList#792
kmalyjur merged 1 commit into
theforeman:masterfrom
pondrejk:listview

Conversation

@pondrejk

@pondrejk pondrejk commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Overview of Changes

  • AnsibleRolesSwitcher now uses DualList that already had the same functionality
  • Bunch of Pf3 imports got removed
  • Replaced snapshot tests

Note that ordering in DualList is currently not working, it will be addressed separeately

Roles tab with the proposed changes:
Screenshot 2026-06-04 at 17 19 17

with inheritance:

Screenshot 2026-06-04 at 17 19 49

@kmalyjur kmalyjur left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works well. I just have a few points:

Image

li {
padding: 0.5rem 0.75rem;
margin-bottom: 0.25rem;
background-color: $color-pf-black-200;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be: background-color: $color-pf-black-200;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so sorry, it should have been this for lines 33-34:

background-color: var(--pf-v5-global--BackgroundColor--200);
color: var(--pf-v5-global--Color--200);

toDestroyRoles,
error,
} = this.props;
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing dependencies warning. eslint-disable could be added.

@Lukshio Lukshio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • AnsibleRolesSwitcherError.js still uses PF3

@kmalyjur It has separate Jira issue

: `id !^ (${assignedRoles.map(role => role.id).join(', ')})`;
return { search: searchString };
};
export const ALL_ROLES_PER_PAGE = 1000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have some backstory why to use this number? Eventually users with more than 1000 roles will have issues.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh, not really, it's arbitrary. I have a card for adjusting DualList itself, so I could probably include some form of pagination there to solve this. For this PR, I could increase this or use 'all' to fetch everything, wdyt?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that should work.

@pondrejk

Copy link
Copy Markdown
Contributor Author
  • Missing space between the number and the name

@kmalyjur addressed, thanks!

@kmalyjur kmalyjur left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, LGTM 👍
@Lukshio do you want to check the changes, too?

@kmalyjur kmalyjur merged commit 03a7daa into theforeman:master Jun 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants