@corva/ui 0.56.0-2 → 0.56.0-3
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 +25 -15
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/cjs-bundle/components/StatusBadge/index.js +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.d.ts.map +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/components/StatusBadge/index.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -19,32 +19,42 @@ components - please also update it's `stories.js` file when it's necessary
|
|
|
19
19
|
|
|
20
20
|
- `yarn storybook` will launch local storybook server which is convenient to use for components testing when you work on public components. That's a playground for building public components.
|
|
21
21
|
- `yarn start` will open ExampleApp.js in your browser. That's a playground for building non-public components (such components will be moved from @corva/ui soon)
|
|
22
|
-
- To link this repo with your app, you should:
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
1. Run `yarn build` or `yarn build-watch` in @corva/ui repo (only first time)
|
|
26
|
-
2. Run `npm link dist` in @corva/ui repo root (only first time)
|
|
27
|
-
3. Run `npm link @corva/ui` in your app folder
|
|
23
|
+
## Link local `@corva/ui` to your app
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
1. Run `npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"`
|
|
31
|
-
2. Run `yarn build` or `yarn build-watch` in @corva/ui repo (only first time)
|
|
32
|
-
3. Run `npm link dist` in @corva/ui repo root (only first time)
|
|
33
|
-
4. Run `npm link @corva/ui` in your app folder
|
|
25
|
+
### Pre-requisite
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
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.
|
|
27
|
+
* Make sure you are using `@corva/ui` with latest updates from `development` branch
|
|
37
28
|
|
|
29
|
+
* If your app is using `getWebpackConfig` from `@corva/ui` instead of `@corva/dc-platform-shared`, migrate it according to [this guide](https://www.notion.so/corva/Migration-to-corva-dc-platform-shared-721cc822e23c4c43a7630b73fdeec3d9)
|
|
38
30
|
|
|
39
|
-
###
|
|
40
|
-
|
|
31
|
+
### Steps to link your local DC app**
|
|
32
|
+
|
|
33
|
+
1. Run `yarn build-dev` or `yarn build-watch` in @corva/ui repo
|
|
34
|
+
<br/>***Note:** `yarn build` will not work for linking*
|
|
35
|
+
|
|
36
|
+
2. `cd ./dist` and run `yarn link` in @corva/ui dist folder (only first time)
|
|
37
|
+
|
|
38
|
+
3. Run `yarn link @corva/ui` in your local DC app root folder
|
|
39
|
+
|
|
40
|
+
4. Run `yarn start` in your local DC app root folder
|
|
41
|
+
|
|
42
|
+
***Note:** npm link will not install @corva/ui dependencies in your node modules folder.*
|
|
43
|
+
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.
|
|
44
|
+
|
|
45
|
+
### Troubleshooting
|
|
46
|
+
|
|
47
|
+
#### Failed to compile.<br />`Module not found: Can't resolve '@corva/ui' in ...`
|
|
48
|
+
Most likely you need to [migrate to `@corva/dc-platform-shared`](https://www.notion.so/corva/Migration-to-corva-dc-platform-shared-721cc822e23c4c43a7630b73fdeec3d9) for cjs webpack config usage
|
|
49
|
+
|
|
50
|
+
#### Error.<br/>`Invalid hook call. Hooks can only be called inside of the body of a function component...`
|
|
41
51
|
|
|
42
52
|
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.
|
|
43
53
|
|
|
44
54
|
|
|
45
55
|
Or change the webpack configuration in config-overrides.js in your app. (Don't commit the changes of this file)
|
|
46
56
|
```
|
|
47
|
-
|
|
57
|
+
{
|
|
48
58
|
resolve: {
|
|
49
59
|
alias: {
|
|
50
60
|
react: path.resolve('./node_modules/react')
|
|
@@ -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"),i=require("@material-ui/core"),s=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var n=require("../constants.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(a),p=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},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:
|
|
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"),i=require("@material-ui/core"),s=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var n=require("../constants.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(a),p=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},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:8,width:270,minHeight:122,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,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4}}})),c=function(e){return o.default.unix(e).format("DD MMM HH:mm (Z)")},d=function(a){var i=a.children,s=p(),n=r.template(i)({timestampFormatter:c}).split("**").map((function(e,a){return a%2==1?t.jsx("b",{children:e}):e}));return t.jsx("span",e.__assign({className:s.message},{children:n}))};exports.DQAlertsTooltip=function(a){var r,i,l,c=a.alert,m=a.anchorEl,x=a.alertIcon,g=a.children,h=a.isTooltipVisible,u=p(),f=Math.max(c.statusUpdatedAt,c.lastCheckedAt),_=(void 0===l&&(l="MM/DD/YYYY HH:mm a"),(i=f)?o.default.unix(i).format(l):null);return t.jsx(s.Tooltip,{interactive:!0,children:g,PopperProps:{anchorEl:m,className:u.popover},placement:"right",title:h?t.jsxs(t.Fragment,{children:[t.jsx("div",e.__assign({className:u.title},{children:c.name})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Category:"})," ",c.category]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Status:"})," ",c.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:x})),t.jsx("span",e.__assign({className:c.state===n.ALERT_STATES.issue?n.BADGE_ICON_STATUSES.warning:n.BADGE_ICON_STATUSES.error},{children:c.state}))]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Score Deduction:"}),t.jsx("span",e.__assign({className:n.BADGE_ICON_STATUSES.warning},{children:"6%"}))]})),t.jsxs("div",e.__assign({className:u.alertMessageFull},{children:[c.isThrottled&&t.jsx("b",{children:"[Throttled]: "}),t.jsx(d,{children:c.message})]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",e.__assign({className:u.note},{children:"Note:"}))," ",(null===(r=c.note)||void 0===r?void 0:r.length)?c.note:"—"]})),t.jsxs("span",e.__assign({className:u.alertTime},{children:["Updated at: ",t.jsx("span",{children:_})]}))]}):""})};
|
|
@@ -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"),d=require("./components/ReportIssueModal.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=u(n),x=u(s),_=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":{maxWidth:455,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,u=n.assetsData,m=void 0===u?[]:u,S=n.appWidth,f=n.iconType,I=n.className,T=n.lastTimestamp,h=n.warningData,j=a.useState(!1),b=j[0],y=j[1],v=null==h?void 0:h.message,D=f==i.BADGE_ICON_STATUSES.error,N=f==i.BADGE_ICON_STATUSES.success,C=S<i.MAX_MOBILE_WIDTH,E=_({isIconExist:!!f,isSuccessTypeIcon:N,isErrorTypeIcon:D});return D&&(s=t.jsx(p.DQUnvalidatedContent,{assetsData:m})),N&&(s=t.jsx(l.DQSuccessContent,{onClick:function(){return y(!0)}})),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:x.default(E.statusBadgeWrapper,I)},{children:[t.jsxs("div",e.__assign({className:E.statusBadgeContent},{children:[f&&t.jsx(o.Tooltip,e.__assign({interactive:D||N,PopperProps:D&&{className:E.popper},placement:"top",title:s},{children:t.jsx("div",e.__assign({className:E.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(f)},{children:t.jsx(c.DQStatusIcon,{color:f,iconType:f})}))})),t.jsxs(r.Typography,e.__assign({className:x.default(E.text,E.timestamp),variant:"body1"},{children:["Last Update: ",g.default.unix(T).format("M/D/YYYY h:mm a")]})),h&&t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,e.__assign({placement:"top",title:v?"".concat(i.WARNING,". ").concat(v):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:E.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!C&&t.jsx(r.Typography,e.__assign({className:x.default(E.text,E.warningMessage),variant:"body1"},{children:v?"".concat(i.WARNING,". ").concat(v):i.WARNING}))]})]})),N&&t.jsx(d.ReportIssueModal,{open:b,onClose:function(){return y(!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"),d=require("./components/ReportIssueModal.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=u(n),x=u(s),_=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":{maxWidth:455,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,u=n.assetsData,m=void 0===u?[]:u,S=n.appWidth,f=n.iconType,I=n.className,T=n.lastTimestamp,h=n.warningData,j=a.useState(!1),b=j[0],y=j[1],v=null==h?void 0:h.message,D=f==i.BADGE_ICON_STATUSES.error,N=f==i.BADGE_ICON_STATUSES.success,C=S<i.MAX_MOBILE_WIDTH,E=_({isIconExist:!!f,isSuccessTypeIcon:N,isErrorTypeIcon:D});return D&&(s=t.jsx(p.DQUnvalidatedContent,{assetsData:m})),N&&(s=t.jsx(l.DQSuccessContent,{onClick:function(){return y(!0)}})),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:x.default(E.statusBadgeWrapper,I)},{children:[t.jsxs("div",e.__assign({className:E.statusBadgeContent},{children:[f&&t.jsx(o.Tooltip,e.__assign({interactive:D||N,PopperProps:D&&{className:E.popper},placement:"top-start",title:s},{children:t.jsx("div",e.__assign({className:E.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(f)},{children:t.jsx(c.DQStatusIcon,{color:f,iconType:f})}))})),t.jsxs(r.Typography,e.__assign({className:x.default(E.text,E.timestamp),variant:"body1"},{children:["Last Update: ",g.default.unix(T).format("M/D/YYYY h:mm a")]})),h&&t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,e.__assign({placement:"top",title:v?"".concat(i.WARNING,". ").concat(v):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:E.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!C&&t.jsx(r.Typography,e.__assign({className:x.default(E.text,E.warningMessage),variant:"body1"},{children:v?"".concat(i.WARNING,". ").concat(v):i.WARNING}))]})]})),N&&t.jsx(d.ReportIssueModal,{open:b,onClose:function(){return y(!1)}})]}))};
|
|
@@ -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;AAMrC,OAAO,EAAE,KAAK,EAAqC,MAAM,cAAc,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;AAMrC,OAAO,EAAE,KAAK,EAAqC,MAAM,cAAc,CAAC;AA6HxE,aAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,eAAe,+DAAgE,0BAA0B,KAAG,WA6CxH,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{Tooltip as l}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{ALERT_STATES as s,BADGE_ICON_STATUSES as p}from"../constants.js";var c=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},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:
|
|
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{Tooltip as l}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{ALERT_STATES as s,BADGE_ICON_STATUSES as p}from"../constants.js";var c=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},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:8,width:270,minHeight:122,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,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4}}})),m=function(e){return i.unix(e).format("DD MMM HH:mm (Z)")},d=function(r){var a=r.children,i=c(),n=o(a)({timestampFormatter:m}).split("**").map((function(e,r){return r%2==1?t("b",{children:e}):e}));return t("span",e({className:i.message},{children:n}))},h=function(o){var n,m,h,f=o.alert,g=o.anchorEl,x=o.alertIcon,u=o.children,b=o.isTooltipVisible,w=c(),v=Math.max(f.statusUpdatedAt,f.lastCheckedAt),y=(void 0===h&&(h="MM/DD/YYYY HH:mm a"),(m=v)?i.unix(m).format(h):null);return t(l,{interactive:!0,children:u,PopperProps:{anchorEl:g,className:w.popover},placement:"right",title:b?r(a,{children:[t("div",e({className:w.title},{children:f.name})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Category:"})," ",f.category]})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Status:"})," ",f.status]})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Error Type:"}),t("div",e({className:w.errorIcon},{children:x})),t("span",e({className:f.state===s.issue?p.warning:p.error},{children:f.state}))]})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Score Deduction:"}),t("span",e({className:p.warning},{children:"6%"}))]})),r("div",e({className:w.alertMessageFull},{children:[f.isThrottled&&t("b",{children:"[Throttled]: "}),t(d,{children:f.message})]})),r("span",e({className:w.alertInfo},{children:[t("span",e({className:w.note},{children:"Note:"}))," ",(null===(n=f.note)||void 0===n?void 0:n.length)?f.note:"—"]})),r("span",e({className:w.alertTime},{children:["Updated at: ",t("span",{children:y})]}))]}):""})};export{h as DQAlertsTooltip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o,Fragment as
|
|
1
|
+
import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n}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:455,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.iconType,T=s.className,w=s.lastTimestamp,_=s.warningData,D=n(!1),j=D[0],C=D[1],W=null==_?void 0:_.message,N=I==m.error,Q=I==m.success,k=S<d,E=h({isIconExist:!!I,isSuccessTypeIcon:Q,isErrorTypeIcon:N});return N&&(b=e(u,{assetsData:y})),Q&&(b=e(f,{onClick:function(){return C(!0)}})),o("div",t({"data-testid":"Status_badge",className:i(E.statusBadgeWrapper,T)},{children:[o("div",t({className:E.statusBadgeContent},{children:[I&&e(p,t({interactive:N||Q,PopperProps:N&&{className:E.popper},placement:"top-start",title:b},{children:e("div",t({className:E.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(I)},{children:e(g,{color:I,iconType:I})}))})),o(c,t({className:i(E.text,E.timestamp),variant:"body1"},{children:["Last Update: ",r.unix(w).format("M/D/YYYY h:mm a")]})),_&&o(a,{children:[e(p,t({placement:"top",title:W?"".concat(l,". ").concat(W):l},{children:e("div",t({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:e(g,{className:E.badgeIconWarning,color:m.warning,iconType:m.warning})}))})),!k&&e(c,t({className:i(E.text,E.warningMessage),variant:"body1"},{children:W?"".concat(l,". ").concat(W):l}))]})]})),Q&&e(x,{open:j,onClose:function(){return C(!1)}})]}))};export{b as StatusBadge};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corva/ui",
|
|
3
|
-
"version": "0.56.0-
|
|
3
|
+
"version": "0.56.0-3",
|
|
4
4
|
"description": "Shared components/utils for Corva ui projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"corva-ui"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"module": "./index.js",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "yarn generate-css-themes && ./scripts/build.sh production",
|
|
13
|
+
"build-dev": "yarn generate-css-themes && ./scripts/build.sh development",
|
|
13
14
|
"build-watch": "yarn generate-css-themes && ./scripts/build.sh development -w",
|
|
14
15
|
"get-changelog": "conventional-changelog -r 2 -p angular",
|
|
15
16
|
"lint": "eslint --cache ./src/",
|