Skip to content

Conversation

@bisht-richa
Copy link
Contributor

What does this PR change?

  • Created new component steps progressbar
  • Created some UIs with dummy data for RBAC UI using steps progressbar component

GUI diff

image

image

image

  • DONE

Documentation

Test coverage

ℹ️ If a major new functionality is added, it is strongly recommended that tests for the new functionality are added to the Cucumber test suite

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • Cucumber tests were added

  • DONE

Links

Issue(s): #
Port(s): # add downstream PR(s), if any

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

@github-actions
Copy link
Contributor

👋 Hello! Thanks for contributing to our project.
Acceptance tests will take some time (aprox. 1h), please be patient ☕

You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/10496/checks
Once tests finish, if they fail, you can check 👀 the cucumber report. See the link at the output of the action.
You can also check the artifacts section, which contains the logs at https://github.com/uyuni-project/uyuni/pull/10496/checks.

If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code.

Reference tests:

KNOWN ISSUES

Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience.

For more tips on troubleshooting, see the troubleshooting guide.

Happy hacking!
⚠️ You should not merge if acceptance tests fail to pass. ⚠️

@cbbayburt
Copy link
Contributor

cbbayburt commented Jul 30, 2025

Some notes after initial review:

  • Add RBAC endpoint entries to DB
    • /manager/admin/config/access-group, etc.
  • Rename menu item "Access Group" to "Access Control"
    • Left menu bar
    • URL '../access-group'
    • Controller method: showAccessGroup
    • Template file 'access-group.jade'
    • .. etc

Role list page:

  • No pagination needed
  • Don't list built-in groups
    • Remove 'Type' column

Namespace list table:

  • Search bar must work for descriptions as well

Add users step & add users tab in edit:

  • Only users from the same org as the AG should be listed
    • Remove 'Organization' column

parlt91 and others added 26 commits October 11, 2025 17:11
@parlt91 parlt91 force-pushed the component-steps-progressbar branch from ef95129 to c4e32a5 Compare October 11, 2025 15:12
@parlt91 parlt91 force-pushed the component-steps-progressbar branch from c4e32a5 to 67c083d Compare October 11, 2025 15:21
Copy link
Contributor

@cbbayburt cbbayburt left a comment

Choose a reason for hiding this comment

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

Thank you very much @bisht-richa, @parlt91. It looks very good overall.

I've also deployed and tested it, and everything works as expected.

Apart from my inline comments, here's a few notes I had when testing, mostly on the UX:

  • The text [API] looks a bit raw on the table. Maybe we should pick an icon for this instead.
  • Bug: when I go back to the first step and remove an item from "Copy permissions from" control, the permissions list is not recalculated.
  • After a series of searching and adding, it's easy to lose track of the overall selections. We need an overview of all the selections at the final step.
  • When you search for a namespace, the natural next step is always expanding some rows. We can automatically expand the whole filtered list after a search, and reduce the necessary steps taken by the user.
  • Apart from that, we could also use the usual "Expand/Collapse all" controls on the table.

Comment on lines +139 to +144
useEffect(() => {
if (!isLoading) {
setIsLoading(true);
getNamespaces(searchValue);
}
}, [searchValue]);
Copy link
Contributor

Choose a reason for hiding this comment

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

In this kind of search-as-you-type task, it's a good practice to limit the requests to the backend to prevent clogging up the network.

We already do this using the debounce utility from lodash. It wraps the method that does the API call and it waits for some milliseconds of inactivity before it calls the method. This way you avoid calling the API for every keystroke, and only do one call after the user pauses typing.

Here's an example usage (note the last arg: 100ms of wait time):

const onSearch = useCallback(
debounce((newSearch: string) => {
channelProcessor.setSearch(newSearch).then((newRows) => {
if (newRows) {
setRows(newRows);
}
if (newSearch) {
// Open all channels when search changes so visible child matches are also visible
setOpenRows(new Set(newRows?.map((row) => row.base.id)));
} else {
// When change is cleared, close all besides the selected base
const selectedBaseChannelId = channelProcessor.getSelectedBaseChannelId();
if (selectedBaseChannelId) {
setOpenRows(new Set([selectedBaseChannelId]));
}
}
});
}, 100),
[]
);

I think it should work if you wrap the getNamespace method like this and call it in useEffect.

if (item.orgName === "-") {
return (
<div className="btn-group">
<Button className="btn-default btn-sm" icon="fa-user" />
Copy link
Contributor

Choose a reason for hiding this comment

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

This button has no function. I think we don't need it at all. I don't even remember why this was here in the first place (also below in the else block).

Comment on lines +77 to +81
<LinkButton
className="btn-default btn-sm"
icon="fa-pencil"
href={`/rhn/manager/admin/access-control/show-access-group/${item.id}`}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

This button is missing a title

Comment on lines +526 to +528
.withVisibility(adminRoles.get("satellite")))
.addChild(new MenuItem("Access Control")
.withPrimaryUrl("/rhn/manager/admin/access-control")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove the item from here if there's no specific reason for it?

@@ -0,0 +1 @@
- Implemented a new StepsProgressBar component for managing RBAC.
Copy link
Contributor

Choose a reason for hiding this comment

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

The end user doesn't need to know about StepsProgressBar. Let's keep it simple. Maybe something like:

Suggested change
- Implemented a new StepsProgressBar component for managing RBAC.
- Implemented RBAC management UI

.createNativeQuery("""
SELECT *
FROM access.namespace
WHERE :filter <% lower(namespace||description)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should add a "." after the namespace (also to the index in the schema). Currently, "systemget_details" works, but "system.get_details" doesn't.

Comment on lines +2 to +8
INSERT INTO access.namespace (namespace, access_mode, description)
SELECT 'admin.access-control.access-group', 'R', 'List and detail custom access groups.'
WHERE NOT EXISTS (SELECT 1 FROM access.namespace WHERE namespace = 'admin.access-control.access-group' AND access_mode = 'R');

INSERT INTO access.namespace (namespace, access_mode, description)
SELECT 'admin.access-control.access-group', 'W', 'Create, modify and delete custom access groups.'
WHERE NOT EXISTS (SELECT 1 FROM access.namespace WHERE namespace = 'admin.access-control.access-group' AND access_mode = 'W');
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't plan to expand this feature much further so I think only 2 levels are enough for the namespace. Also I suggested "access" to be consistent with the api.access namespace.

Suggested change
INSERT INTO access.namespace (namespace, access_mode, description)
SELECT 'admin.access-control.access-group', 'R', 'List and detail custom access groups.'
WHERE NOT EXISTS (SELECT 1 FROM access.namespace WHERE namespace = 'admin.access-control.access-group' AND access_mode = 'R');
INSERT INTO access.namespace (namespace, access_mode, description)
SELECT 'admin.access-control.access-group', 'W', 'Create, modify and delete custom access groups.'
WHERE NOT EXISTS (SELECT 1 FROM access.namespace WHERE namespace = 'admin.access-control.access-group' AND access_mode = 'W');
INSERT INTO access.namespace (namespace, access_mode, description)
SELECT 'admin.access', 'R', 'List and detail custom access groups.'
WHERE NOT EXISTS (SELECT 1 FROM access.namespace WHERE namespace = 'admin.access-control.access-group' AND access_mode = 'R');
INSERT INTO access.namespace (namespace, access_mode, description)
SELECT 'admin.access', 'W', 'Create, modify and delete custom access groups.'
WHERE NOT EXISTS (SELECT 1 FROM access.namespace WHERE namespace = 'admin.access-control.access-group' AND access_mode = 'W');

Also: the data is missing in common/data/..

@@ -0,0 +1 @@
- Implemented a new StepsProgressBar component for managing RBAC.
Copy link
Contributor

Choose a reason for hiding this comment

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

The end user doesn't need to know about StepsProgressBar. Let's keep it simple. Maybe something like:

Suggested change
- Implemented a new StepsProgressBar component for managing RBAC.
- Implemented RBAC management UI

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.

5 participants