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

[do not merge] Access Tabs for Hub resources (testable with namespaces) #1498

Closed
wants to merge 13 commits into from

Conversation

vidyanambiar
Copy link
Member

@vidyanambiar vidyanambiar commented Jan 23, 2024

Jira Issues

AAH-3052
AAH-3053
AAH-3054

Design changes from existing UI:

  • In the existing UI, the Access tab for a resource contains 2 lists, one for users and one for teams (groups). In the new UI, the single access tab is broken into 2 tabs "User access" and "Team access" each containing a list of users and teams respectively.
  • Clicking on a user/team in the "User/Team access" tab brings up the list of roles for that user/team. The tabs would change to reflect a "Back to user/team access" tab and a "Roles" tab. The breadcrumbs reflect the current selected tab.

Changes in this PR:

  • Hub
    • Reusable components to implement lists for users, teams and roles in the access tabs for a hub resource
    • This PR does not include the actions for adding or deleting a user/team/role. It will be added separately.
    • Updates to Namespace page adding tabs for User access and Team access
  • Framework
    • updated useInMemoryView to handle text-based filters correctly
    • PageBreadcrumbs: Provider and hook for managing breadcrumbs in the PageHeader and PageRoutedTabs components. This allows the currently active tab to be displayed in the breadcrumbs.
Screen.Recording.2024-01-24.at.12.42.54.PM.mov

@github-actions github-actions bot added HUB AFW Ansible Framework labels Jan 23, 2024
@github-actions github-actions bot added E2E End-to-end testing CCT Component tests labels Jan 24, 2024
@vidyanambiar vidyanambiar marked this pull request as ready for review January 24, 2024 17:41
return filters;
}, [t]);

const view = useInMemoryView<HubAccessRole>({
Copy link
Contributor

Choose a reason for hiding this comment

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

@vidyanambiar I am just starting to look at this PR. It does look pretty good.

I could not follow why we need to use the useInMemoryView, neither why the changes were required there. Is it something that we will need to use in order to use the new approach for breadcrumbs?

Could we document this new hook, and how to use them?

Copy link
Member Author

Choose a reason for hiding this comment

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

@nixocio Thanks for taking a look!

Reason for using the useInMemoryView hook: Unlike most other list UIs, this one does not have a direct API call for loading the roles table so we cannot utilize usePulpView or useHubView which are associated with an API call for fetching the data for the table. We need to use the object-roles array that is received within the user/team data. So the table is constructed using a static array. useInMemoryView is a hook provided in the framework to create a PageTable directly from data instead of the API. And it provides the utilities required like selectable rows, filtering etc. I needed to make a small update for making the filtering work correctly for text-based filters.

framework/PageHeader.tsx Outdated Show resolved Hide resolved
@himdel
Copy link
Contributor

himdel commented Jan 29, 2024

Something is broken, I can access both Access tabs under namespaces,
but:

  1. be on https://localhost:4102/namespaces/abc/user-access?page=1&perPage=10&sort=username
  2. click Add user
  3. https://localhost:4102/namespaces/:id/user-access-add-user renders, with a Under Development screen, namespace name no longer appears

(same for groups)

(looks like it doesn't set the namespace id in the url)

but when I alter the url manually, I still get the same Under Development screen

@vidyanambiar
Copy link
Member Author

vidyanambiar commented Jan 29, 2024

@himdel Yes, https://localhost:4102/namespaces/:id/user-access-add-user does not work yet in this PR (same for teams). I'm fixing up the routing for that along with hooking up the add user action in the next PR.

@vidyanambiar vidyanambiar changed the title Access Tabs for Hub resources (testable with namespaces) [do not merge] Access Tabs for Hub resources (testable with namespaces) Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AFW Ansible Framework CCT Component tests E2E End-to-end testing HUB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants