@capillarytech/blaze-ui 4.33.1 → 4.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapNotificationDefaultCard.d.ts","sourceRoot":"","sources":["../../components/CapNotificationDropdown/CapNotificationDefaultCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,YAAY,EAA0B,MAAM,SAAS,CAAC;AAepE,UAAU,+BAAgC,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpF,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,mBAAmB,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,IAAI,CAAC;CACpE;AAED,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,
|
|
1
|
+
{"version":3,"file":"CapNotificationDefaultCard.d.ts","sourceRoot":"","sources":["../../components/CapNotificationDropdown/CapNotificationDefaultCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,YAAY,EAA0B,MAAM,SAAS,CAAC;AAepE,UAAU,+BAAgC,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpF,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,mBAAmB,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,IAAI,CAAC;CACpE;AAED,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAiHzE,CAAC;AAEF,eAAe,0BAA0B,CAAC;AAC1C,YAAY,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -608,6 +608,9 @@ const CapNotificationDefaultCard = _ref => {
|
|
|
608
608
|
return null;
|
|
609
609
|
};
|
|
610
610
|
const severityKey = severity || 'info';
|
|
611
|
+
|
|
612
|
+
// Ensure severityKey is valid, fallback to 'info' if invalid
|
|
613
|
+
const validSeverityKey = severityKey in iconBackgroundColorMap ? severityKey : 'info';
|
|
611
614
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _extends({
|
|
612
615
|
className: _styles.default['notification-item'],
|
|
613
616
|
onClick: handleClick
|
|
@@ -621,14 +624,14 @@ const CapNotificationDefaultCard = _ref => {
|
|
|
621
624
|
withBackground: true,
|
|
622
625
|
backgroundProps: {
|
|
623
626
|
style: {
|
|
624
|
-
backgroundColor: iconBackgroundColorMap[
|
|
627
|
+
backgroundColor: iconBackgroundColorMap[validSeverityKey]
|
|
625
628
|
}
|
|
626
629
|
},
|
|
627
630
|
svgProps: {
|
|
628
631
|
width: 24,
|
|
629
632
|
height: 24
|
|
630
633
|
},
|
|
631
|
-
type: iconTypeMap[
|
|
634
|
+
type: iconTypeMap[validSeverityKey]
|
|
632
635
|
}, iconProps))
|
|
633
636
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapColumn.default, {
|
|
634
637
|
span: 22,
|
|
@@ -654,10 +657,12 @@ const CapNotificationDefaultCard = _ref => {
|
|
|
654
657
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
655
658
|
className: _styles.default['notification-cta-date-row'],
|
|
656
659
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapHeading.default, {
|
|
657
|
-
children: cta == null ? void 0 : cta.map(touchpoint =>
|
|
660
|
+
children: cta == null ? void 0 : cta.map((touchpoint, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
661
|
+
children: getCTA(touchpoint)
|
|
662
|
+
}, index))
|
|
658
663
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
|
|
659
664
|
className: _styles.default['notification-date'],
|
|
660
|
-
children: (0, _moment.default)(updatedAt).format(_constants.DATE_FORMAT)
|
|
665
|
+
children: updatedAt ? (0, _moment.default)(updatedAt).format(_constants.DATE_FORMAT) : ''
|
|
661
666
|
})]
|
|
662
667
|
})]
|
|
663
668
|
})]
|
|
@@ -39948,7 +39953,7 @@ const CapNotificationDropdown = _ref => {
|
|
|
39948
39953
|
})]
|
|
39949
39954
|
}), notifications.length ? notifications.map((notification, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapMenu.default.Item, {
|
|
39950
39955
|
className: _styles.default['notification-item-wrapper'],
|
|
39951
|
-
children: [notification.notificationType === 'custom' ? notification.notificationTemplate : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapNotificationDefaultCard.default, {
|
|
39956
|
+
children: [notification.notificationType === 'custom' && notification.notificationTemplate ? notification.notificationTemplate : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapNotificationDefaultCard.default, {
|
|
39952
39957
|
notification: notification,
|
|
39953
39958
|
history: history,
|
|
39954
39959
|
onClickNotification: onClickNotification
|