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

fix(ValueCard) Remove XSMALL from LEGACY_CARD_SIZES because we are using and displaying unwanted warnings #3935

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

anishkumar-bhut
Copy link
Collaborator

Summary
in ValueCard component have a CARD_SIZES and in that XSMALL is under LEGACY_CARD_SIZES but in Operation dashboard and other places XSMALL is using so in console unwanted warning displaying so added XSMALL in CARD_SIZES

Change List (commits, features, bugs, etc)

Acceptance Test (how to verify the PR)

  • tests here

Regression Test (how to make sure this PR doesn't break old functionality)

  • tests here

Things to look for during review

  • Make sure all references to iot or bx class prefix is using the prefix variable
  • (React) All major areas have a data-testid attribute. New test ids should have test written to ensure they are not changed or removed.
  • UI should be checked in RTL mode to ensure the proper handling of layout and text.
  • All strings should be translatable.
  • The code should pass a11y scans (The storybook a11y knob should show no violations). New components should have a11y test written.
  • Unit test should be written and should have a coverage of 90% or higher in all areas.
  • All components should be passing visual regression test. For new styles or components either a visual regression test should be written for all permutations or the base image updated.
  • Changes or new components should either write new or update existing documentation.
  • PR should link and close out an existing issue

@anishkumar-bhut anishkumar-bhut changed the title Remove XSMALL from LEGACY_CARD_SIZES because we are using and displaying unwanted warnings fix(ValueCard) Remove XSMALL from LEGACY_CARD_SIZES because we are using and displaying unwanted warnings Mar 7, 2025
Copy link

netlify bot commented Mar 7, 2025

Deploy Preview for carbon-addons-iot-react ready!

Name Link
🔨 Latest commit e00df1d
🔍 Latest deploy log https://app.netlify.com/sites/carbon-addons-iot-react/deploys/67dab5553898260008f59a9e
😎 Deploy Preview https://deploy-preview-3935--carbon-addons-iot-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -9,6 +9,7 @@ export const COLORS = {
};

export const CARD_SIZES = {
XSMALL: 'XSMALL',
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this supported ? As far as I'm aware support for XSMALL was removed. and when ever someone use XSMALL we used to change it to 'SMALL'

This may have impact on monitor dashboards.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@herleraja Hello. Support for xsmall was removed, but we have a scenario in Maximo where the use of it is required again. It will only be allowed for certain simple Value cards, and there is likely some CSS cleanup and other work that will need to go in to that card type. What would work for Monitor here? Is there a condition or check we could add to isolate you from this change? @anishkumar-bhut @hectordavis @stuckless

Copy link
Collaborator

Choose a reason for hiding this comment

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

Where exactly is the warning coming from? From what I can see here, ValueCard still uses the LEGACY_CARD_SIZES as expected sizes

Copy link
Collaborator

@herleraja herleraja Mar 17, 2025

Choose a reason for hiding this comment

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

@JordanWSmith15 Just checked. I think the monitor should not be affected by this change.

We override the props accordingly.

image

Also, this may need to be well tested, because its used directly or indirectly
example if the size is small we won't display the error message icons. so we need to add the XSMALL size here too.
image

Copy link
Collaborator

@herleraja herleraja Mar 17, 2025

Choose a reason for hiding this comment

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

@hectordavis the warning thrown in getUpdatedCardSize but that's thrown only in development mode. It should not effect in production.
image

@@ -92,9 +92,7 @@ export const compareGrains = (grain1, grain2) => {

export const getUpdatedCardSize = (oldSize) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If its needed for value card may be you can do it specifically for value card. looks like getUpdatedCardSize function getting used in almost all the cards
image

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