@corva/ui 3.53.0-9 → 3.53.0

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.
Files changed (75) hide show
  1. package/assets/24e85195c257f1a487266abb9fc7a2bf.png +0 -0
  2. package/assets/573240ce4ae3f03b1dcda59a6122d385.png +0 -0
  3. package/assets/611a0b004a47e773eef650c39e484dde.png +0 -0
  4. package/assets/637021239e939e67a50264c22fdad2cf.png +0 -0
  5. package/assets/9fd5109325b72bf1dea0d2984b0478b8.png +0 -0
  6. package/assets/c901dbd37bce6a412f2c0f0ceecfea1d.png +0 -0
  7. package/cjs-bundle/components/AppIcon/assets/CompletionAppIcon.js +1 -1
  8. package/cjs-bundle/components/AppIcon/assets/CompletionAppIconBe.js +1 -1
  9. package/cjs-bundle/components/AppIcon/assets/DrillingAppIcon.js +1 -1
  10. package/cjs-bundle/components/AppIcon/assets/DrillingAppIconBe.js +1 -1
  11. package/cjs-bundle/components/AppIcon/assets/InterventionAppIcon.js +2 -0
  12. package/cjs-bundle/components/AppIcon/assets/InterventionAppIcon.js.map +1 -0
  13. package/cjs-bundle/components/AppIcon/assets/NoSegmentAppIcon.js +1 -1
  14. package/cjs-bundle/components/AppIcon/assets/NoSegmentAppIconBeIdle.js +1 -1
  15. package/cjs-bundle/components/AppIcon/utils.js +1 -1
  16. package/cjs-bundle/components/AppIcon/utils.js.map +1 -1
  17. package/cjs-bundle/components/Drillstring/DrillstringDetail/DrillstringDetail.js +1 -1
  18. package/cjs-bundle/components/Drillstring/DrillstringDetail/DrillstringDetail.js.map +1 -1
  19. package/cjs-bundle/components/FeedItem/feedItemTypes/BhaFeedItem/components/BhaSchematic.js +1 -1
  20. package/cjs-bundle/components/FeedItem/feedItemTypes/BhaFeedItem/components/BhaSchematic.js.map +1 -1
  21. package/cjs-bundle/components/FeedItem/feedItemTypes/BhaFeedItem/components/Info.js +1 -1
  22. package/cjs-bundle/components/FeedItem/feedItemTypes/BhaFeedItem/components/Info.js.map +1 -1
  23. package/cjs-bundle/components/FeedItem/feedItemTypes/FluidReportFeedItem.js +1 -1
  24. package/cjs-bundle/components/FeedItem/feedItemTypes/FluidReportFeedItem.js.map +1 -1
  25. package/cjs-bundle/components/FileUploadIconButton.js +1 -1
  26. package/cjs-bundle/components/FileUploadIconButton.js.map +1 -1
  27. package/cjs-bundle/components/UserMention/index.js +1 -1
  28. package/cjs-bundle/components/UserMention/index.js.map +1 -1
  29. package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
  30. package/components/AppIcon/assets/CompletionAppIcon.d.ts.map +1 -1
  31. package/components/AppIcon/assets/CompletionAppIcon.js +1 -1
  32. package/components/AppIcon/assets/CompletionAppIconBe.d.ts.map +1 -1
  33. package/components/AppIcon/assets/CompletionAppIconBe.js +1 -1
  34. package/components/AppIcon/assets/DrillingAppIcon.d.ts.map +1 -1
  35. package/components/AppIcon/assets/DrillingAppIcon.js +1 -1
  36. package/components/AppIcon/assets/DrillingAppIconBe.d.ts.map +1 -1
  37. package/components/AppIcon/assets/DrillingAppIconBe.js +1 -1
  38. package/components/AppIcon/assets/InterventionAppIcon.d.ts +4 -0
  39. package/components/AppIcon/assets/InterventionAppIcon.d.ts.map +1 -0
  40. package/components/AppIcon/assets/InterventionAppIcon.js +2 -0
  41. package/components/AppIcon/assets/InterventionAppIcon.js.map +1 -0
  42. package/components/AppIcon/assets/NoSegmentAppIcon.d.ts.map +1 -1
  43. package/components/AppIcon/assets/NoSegmentAppIcon.js +1 -1
  44. package/components/AppIcon/assets/NoSegmentAppIconBeIdle.d.ts.map +1 -1
  45. package/components/AppIcon/assets/NoSegmentAppIconBeIdle.js +1 -1
  46. package/components/AppIcon/utils.d.ts.map +1 -1
  47. package/components/AppIcon/utils.js +1 -1
  48. package/components/AppIcon/utils.js.map +1 -1
  49. package/components/Drillstring/DrillstringDetail/DrillstringDetail.d.ts +8 -4
  50. package/components/Drillstring/DrillstringDetail/DrillstringDetail.d.ts.map +1 -1
  51. package/components/Drillstring/DrillstringDetail/DrillstringDetail.js +1 -1
  52. package/components/Drillstring/DrillstringDetail/DrillstringDetail.js.map +1 -1
  53. package/components/FeedItem/feedItemTypes/BhaFeedItem/components/BhaSchematic.d.ts +1 -1
  54. package/components/FeedItem/feedItemTypes/BhaFeedItem/components/BhaSchematic.js +1 -1
  55. package/components/FeedItem/feedItemTypes/BhaFeedItem/components/BhaSchematic.js.map +1 -1
  56. package/components/FeedItem/feedItemTypes/BhaFeedItem/components/Info.js +1 -1
  57. package/components/FeedItem/feedItemTypes/BhaFeedItem/components/Info.js.map +1 -1
  58. package/components/FeedItem/feedItemTypes/FluidReportFeedItem.js +1 -1
  59. package/components/FeedItem/feedItemTypes/FluidReportFeedItem.js.map +1 -1
  60. package/components/FileUploadIconButton.d.ts +3 -1
  61. package/components/FileUploadIconButton.d.ts.map +1 -1
  62. package/components/FileUploadIconButton.js +1 -1
  63. package/components/FileUploadIconButton.js.map +1 -1
  64. package/components/UserMention/index.js +1 -1
  65. package/components/UserMention/index.js.map +1 -1
  66. package/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
  67. package/mcp-server/server.mjs +228 -2
  68. package/mcp-server/server.mjs.map +1 -1
  69. package/package.json +1 -1
  70. package/tsconfig.tsbuildinfo +1 -1
  71. package/assets/3f1e09e6e814329ccfc22c5f2fb49320.png +0 -0
  72. package/assets/747c045c9381addbc4c6aecd531ccbff.png +0 -0
  73. package/assets/9f235cc0306a992ec6aecee01ad6956b.png +0 -0
  74. package/assets/cc3725c7d2b2258f38e3e25e49ce0a53.png +0 -0
  75. package/assets/dad8511026615181e47069625c14a00d.png +0 -0
@@ -1,2 +1,2 @@
1
- import{useMemo as e}from"react";import{shape as i,number as t,string as r,arrayOf as n}from"prop-types";import a from"classnames";import{makeStyles as o,Grid as c,Typography as s}from"@material-ui/core";import d from"@material-ui/core/colors/blue";import{getUnitDisplay as l,convertValue as m}from"../../../utils/convert.js";import{ctop as u}from"../../../utils/FluidCheckUtils.js";import{jsxs as p,jsx as f}from"react/jsx-runtime";var y="fluidReportActivity",h=o((function(e){return{density:{color:d[300]},unit:{color:e.palette.grey[400],marginLeft:5},oneLineText:{display:"flex",alignItems:"center"},title:{color:e.palette.grey[400]},columnWithMargin:{marginRight:40}}})),v=function(i){var t=i.feedItem.context.fluid_report.data,r=t.depth,n=t.mud_type,o=t.mud_density,d=t.viscosity,v=d.pv,R=void 0===v?"":v,g=d.yp,q=void 0===g?"":g,N=d.rpm_readings,_=h(),x=u(r,"length","ft"),b=x?x.formatNumeral("0,0"):"-",F=l("length"),L=m(+o,"density","ppg").formatNumeral("0,0.00"),T=l("density"),j=l("yp"),P=Number.isFinite(R)?R.fixFloat(3):R,I=Number.isFinite(q)?q.fixFloat(3):q,M=e((function(){var e=N.length-1;return N.reduce((function(i,t,r){var n=r===e?"":", ",a="".concat(t.rpm,"/").concat(t.dial_reading);return"".concat(i).concat(a).concat(n)}),"")}),[N]);return p(c,{container:!0,spacing:"40",justify:"flex-start",children:[p(c,{item:!0,className:_.columnWithMargin,children:[f(s,{variant:"body2",children:"Density"}),p(s,{variant:"h6","data-testid":"".concat(y,"_density"),className:a(_.density,_.oneLineText),children:[L,p(s,{component:"span",variant:"caption",className:_.unit,children:["(",T,")"]})]}),p(s,{className:_.oneLineText,children:[b,p(s,{component:"span",variant:"caption",className:_.unit,children:["(",F,")"]})," / ",n]})]}),p(c,{item:!0,children:[p(s,{variant:"body2","data-testid":"".concat(y,"_viscosity"),className:_.oneLineText,children:[f(s,{variant:"span",className:_.title,children:"PV: "}),"".concat(P," ").concat("cP"," / YP: ").concat(I),f(s,{component:"span",variant:"caption",className:_.unit,children:j})]}),f(s,{variant:"body2",className:_.title,children:"Rheometer Readings (RPM/Dial Reading):"}),f(s,{variant:"body2","data-testid":"".concat(y,"_rheometerReadings"),children:M})]})]})};v.propTypes={feedItem:i({context:i({fluid_report:i({data:i({depth:t.isRequired,mud_type:r.isRequired,mud_density:t.isRequired,viscosity:i({pv:t.isRequired,yp:t.isRequired,rpm_readings:n(i({id:r.isRequired,dial_reading:t.isRequired,rpm:t.isRequired})).isRequired}).isRequired}).isRequired}).isRequired}).isRequired}).isRequired};export{v as default};
1
+ import{useMemo as e}from"react";import{shape as i,number as t,string as r,arrayOf as n}from"prop-types";import a from"classnames";import{makeStyles as o,Grid as c,Typography as s}from"@material-ui/core";import d from"@material-ui/core/colors/blue";import{getUnitDisplay as l,convertValue as m}from"../../../utils/convert.js";import{ctop as u}from"../../../utils/FluidCheckUtils.js";import{jsxs as p,jsx as f}from"react/jsx-runtime";var y="fluidReportActivity",h=o((function(e){return{density:{color:d[300]},unit:{color:e.palette.grey[400],marginLeft:5},oneLineText:{display:"flex",alignItems:"center"},title:{color:e.palette.grey[400]},columnWithMargin:{marginRight:40}}})),v=function(i){var t=i.feedItem.context.fluid_report.data,r=t.depth,n=t.mud_type,o=t.mud_density,d=t.viscosity,v=d.pv,R=void 0===v?"":v,g=d.yp,q=void 0===g?"":g,N=d.rpm_readings,_=h(),x=u(r,"length","ft"),b=x?x.formatNumeral("0,0"):"-",F=l("length"),L=m(+o,"density","ppg").formatNumeral("0,0.00"),T=l("density"),j=l("yp"),P=Number.isFinite(R)?R.fixFloat(3):R,I=Number.isFinite(q)?q.fixFloat(3):q,M=e((function(){var e=N.length-1;return N.reduce((function(i,t,r){var n=r===e?"":", ",a="".concat(t.rpm,"/").concat(t.dial_reading);return"".concat(i).concat(a).concat(n)}),"")}),[N]);return p(c,{container:!0,justify:"flex-start",children:[p(c,{item:!0,className:_.columnWithMargin,children:[f(s,{variant:"body2",children:"Density"}),p(s,{variant:"h6","data-testid":"".concat(y,"_density"),className:a(_.density,_.oneLineText),children:[L,p(s,{component:"span",variant:"caption",className:_.unit,children:["(",T,")"]})]}),p(s,{className:_.oneLineText,children:[b,p(s,{component:"span",variant:"caption",className:_.unit,children:["(",F,")"]})," / ",n]})]}),p(c,{item:!0,children:[p(s,{variant:"body2","data-testid":"".concat(y,"_viscosity"),className:_.oneLineText,children:[f(s,{variant:"span",className:_.title,children:"PV: "}),"".concat(P," ").concat("cP"," / YP: ").concat(I),f(s,{component:"span",variant:"caption",className:_.unit,children:j})]}),f(s,{variant:"body2",className:_.title,children:"Rheometer Readings (RPM/Dial Reading):"}),f(s,{variant:"body2","data-testid":"".concat(y,"_rheometerReadings"),children:M})]})]})};v.propTypes={feedItem:i({context:i({fluid_report:i({data:i({depth:t.isRequired,mud_type:r.isRequired,mud_density:t.isRequired,viscosity:i({pv:t.isRequired,yp:t.isRequired,rpm_readings:n(i({id:r.isRequired,dial_reading:t.isRequired,rpm:t.isRequired})).isRequired}).isRequired}).isRequired}).isRequired}).isRequired}).isRequired};export{v as default};
2
2
  //# sourceMappingURL=FluidReportFeedItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FluidReportFeedItem.js","sources":["../../../../src/components/FeedItem/feedItemTypes/FluidReportFeedItem.js"],"sourcesContent":["import { useMemo } from 'react';\nimport { shape, number, string, arrayOf } from 'prop-types';\nimport classNames from 'classnames';\nimport { Typography, Grid, makeStyles } from '@material-ui/core';\nimport blue from '@material-ui/core/colors/blue';\n\nimport { convertValue, getUnitDisplay } from '~/utils/convert';\nimport { ctop } from '~/utils/FluidCheckUtils';\n\nconst PAGE_NAME = 'fluidReportActivity';\n\nconst useStyles = makeStyles(theme => ({\n density: {\n color: blue[300],\n },\n unit: {\n color: theme.palette.grey[400],\n marginLeft: 5,\n },\n oneLineText: {\n display: 'flex',\n alignItems: 'center',\n },\n title: {\n color: theme.palette.grey[400],\n },\n columnWithMargin: {\n marginRight: 40,\n },\n}));\n\nconst FluidReportFeedItem = ({\n feedItem: {\n context: {\n fluid_report: {\n data: {\n depth: depthNotConverted,\n mud_type: mudType,\n mud_density: mudDensity,\n viscosity: { pv = '', yp = '', rpm_readings: rpmReadings },\n },\n },\n },\n },\n}) => {\n const classes = useStyles();\n\n const depth = ctop(depthNotConverted, 'length', 'ft');\n const depthString = depth ? depth.formatNumeral('0,0') : '-';\n const depthUnit = getUnitDisplay('length');\n\n const convertedMudDensity = convertValue(+mudDensity, 'density', 'ppg');\n const mudDensityFormatted = convertedMudDensity.formatNumeral('0,0.00');\n const densityUnit = getUnitDisplay('density');\n\n const pvUnit = 'cP';\n const ypUnit = getUnitDisplay('yp');\n const pvFormatted = Number.isFinite(pv) ? pv.fixFloat(3) : pv;\n const ypFormatted = Number.isFinite(yp) ? yp.fixFloat(3) : yp;\n\n const rheometerReadingsString = useMemo(() => {\n const rpmReadingsLastItemIndex = rpmReadings.length - 1;\n\n return rpmReadings.reduce((resultString, reading, index) => {\n const commaString = index === rpmReadingsLastItemIndex ? '' : ', ';\n const readingString = `${reading.rpm}/${reading.dial_reading}`;\n return `${resultString}${readingString}${commaString}`;\n }, '');\n }, [rpmReadings]);\n\n return (\n <Grid container spacing=\"40\" justify=\"flex-start\">\n <Grid item className={classes.columnWithMargin}>\n <Typography variant=\"body2\">Density</Typography>\n <Typography\n variant=\"h6\"\n data-testid={`${PAGE_NAME}_density`}\n className={classNames(classes.density, classes.oneLineText)}\n >\n {mudDensityFormatted}\n <Typography component=\"span\" variant=\"caption\" className={classes.unit}>\n ({densityUnit})\n </Typography>\n </Typography>\n <Typography className={classes.oneLineText}>\n {depthString}\n <Typography component=\"span\" variant=\"caption\" className={classes.unit}>\n ({depthUnit})\n </Typography>\n &nbsp;/ {mudType}\n </Typography>\n </Grid>\n <Grid item>\n <Typography\n variant=\"body2\"\n data-testid={`${PAGE_NAME}_viscosity`}\n className={classes.oneLineText}\n >\n <Typography variant=\"span\" className={classes.title}>\n PV:&nbsp;\n </Typography>\n {`${pvFormatted} ${pvUnit} / YP: ${ypFormatted}`}\n <Typography component=\"span\" variant=\"caption\" className={classes.unit}>\n {ypUnit}\n </Typography>\n </Typography>\n <Typography variant=\"body2\" className={classes.title}>\n Rheometer Readings (RPM/Dial Reading):\n </Typography>\n <Typography variant=\"body2\" data-testid={`${PAGE_NAME}_rheometerReadings`}>\n {rheometerReadingsString}\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\nFluidReportFeedItem.propTypes = {\n feedItem: shape({\n context: shape({\n fluid_report: shape({\n data: shape({\n depth: number.isRequired,\n mud_type: string.isRequired,\n mud_density: number.isRequired,\n viscosity: shape({\n pv: number.isRequired,\n yp: number.isRequired,\n rpm_readings: arrayOf(\n shape({\n id: string.isRequired,\n dial_reading: number.isRequired,\n rpm: number.isRequired,\n })\n ).isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n};\n\nexport default FluidReportFeedItem;\n"],"names":["PAGE_NAME","useStyles","makeStyles","theme","density","color","blue","unit","palette","grey","marginLeft","oneLineText","display","alignItems","title","columnWithMargin","marginRight","FluidReportFeedItem","_ref","_ref$feedItem$context","feedItem","context","fluid_report","data","depthNotConverted","depth","mudType","mud_type","mudDensity","mud_density","_ref$feedItem$context2","viscosity","_ref$feedItem$context3","pv","_ref$feedItem$context4","yp","rpmReadings","rpm_readings","classes","ctop","depthString","formatNumeral","depthUnit","getUnitDisplay","mudDensityFormatted","convertValue","densityUnit","ypUnit","pvFormatted","Number","isFinite","fixFloat","ypFormatted","rheometerReadingsString","useMemo","rpmReadingsLastItemIndex","length","reduce","resultString","reading","index","commaString","readingString","rpm","dial_reading","concat","_jsxs","Grid","container","spacing","justify","children","item","className","_jsx","Typography","variant","classNames","component","pvUnit","propTypes","shape","number","isRequired","string","arrayOf","id"],"mappings":"gbASA,IAAMA,EAAY,sBAEZC,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,MAAOC,EAAK,MAEdC,KAAM,CACJF,MAAOF,EAAMK,QAAQC,KAAK,KAC1BC,WAAY,GAEdC,YAAa,CACXC,QAAS,OACTC,WAAY,UAEdC,MAAO,CACLT,MAAOF,EAAMK,QAAQC,KAAK,MAE5BM,iBAAkB,CAChBC,YAAa,IAEhB,IAEKC,EAAsB,SAatBC,GAAA,IAAAC,EAAAD,EAZJE,SACEC,QACEC,aACEC,KACSC,IAAP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AU,CAACF,UAAWnC,EAAQ3B,YAAY4D,SACxC/B,CAAAA,EACD0B,EAACS,EAAU,CAACG,UAAU,OAAOF,QAAQ,UAAUH,UAAWnC,EAAQ/B,KAAKgE,SAAA,CAAA,IACnE7B,EAAS,aAEJhB,QAGbwC,EAACC,EAAI,CAACK,MAAI,EAAAD,SAAA,CACRL,EAACS,EAAU,CACTC,QAAQ,QACR,cAAA,GAAAX,OAAgBjE,EAAsB,cACtCyE,UAAWnC,EAAQ3B,YAAY4D,SAAA,CAE/BG,EAACC,EAAU,CAACC,QAAQ,OAAOH,UAAWnC,EAAQxB,MAAMyD,SAAA,SAEvC,GAAAN,OACTjB,EAAe+B,KAAAA,OA9CZ,uBA8C4B3B,GACnCsB,EAACC,EAAU,CAACG,UAAU,OAAOF,QAAQ,UAAUH,UAAWnC,EAAQ/B,KAAKgE,SACpExB,OAGL2B,EAACC,EAAU,CAACC,QAAQ,QAAQH,UAAWnC,EAAQxB,MAAMyD,SAAA,2CAGrDG,EAACC,EAAU,CAACC,QAAQ,QAAQ,cAAA,GAAAX,OAAgBjE,EAA8B,sBAAAuE,SACvElB,SAKX,EAEApC,EAAoB+D,UAAY,CAC9B5D,SAAU6D,EAAM,CACd5D,QAAS4D,EAAM,CACb3D,aAAc2D,EAAM,CAClB1D,KAAM0D,EAAM,CACVxD,MAAOyD,EAAOC,WACdxD,SAAUyD,EAAOD,WACjBtD,YAAaqD,EAAOC,WACpBpD,UAAWkD,EAAM,CACfhD,GAAIiD,EAAOC,WACXhD,GAAI+C,EAAOC,WACX9C,aAAcgD,EACZJ,EAAM,CACJK,GAAIF,EAAOD,WACXnB,aAAckB,EAAOC,WACrBpB,IAAKmB,EAAOC,cAEdA,aACDA,aACFA,aACFA,aACFA,aACFA"}
1
+ {"version":3,"file":"FluidReportFeedItem.js","sources":["../../../../src/components/FeedItem/feedItemTypes/FluidReportFeedItem.js"],"sourcesContent":["import { useMemo } from 'react';\nimport { shape, number, string, arrayOf } from 'prop-types';\nimport classNames from 'classnames';\nimport { Typography, Grid, makeStyles } from '@material-ui/core';\nimport blue from '@material-ui/core/colors/blue';\n\nimport { convertValue, getUnitDisplay } from '~/utils/convert';\nimport { ctop } from '~/utils/FluidCheckUtils';\n\nconst PAGE_NAME = 'fluidReportActivity';\n\nconst useStyles = makeStyles(theme => ({\n density: {\n color: blue[300],\n },\n unit: {\n color: theme.palette.grey[400],\n marginLeft: 5,\n },\n oneLineText: {\n display: 'flex',\n alignItems: 'center',\n },\n title: {\n color: theme.palette.grey[400],\n },\n columnWithMargin: {\n marginRight: 40,\n },\n}));\n\nconst FluidReportFeedItem = ({\n feedItem: {\n context: {\n fluid_report: {\n data: {\n depth: depthNotConverted,\n mud_type: mudType,\n mud_density: mudDensity,\n viscosity: { pv = '', yp = '', rpm_readings: rpmReadings },\n },\n },\n },\n },\n}) => {\n const classes = useStyles();\n\n const depth = ctop(depthNotConverted, 'length', 'ft');\n const depthString = depth ? depth.formatNumeral('0,0') : '-';\n const depthUnit = getUnitDisplay('length');\n\n const convertedMudDensity = convertValue(+mudDensity, 'density', 'ppg');\n const mudDensityFormatted = convertedMudDensity.formatNumeral('0,0.00');\n const densityUnit = getUnitDisplay('density');\n\n const pvUnit = 'cP';\n const ypUnit = getUnitDisplay('yp');\n const pvFormatted = Number.isFinite(pv) ? pv.fixFloat(3) : pv;\n const ypFormatted = Number.isFinite(yp) ? yp.fixFloat(3) : yp;\n\n const rheometerReadingsString = useMemo(() => {\n const rpmReadingsLastItemIndex = rpmReadings.length - 1;\n\n return rpmReadings.reduce((resultString, reading, index) => {\n const commaString = index === rpmReadingsLastItemIndex ? '' : ', ';\n const readingString = `${reading.rpm}/${reading.dial_reading}`;\n return `${resultString}${readingString}${commaString}`;\n }, '');\n }, [rpmReadings]);\n\n return (\n <Grid container justify=\"flex-start\">\n <Grid item className={classes.columnWithMargin}>\n <Typography variant=\"body2\">Density</Typography>\n <Typography\n variant=\"h6\"\n data-testid={`${PAGE_NAME}_density`}\n className={classNames(classes.density, classes.oneLineText)}\n >\n {mudDensityFormatted}\n <Typography component=\"span\" variant=\"caption\" className={classes.unit}>\n ({densityUnit})\n </Typography>\n </Typography>\n <Typography className={classes.oneLineText}>\n {depthString}\n <Typography component=\"span\" variant=\"caption\" className={classes.unit}>\n ({depthUnit})\n </Typography>\n &nbsp;/ {mudType}\n </Typography>\n </Grid>\n <Grid item>\n <Typography\n variant=\"body2\"\n data-testid={`${PAGE_NAME}_viscosity`}\n className={classes.oneLineText}\n >\n <Typography variant=\"span\" className={classes.title}>\n PV:&nbsp;\n </Typography>\n {`${pvFormatted} ${pvUnit} / YP: ${ypFormatted}`}\n <Typography component=\"span\" variant=\"caption\" className={classes.unit}>\n {ypUnit}\n </Typography>\n </Typography>\n <Typography variant=\"body2\" className={classes.title}>\n Rheometer Readings (RPM/Dial Reading):\n </Typography>\n <Typography variant=\"body2\" data-testid={`${PAGE_NAME}_rheometerReadings`}>\n {rheometerReadingsString}\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\nFluidReportFeedItem.propTypes = {\n feedItem: shape({\n context: shape({\n fluid_report: shape({\n data: shape({\n depth: number.isRequired,\n mud_type: string.isRequired,\n mud_density: number.isRequired,\n viscosity: shape({\n pv: number.isRequired,\n yp: number.isRequired,\n rpm_readings: arrayOf(\n shape({\n id: string.isRequired,\n dial_reading: number.isRequired,\n rpm: number.isRequired,\n })\n ).isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n }).isRequired,\n};\n\nexport default FluidReportFeedItem;\n"],"names":["PAGE_NAME","useStyles","makeStyles","theme","density","color","blue","unit","palette","grey","marginLeft","oneLineText","display","alignItems","title","columnWithMargin","marginRight","FluidReportFeedItem","_ref","_ref$feedItem$context","feedItem","context","fluid_report","data","depthNotConverted","depth","mudType","mud_type","mudDensity","mud_density","_ref$feedItem$context2","viscosity","_ref$feedItem$context3","pv","_ref$feedItem$context4","yp","rpmReadings","rpm_readings","classes","ctop","depthString","formatNumeral","depthUnit","getUnitDisplay","mudDensityFormatted","convertValue","densityUnit","ypUnit","pvFormatted","Number","isFinite","fixFloat","ypFormatted","rheometerReadingsString","useMemo","rpmReadingsLastItemIndex","length","reduce","resultString","reading","index","commaString","readingString","rpm","dial_reading","concat","_jsxs","Grid","container","justify","children","item","className","_jsx","Typography","variant","classNames","component","pvUnit","propTypes","shape","number","isRequired","string","arrayOf","id"],"mappings":"gbASA,IAAMA,EAAY,sBAEZC,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,MAAOC,EAAK,MAEdC,KAAM,CACJF,MAAOF,EAAMK,QAAQC,KAAK,KAC1BC,WAAY,GAEdC,YAAa,CACXC,QAAS,OACTC,WAAY,UAEdC,MAAO,CACLT,MAAOF,EAAMK,QAAQC,KAAK,MAE5BM,iBAAkB,CAChBC,YAAa,IAEhB,IAEKC,EAAsB,SAatBC,GAAA,IAAAC,EAAAD,EAZJE,SACEC,QACEC,aACEC,KACSC,IAAPC,MACUC,IAAVC,SACaC,IAAbC,YAAWC,EAAAX,EACXY,UAASC,EAAAF,EAAIG,GAAAA,aAAK,GAAED,EAAAE,EAAAJ,EAAEK,GAAAA,aAAK,GAAED,EAAgBE,IAAdC,aAMjCC,EAAUrC,IAEVwB,EAAQc,EAAKf,EAAmB,SAAU,MAC1CgB,EAAcf,EAAQA,EAAMgB,cAAc,OAAS,IACnDC,EAAYC,EAAe,UAG3BC,EADsBC,GAAcjB,EAAY,UAAW,OACjBa,cAAc,UACxDK,EAAcH,EAAe,WAG7BI,EAASJ,EAAe,MACxBK,EAAcC,OAAOC,SAASjB,GAAMA,EAAGkB,SAAS,GAAKlB,EACrDmB,EAAcH,OAAOC,SAASf,GAAMA,EAAGgB,SAAS,GAAKhB,EAErDkB,EAA0BC,GAAQ,WACtC,IAAMC,EAA2BnB,EAAYoB,OAAS,EAEtD,OAAOpB,EAAYqB,QAAO,SAACC,EAAcC,EAASC,GAChD,IAAMC,EAAcD,IAAUL,EAA2B,GAAK,KACxDO,Y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Q,QAAQ,cAAA,GAAAV,OAAgBjE,EAA8B,sBAAAsE,SACvEjB,SAKX,EAEApC,EAAoB8D,UAAY,CAC9B3D,SAAU4D,EAAM,CACd3D,QAAS2D,EAAM,CACb1D,aAAc0D,EAAM,CAClBzD,KAAMyD,EAAM,CACVvD,MAAOwD,EAAOC,WACdvD,SAAUwD,EAAOD,WACjBrD,YAAaoD,EAAOC,WACpBnD,UAAWiD,EAAM,CACf/C,GAAIgD,EAAOC,WACX/C,GAAI8C,EAAOC,WACX7C,aAAc+C,EACZJ,EAAM,CACJK,GAAIF,EAAOD,WACXlB,aAAciB,EAAOC,WACrBnB,IAAKkB,EAAOC,cAEdA,aACDA,aACFA,aACFA,aACFA,aACFA"}
@@ -25,7 +25,7 @@ declare class FileUploadIconButton extends PureComponent<any, any, any> {
25
25
  declare namespace FileUploadIconButton {
26
26
  namespace propTypes {
27
27
  let additionalFields: PropTypes.Requireable<PropTypes.ReactNodeLike[]>;
28
- let classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
28
+ let classes: PropTypes.Requireable<PropTypes.InferProps<{}>>;
29
29
  let tooltipProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
30
30
  let disableRipple: PropTypes.Requireable<boolean>;
31
31
  let disabled: PropTypes.Requireable<boolean>;
@@ -41,6 +41,8 @@ declare namespace FileUploadIconButton {
41
41
  namespace defaultProps {
42
42
  let additionalFields_1: never[];
43
43
  export { additionalFields_1 as additionalFields };
44
+ let classes_1: {};
45
+ export { classes_1 as classes };
44
46
  let disableRipple_1: boolean;
45
47
  export { disableRipple_1 as disableRipple };
46
48
  let disabled_1: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadIconButton.d.ts","sourceRoot":"","sources":["../../src/components/FileUploadIconButton.js"],"names":[],"mappings":"AAeA,2CAA4C,yBAAyB,CAAC;;AAEtE;IACE,wBAgBC;IAbC;;;;;;;MAUC;IAED,0CAA4B;IAG9B,8BAcE;IAEF,UAAU,uBAAkB,UAG1B;IAEF,eAAsB,SAAI,EAAE,aAAQ,mBA4BlC;IAEF,aAAc,SAAI,EAAE,SAAI,UAEtB;IAEF,aAAa,UAAK,UAqBhB;IAEF,oBAKC;IAED,+CAEE;IAEF,cAAe,YAAO,EAAE,aAAQ,EAAE,aAAQ,UAMxC;IAEF,kCA2BC;IAED,sBAwBC;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA3LwC,OAAO;sBAC1B,YAAY"}
1
+ {"version":3,"file":"FileUploadIconButton.d.ts","sourceRoot":"","sources":["../../src/components/FileUploadIconButton.js"],"names":[],"mappings":"AAeA,2CAA4C,yBAAyB,CAAC;;AAEtE;IACE,wBAgBC;IAbC;;;;;;;MAUC;IAED,0CAA4B;IAG9B,8BAcE;IAEF,UAAU,uBAAkB,UAG1B;IAEF,eAAsB,SAAI,EAAE,aAAQ,mBA4BlC;IAEF,aAAc,SAAI,EAAE,SAAI,UAEtB;IAEF,aAAa,UAAK,UAqBhB;IAEF,oBAKC;IAED,+CAEE;IAEF,cAAe,YAAO,EAAE,aAAQ,EAAE,aAAQ,UAMxC;IAEF,kCA2BC;IAED,sBAwBC;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA3LwC,OAAO;sBAC1B,YAAY"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import i from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/regenerator";import{createRef as p,PureComponent as u}from"react";import d from"prop-types";import c from"react-s3-uploader/s3upload";import f from"@material-ui/core/CircularProgress";import h from"@material-ui/icons/PhotoCamera";import m from"./PostPreviewDialog/index.js";import b from"./Icons/AttachIcon.js";import g from"./IconButton/index.js";import{getS3DownloadLink as F,getS3SignedUrl as v}from"../clients/jsonApi/index.js";import{isNativeDetected as U}from"../utils/mobileDetect.js";import{jsxs as P,jsx as y,Fragment as S}from"react/jsx-runtime";function O(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function w(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?O(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function j(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,i=l(e);if(r){var o=l(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return n(this,t)}}var D="data-file-upload-button",I=function(n){o(d,u);var l=j(d);function d(t){var o,n;return r(this,d),o=l.call(this,t),a(i(o),"onFinish",e(s.mark((function e(){var r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(o.state.s3FileName);case 2:r=e.sent,o.setState({currentUpload:null,uploadingFileToS3:!1,openFileUploadPreviewDialog:o.props.openPreviewDialogOnUpload,s3FileUrl:r.url},(function(){o.props.onFinish&&o.props.onFinish(o.state.s3FileUrl,o.state.s3FileName,o.state.s3FileSize)}));case 4:case"end":return e.stop()}}),e)})))),a(i(o),"onError",(function(e){o.props.onError&&o.props.onError(e),console.error(e)})),a(i(o),"getSignedUrl",(n=e(s.mark((function e(r,t){var i;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v(r.name,r.type);case 3:i=e.sent,e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),o.setState({uploadingFileToS3:null,currentUpload:null},(function(){o.onError(e.t0.message)})),e.abrupt("return");case 10:o.setState({s3FileUrl:i.signed_url,s3FileName:i.file_name,s3FileSize:r.size}),t(w(w({},i),{},{signedUrl:i.signed_url}));case 12:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,r){return n.apply(this,arguments)})),a(i(o),"preprocess",(function(e,r){r(e)})),a(i(o),"uploadFile",(function(e){if(e.target.files[0]){o.clearUpload();var r=new c({fileElement:o.fileInput.current,getSignedUrl:o.getSignedUrl,preprocess:o.preprocess,onProgress:function(){},onFinishS3Put:o.onFinish,onError:o.onError});o.setState({uploadingFileToS3:!0,currentUpload:{uploader:r}})}})),a(i(o),"handleCloseFileUploadPreviewDialog",(function(){o.setState({openFileUploadPreviewDialog:!1})})),a(i(o),"handleShare",(function(e,r,t){o.setState({openFileUploadPreviewDialog:!1},(function(){o.props.handleShare&&o.props.handleShare(e,r,t)}))})),o.state={currentUpload:null,s3FileUrl:null,s3FileName:null,s3FileSize:null,uploadingFileToS3:!1,openFileUploadPreviewDialog:!1},o.fileInput=p(),o}return t(d,[{key:"clearUpload",value:function(){var e=this.state.currentUpload;e&&e.uploader&&e.uploader.abortUpload()}},{key:"renderUploadButton",value:function(){var e=U?h:b,r=a({},"data-file-upload-button","");return P("label",w(w({htmlFor:this.props.inputId},r),{},{children:[y("input",{ref:this.fileInput,id:this.props.inputId,type:"file",disabled:this.props.disabled,onChange:this.uploadFile,style:{display:"none"}}),y(g,{"data-testid":"".concat("fileUpload","_attachFileButton"),"aria-label":"File Upload",disabled:this.props.disabled,component:this.props.disabled?"button":"span",className:this.props.fileUploadIconClassName,disableRipple:this.props.disableRipple,tooltipProps:this.props.tooltipProps,children:y(e,{})})]}))}},{key:"render",value:function(){return P(S,{children:[this.state.uploadingFileToS3?y(f,{"data-testid":"generic_uploadProgress",size:18}):this.renderUploadButton(),this.state.openFileUploadPreviewDialog&&y(m,{open:this.state.openFileUploadPreviewDialog,fileUrl:this.state.s3FileUrl,fileName:this.state.s3FileName,fileSize:this.state.s3FileSize,handleShare:this.handleShare,handleClose:this.handleCloseFileUploadPreviewDialog,additionalFields:this.props.additionalFields,requiredFields:this.props.requiredFields,message:this.props.message})]})}}]),d}();I.propTypes={additionalFields:d.arrayOf(d.node),classes:d.shape({}).isRequired,tooltipProps:d.shape({}),disableRipple:d.bool,disabled:d.bool,fileUploadIconClassName:d.string,handleShare:d.func,inputId:d.string,message:d.string,onError:d.func,onFinish:d.func,openPreviewDialogOnUpload:d.bool,requiredFields:d.arrayOf(d.string)},I.defaultProps={additionalFields:[],disableRipple:!1,disabled:!1,fileUploadIconClassName:void 0,handleShare:void 0,inputId:"icon-button-file",message:void 0,onError:void 0,onFinish:void 0,openPreviewDialogOnUpload:!0,requiredFields:[],tooltipProps:{title:"Attach File"}};export{D as FILE_UPLOAD_BUTTON_DATA_ATTR,I as default};
1
+ import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/regenerator";import{createRef as p,PureComponent as u}from"react";import d from"prop-types";import c from"react-s3-uploader/s3upload";import f from"@material-ui/core/CircularProgress";import h from"@material-ui/icons/PhotoCamera";import m from"./PostPreviewDialog/index.js";import b from"./Icons/AttachIcon.js";import g from"./IconButton/index.js";import{getS3DownloadLink as F,getS3SignedUrl as v}from"../clients/jsonApi/index.js";import{isNativeDetected as U}from"../utils/mobileDetect.js";import{jsxs as P,jsx as y,Fragment as S}from"react/jsx-runtime";function O(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function w(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?O(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function j(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,o=l(e);if(r){var i=l(this).constructor;t=Reflect.construct(o,arguments,i)}else t=o.apply(this,arguments);return n(this,t)}}var D="data-file-upload-button",I=function(n){i(d,u);var l=j(d);function d(t){var i,n;return r(this,d),i=l.call(this,t),a(o(i),"onFinish",e(s.mark((function e(){var r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(i.state.s3FileName);case 2:r=e.sent,i.setState({currentUpload:null,uploadingFileToS3:!1,openFileUploadPreviewDialog:i.props.openPreviewDialogOnUpload,s3FileUrl:r.url},(function(){i.props.onFinish&&i.props.onFinish(i.state.s3FileUrl,i.state.s3FileName,i.state.s3FileSize)}));case 4:case"end":return e.stop()}}),e)})))),a(o(i),"onError",(function(e){i.props.onError&&i.props.onError(e),console.error(e)})),a(o(i),"getSignedUrl",(n=e(s.mark((function e(r,t){var o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v(r.name,r.type);case 3:o=e.sent,e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),i.setState({uploadingFileToS3:null,currentUpload:null},(function(){i.onError(e.t0.message)})),e.abrupt("return");case 10:i.setState({s3FileUrl:o.signed_url,s3FileName:o.file_name,s3FileSize:r.size}),t(w(w({},o),{},{signedUrl:o.signed_url}));case 12:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,r){return n.apply(this,arguments)})),a(o(i),"preprocess",(function(e,r){r(e)})),a(o(i),"uploadFile",(function(e){if(e.target.files[0]){i.clearUpload();var r=new c({fileElement:i.fileInput.current,getSignedUrl:i.getSignedUrl,preprocess:i.preprocess,onProgress:function(){},onFinishS3Put:i.onFinish,onError:i.onError});i.setState({uploadingFileToS3:!0,currentUpload:{uploader:r}})}})),a(o(i),"handleCloseFileUploadPreviewDialog",(function(){i.setState({openFileUploadPreviewDialog:!1})})),a(o(i),"handleShare",(function(e,r,t){i.setState({openFileUploadPreviewDialog:!1},(function(){i.props.handleShare&&i.props.handleShare(e,r,t)}))})),i.state={currentUpload:null,s3FileUrl:null,s3FileName:null,s3FileSize:null,uploadingFileToS3:!1,openFileUploadPreviewDialog:!1},i.fileInput=p(),i}return t(d,[{key:"clearUpload",value:function(){var e=this.state.currentUpload;e&&e.uploader&&e.uploader.abortUpload()}},{key:"renderUploadButton",value:function(){var e=U?h:b,r=a({},"data-file-upload-button","");return P("label",w(w({htmlFor:this.props.inputId},r),{},{children:[y("input",{ref:this.fileInput,id:this.props.inputId,type:"file",disabled:this.props.disabled,onChange:this.uploadFile,style:{display:"none"}}),y(g,{"data-testid":"".concat("fileUpload","_attachFileButton"),"aria-label":"File Upload",disabled:this.props.disabled,component:this.props.disabled?"button":"span",className:this.props.fileUploadIconClassName,disableRipple:this.props.disableRipple,tooltipProps:this.props.tooltipProps,children:y(e,{})})]}))}},{key:"render",value:function(){return P(S,{children:[this.state.uploadingFileToS3?y(f,{"data-testid":"generic_uploadProgress",size:18}):this.renderUploadButton(),this.state.openFileUploadPreviewDialog&&y(m,{open:this.state.openFileUploadPreviewDialog,fileUrl:this.state.s3FileUrl,fileName:this.state.s3FileName,fileSize:this.state.s3FileSize,handleShare:this.handleShare,handleClose:this.handleCloseFileUploadPreviewDialog,additionalFields:this.props.additionalFields,requiredFields:this.props.requiredFields,message:this.props.message})]})}}]),d}();I.propTypes={additionalFields:d.arrayOf(d.node),classes:d.shape({}),tooltipProps:d.shape({}),disableRipple:d.bool,disabled:d.bool,fileUploadIconClassName:d.string,handleShare:d.func,inputId:d.string,message:d.string,onError:d.func,onFinish:d.func,openPreviewDialogOnUpload:d.bool,requiredFields:d.arrayOf(d.string)},I.defaultProps={additionalFields:[],classes:{},disableRipple:!1,disabled:!1,fileUploadIconClassName:void 0,handleShare:void 0,inputId:"icon-button-file",message:void 0,onError:void 0,onFinish:void 0,openPreviewDialogOnUpload:!0,requiredFields:[],tooltipProps:{title:"Attach File"}};export{D as FILE_UPLOAD_BUTTON_DATA_ATTR,I as default};
2
2
  //# sourceMappingURL=FileUploadIconButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadIconButton.js","sources":["../../src/components/FileUploadIconButton.js"],"sourcesContent":["import { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport S3Upload from 'react-s3-uploader/s3upload';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport PhotoCameraIcon from '@material-ui/icons/PhotoCamera';\n\nimport PostPreviewDialog from '~components/PostPreviewDialog';\nimport AttachIcon from '~components/Icons/AttachIcon';\nimport IconButton from '~components/IconButton';\nimport { getS3SignedUrl, getS3DownloadLink } from '~/clients/jsonApi';\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'fileUpload';\n\n// Data attr helps to identify the select file action; Is used to prevent the tooltip from closing\nexport const FILE_UPLOAD_BUTTON_DATA_ATTR = 'data-file-upload-button';\n\nclass FileUploadIconButton extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n currentUpload: null,\n\n s3FileUrl: null,\n s3FileName: null,\n s3FileSize: null,\n\n uploadingFileToS3: false,\n\n openFileUploadPreviewDialog: false,\n };\n\n this.fileInput = createRef();\n }\n\n onFinish = async () => {\n const s3DownloadLinkResponse = await getS3DownloadLink(this.state.s3FileName);\n this.setState(\n {\n currentUpload: null,\n uploadingFileToS3: false,\n openFileUploadPreviewDialog: this.props.openPreviewDialogOnUpload,\n s3FileUrl: s3DownloadLinkResponse.url,\n },\n () => {\n if (this.props.onFinish)\n this.props.onFinish(this.state.s3FileUrl, this.state.s3FileName, this.state.s3FileSize);\n }\n );\n };\n\n onError = fileUploadingError => {\n if (this.props.onError) this.props.onError(fileUploadingError);\n console.error(fileUploadingError);\n };\n\n getSignedUrl = async (file, callback) => {\n let data;\n try {\n data = await getS3SignedUrl(file.name, file.type);\n } catch (e) {\n this.setState(\n {\n uploadingFileToS3: null,\n currentUpload: null,\n },\n () => {\n this.onError(e.message);\n }\n );\n return;\n }\n\n this.setState({\n s3FileUrl: data.signed_url,\n s3FileName: data.file_name,\n s3FileSize: file.size,\n });\n\n // NOTE: Add node for 'signedUrl' which is the expected name by uploader component\n callback({\n ...data,\n signedUrl: data.signed_url,\n });\n };\n\n preprocess = (file, next) => {\n next(file);\n };\n\n uploadFile = event => {\n if (!event.target.files[0]) {\n return;\n }\n\n this.clearUpload();\n const uploader = new S3Upload({\n fileElement: this.fileInput.current,\n getSignedUrl: this.getSignedUrl,\n preprocess: this.preprocess,\n onProgress: () => {}, // NOTE: Prevents logging to console\n onFinishS3Put: this.onFinish,\n onError: this.onError,\n });\n\n this.setState({\n uploadingFileToS3: true,\n currentUpload: {\n uploader,\n },\n });\n };\n\n clearUpload() {\n const { currentUpload } = this.state;\n if (currentUpload && currentUpload.uploader) {\n currentUpload.uploader.abortUpload();\n }\n }\n\n handleCloseFileUploadPreviewDialog = () => {\n this.setState({ openFileUploadPreviewDialog: false });\n };\n\n handleShare = (comment, fileName, fileSize) => {\n this.setState({ openFileUploadPreviewDialog: false }, () => {\n if (this.props.handleShare) {\n this.props.handleShare(comment, fileName, fileSize);\n }\n });\n };\n\n renderUploadButton() {\n const Icon = isNativeDetected ? PhotoCameraIcon : AttachIcon;\n const labelDataAttributes = { [FILE_UPLOAD_BUTTON_DATA_ATTR]: '' };\n\n return (\n <label htmlFor={this.props.inputId} {...labelDataAttributes}>\n <input\n ref={this.fileInput}\n id={this.props.inputId}\n type=\"file\"\n disabled={this.props.disabled}\n onChange={this.uploadFile}\n style={{ display: 'none' }}\n />\n <IconButton\n data-testid={`${PAGE_NAME}_attachFileButton`}\n aria-label=\"File Upload\"\n disabled={this.props.disabled}\n component={this.props.disabled ? 'button' : 'span'}\n className={this.props.fileUploadIconClassName}\n disableRipple={this.props.disableRipple}\n tooltipProps={this.props.tooltipProps}\n >\n <Icon />\n </IconButton>\n </label>\n );\n }\n\n render() {\n return (\n <>\n {this.state.uploadingFileToS3 ? (\n <CircularProgress data-testid=\"generic_uploadProgress\" size={18} />\n ) : (\n this.renderUploadButton()\n )}\n\n {this.state.openFileUploadPreviewDialog && (\n <PostPreviewDialog\n open={this.state.openFileUploadPreviewDialog}\n fileUrl={this.state.s3FileUrl}\n fileName={this.state.s3FileName}\n fileSize={this.state.s3FileSize}\n handleShare={this.handleShare}\n handleClose={this.handleCloseFileUploadPreviewDialog}\n additionalFields={this.props.additionalFields}\n requiredFields={this.props.requiredFields}\n message={this.props.message}\n />\n )}\n </>\n );\n }\n}\n\nFileUploadIconButton.propTypes = {\n additionalFields: PropTypes.arrayOf(PropTypes.node),\n classes: PropTypes.shape({}).isRequired,\n tooltipProps: PropTypes.shape({}),\n disableRipple: PropTypes.bool,\n disabled: PropTypes.bool,\n fileUploadIconClassName: PropTypes.string,\n handleShare: PropTypes.func,\n inputId: PropTypes.string,\n message: PropTypes.string,\n onError: PropTypes.func,\n onFinish: PropTypes.func,\n openPreviewDialogOnUpload: PropTypes.bool,\n requiredFields: PropTypes.arrayOf(PropTypes.string),\n};\n\nFileUploadIconButton.defaultProps = {\n additionalFields: [],\n disableRipple: false,\n disabled: false,\n fileUploadIconClassName: undefined,\n handleShare: undefined,\n inputId: 'icon-button-file',\n message: undefined,\n onError: undefined,\n onFinish: undefined,\n openPreviewDialogOnUpload: true,\n requiredFields: [],\n tooltipProps: { title: 'Attach File' },\n};\n\nexport default FileUploadIconButton;\n"],"names":["FILE_UPLOAD_BUTTON_DATA_ATTR","FileUploadIconButton","_PureComponent","_inherits","PureComponent","_super","_createSuper","props","_this","_ref2","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","_asyncToGenerator","_regeneratorRuntime","mark","_callee","s3DownloadLinkResponse","wrap","_context","prev","next","getS3DownloadLink","state","s3FileName","sent","setState","currentUpload","uploadingFileToS3","openFileUploadPreviewDialog","openPreviewDialogOnUpload","s3FileUrl","url","onFinish","s3FileSize","stop","fileUploadingError","onError","console","error","_callee2","file","callback","data","_context2","getS3SignedUrl","name","type","t0","message","abrupt","signed_url","file_name","size","signedUrl","_x","_x2","apply","arguments","event","target","files","clearUpload","uploader","S3Upload","fileElement","fileInput","current","getSignedUrl","preprocess","onProgress","onFinishS3Put","comment","fileName","fileSize","handleShare","createRef","_createClass","key","value","abortUpload","Icon","isNativeDetected","PhotoCameraIcon","AttachIcon","labelDataAttributes","_jsxs","_objectSpread","htmlFor","inputId","children","_jsx","ref","id","disabled","onChange","uploadFile","style","display","IconButton","concat","component","className","fileUploadIconClassName","disableRipple","tooltipProps","_Fragment","CircularProgress","renderUploadButton","PostPreviewDialog","open","fileUrl","handleClose","handleCloseFileUploadPreviewDialog","additionalFields","requiredFields","propTypes","PropTypes","arrayOf","node","classes","shape","isRequired","bool","string","func","defaultProps","undefined","title"],"mappings":"k+DAYA,IAGaA,EAA+B,0BAEtCC,EAAoB,SAAAC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GACxB,SAAAA,EAAYM,GAAO,IAAAC,EAuCJC,EAxBgB,OAfZC,EAAAC,KAAAV,GACjBO,EAAAH,EAAAO,KAAAD,KAAMJ,GAAOM,EAiBJC,EAAAN,GAAA,WAAAO,EAAAC,EAAAC,MAAA,SAAAC,IAAA,IAAAC,EAAA,OAAAH,EAAAI,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAA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UM,KACzB7B,SAAUuB,EAAUM,KACpBpB,wBAAyBc,EAAUO,OACnCjD,YAAa0C,EAAUQ,KACvBpC,QAAS4B,EAAUO,OACnB3E,QAASoE,EAAUO,OACnBvF,QAASgF,EAAUQ,KACnB5F,SAAUoF,EAAUQ,KACpB/F,0BAA2BuF,EAAUM,KACrCR,eAAgBE,EAAUC,QAAQD,EAAUO,SAG9C7H,EAAqB+H,aAAe,CAClCZ,iBAAkB,GAClBV,eAAe,EACfV,UAAU,EACVS,6BAAyBwB,EACzBpD,iBAAaoD,EACbtC,QAAS,mBACTxC,aAAS8E,EACT1F,aAAS0F,EACT9F,cAAU8F,EACVjG,2BAA2B,EAC3BqF,eAAgB,GAChBV,aAAc,CAAEuB,MAAO"}
1
+ {"version":3,"file":"FileUploadIconButton.js","sources":["../../src/components/FileUploadIconButton.js"],"sourcesContent":["import { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport S3Upload from 'react-s3-uploader/s3upload';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport PhotoCameraIcon from '@material-ui/icons/PhotoCamera';\n\nimport PostPreviewDialog from '~components/PostPreviewDialog';\nimport AttachIcon from '~components/Icons/AttachIcon';\nimport IconButton from '~components/IconButton';\nimport { getS3SignedUrl, getS3DownloadLink } from '~/clients/jsonApi';\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'fileUpload';\n\n// Data attr helps to identify the select file action; Is used to prevent the tooltip from closing\nexport const FILE_UPLOAD_BUTTON_DATA_ATTR = 'data-file-upload-button';\n\nclass FileUploadIconButton extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n currentUpload: null,\n\n s3FileUrl: null,\n s3FileName: null,\n s3FileSize: null,\n\n uploadingFileToS3: false,\n\n openFileUploadPreviewDialog: false,\n };\n\n this.fileInput = createRef();\n }\n\n onFinish = async () => {\n const s3DownloadLinkResponse = await getS3DownloadLink(this.state.s3FileName);\n this.setState(\n {\n currentUpload: null,\n uploadingFileToS3: false,\n openFileUploadPreviewDialog: this.props.openPreviewDialogOnUpload,\n s3FileUrl: s3DownloadLinkResponse.url,\n },\n () => {\n if (this.props.onFinish)\n this.props.onFinish(this.state.s3FileUrl, this.state.s3FileName, this.state.s3FileSize);\n }\n );\n };\n\n onError = fileUploadingError => {\n if (this.props.onError) this.props.onError(fileUploadingError);\n console.error(fileUploadingError);\n };\n\n getSignedUrl = async (file, callback) => {\n let data;\n try {\n data = await getS3SignedUrl(file.name, file.type);\n } catch (e) {\n this.setState(\n {\n uploadingFileToS3: null,\n currentUpload: null,\n },\n () => {\n this.onError(e.message);\n }\n );\n return;\n }\n\n this.setState({\n s3FileUrl: data.signed_url,\n s3FileName: data.file_name,\n s3FileSize: file.size,\n });\n\n // NOTE: Add node for 'signedUrl' which is the expected name by uploader component\n callback({\n ...data,\n signedUrl: data.signed_url,\n });\n };\n\n preprocess = (file, next) => {\n next(file);\n };\n\n uploadFile = event => {\n if (!event.target.files[0]) {\n return;\n }\n\n this.clearUpload();\n const uploader = new S3Upload({\n fileElement: this.fileInput.current,\n getSignedUrl: this.getSignedUrl,\n preprocess: this.preprocess,\n onProgress: () => {}, // NOTE: Prevents logging to console\n onFinishS3Put: this.onFinish,\n onError: this.onError,\n });\n\n this.setState({\n uploadingFileToS3: true,\n currentUpload: {\n uploader,\n },\n });\n };\n\n clearUpload() {\n const { currentUpload } = this.state;\n if (currentUpload && currentUpload.uploader) {\n currentUpload.uploader.abortUpload();\n }\n }\n\n handleCloseFileUploadPreviewDialog = () => {\n this.setState({ openFileUploadPreviewDialog: false });\n };\n\n handleShare = (comment, fileName, fileSize) => {\n this.setState({ openFileUploadPreviewDialog: false }, () => {\n if (this.props.handleShare) {\n this.props.handleShare(comment, fileName, fileSize);\n }\n });\n };\n\n renderUploadButton() {\n const Icon = isNativeDetected ? PhotoCameraIcon : AttachIcon;\n const labelDataAttributes = { [FILE_UPLOAD_BUTTON_DATA_ATTR]: '' };\n\n return (\n <label htmlFor={this.props.inputId} {...labelDataAttributes}>\n <input\n ref={this.fileInput}\n id={this.props.inputId}\n type=\"file\"\n disabled={this.props.disabled}\n onChange={this.uploadFile}\n style={{ display: 'none' }}\n />\n <IconButton\n data-testid={`${PAGE_NAME}_attachFileButton`}\n aria-label=\"File Upload\"\n disabled={this.props.disabled}\n component={this.props.disabled ? 'button' : 'span'}\n className={this.props.fileUploadIconClassName}\n disableRipple={this.props.disableRipple}\n tooltipProps={this.props.tooltipProps}\n >\n <Icon />\n </IconButton>\n </label>\n );\n }\n\n render() {\n return (\n <>\n {this.state.uploadingFileToS3 ? (\n <CircularProgress data-testid=\"generic_uploadProgress\" size={18} />\n ) : (\n this.renderUploadButton()\n )}\n\n {this.state.openFileUploadPreviewDialog && (\n <PostPreviewDialog\n open={this.state.openFileUploadPreviewDialog}\n fileUrl={this.state.s3FileUrl}\n fileName={this.state.s3FileName}\n fileSize={this.state.s3FileSize}\n handleShare={this.handleShare}\n handleClose={this.handleCloseFileUploadPreviewDialog}\n additionalFields={this.props.additionalFields}\n requiredFields={this.props.requiredFields}\n message={this.props.message}\n />\n )}\n </>\n );\n }\n}\n\nFileUploadIconButton.propTypes = {\n additionalFields: PropTypes.arrayOf(PropTypes.node),\n classes: PropTypes.shape({}),\n tooltipProps: PropTypes.shape({}),\n disableRipple: PropTypes.bool,\n disabled: PropTypes.bool,\n fileUploadIconClassName: PropTypes.string,\n handleShare: PropTypes.func,\n inputId: PropTypes.string,\n message: PropTypes.string,\n onError: PropTypes.func,\n onFinish: PropTypes.func,\n openPreviewDialogOnUpload: PropTypes.bool,\n requiredFields: PropTypes.arrayOf(PropTypes.string),\n};\n\nFileUploadIconButton.defaultProps = {\n additionalFields: [],\n classes: {},\n disableRipple: false,\n disabled: false,\n fileUploadIconClassName: undefined,\n handleShare: undefined,\n inputId: 'icon-button-file',\n message: undefined,\n onError: undefined,\n onFinish: undefined,\n openPreviewDialogOnUpload: true,\n requiredFields: [],\n tooltipProps: { title: 'Attach File' },\n};\n\nexport default FileUploadIconButton;\n"],"names":["FILE_UPLOAD_BUTTON_DATA_ATTR","FileUploadIconButton","_PureComponent","_inherits","PureComponent","_super","_createSuper","props","_this","_ref2","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","_asyncToGenerator","_regeneratorRuntime","mark","_callee","s3DownloadLinkResponse","wrap","_context","prev","next","getS3DownloadLink","state","s3FileName","sent","setState","currentUpload","uploadingFileToS3","openFileUploadPreviewDialog","openPreviewDialogOnUpload","s3FileUrl","url","onFinish","s3FileSize","stop","fileUploadingError","onError","console","error","_callee2","file","callback","data","_context2","getS3SignedUrl","name","type","t0","message","abrupt","signed_url","file_name","size","signedUrl","_x","_x2","apply","arguments","event","target","files","clearUpload","uploader","S3Upload","fileElement","fileInput","current","getSignedUrl","preprocess","onProgress","onFinishS3Put","comment","fileName","fileSize","handleShare","createRef","_createClass","key","value","abortUpload","Icon","isNativeDetected","PhotoCameraIcon","AttachIcon","labelDataAttributes","_jsxs","_objectSpread","htmlFor","inputId","children","_jsx","ref","id","disabled","onChange","uploadFile","style","display","IconButton","concat","component","className","fileUploadIconClassName","disableRipple","tooltipProps","_Fragment","CircularProgress","renderUploadButton","PostPreviewDialog","open","fileUrl","handleClose","handleCloseFileUploadPreviewDialog","additionalFields","requiredFields","propTypes","PropTypes","arrayOf","node","classes","shape","bool","string","func","defaultProps","undefined","title"],"mappings":"k+DAYA,IAGaA,EAA+B,0BAEtCC,EAAoB,SAAAC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GACxB,SAAAA,EAAYM,GAAO,IAAAC,EAuCJC,EAxBgB,OAfZC,EAAAC,KAAAV,GACjBO,EAAAH,EAAAO,KAAAD,KAAMJ,GAAOM,EAiBJC,EAAAN,GAAA,WAAAO,EAAAC,EAAAC,MAAA,SAAAC,IAAA,IAAAC,EAAA,OAAAH,EAAAI,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAA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ACpBnB,wBAAyBc,EAAUM,OACnChD,YAAa0C,EAAUO,KACvBnC,QAAS4B,EAAUM,OACnB1E,QAASoE,EAAUM,OACnBtF,QAASgF,EAAUO,KACnB3F,SAAUoF,EAAUO,KACpB9F,0BAA2BuF,EAAUK,KACrCP,eAAgBE,EAAUC,QAAQD,EAAUM,SAG9C5H,EAAqB8H,aAAe,CAClCX,iBAAkB,GAClBM,QAAS,CAAE,EACXhB,eAAe,EACfV,UAAU,EACVS,6BAAyBuB,EACzBnD,iBAAamD,EACbrC,QAAS,mBACTxC,aAAS6E,EACTzF,aAASyF,EACT7F,cAAU6F,EACVhG,2BAA2B,EAC3BqF,eAAgB,GAChBV,aAAc,CAAEsB,MAAO"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{useEffect as o,useCallback as n}from"react";import{debounce as r}from"lodash";import t from"prop-types";import{withStyles as s}from"@material-ui/core/styles";import{MentionsInput as i,Mention as a}from"react-mentions";import l from"@material-ui/core/colors/blue";import{handleFetchUsers as u}from"./utils/index.js";import{USER_MARKUP as c}from"./constants.js";import p from"./style.css.js";import{AvatarComponent as m}from"../Avatar/index.js";import"../../permissions/PermissionsContext.js";import{PERMISSIONS as f}from"../../permissions/constants/index.js";import"@babel/runtime/helpers/slicedToArray";import{withPermissionsHOC as g}from"../../permissions/withPermissionsHOC.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.js";import"../../permissions/ProvidePermissions.js";import{jsx as d,jsxs as b}from"react/jsx-runtime";function y(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,r)}return n}function h(o){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(o,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))}))}return o}var v={backgroundColor:l[100]},j={color:"#00bcd4"},_={suggestions:{item:{"&focused":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},w=h(h({},_),{},{input:{color:"#fff",caretColor:"#fff",zIndex:1},highlighter:{color:"#fff"}}),O=h(h({},_),{},{input:{color:"#000"}}),P=function(e){var t=e.onChange,s=e.singleLine,l=e.suggestionsPortalHost,f=e.value,g=e.inputRef,y=e.classes,_=e.style,P=e.withLightTheme,C=e.placeholder,S=e.onMount,x=e.onKeyDown,R=e.onKeyUp,A=e.onFocus,D=e.onBlur,F=e.autoFocus,K=e.disabled,L=e.companyId,N=e.currentUser,T=e.isCompanySelectVisible,k=e.mentionProps,U=e.allowSuggestionsAboveCursor;o(S,[]);var q=n(r((function(e,o){var n=T&&N&&N.company_id!==L?[N.company_id,L]:null;u(e,o,n)}),400),[L]),H=Object.assign(P?O:w,_);return d(i,{value:f,onChange:function(e,o){t(o)},singleLine:s,allowSpaceInQuery:!0,classNames:p,placeholder:C,suggestionsPortalHost:l,inputRef:g,style:H,onKeyDown:x,onKeyUp:R,autoFocus:F,onFocus:A,onBlur:D,disabled:K,allowSuggestionsAboveCursor:U,children:d(a,h({markup:c,renderSuggestion:function(e){return function(e,o){return b("div",{className:p.mention__suggestion,children:[d(m,{alt:e.display,displayName:e.display,className:o.avatar,imgSrc:e.photo}),b("div",{className:p.mention__suggestion__info,children:[d("span",{"data-testid":"".concat("userMention","_name_").concat(e.display),className:p.mention__suggestion__info__name,children:e.display}),e.title&&d("span",{className:p.mention__suggestion__info__group,children:e.title})]})]})}(e,y)},trigger:"@",data:q,displayTransform:function(e,o){return"@".concat(o)},style:P?v:j,appendSpaceOnAdd:!0},k))})};P.propTypes={onChange:t.func,singleLine:t.bool,suggestionsPortalHost:t.shape({current:t.instanceOf(Element)}),value:t.string,inputRef:t.shape({}),classes:t.shape({avatar:t.string.isRequired}).isRequired,withLightTheme:t.bool,placeholder:t.string,style:t.shape({}),mentionProps:t.shape({}),onMount:t.func,onKeyDown:t.func,onKeyUp:t.func,onFocus:t.func,onBlur:t.func,autoFocus:t.bool,disabled:t.bool,currentUser:t.shape({company_id:t.number.isRequired}).isRequired,companyId:t.number,isCompanySelectVisible:t.bool.isRequired,allowSuggestionsAboveCursor:t.bool},P.defaultProps={onChange:function(){},singleLine:!1,suggestionsPortalHost:null,value:"",inputRef:null,withLightTheme:!1,placeholder:"Mention people using '@'",style:{suggestions:{list:{background:"#414141"},item:{color:"white",height:30,"&focused":{backgroundColor:"rgba(255, 255, 255, 0.08)"}}}},mentionProps:{},onMount:function(){},onKeyDown:function(){},onKeyUp:function(){},onFocus:function(){},onBlur:function(){},autoFocus:!0,disabled:!1,allowSuggestionsAboveCursor:!1,companyId:null};var C=g({isCompanySelectVisible:f.companySelectorView})(s({avatar:{height:45,width:45,border:"1.5px solid #fff"}})(P));export{C as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import{useEffect as o,useCallback as n}from"react";import{debounce as r}from"lodash";import t from"prop-types";import{withStyles as s}from"@material-ui/core/styles";import{MentionsInput as i,Mention as a}from"react-mentions";import l from"@material-ui/core/colors/blue";import{handleFetchUsers as u}from"./utils/index.js";import{USER_MARKUP as c}from"./constants.js";import p from"./style.css.js";import{AvatarComponent as m}from"../Avatar/index.js";import"../../permissions/PermissionsContext.js";import{PERMISSIONS as f}from"../../permissions/constants/index.js";import"@babel/runtime/helpers/slicedToArray";import{withPermissionsHOC as g}from"../../permissions/withPermissionsHOC.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.js";import"../../permissions/ProvidePermissions.js";import{jsx as d,jsxs as b}from"react/jsx-runtime";function y(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,r)}return n}function h(o){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(o,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))}))}return o}var v={backgroundColor:l[100]},j={color:"#00bcd4"},_={suggestions:{item:{"&focused":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},w=h(h({},_),{},{input:{color:"#fff",caretColor:"#fff",zIndex:1},highlighter:{color:"#fff"}}),O=h(h({},_),{},{input:{color:"#000"}}),P=function(e){var t=e.onChange,s=e.singleLine,l=e.suggestionsPortalHost,f=e.value,g=e.inputRef,y=e.classes,_=e.style,P=e.withLightTheme,C=e.placeholder,S=e.onMount,x=e.onKeyDown,A=e.onKeyUp,D=e.onFocus,F=e.onBlur,K=e.autoFocus,R=e.disabled,L=e.companyId,N=e.currentUser,T=e.isCompanySelectVisible,U=e.mentionProps,k=e.allowSuggestionsAboveCursor;o(S,[]);var H=n(r((function(e,o){var n=T&&N&&N.company_id!==L?[N.company_id,L]:null;u(e,o,n)}),400),[L]),I=Object.assign(P?O:w,_);return d(i,{value:f,onChange:function(e,o){t(o)},singleLine:s,allowSpaceInQuery:!0,classNames:p,placeholder:C,suggestionsPortalHost:l,inputRef:g,style:I,onKeyDown:x,onKeyUp:A,autoFocus:K,onFocus:D,onBlur:F,disabled:R,allowSuggestionsAboveCursor:k,children:d(a,h({markup:c,renderSuggestion:function(e){return function(e,o){return b("div",{className:p.mention__suggestion,children:[d(m,{alt:e.display,displayName:e.display,className:o.avatar,imgSrc:e.photo}),b("div",{className:p.mention__suggestion__info,children:[d("span",{"data-testid":"".concat("userMention","_name_").concat(e.display),className:p.mention__suggestion__info__name,children:e.display}),e.title&&d("span",{className:p.mention__suggestion__info__group,children:e.title})]})]})}(e,y)},trigger:"@",data:H,displayTransform:function(e,o){return"@".concat(o)},style:P?v:j,appendSpaceOnAdd:!0},U))})};P.propTypes={onChange:t.func,singleLine:t.bool,suggestionsPortalHost:t.shape({current:t.instanceOf(Element)}),value:t.string,inputRef:t.shape({}),classes:t.shape({avatar:t.string.isRequired}).isRequired,withLightTheme:t.bool,placeholder:t.string,style:t.shape({}),mentionProps:t.shape({}),onMount:t.func,onKeyDown:t.func,onKeyUp:t.func,onFocus:t.func,onBlur:t.func,autoFocus:t.bool,disabled:t.bool,currentUser:t.shape({company_id:t.number.isRequired}),companyId:t.number,isCompanySelectVisible:t.bool.isRequired,allowSuggestionsAboveCursor:t.bool},P.defaultProps={onChange:function(){},singleLine:!1,suggestionsPortalHost:null,value:"",inputRef:null,withLightTheme:!1,placeholder:"Mention people using '@'",style:{suggestions:{list:{background:"#414141"},item:{color:"white",height:30,"&focused":{backgroundColor:"rgba(255, 255, 255, 0.08)"}}}},mentionProps:{},onMount:function(){},onKeyDown:function(){},onKeyUp:function(){},onFocus:function(){},onBlur:function(){},autoFocus:!0,disabled:!1,allowSuggestionsAboveCursor:!1,companyId:null,currentUser:null};var C=g({isCompanySelectVisible:f.companySelectorView})(s({avatar:{height:45,width:45,border:"1.5px solid #fff"}})(P));export{C as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/UserMention/index.js"],"sourcesContent":["import { useCallback, useEffect } from 'react';\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { MentionsInput, Mention } from 'react-mentions';\nimport blue from '@material-ui/core/colors/blue';\n\nimport { handleFetchUsers } from './utils';\nimport { USER_MARKUP } from './constants';\n\nimport styles from './style.css';\n\nimport Avatar from '~components/Avatar';\nimport { withPermissionsHOC, PERMISSIONS } from '~/permissions';\n\nconst PAGE_NAME = 'userMention';\n\nconst muiStyles = {\n avatar: {\n height: 45,\n width: 45,\n border: '1.5px solid #fff',\n },\n};\n\nconst mentionLightStyle = {\n backgroundColor: blue[100],\n};\nconst mentionDarkStyle = {\n color: '#00bcd4',\n};\n\n// NOTE: IMPORTANT! 'input', 'mention' and 'highliter' should always have same font/latter/height/line etc values\nconst inputStyles = {\n suggestions: {\n item: {\n '&focused': {\n backgroundColor: 'rgba(0, 0, 0, 0.08)',\n },\n },\n },\n};\n\nconst darkThemeInputStyles = {\n ...inputStyles,\n input: {\n color: '#fff',\n caretColor: '#fff',\n zIndex: 1,\n },\n highlighter: {\n color: '#fff',\n },\n};\n\nconst lightThemeInputStyles = {\n ...inputStyles,\n input: { color: '#000' },\n};\n\nconst renderSuggestion = (entry, classes) => (\n <div className={styles.mention__suggestion}>\n <Avatar\n alt={entry.display}\n displayName={entry.display}\n className={classes.avatar}\n imgSrc={entry.photo}\n />\n <div className={styles.mention__suggestion__info}>\n <span\n data-testid={`${PAGE_NAME}_name_${entry.display}`}\n className={styles.mention__suggestion__info__name}\n >\n {entry.display}\n </span>\n {entry.title && (\n <span className={styles.mention__suggestion__info__group}>{entry.title}</span>\n )}\n </div>\n </div>\n);\n\nconst UserMention = ({\n onChange,\n singleLine,\n suggestionsPortalHost,\n value,\n inputRef,\n classes,\n style,\n withLightTheme,\n placeholder,\n onMount,\n onKeyDown,\n onKeyUp,\n onFocus,\n onBlur,\n autoFocus,\n disabled,\n companyId,\n currentUser,\n isCompanySelectVisible,\n mentionProps,\n allowSuggestionsAboveCursor,\n}) => {\n useEffect(onMount, []);\n\n const fetchUsers = (search, callback) => {\n const companyIds =\n isCompanySelectVisible && currentUser && currentUser.company_id !== companyId\n ? [currentUser.company_id, companyId]\n : null;\n\n handleFetchUsers(search, callback, companyIds);\n };\n\n const debouncedUsersFetch = useCallback(debounce(fetchUsers, 400), [companyId]);\n\n const onInputChange = (event, newValue) => {\n onChange(newValue);\n };\n\n const themedStyle = Object.assign(\n withLightTheme ? lightThemeInputStyles : darkThemeInputStyles,\n style\n );\n\n return (\n <MentionsInput\n value={value}\n onChange={onInputChange}\n singleLine={singleLine}\n allowSpaceInQuery\n classNames={styles}\n placeholder={placeholder}\n suggestionsPortalHost={suggestionsPortalHost}\n inputRef={inputRef}\n style={themedStyle}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n autoFocus={autoFocus}\n onFocus={onFocus}\n onBlur={onBlur}\n disabled={disabled}\n allowSuggestionsAboveCursor={allowSuggestionsAboveCursor}\n >\n <Mention\n markup={USER_MARKUP}\n renderSuggestion={entry => renderSuggestion(entry, classes)}\n trigger=\"@\"\n data={debouncedUsersFetch}\n displayTransform={(id, display) => `@${display}`}\n style={withLightTheme ? mentionLightStyle : mentionDarkStyle}\n appendSpaceOnAdd\n {...mentionProps}\n />\n </MentionsInput>\n );\n};\n\nUserMention.propTypes = {\n onChange: PropTypes.func,\n singleLine: PropTypes.bool,\n suggestionsPortalHost: PropTypes.shape({\n current: PropTypes.instanceOf(Element),\n }),\n value: PropTypes.string,\n inputRef: PropTypes.shape({}),\n classes: PropTypes.shape({\n avatar: PropTypes.string.isRequired,\n }).isRequired,\n withLightTheme: PropTypes.bool,\n placeholder: PropTypes.string,\n style: PropTypes.shape({}),\n mentionProps: PropTypes.shape({}),\n onMount: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyUp: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n currentUser: PropTypes.shape({\n company_id: PropTypes.number.isRequired,\n }).isRequired,\n companyId: PropTypes.number,\n isCompanySelectVisible: PropTypes.bool.isRequired,\n allowSuggestionsAboveCursor: PropTypes.bool,\n};\n\nUserMention.defaultProps = {\n onChange: () => undefined,\n singleLine: false,\n suggestionsPortalHost: null,\n value: '',\n inputRef: null,\n withLightTheme: false,\n placeholder: \"Mention people using '@'\",\n style: {\n suggestions: {\n list: {\n background: '#414141',\n },\n item: {\n color: 'white',\n height: 30,\n '&focused': {\n backgroundColor: 'rgba(255, 255, 255, 0.08)',\n },\n },\n },\n },\n mentionProps: {},\n onMount: () => undefined,\n onKeyDown: () => undefined,\n onKeyUp: () => undefined,\n onFocus: () => undefined,\n onBlur: () => undefined,\n autoFocus: true,\n disabled: false,\n allowSuggestionsAboveCursor: false,\n companyId: null,\n};\n\nexport default withPermissionsHOC({ isCompanySelectVisible: PERMISSIONS.companySelectorView })(\n withStyles(muiStyles)(UserMention)\n);\n"],"names":["mentionLightStyle","backgroundColor","blue","mentionDarkStyle","color","inputStyles","suggestions","item","darkThemeInputStyles","input","caretColor","zIndex","highlighter","lightThemeInputStyles","UserMention","_ref","onChange","singleLine","suggestionsPortalHost","value","inputRef","classes","style","withLightTheme","placeholder","onMount","onKeyDown","onKeyUp","onFocus","onBlur","autoFocus","disabled","companyId","currentUser","isCompanySelectVisible","mentionProps","allowSuggestionsAboveCursor","useEffect","debouncedUsersFetch","useCallback","debounce","search","callback","companyIds","company_id","handleFetchUsers","themedStyle","Object","assign","_jsx","MentionsInput","event","newValue","allowSpaceInQuery","classNames","styles","children","Mention","_objectSpread","markup","USER_MARKUP","renderSuggestion","entry","_jsxs","className","mention__suggestion","Avatar","alt","display","displayName","avatar","imgSrc","photo","mention__suggestion__info","concat","mention__suggestion__info__name","title","mention__suggestion__info__group","trigger","data","displayTransform","id","appendSpaceOnAdd","propTypes","PropTypes","func","bool","shape","current","instanceOf","Element","string","isRequired","number","defaultProps","list","background","height","UserMention$1","withPermissionsHOC","PERMISSIONS","companySelectorView","withStyles","width","border"],"mappings":"+/CAeA,IAUMA,EAAoB,CACxBC,gBAAiBC,EAAK,MAElBC,EAAmB,CACvBC,MAAO,WAIHC,EAAc,CAClBC,YAAa,CACXC,KAAM,CACJ,WAAY,CACVN,gBAAiB,0BAMnBO,SACDH,GAAW,CAAA,EAAA,CACdI,MAAO,CACLL,MAAO,OACPM,WAAY,OACZC,OAAQ,GAEVC,YAAa,CACXR,MAAO,UAILS,SACDR,GAAW,CAAA,EAAA,CACdI,MAAO,CAAEL,MAAO,UAyBZU,EAAc,SAs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AO,QACP6F,OAAQ,GACR,WAAY,CACVhG,gBAAiB,gCAKzBkC,aAAc,CAAE,EAChBV,QAAS,WAAe,EACxBC,UAAW,WAAe,EAC1BC,QAAS,WAAe,EACxBC,QAAS,WAAe,EACxBC,OAAQ,WAAe,EACvBC,WAAW,EACXC,UAAU,EACVK,6BAA6B,EAC7BJ,UAAW,MAGb,IAAAkE,EAAeC,EAAmB,CAAEjE,uBAAwBkE,EAAYC,qBAAzDF,CACbG,EAjNgB,CAChBhC,OAAQ,CACN2B,OAAQ,GACRM,MAAO,GACPC,OAAQ,qBA6MVF,CAAsBxF"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/UserMention/index.js"],"sourcesContent":["import { useCallback, useEffect } from 'react';\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { MentionsInput, Mention } from 'react-mentions';\nimport blue from '@material-ui/core/colors/blue';\n\nimport { handleFetchUsers } from './utils';\nimport { USER_MARKUP } from './constants';\n\nimport styles from './style.css';\n\nimport Avatar from '~components/Avatar';\nimport { withPermissionsHOC, PERMISSIONS } from '~/permissions';\n\nconst PAGE_NAME = 'userMention';\n\nconst muiStyles = {\n avatar: {\n height: 45,\n width: 45,\n border: '1.5px solid #fff',\n },\n};\n\nconst mentionLightStyle = {\n backgroundColor: blue[100],\n};\nconst mentionDarkStyle = {\n color: '#00bcd4',\n};\n\n// NOTE: IMPORTANT! 'input', 'mention' and 'highliter' should always have same font/latter/height/line etc values\nconst inputStyles = {\n suggestions: {\n item: {\n '&focused': {\n backgroundColor: 'rgba(0, 0, 0, 0.08)',\n },\n },\n },\n};\n\nconst darkThemeInputStyles = {\n ...inputStyles,\n input: {\n color: '#fff',\n caretColor: '#fff',\n zIndex: 1,\n },\n highlighter: {\n color: '#fff',\n },\n};\n\nconst lightThemeInputStyles = {\n ...inputStyles,\n input: { color: '#000' },\n};\n\nconst renderSuggestion = (entry, classes) => (\n <div className={styles.mention__suggestion}>\n <Avatar\n alt={entry.display}\n displayName={entry.display}\n className={classes.avatar}\n imgSrc={entry.photo}\n />\n <div className={styles.mention__suggestion__info}>\n <span\n data-testid={`${PAGE_NAME}_name_${entry.display}`}\n className={styles.mention__suggestion__info__name}\n >\n {entry.display}\n </span>\n {entry.title && (\n <span className={styles.mention__suggestion__info__group}>{entry.title}</span>\n )}\n </div>\n </div>\n);\n\nconst UserMention = ({\n onChange,\n singleLine,\n suggestionsPortalHost,\n value,\n inputRef,\n classes,\n style,\n withLightTheme,\n placeholder,\n onMount,\n onKeyDown,\n onKeyUp,\n onFocus,\n onBlur,\n autoFocus,\n disabled,\n companyId,\n currentUser,\n isCompanySelectVisible,\n mentionProps,\n allowSuggestionsAboveCursor,\n}) => {\n useEffect(onMount, []);\n\n const fetchUsers = (search, callback) => {\n const companyIds =\n isCompanySelectVisible && currentUser && currentUser.company_id !== companyId\n ? [currentUser.company_id, companyId]\n : null;\n\n handleFetchUsers(search, callback, companyIds);\n };\n\n const debouncedUsersFetch = useCallback(debounce(fetchUsers, 400), [companyId]);\n\n const onInputChange = (event, newValue) => {\n onChange(newValue);\n };\n\n const themedStyle = Object.assign(\n withLightTheme ? lightThemeInputStyles : darkThemeInputStyles,\n style\n );\n\n return (\n <MentionsInput\n value={value}\n onChange={onInputChange}\n singleLine={singleLine}\n allowSpaceInQuery\n classNames={styles}\n placeholder={placeholder}\n suggestionsPortalHost={suggestionsPortalHost}\n inputRef={inputRef}\n style={themedStyle}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n autoFocus={autoFocus}\n onFocus={onFocus}\n onBlur={onBlur}\n disabled={disabled}\n allowSuggestionsAboveCursor={allowSuggestionsAboveCursor}\n >\n <Mention\n markup={USER_MARKUP}\n renderSuggestion={entry => renderSuggestion(entry, classes)}\n trigger=\"@\"\n data={debouncedUsersFetch}\n displayTransform={(id, display) => `@${display}`}\n style={withLightTheme ? mentionLightStyle : mentionDarkStyle}\n appendSpaceOnAdd\n {...mentionProps}\n />\n </MentionsInput>\n );\n};\n\nUserMention.propTypes = {\n onChange: PropTypes.func,\n singleLine: PropTypes.bool,\n suggestionsPortalHost: PropTypes.shape({\n current: PropTypes.instanceOf(Element),\n }),\n value: PropTypes.string,\n inputRef: PropTypes.shape({}),\n classes: PropTypes.shape({\n avatar: PropTypes.string.isRequired,\n }).isRequired,\n withLightTheme: PropTypes.bool,\n placeholder: PropTypes.string,\n style: PropTypes.shape({}),\n mentionProps: PropTypes.shape({}),\n onMount: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyUp: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n currentUser: PropTypes.shape({\n company_id: PropTypes.number.isRequired,\n }),\n companyId: PropTypes.number,\n isCompanySelectVisible: PropTypes.bool.isRequired,\n allowSuggestionsAboveCursor: PropTypes.bool,\n};\n\nUserMention.defaultProps = {\n onChange: () => undefined,\n singleLine: false,\n suggestionsPortalHost: null,\n value: '',\n inputRef: null,\n withLightTheme: false,\n placeholder: \"Mention people using '@'\",\n style: {\n suggestions: {\n list: {\n background: '#414141',\n },\n item: {\n color: 'white',\n height: 30,\n '&focused': {\n backgroundColor: 'rgba(255, 255, 255, 0.08)',\n },\n },\n },\n },\n mentionProps: {},\n onMount: () => undefined,\n onKeyDown: () => undefined,\n onKeyUp: () => undefined,\n onFocus: () => undefined,\n onBlur: () => undefined,\n autoFocus: true,\n disabled: false,\n allowSuggestionsAboveCursor: false,\n companyId: null,\n currentUser: null,\n};\n\nexport default withPermissionsHOC({ isCompanySelectVisible: PERMISSIONS.companySelectorView })(\n withStyles(muiStyles)(UserMention)\n);\n"],"names":["mentionLightStyle","backgroundColor","blue","mentionDarkStyle","color","inputStyles","suggestions","item","darkThemeInputStyles","input","caretColor","zIndex","highlighter","lightThemeInputStyles","UserMention","_ref","onChange","singleLine","suggestionsPortalHost","value","inputRef","classes","style","withLightTheme","placeholder","onMount","onKeyDown","onKeyUp","onFocus","onBlur","autoFocus","disabled","companyId","currentUser","isCompanySelectVisible","mentionProps","allowSuggestionsAboveCursor","useEffect","debouncedUsersFetch","useCallback","debounce","search","callback","companyIds","company_id","handleFetchUsers","themedStyle","Object","assign","_jsx","MentionsInput","event","newValue","allowSpaceInQuery","classNames","styles","children","Mention","_objectSpread","markup","USER_MARKUP","renderSuggestion","entry","_jsxs","className","mention__suggestion","Avatar","alt","display","displayName","avatar","imgSrc","photo","mention__suggestion__info","concat","mention__suggestion__info__name","title","mention__suggestion__info__group","trigger","data","displayTransform","id","appendSpaceOnAdd","propTypes","PropTypes","func","bool","shape","current","instanceOf","Element","string","isRequired","number","defaultProps","list","background","height","UserMention$1","withPermissionsHOC","PERMISSIONS","companySelectorView","withStyles","width","border"],"mappings":"+/CAeA,IAUMA,EAAoB,CACxBC,gBAAiBC,EAAK,MAElBC,EAAmB,CACvBC,MAAO,WAIHC,EAAc,CAClBC,YAAa,CACXC,KAAM,CACJ,WAAY,CACVN,gBAAiB,0BAMnBO,SACDH,GAAW,CAAA,EAAA,CACdI,MAAO,CACLL,MAAO,OACPM,WAAY,OACZC,OAAQ,GAEVC,YAAa,CACXR,MAAO,UAILS,SACDR,GAAW,CAAA,EAAA,CACdI,MAAO,CAAEL,MAAO,UAyBZU,EAAc,SAsBdC,GAAA,IArBJC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,sBACAC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,QACAC,IAAAA,MACAC,IAAAA,eACAC,IAAAA,YACAC,IAAAA,QACAC,IAAAA,UACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,OACAC,IAAAA,UACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,uBACAC,IAAAA,aACAC,IAAAA,4BAEAC,EAAUZ,EAAS,IAEnB,IASMa,EAAsBC,EAAYC,GATrB,SAACC,EAAQC,GAC1B,IAAMC,EACJT,GAA0BD,GAAeA,EAAYW,aAAeZ,EAChE,CAAC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inject/dist/style-inject.es.js';var o={spacing:"8",root:"Autocomplete_root__4SidE",paper:"Autocomplete_paper__Vq6DC",sticky:"Autocomplete_sticky__0-eTa",menuItem:"Autocomplete_menuItem__c2Qka",listboxScrolled:"Autocomplete_listboxScrolled__n34NV",checkboxSmall:"Autocomplete_checkboxSmall__TjdiN",checkboxMedium:"Autocomplete_checkboxMedium__LUbff",selectedValue:"Autocomplete_selectedValue__iGHNh",selectedValueChip:"Autocomplete_selectedValueChip__5QOEK",inputContainer:"Autocomplete_inputContainer__RKk5j",prefix:"Autocomplete_prefix__WzSbL",input:"Autocomplete_input__FHTVO",withArrow:"Autocomplete_withArrow__pNaNX",withClear:"Autocomplete_withClear__RGtWV",suffix:"Autocomplete_suffix__y3P7i",readOnlyInput:"Autocomplete_readOnlyInput__mD5xQ"};t('.Autocomplete_root__4SidE{width:100%}.Autocomplete_root__4SidE .MuiAutocomplete-endAdornment{display:contents}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator{margin:0;padding:0;visibility:visible}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator .MuiTouchRipple-root,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator .MuiTouchRipple-root{display:none}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator{background-color:transparent!important;transition:transform .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1)}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator svg,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator svg{display:block}.Autocomplete_root__4SidE .MuiInputAdornment-positionStart{max-width:70%}.Autocomplete_paper__Vq6DC{--corvaui-background:var(--palette-background-b-9);background-color:var(--palette-background-b-9)!important;box-shadow:0 8px 24px 0 rgba(0,0,0,.24)!important;display:flex;flex-flow:column wrap;margin:8px 0;max-height:40vh;overflow:hidden;padding:0;position:relative}.Autocomplete_paper__Vq6DC:before{background:linear-gradient(180deg,rgb(from var(--corvaui-background) r g b/1) 0,rgb(from var(--corvaui-background) r g b/0) 100%);content:"";height:8px;inset:0 10px auto 0;position:absolute;z-index:1}.Autocomplete_paper__Vq6DC:after{background:linear-gradient(0deg,rgb(from var(--corvaui-background) r g b/1) 0,rgb(from var(--corvaui-background) r g b/0) 100%);content:"";height:8px;inset:auto 10px 0 0;position:absolute;z-index:1}.Autocomplete_paper__Vq6DC:has(.Autocomplete_sticky__0-eTa){padding-top:8px}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox{flex:0 1 auto;max-height:unset;padding:8px 0}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox,.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox li{width:100%}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox:has(.Autocomplete_sticky__0-eTa){padding-top:0}.Autocomplete_paper__Vq6DC li.MuiAutocomplete-option{background:var(--corvaui-background)!important;display:block;padding:0 16px!important;z-index:1}.Autocomplete_paper__Vq6DC li.MuiAutocomplete-option[data-focus=true] .Autocomplete_menuItem__c2Qka{background-color:rgb(from var(--palette-primary-text-1) r g b/.08)}.Autocomplete_paper__Vq6DC li.MuiAutocomplete-option:has(.Autocomplete_sticky__0-eTa){left:0;position:sticky;top:0}.Autocomplete_paper__Vq6DC .Autocomplete_sticky__0-eTa{border-bottom:1px solid rgb(from var(--palette-primary-text-1) r g b/.25);overflow:visible}.Autocomplete_paper__Vq6DC .Autocomplete_listboxScrolled__n34NV .Autocomplete_sticky__0-eTa:after{background:linear-gradient(0deg,rgb(from var(--corvaui-background) r g b/0) 0,rgb(from var(--corvaui-background) r g b/1) 100%);content:"";height:8px;inset:100% 0 auto 0;margin-top:1px;position:absolute}.Autocomplete_paper__Vq6DC .MuiAutocomplete-noOptions{align-items:center;color:var(--palette-primary-text-6);display:flex;font-size:12px;font-style:italic;justify-content:center;min-height:31px;padding:0}.Autocomplete_paper__Vq6DC .MuiAutocomplete-groupLabel{background:var(--corvaui-background)!important;color:var(--palette-primary-text-7);font-size:12px;font-weight:400;line-height:16px}.Autocomplete_paper__Vq6DC .MuiAutocomplete-groupLabel:not(:empty){padding-top:8px}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox li+li .MuiAutocomplete-groupLabel:not(:empty){margin-top:8px}.Autocomplete_checkboxSmall__TjdiN{margin-right:-8px}.Autocomplete_checkboxMedium__LUbff{margin-right:-12px}.Autocomplete_selectedValue__iGHNh{overflow:hidden}.Autocomplete_selectedValueChip__5QOEK{flex:0 0 auto;margin:-3px 0;max-width:calc(33% - 8px)}.Autocomplete_inputContainer__RKk5j{flex-wrap:wrap;position:relative;row-gap:14px}.Autocomplete_inputContainer__RKk5j .Autocomplete_selectedValue__iGHNh{max-width:50%}.Autocomplete_prefix__WzSbL{display:contents}.Autocomplete_input__FHTVO{flex:1 1;max-width:100%;min-width:150px}.Autocomplete_withArrow__pNaNX .Autocomplete_input__FHTVO,.Autocomplete_withClear__RGtWV .Autocomplete_input__FHTVO{padding-right:24px}.Autocomplete_withArrow__pNaNX.Autocomplete_withClear__RGtWV .Autocomplete_input__FHTVO{padding-right:48px}.Autocomplete_suffix__y3P7i{bottom:calc(var(--corvaui-textinput-inputheight)/2 + 6px);height:var(--corvaui-textinput-inputheight);position:absolute;right:7px;transform:translateY(50%)}.Autocomplete_readOnlyInput__mD5xQ{cursor:inherit}');export{o as default};
1
+ import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var o={spacing:"8",root:"Autocomplete_root__4SidE",paper:"Autocomplete_paper__Vq6DC",sticky:"Autocomplete_sticky__0-eTa",menuItem:"Autocomplete_menuItem__c2Qka",listboxScrolled:"Autocomplete_listboxScrolled__n34NV",checkboxSmall:"Autocomplete_checkboxSmall__TjdiN",checkboxMedium:"Autocomplete_checkboxMedium__LUbff",selectedValue:"Autocomplete_selectedValue__iGHNh",selectedValueChip:"Autocomplete_selectedValueChip__5QOEK",inputContainer:"Autocomplete_inputContainer__RKk5j",prefix:"Autocomplete_prefix__WzSbL",input:"Autocomplete_input__FHTVO",withArrow:"Autocomplete_withArrow__pNaNX",withClear:"Autocomplete_withClear__RGtWV",suffix:"Autocomplete_suffix__y3P7i",readOnlyInput:"Autocomplete_readOnlyInput__mD5xQ"};t('.Autocomplete_root__4SidE{width:100%}.Autocomplete_root__4SidE .MuiAutocomplete-endAdornment{display:contents}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator{margin:0;padding:0;visibility:visible}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator .MuiTouchRipple-root,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator .MuiTouchRipple-root{display:none}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator{background-color:transparent!important;transition:transform .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1)}.Autocomplete_root__4SidE .MuiAutocomplete-clearIndicator svg,.Autocomplete_root__4SidE .MuiAutocomplete-popupIndicator svg{display:block}.Autocomplete_root__4SidE .MuiInputAdornment-positionStart{max-width:70%}.Autocomplete_paper__Vq6DC{--corvaui-background:var(--palette-background-b-9);background-color:var(--palette-background-b-9)!important;box-shadow:0 8px 24px 0 rgba(0,0,0,.24)!important;display:flex;flex-flow:column wrap;margin:8px 0;max-height:40vh;overflow:hidden;padding:0;position:relative}.Autocomplete_paper__Vq6DC:before{background:linear-gradient(180deg,rgb(from var(--corvaui-background) r g b/1) 0,rgb(from var(--corvaui-background) r g b/0) 100%);content:"";height:8px;inset:0 10px auto 0;position:absolute;z-index:1}.Autocomplete_paper__Vq6DC:after{background:linear-gradient(0deg,rgb(from var(--corvaui-background) r g b/1) 0,rgb(from var(--corvaui-background) r g b/0) 100%);content:"";height:8px;inset:auto 10px 0 0;position:absolute;z-index:1}.Autocomplete_paper__Vq6DC:has(.Autocomplete_sticky__0-eTa){padding-top:8px}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox{flex:0 1 auto;max-height:unset;padding:8px 0}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox,.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox li{width:100%}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox:has(.Autocomplete_sticky__0-eTa){padding-top:0}.Autocomplete_paper__Vq6DC li.MuiAutocomplete-option{background:var(--corvaui-background)!important;display:block;padding:0 16px!important;z-index:1}.Autocomplete_paper__Vq6DC li.MuiAutocomplete-option[data-focus=true] .Autocomplete_menuItem__c2Qka{background-color:rgb(from var(--palette-primary-text-1) r g b/.08)}.Autocomplete_paper__Vq6DC li.MuiAutocomplete-option:has(.Autocomplete_sticky__0-eTa){left:0;position:sticky;top:0}.Autocomplete_paper__Vq6DC .Autocomplete_sticky__0-eTa{border-bottom:1px solid rgb(from var(--palette-primary-text-1) r g b/.25);overflow:visible}.Autocomplete_paper__Vq6DC .Autocomplete_listboxScrolled__n34NV .Autocomplete_sticky__0-eTa:after{background:linear-gradient(0deg,rgb(from var(--corvaui-background) r g b/0) 0,rgb(from var(--corvaui-background) r g b/1) 100%);content:"";height:8px;inset:100% 0 auto 0;margin-top:1px;position:absolute}.Autocomplete_paper__Vq6DC .MuiAutocomplete-noOptions{align-items:center;color:var(--palette-primary-text-6);display:flex;font-size:12px;font-style:italic;justify-content:center;min-height:31px;padding:0}.Autocomplete_paper__Vq6DC .MuiAutocomplete-groupLabel{background:var(--corvaui-background)!important;color:var(--palette-primary-text-7);font-size:12px;font-weight:400;line-height:16px}.Autocomplete_paper__Vq6DC .MuiAutocomplete-groupLabel:not(:empty){padding-top:8px}.Autocomplete_paper__Vq6DC .MuiAutocomplete-listbox li+li .MuiAutocomplete-groupLabel:not(:empty){margin-top:8px}.Autocomplete_checkboxSmall__TjdiN{margin-right:-8px}.Autocomplete_checkboxMedium__LUbff{margin-right:-12px}.Autocomplete_selectedValue__iGHNh{max-width:100%;overflow:hidden}.Autocomplete_selectedValueChip__5QOEK{flex:0 0 auto;margin:-3px 0;max-width:calc(33% - 8px)}.Autocomplete_inputContainer__RKk5j{flex-wrap:wrap;position:relative;row-gap:14px}.Autocomplete_inputContainer__RKk5j .Autocomplete_selectedValue__iGHNh{font-size:inherit;line-height:inherit;max-width:50%}.Autocomplete_prefix__WzSbL{display:contents}.Autocomplete_input__FHTVO{flex:1 1;max-width:100%;min-width:150px}.Autocomplete_withArrow__pNaNX .Autocomplete_input__FHTVO,.Autocomplete_withClear__RGtWV .Autocomplete_input__FHTVO{padding-right:24px}.Autocomplete_withArrow__pNaNX.Autocomplete_withClear__RGtWV .Autocomplete_input__FHTVO{padding-right:48px}.Autocomplete_suffix__y3P7i{bottom:calc(var(--corvaui-textinput-inputheight)/2 + 6px);height:var(--corvaui-textinput-inputheight);position:absolute;right:7px;transform:translateY(50%)}.Autocomplete_readOnlyInput__mD5xQ{cursor:inherit}');export{o as default};
2
2
  //# sourceMappingURL=Autocomplete.scss.js.map
@@ -227,7 +227,7 @@ const validateDsn = (dsn) => {
227
227
 
228
228
  const MCP_SERVER_VERSION = '1.0.0';
229
229
 
230
- var version = "3.53.0-9";
230
+ var version = "3.53.0";
231
231
 
232
232
  const CORVA_UI_VERSION = version;
233
233
 
@@ -16838,6 +16838,7 @@ var clientsData = [
16838
16838
  "audits",
16839
16839
  "dataset_audits",
16840
16840
  "permission_audits",
16841
+ "group_membership_audits",
16841
16842
  "provisioning_subscription_audits",
16842
16843
  "platform_subscription_audits",
16843
16844
  "purchase_subscription_audits",
@@ -39510,6 +39511,111 @@ var clientsData = [
39510
39511
  }
39511
39512
  }
39512
39513
  },
39514
+ {
39515
+ path: "/v2/group_membership_audits",
39516
+ method: "GET",
39517
+ summary: "List Group Membership Audits",
39518
+ tags: [
39519
+ "Audits"
39520
+ ],
39521
+ parameters: [
39522
+ {
39523
+ name: "action_name",
39524
+ "in": "query",
39525
+ type: "string",
39526
+ required: false,
39527
+ description: "Search by action (add, remove)"
39528
+ },
39529
+ {
39530
+ name: "user_email",
39531
+ "in": "query",
39532
+ type: "string",
39533
+ required: false,
39534
+ description: "Searches by performer email"
39535
+ },
39536
+ {
39537
+ name: "target_user_email",
39538
+ "in": "query",
39539
+ type: "string",
39540
+ required: false,
39541
+ description: "Search by target user email"
39542
+ },
39543
+ {
39544
+ name: "group_name",
39545
+ "in": "query",
39546
+ type: "string",
39547
+ required: false,
39548
+ description: "Search by group name"
39549
+ },
39550
+ {
39551
+ name: "company_id",
39552
+ "in": "query",
39553
+ type: "integer",
39554
+ required: false,
39555
+ description: "Filter by company"
39556
+ },
39557
+ {
39558
+ name: "start",
39559
+ "in": "query",
39560
+ type: "integer",
39561
+ required: false,
39562
+ description: "Search by start time as a Unix timestamp"
39563
+ },
39564
+ {
39565
+ name: "end",
39566
+ "in": "query",
39567
+ type: "integer",
39568
+ required: false,
39569
+ description: "Search by end time as a Unix timestamp"
39570
+ },
39571
+ {
39572
+ name: "page",
39573
+ "in": "query",
39574
+ type: "integer",
39575
+ required: false,
39576
+ description: "Number of page"
39577
+ },
39578
+ {
39579
+ name: "per_page",
39580
+ "in": "query",
39581
+ type: "integer",
39582
+ required: false,
39583
+ description: "Number of items to list per page"
39584
+ },
39585
+ {
39586
+ name: "sort",
39587
+ "in": "query",
39588
+ type: "string",
39589
+ required: false,
39590
+ description: "One or more fields to sort by. Prefix with a - for descending order. Ex: action, -created_at"
39591
+ },
39592
+ {
39593
+ name: "order",
39594
+ "in": "query",
39595
+ type: "string",
39596
+ required: false,
39597
+ description: "A sorting direction"
39598
+ }
39599
+ ],
39600
+ responses: {
39601
+ "200": {
39602
+ description: "Successful response",
39603
+ schema: "any"
39604
+ },
39605
+ "401": {
39606
+ description: "Authentication error",
39607
+ schema: "any"
39608
+ },
39609
+ "403": {
39610
+ description: "Authorization error",
39611
+ schema: "any"
39612
+ },
39613
+ "404": {
39614
+ description: "Not found error",
39615
+ schema: "any"
39616
+ }
39617
+ }
39618
+ },
39513
39619
  {
39514
39620
  path: "/v2/provisioning_subscription_audits",
39515
39621
  method: "GET",
@@ -39975,6 +40081,13 @@ var clientsData = [
39975
40081
  required: false,
39976
40082
  description: "Filter by corva_v3"
39977
40083
  },
40084
+ {
40085
+ name: "corva_next",
40086
+ "in": "query",
40087
+ type: "boolean",
40088
+ required: false,
40089
+ description: "Filter by corva_next (iOS app)"
40090
+ },
39978
40091
  {
39979
40092
  name: "user_group",
39980
40093
  "in": "query",
@@ -50704,6 +50817,13 @@ var clientsData = [
50704
50817
  required: false,
50705
50818
  description: "Filter by corva_v3"
50706
50819
  },
50820
+ {
50821
+ name: "corva_next",
50822
+ "in": "query",
50823
+ type: "boolean",
50824
+ required: false,
50825
+ description: "Filter by corva_next (iOS app)"
50826
+ },
50707
50827
  {
50708
50828
  name: "user_group",
50709
50829
  "in": "query",
@@ -57899,6 +58019,111 @@ var clientsData = [
57899
58019
  }
57900
58020
  }
57901
58021
  },
58022
+ {
58023
+ path: "/v2/group_membership_audits",
58024
+ method: "GET",
58025
+ summary: "List Group Membership Audits",
58026
+ tags: [
58027
+ "Audits"
58028
+ ],
58029
+ parameters: [
58030
+ {
58031
+ name: "action_name",
58032
+ "in": "query",
58033
+ type: "string",
58034
+ required: false,
58035
+ description: "Search by action (add, remove)"
58036
+ },
58037
+ {
58038
+ name: "user_email",
58039
+ "in": "query",
58040
+ type: "string",
58041
+ required: false,
58042
+ description: "Searches by performer email"
58043
+ },
58044
+ {
58045
+ name: "target_user_email",
58046
+ "in": "query",
58047
+ type: "string",
58048
+ required: false,
58049
+ description: "Search by target user email"
58050
+ },
58051
+ {
58052
+ name: "group_name",
58053
+ "in": "query",
58054
+ type: "string",
58055
+ required: false,
58056
+ description: "Search by group name"
58057
+ },
58058
+ {
58059
+ name: "company_id",
58060
+ "in": "query",
58061
+ type: "integer",
58062
+ required: false,
58063
+ description: "Filter by company"
58064
+ },
58065
+ {
58066
+ name: "start",
58067
+ "in": "query",
58068
+ type: "integer",
58069
+ required: false,
58070
+ description: "Search by start time as a Unix timestamp"
58071
+ },
58072
+ {
58073
+ name: "end",
58074
+ "in": "query",
58075
+ type: "integer",
58076
+ required: false,
58077
+ description: "Search by end time as a Unix timestamp"
58078
+ },
58079
+ {
58080
+ name: "page",
58081
+ "in": "query",
58082
+ type: "integer",
58083
+ required: false,
58084
+ description: "Number of page"
58085
+ },
58086
+ {
58087
+ name: "per_page",
58088
+ "in": "query",
58089
+ type: "integer",
58090
+ required: false,
58091
+ description: "Number of items to list per page"
58092
+ },
58093
+ {
58094
+ name: "sort",
58095
+ "in": "query",
58096
+ type: "string",
58097
+ required: false,
58098
+ description: "One or more fields to sort by. Prefix with a - for descending order. Ex: action, -created_at"
58099
+ },
58100
+ {
58101
+ name: "order",
58102
+ "in": "query",
58103
+ type: "string",
58104
+ required: false,
58105
+ description: "A sorting direction"
58106
+ }
58107
+ ],
58108
+ responses: {
58109
+ "200": {
58110
+ description: "Successful response",
58111
+ schema: "any"
58112
+ },
58113
+ "401": {
58114
+ description: "Authentication error",
58115
+ schema: "any"
58116
+ },
58117
+ "403": {
58118
+ description: "Authorization error",
58119
+ schema: "any"
58120
+ },
58121
+ "404": {
58122
+ description: "Not found error",
58123
+ schema: "any"
58124
+ }
58125
+ }
58126
+ },
57902
58127
  {
57903
58128
  path: "/v2/package_audits",
57904
58129
  method: "GET",
@@ -84552,6 +84777,7 @@ var entries = [
84552
84777
  "audits",
84553
84778
  "dataset_audits",
84554
84779
  "permission_audits",
84780
+ "group_membership_audits",
84555
84781
  "provisioning_subscription_audits",
84556
84782
  "platform_subscription_audits",
84557
84783
  "purchase_subscription_audits",
@@ -84621,7 +84847,7 @@ var entries = [
84621
84847
  ],
84622
84848
  category: "clients",
84623
84849
  importPath: "@corva/ui/clients",
84624
- searchText: "corvaapi main api client for corva platform. provides methods for get, put, patch, post, delete requests. api http request fetch rest get post put delete patch abilitycheck v2 ability_check check_feature check_permission feed activities alerts v1 comments likes toggle definitions context trigger close check templates enable disable acknowledge classify totals details appreviews app_reviews approve decline assets favorites settings type_wells type_well reruns ancestor_ids resolve autocomplete programs clusters pads frac_fleets app_wells wells active_wells rigs active_well well_cache drillout_units frac fleets wirelines dashboardappannotations dashboard_app_annotations last_annotations dashboards users dashboard_apps bulk_create batch_update dashboard_folders dashboard_shares dashboard_folder_shares use clone use_template available_timezones data data_filters data_filters#2 files file sign preview download download_link url security groups assign_users copy_users wellview integration ingest bha frac_stage_design frac_stage_summary frac_stage_summary_calculated job_settings plugs .well-known jwks.json jwks messageproducer message_producer notifications acknowledge_all count unread security_policies companies permissions bulk_destroy grouped picklists items tasks user_token#1 user_token#2 user_token#3 user_token#4 sessions verification schemas export streaks identity_verifiers api_keys deactivate apps install packages upload app_categories categories featured types secrets appdatasets app_datasets mark_followable app_help_contents signed_url applogs app_logs events search apptypes app_types appsettingstemplates app_settings_templates share unshare copy publish appstreamtemplate app_stream_templates appstreamtemplateapp add_app update_app remove_app datasettypes dataset_types datset_types documents document_sections rig_templates aggregated_values rig aggregated values rig_template_categories rig_template_items tiers productsubscriptions product_subscriptions cancel deny platformsubscriptions platform_subscriptions resume provisioningsubscriptions provisioning_subscriptions app_streams purchasesubscriptions purchase_subscriptions subscriptionfeatures subscription_features wellcache corva blacklisteddatasets blacklisted_datasets app metrics app_metrics for_selected_apps appassets packagereviews package_reviews apppurchases app_purchases datasets filtered_by_apps appruns app_runs stop duplicate_check appstream idle_worker_stats create_backfill_stream force_resume batch_destroy update_edr_provider_connection_status appconnection app_connections update_package apperroralert app_error_alerts subscribe unsubscribe usage summaries workflows workflow_content_blocks workflow_apps workflowroles workflow_roles columnmappertemplates column_mapper_templates add_asset remove_asset columnmappertemplatechannels column_mapper_template_channels columnmappertemplaterules column_mapper_template_rules dashboard_workflows ungroup ungroup_all change_asset competitoranalysis competitor_analysis statistics company app_companies appstoretemplates app_store_templates appstoretemplatesections app_store_template_sections app_store_template_section appstorearticles app_store_articles remove_section signedurl audits dataset_audits permission_audits provisioning_subscription_audits platform_subscription_audits purchase_subscription_audits event audit appusage usage_analytics app_usage usage_list view_date_list top_apps top_users total_usage_trend partialwellreruns partial_reruns list start_merging fail restart app_progress partialwellrerunappprogresses app_progresses searchsuggestions search_suggestions goals projects projectfolders project_folders projectfiles project_files registeredmodels registered_models appschedule app_schedules bulk_update_status package_audits apikey api_keys_management activate edrproviders edr_providers test_connection api_key_audits typewells padfracfleets pad_frac_fleets fracfleetcontracts frac_fleet_contracts interventionunits intervention_units interventionunitevents intervention_unit_events data export app data_export_app column_fields column_fields_list flat activity_code_mappings countries country_list revoltchat revolt_chat_sessions interventionunitreruns intervention_unit_reruns"
84850
+ searchText: "corvaapi main api client for corva platform. provides methods for get, put, patch, post, delete requests. api http request fetch rest get post put delete patch abilitycheck v2 ability_check check_feature check_permission feed activities alerts v1 comments likes toggle definitions context trigger close check templates enable disable acknowledge classify totals details appreviews app_reviews approve decline assets favorites settings type_wells type_well reruns ancestor_ids resolve autocomplete programs clusters pads frac_fleets app_wells wells active_wells rigs active_well well_cache drillout_units frac fleets wirelines dashboardappannotations dashboard_app_annotations last_annotations dashboards users dashboard_apps bulk_create batch_update dashboard_folders dashboard_shares dashboard_folder_shares use clone use_template available_timezones data data_filters data_filters#2 files file sign preview download download_link url security groups assign_users copy_users wellview integration ingest bha frac_stage_design frac_stage_summary frac_stage_summary_calculated job_settings plugs .well-known jwks.json jwks messageproducer message_producer notifications acknowledge_all count unread security_policies companies permissions bulk_destroy grouped picklists items tasks user_token#1 user_token#2 user_token#3 user_token#4 sessions verification schemas export streaks identity_verifiers api_keys deactivate apps install packages upload app_categories categories featured types secrets appdatasets app_datasets mark_followable app_help_contents signed_url applogs app_logs events search apptypes app_types appsettingstemplates app_settings_templates share unshare copy publish appstreamtemplate app_stream_templates appstreamtemplateapp add_app update_app remove_app datasettypes dataset_types datset_types documents document_sections rig_templates aggregated_values rig aggregated values rig_template_categories rig_template_items tiers productsubscriptions product_subscriptions cancel deny platformsubscriptions platform_subscriptions resume provisioningsubscriptions provisioning_subscriptions app_streams purchasesubscriptions purchase_subscriptions subscriptionfeatures subscription_features wellcache corva blacklisteddatasets blacklisted_datasets app metrics app_metrics for_selected_apps appassets packagereviews package_reviews apppurchases app_purchases datasets filtered_by_apps appruns app_runs stop duplicate_check appstream idle_worker_stats create_backfill_stream force_resume batch_destroy update_edr_provider_connection_status appconnection app_connections update_package apperroralert app_error_alerts subscribe unsubscribe usage summaries workflows workflow_content_blocks workflow_apps workflowroles workflow_roles columnmappertemplates column_mapper_templates add_asset remove_asset columnmappertemplatechannels column_mapper_template_channels columnmappertemplaterules column_mapper_template_rules dashboard_workflows ungroup ungroup_all change_asset competitoranalysis competitor_analysis statistics company app_companies appstoretemplates app_store_templates appstoretemplatesections app_store_template_sections app_store_template_section appstorearticles app_store_articles remove_section signedurl audits dataset_audits permission_audits group_membership_audits provisioning_subscription_audits platform_subscription_audits purchase_subscription_audits event audit appusage usage_analytics app_usage usage_list view_date_list top_apps top_users total_usage_trend partialwellreruns partial_reruns list start_merging fail restart app_progress partialwellrerunappprogresses app_progresses searchsuggestions search_suggestions goals projects projectfolders project_folders projectfiles project_files registeredmodels registered_models appschedule app_schedules bulk_update_status package_audits apikey api_keys_management activate edrproviders edr_providers test_connection api_key_audits typewells padfracfleets pad_frac_fleets fracfleetcontracts frac_fleet_contracts interventionunits intervention_units interventionunitevents intervention_unit_events data export app data_export_app column_fields column_fields_list flat activity_code_mappings countries country_list revoltchat revolt_chat_sessions interventionunitreruns intervention_unit_reruns"
84625
84851
  },
84626
84852
  {
84627
84853
  id: "client-corvaDataAPI",