@corva/ui 0.65.0-0 → 0.65.0-1
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.
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/cjs-bundle/components/StatusBadge/index.js +1 -1
- package/cjs-bundle/effects/useWellnessAlerts.js +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.d.ts +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.d.ts.map +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/components/StatusBadge/index.d.ts +2 -1
- package/components/StatusBadge/index.d.ts.map +1 -1
- package/components/StatusBadge/index.js +1 -1
- package/effects/useWellnessAlerts.d.ts +3 -2
- package/effects/useWellnessAlerts.d.ts.map +1 -1
- package/effects/useWellnessAlerts.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("moment"),r=require("lodash"),s=require("@material-ui/core"),i=require("@material-ui/icons/ArrowForward"),n=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var l=require("../utils.js"),o=require("../constants.js"),c=require("../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js"),p=require("../styles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(a),g=d(i),u=s.makeStyles((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1,display:"flex",alignItems:"center"},emptyMessage:{padding:"0",fontSize:16,lineHeight:"22px",color:e.palette.primary.contrastText},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:77,width:270,padding:12,display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:e.palette.background.b9,border:"1px solid ".concat(e.palette.primary.text9),boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",borderRadius:4,zIndex:500,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4},ok:{color:"#F99500 !important"},good:{color:"".concat(e.palette.warning.light," !important")}}})),x=function(e){return m.default.unix(e).format("DD MMM HH:mm (Z)")},h=function(a){var s=a.children,i=u(),n=r.template(s)({timestampFormatter:x}).split("**").map((function(e,a){return a%2==1?t.jsx("b",{children:e}):e}));return t.jsx("span",e.__assign({className:i.message},{children:n}))};exports.DQAlertsTooltip=function(a){var r,s,i,d=a.alert,x=a.alertIcon,f=a.children,_=a.linkToDQPage,j=u(),S=p.useDQUnvalidatedContentStyles({}),v=Math.max(d.statusUpdatedAt,d.lastCheckedAt),y=(void 0===i&&(i="MM/DD/YY hh:mm a"),(s=v)?m.default.unix(s).format(i):null);return t.jsx(n.Tooltip,{interactive:!0,children:f,PopperProps:{className:j.popover},placement:"right",title:d.emptyMessage?t.jsx("div",e.__assign({className:j.emptyMessage},{children:d.emptyMessage})):t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:j.title},{children:[d.name,t.jsx(n.Tooltip,e.__assign({isFullScreen:!1,title:"Go to Data Quality page"},{children:t.jsx("div",{children:t.jsx(c.UniversalLink,e.__assign({className:S.link,href:_},{children:t.jsx(g.default,{className:S.linkIcon})}))})}))]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Category:"})," ",d.category]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Status:"})," ",d.status]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Error Type:"}),t.jsx("div",e.__assign({className:j.errorIcon},{children:x})),t.jsx("span",e.__assign({className:d.state===o.ALERT_STATES.issue?o.BADGE_ICON_STATUSES.warning:o.BADGE_ICON_STATUSES.error},{children:d.state}))]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Score Deduction:"}),t.jsx("span",e.__assign({className:l.getDeductsFromScoreClass(j,d.deductsFromScore,l.isResolved(d.status))},{children:l.getDeductsFromScoreValue(d.deductsFromScore,l.isResolved(d.status))}))]})),t.jsxs("div",e.__assign({className:j.alertMessageFull},{children:[d.isThrottled&&t.jsx("b",{children:"[Throttled]: "}),t.jsx(h,{children:d.message})]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",e.__assign({className:j.note},{children:"Note:"}))," ",(null===(r=d.note)||void 0===r?void 0:r.length)?d.note:"—"]})),t.jsxs("span",e.__assign({className:j.alertTime},{children:["Updated at: ",t.jsx("span",{children:y})]}))]})})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("moment"),r=require("lodash"),s=require("@material-ui/core"),i=require("@material-ui/icons/ArrowForward"),n=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var l=require("../utils.js"),o=require("../constants.js"),c=require("../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js"),p=require("../styles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(a),g=d(i),u=s.makeStyles((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1,display:"flex",alignItems:"center"},emptyMessage:{padding:"0",fontSize:16,lineHeight:"22px",color:e.palette.primary.contrastText},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:77,width:270,padding:12,display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:e.palette.background.b9,border:"1px solid ".concat(e.palette.primary.text9),boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",borderRadius:4,zIndex:500,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4},ok:{color:"#F99500 !important"},good:{color:"".concat(e.palette.warning.light," !important")}}})),x=function(e){return m.default.unix(e).format("DD MMM HH:mm (Z)")},h=function(a){var s=a.children,i=u(),n=r.template(s)({timestampFormatter:x}).split("**").map((function(e,a){return a%2==1?t.jsx("b",{children:e}):e}));return t.jsx("span",e.__assign({className:i.message},{children:n}))};exports.DQAlertsTooltip=function(a){var r,s,i,d=a.alert,x=a.alertIcon,f=a.children,_=a.linkToDQPage,j=u(),S=p.useDQUnvalidatedContentStyles({}),v=Math.max(d.statusUpdatedAt,d.lastCheckedAt),y=(void 0===i&&(i="MM/DD/YY hh:mm a"),(s=v)?m.default.unix(s).format(i):null);return t.jsx(n.Tooltip,{isFullScreen:!1,interactive:!0,children:f,PopperProps:{className:j.popover},placement:"right",title:d.emptyMessage?t.jsx("div",e.__assign({className:j.emptyMessage},{children:d.emptyMessage})):t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:j.title},{children:[d.name,t.jsx(n.Tooltip,e.__assign({isFullScreen:!1,title:"Go to Data Quality page"},{children:t.jsx("div",{children:t.jsx(c.UniversalLink,e.__assign({className:S.link,href:_},{children:t.jsx(g.default,{className:S.linkIcon})}))})}))]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Category:"})," ",d.category]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Status:"})," ",d.status]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Error Type:"}),t.jsx("div",e.__assign({className:j.errorIcon},{children:x})),t.jsx("span",e.__assign({className:d.state===o.ALERT_STATES.issue?o.BADGE_ICON_STATUSES.warning:o.BADGE_ICON_STATUSES.error},{children:d.state}))]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",{children:"Score Deduction:"}),t.jsx("span",e.__assign({className:l.getDeductsFromScoreClass(j,d.deductsFromScore,l.isResolved(d.status))},{children:l.getDeductsFromScoreValue(d.deductsFromScore,l.isResolved(d.status))}))]})),t.jsxs("div",e.__assign({className:j.alertMessageFull},{children:[d.isThrottled&&t.jsx("b",{children:"[Throttled]: "}),t.jsx(h,{children:d.message})]})),t.jsxs("span",e.__assign({className:j.alertInfo},{children:[t.jsx("span",e.__assign({className:j.note},{children:"Note:"}))," ",(null===(r=d.note)||void 0===r?void 0:r.length)?d.note:"—"]})),t.jsxs("span",e.__assign({className:j.alertTime},{children:["Updated at: ",t.jsx("span",{children:y})]}))]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),n=require("react"),a=require("moment"),r=require("classnames"),s=require("@material-ui/core"),i=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var o=require("./constants.js"),c=require("./components/DQStatusIcon.js"),u=require("./components/DQUnvalidatedContent.js"),l=require("./components/ReportIssueModal.js"),p=require("./api.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(a),m=d(r),f=window.innerHeight-212,x=s.makeStyles((function(e){return{statusBadgeWrapper:{backgroundColor:e.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(e){var t=e.isSuccessTypeIcon,n=e.isErrorTypeIcon,a=e.isIssueTypeIcon;return"12px 0 2px ".concat(t||n||a?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:e.palette.primary.text6,marginLeft:function(e){return e.isIconExist&&4}},warningMessage:{color:e.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{zIndex:function(e){return e.maximized?500:1},"& .MuiTooltip-tooltip":{position:"absolute",bottom:0,width:"max-content",transformOrigin:"center top",maxWidth:"none",padding:4,fontSize:12,boxShadow:"0px 0px 4px 2px rgb(0 0 0 / 12%)",fontWeight:400,lineHeight:"16px",letterSpacing:"0.4px",backgroundColor:e.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,minWidth:24,borderRadius:12,"&:hover":{backgroundColor:function(e){var t=e.isErrorTypeIcon,n=e.isSuccessTypeIcon,a=e.isIssueTypeIcon;return t?"rgba(244, 67, 54, 0.1)":n?"rgba(117, 219, 41, 0.2)":a?"rgba(255, 193, 7, 0.16)":"transparent"}}}}}));exports.StatusBadge=function(a){var r=a.assetsData,d=void 0===r?{}:r,_=a.appWidth,S=a.DQIssueTooltipMaxHeight,I=void 0===S?f:S,T=a.iconType,h=a.className,b=a.lastTimestamp,v=a.onReportErrorClick,y=a.warningData,j=a.hasSubscriptionsData,E=a.currentUser,N=a.segment,D=a.maximized,w=n.useState(!1),C=w[0],A=w[1],W=n.useState(!1),M=W[0],q=W[1],R=n.useRef(null),k=null==y?void 0:y.message,B=T===o.BADGE_ICON_STATUSES.error,O=T===o.BADGE_ICON_STATUSES.success,L=T===o.BADGE_ICON_STATUSES.issue,Q=_<o.MAX_MOBILE_WIDTH,G=x({isIconExist:!!T,isSuccessTypeIcon:O,isErrorTypeIcon:B,isIssueTypeIcon:L,maximized:D}),U=n.useRef(null),z=function(e){R.current&&!R.current.contains(e.target)&&q(!1)};n.useEffect((function(){return document.addEventListener("click",z),function(){document.removeEventListener("click",z),clearTimeout(U.current)}}),[]);var H=function(){clearTimeout(U.current),q(!0)},Y=function(e,t){void 0===t&&(t=700),U.current=setTimeout((function(){return q(!1)}),t)};return n.useEffect((function(){j&&(H(),Y(0,1e4))}),[JSON.stringify(d)]),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:m.default(G.statusBadgeWrapper,"c-status-badge--".concat(T),h)},{children:[t.jsxs("div",e.__assign({className:G.statusBadgeContent,ref:R},{children:[T&&t.jsx(i.Tooltip,e.__assign({isFullScreen:!1,disableHoverListener:!0,open:M,onMouseEnter:H,onMouseLeave:Y,PopperProps:{className:G.popper},placement:"top-start",title:t.jsx(u.DQUnvalidatedContent,{tooltipRef:R,onMouseEnter:H,onMouseLeave:Y,assetsData:d,maxHeight:I,onClick:function(){return A(!0)}})},{children:t.jsx("div",e.__assign({className:G.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(T)},{children:t.jsx(c.DQStatusIcon,{color:T,iconType:T})}))})),b&&t.jsxs(s.Typography,e.__assign({className:m.default(G.text,G.timestamp),variant:"body1"},{children:["Last Update: ",g.default.unix(b).format("M/D/YYYY h:mm a")]})),y&&t.jsxs(t.Fragment,{children:[t.jsx(i.Tooltip,e.__assign({placement:"top",title:k?"".concat(o.WARNING,". ").concat(k):o.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:G.badgeIconWarning,color:o.BADGE_ICON_STATUSES.warning,iconType:o.BADGE_ICON_STATUSES.warning})}))})),!Q&&t.jsx(s.Typography,e.__assign({className:m.default(G.text,G.warningMessage),variant:"body1"},{children:k?"".concat(o.WARNING,". ").concat(k):o.WARNING}))]})]})),C&&t.jsx(l.ReportIssueModal,{assets:Object.keys(d).map((function(e){return{name:e,id:d[e][0].alert.assetId}})),onSave:v||function(e,t){p.postReportError(t,e,E,N)},onClose:function(){return A(!1)}})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../ext-esm/tslib/tslib.es6.js'),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../ext-esm/tslib/tslib.es6.js'),t=require("react"),s=require("uuid"),n=require("lodash"),r=require("../utils/resolveWellHubSlug.js"),i=require("../utils/env.js"),a=require("../components/StatusBadge/api.js"),u=require("../components/StatusBadge/utils.js"),o=require("../components/StatusBadge/constants.js"),l=require("../clients/index.js"),c=function(e,t,s){return void 0===s&&(s=""),{provider:o.METADATA.recordProvider,dataset:t,assetId:e,event:s}};function d(e,s,r){var i=t.useState([]),a=i[0],d=i[1];return t.useEffect((function(){if(!n.isEmpty(e.filter((function(e){return e})))){var t=function(e){var t=e.data.map(u.parseWellnessAlertFromJson);d(t)},s=e.map((function(e){return l.socketClient.subscribe(c(e,o.METADATA.recordCollections.wellnessAlerts),{onDataReceive:t})})),r=e.map((function(e){return l.socketClient.subscribe(c(e,o.METADATA.recordCollections.wellnessAlerts,"update"),{onDataReceive:t})}));return function(){s.forEach((function(e){return e()})),r.forEach((function(e){return e()}))}}}),[JSON.stringify(e),s,r]),a}exports.useAlertsSubscription=d,exports.useWellnessAlerts=function(l){var c=l.asset,_=l.multiRigAssets,A=void 0===_?[]:_,v=l.appId,f=l.dashboards,m=l.isDCApp,g=l.maximized,p=t.useState({}),S=p[0],T=p[1],E=t.useState(""),D=E[0],I=E[1],R=d(c?[c.id]:A.map((function(e){return e.id})),v,g);return t.useEffect((function(){if(S.alertsData&&!n.isEmpty(R)){var t=Object.keys(S.alertsData).reduce((function(t,s){var n;return e.__assign(e.__assign({},t),((n={})[s]=S.alertsData[s].map((function(t){var s=R.find((function(e){return(null==e?void 0:e.name)===t.name&&(null==e?void 0:e.assetId)===t.alert.assetId}));if(!s)return t;if([o.ALERT_STATUSES.FLAGGED,o.ALERT_STATUSES.INVESTIGATION,o.ALERT_STATUSES.ON_HOLD].includes(s.status))return t;var n=e.__assign(e.__assign({},s),{emptyMessage:u.isResolved(s.status)&&o.DATA_QUALITY_CHECK_PASSED}),r=u.isResolved(s.status);return t.alert.id===s.id?e.__assign(e.__assign({},t),{isResolved:r,alert:n}):e.__assign(e.__assign({},t),{isResolved:r,issuesNum:s.state===o.ALERT_STATES.issue?t.issuesNum+1:0,missingNum:s.state===o.ALERT_STATES.missing?t.missingNum+1:0,alert:n})})),n))}),{}),s=Object.keys(t);I(u.getIconType(s,t)),T((function(s){return e.__assign(e.__assign({},s),{alertsData:t,hasSubscriptionsData:!0})}))}}),[R]),t.useEffect((function(){var t=i.isDevOrQAEnv?o.ENABLING_ON_QA_APP_IDS_LIST:o.ENABLING_ON_PROD_APP_IDS_LIST,n={id:null==c?void 0:c.id,name:null==c?void 0:c.name},l=n.id?[n]:A;try{l.length&&(t.includes(v)||m)?function(t){e.__awaiter(void 0,void 0,void 0,(function(){var n,i,l,c,d,_,A,m,g,p,S;return e.__generator(this,(function(E){switch(E.label){case 0:return[4,a.getWCURuleMapping(v)];case 1:return n=E.sent(),[4,a.getWellnessRuleSettings(null===(g=n[0])||void 0===g?void 0:g.rule_id)];case 2:return(i=E.sent()).length?[4,r(f)]:[2];case 3:return l=E.sent(),c=t.map((function(e){return e.id})),[4,Promise.all(i.map((function(e){var t=e.data.name;return a.getWellnessAlerts(c,t)}))).then((function(e){return e.map((function(e){return e.map((function(e){return u.parseWellnessAlertFromJson(e)}))}))}))];case 4:return d=E.sent(),_=u.getNewWellnessAlerts(t,d,l),A=t.reduce((function(t,n){var r,a=n.id;return e.__assign(e.__assign({},t),((r={})[n.name]=i.map((function(e){var r;return(null===(r=t[n.name])||void 0===r?void 0:r.find((function(t){return t.name===e.data.name})))||{alert:{assetId:a,category:e.data.category,status:o.ALERT_STATUSES.RESOLVED,emptyMessage:o.DATA_QUALITY_CHECK_PASSED},id:s.v4(),isResolved:!0,name:e.data.name,linkToDQPage:u.getLinkToDQPage({assetId:a,wellHubSlug:l})}})),r))}),e.__assign({},_)),m=Object.keys(A),I(u.getIconType(m,A)),T({alertsData:A,lastTimestamp:null===(S=null===(p=A[m[0]][0])||void 0===p?void 0:p.alert)||void 0===S?void 0:S.statusUpdatedAt}),[2]}}))}))}(l):(T({}),I(""))}catch(e){console.error(e)}}),[null==c?void 0:c.id,A.length]),{wellnessAlerts:S,statusBadgeIconType:D}};
|
|
@@ -6,6 +6,6 @@ declare type DQCountryCheckTooltipProps = {
|
|
|
6
6
|
children: ReactElement<any, any>;
|
|
7
7
|
linkToDQPage: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const DQAlertsTooltip: ({ alert, alertIcon, children, linkToDQPage }: DQCountryCheckTooltipProps) => JSX.Element;
|
|
9
|
+
export declare const DQAlertsTooltip: ({ alert, alertIcon, children, linkToDQPage, }: DQCountryCheckTooltipProps) => JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=DQAlertsTooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DQAlertsTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAlertsTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DQAlertsTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAlertsTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAWrC,OAAO,EAAE,KAAK,EAAqC,MAAM,oCAAoC,CAAC;AAqI9F,aAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,kDAKzB,0BAA0B,KAAG,WA0E/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as r,Fragment as a}from"react/jsx-runtime";import i from"moment";import{template as o}from"lodash";import{makeStyles as n}from"@material-ui/core";import l from"@material-ui/icons/ArrowForward";import{Tooltip as s}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{getDeductsFromScoreClass as p,isResolved as c,getDeductsFromScoreValue as m}from"../utils.js";import{ALERT_STATES as d,BADGE_ICON_STATUSES as h}from"../constants.js";import{UniversalLink as g}from"../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import{useDQUnvalidatedContentStyles as f}from"../styles.js";var u=n((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1,display:"flex",alignItems:"center"},emptyMessage:{padding:"0",fontSize:16,lineHeight:"22px",color:e.palette.primary.contrastText},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:77,width:270,padding:12,display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:e.palette.background.b9,border:"1px solid ".concat(e.palette.primary.text9),boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",borderRadius:4,zIndex:500,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4},ok:{color:"#F99500 !important"},good:{color:"".concat(e.palette.warning.light," !important")}}})),x=function(e){return i.unix(e).format("DD MMM HH:mm (Z)")},y=function(r){var a=r.children,i=u(),n=o(a)({timestampFormatter:x}).split("**").map((function(e,r){return r%2==1?t("b",{children:e}):e}));return t("span",e({className:i.message},{children:n}))},v=function(o){var n,x,v,w=o.alert,b=o.alertIcon,
|
|
1
|
+
import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as r,Fragment as a}from"react/jsx-runtime";import i from"moment";import{template as o}from"lodash";import{makeStyles as n}from"@material-ui/core";import l from"@material-ui/icons/ArrowForward";import{Tooltip as s}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{getDeductsFromScoreClass as p,isResolved as c,getDeductsFromScoreValue as m}from"../utils.js";import{ALERT_STATES as d,BADGE_ICON_STATUSES as h}from"../constants.js";import{UniversalLink as g}from"../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import{useDQUnvalidatedContentStyles as f}from"../styles.js";var u=n((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1,display:"flex",alignItems:"center"},emptyMessage:{padding:"0",fontSize:16,lineHeight:"22px",color:e.palette.primary.contrastText},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:77,width:270,padding:12,display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:e.palette.background.b9,border:"1px solid ".concat(e.palette.primary.text9),boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",borderRadius:4,zIndex:500,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4},ok:{color:"#F99500 !important"},good:{color:"".concat(e.palette.warning.light," !important")}}})),x=function(e){return i.unix(e).format("DD MMM HH:mm (Z)")},y=function(r){var a=r.children,i=u(),n=o(a)({timestampFormatter:x}).split("**").map((function(e,r){return r%2==1?t("b",{children:e}):e}));return t("span",e({className:i.message},{children:n}))},v=function(o){var n,x,v,w=o.alert,b=o.alertIcon,S=o.children,N=o.linkToDQPage,I=u(),k=f({}),M=Math.max(w.statusUpdatedAt,w.lastCheckedAt),T=(void 0===v&&(v="MM/DD/YY hh:mm a"),(x=M)?i.unix(x).format(v):null);return t(s,{isFullScreen:!1,interactive:!0,children:S,PopperProps:{className:I.popover},placement:"right",title:w.emptyMessage?t("div",e({className:I.emptyMessage},{children:w.emptyMessage})):r(a,{children:[r("div",e({className:I.title},{children:[w.name,t(s,e({isFullScreen:!1,title:"Go to Data Quality page"},{children:t("div",{children:t(g,e({className:k.link,href:N},{children:t(l,{className:k.linkIcon})}))})}))]})),r("span",e({className:I.alertInfo},{children:[t("span",{children:"Category:"})," ",w.category]})),r("span",e({className:I.alertInfo},{children:[t("span",{children:"Status:"})," ",w.status]})),r("span",e({className:I.alertInfo},{children:[t("span",{children:"Error Type:"}),t("div",e({className:I.errorIcon},{children:b})),t("span",e({className:w.state===d.issue?h.warning:h.error},{children:w.state}))]})),r("span",e({className:I.alertInfo},{children:[t("span",{children:"Score Deduction:"}),t("span",e({className:p(I,w.deductsFromScore,c(w.status))},{children:m(w.deductsFromScore,c(w.status))}))]})),r("div",e({className:I.alertMessageFull},{children:[w.isThrottled&&t("b",{children:"[Throttled]: "}),t(y,{children:w.message})]})),r("span",e({className:I.alertInfo},{children:[t("span",e({className:I.note},{children:"Note:"}))," ",(null===(n=w.note)||void 0===n?void 0:n.length)?w.note:"—"]})),r("span",e({className:I.alertTime},{children:["Updated at: ",t("span",{children:T})]}))]})})};export{v as DQAlertsTooltip};
|
|
@@ -12,7 +12,8 @@ declare type StatusBadgeProps = {
|
|
|
12
12
|
hasSubscriptionsData?: boolean;
|
|
13
13
|
currentUser: Record<string, any>;
|
|
14
14
|
segment: 'drilling' | 'completion';
|
|
15
|
+
maximized?: boolean;
|
|
15
16
|
};
|
|
16
|
-
export declare const StatusBadge: ({ assetsData, appWidth, DQIssueTooltipMaxHeight, iconType, className, lastTimestamp, onReportErrorClick: customOnReportErrorClick, warningData, hasSubscriptionsData, currentUser, segment, }: StatusBadgeProps) => JSX.Element;
|
|
17
|
+
export declare const StatusBadge: ({ assetsData, appWidth, DQIssueTooltipMaxHeight, iconType, className, lastTimestamp, onReportErrorClick: customOnReportErrorClick, warningData, hasSubscriptionsData, currentUser, segment, maximized, }: StatusBadgeProps) => JSX.Element;
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAkD,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAkD,SAAS,EAAE,MAAM,aAAa,CAAC;AAqFxF,aAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,EAAE,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,OAAO,EAAE,UAAU,GAAG,YAAY,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,6MAarB,gBAAgB,KAAG,WA8HrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as t,jsx as n,Fragment as o}from"react/jsx-runtime";import{useState as r,useRef as i,useEffect as a}from"react";import s from"moment";import c from"classnames";import{makeStyles as p,Typography as l}from"@material-ui/core";import{Tooltip as m}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import{WARNING as u,BADGE_ICON_STATUSES as d,MAX_MOBILE_WIDTH as g}from"./constants.js";import{DQStatusIcon as f}from"./components/DQStatusIcon.js";import{DQUnvalidatedContent as x}from"./components/DQUnvalidatedContent.js";import{ReportIssueModal as h}from"./components/ReportIssueModal.js";import{postReportError as b}from"./api.js";var v=window.innerHeight-212,I=p((function(e){return{statusBadgeWrapper:{backgroundColor:e.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(e){var t=e.isSuccessTypeIcon,n=e.isErrorTypeIcon,o=e.isIssueTypeIcon;return"12px 0 2px ".concat(t||n||o?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:e.palette.primary.text6,marginLeft:function(e){return e.isIconExist&&4}},warningMessage:{color:e.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{zIndex:function(e){return e.maximized?500:1},"& .MuiTooltip-tooltip":{position:"absolute",bottom:0,width:"max-content",transformOrigin:"center top",maxWidth:"none",padding:4,fontSize:12,boxShadow:"0px 0px 4px 2px rgb(0 0 0 / 12%)",fontWeight:400,lineHeight:"16px",letterSpacing:"0.4px",backgroundColor:e.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,minWidth:24,borderRadius:12,"&:hover":{backgroundColor:function(e){var t=e.isErrorTypeIcon,n=e.isSuccessTypeIcon,o=e.isIssueTypeIcon;return t?"rgba(244, 67, 54, 0.1)":n?"rgba(117, 219, 41, 0.2)":o?"rgba(255, 193, 7, 0.16)":"transparent"}}}}})),y=function(p){var y=p.assetsData,T=void 0===y?{}:y,S=p.appWidth,w=p.DQIssueTooltipMaxHeight,D=void 0===w?v:w,_=p.iconType,j=p.className,k=p.lastTimestamp,C=p.onReportErrorClick,E=p.warningData,M=p.hasSubscriptionsData,W=p.currentUser,L=p.segment,N=p.maximized,z=r(!1),Q=z[0],H=z[1],B=r(!1),O=B[0],R=B[1],Y=i(null),U=null==E?void 0:E.message,P=_===d.error,F=_===d.success,J=_===d.issue,q=S<g,A=I({isIconExist:!!_,isSuccessTypeIcon:F,isErrorTypeIcon:P,isIssueTypeIcon:J,maximized:N}),G=i(null),K=function(e){Y.current&&!Y.current.contains(e.target)&&R(!1)};a((function(){return document.addEventListener("click",K),function(){document.removeEventListener("click",K),clearTimeout(G.current)}}),[]);var V=function(){clearTimeout(G.current),R(!0)},X=function(e,t){void 0===t&&(t=700),G.current=setTimeout((function(){return R(!1)}),t)};return a((function(){M&&(V(),X(0,1e4))}),[JSON.stringify(T)]),t("div",e({"data-testid":"Status_badge",className:c(A.statusBadgeWrapper,"c-status-badge--".concat(_),j)},{children:[t("div",e({className:A.statusBadgeContent,ref:Y},{children:[_&&n(m,e({isFullScreen:!1,disableHoverListener:!0,open:O,onMouseEnter:V,onMouseLeave:X,PopperProps:{className:A.popper},placement:"top-start",title:n(x,{tooltipRef:Y,onMouseEnter:V,onMouseLeave:X,assetsData:T,maxHeight:D,onClick:function(){return H(!0)}})},{children:n("div",e({className:A.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(_)},{children:n(f,{color:_,iconType:_})}))})),k&&t(l,e({className:c(A.text,A.timestamp),variant:"body1"},{children:["Last Update: ",s.unix(k).format("M/D/YYYY h:mm a")]})),E&&t(o,{children:[n(m,e({placement:"top",title:U?"".concat(u,". ").concat(U):u},{children:n("div",e({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:n(f,{className:A.badgeIconWarning,color:d.warning,iconType:d.warning})}))})),!q&&n(l,e({className:c(A.text,A.warningMessage),variant:"body1"},{children:U?"".concat(u,". ").concat(U):u}))]})]})),Q&&n(h,{assets:Object.keys(T).map((function(e){return{name:e,id:T[e][0].alert.assetId}})),onSave:C||function(e,t){b(t,e,W,L)},onClose:function(){return H(!1)}})]}))};export{y as StatusBadge};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { AssetData } from '~/components/StatusBadge/constants';
|
|
2
|
-
export declare function useAlertsSubscription(assetIds: any): any[];
|
|
2
|
+
export declare function useAlertsSubscription(assetIds: any, appId: any, maximized: any): any[];
|
|
3
3
|
declare type WellnessAlerts = {
|
|
4
4
|
alertsData: AssetData;
|
|
5
5
|
lastTimestamp: number;
|
|
6
6
|
hasSubscriptionsData: boolean;
|
|
7
7
|
} | Record<string, {}>;
|
|
8
|
-
export declare const useWellnessAlerts: ({ asset, multiRigAssets, appId, dashboards, isDCApp }: {
|
|
8
|
+
export declare const useWellnessAlerts: ({ asset, multiRigAssets, appId, dashboards, isDCApp, maximized, }: {
|
|
9
9
|
asset: any;
|
|
10
10
|
multiRigAssets?: any[];
|
|
11
11
|
appId: any;
|
|
12
12
|
dashboards: any;
|
|
13
13
|
isDCApp: any;
|
|
14
|
+
maximized: any;
|
|
14
15
|
}) => {
|
|
15
16
|
wellnessAlerts: WellnessAlerts;
|
|
16
17
|
statusBadgeIconType: "" | "success" | "error" | "issue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWellnessAlerts.d.ts","sourceRoot":"","sources":["../../src/effects/useWellnessAlerts.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,SAAS,EAIV,MAAM,oCAAoC,CAAC;AAW5C,wBAAgB,qBAAqB,CAAC,QAAQ,KAAA,
|
|
1
|
+
{"version":3,"file":"useWellnessAlerts.d.ts","sourceRoot":"","sources":["../../src/effects/useWellnessAlerts.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,SAAS,EAIV,MAAM,oCAAoC,CAAC;AAW5C,wBAAgB,qBAAqB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,SAAS,KAAA,SA+B/D;AAED,aAAK,cAAc,GACf;IAAE,UAAU,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,OAAO,CAAA;CAAE,GAC/E,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEvB,eAAO,MAAM,iBAAiB;;;;;;;;;;CAiJ7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from'./../ext-esm/tslib/tslib.es6.js';import{useState as r,useEffect as s}from"react";import{v4 as a}from"uuid";import{isEmpty as i}from"lodash";import o from"../utils/resolveWellHubSlug.js";import{isDevOrQAEnv as u}from"../utils/env.js";import{getWellnessAlerts as l,getWellnessRuleSettings as d,getWCURuleMapping as c}from"../components/StatusBadge/api.js";import{isResolved as m,getIconType as f,parseWellnessAlertFromJson as v,getNewWellnessAlerts as p,getLinkToDQPage as g}from"../components/StatusBadge/utils.js";import{ALERT_STATUSES as b,DATA_QUALITY_CHECK_PASSED as D,ALERT_STATES as h,ENABLING_ON_QA_APP_IDS_LIST as j,ENABLING_ON_PROD_APP_IDS_LIST as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from'./../ext-esm/tslib/tslib.es6.js';import{useState as r,useEffect as s}from"react";import{v4 as a}from"uuid";import{isEmpty as i}from"lodash";import o from"../utils/resolveWellHubSlug.js";import{isDevOrQAEnv as u}from"../utils/env.js";import{getWellnessAlerts as l,getWellnessRuleSettings as d,getWCURuleMapping as c}from"../components/StatusBadge/api.js";import{isResolved as m,getIconType as f,parseWellnessAlertFromJson as v,getNewWellnessAlerts as p,getLinkToDQPage as g}from"../components/StatusBadge/utils.js";import{ALERT_STATUSES as b,DATA_QUALITY_CHECK_PASSED as D,ALERT_STATES as h,ENABLING_ON_QA_APP_IDS_LIST as j,ENABLING_ON_PROD_APP_IDS_LIST as y,METADATA as I}from"../components/StatusBadge/constants.js";import{socketClient as S}from"../clients/index.js";var A=function(t,e,n){return void 0===n&&(n=""),{provider:I.recordProvider,dataset:e,assetId:t,event:n}};function N(t,e,n){var a=r([]),o=a[0],u=a[1];return s((function(){if(!i(t.filter((function(t){return t})))){var e=function(t){var e=t.data.map(v);u(e)},n=t.map((function(t){return S.subscribe(A(t,I.recordCollections.wellnessAlerts),{onDataReceive:e})})),r=t.map((function(t){return S.subscribe(A(t,I.recordCollections.wellnessAlerts,"update"),{onDataReceive:e})}));return function(){n.forEach((function(t){return t()})),r.forEach((function(t){return t()}))}}}),[JSON.stringify(t),e,n]),o}var O=function(I){var S=I.asset,A=I.multiRigAssets,O=void 0===A?[]:A,R=I.appId,E=I.dashboards,w=I.isDCApp,T=I.maximized,k=r({}),B=k[0],x=k[1],C=r(""),G=C[0],H=C[1],L=N(S?[S.id]:O.map((function(t){return t.id})),R,T);return s((function(){if(B.alertsData&&!i(L)){var e=Object.keys(B.alertsData).reduce((function(e,n){var r;return t(t({},e),((r={})[n]=B.alertsData[n].map((function(e){var n=L.find((function(t){return(null==t?void 0:t.name)===e.name&&(null==t?void 0:t.assetId)===e.alert.assetId}));if(!n)return e;if([b.FLAGGED,b.INVESTIGATION,b.ON_HOLD].includes(n.status))return e;var r=t(t({},n),{emptyMessage:m(n.status)&&D}),s=m(n.status);return e.alert.id===n.id?t(t({},e),{isResolved:s,alert:r}):t(t({},e),{isResolved:s,issuesNum:n.state===h.issue?e.issuesNum+1:0,missingNum:n.state===h.missing?e.missingNum+1:0,alert:r})})),r))}),{}),n=Object.keys(e);H(f(n,e)),x((function(n){return t(t({},n),{alertsData:e,hasSubscriptionsData:!0})}))}}),[L]),s((function(){var r=u?j:y,s={id:null==S?void 0:S.id,name:null==S?void 0:S.name},i=s.id?[s]:O;try{i.length&&(r.includes(R)||w)?function(r){e(void 0,void 0,void 0,(function(){var e,s,i,u,m,h,j,y,I,S,A;return n(this,(function(n){switch(n.label){case 0:return[4,c(R)];case 1:return e=n.sent(),[4,d(null===(I=e[0])||void 0===I?void 0:I.rule_id)];case 2:return(s=n.sent()).length?[4,o(E)]:[2];case 3:return i=n.sent(),u=r.map((function(t){return t.id})),[4,Promise.all(s.map((function(t){var e=t.data.name;return l(u,e)}))).then((function(t){return t.map((function(t){return t.map((function(t){return v(t)}))}))}))];case 4:return m=n.sent(),h=p(r,m,i),j=r.reduce((function(e,n){var r,o=n.id;return t(t({},e),((r={})[n.name]=s.map((function(t){var r;return(null===(r=e[n.name])||void 0===r?void 0:r.find((function(e){return e.name===t.data.name})))||{alert:{assetId:o,category:t.data.category,status:b.RESOLVED,emptyMessage:D},id:a(),isResolved:!0,name:t.data.name,linkToDQPage:g({assetId:o,wellHubSlug:i})}})),r))}),t({},h)),y=Object.keys(j),H(f(y,j)),x({alertsData:j,lastTimestamp:null===(A=null===(S=j[y[0]][0])||void 0===S?void 0:S.alert)||void 0===A?void 0:A.statusUpdatedAt}),[2]}}))}))}(i):(x({}),H(""))}catch(t){console.error(t)}}),[null==S?void 0:S.id,O.length]),{wellnessAlerts:B,statusBadgeIconType:G}};export{N as useAlertsSubscription,O as useWellnessAlerts};
|