Skip to content

Comments

M3-4582 Change: Use a shared component for view-only permissions tables.#7169

Merged
Jskobos merged 3 commits intolinode:developfrom
Jskobos:M3-4582-read-only-permissions
Dec 7, 2020
Merged

M3-4582 Change: Use a shared component for view-only permissions tables.#7169
Jskobos merged 3 commits intolinode:developfrom
Jskobos:M3-4582-read-only-permissions

Conversation

@Jskobos
Copy link
Contributor

@Jskobos Jskobos commented Dec 1, 2020

Description

For OBJ access tokens and API access tokens, instead of showing a disabled version of the scopes form (with a bunch of radio buttons), if a user is in view-only mode instead use check marks for selected permissions. I opted to go with a shared (new) component for this, though it isn't clear if it's worth it in this case.

Screen Shot 2020-12-01 at 4 04 07 PM

@ndukatz there are a few existing e2e tests that used data-qa attributes that are lost using this approach (nothing in Cypress though). Please let me know if I broke anything you're working on.

@tiffwong making this change meant that the aria stuff needed to be dynamic. The results are a bit different but I think they're ok. Please let me know.

  • unit tests

@Jskobos Jskobos self-assigned this Dec 1, 2020
For OBJ access tokens and API access tokens, instead of
showing a disabled version of the scopes form
(with a bunch of radio buttons), if a user is in view-only
mode instead use check marks for selected permissions.
I opted to go with a shared (new) component for this,
though it isn't clear if it's worth it in this case.

Use check marks instead of disabled/greyed table cells

Refactor out an AccessCell component

Fix aria label

return (closeMenu: Function): Action[] => {
const actions = !isThirdPartyAccessToken
return !isThirdPartyAccessToken
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are linter fixes

Copy link
Contributor

@johnwcallahan johnwcallahan left a comment

Choose a reason for hiding this comment

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

UI looks good, one bug in the PAT drawer.

Not sure about the accessibility here. Maybe the span containing the SVG needs something like:

        role="checkbox"
        aria-checked="true"
        aria-disabled="true"

value="0"
<AccessCell
active={scopeTup[1] === 0}
scope="2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Think this should be "0"... currently there's some incorrect behavior when you click "None" for a single scope.

@Jskobos
Copy link
Contributor Author

Jskobos commented Dec 2, 2020

UI looks good, one bug in the PAT drawer.

Not sure about the accessibility here. Maybe the span containing the SVG needs something like:

        role="checkbox"
        aria-checked="true"
        aria-disabled="true"

I'm not sure about accessibility either, I feel weird telling people it's a checkbox when it isn't. I added an aria-label to the span instead, let me know what you think. @tiffwong please weigh in as well.

Copy link
Contributor

@johnwcallahan johnwcallahan left a comment

Choose a reason for hiding this comment

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

The ARIA label makes sense to me.

return (
<span
className={classes.checkIcon}
aria-label={`This token has ${scope} access for ${scopeDisplay}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, the aria-label isn't accessible so this never gets read but can easily be fixed by adding tabIndex={0}

Copy link
Contributor

@tiffwong tiffwong left a comment

Choose a reason for hiding this comment

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

This looks great! The check icons are a great visual touch to prevent users from thinking they can edit the permissions 💯

The only comment I have is to add a tabIndex so that users can access the aria-label and I agree with not labeling it as a checkbox since that could confuse the user into thinking they can edit it (which defeats the whole purpose of this)

@Jskobos Jskobos merged commit e751b4b into linode:develop Dec 7, 2020
@Jskobos Jskobos deleted the M3-4582-read-only-permissions branch December 7, 2020 15:33
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.

3 participants