-
Notifications
You must be signed in to change notification settings - Fork 0
ERA-10487: Support EFB schemas in ER > Header #1213
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
Conversation
@@ -1,5 +1,5 @@ | |||
import { setupServer } from 'msw/node'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these changes are not related with this ticket, I'm just fixing some issues We had with the msw update for this tests
@@ -503,6 +503,425 @@ const schemaWithDateTimes = { | |||
}, | |||
}; | |||
|
|||
const schemas = [schemaWithTexts, schemaWithSections, schemaWithBasicText, schemaWithDateTimes]; | |||
const headers = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a bunch of header configs, I will be erasing most of them before merging this to develop, just to keep this file light
renderHeader(); | ||
const header = screen.getByText(headerDetails.label); | ||
expect( header ).toBeVisible(); | ||
expect( header ).toHaveClass(styles.large); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got mixed feelings about checking the className in this test, but I thought it is needed to check the header is being display with the specific styles based on its size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense since its the only programmatic difference between the three of them. Otherwise you would have 3 tests asserting the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and easy. I just retook the conversation on using h
tags. I'm having second thoughts myself, I'd like to hear your opinions.
}; | ||
|
||
const Header = ({ details, id }) => ( | ||
<p className={`${styles.header} ${HEADER_THEMES[details.size]}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I guess here we can discuss about making this actual HTML headers like Gabo suggested:
const HEADER_THEMES = {
[HEADER_ELEMENT_SIZES.LARGE]: 'h4',
[HEADER_ELEMENT_SIZES.MEDIUM]: 'h5',
[HEADER_ELEMENT_SIZES.SMALL]: 'h6'
};
It worries me that since users will be the ones designing the forms, they can break the semantics if the use headers for other things like providing instructions or simply putting smaller headers over bigger headers. What do you think @JoshuaVulcan
renderHeader(); | ||
const header = screen.getByText(headerDetails.label); | ||
expect( header ).toBeVisible(); | ||
expect( header ).toHaveClass(styles.large); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense since its the only programmatic difference between the three of them. Otherwise you would have 3 tests asserting the same thing.
Hi @gaboDev Looking good 😎 Seeing the headers with the headers in the event like activity and history, I'm thinking we're adding too much variation in styles.
Sorry, I know we looked at this yesterday, but seeing it with everything else made it clearer. |
@@ -503,6 +503,425 @@ const schemaWithDateTimes = { | |||
}, | |||
}; | |||
|
|||
const schemas = [schemaWithTexts, schemaWithSections, schemaWithBasicText, schemaWithDateTimes]; | |||
const headers = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a section with two column headers, preferably with diff sizing for the two of them just for validation purposes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, it is under the label Headers and Sections
in the schema selector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good.
Thanks Gabo for the changes and making an example w/ the section headers. Sorry I didn't specify this, I think that the following should match including the section headers. And I realize I didn't specify a line height so adding that here as well. You can see examples here.
![]() |
@tiffanynwong it is done, let me know if you anything else 🫡 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! thank you for the tweaks to make all the styles match!
What does this PR do?
How does it look
Relevant link(s)