Skip to content

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

Merged
merged 8 commits into from
Jan 21, 2025
Merged

ERA-10487: Support EFB schemas in ER > Header #1213

merged 8 commits into from
Jan 21, 2025

Conversation

gaboDev
Copy link
Contributor

@gaboDev gaboDev commented Jan 16, 2025

What does this PR do?

  • It adds support for Header fields of EFB in ER

How does it look

image

Relevant link(s)

@@ -1,5 +1,5 @@
import { setupServer } from 'msw/node';
Copy link
Contributor Author

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 = {
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 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);
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 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

Copy link
Contributor

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.

Copy link
Contributor

@luixlive luixlive left a 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]}`}
Copy link
Contributor

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);
Copy link
Contributor

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.

@tiffanynwong
Copy link
Collaborator

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.

  • Can we change the large and medium header to use the same font weight as "activity"? That would make the medium header match the style of the headers that are already in the event and the large header would match the event name style.
  • Can you please bump up the font weight of the small header to 400? (or whatever font weight we're using for the inputs.) The weight it's at now is quite hard to read.

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 = {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@AlanCalvillo AlanCalvillo left a comment

Choose a reason for hiding this comment

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

looking good.

@tiffanynwong
Copy link
Collaborator

tiffanynwong commented Jan 21, 2025

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.

  1. Large header = Event name = 20, font weight 500 medium, line height 24
  2. Medium header = section header = event section headers (Details, Activity, History) = 18, font weight 500 medium, line height 22
  3. Smalle header = 16, font weight 400 regular, line height 22
Screen Shot 2025-01-21 at 8 09 17 AM

@gaboDev
Copy link
Contributor Author

gaboDev commented Jan 21, 2025

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.

  1. Large header = Event name = 22, font weight 500 medium, line height 27
  2. Medium header = section header = event section headers (Details, Activity, History) = 18, font weight 500 medium, line height 22
  3. Smalle header = 16, font weight 400 regular, line height 22

@tiffanynwong it is done, let me know if you anything else 🫡

Copy link
Collaborator

@tiffanynwong tiffanynwong left a 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!

@gaboDev gaboDev merged commit ed0fcb4 into develop Jan 21, 2025
3 checks passed
@gaboDev gaboDev deleted the ERA-10487 branch January 21, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants