@corva/ui 0.56.0-12 → 0.56.0-13
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/README.md +26 -3
- package/cjs-bundle/components/OffsetWellPickerV4/effects/useAdvancedWells.js +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAccordionDetailsContent.js +1 -0
- package/cjs-bundle/components/StatusBadge/components/DQAlertTooltip.js +1 -0
- package/cjs-bundle/components/StatusBadge/components/DQUnvalidatedContent.js +1 -1
- package/cjs-bundle/components/StatusBadge/index.js +1 -1
- package/cjs-bundle/components/StatusBadge/styles.js +1 -0
- package/components/OffsetWellPickerV4/effects/useAdvancedWells.d.ts.map +1 -1
- package/components/OffsetWellPickerV4/effects/useAdvancedWells.js +1 -1
- package/components/StatusBadge/components/DQAccordionDetailsContent.d.ts +9 -0
- package/components/StatusBadge/components/DQAccordionDetailsContent.d.ts.map +1 -0
- package/components/StatusBadge/components/DQAccordionDetailsContent.js +1 -0
- package/components/StatusBadge/components/DQAlertTooltip.d.ts +13 -0
- package/components/StatusBadge/components/DQAlertTooltip.d.ts.map +1 -0
- package/components/StatusBadge/components/DQAlertTooltip.js +1 -0
- package/components/StatusBadge/components/DQUnvalidatedContent.d.ts +3 -2
- package/components/StatusBadge/components/DQUnvalidatedContent.d.ts.map +1 -1
- package/components/StatusBadge/components/DQUnvalidatedContent.js +1 -1
- package/components/StatusBadge/constants.d.ts +8 -4
- package/components/StatusBadge/constants.d.ts.map +1 -1
- package/components/StatusBadge/index.d.ts +3 -2
- package/components/StatusBadge/index.d.ts.map +1 -1
- package/components/StatusBadge/index.js +1 -1
- package/components/StatusBadge/styles.d.ts +6 -0
- package/components/StatusBadge/styles.d.ts.map +1 -0
- package/components/StatusBadge/styles.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,20 @@ components - please also update it's `stories.js` file when it's necessary
|
|
|
37
37
|
|
|
38
38
|
3. Run `yarn link @corva/ui` in your local DC app root folder
|
|
39
39
|
|
|
40
|
-
4.
|
|
40
|
+
4. Add following parameters to the `config-overrides.js`.<br/>It should avoid the issue of mulitple React instances and the MUI styling issue
|
|
41
|
+
```
|
|
42
|
+
{
|
|
43
|
+
resolve: {
|
|
44
|
+
alias: {
|
|
45
|
+
react: path.resolve('./node_modules/react'),
|
|
46
|
+
'@material-ui': resolve('./node_modules/@material-ui'),
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
5. Run `yarn start` in your local DC app root folder
|
|
41
54
|
|
|
42
55
|
***Note:** npm link will not install @corva/ui dependencies in your node modules folder.*
|
|
43
56
|
If you want to debug a change in @corva/ui dependencies, you should use `yarn add file:../corva-ui/dist`, this will install new dependencies.
|
|
@@ -52,7 +65,7 @@ Most likely you need to [migrate to `@corva/dc-platform-shared`](https://www.not
|
|
|
52
65
|
In that case, your bundler might “see” two Reacts — one in application folder and one in your library folder. Assuming myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This should make the library use the application’s React copy.
|
|
53
66
|
|
|
54
67
|
|
|
55
|
-
Or change the webpack configuration in config-overrides.js in your app. (Don't commit the changes of this file)
|
|
68
|
+
Or change the webpack configuration in `config-overrides.js` file in your app. (Don't commit the changes of this file)
|
|
56
69
|
```
|
|
57
70
|
{
|
|
58
71
|
resolve: {
|
|
@@ -63,4 +76,14 @@ Most likely you need to [migrate to `@corva/dc-platform-shared`](https://www.not
|
|
|
63
76
|
}
|
|
64
77
|
```
|
|
65
78
|
|
|
66
|
-
|
|
79
|
+
#### Material UI styles are corrupted
|
|
80
|
+
Add the following parameter to the `config-overrides.js` file in your app
|
|
81
|
+
```
|
|
82
|
+
{
|
|
83
|
+
resolve: {
|
|
84
|
+
alias: {
|
|
85
|
+
'@material-ui': resolve('./node_modules/@material-ui')
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/regenerator"),u=require("react"),a=require("lodash"),i=require("../../../utils/index.js"),c=require("../utils/apiCalls.js"),o=require("../constants.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=s(e),l=s(t),p=s(r),d=s(n);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){f.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/regenerator"),u=require("react"),a=require("lodash"),i=require("../../../utils/index.js"),c=require("../utils/apiCalls.js"),o=require("../constants.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=s(e),l=s(t),p=s(r),d=s(n);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){f.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=i.mapbox.getAssetV2Coordinates,h=i.mapbox.getDistanceByCoordinates,m=function(e){return Number.isFinite(e)?parseFloat(e.toFixed(2)):null};exports.useAdvancedWells=function(e,t,r,n,i,s){var b=u.useState(null),O=p.default(b,2),j=O[0],x=O[1],g=u.useState(null),w=p.default(g,2),E=w[0],P=w[1],q=u.useState(null),k=p.default(q,2),S=k[0],D=k[1],F=u.useRef({});function C(){return C=l.default(d.default.mark((function e(){var r,n,u;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.find((function(e){return e.id===i})),(n=r&&y(r,"topHole"))||P(t),e.next=5,Promise.all(t.map(function(){var e=l.default(d.default.mark((function e(t){var r,u;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,y(t,"topHole");case 3:if(!(r=e.sent)){e.next=13;break}return e.t0=parseFloat,e.next=8,h(n,r);case 8:return e.t1=e.sent,u=(0,e.t0)(e.t1),e.abrupt("return",v(v({},t),{},{distance:parseFloat(u.toFixed(2))}));case 13:return e.abrupt("return",t);case 14:e.next=19;break;case 16:return e.prev=16,e.t2=e.catch(0),e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t){return e.apply(this,arguments)}}()));case 5:u=e.sent,P(u);case 7:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function _(e){return A.apply(this,arguments)}function A(){return(A=l.default(d.default.mark((function t(r){var n,u,i,o;return d.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c.fetchMetricsData(e,r,s);case 2:n=t.sent,u={},i=a.groupBy(n,"asset_id"),r.forEach((function(e){var t,r=null===(t=i[e])||void 0===t?void 0:t.reduce((function(e,t){var r=a.get(t,"data.value"),n=a.get(t,"data.key");return v(v({},e),{},f.default({},n,m(r)))}),{});u[e]=r})),F.current=v(v({},F.current),u),o=[],S.forEach((function(e){o.push(v(v({},e),F.current[e.id]))})),x(o);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return u.useEffect((function(){t&&function(){C.apply(this,arguments)}()}),[t,i]),u.useEffect((function(){var e,t;E&&r&&n&&(e=r.filter((function(e){return e.value!==o.ALL_SECTION_KEY})),t=E.map((function(t){var r=e.filter((function(e){return(n[e.value]||[]).includes(t.id)})).map((function(e){return e.label}));return r.length>0?v(v({},t),{},f.default({},o.ColumnType.wellSection,r)):t})),D(t))}),[E,r,n]),u.useEffect((function(){if(S){var e=[];S.forEach((function(t){F.current[t.id]||e.push(t.id)})),_(e)}}),[S]),u.useEffect((function(){j&&_(j.map((function(e){return e.id})))}),[s]),j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require('./../../../ext-esm/tslib/tslib.es6.js'),e=require("react/jsx-runtime"),a=require("classnames"),i=require("../styles.js"),t=require("../constants.js"),r=require("./DQAlertTooltip.js");function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var n=l(a);exports.DQAccordionDetailsContent=function(a){var l=a.assets,u=a.anchorEl,c=i.useDQUnvalidatedContentStyles({});return e.jsx("div",s.__assign({className:c.assetTable},{children:l.map((function(a){var i=a.id,l=a.name,o=a.issuesNum,d=a.missingNum,_=a.isResolved,T=a.alert,m=function(s){return{alert:T,alertsNum:s===t.ALERT_STATES.issue?o:d,alertState:s===t.ALERT_STATES.issue?t.ALERT_STATES.issue:t.ALERT_STATES.missing,isMissingData:d>0,isIssueData:o>0}},j=m(t.ALERT_STATES.issue),A=m(t.ALERT_STATES.missing),v=t.ALERT_ICONS.Resolved;return e.jsxs("div",s.__assign({className:c.assetWrapper},{children:[e.jsx("div",s.__assign({className:n.default(c.assetName,c.assetCell)},{children:l})),_?e.jsx("div",s.__assign({className:c.assetCell},{children:e.jsx("div",s.__assign({className:c.errorContainer},{children:e.jsx(v,{className:n.default(c.Resolved,c.alertIcon)})}))})):e.jsxs(e.Fragment,{children:[o>0&&e.jsx("div",s.__assign({className:c.assetCell},{children:e.jsx(r.DQAlertTooltip,s.__assign({anchorEl:u},j))})),d>0&&e.jsx("div",s.__assign({className:c.assetCell},{children:e.jsx(r.DQAlertTooltip,s.__assign({anchorEl:u},A))}))]})]}),i)}))}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require('./../../../ext-esm/tslib/tslib.es6.js'),e=require("react/jsx-runtime"),r=require("classnames"),t=require("../constants.js"),a=require("./DQAlertsTooltip.js"),i=require("../styles.js");function n(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var l=n(r);exports.DQAlertTooltip=function(r){var n,o=r.alert,u=r.alertsNum,c=r.alertState,d=r.isMissingData,_=r.isIssueData,T=r.anchorEl,j=i.useDQUnvalidatedContentStyles({}),m=t.ALERT_ICONS[c];return e.jsx(a.DQAlertsTooltip,s.__assign({alert:d?s.__assign(s.__assign({},o),{state:t.ALERT_STATES.missing}):o,anchorEl:T,alertIcon:e.jsx(m,{className:l.default(j[d?t.ALERT_STATES.missing:c],j.alertIcon)}),isTooltipVisible:u>0},{children:e.jsxs("div",s.__assign({className:l.default(j.errorContainer,(n={},n[j.missingContainer]=_&&c===t.ALERT_STATES.missing,n))},{children:[e.jsx(m,{className:l.default(j[c],j.alertIcon)}),e.jsxs("div",{children:[e.jsxs("span",s.__assign({className:l.default(j[c],j.errorText)},{children:[c,": "]})),e.jsx("span",s.__assign({className:j.errorNum},{children:u}))]})]}))}))};
|
|
@@ -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'),a=require("react/jsx-runtime"),s=require("react"),r=require("classnames"),t=require("@material-ui/core"),i=require("@material-ui/icons/ExpandMore"),n=require("../../Search/utils/truncate.js"),c=require("../styles.js"),d=require("./DQAccordionDetailsContent.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(r),o=l(i);exports.DQUnvalidatedContent=function(r){var i=r.assetsData,l=r.maxHeight,m=s.useRef(null),x=c.useDQUnvalidatedContentStyles({maxHeight:l});return a.jsxs("div",e.__assign({className:x.container,ref:m},{children:[a.jsxs("div",{children:[a.jsx(t.Typography,e.__assign({className:x.headerText,"data-testid":"Status_badge__DQ_unvalidated_content"},{children:"Data Quality"})),a.jsx(t.Typography,e.__assign({className:x.subheaderText},{children:"Fusion real-time data quality rules for app data"}))]}),a.jsx("div",e.__assign({className:x.relative},{children:a.jsx("div",e.__assign({className:x.accordionsWrapper},{children:Object.keys(i).map((function(s){var r=i[s];return a.jsxs(t.Accordion,e.__assign({className:x.accordion,defaultExpanded:!0},{children:[a.jsx(t.AccordionSummary,e.__assign({className:u.default("large","stretched"),expandIcon:a.jsx(o.default,{})},{children:n.truncateString(s,{maxChars:40,charsNumFromStart:18,charsNumFromEnd:17})})),a.jsx(t.AccordionDetails,{children:a.jsx(d.DQAccordionDetailsContent,{anchorEl:null==m?void 0:m.current,assets:r})})]}),s)}))}))}))]}))};
|
|
@@ -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("react"),n=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"),p=require("./components/DQUnvalidatedContent.js"),l=require("./components/DQSuccessContent.js"),u=require("./components/ReportIssueModal.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(n),x=d(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"),n=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"),p=require("./components/DQUnvalidatedContent.js"),l=require("./components/DQSuccessContent.js"),u=require("./components/ReportIssueModal.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(n),x=d(s),m=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,a=e.isErrorTypeIcon;return"12px 0 2px ".concat(t||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:{"& .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,borderRadius:12,"&:hover":{backgroundColor:function(e){var t=e.isErrorTypeIcon,a=e.isSuccessTypeIcon;return t?"rgba(244, 67, 54, 0.1)":a?"rgba(117, 219, 41, 0.2)":"transparent"}}}}}));exports.StatusBadge=function(n){var s,d=n.assetsData,_=void 0===d?{}:d,S=n.appWidth,f=n.DQIssueTooltipMaxHeight,h=n.iconType,I=n.className,T=n.lastTimestamp,b=n.onReportErrorClick,j=n.warningData,y=a.useState(!1),v=y[0],D=y[1],N=null==j?void 0:j.message,C=h==i.BADGE_ICON_STATUSES.error,E=h==i.BADGE_ICON_STATUSES.success,w=S<i.MAX_MOBILE_WIDTH,W=m({isIconExist:!!h,isSuccessTypeIcon:E,isErrorTypeIcon:C});C&&(s=t.jsx(p.DQUnvalidatedContent,{assetsData:_,maxHeight:f})),E&&(s=t.jsx(l.DQSuccessContent,{onClick:function(){return D(!0)}}));return t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:x.default(W.statusBadgeWrapper,I)},{children:[t.jsxs("div",e.__assign({className:W.statusBadgeContent},{children:[h&&t.jsx(o.Tooltip,e.__assign({leaveDelay:200,interactive:C||E,PopperProps:{className:W.popper},placement:"top-start",title:s},{children:t.jsx("div",e.__assign({className:W.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(h)},{children:t.jsx(c.DQStatusIcon,{color:h,iconType:h})}))})),t.jsxs(r.Typography,e.__assign({className:x.default(W.text,W.timestamp),variant:"body1"},{children:["Last Update: ",g.default.unix(T).format("M/D/YYYY h:mm a")]})),j&&t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,e.__assign({placement:"top",title:N?"".concat(i.WARNING,". ").concat(N):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:W.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!w&&t.jsx(r.Typography,e.__assign({className:x.default(W.text,W.warningMessage),variant:"body1"},{children:N?"".concat(i.WARNING,". ").concat(N):i.WARNING}))]})]})),E&&t.jsx(u.ReportIssueModal,{open:v,onSave:function(e){b(e),D(!1)},onClose:function(){return D(!1)}})]}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core").makeStyles((function(e){return{alertIcon:{width:16,height:16},assetWrapper:{display:"table-row"},assetTable:{display:"table"},assetCell:{display:"table-cell",padding:"5px 0",verticalAlign:"middle",width:111},assetName:{fontSize:"12px",width:89},container:{padding:"12px 0 4px 12px"},headerText:{lineHeight:"19px",fontSize:"16px",fontWeight:500},subheaderText:{lineHeight:"14px",fontSize:"12px",fontWeight:400,marginRight:16,color:e.palette.primary.text7,marginTop:4},Issue:{color:"#ffa500"},Missing:{color:e.palette.error.main},Resolved:{color:e.palette.success.bright},errorContainer:{display:"flex",alignItems:"center",marginLeft:8,height:22},missingContainer:{marginLeft:0},errorText:{marginLeft:4,fontSize:"14px"},errorNum:{fontSize:"16px",marginLeft:4},accordion:{"&:not(:first-child)":{marginTop:"16px !important"},marginTop:"8px !important",color:e.palette.primary.contrastText,"& .MuiAccordionSummary-content":{fontWeight:"400 !important"}},accordionsWrapper:{maxHeight:function(e){var t=e.maxHeight;return t},overflowY:"auto",paddingRight:16,"&::before, &::after":{content:'""',width:"100%",height:16,position:"absolute",zIndex:1},"&::before":{background:"linear-gradient(180deg, ".concat(e.palette.background.b9," 18.23%, rgba(59, 59, 59, 0) 100%)"),opacity:.8,top:0},"&::after":{background:"linear-gradient(0deg, ".concat(e.palette.background.b9," 18.23%, rgba(59, 59, 59, 0) 100%)"),opacity:.8,bottom:0}},relative:{position:"relative",padding:"8px 0"}}}));exports.useDQUnvalidatedContentStyles=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAdvancedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAdvancedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"names":[],"mappings":"AAUA,yJAwHC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as
|
|
1
|
+
import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as u,useEffect as i}from"react";import{groupBy as a,get as c}from"lodash";import{mapbox as s}from"../../../utils/index.js";import{fetchMetricsData as p}from"../utils/apiCalls.js";import{ALL_SECTION_KEY as f,ColumnType as l}from"../constants.js";function m(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var d=s.getAssetV2Coordinates,v=s.getDistanceByCoordinates,h=function(r){return Number.isFinite(r)?parseFloat(r.toFixed(2)):null};function y(s,m,y,O,j,w){var x=o(null),g=e(x,2),P=g[0],k=g[1],F=o(null),D=e(F,2),E=D[0],C=D[1],S=o(null),A=e(S,2),H=A[0],T=A[1],B=u({});function G(){return G=t(n.mark((function r(){var e,o,u;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=m.find((function(r){return r.id===j})),(o=e&&d(e,"topHole"))||C(m),r.next=5,Promise.all(m.map(function(){var r=t(n.mark((function r(t){var e,u;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d(t,"topHole");case 3:if(!(e=r.sent)){r.next=13;break}return r.t0=parseFloat,r.next=8,v(o,e);case 8:return r.t1=r.sent,u=(0,r.t0)(r.t1),r.abrupt("return",b(b({},t),{},{distance:parseFloat(u.toFixed(2))}));case 13:return r.abrupt("return",t);case 14:r.next=19;break;case 16:return r.prev=16,r.t2=r.catch(0),r.abrupt("return",t);case 19:case"end":return r.stop()}}),r,null,[[0,16]])})));return function(t){return r.apply(this,arguments)}}()));case 5:u=r.sent,C(u);case 7:case"end":return r.stop()}}),r)}))),G.apply(this,arguments)}function N(r){return V.apply(this,arguments)}function V(){return(V=t(n.mark((function t(e){var o,u,i,f;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p(s,e,w);case 2:o=t.sent,u={},i=a(o,"asset_id"),e.forEach((function(t){var e,n=null===(e=i[t])||void 0===e?void 0:e.reduce((function(t,e){var n=c(e,"data.value"),o=c(e,"data.key");return b(b({},t),{},r({},o,h(n)))}),{});u[t]=n})),B.current=b(b({},B.current),u),f=[],H.forEach((function(r){f.push(b(b({},r),B.current[r.id]))})),k(f);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return i((function(){m&&function(){G.apply(this,arguments)}()}),[m,j]),i((function(){var t,e;E&&y&&O&&(t=y.filter((function(r){return r.value!==f})),e=E.map((function(e){var n=t.filter((function(r){return(O[r.value]||[]).includes(e.id)})).map((function(r){return r.label}));return n.length>0?b(b({},e),{},r({},l.wellSection,n)):e})),T(e))}),[E,y,O]),i((function(){if(H){var r=[];H.forEach((function(t){B.current[t.id]||r.push(t.id)})),N(r)}}),[H]),i((function(){P&&N(P.map((function(r){return r.id})))}),[w]),P}export{y as useAdvancedWells};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AssetItem } from '~/components/StatusBadge/constants';
|
|
3
|
+
declare type DQAccordionDetailsContentProps = {
|
|
4
|
+
anchorEl: HTMLAnchorElement;
|
|
5
|
+
assets: AssetItem[];
|
|
6
|
+
};
|
|
7
|
+
export declare const DQAccordionDetailsContent: ({ assets, anchorEl }: DQAccordionDetailsContentProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=DQAccordionDetailsContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DQAccordionDetailsContent.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAccordionDetailsContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAgD,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAG7G,aAAK,8BAA8B,GAAG;IACpC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAUF,eAAO,MAAM,yBAAyB,yBAA0B,8BAA8B,KAAG,WA6ChG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as s}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as a,Fragment as r}from"react/jsx-runtime";import i from"classnames";import{useDQUnvalidatedContentStyles as l}from"../styles.js";import{ALERT_ICONS as t,ALERT_STATES as n}from"../constants.js";import{DQAlertTooltip as m}from"./DQAlertTooltip.js";var o=function(o){var c=o.assets,d=o.anchorEl,u=l({});return e("div",s({className:u.assetTable},{children:c.map((function(l){var o=l.id,c=l.name,v=l.issuesNum,N=l.missingNum,h=l.isResolved,p=l.alert,f=function(s){return{alert:p,alertsNum:s===n.issue?v:N,alertState:s===n.issue?n.issue:n.missing,isMissingData:N>0,isIssueData:v>0}},j=f(n.issue),C=f(n.missing),g=t.Resolved;return a("div",s({className:u.assetWrapper},{children:[e("div",s({className:i(u.assetName,u.assetCell)},{children:c})),h?e("div",s({className:u.assetCell},{children:e("div",s({className:u.errorContainer},{children:e(g,{className:i(u.Resolved,u.alertIcon)})}))})):a(r,{children:[v>0&&e("div",s({className:u.assetCell},{children:e(m,s({anchorEl:d},j))})),N>0&&e("div",s({className:u.assetCell},{children:e(m,s({anchorEl:d},C))}))]})]}),o)}))}))};export{o as DQAccordionDetailsContent};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Alert, AlertState } from '~/components/StatusBadge/constants';
|
|
3
|
+
declare type DQAlertTooltipProps = {
|
|
4
|
+
alertsNum: number;
|
|
5
|
+
alertState: AlertState;
|
|
6
|
+
isMissingData: boolean;
|
|
7
|
+
isIssueData: boolean;
|
|
8
|
+
anchorEl: HTMLAnchorElement;
|
|
9
|
+
alert: Alert;
|
|
10
|
+
};
|
|
11
|
+
export declare const DQAlertTooltip: ({ alert, alertsNum, alertState, isMissingData, isIssueData, anchorEl }: DQAlertTooltipProps) => JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=DQAlertTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DQAlertTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAlertTooltip.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAE,UAAU,EAA6B,MAAM,oCAAoC,CAAC;AAIjG,aAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,2EAA4E,mBAAmB,KAAG,WAuB5H,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as s}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as r,jsxs as e}from"react/jsx-runtime";import i from"classnames";import{ALERT_STATES as a,ALERT_ICONS as t}from"../constants.js";import{DQAlertsTooltip as o}from"./DQAlertsTooltip.js";import{useDQUnvalidatedContentStyles as n}from"../styles.js";var l=function(l){var m,c=l.alert,p=l.alertsNum,d=l.alertState,f=l.isMissingData,h=l.isIssueData,u=l.anchorEl,N=n({}),g=t[d];return r(o,s({alert:f?s(s({},c),{state:a.missing}):c,anchorEl:u,alertIcon:r(g,{className:i(N[f?a.missing:d],N.alertIcon)}),isTooltipVisible:p>0},{children:e("div",s({className:i(N.errorContainer,(m={},m[N.missingContainer]=h&&d===a.missing,m))},{children:[r(g,{className:i(N[d],N.alertIcon)}),e("div",{children:[e("span",s({className:i(N[d],N.errorText)},{children:[d,": "]})),r("span",s({className:N.errorNum},{children:p}))]})]}))}))};export{l as DQAlertTooltip};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AssetData } from '~/components/StatusBadge/constants';
|
|
3
3
|
declare type DQUnvalidatedContentProps = {
|
|
4
|
-
assetsData?: AssetData
|
|
4
|
+
assetsData?: AssetData;
|
|
5
|
+
maxHeight?: number;
|
|
5
6
|
};
|
|
6
|
-
export declare const DQUnvalidatedContent: ({ assetsData }: DQUnvalidatedContentProps) => JSX.Element;
|
|
7
|
+
export declare const DQUnvalidatedContent: ({ assetsData, maxHeight }: DQUnvalidatedContentProps) => JSX.Element;
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=DQUnvalidatedContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DQUnvalidatedContent.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQUnvalidatedContent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DQUnvalidatedContent.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQUnvalidatedContent.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAK/D,aAAK,yBAAyB,GAAG;IAC/B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,oBAAoB,8BAA+B,yBAAyB,KAAG,WAwC3F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as a}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsxs as r,jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import i from"classnames";import{Typography as s,Accordion as o,AccordionSummary as c,AccordionDetails as n}from"@material-ui/core";import m from"@material-ui/icons/ExpandMore";import{truncateString as l}from"../../Search/utils/truncate.js";import{useDQUnvalidatedContentStyles as d}from"../styles.js";import{DQAccordionDetailsContent as u}from"./DQAccordionDetailsContent.js";var h=function(h){var p=h.assetsData,f=h.maxHeight,v=t(null),x=d({maxHeight:f});return r("div",a({className:x.container,ref:v},{children:[r("div",{children:[e(s,a({className:x.headerText,"data-testid":"Status_badge__DQ_unvalidated_content"},{children:"Data Quality"})),e(s,a({className:x.subheaderText},{children:"Fusion real-time data quality rules for app data"}))]}),e("div",a({className:x.relative},{children:e("div",a({className:x.accordionsWrapper},{children:Object.keys(p).map((function(t){var s=p[t];return r(o,a({className:x.accordion,defaultExpanded:!0},{children:[e(c,a({className:i("large","stretched"),expandIcon:e(m,{})},{children:l(t,{maxChars:40,charsNumFromStart:18,charsNumFromEnd:17})})),e(n,{children:e(u,{anchorEl:null==v?void 0:v.current,assets:s})})]}),t)}))}))}))]}))};export{h as DQUnvalidatedContent};
|
|
@@ -5,14 +5,17 @@ export declare const ALERT_ICONS: {
|
|
|
5
5
|
Issue: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
|
|
6
6
|
Resolved: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
|
|
7
7
|
};
|
|
8
|
+
declare type Issue = 'Issue';
|
|
9
|
+
declare type Missing = 'Missing';
|
|
10
|
+
export declare type AlertState = Issue | Missing;
|
|
8
11
|
export declare const ALERT_STATES: {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
issue: Issue;
|
|
13
|
+
missing: Missing;
|
|
11
14
|
};
|
|
12
15
|
export declare type Alert = {
|
|
13
16
|
name: string;
|
|
14
17
|
category: string;
|
|
15
|
-
state:
|
|
18
|
+
state: AlertState;
|
|
16
19
|
status: string;
|
|
17
20
|
isThrottled: boolean;
|
|
18
21
|
message: string;
|
|
@@ -20,7 +23,7 @@ export declare type Alert = {
|
|
|
20
23
|
statusUpdatedAt: number;
|
|
21
24
|
lastCheckedAt: number;
|
|
22
25
|
};
|
|
23
|
-
export declare type
|
|
26
|
+
export declare type AssetItem = {
|
|
24
27
|
name: string;
|
|
25
28
|
id: number;
|
|
26
29
|
issuesNum: number;
|
|
@@ -28,6 +31,7 @@ export declare type AssetData = {
|
|
|
28
31
|
isResolved?: boolean;
|
|
29
32
|
alert: Alert;
|
|
30
33
|
};
|
|
34
|
+
export declare type AssetData = Record<string, AssetItem[]>;
|
|
31
35
|
declare type BadgeIconStatuses = {
|
|
32
36
|
success: 'success';
|
|
33
37
|
warning: 'warning';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,oBAAY,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,oBAAY,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,aAAK,KAAK,GAAG,OAAO,CAAC;AACrB,aAAK,OAAO,GAAG,SAAS,CAAC;AAEzB,oBAAY,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAG1D,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,oBAAY,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpD,aAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAIjC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,OAAO,kEAAkE,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AssetData } from './constants';
|
|
3
3
|
declare type StatusBadgeProps = {
|
|
4
|
-
assetsData?: AssetData
|
|
4
|
+
assetsData?: AssetData;
|
|
5
5
|
appWidth: number;
|
|
6
6
|
className?: string;
|
|
7
|
+
DQIssueTooltipMaxHeight?: number;
|
|
7
8
|
iconType?: 'error' | 'success';
|
|
8
9
|
lastTimestamp: number;
|
|
9
10
|
onReportErrorClick?: (description: string) => void;
|
|
10
11
|
warningData?: Record<string, any>;
|
|
11
12
|
};
|
|
12
|
-
export declare const StatusBadge: ({ assetsData, appWidth, iconType, className, lastTimestamp, onReportErrorClick, warningData, }: StatusBadgeProps) => JSX.Element;
|
|
13
|
+
export declare const StatusBadge: ({ assetsData, appWidth, DQIssueTooltipMaxHeight, iconType, className, lastTimestamp, onReportErrorClick, warningData, }: StatusBadgeProps) => JSX.Element;
|
|
13
14
|
export {};
|
|
14
15
|
//# 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,EAIL,SAAS,EACV,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAIL,SAAS,EACV,MAAM,aAAa,CAAC;AA+ErB,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,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,WAAW,4HASrB,gBAAgB,KAAG,WA2ErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as a}from"react";import r from"moment";import i from"classnames";import{makeStyles as s,Typography as c}from"@material-ui/core";import{Tooltip as p}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import{WARNING as l,BADGE_ICON_STATUSES as m,MAX_MOBILE_WIDTH as d}from"./constants.js";import{DQStatusIcon as g}from"./components/DQStatusIcon.js";import{DQUnvalidatedContent as u}from"./components/DQUnvalidatedContent.js";import{DQSuccessContent as f}from"./components/DQSuccessContent.js";import{ReportIssueModal as x}from"./components/ReportIssueModal.js";var h=s((function(t){return{statusBadgeWrapper:{backgroundColor:t.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(t){var e=t.isSuccessTypeIcon,o=t.isErrorTypeIcon;return"12px 0 2px ".concat(e||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:{"& .MuiTooltip-tooltip":{maxWidth:
|
|
1
|
+
import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as a}from"react";import r from"moment";import i from"classnames";import{makeStyles as s,Typography as c}from"@material-ui/core";import{Tooltip as p}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import{WARNING as l,BADGE_ICON_STATUSES as m,MAX_MOBILE_WIDTH as d}from"./constants.js";import{DQStatusIcon as g}from"./components/DQStatusIcon.js";import{DQUnvalidatedContent as u}from"./components/DQUnvalidatedContent.js";import{DQSuccessContent as f}from"./components/DQSuccessContent.js";import{ReportIssueModal as x}from"./components/ReportIssueModal.js";var h=s((function(t){return{statusBadgeWrapper:{backgroundColor:t.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(t){var e=t.isSuccessTypeIcon,o=t.isErrorTypeIcon;return"12px 0 2px ".concat(e||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:{"& .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,borderRadius:12,"&:hover":{backgroundColor:function(t){var e=t.isErrorTypeIcon,o=t.isSuccessTypeIcon;return e?"rgba(244, 67, 54, 0.1)":o?"rgba(117, 219, 41, 0.2)":"transparent"}}}}})),b=function(s){var b,v=s.assetsData,y=void 0===v?{}:v,S=s.appWidth,I=s.DQIssueTooltipMaxHeight,T=s.iconType,w=s.className,D=s.lastTimestamp,_=s.onReportErrorClick,C=s.warningData,j=a(!1),W=j[0],N=j[1],Q=null==C?void 0:C.message,k=T==m.error,E=T==m.success,M=S<d,B=h({isIconExist:!!T,isSuccessTypeIcon:E,isErrorTypeIcon:k});k&&(b=e(u,{assetsData:y,maxHeight:I})),E&&(b=e(f,{onClick:function(){return N(!0)}}));return o("div",t({"data-testid":"Status_badge",className:i(B.statusBadgeWrapper,w)},{children:[o("div",t({className:B.statusBadgeContent},{children:[T&&e(p,t({leaveDelay:200,interactive:k||E,PopperProps:{className:B.popper},placement:"top-start",title:b},{children:e("div",t({className:B.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(T)},{children:e(g,{color:T,iconType:T})}))})),o(c,t({className:i(B.text,B.timestamp),variant:"body1"},{children:["Last Update: ",r.unix(D).format("M/D/YYYY h:mm a")]})),C&&o(n,{children:[e(p,t({placement:"top",title:Q?"".concat(l,". ").concat(Q):l},{children:e("div",t({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:e(g,{className:B.badgeIconWarning,color:m.warning,iconType:m.warning})}))})),!M&&e(c,t({className:i(B.text,B.warningMessage),variant:"body1"},{children:Q?"".concat(l,". ").concat(Q):l}))]})]})),E&&e(x,{open:W,onSave:function(t){_(t),N(!1)},onClose:function(){return N(!1)}})]}))};export{b as StatusBadge};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare type DQUnvalidatedContentStyleProps = {
|
|
2
|
+
maxHeight?: number;
|
|
3
|
+
};
|
|
4
|
+
export declare const useDQUnvalidatedContentStyles: (props: DQUnvalidatedContentStyleProps) => import("@material-ui/styles").ClassNameMap<string>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/styles.ts"],"names":[],"mappings":"AAEA,aAAK,8BAA8B,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,6BAA6B,+FAqFvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{alertIcon:{width:16,height:16},assetWrapper:{display:"table-row"},assetTable:{display:"table"},assetCell:{display:"table-cell",padding:"5px 0",verticalAlign:"middle",width:111},assetName:{fontSize:"12px",width:89},container:{padding:"12px 0 4px 12px"},headerText:{lineHeight:"19px",fontSize:"16px",fontWeight:500},subheaderText:{lineHeight:"14px",fontSize:"12px",fontWeight:400,marginRight:16,color:e.palette.primary.text7,marginTop:4},Issue:{color:"#ffa500"},Missing:{color:e.palette.error.main},Resolved:{color:e.palette.success.bright},errorContainer:{display:"flex",alignItems:"center",marginLeft:8,height:22},missingContainer:{marginLeft:0},errorText:{marginLeft:4,fontSize:"14px"},errorNum:{fontSize:"16px",marginLeft:4},accordion:{"&:not(:first-child)":{marginTop:"16px !important"},marginTop:"8px !important",color:e.palette.primary.contrastText,"& .MuiAccordionSummary-content":{fontWeight:"400 !important"}},accordionsWrapper:{maxHeight:function(e){var t=e.maxHeight;return t},overflowY:"auto",paddingRight:16,"&::before, &::after":{content:'""',width:"100%",height:16,position:"absolute",zIndex:1},"&::before":{background:"linear-gradient(180deg, ".concat(e.palette.background.b9," 18.23%, rgba(59, 59, 59, 0) 100%)"),opacity:.8,top:0},"&::after":{background:"linear-gradient(0deg, ".concat(e.palette.background.b9," 18.23%, rgba(59, 59, 59, 0) 100%)"),opacity:.8,bottom:0}},relative:{position:"relative",padding:"8px 0"}}}));export{t as useDQUnvalidatedContentStyles};
|