diff --git a/lib/kits/core-ui/components/common/offer-overview.styl b/lib/kits/core-ui/components/common/offer-overview.styl index 19d916b1..7c888831 100644 --- a/lib/kits/core-ui/components/common/offer-overview.styl +++ b/lib/kits/core-ui/components/common/offer-overview.styl @@ -15,8 +15,8 @@ overflow-y auto box-shadow rgba(0, 0, 0, 0.7) 0px 20px 55px, rgba(0, 0, 0, 0.3) 0px 0px 1px text-align left - max-width 80vw - width 100% + max-width 1450px + width 96% max-height 80vh height 650px background #ffffff @@ -214,13 +214,15 @@ overflow hidden .sgn-product-title - white-space nowrap overflow hidden text-overflow ellipsis max-width 476px font-weight 600 font-size 1.2rem padding-bottom 0.2rem + display -webkit-box + -webkit-box-orient vertical + -webkit-line-clamp 2 > a color inherit diff --git a/lib/kits/core-ui/components/common/offer-overview.ts b/lib/kits/core-ui/components/common/offer-overview.ts index 9ee80333..712a8f09 100644 --- a/lib/kits/core-ui/components/common/offer-overview.ts +++ b/lib/kits/core-ui/components/common/offer-overview.ts @@ -131,22 +131,6 @@ const OfferOverview = ({ }; const render = async () => { - container = document.createElement('div'); - container.className = 'sgn-offer-overview-container'; - - createModal(container); - - container.innerHTML = Mustache.render(template, { - translations, - label: '', - disableShoppingList: document.querySelector('.sgn__offer-shopping') - ? false - : true, - offer: {}, - loader: true, - layoutWidth: sgnData?.incito?.root_view?.layout_width - }); - try { const transformedOffer = type === 'paged' @@ -158,6 +142,11 @@ const OfferOverview = ({ ? false : true; + container = document.createElement('div'); + container.className = 'sgn-offer-overview-container'; + + createModal(container); + container.innerHTML = Mustache.render(template, { translations, label: sgnData?.details?.label, @@ -171,10 +160,13 @@ const OfferOverview = ({ dispatchOfferClickEvent(transformedOffer); addEventListeners(); } catch (error) { - destroyModal(); - displayOfferMessage(offer.viewId, "Couldn't fetch offer data"); + displayOfferMessage( + offer.viewId, + translate('publication_viewer_no_product_message') + ); } }; + const transformProducts = (offer, products) => { const {localeCode, currency} = translations; const storedPublicationOffers = diff --git a/locales/da_DK.ts b/locales/da_DK.ts index f648aa4e..aa3910db 100644 --- a/locales/da_DK.ts +++ b/locales/da_DK.ts @@ -22,5 +22,6 @@ export default { publication_viewer_visit_webshop_link: 'Besøg webshoplink', publication_viewer_upcoming: 'Kommende', publication_viewer_offer_price_from: 'Fra', - publication_viewer_offer_valid_from: 'Gælder kun fra d. ' + publication_viewer_offer_valid_from: 'Gælder kun fra d. ', + publication_viewer_no_product_message: 'Ingen produkt detaljer' }; diff --git a/locales/en_US.ts b/locales/en_US.ts index 8ed94b3b..8af9b370 100644 --- a/locales/en_US.ts +++ b/locales/en_US.ts @@ -22,5 +22,6 @@ export default { publication_viewer_visit_webshop_link: 'Visit Webshop Link', publication_viewer_upcoming: 'Upcoming', publication_viewer_offer_price_from: 'From', - publication_viewer_offer_valid_from: 'Valid from ' + publication_viewer_offer_valid_from: 'Valid from ', + publication_viewer_no_product_message: 'No product details' }; diff --git a/locales/nb_NO.ts b/locales/nb_NO.ts index 5a95eff4..6523a7b6 100644 --- a/locales/nb_NO.ts +++ b/locales/nb_NO.ts @@ -23,5 +23,6 @@ export default { publication_viewer_visit_webshop_link: 'Besøk nettbutikklink', publication_viewer_upcoming: 'Påkommende', publication_viewer_offer_price_from: 'Fra', - publication_viewer_offer_valid_from: 'Gjelder kun fra ' + publication_viewer_offer_valid_from: 'Gjelder kun fra ', + publication_viewer_no_product_message: 'Ingen produktdetalje' }; diff --git a/locales/sv_SE.ts b/locales/sv_SE.ts index 60268d63..b7e8e478 100644 --- a/locales/sv_SE.ts +++ b/locales/sv_SE.ts @@ -22,5 +22,6 @@ export default { publication_viewer_visit_webshop_link: 'Besök webbshoplänk', publication_viewer_upcoming: 'Kommende', publication_viewer_offer_price_from: 'Från', - publication_viewer_offer_valid_from: 'Gäller endast fr.o.m ' + publication_viewer_offer_valid_from: 'Gäller endast fr.o.m ', + publication_viewer_no_product_message: 'Inga produktdetaljer' };