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

feat(cards): refactor cards with content block - FRONT-3606 #2469

Merged
merged 14 commits into from
May 16, 2022

Conversation

emeryro
Copy link
Contributor

@emeryro emeryro commented May 12, 2022

Update card component, to rely on the new content block element

Important:
Data structure has been updated/simplified (), but a temporary backward compatibility has been provided to avoid breaking changes.
Main modifications in data:

  • the wrapper "card" object is no longer needed
  • "meta" has been renamed to "primary_meta"
  • "infos" has been renamed to "secondary_meta"
  • "type" has been removed (no longer used)

@emeryro emeryro self-assigned this May 12, 2022
@github-actions
Copy link

github-actions bot commented May 16, 2022

@emeryro emeryro marked this pull request as ready for review May 16, 2022 07:29
@emeryro emeryro requested a review from a team May 16, 2022 07:29
@@ -193,9 +207,23 @@ export default {
decorators: [withCode, withNotes],
};

export const Card = (args) => card(prepareData(dataCard, args));
export const Default = (args) => card(prepareData(dataCardDefault, args));

Copy link
Contributor

Choose a reason for hiding this comment

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

At this point i wonder about the reason why having multiple stories in card. I find that confusing considering that all the optional content of a card has toggles to show/hide them, i think that one single story "default" would be enough, but you probably based also on requests by comm, so just a personal thought..

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 won't say that this is a "request", but all their design mention 3 examples of cards (default, tags, list), so I guess that having them with the same naming would avoid some discussions

planctus
planctus previously approved these changes May 16, 2022
Copy link
Contributor

@planctus planctus left a comment

Choose a reason for hiding this comment

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

It seems all good to me, i do have a concern regarding the markup, though, but it is coming from the content block, we have now these very long class names ex: ecl-content-block__secondary-meta-container and this code is going to be everywhere making the source code "heavier" although semantically correct.

@planctus
Copy link
Contributor

wouldn't it be good to have a test also with the "old" data to check the backward compatibility of this implementation..?

@emeryro emeryro merged commit d067730 into v3-dev May 16, 2022
@emeryro emeryro deleted the FRONT-3606-cards branch May 16, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants