Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-avatar] Changed Shared user variant to Generic Avatar variant #2620

Merged
merged 25 commits into from
Mar 28, 2020

Conversation

supreethmr
Copy link
Contributor

Summary

Resolves #2026

Additional Details

Replaced Shared user variant with Generic Variant and added sub-variants single-user, shared-user, provider variants for Generic variant.

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 August 29, 2019 18:30 Inactive
@supreethmr supreethmr self-assigned this Aug 29, 2019
@supreethmr supreethmr requested a review from nramamurth August 30, 2019 04:29
genericIconClassNames = cx(['icon', GENERIC_VARIANTS.SHARED_USER]);
} else if (variant === GENERIC_VARIANTS.PROVIDER) {
genericIconClassNames = cx(['icon', GENERIC_VARIANTS.PROVIDER]);
}

/* eslint-disable react/forbid-dom-props */
return (
<div {...attributes} className={multiUserClassNames} style={customStyles}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rename multiUserClassNames.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated here

@@ -3,6 +3,8 @@ ChangeLog

Unreleased
----------
### Changed
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a MVB, right? Removing a variant altogether is a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this will be MVB..

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 August 30, 2019 09:35 Inactive

### Added
* `Generic` Variant with props same as `Shared User` and with `Variant` prop to support sub-variants like `single-user`, `shared-user` and `provider`.
* `variant` prop. this will take values for sub-variants `single-user`, `shared-user` and `provider`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is confusing to me as I understand that you are probably talking about the variant prop of Generic sub-component but at first glance, I felt this is in contradiction to what was mentioned earlier.

I'd remove this line altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced line with suggested line below..!

* `Shared User` Variant From Avatar Variants

### Added
* `Generic` Variant with props same as `Shared User` and with `Variant` prop to support sub-variants like `single-user`, `shared-user` and `provider`.
Copy link
Contributor

@nramamurth nramamurth Aug 30, 2019

Choose a reason for hiding this comment

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

Suggested change
* `Generic` Variant with props same as `Shared User` and with `Variant` prop to support sub-variants like `single-user`, `shared-user` and `provider`.
* the `generic` subcomponent that replaces the `sharedUser` subcomponent with a new `variant` prop that can be `single-user`, `shared-user`, or `provider`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @nramamurth. yes that sounds more appropriate. updated here : 5f17135

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 August 30, 2019 10:40 Inactive
<div {...attributes} className={multiUserClassNames} style={customStyles}>
{multiUserContent}
<div {...attributes} className={GenericUserClassNames} style={customStyles}>
<span className={genericIconClassNames} role="img" aria-label={alt} alt={alt} aria-hidden={isAriaHidden} />
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need aria-hidden attribute also here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

ok got it, this is actually a prop


const cx = classNames.bind(styles);

const GENERIC_VARIANTS = {
Copy link
Contributor

Choose a reason for hiding this comment

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

@supreethmr we will have to export this separately so that consumer can access it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added export : 4a470cf

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 September 3, 2019 05:35 Inactive
Copy link
Contributor

@yuderekyu yuderekyu left a comment

Choose a reason for hiding this comment

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

We have identical single, multi, and provider examples. Let's eliminate some redundancy.

Want to add an example that toggles between the three generic variants? Then, remove all multi and provider examples.

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 October 10, 2019 06:18 Inactive
@jeremyfuksa
Copy link
Contributor

jeremyfuksa commented Oct 10, 2019

UX Input
In the standard Avatar variant, it was discussed that we wouldn't show the fallback icon because that variant is only for initials. That would also mean that the deceased example would show initials and not an icon.

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 October 16, 2019 08:40 Inactive
@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 October 16, 2019 15:24 Inactive
@bjankord bjankord temporarily deployed to terra-core-deployed-pr-2620 October 16, 2019 15:55 Inactive
@@ -3,6 +3,9 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `generic` subcomponent replaces the `sharedUser` subcomponent
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a rationale for this breaking change? We're trying to make sure we provide that for breaking changes going forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have modified the change log for this code changes: 128dd37 . Let me know if any changes needs to be made.

@ryanthemanuel ryanthemanuel self-assigned this Oct 24, 2019
Copy link
Contributor

@jeremyfuksa jeremyfuksa left a comment

Choose a reason for hiding this comment

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

Tested: PR #2620
Resolves: Issue #2026

Reviewed:

  • Follows pattern considerations documented in the current Cerner Design Standards: Avatar - User Experience - Cerner Wiki
  • Follows UX defined design implementation for Avatar
  • Follows defined theme designs: terra-theme


    Verified by @jeremyfuksa, Marking as Verified, Ready for Release.
Pass
UX Review

@emilyrohrbough emilyrohrbough added the ⭐ UX Reviewed UX Reviewed and approved. label Jan 13, 2020
@StephenEsser StephenEsser changed the title Changed Shared user variant to Generic Avatar variant [terra-avatar] Changed Shared user variant to Generic Avatar variant Jan 24, 2020
rm012685 and others added 3 commits March 27, 2020 10:05
…iant

# Conflicts:
#	packages/terra-avatar/docs/generic.md
#	packages/terra-avatar/package.json
#	packages/terra-avatar/src/terra-dev-site/doc/avatar/About.1.doc.mdx
@ryanthemanuel ryanthemanuel merged commit ed26635 into master Mar 28, 2020
@ryanthemanuel ryanthemanuel deleted the Avatar-Provider-Variant branch March 28, 2020 17:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[terra-avatar] Provider Variant