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

Show member popover when user avatar selected #2999

Merged

Conversation

danbr
Copy link
Contributor

@danbr danbr commented Dec 2, 2021

Description

This PR updates Actions, Events, Extension, & Motion pages to show user information popover when clicking on UserAvatar.

Screenshot 2021-12-02 at 13 21 32

Bugs

Some issues that were identified and corrected along the way:

  • Some MemberInfoPopover inherited from their parent and text became right aligned.
  • Differences in Width (CSS) between InfoPopover & MemberInfoPopover
  • InfoPopover “Copy” link when clicked, not showing “Copied” fully, due to Avatar size being affected by parent.

Resolves #2847

@CLAassistant
Copy link

CLAassistant commented Dec 2, 2021

CLA assistant check
All committers have signed the CLA.

@chinins chinins added the feature label Dec 2, 2021
@rdig rdig self-requested a review December 3, 2021 09:08
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Very nice work! 💯

Congratulations on your first PR!

This is all good, I just rejected it because I want you to add the "fancy' popover in one more place: Annotations on the Actions/Motions pages

See this screenshot:

Screenshot from 2021-12-03 11-25-56

The user widget on the right has the correct member popover (the one that you just added in this PR), while the one that appears over the avatar in Annotations, is still the "basic" version.

Please add it in there as well.

PS: you can drop the "Feature" from your PR's title, we only use "tags" like that for commit messages, PR titles should be more "human friendly" :)

Comment on lines +224 to +235
<div
/*
* Clicking on UserAvatar would redirect to Actions page and stop
* interaction with popover.
* stopPropagation prevents event being inherited by child
*/
onClick={stopPropagation}
onKeyPress={stopPropagation}
role="button"
tabIndex={0}
className={styles.avatar}
>
Copy link
Member

Choose a reason for hiding this comment

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

I'm good with this change, however there's an handleOnClick prop that's coming in, which assumes it can run the click action on the whole item.

Stopping propagation on the avatar, might impede that to some extent.

But since there's not "proper" way to check the execution requirements of the onClick function that's coming in (well, at least not without going a very deep dark rabbit hole), it will have to do for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The onClick was being passed to MemberInfoPopover, so it became clickable (same as the parent listItem), taking the user to the DefaultAction page.
Preventing the propagation allows MemberInfoPopover to behave as expected.

@rdig rdig marked this pull request as ready for review December 3, 2021 09:44
@danbr danbr changed the title Feature: Show member popover when user avatar selected Show member popover when user avatar selected Dec 3, 2021
@danbr danbr requested a review from rdig December 3, 2021 15:26
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

All good now, however there's a "rogue" merge commit in your commit history for this branch that shouldn't be there (most likely a rebase gone wrong)

Screenshot from 2021-12-06 16-50-14

Please clean up your commit history, after which you can merge

I'm pre-approving in the mean time.

(PS: let me know if you have trouble merging due to permissions issues)

Copy link
Contributor

@ArmandoGraterol ArmandoGraterol left a comment

Choose a reason for hiding this comment

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

Looking good! Nice first PR

@danbr danbr force-pushed the feat/2847-actionpage-show-member-popover branch from e300bbf to dceec2e Compare December 6, 2021 22:22
@danbr danbr merged commit 4482505 into JoinColony:master Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When clicking on a user from within action details view, show the user profile popover
5 participants