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

New Permissions Pages #17328

Merged
merged 53 commits into from Aug 24, 2021
Merged

New Permissions Pages #17328

merged 53 commits into from Aug 24, 2021

Conversation

alxnddr
Copy link
Member

@alxnddr alxnddr commented Aug 5, 2021

Description

This PR replaces the old Permissions UI with the new one that should make viewing/editing permissions easier especially for customers with a lot of data. It should behave the same in terms of business logic, only the UI has changed.

Screenshots

Collections permissions

Before
Screen Shot 2021-08-12 at 19 06 45

After
Screen Shot 2021-08-12 at 01 32 49

Data permissions

Before
Screen Shot 2021-08-12 at 19 06 57

After — groups focus
Screen Shot 2021-08-09 at 04 04 15

After — databases focus
Screen Shot 2021-08-09 at 04 04 29

Collection permissions modal

Before
Screen Shot 2021-08-12 at 19 07 48

After
Screen Shot 2021-08-09 at 04 05 02

Snippet folder permissions modal

Before
Screen Shot 2021-08-12 at 19 08 06

After
Screen Shot 2021-08-09 at 04 05 16

Warnings

Screen Shot 2021-08-16 at 11 07 25

Closes #4186
Closes #8165
Closes #10874
Closes #10920
Closes #12489
Closes #14669
Closes #14671
Closes #17185
Closes #15233

@alxnddr alxnddr changed the title wip: moving changes from 0.40 permissions branch New Permissions Pages Aug 6, 2021
@alxnddr alxnddr self-assigned this Aug 6, 2021
@alxnddr alxnddr force-pushed the new-permission-pages branch 5 times, most recently from 8b3ae3d to 6c0a0d5 Compare August 12, 2021 15:58
@alxnddr
Copy link
Member Author

alxnddr commented Aug 12, 2021

@metabase-bot run visual tests

@alxnddr alxnddr force-pushed the new-permission-pages branch 5 times, most recently from 71b4f76 to 4e30bd3 Compare August 13, 2021 00:16
@alxnddr
Copy link
Member Author

alxnddr commented Aug 13, 2021

@metabase-bot run visual tests

@kdoh
Copy link
Member

kdoh commented Aug 13, 2021

Overall looking quite solid. There are a couple things I noticed while playing with this that I'd consider tweaking.

  1. I think we need a more obvious sense that the database names in the top level group based view are clickable. Think it could be worth using text-decoration: underline here just to be super obvious that you can drill down further.

Screen Shot 2021-08-13 at 9 46 53 AM

  1. It's not clear which database I'm looking at when I've drilled through into a DB or schema in the group view. We might want to consider adding breadcrumbs here above the "Schema name" label just to help make it easier to scoot around. This is especially true when you get linked to that screen when selecting which tables you want to limit for a particular group as I mention in the next point.

Screen Shot 2021-08-13 at 9 53 43 AM

  1. I've noticed some jumpiness in the top of the permission page when I select "Limit access" and then I get taken over to the group view. It's like the confirm save bar pops in for a second and then disappears. I tried capturing it in this recording.
permissions-ui-flashing.mov

@alxnddr alxnddr force-pushed the new-permission-pages branch 2 times, most recently from af03375 to 3ce3c35 Compare August 13, 2021 17:12
@alxnddr
Copy link
Member Author

alxnddr commented Aug 13, 2021

@kdoh I've addressed all the points, thanks!

@codecov
Copy link

codecov bot commented Aug 14, 2021

Codecov Report

Merging #17328 (8b72fd5) into master (4b0afb6) will decrease coverage by 24.30%.
The diff coverage is 24.65%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #17328       +/-   ##
===========================================
- Coverage   62.46%   38.15%   -24.31%     
===========================================
  Files        1639     1240      -399     
  Lines       65735    33141    -32594     
  Branches     7258     4918     -2340     
===========================================
- Hits        41061    12646    -28415     
+ Misses      21507    19772     -1735     
+ Partials     3167      723     -2444     
Flag Coverage Δ
back-end ?
front-end 38.14% <24.65%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ntend/src/metabase-enterprise/sandboxes/actions.js 0.00% <0.00%> (ø)
...base-enterprise/sandboxes/components/GTAPModal.jsx 0.00% <0.00%> (ø)
...rontend/src/metabase-enterprise/sandboxes/index.js 0.00% <0.00%> (ø)
...frontend/src/metabase-enterprise/snippets/index.js 0.00% <ø> (ø)
...ionPermissionsModal/CollectionPermissionsModal.jsx 0.00% <0.00%> (ø)
...issionsModal/CollectionPermissionsModal.styled.jsx 0.00% <0.00%> (ø)
...components/PermissionsEditor/PermissionsEditor.jsx 0.00% <0.00%> (ø)
...ents/PermissionsEditor/PermissionsEditor.styled.js 0.00% <0.00%> (ø)
...PermissionsEditor/PermissionsEditorBreadcrumbs.jsx 0.00% <0.00%> (ø)
...sionsEditor/PermissionsEditorBreadcrumbs.styled.js 0.00% <0.00%> (ø)
... and 529 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b0afb6...8b72fd5. Read the comment docs.

@alxnddr alxnddr force-pushed the new-permission-pages branch 3 times, most recently from 1aa0665 to e44177c Compare August 15, 2021 23:43
@alxnddr alxnddr marked this pull request as ready for review August 15, 2021 23:43
@alxnddr alxnddr requested review from howonlee, flamber and a team August 16, 2021 07:54
@alxnddr
Copy link
Member Author

alxnddr commented Aug 16, 2021

@metabase/frontend-developers it is a big one but I split it into granular commits to make the review a bit easier. Please tell if you'd prefer me to create multiple PRs

Copy link
Contributor

@flamber flamber left a comment

Choose a reason for hiding this comment

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

Just did a quick test of e44177c - here's what I've found:
Looks really nice, but takes a while to get used to it.

  1. Clicking the database/schema/table links fails - they are /admin/permissions/data/database1 instead of /admin/permissions/data/database/1
    image
  2. The table search also search schema, but it's a bit strange, when there's overlaps
    image
    image
  3. I'm still seeing Weird UX around setting limited data permissions #15233
  4. If I redo Sandbox modal "cancel" doesn't work correctly #14669, then I can get to a state, where the table is sandboxed, without me defining anything in the sandbox (clicked cancel) and then saved permissions, but now it's not possible to edit the sandbox settings - nothing opens. This might have something to do with sandbox modal sends a GTAP request, which is separate from the overall permission Save request, so it's possible to get into a weird state (though this has always existed and doesn't expose any data incorrectly).

@kulyk
Copy link
Member

kulyk commented Aug 20, 2021

Tremendous work @alxnddr 👏
Have some general UX feedback here (cc @kdoh)

Discard changes popup

The popup is a little bit confusing. If I have unsaved changes and try to leave a page or change a tab, I see a popup saying "your changes will be discarded if you leave" with two options: "Cancel" and "Discard changes". I expected "Cancel" to close the popup, so I can save my changes and "Discard changes" to leave the page without saving the changes, but it works vice-versa. I guess it doesn't align with the common UX pattern for confirmations like these

Video Demo
confusing-discard-popup.mov

Updating permissions for child collections

When I change permission for a collection, the popover has a toggle to apply the changes to child collections too. The toggle is placed below the permission options, so I tend to select the permission first and then select the toggle. However:

  1. The popover closes once I select the permission level, so I need to open it for the second time to change the toggle
  2. If I actually reopen the popover and click the toggle, it won't apply the change to children. It only works if I first change the toggle and then change the permission level. I'm just worried it might confuse people
Video Demo
children-update-ux.mov

@alxnddr
Copy link
Member Author

alxnddr commented Aug 22, 2021

@metabase-bot run visual tests

@alxnddr
Copy link
Member Author

alxnddr commented Aug 23, 2021

@flamber @daltojohnso @kulyk thank you for reviewing this PR and for your feedback, I hope it was not that painful. I addressed your comments, could you please take a look again?

@kulyk yes, this toggle is really inconvenient, thanks for pointing. If you don't mind, I'll fix it in a separate PR, because it worked the same way before.

@daltojohnso I added a bit of tests on selectors, but previously they contained some mutating logic. Instead, I have cypress specs for that, but the coverage can be increased. Would you mind if I add more tests in a follow-up PR?

Copy link
Contributor

@flamber flamber left a comment

Choose a reason for hiding this comment

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

Testing 909e299
When I try to edit a sandbox, then it show 404 and changes to URL to this:
/undefined/segmented/group/[object Object]

@alxnddr
Copy link
Member Author

alxnddr commented Aug 23, 2021

@flamber oh, seems like I broke it during some refactoring while addressing review comments. Fixed, added a spec to prevent breaking it again. Thanks for catching it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment