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

refactor: [M3-6300] - MUI v5 Migration - Components > CheckoutBar #9051

Merged

Conversation

dwiley-akamai
Copy link
Contributor

@dwiley-akamai dwiley-akamai commented Apr 24, 2023

Description 📝

Migrates SRC > Components > CheckoutBar from JSS to styled components.

Major Changes 🔄

  • Removed packages/manager/src/components/CheckoutBar/index.ts
  • Made use of styled components in CheckoutBar.tsx, housed in /CheckoutBar/styles.ts

How to test 🧪

Go to /kubernetes/create and ensure the checkout bar looks and functions the same as in prod.

To-Do:

  • Fix total amount display bug
  • Some sx refactoring

@cypress
Copy link

cypress bot commented Apr 24, 2023

Passing run #3186 ↗︎

0 151 3 0 Flakiness 0

Details:

Rename styled divs
Project: Cloud Manager E2E Commit: 278b128703
Status: Passed Duration: 17:41 💡
Started: Apr 26, 2023 2:36 PM Ended: Apr 26, 2023 2:54 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

>
{details}
</Typography>
)}
</div>
) : null}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

details is typed as a string or number, so I went with the ternary here.

},
checkoutSection: {
animation: '$fadeIn 225ms linear forwards',
opacity: 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't clear to me if animation and opacity were actually doing anything here, or what the benefit of keeping them would be, so I removed those properties.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not totally sure either, but it seems like the "Create Cluster" button does a slight fade in when the component first loads in prod. I don't think this is necessary and initial rendering + interacting with the CheckoutBar looks smooth to me without any animation

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

This looked good when testing with the preview link. Can we add a changelog entry?

I noticed with local development (this branch and on develop), we don't display the HA section for kube checkout even though showHighAvailability is true. Do you know why that is?

},
checkoutSection: {
animation: '$fadeIn 225ms linear forwards',
opacity: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not totally sure either, but it seems like the "Create Cluster" button does a slight fade in when the component first loads in prod. I don't think this is necessary and initial rendering + interacting with the CheckoutBar looks smooth to me without any animation

@dwiley-akamai
Copy link
Contributor Author

I noticed with local development (this branch and on develop), we don't display the HA section for kube checkout even though showHighAvailability is true. Do you know why that is?

It displays on mine; REACT_APP_LKE_HIGH_AVAILABILITY_PRICE probably isn't defined in your .env file

root: {
}));

const StyledDiv1 = styled('div')(() => {
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 have a convention for descriptively naming these styled components? For example, Root and CheckoutSection (the old JSS classnames) could be used instead of StyledDiv1 and StyledDiv2 and might make these names more meaningful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for asking this @hkhalil-akamai -- I think this is a good point and don't love StyledDiv1 or StyledDiv2 either. I do think it's useful to include the element name in the styled component name. I wonder if something like RootStyledDiv and CheckoutSectionStyledDiv would help address both of these points?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed or StyledRoot and StyledCheckoutSection... just something more descriptive 👍

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

REACT_APP_LKE_HIGH_AVAILABILITY_PRICE probably isn't defined in your .env file

Yep, that'll do it!

Pending some decision on the discussion about styled component naming (maybe this is a potential cafe topic?), the component in the UI looks good, so I'm approving.

@dwiley-akamai dwiley-akamai force-pushed the M3-6300-tss-reactify-checkoutbar branch from 84a8aa5 to 278b128 Compare April 26, 2023 14:32
@mjac0bs mjac0bs added the Approved Multiple approvals and ready to merge! label Apr 26, 2023
@dwiley-akamai dwiley-akamai merged commit c149541 into linode:develop Apr 26, 2023
@dwiley-akamai dwiley-akamai deleted the M3-6300-tss-reactify-checkoutbar branch April 26, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants