visitscotland / vs-component-library

VisitScotland Component Library
Other
0 stars 0 forks source link

FED - images broken external preview for megalinks and OTYML #271

Closed jlrhurta closed 6 months ago

jlrhurta commented 11 months ago

Summary of task

There is a new functionality in version 15 that allows the content team to share a draft page with anybody without CMS access for review/approval before publishing it. Due to the image scaler implementation in the component library, the images from the CMS for megalinks list, OTYML and megalinks multimage are broken. This "external preview" feature adds a token parameter to the URL and a side effect is that the hardcoded image scaler solution tries to bring the image using this URL https://2f1a7f9478.visitscotland.net/binaries/content/gallery/visitscotland/cms-images/2022/12/07/royal-mile-frige-festival.jpg?preview-token=15ec6cf3-1219-4db2-bc86-9c3bc0dcd4c4?size=lg where there are two parameters using two "?" instead of the "&"

Acceptance criteria

When accessing a page with different megalinks modules using an external preview, all the images should be visible.

Additional context

The rest of the modules were fixed on https://github.com/visitscotland/dot-com-brxm/issues/303 Steps to reproduce the behaviour:

Go to any page in the cms and access the preview mode (or use this example: https://www.visitscotland.com/places-to-go/edinburgh?preview-token=15ec6cf3-1219-4db2-bc86-9c3bc0dcd4c4)

Click on preview at the top image replace cms.visitscoland... by "www.visitscotland..."

See the draft page without cms images rendering image

mjpvs commented 11 months ago

Hey @CorinaMala , this is just a follow on from the previous image issues one. These two pages should contain an OTYML and some megalinks which I believe were the two left over

https://feature.visitscotland.com/?vs_brxm_host=172.28.87.25&vs_brxm_port=8004&vs_brxm_http_host=feature.visitscotland.com&vs_ssr_http_port=8204&vs_tln_http_port=8304&vs_feature_branch=PR-332&vs_ssr_proxy=on

https://feature.visitscotland.com/test/pages/destination?preview-token=db73dd44-26cf-4d37-bbeb-b3a4a40bbbae

https://feature.visitscotland.com/test/modules/megalinks?preview-token=db73dd44-26cf-4d37-bbeb-b3a4a40bbbae

CorinaMala commented 11 months ago

@mjpvs Ready to be merged to develop After checking the preview on different browsers, I can confirm the images are showing up correctly for not only the two pages in the comment, but for other pages as well.