Merge pull request #82 from Safelite/feature/SSR-132

Feature/ssr 132
This commit is contained in:
Kulbhushan Kaushik 2022-12-22 14:19:39 -05:00 committed by GitHub
commit 93995c2b42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="site-header d-flex justify-content-center align-items-center flex-column"> <div class="site-header d-flex justify-content-center align-items-center flex-column" :style="logoBackgroundStyle">
<img id="siteHeaderImage" class="img-fluid" :src="imageSrc" :alt="altText" /> <img id="siteHeaderImage" class="img-fluid" :src="imageSrc" :alt="altText" />
<menuModal/> <menuModal/>
</div> </div>
@ -32,6 +32,7 @@ import { globalEvents } from "@/constants/events";
messageHeadline: "", messageHeadline: "",
type: "", type: "",
}, },
headerAnswers:Array
}; };
}, },
props: { props: {
@ -40,15 +41,36 @@ import { globalEvents } from "@/constants/events";
computed: { computed: {
imageSrc() imageSrc()
{ {
return "https://digitalisscms.dev.safelite.io/images/default-source/default-album/logos/insuranceLogo.jpg"; return this.headerAnswers[0] !== undefined ? this.headerAnswers[0].AnswerImageUrl : "";
}, },
altText() altText()
{ {
return "Logo"; return this.headerAnswers[0] !== undefined ? this.headerAnswers[0].AltText : "";
} },
hexCode()
{
return this.headerAnswers[0] !== undefined ? this.headerAnswers[0].HexCode : "";
},
logoBackgroundStyle() {
return {
"background-color": this.headerAnswers[0] !== undefined ? this.headerAnswers[0].HexCode : "#FFFFFF"
};
},
}, },
mounted() { mounted() {
// Check if alert event is on the bus
var cmsAnswers = this.getCmsContent(this.cmsWidgetName, "Answers");
const filteredAnswers = Array.isArray(cmsAnswers)
? cmsAnswers.filter((ans) => {
const accountNumber = Number(ans.AccountNumber);
return (
accountNumber === this.mainStore.order.accountNumber
);
})
: [];
this.headerAnswers = filteredAnswers;
// Check if alert event is on the bus
const alertEvent = eventBus.readAndPopEventFromBus( const alertEvent = eventBus.readAndPopEventFromBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND globalEvents.SubCategories.PAGE_NOT_FOUND