bolt icon indicating copy to clipboard operation
bolt copied to clipboard

[DO NOT MERGE] Ds-602 Remove pattern template function

Open MarcinMr opened this issue 2 years ago • 1 comments

Jira

https://pegadigitalit.atlassian.net/browse/DS-602

Summary

Pattern_template function usage was rewritten in the Bolt repository.

Details

All the examples of the pattern_template function (for example pattern: 'image' )used in the Bolt repository (components and pattern lab) are rewritten.

How to test

Pull the branch. Search for examples of pattern_template usage, and confirm that there is no regression due to updating it.

Release notes

Pattern_template function is deprecated.

A list of where pattern_template() function will be no longer in use in the future:

  • buton-group (@bolt-components-button-group/button-group.twig)
  • button (@bolt-components-button/button.twig)
  • card (@bolt-components-card-replacement/card-replacement.twig)
  • card-w-teaser (@bolt-components-card-w-teaser/card-w-teaser.twig)
  • eyebrow (@bolt-components-headline/eyebrow.twig)
  • flag (@bolt/flag.twig) (this is an object)
  • headline (@bolt-components-headline/headline.twig)
  • image (@bolt-components-image/image.twig)
  • link (@bolt-components-link/link.twig)
  • teaser (@bolt-components-teaser/teaser.twig)
  • text (@bolt-components-text/text.twig)

pattern prop (pattern: $name) will no longer be used. Please use the bolt-components whenever you want to utilize card, headline, image, etc.

There is no need to use the pattern: image when utilizing bolt-background component.

MarcinMr avatar Apr 14 '22 09:04 MarcinMr

@colbytcook @remydenton

These examples you mentioned above have been corrected. Yarn build doesn't throw any errors on my side.

There were a lot of usage pattern: 'image' that I missed last time. I rewrite a little bit the background-item template to get rid of the item.pattern = 'image' statement and the all usage in the docs. I'm not sure if it's done correctly. I created a test page to see if it still works /?p=tests-background-image. It seems that for these two scenarios(passing image attributes as an object and pass the whole image as a variable) everything is fine. Let me know what do you think.

MarcinMr avatar Apr 19 '22 14:04 MarcinMr

https://gitlab.com/pegadigital/bolt/design-system/-/merge_requests/3

colbytcook avatar Apr 06 '23 18:04 colbytcook