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

EDSC-4322: Refactor CustomizableIcons.jsx and fix styling inconsistencies #1842

Merged
merged 14 commits into from
Dec 30, 2024

Conversation

eudoroolivares2016
Copy link
Contributor

@eudoroolivares2016 eudoroolivares2016 commented Dec 4, 2024

Overview

What is the feature?

Standardize the classanames for cusomizableIcons.jsx, removes using actual portals on the unit test so that it won't fail if we make updates to portal configurations, fixes an issue in production where long harmony names are overlapping with text on the icons, some colors on the granule download options were not visible this updates their color so that they can more easily be seen

What is the Solution?

Updates the cusomizableIcons.jsx component to use the established pattern of having its own scss file to enforce lose coupling and making sure style changes to one component do not affect another one.

Updating the colors for a few buttons on the granule download links using carbon-50 to match icons we have on the order-status page

What areas of the application does this impact?

List impacted areas.

Testing

Reproduction steps

  • **Environment for testing:Prod
  • **Collection to test with:See below
  1. Collection with long Harmony service name C1996881146-POCLOUD
  2. Collection that has granules with S3 and download files: C1214470488-ASF
  3. Collections in general filter using the customizable facet to see ensure the icons are appearing as expected

Attachments

Current ops:
image
image
image

Feature Branch:
image
image
image
image

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 93.78%. Comparing base (fcae98f) to head (535e25f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tionsIcons/AvailableCustomizationsTooltipIcons.jsx 78.26% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1842      +/-   ##
==========================================
- Coverage   93.81%   93.78%   -0.04%     
==========================================
  Files         777      778       +1     
  Lines       18867    18885      +18     
  Branches     4867     4847      -20     
==========================================
+ Hits        17701    17711      +10     
- Misses       1090     1095       +5     
- Partials       76       79       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -642,7 +642,7 @@ const TourSteps = ({
<ExternalLink
href="https://www.earthdata.nasa.gov/learn/earthdata-search"
>
Earthdata Search wiki
Earthdata Search
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some discussion with PO around this; since this link is not actually a wiki page this language change is preferred

@@ -25,8 +25,7 @@ import SearchSidebarHeader from '../SearchSidebarHeader'
import SearchFormContainer from '../../../containers/SearchFormContainer/SearchFormContainer'
import PortalLinkContainer from '../../../containers/PortalLinkContainer/PortalLinkContainer'

// eslint-disable-next-line import/no-unresolved
import availablePortals from '../../../../../../portals/availablePortals.json'
import availablePortals from './availablePortalsMock.json'
Copy link
Contributor Author

@eudoroolivares2016 eudoroolivares2016 Dec 4, 2024

Choose a reason for hiding this comment

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

We have a tiny ticket to not use real portal configs in the unit tests

README.md Outdated Show resolved Hide resolved
@@ -9,7 +9,7 @@
cursor: pointer;

.button__icon {
color: rgba($color__spacesuit-white, 0.7);
color: $color__carbon--40;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should maybe be $color__carbon--50; since that is what we are using in static/src/js/components/CopyableText/CopyableText.scss

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 made it the same color as the nearby copy button so they all match this button I mean:
image

@eudoroolivares2016 eudoroolivares2016 marked this pull request as ready for review December 5, 2024 16:08
EDSC-4322: revert style change

EDSC-4322: Match colors
Copy link
Collaborator

@trevorlang trevorlang left a comment

Choose a reason for hiding this comment

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

Still working through the last bits of the PR review but I have a few tweaks in mind that will help with the design a bit. It would be great if we could get them in now while were touching this.

  • The line height on the Harmony services on the project page is too tight. We should remove the line-height: 1 declaration on .harmony-select-item. This is also affecting the customizable icons and makes those look better
  • When an access method hovered, the background of the customizable icons is too similar to the background of the access method. We should add some css to the .access-method so that when one is hovered, the customizable icon badge uses one step darker versions of the gray than the default.
  • The background color change during the hover state on the customizable icons and other badges is not serving any purpose and might make the icons look clickable, so I want to get rid of that. To fix that, we should:
    • Remove the hover state css on .customizable-icons__meta-icon
    • Remove the hover state on css`.collection-results-item__meta-icon
  • On harmony services on the project page, the customizable icons are not aligned with the service title. Adding align-items: flex-start on the .access-method-radio__header-primary class will clean that up.

hasCombine: false
}

availableCustomizationsTooltipIcons.propTypes = {
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 tried combining these two the issue becomes that these are props to MetaIcon when its used so we'd need to refactor MetaIcon as well and its being used that way in other places as well for non customizable icons

@eudoroolivares2016 eudoroolivares2016 changed the title EDSC-4322: Cleanup the classnames in CustomizableIcons.jsx EDSC-4322: Refactor CustomizableIcons.jsx and remove reused CSS Dec 16, 2024
@eudoroolivares2016 eudoroolivares2016 changed the title EDSC-4322: Refactor CustomizableIcons.jsx and remove reused CSS EDSC-4322: Refactor CustomizableIcons.jsx and fix styling inconsistencies Dec 16, 2024
Copy link
Collaborator

@bnp26 bnp26 left a comment

Choose a reason for hiding this comment

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

@eudoroolivares2016 Personally I find the "Available" part of the new components to be a bit redundant and like the old name better but that's a matter of preference, then the new tooltips component would be named CustomizableTooltipIcons.jsx

If you do decide to move forward with the new naming, it might be better english to call the new customization icons to be
AvailableCustomizationIcons.jsx instead of AvailableCustomizationsIcons.jsx but that's up to you.
Similarly, the Icons would be AvailableCustomizationTooltipIcons.jsx instead of AvailableCustomizationsTooltipIcons.

Copy link
Collaborator

@trevorlang trevorlang 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 good to me other than some tiny tweaks to colors to improve contrast on the hover states. I think we should improve that while we're in here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not related to your PR, but could you tweak the hover states on lines 58 and 101 to be $color__carbon--5, instead of $color__carbon--10? That extra contrast will be good.

@bnp26
Copy link
Collaborator

bnp26 commented Dec 19, 2024

@eudoroolivares2016 If you're gonna change the component name to AvailableCustomizationIcons, you should also change the filenames to say those as well

@eudoroolivares2016 eudoroolivares2016 merged commit 3f1a79a into main Dec 30, 2024
11 checks passed
@eudoroolivares2016 eudoroolivares2016 deleted the EDSC-4322 branch December 30, 2024 19:09
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.

4 participants