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

[rbac] New UI for object permission assignment #1863

Merged
merged 10 commits into from
Jun 8, 2022

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Apr 7, 2022

Fixes AAH-1129
Depends on:

Related to ansible/galaxykit#39

Changes:

  • Namespace detail - add a new "Namespace owners" tab, allows assigning a group with some roles to the namespace
  • Namespace create modal - removed groups from modal, changed the on success redirect to go directly to Namespace owners
  • Namespace edit - removed groups from form, left an info box in its place
  • EE edit - removed groups from edit modal, left info box
  • EE detail - add a new "Owners" tab, same as in namespaces, different set of permissions
where before after
namespace create 20220426212407 20220426212630 after, goes to 20220426213035
namespace edit 20220426212453 20220426212649
remote EE edit 20220426212518 20220426212718
local EE edit 20220426212543 20220426212728
added namespace remote EE local EE
empty state 20220426214655 20220426214709 20220426214717

20220523233604
20220523233634
20220523233712
20220523233742
20220523233756
20220523233821
20220523233830
20220523233844

@himdel himdel force-pushed the aah1129 branch 3 times, most recently from 4245275 to 8d4fd6d Compare April 8, 2022 13:35
@newswangerd newswangerd changed the base branch from master to feature/rbac-roles April 22, 2022 13:06
@himdel himdel force-pushed the aah1129 branch 5 times, most recently from 3ea899d to 1ff6475 Compare April 26, 2022 20:20
@himdel himdel force-pushed the feature/rbac-roles branch from 7a38047 to b8ad7ca Compare April 26, 2022 20:44
@himdel himdel force-pushed the aah1129 branch 4 times, most recently from f723252 to 2c18444 Compare April 26, 2022 22:01
@himdel himdel force-pushed the aah1129 branch 2 times, most recently from 395f447 to 5f498b3 Compare April 27, 2022 03:35
@himdel himdel force-pushed the feature/rbac-roles branch from b8ad7ca to 26857a5 Compare April 29, 2022 02:49
@himdel
Copy link
Collaborator Author

himdel commented May 2, 2022

Current issues:

=> remaining issues will need ansible/galaxy_ng#1279 and be fixed in a separate PR: #2186

@himdel himdel marked this pull request as ready for review May 26, 2022 00:02
@himdel himdel requested a review from newswangerd May 26, 2022 00:05
@himdel himdel force-pushed the feature/rbac-roles branch from 0653ce9 to e0054d2 Compare June 7, 2022 14:10
@himdel
Copy link
Collaborator Author

himdel commented Jun 7, 2022

Rebased both the base branch and this PR,
so this should now be working with just ansible/galaxy_ng#1279 + this PR.

himdel added a commit to himdel/ansible-hub-ui that referenced this pull request Jun 7, 2022
Issue: AAH-1129

add GroupType

namespace edit, detail, EE base tab cleanups

namespace create - redirect to Namespace owners on success

namespace edit, EE edit - info alert pointing to Owners tab

GroupDetailRoleManagement - use EmptyStateNoData instead of Custom for the no data screen

move PreviewRoles, SelectRoles, GroupRolePermissions to components, use EmptyStateNoData

EE base: move addAlert, alerts to base

SelectGroup

OwnersTab: add to namespace detail & EE detail tabs
@himdel
Copy link
Collaborator Author

himdel commented Jun 8, 2022

Merging to get the rest unstuck

@himdel himdel merged commit 066d054 into ansible:feature/rbac-roles Jun 8, 2022
himdel added a commit that referenced this pull request Jun 23, 2022
* Create new UI for object permission assignment

Issue: AAH-1129

* add GroupType

* namespace edit, detail, EE base tab cleanups

* namespace create - redirect to Namespace owners on success

* namespace edit, EE edit - info alert pointing to Owners tab

* GroupDetailRoleManagement - use EmptyStateNoData instead of Custom for the no data screen

* move PreviewRoles, SelectRoles, GroupRolePermissions to components, use EmptyStateNoData

* EE base: move addAlert, alerts to base

* SelectGroup

* OwnersTab: add to namespace detail & EE detail tabs
himdel added a commit that referenced this pull request Jun 23, 2022
* Create new UI for object permission assignment
* add GroupType
* namespace edit, detail, EE base tab cleanups
* namespace create - redirect to Namespace owners on success
* namespace edit, EE edit - info alert pointing to Owners tab
* GroupDetailRoleManagement - use EmptyStateNoData instead of Custom for the no data screen
* move PreviewRoles, SelectRoles, GroupRolePermissions to components, use EmptyStateNoData
* EE base: move addAlert, alerts to base
* SelectGroup
* OwnersTab: add to namespace detail & EE detail tabs

Issue: AAH-1129
@himdel himdel mentioned this pull request Jun 23, 2022
@himdel himdel deleted the aah1129 branch June 25, 2022 22:25
himdel added a commit that referenced this pull request Aug 1, 2022
* Create new UI for object permission assignment
* add GroupType
* namespace edit, detail, EE base tab cleanups
* namespace create - redirect to Namespace owners on success
* namespace edit, EE edit - info alert pointing to Owners tab
* GroupDetailRoleManagement - use EmptyStateNoData instead of Custom for the no data screen
* move PreviewRoles, SelectRoles, GroupRolePermissions to components, use EmptyStateNoData
* EE base: move addAlert, alerts to base
* SelectGroup
* OwnersTab: add to namespace detail & EE detail tabs

Issue: AAH-1129
@himdel himdel changed the title New UI for object permission assignment [rbac] New UI for object permission assignment Aug 1, 2022
himdel added a commit that referenced this pull request Aug 15, 2022
* Create new UI for object permission assignment
* add GroupType
* namespace edit, detail, EE base tab cleanups
* namespace create - redirect to Namespace owners on success
* namespace edit, EE edit - info alert pointing to Owners tab
* GroupDetailRoleManagement - use EmptyStateNoData instead of Custom for the no data screen
* move PreviewRoles, SelectRoles, GroupRolePermissions to components, use EmptyStateNoData
* EE base: move addAlert, alerts to base
* SelectGroup
* OwnersTab: add to namespace detail & EE detail tabs

Issue: AAH-1129
himdel added a commit that referenced this pull request Aug 15, 2022
* Role list view (#1860)

* create role list view
* roleAPI
* updates exports for roleAPI
* update roleList paths
* add table
* add item to table headers and implement rolelisttable in role-list component.
* add permission chip selector
* update RoleAPI and role-list-view
* fix EmptyStateFilter
* delete function role delete
* update roleAPI
* initialize createRole UI page
* role create functions
* formatting
* changelog entry
* rework editRole path
* add description to create role component
* get description field working in create role ui
* update name and description state in role edit component
* implement saveRole function in role-edit component
* error handing on edit role page
* adding error handling to create and edit pages
* add DateComponent to list view
* remove extra loading spinner
* Add tooltip to locked roles
* add sorting to created at column
* drop unused createRole method
* use helper text
* remove extraneous code in maperrormessages.tsx
* cleanup UX on edit role page
* fix UX on role create form
* get redirect and tooltips working
* add filtering for galaxy. roles only
* work with mapErrorMessages error
* additional form input validation
* finalize form validation
* cleanup compound filters
* reusable role-form
* role-edit parent component
* properly type nameValidated and descriptionValidated
* tighten up the mapErrors method for network error handling.
* remove extra import and use just one <Form> component in RoleForm
* include galaxy__starts_with in UI
* rework validateInput functions
* move validateINput and mapNetworkErros to util
* move role functions to containers/role-management

Issue: AAH-1131

* Rework groups view (#1797)

* Rework groups view
* Fix params issues
* fix requests spam
* fix group_management test
* add allSettled promise
* comment out and skip permissions related tests
* add api changes and fixes
* fix translation
* update changes
* fix pagination and UI
* show only selected roles
* add custom permissions and hide No permission

Issue: AAH-1130

* Fix CI, unify breadcrumb types (#1978)

* BreadcrumbType: unify types for breadcrumbs, fix eslint warning (any)
* namespaces.js test: disable tests failing on roles

* Rbac testing (#1993)

* cypress test rbac UI pages
* edit role test

* GroupRoleAPI, RoleAPI, PulpAPI - move logic to components (#1981)

* GroupRoleAPI, PulpAPI - move getRolesWithPermissions outside api, keep only listRoles; use apiPath instead of custom constructor
* RoleAPI.list - drop hardcoded filter, move to components using it
* RoleList already sets the default param, but needs to be able to override it away,
  the rest just moves the hardcoding to the user component
* GroupRoleAPI - listRoles use super.list for ordering
* GroupRoleAPI: addRoleToGroup comment about content_object being required
* TaskManagementAPI: use super.list since the ordering logic was moved to PulpAPI

* Drop all ObjectPermissionField logic (#1980)

* drop ObjectPermissionField from EE edit, NS create, NS edit
* namespace-edit test - drop edit owners field test

* test add roles to group (#1995)

* add roles to group
* update intercept command to replace cy.wait(10000)
* add login to beforeEach hook.

* Optimize assigned roles to group loading and fix bugs (#2086)

* fix not showing new roles
* rework and optimize group role fetching
* fix .bugfix file
* fix group_roles test

Issue: AAH-1600
Issue: AAH-1602

* Fix redirection to not existing group (#2118)

* add notFound redirection
* remove group name from message title

Issue: AAH-1668

* New UI for object permission assignment (#1863)

* Create new UI for object permission assignment
* add GroupType
* namespace edit, detail, EE base tab cleanups
* namespace create - redirect to Namespace owners on success
* namespace edit, EE edit - info alert pointing to Owners tab
* GroupDetailRoleManagement - use EmptyStateNoData instead of Custom for the no data screen
* move PreviewRoles, SelectRoles, GroupRolePermissions to components, use EmptyStateNoData
* EE base: move addAlert, alerts to base
* SelectGroup
* OwnersTab: add to namespace detail & EE detail tabs

Issue: AAH-1129

* add permission checks (#2210)

Issue: AAH-1699

* OwnersTab SelectRoles - filter roles by ?for_object_type (#2186)

* Move user, group, role and permission related components to src/components/rbac/ (#2247)

* fix roles screens for user with group perms (#2266)

AAH-1698

* Role lists - default sort by name, show description, pretty "Galaxy only" in AppliedFilters (#2092)

* RoleList - pretty AppliedFilters for `name__startswith: "galaxy."` -> `Galaxy only: true`
* RoleList - default sort by name
* GroupDetailRoleManagement: add description field, switch to RolePermissions
  now that we have data for .description and .permission in the list api
* SelectRoles: sort by role name
  it's the default sort now, but adding it makes the sort indicator work
  affects group add roles, namespace/EE roles in wizad
* OwnersTab: sort groups and roles by name
* PulpAPI - add useOrdering bool param, but default to false
  and enable it for RoleAPI and TaskManagementAPI, but not GroupRoleAPI
  related to pulp/pulpcore#2703
* rbac_create test: filter for role before checking it's present
  now that we're sorting by name, it's not on the first page anymore
  .. which is an opportunity to test filtering works too :)
* role_list whitespace fix
* Remove Role -> Remove role
* OwnersTab: use lodash sortBy instead of a handmade <=>
* GroupRoleAPI - useOrdering
  after pulp/pulpcore#2849
* role list - rename Locked to Built-in/Editable
* role-list: don't show "can't edit/remove" tooltip for editable items
* rbac_edit: don't expect newest roles on the top, filter to find the right one
* user_detail: there is no ui/group-list request, only a route change
* fixup rbac_edit
* user_detail: use galaxykit more
* galaxykit error log
* rbac_edit: specify which edit to click
* galaxykit log code and error on failure; user_detail fix param order

* Test Namespace/EE owners (#2230)

* rbac_owners test: test Namespace owners and EE owners tab
* EE: show Detail tab even if container name contains "detail", "images", "activity" or "owners"
  (currently naming a container rbac_owners_123 causes the Detail tab to become inaccessible, and the UI assumes the Owners tab is open when it isn't, breaking tests)
* rbac_owners: create test group, don't rely on system:partners-engineers
* group_roles - clean up role afterwards; rbac_owners - use the first role if multiple
* rbac_owners fixups - modal strong->b, delete-button, not delete_button
* rbac_owners: close alerts after checking them
* fixup remove group check

* Fix additional perms (#2267)

* hide sync button in ee detail
* hide delete button in ee image
* add perms in owners tab
* add perms to owners tab

* cypress: install galaxykit branch with roles (#2268)

* RBAC Test rework (#2184)

* add cy.createRole command
* wip add commands
* add test preview roles
* rewrite group_management test
* add test for deleted assigned roles
* fix pagination
* code cleanup
* add EmptyState data-cy
* rework rbac tests
* minor test fixes
* use galaxykit commands instead
* fix rebase errors
* fix test err and lint prop

Issue: AAH-1616
Issue: AAH-1678

Co-authored-by: Shaiah Emigh-Doyle <[email protected]>

* Group roles test (#2117)

* rebase and fix conflicts
* fix group_roles test
* fix group_management test
* fix CI
* fix double data-cy attr

Issue: AAH-1616

* Add and fix permissions related to roles and group/roles (#2337)

* let group/role assigning with change_group perm
* fix additional roles and group/roles perms
* fix missing space
* unauth group detail screen
* add unauth to group detail screen
* fix perms to be able to edit ee

Issue: AAH-1729
Issue: AAH-1752
Issue: AAH-1754
Issue: AAH-1766
Issue: AAH-1810

* Remove unexpected digest value (#2375)

Issue: AAH-1841

* EE edit - only make the Owners tab link clickable when editing (#2376)

Issue: AAH-1792

* group-list: filter "Group name" by name__icontains, not exact name (#2336)

* group-list: filter "Group name" by name__icontains, not exact name
* group-list: use name__contains, icontains not supported by api
* fix missing i18n

Issue: AAH-1806

* rbac_edit: fix selector, it's not `li[role=menuitem]` but `li > a[role=menuitem]` .. omitting the element names

Co-authored-by: Shaiah Emigh-Doyle <[email protected]>
Co-authored-by: Jiří Jeřábek <[email protected]>
Co-authored-by: Brian McLaughlin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant