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

chore(Cross): [IOAPPX-448] Add missing components to the Design System section, remove legacy ones + Change ListItemMessage component API #6541

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

dmnplb
Copy link
Contributor

@dmnplb dmnplb commented Dec 11, 2024

Short description

This PR updates the Design System section with missing components. Checking them in isolation is essential to avoid regression during development.

List of changes proposed in this pull request

  • Add BannerErrorState to the DSAdvice page
    • Restrict the choice of possible icons to avoid excessive generalisation of the component itself
  • Add the ListItemSearchInstitution to the DSListItems page
  • Rename CgnModuleDiscount to ModuleCgnDiscount, refactor it and move it to DSModules from DSListItems
  • Remove gradients from DSColors because CGN doesn't use them anymore

MessageListItemListItemMessage

  • Change the component name
  • Rename DoubleAvatar to AvatarDouble (to keep the same convention as the others) and add it to the DSLogos page
  • Replace badgeText and badgeVariant props with the single tag prop
  • Remove CustomPressableListItemBase by integrating it into ListItemMessage
  • Add all the ListItemMessage possible combinations to DSListItems for testing purposes

Preview

The new ListItemMessage section in the List Items page

How to test

Go to the Design System section and check the update pages

@dmnplb dmnplb added the Design System New visual language and reduction of previous UI clutter label Dec 11, 2024
@pagopa-github-bot pagopa-github-bot changed the title [IOAPPX-448] Add missing components to the Design System section chore(Cross): [IOAPPX-448] Add missing components to the Design System section Dec 11, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Dec 11, 2024

Affected stories

  • ⚙️ IOAPPX-448: Aggiunta di alcuni componenti all'interno della sezione DS
    subtask of

Generated by 🚫 dangerJS against 6b3f740

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 78.78788% with 14 lines in your changes missing coverage. Please review.

Project coverage is 49.16%. Comparing base (4f204b4) to head (1ddd447).
Report is 907 commits behind head on master.

Files with missing lines Patch % Lines
ts/features/design-system/core/DSListItems.tsx 40.00% 6 Missing ⚠️
ts/features/messages/components/Home/homeUtils.ts 0.00% 3 Missing ⚠️
ts/components/ui/BannerErrorState.tsx 0.00% 1 Missing ⚠️
ts/features/design-system/core/DSAdvice.tsx 50.00% 1 Missing ⚠️
ts/features/design-system/core/DSModules.tsx 66.66% 1 Missing ⚠️
...features/messages/screens/MessagesSearchScreen.tsx 0.00% 1 Missing ⚠️
...es/common/components/ListItemSearchInstitution.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6541      +/-   ##
==========================================
+ Coverage   48.42%   49.16%   +0.73%     
==========================================
  Files        1488     1553      +65     
  Lines       31617    32068     +451     
  Branches     7669     7259     -410     
==========================================
+ Hits        15311    15765     +454     
- Misses      16238    16264      +26     
+ Partials       68       39      -29     
Files with missing lines Coverage Δ
.../components/merchants/CgnMerchantsDiscountItem.tsx 22.22% <ø> (-17.78%) ⬇️
...nus/cgn/components/merchants/ModuleCgnDiscount.tsx 94.44% <100.00%> (ø)
...omponents/merchants/discount/CgnDiscountHeader.tsx 100.00% <ø> (ø)
ts/features/design-system/DesignSystem.tsx 31.03% <ø> (-3.75%) ⬇️
ts/features/design-system/core/DSColors.tsx 22.95% <ø> (+2.95%) ⬆️
ts/features/design-system/core/DSLogos.tsx 31.42% <ø> (+0.39%) ⬆️
ts/features/design-system/core/DSTypography.tsx 45.65% <ø> (-4.35%) ⬇️
...tures/messages/components/Home/DS/AvatarDouble.tsx 60.00% <100.00%> (ø)
...es/messages/components/Home/DS/ListItemMessage.tsx 100.00% <100.00%> (ø)
...ges/components/Home/DS/ListItemMessageSkeleton.tsx 100.00% <100.00%> (ø)
... and 11 more

... and 1717 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc66860...1ddd447. Read the comment docs.

@dmnplb dmnplb changed the title chore(Cross): [IOAPPX-448] Add missing components to the Design System section chore(Cross): [IOAPPX-448] Add missing components to the Design System section, remove legacy ones Dec 13, 2024
@dmnplb dmnplb marked this pull request as ready for review December 13, 2024 15:12
@dmnplb dmnplb requested review from ChrisMattew, gispada, freddi301 and a team as code owners December 13, 2024 15:12
@dmnplb dmnplb requested a review from Vangaorth December 13, 2024 15:14
Copy link
Contributor

github-actions bot commented Dec 17, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOAPPX-448

/* Component Types */

type BaseBannerErrorStateProps = WithTestID<{
icon?: IOIcons;
icon?: BannerErrorStateIcons;
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 really need to limit the icons here? What do you think about making the entire IOIcons set available instead? It would certainly provide more flexibility for potential future use cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hantex9 It certainly provides more flexibility, but the component already has a specific job (Error...), which is to signal states related to errors or warnings. For other purposes we already have other components like Banner or Alert. I can't see BannerErrorState being used with a smiley icon, for example.

So I think it's better to limit the choice for now. If we need some flexibility in the future, things will change.

Copy link
Contributor

Choose a reason for hiding this comment

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

It makes sense, and I understand your point about the component having a specific purpose. However, limiting the icons to a predefined set could become a constraint in the future if new error-related icons are introduced or required for additional use cases.

This approach might lead to an increased boilerplate if we need to update the component later to include more icons. Allowing the entire IOIcons set would future-proof the component and reduce the need for maintenance in case requirements evolve. What do you think?

Copy link
Contributor Author

@dmnplb dmnplb Dec 18, 2024

Choose a reason for hiding this comment

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

limiting the icons to a predefined set could become a constraint in the future if new error-related icons are introduced or required for additional use cases

I consider adding this level of friction to be a feature rather than a bug, but I also understand your point about new error-related icons. I'll restore the IOIcons generic type 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hantex9 Addressed here → 1ddd447 (#6541)

@dmnplb dmnplb self-assigned this Dec 17, 2024
Copy link
Contributor

@Hantex9 Hantex9 left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cross Design System New visual language and reduction of previous UI clutter dont-merge ✋
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants