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(app): update Modal component and deprecate old one #10124

Closed
wants to merge 4 commits into from

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Apr 28, 2022

closes #9578

Overview

Right now, there are 3 modal components: baseModal in components, Modal in components, and Modal in the app folder. baseModal is only ever being used in the old app. So this PR deprecates baseModal and changes Modal in the app to not use baseModal at all. So when the time comes, we can delete baseModal all together.

Changelog

  • updates modal and creates a story and test
  • deprecates the old baseModal component

Review requests

  • does it match designs?

Risk assessment

low

@jerader jerader requested a review from a team as a code owner April 28, 2022 20:38
@jerader jerader requested review from Kadee80, sakibh and shlokamin and removed request for a team and Kadee80 April 28, 2022 20:38
@codecov
Copy link

codecov bot commented Apr 28, 2022

Codecov Report

Merging #10124 (5e4556e) into edge (f86b664) will decrease coverage by 0.00%.
The diff coverage is 64.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #10124      +/-   ##
==========================================
- Coverage   74.71%   74.70%   -0.01%     
==========================================
  Files        2093     2094       +1     
  Lines       55234    55241       +7     
  Branches     5567     5569       +2     
==========================================
+ Hits        41266    41269       +3     
- Misses      12831    12835       +4     
  Partials     1137     1137              
Flag Coverage Δ
app 71.24% <64.28%> (-0.02%) ⬇️
components 52.82% <ø> (ø)
labware-library 49.74% <ø> (ø)
protocol-designer 45.13% <ø> (ø)
react-api-client 82.48% <ø> (ø)
step-generation 86.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/src/atoms/Modal/Modal.stories.tsx 0.00% <0.00%> (ø)
components/src/modals/BaseModal.tsx 91.66% <ø> (ø)
app/src/atoms/Modal/index.tsx 91.66% <90.00%> (+2.77%) ⬆️

Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

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

I don't follow why we want to get rid of base modal. As per its description: A BaseModal is a layout component for building more specific modals., which seems like a valid shared component to me. It looks like the app's modal was using base modal prior to this PR, which seems like a good use case. Is the idea that we eventually want the modal component in the app folder to be moved into shared components or something?

Comment on lines 49 to 51
/**
* @deprecated Use Modal in app folder
*/
Copy link
Member

Choose a reason for hiding this comment

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

components in our component library should not point to components outside of it. ex. if PD or LL wants to use a modal component, it can't import it from the app, because the app is not a dependency of PD or LL (and shouldn't be)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PD and LL would use the modal component in the components folder

Copy link
Member

Choose a reason for hiding this comment

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

that makes sense, but we still should not be pointing consumers of our components library to non shared monorepo subdirectories. does that make sense? like if a consumer were poking around shared components and was pointed to the app sub directory, that would mean they would have to add the entire app as a dependency

@jerader jerader requested a review from shlokamin May 2, 2022 17:24
@b-cooper
Copy link
Contributor

b-cooper commented May 5, 2022

BaseModal is still being used via inheritance in a few existing components. We should hold off on deprecating it until we have consolidated all usage of modals in the app.

@b-cooper b-cooper closed this May 5, 2022
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.

Combine BaseModal and Modal into one component and update design
3 participants