feat: [UIE-8142] - IAM RBAC - Implement Roles Table - #12012
Conversation
mjac0bs
left a comment
There was a problem hiding this comment.
Hi @rodonnel-akamai - it looks like all the CI jobs are failing on this PR with an error related to the Akamai CDS package. Can you address that before review? (Does this branch have the latest from develop? Have you run pnpm clean and pnpm install?)
Also, is there somewhere I can find the date for the RBAC initial release mentioned under the Target Release Date?
I have and just reran it. I am puzzled by the failure of the CI jobs - it didn't happen that way the first time I raised the PR. I abandoned that PR because I couldn't resolve merge conflicts, and opened this PR under a new branch with the same code but fixes based on comments in the previous PR.
I don't have an exact date but I have heard June. I will look for a schedule somewhere. |
3f4f65f to
39f2fe9
Compare
b50cd95 to
51915c3
Compare
| }; | ||
|
|
||
| const handleAssignSelectedRoles = () => { | ||
| // Logic to assign selected roles |
There was a problem hiding this comment.
Is there another ticket TODO for this?
There was a problem hiding this comment.
No and there should be or this should be implemented. Will update one way or the other.
| data: EntitiesRole[] | RoleMap[], | ||
| suffix: string | ||
| ): SelectOption[] => { | ||
| const resourceTypes = Array.from(new Set(data?.map((el) => el.entity_type))); |
There was a problem hiding this comment.
Nit: We should avoid "resource" since it is now referred to as "entity"
There was a problem hiding this comment.
I've fixed this a several other new-ish references to "resource" in this file. There are still roughly 50 other references that I did not touch and maybe we should look at down the road.
| }; | ||
|
|
||
| export const mapEntityTypesForSelect = ( | ||
| data: EntitiesRole[] | RoleMap[], |
There was a problem hiding this comment.
Can we reuse mapEntityTypes function? How would other devs know which function to use when?
There was a problem hiding this comment.
The first one - mapEntityTypes came first and was for an autocomplete, which has different enough options that I had to do this for now. I think you are probably right that there has to be a simple way to combine these, and we should. I'll take a second look at this after the initial release.
| /** | ||
| * Add descriptions, permissions, type to roles | ||
| */ | ||
| export const mapAccountPermissionsToRoles = ( |
There was a problem hiding this comment.
Not sure about the name of this function. If I understand correctly, the permissions are already associated with the Role, so this function is flattening the roles and adding 'access', 'entity_type' and 'id' (id is the same as name so not sure it's needed) to the Role for display in the table.
There was a problem hiding this comment.
We can follow up on naming. @aaleksee-akamai and I were discussing creating a ticket to align the naming since it has evolved during backend development.
Cloud Manager UI test results🔺 1 failing test on test run #13 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/objectStorageMulticluster/bucket-details-multicluster.spec.ts" |
|||||||||||||||||
There was a problem hiding this comment.
Did merging in develop cause the linter to run on a bunch of other files that weren't in this PR? CI is failing again. @cpathipa - have you seen this with any of the other IAM PRs?
Edit: I saw this locally on this branch, and a different branch of my own that also had the latest develop merged in, before I ran pnpm clean && pnpm install && pnpm bootstrap to reset the dependencies. That seemed to clear the typecheck errors for me, which leads me to believe that maybe the typecheck failures on this branch are related to the new package update?
I can't test this with API data because I don't have devenv set up locally and have had various blockers in trying to do that in the past week. Still working through them, but just reviewed code and the UI without API data to get this reviewed.
It sounds like you need this in the 4/22 release for devcloud, so as long as we get CI passing and clean up warnings, the rest of my notes were more minor.
- The table should have centered empty state text and the action menus in the PR description's screenshot look like they're not aligned at the end of the row. If not addressed in this PR, can you please create a ticket to address as a follow up?
| "@linode/manager": Added | ||
| --- | ||
|
|
||
| UIE-8142 - implement Roles table ([#12012](https://github.com/linode/manager/pull/12012)) |
There was a problem hiding this comment.
Is this still an upcoming feature under active development? If so, can we delete this changeset and replace it with an "Upcoming Feature" changeset?
| <TableBody> | ||
| {!rows?.length ? ( | ||
| <TableRow> | ||
| <TableCell>No items to display.</TableCell> |
There was a problem hiding this comment.
I've written a ticket for this. https://track.akamai.com/jira/browse/UIE-8708
| } | ||
| buttonType="primary" | ||
| disabled={selectedRows.length === 0} | ||
| onClick={() => handleAssignSelectedRoles()} |
There was a problem hiding this comment.
Optional nit
| onClick={() => handleAssignSelectedRoles()} | |
| onClick={handleAssignSelectedRoles} |
|
|
||
| renderWithTheme(<RolesLanding />); | ||
|
|
||
| expect(screen.getByRole('progressbar')).toBeInTheDocument(); |
There was a problem hiding this comment.
Nit: Couple of linter warnings here - you can remove the expect.
There was a problem hiding this comment.
Honestly still learning to write the tests within this framework. It's both very different and familiar, so I definitely appreciate any pointers.
| "@tanstack/react-query-devtools": "5.51.24", | ||
| "@tanstack/react-router": "^1.111.11", | ||
| "@xterm/xterm": "^5.5.0", | ||
| "akamai-cds-react-components": "0.0.1-alpha.6", |
There was a problem hiding this comment.
Is this the first use of the Lit web components? That's probably a good thing to highlight in the PR description if so.
There was a problem hiding this comment.
Yes, as far as I know it is - hence the missed centered table row - going to have to figure that one out. (Ticket above.) You're right, I should have called it out in the description.
There was a problem hiding this comment.
A lot of warnings in this file - see the Github Actions reported by watchdog.
|
|
||
| export const RolesTableActionMenu = () => { | ||
| const assignRole = () => { | ||
| // TODO - implement the assign role functionality |
There was a problem hiding this comment.
Nit: helpful if TODOs reference ticket numbers if this is a follow up for another PR
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| }); |
| /** | ||
| * Add descriptions, permissions, type to roles | ||
| */ | ||
| export const mapAccountPermissionsToRoles = ( |
There was a problem hiding this comment.
We can follow up on naming. @aaleksee-akamai and I were discussing creating a ticket to align the naming since it has evolved during backend development.
mjac0bs
left a comment
There was a problem hiding this comment.
Thanks for fixing the lock file. Approving with passing CI and team discussion about the web components package remaining in this PR.


Description 📝
Highlight the Pull Request's context and intentions.
Changes 🔄
List any change(s) relevant to the reviewer.
Target release date 🗓️
4/22/2025
RBAC initial release
Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅