@corva/ui 0.65.0-rc.0 → 0.65.0-rc.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.
@@ -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,t){return void 0===t&&(t="MM/DD/YY hh:mm a"),e?m.default.unix(e).format(t):null},h=function(e){return m.default.unix(e).format("DD MMM HH:mm (Z)")},f=function(a){var s=a.children,i=u(),n=r.template(s)({timestampFormatter:h}).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=a.alert,i=a.alertIcon,d=a.children,m=a.linkToDQPage,h=u(),j=p.useDQUnvalidatedContentStyles({}),_=Math.max(s.statusUpdatedAt,s.lastCheckedAt),S=x(_);return t.jsx(n.Tooltip,{interactive:!0,children:d,PopperProps:{className:h.popover},placement:"right",title:t.jsxs(t.Fragment,{children:[s.emptyMessage&&t.jsx("div",e.__assign({className:h.emptyMessage},{children:s.statusUpdatedAt?x(s.statusUpdatedAt,"MM/DD/YYYY hh:mm a"):s.emptyMessage})),!s.emptyMessage&&t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:h.title},{children:[s.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:j.link,href:m},{children:t.jsx(g.default,{className:j.linkIcon})}))})}))]})),t.jsxs("span",e.__assign({className:h.alertInfo},{children:[t.jsx("span",{children:"Category:"})," ",s.category]})),t.jsxs("span",e.__assign({className:h.alertInfo},{children:[t.jsx("span",{children:"Status:"})," ",s.status]})),t.jsxs("span",e.__assign({className:h.alertInfo},{children:[t.jsx("span",{children:"Error Type:"}),t.jsx("div",e.__assign({className:h.errorIcon},{children:i})),t.jsx("span",e.__assign({className:s.state===o.ALERT_STATES.issue?o.BADGE_ICON_STATUSES.warning:o.BADGE_ICON_STATUSES.error},{children:s.state}))]})),t.jsxs("span",e.__assign({className:h.alertInfo},{children:[t.jsx("span",{children:"Score Deduction:"}),t.jsx("span",e.__assign({className:l.getDeductsFromScoreClass(h,s.deductsFromScore,l.isResolved(s.status))},{children:l.getDeductsFromScoreValue(s.deductsFromScore,l.isResolved(s.status))}))]})),t.jsxs("div",e.__assign({className:h.alertMessageFull},{children:[s.isThrottled&&t.jsx("b",{children:"[Throttled]: "}),t.jsx(f,{children:s.message})]})),t.jsxs("span",e.__assign({className:h.alertInfo},{children:[t.jsx("span",e.__assign({className:h.note},{children:"Note:"}))," ",(null===(r=s.note)||void 0===r?void 0:r.length)?s.note:"—"]})),t.jsxs("span",e.__assign({className:h.alertTime},{children:["Updated at: ",t.jsx("span",{children:S})]}))]})]})})};
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("react"),r=require("moment"),s=require("lodash"),i=require("@material-ui/core"),n=require("@material-ui/icons/ArrowForward"),l=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var o=require("../utils.js"),c=require("../constants.js"),p=require("../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js"),d=require("../styles.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=m(r),g=m(n),x=i.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")}}})),h=function(e,t){return void 0===t&&(t="MM/DD/YY hh:mm a"),e?u.default.unix(e).format(t):null},f=function(e){return u.default.unix(e).format("DD MMM HH:mm (Z)")},j=function(a){var r=a.children,i=x(),n=s.template(r)({timestampFormatter:f}).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}))},_=a.memo((function(a){var r,s=a.alert,i=a.alertIcon,n=a.children,m=a.linkToDQPage,u=x(),f=d.useDQUnvalidatedContentStyles({}),_=Math.max(s.statusUpdatedAt,s.lastCheckedAt),S=h(_);return t.jsx(l.Tooltip,{interactive:!0,children:n,PopperProps:{className:u.popover},placement:"right",title:t.jsxs(t.Fragment,{children:[s.emptyMessage&&t.jsx("div",e.__assign({className:u.emptyMessage},{children:s.statusUpdatedAt?h(s.statusUpdatedAt,"MM/DD/YYYY hh:mm a"):s.emptyMessage})),!s.emptyMessage&&t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:u.title},{children:[s.name,t.jsx(l.Tooltip,e.__assign({isFullScreen:!1,title:"Go to Data Quality page"},{children:t.jsx("div",{children:t.jsx(p.UniversalLink,e.__assign({className:f.link,href:m},{children:t.jsx(g.default,{className:f.linkIcon})}))})}))]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Category:"})," ",s.category]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Status:"})," ",s.status]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Error Type:"}),t.jsx("div",e.__assign({className:u.errorIcon},{children:i})),t.jsx("span",e.__assign({className:s.state===c.ALERT_STATES.issue?c.BADGE_ICON_STATUSES.warning:c.BADGE_ICON_STATUSES.error},{children:s.state}))]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Score Deduction:"}),t.jsx("span",e.__assign({className:o.getDeductsFromScoreClass(u,s.deductsFromScore,o.isResolved(s.status))},{children:o.getDeductsFromScoreValue(s.deductsFromScore,o.isResolved(s.status))}))]})),t.jsxs("div",e.__assign({className:u.alertMessageFull},{children:[s.isThrottled&&t.jsx("b",{children:"[Throttled]: "}),t.jsx(j,{children:s.message})]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",e.__assign({className:u.note},{children:"Note:"}))," ",(null===(r=s.note)||void 0===r?void 0:r.length)?s.note:"—"]})),t.jsxs("span",e.__assign({className:u.alertTime},{children:["Updated at: ",t.jsx("span",{children:S})]}))]})]})})}),(function(e,t){return s.isEqual(e.alert,t.alert)}));exports.DQAlertsTooltip=_;
@@ -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"),a=require("moment"),s=require("classnames"),r=require("@material-ui/core"),o=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var i=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(s),f=window.innerHeight-212,x=r.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:10},"& .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 s=a.assetsData,d=void 0===s?{}:s,_=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,C=a.statusBadgeContentClassName,w=n.useState(!1),A=w[0],W=w[1],M=n.useState(!1),q=M[0],B=M[1],R=n.useRef(null),k=null==y?void 0:y.message,O=T===i.BADGE_ICON_STATUSES.error,L=T===i.BADGE_ICON_STATUSES.success,Q=T===i.BADGE_ICON_STATUSES.issue,G=_<i.MAX_MOBILE_WIDTH,U=x({isIconExist:!!T,isSuccessTypeIcon:L,isErrorTypeIcon:O,isIssueTypeIcon:Q,maximized:D}),z=n.useRef(null),H=function(e){R.current&&!R.current.contains(e.target)&&B(!1)};n.useEffect((function(){return document.addEventListener("click",H),function(){document.removeEventListener("click",H),clearTimeout(z.current)}}),[]);var Y=function(){clearTimeout(z.current),B(!0)},P=function(e,t){void 0===t&&(t=700),z.current=setTimeout((function(){return B(!1)}),t)};return n.useEffect((function(){j&&(Y(),P(0,1e4))}),[JSON.stringify(d)]),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:m.default(U.statusBadgeWrapper,"c-status-badge--".concat(T),h)},{children:[t.jsxs("div",e.__assign({className:m.default(U.statusBadgeContent,C),ref:R},{children:[T&&t.jsx(o.Tooltip,e.__assign({disableHoverListener:!0,open:q,onMouseEnter:Y,onMouseLeave:P,PopperProps:{className:U.popper},placement:"top-start",title:t.jsx(u.DQUnvalidatedContent,{tooltipRef:R,onMouseEnter:Y,onMouseLeave:P,assetsData:d,maxHeight:I,onClick:function(){return W(!0)}})},{children:t.jsx("div",e.__assign({className:U.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(T)},{children:t.jsx(c.DQStatusIcon,{color:T,iconType:T})}))})),b&&t.jsxs(r.Typography,e.__assign({className:m.default(U.text,U.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(o.Tooltip,e.__assign({placement:"top",title:k?"".concat(i.WARNING,". ").concat(k):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:U.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!G&&t.jsx(r.Typography,e.__assign({className:m.default(U.text,U.warningMessage),variant:"body1"},{children:k?"".concat(i.WARNING,". ").concat(k):i.WARNING}))]})]})),A&&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 W(!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"),a=require("moment"),s=require("classnames"),r=require("@material-ui/core"),o=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var i=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(s),f=window.innerHeight-212,x=r.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:400},"& .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 s=a.assetsData,d=void 0===s?{}:s,_=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,C=a.statusBadgeContentClassName,w=n.useState(!1),A=w[0],W=w[1],M=n.useState(!1),q=M[0],B=M[1],R=n.useRef(null),k=null==y?void 0:y.message,O=T===i.BADGE_ICON_STATUSES.error,L=T===i.BADGE_ICON_STATUSES.success,Q=T===i.BADGE_ICON_STATUSES.issue,G=_<i.MAX_MOBILE_WIDTH,U=x({isIconExist:!!T,isSuccessTypeIcon:L,isErrorTypeIcon:O,isIssueTypeIcon:Q,maximized:D}),z=n.useRef(null),H=function(e){R.current&&!R.current.contains(e.target)&&B(!1)};n.useEffect((function(){return document.addEventListener("click",H),function(){document.removeEventListener("click",H),clearTimeout(z.current)}}),[]);var Y=function(){clearTimeout(z.current),B(!0)},P=function(e,t){void 0===t&&(t=700),z.current=setTimeout((function(){return B(!1)}),t)};return n.useEffect((function(){j&&(Y(),P(0,1e4))}),[JSON.stringify(d)]),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:m.default(U.statusBadgeWrapper,"c-status-badge--".concat(T),h)},{children:[t.jsxs("div",e.__assign({className:m.default(U.statusBadgeContent,C),ref:R},{children:[T&&t.jsx(o.Tooltip,e.__assign({disableHoverListener:!0,open:q,onMouseEnter:Y,onMouseLeave:P,PopperProps:{className:U.popper},placement:"top-start",title:t.jsx(u.DQUnvalidatedContent,{tooltipRef:R,onMouseEnter:Y,onMouseLeave:P,assetsData:d,maxHeight:I,onClick:function(){return W(!0)}})},{children:t.jsx("div",e.__assign({className:U.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(T)},{children:t.jsx(c.DQStatusIcon,{color:T,iconType:T})}))})),b&&t.jsxs(r.Typography,e.__assign({className:m.default(U.text,U.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(o.Tooltip,e.__assign({placement:"top",title:k?"".concat(i.WARNING,". ").concat(k):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:U.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!G&&t.jsx(r.Typography,e.__assign({className:m.default(U.text,U.warningMessage),variant:"body1"},{children:k?"".concat(i.WARNING,". ").concat(k):i.WARNING}))]})]})),A&&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 W(!1)}})]}))};
@@ -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: import("react").MemoExoticComponent<({ 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;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,WAgF/B,CAAC"}
1
+ {"version":3,"file":"DQAlertsTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAlertsTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAQ,MAAM,OAAO,CAAC;AAW3C,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,qFACqB,0BAA0B,KAAG,WAAW,CAsFxF,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,t){return void 0===t&&(t="MM/DD/YY hh:mm a"),e?i.unix(e).format(t):null},y=function(e){return i.unix(e).format("DD MMM HH:mm (Z)")},v=function(r){var a=r.children,i=u(),n=o(a)({timestampFormatter:y}).split("**").map((function(e,r){return r%2==1?t("b",{children:e}):e}));return t("span",e({className:i.message},{children:n}))},w=function(i){var o,n=i.alert,y=i.alertIcon,w=i.children,b=i.linkToDQPage,N=u(),S=f({}),M=Math.max(n.statusUpdatedAt,n.lastCheckedAt),I=x(M);return t(s,{interactive:!0,children:w,PopperProps:{className:N.popover},placement:"right",title:r(a,{children:[n.emptyMessage&&t("div",e({className:N.emptyMessage},{children:n.statusUpdatedAt?x(n.statusUpdatedAt,"MM/DD/YYYY hh:mm a"):n.emptyMessage})),!n.emptyMessage&&r(a,{children:[r("div",e({className:N.title},{children:[n.name,t(s,e({isFullScreen:!1,title:"Go to Data Quality page"},{children:t("div",{children:t(g,e({className:S.link,href:b},{children:t(l,{className:S.linkIcon})}))})}))]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Category:"})," ",n.category]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Status:"})," ",n.status]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Error Type:"}),t("div",e({className:N.errorIcon},{children:y})),t("span",e({className:n.state===d.issue?h.warning:h.error},{children:n.state}))]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Score Deduction:"}),t("span",e({className:p(N,n.deductsFromScore,c(n.status))},{children:m(n.deductsFromScore,c(n.status))}))]})),r("div",e({className:N.alertMessageFull},{children:[n.isThrottled&&t("b",{children:"[Throttled]: "}),t(v,{children:n.message})]})),r("span",e({className:N.alertInfo},{children:[t("span",e({className:N.note},{children:"Note:"}))," ",(null===(o=n.note)||void 0===o?void 0:o.length)?n.note:"—"]})),r("span",e({className:N.alertTime},{children:["Updated at: ",t("span",{children:I})]}))]})]})})};export{w as DQAlertsTooltip};
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{memo as i}from"react";import o from"moment";import{isEqual as n,template as l}from"lodash";import{makeStyles as s}from"@material-ui/core";import p from"@material-ui/icons/ArrowForward";import{Tooltip as c}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{getDeductsFromScoreClass as m,isResolved as d,getDeductsFromScoreValue as h}from"../utils.js";import{ALERT_STATES as f,BADGE_ICON_STATUSES as g}from"../constants.js";import{UniversalLink as u}from"../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import{useDQUnvalidatedContentStyles as x}from"../styles.js";var y=s((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")}}})),v=function(e,t){return void 0===t&&(t="MM/DD/YY hh:mm a"),e?o.unix(e).format(t):null},w=function(e){return o.unix(e).format("DD MMM HH:mm (Z)")},b=function(r){var a=r.children,i=y(),o=l(a)({timestampFormatter:w}).split("**").map((function(e,r){return r%2==1?t("b",{children:e}):e}));return t("span",e({className:i.message},{children:o}))},N=i((function(i){var o,n=i.alert,l=i.alertIcon,s=i.children,w=i.linkToDQPage,N=y(),S=x({}),M=Math.max(n.statusUpdatedAt,n.lastCheckedAt),I=v(M);return t(c,{interactive:!0,children:s,PopperProps:{className:N.popover},placement:"right",title:r(a,{children:[n.emptyMessage&&t("div",e({className:N.emptyMessage},{children:n.statusUpdatedAt?v(n.statusUpdatedAt,"MM/DD/YYYY hh:mm a"):n.emptyMessage})),!n.emptyMessage&&r(a,{children:[r("div",e({className:N.title},{children:[n.name,t(c,e({isFullScreen:!1,title:"Go to Data Quality page"},{children:t("div",{children:t(u,e({className:S.link,href:w},{children:t(p,{className:S.linkIcon})}))})}))]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Category:"})," ",n.category]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Status:"})," ",n.status]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Error Type:"}),t("div",e({className:N.errorIcon},{children:l})),t("span",e({className:n.state===f.issue?g.warning:g.error},{children:n.state}))]})),r("span",e({className:N.alertInfo},{children:[t("span",{children:"Score Deduction:"}),t("span",e({className:m(N,n.deductsFromScore,d(n.status))},{children:h(n.deductsFromScore,d(n.status))}))]})),r("div",e({className:N.alertMessageFull},{children:[n.isThrottled&&t("b",{children:"[Throttled]: "}),t(b,{children:n.message})]})),r("span",e({className:N.alertInfo},{children:[t("span",e({className:N.note},{children:"Note:"}))," ",(null===(o=n.note)||void 0===o?void 0:o.length)?n.note:"—"]})),r("span",e({className:N.alertTime},{children:["Updated at: ",t("span",{children:I})]}))]})]})})}),(function(e,t){return n(e.alert,t.alert)}));export{N as DQAlertsTooltip};
@@ -1 +1 @@
1
- import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,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(t){return{statusBadgeWrapper:{backgroundColor:t.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(t){var e=t.isSuccessTypeIcon,n=t.isErrorTypeIcon,o=t.isIssueTypeIcon;return"12px 0 2px ".concat(e||n||o?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:t.palette.primary.text6,marginLeft:function(t){return t.isIconExist&&4}},warningMessage:{color:t.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{zIndex:function(t){return t.maximized?500:10},"& .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:t.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,minWidth:24,borderRadius:12,"&:hover":{backgroundColor:function(t){var e=t.isErrorTypeIcon,n=t.isSuccessTypeIcon,o=t.isIssueTypeIcon;return e?"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,C=void 0===w?v:w,D=p.iconType,_=p.className,j=p.lastTimestamp,k=p.onReportErrorClick,E=p.warningData,M=p.hasSubscriptionsData,N=p.currentUser,W=p.segment,L=p.maximized,z=p.statusBadgeContentClassName,Q=r(!1),H=Q[0],B=Q[1],O=r(!1),R=O[0],Y=O[1],U=i(null),P=null==E?void 0:E.message,J=D===d.error,q=D===d.success,A=D===d.issue,F=S<g,G=I({isIconExist:!!D,isSuccessTypeIcon:q,isErrorTypeIcon:J,isIssueTypeIcon:A,maximized:L}),K=i(null),V=function(t){U.current&&!U.current.contains(t.target)&&Y(!1)};a((function(){return document.addEventListener("click",V),function(){document.removeEventListener("click",V),clearTimeout(K.current)}}),[]);var X=function(){clearTimeout(K.current),Y(!0)},Z=function(t,e){void 0===e&&(e=700),K.current=setTimeout((function(){return Y(!1)}),e)};return a((function(){M&&(X(),Z(0,1e4))}),[JSON.stringify(T)]),e("div",t({"data-testid":"Status_badge",className:c(G.statusBadgeWrapper,"c-status-badge--".concat(D),_)},{children:[e("div",t({className:c(G.statusBadgeContent,z),ref:U},{children:[D&&n(m,t({disableHoverListener:!0,open:R,onMouseEnter:X,onMouseLeave:Z,PopperProps:{className:G.popper},placement:"top-start",title:n(x,{tooltipRef:U,onMouseEnter:X,onMouseLeave:Z,assetsData:T,maxHeight:C,onClick:function(){return B(!0)}})},{children:n("div",t({className:G.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(D)},{children:n(f,{color:D,iconType:D})}))})),j&&e(l,t({className:c(G.text,G.timestamp),variant:"body1"},{children:["Last Update: ",s.unix(j).format("M/D/YYYY h:mm a")]})),E&&e(o,{children:[n(m,t({placement:"top",title:P?"".concat(u,". ").concat(P):u},{children:n("div",t({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:n(f,{className:G.badgeIconWarning,color:d.warning,iconType:d.warning})}))})),!F&&n(l,t({className:c(G.text,G.warningMessage),variant:"body1"},{children:P?"".concat(u,". ").concat(P):u}))]})]})),H&&n(h,{assets:Object.keys(T).map((function(t){return{name:t,id:T[t][0].alert.assetId}})),onSave:k||function(t,e){b(e,t,N,W)},onClose:function(){return B(!1)}})]}))};export{y as StatusBadge};
1
+ import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,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(t){return{statusBadgeWrapper:{backgroundColor:t.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(t){var e=t.isSuccessTypeIcon,n=t.isErrorTypeIcon,o=t.isIssueTypeIcon;return"12px 0 2px ".concat(e||n||o?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:t.palette.primary.text6,marginLeft:function(t){return t.isIconExist&&4}},warningMessage:{color:t.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{zIndex:function(t){return t.maximized?500:400},"& .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:t.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,minWidth:24,borderRadius:12,"&:hover":{backgroundColor:function(t){var e=t.isErrorTypeIcon,n=t.isSuccessTypeIcon,o=t.isIssueTypeIcon;return e?"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,C=void 0===w?v:w,D=p.iconType,_=p.className,j=p.lastTimestamp,k=p.onReportErrorClick,E=p.warningData,M=p.hasSubscriptionsData,N=p.currentUser,W=p.segment,L=p.maximized,z=p.statusBadgeContentClassName,Q=r(!1),H=Q[0],B=Q[1],O=r(!1),R=O[0],Y=O[1],U=i(null),P=null==E?void 0:E.message,J=D===d.error,q=D===d.success,A=D===d.issue,F=S<g,G=I({isIconExist:!!D,isSuccessTypeIcon:q,isErrorTypeIcon:J,isIssueTypeIcon:A,maximized:L}),K=i(null),V=function(t){U.current&&!U.current.contains(t.target)&&Y(!1)};a((function(){return document.addEventListener("click",V),function(){document.removeEventListener("click",V),clearTimeout(K.current)}}),[]);var X=function(){clearTimeout(K.current),Y(!0)},Z=function(t,e){void 0===e&&(e=700),K.current=setTimeout((function(){return Y(!1)}),e)};return a((function(){M&&(X(),Z(0,1e4))}),[JSON.stringify(T)]),e("div",t({"data-testid":"Status_badge",className:c(G.statusBadgeWrapper,"c-status-badge--".concat(D),_)},{children:[e("div",t({className:c(G.statusBadgeContent,z),ref:U},{children:[D&&n(m,t({disableHoverListener:!0,open:R,onMouseEnter:X,onMouseLeave:Z,PopperProps:{className:G.popper},placement:"top-start",title:n(x,{tooltipRef:U,onMouseEnter:X,onMouseLeave:Z,assetsData:T,maxHeight:C,onClick:function(){return B(!0)}})},{children:n("div",t({className:G.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(D)},{children:n(f,{color:D,iconType:D})}))})),j&&e(l,t({className:c(G.text,G.timestamp),variant:"body1"},{children:["Last Update: ",s.unix(j).format("M/D/YYYY h:mm a")]})),E&&e(o,{children:[n(m,t({placement:"top",title:P?"".concat(u,". ").concat(P):u},{children:n("div",t({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:n(f,{className:G.badgeIconWarning,color:d.warning,iconType:d.warning})}))})),!F&&n(l,t({className:c(G.text,G.warningMessage),variant:"body1"},{children:P?"".concat(u,". ").concat(P):u}))]})]})),H&&n(h,{assets:Object.keys(T).map((function(t){return{name:t,id:T[t][0].alert.assetId}})),onSave:k||function(t,e){b(e,t,N,W)},onClose:function(){return B(!1)}})]}))};export{y as StatusBadge};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.65.0-rc.0",
3
+ "version": "0.65.0-rc.1",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"