TP-60261 | API ErrorTag | SI Event | Status Bar | Unnecessary Log (#10265)
This commit is contained in:
@@ -25,12 +25,6 @@ const BaseWidget = ({
|
||||
value: any | undefined | null,
|
||||
actionPayloadList: GenericActionPayload | undefined
|
||||
) {
|
||||
// console.log(
|
||||
// "handleWidgetActions payload list" +
|
||||
// JSON.stringify(actionPayloadList) +
|
||||
// "value " +
|
||||
// JSON.stringify(value)
|
||||
// );
|
||||
let payload = actionPayloadList;
|
||||
let needPayloadCompression = false;
|
||||
actionPayloadList?.metaData?.forEach((actionPayload) => {
|
||||
|
||||
@@ -10,6 +10,13 @@ import { GenericActionPayload } from "../../../App/common/actions/GenericAction"
|
||||
import { SumInsuredWidgetData } from "../../../App/common/interface/widgets/widgetData/SumInsuredWidgetData";
|
||||
import { getIndexFromOffset } from "../../../App/common/utilities/SizeUtils";
|
||||
import CarouselItem from "./component/CarouselItem";
|
||||
import { logToSentry } from "../../../App/common/hooks/useSentryLogging";
|
||||
import { AnalyticsEvent } from "../../../App/common/interface";
|
||||
import { sendAsAnalyticsEvent } from "../../../App/common/hooks/useAnalyticsEvent";
|
||||
import {
|
||||
AnalyticsEventNameConstants,
|
||||
AnalyticsEventPropertyConstants,
|
||||
} from "../../../App/common/constants/AnalyticsEventsConstant";
|
||||
|
||||
const SumInsuredWidget = ({
|
||||
widgetData,
|
||||
@@ -26,7 +33,7 @@ const SumInsuredWidget = ({
|
||||
widgetStyle?: ViewStyle;
|
||||
}) => {
|
||||
const { width } = useWindowDimensions();
|
||||
const SIZE = width * 0.400;
|
||||
const SIZE = width * 0.4;
|
||||
const SPACER_SIZE = (width - SIZE) / 2;
|
||||
const x = useSharedValue(0);
|
||||
const isMiddleCard = useSharedValue(false);
|
||||
@@ -48,11 +55,15 @@ const SumInsuredWidget = ({
|
||||
},
|
||||
});
|
||||
|
||||
// Makes a patch call to update the sumInsured in the backend
|
||||
const handleActionApiCall = (index: number) => {
|
||||
const actionPayloadList = widgetData?.widgetMetaData?.onCarouselReleaseActionSequence;
|
||||
|
||||
const actionPayloadList =
|
||||
widgetData?.widgetMetaData?.onCarouselReleaseActionSequence;
|
||||
|
||||
if (!actionPayloadList) {
|
||||
console.error("Action payload list is not defined.");
|
||||
logToSentry(
|
||||
`Payload not present: ${actionPayloadList} | MethodName: handleActionApiCall`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,6 +97,22 @@ const SumInsuredWidget = ({
|
||||
widgetData?.widgetMetaData?.onValueChangeAction
|
||||
);
|
||||
}
|
||||
const clickEvent: AnalyticsEvent = {
|
||||
name: AnalyticsEventNameConstants.HI_SI_PILLS_CLICK,
|
||||
properties: new Map([
|
||||
[
|
||||
AnalyticsEventPropertyConstants.SUM_INSURED,
|
||||
widgetData?.carouselListData?.at(index)?.sumInsured?.toString() ?? "",
|
||||
],
|
||||
[
|
||||
AnalyticsEventPropertyConstants.TAG,
|
||||
widgetData?.widgetMetaData?.recommendItemIndex === index
|
||||
? AnalyticsEventPropertyConstants.RECOMMENDED
|
||||
: AnalyticsEventPropertyConstants.NOT_RECOMMENDED,
|
||||
],
|
||||
]),
|
||||
};
|
||||
sendAsAnalyticsEvent(clickEvent);
|
||||
};
|
||||
|
||||
const data = widgetData.carouselListData && [
|
||||
|
||||
Reference in New Issue
Block a user