@corva/dc-platform-shared 0.0.0-6e84283 → 0.0.0-761ed8d

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 (79) hide show
  1. package/CLI/components/App/App.js +1 -1
  2. package/CLI/components/App/components/AppBar/AppBar.js +1 -1
  3. package/CLI/constants/index.js +1 -1
  4. package/CLI/context/auth.js +1 -1
  5. package/CLI/hocs/effects/useProvideAuth/api.js +1 -1
  6. package/CLI/hocs/effects/useProvideAuth/constants.js +1 -1
  7. package/CLI/hocs/effects/useProvideAuth/useProvideAuth.js +1 -1
  8. package/CLI/hocs/utils.js +1 -1
  9. package/CLI/hocs/withAppDataProviderHOC.js +1 -1
  10. package/CLI/hocs/withCLIAppSettingsHOC.js +1 -1
  11. package/CLI/hocs/withCorvaMagicHOC.js +1 -1
  12. package/CLI/hocs/withDevCenterRouterHOC.js +1 -1
  13. package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
  14. package/CLI/hocs/withPDFLayoutHOC.js +1 -1
  15. package/CLI/hocs/withReactRouterHOC.js +1 -1
  16. package/CLI/screens/LoginScreen/LoginScreen.js +1 -1
  17. package/CLI/screens/LoginScreen/components/Auth.js +1 -1
  18. package/CLI/screens/LoginScreen/components/AuthStep.js +1 -1
  19. package/CLI/screens/LoginScreen/components/EmailStep.js +1 -1
  20. package/CLI/screens/LoginScreen/components/SSOButton.js +1 -1
  21. package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
  22. package/README.md +63 -15
  23. package/cjs/devcenter/webpack/DevServerEntryPoint.js +1 -1
  24. package/cjs/devcenter/webpack/DevServerIsolatedAppEntryPoint.js +1 -1
  25. package/cjs/devcenter/webpack/MapboxGlDevSetupEntryPoint.js +1 -0
  26. package/cjs/devcenter/webpack/constants.js +1 -1
  27. package/cjs/devcenter/webpack/createAdaptiveRoot.js +1 -0
  28. package/cjs/devcenter/webpack/plugins/checkCorvaUIVersion.js +11 -1
  29. package/cjs/devcenter/webpack/utils/middlewares.js +1 -1
  30. package/cjs/devcenter/webpack/utils/serializeDotEnv.js +1 -1
  31. package/cjs/devcenter/webpack/validators/dependencies.js +1 -1
  32. package/cjs/devcenter/webpack/validators/index.js +1 -1
  33. package/cjs/devcenter/webpack/webpack.config.common.js +1 -1
  34. package/cjs/devcenter/webpack/webpack.config.dev.js +1 -1
  35. package/cjs/devcenter/webpack/webpack.config.prod.js +1 -1
  36. package/clients/auth0/index.js +1 -1
  37. package/components/GridLockButton/index.js +1 -1
  38. package/components/Login/components/Chip.js +1 -1
  39. package/components/Login/components/EmailField.js +1 -1
  40. package/components/Login/components/HiddenEmailField.js +1 -1
  41. package/components/Login/components/Login.js +1 -1
  42. package/components/Login/components/OrDivider.js +1 -1
  43. package/components/Login/components/PasswordField.js +1 -1
  44. package/components/Login/components/StepContent.js +1 -1
  45. package/components/Login/components/StepFooter.js +1 -1
  46. package/components/Login/components/StepHeader.js +1 -1
  47. package/components/Login/components/VerificationStep.js +1 -1
  48. package/ext-esm/auth0-js/dist/auth0.min.esm.js +1 -1
  49. package/package.json +1 -1
  50. package/utils/devcenter.js +1 -1
  51. package/utils/recaptcha.js +1 -1
  52. package/vite/corva-vite-config.mjs +872 -0
  53. package/_virtual/_commonjsHelpers.js +0 -1
  54. package/_virtual/arrayLikeToArray.js +0 -1
  55. package/_virtual/arrayWithHoles.js +0 -1
  56. package/_virtual/arrayWithoutHoles.js +0 -1
  57. package/_virtual/iterableToArray.js +0 -1
  58. package/_virtual/iterableToArrayLimit.js +0 -1
  59. package/_virtual/nonIterableRest.js +0 -1
  60. package/_virtual/nonIterableSpread.js +0 -1
  61. package/_virtual/regeneratorRuntime.js +0 -1
  62. package/_virtual/typeof.js +0 -1
  63. package/_virtual/unsupportedIterableToArray.js +0 -1
  64. package/ext-cjs/@babel/runtime/helpers/arrayLikeToArray.js +0 -1
  65. package/ext-cjs/@babel/runtime/helpers/arrayWithHoles.js +0 -1
  66. package/ext-cjs/@babel/runtime/helpers/arrayWithoutHoles.js +0 -1
  67. package/ext-cjs/@babel/runtime/helpers/asyncToGenerator.js +0 -1
  68. package/ext-cjs/@babel/runtime/helpers/defineProperty.js +0 -1
  69. package/ext-cjs/@babel/runtime/helpers/iterableToArray.js +0 -1
  70. package/ext-cjs/@babel/runtime/helpers/iterableToArrayLimit.js +0 -1
  71. package/ext-cjs/@babel/runtime/helpers/nonIterableRest.js +0 -1
  72. package/ext-cjs/@babel/runtime/helpers/nonIterableSpread.js +0 -1
  73. package/ext-cjs/@babel/runtime/helpers/regeneratorRuntime.js +0 -1
  74. package/ext-cjs/@babel/runtime/helpers/slicedToArray.js +0 -1
  75. package/ext-cjs/@babel/runtime/helpers/taggedTemplateLiteral.js +0 -1
  76. package/ext-cjs/@babel/runtime/helpers/toConsumableArray.js +0 -1
  77. package/ext-cjs/@babel/runtime/helpers/typeof.js +0 -1
  78. package/ext-cjs/@babel/runtime/helpers/unsupportedIterableToArray.js +0 -1
  79. package/ext-cjs/@babel/runtime/regenerator/index.js +0 -1
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/slicedToArray";import{useReducer as o,useEffect as t}from"react";import e from"classnames";import{MuiThemeProvider as i}from"@material-ui/core";import{MuiPickersUtilsProvider as m}from"@material-ui/pickers";import n from"@date-io/moment";import a from"moment";import{isPDFReportView as p}from"@corva/ui/utils/reports";import{LOCAL_STORAGE_APP_THEME_KEY as c}from"@corva/ui/constants/localStorageKeys";import{NotificationsContainer as s}from"@corva/ui/components";import{THEMES as l}from"@corva/ui/constants/theme";import{darkTheme as u,lightTheme as f}from"@corva/ui/config/theme";import{setThemeVariables as d}from"@corva/ui/utils/themeVariables";import{LOGIN_ROUTE_REG_EXP as h}from"../../constants/index.js";import v from"./components/AppBar/AppBar.js";import{AuthContext as A}from"../../context/auth.js";import g from"../../hocs/effects/useProvideAuth/useProvideAuth.js";import j from"./App.css.js";import{jsx as b,jsxs as x,Fragment as I}from"react/jsx-runtime";function K(K){var C,D=K.children,P=K.router,R=g(P),S=!h.test(P.location.pathname)&&!R.loading,T=o((function(r){return r+1}),0),y=r(T,2)[1],B=null!==(C=localStorage.getItem(c))&&void 0!==C?C:l.DARK,N=!S||!p&&B===l.DARK;t((function(){return d(N)}),[N]);return b(A.Provider,{value:R,children:b(i,{theme:N?u:f,children:b(m,{libInstance:a,utils:n,children:x(I,{children:[!S&&D,S&&x("div",{className:j.app,children:[b(s,{}),b(v,{toggleTheme:function(){localStorage.setItem(c,N?l.LIGHT:l.DARK),y()}}),b("div",{className:e(j.appContent,p&&j.pdfAppContent,!N&&j.lightAppContent),children:D})]})]})})})})}export{K as default};
1
+ import{useReducer as o,useEffect as t}from"react";import r from"classnames";import{MuiThemeProvider as e}from"@material-ui/core";import{MuiPickersUtilsProvider as m}from"@material-ui/pickers";import i from"@date-io/moment";import a from"moment";import{isPDFReportView as n}from"@corva/ui/utils/reports";import{LOCAL_STORAGE_APP_THEME_KEY as p}from"@corva/ui/constants/localStorageKeys";import{NotificationsContainer as s}from"@corva/ui/components";import{THEMES as c}from"@corva/ui/constants/theme";import{darkTheme as l,lightTheme as f}from"@corva/ui/config/theme";import{setThemeVariables as u}from"@corva/ui/utils/themeVariables";import{LOGIN_ROUTE_REG_EXP as h}from"../../constants/index.js";import d from"./components/AppBar/AppBar.js";import{AuthContext as v}from"../../context/auth.js";import A from"../../hocs/effects/useProvideAuth/useProvideAuth.js";import g from"./App.css.js";import{jsx as j,jsxs as x,Fragment as I}from"react/jsx-runtime";function K({children:K,router:C}){const D=A(C),P=!h.test(C.location.pathname)&&!D.loading,[,R]=o((o=>o+1),0),S=localStorage.getItem(p)??c.DARK,b=!P||!n&&S===c.DARK;t((()=>u(b)),[b]);return j(v.Provider,{value:D,children:j(e,{theme:b?l:f,children:j(m,{libInstance:a,utils:i,children:x(I,{children:[!P&&K,P&&x("div",{className:g.app,children:[j(s,{}),j(d,{toggleTheme:()=>{localStorage.setItem(p,b?c.LIGHT:c.DARK),R()}}),j("div",{className:r(g.appContent,n&&g.pdfAppContent,!b&&g.lightAppContent),children:K})]})]})})})})}export{K as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{useState as o}from"react";import t from"prop-types";import{makeStyles as r,useTheme as a,AppBar as n,Toolbar as i,FormControlLabel as l,Checkbox as c,Tooltip as s,IconButton as m,Typography as p,Menu as d,MenuItem as u}from"@material-ui/core";import h from"@material-ui/icons/AccountCircle";import f from"@corva/ui/components/SwitchControl";import{FEATURE_FLAG_APPS_ISOLATION as g}from"@corva/ui/clients/clientStorage";import{LOCAL_STORAGE_PDF_REPORT_VIEW_KEY as v}from"@corva/ui/constants/localStorageKeys";import{isPDFReportView as b}from"@corva/ui/utils/reports";import C from"../../../../assets/DevCenterLogo.js";import{useAuth as w}from"../../../../context/auth.js";import{jsxs as B,jsx as k}from"react/jsx-runtime";var S=r((function(e){return{grow:{flexGrow:1},flex:{display:"flex"},appBar:{backgroundColor:"rgb(30, 31, 31)"},iconButtonRoot:{borderRadius:"unset"},userProfileIcon:{marginLeft:4},headerControl:{marginRight:32},formControlLabel:{fontSize:14}}}));function A(t){var r,A,L=t.toggleTheme,I=S(),N=w(),T=N.user,x=N.logout,_=a(),y=o(null),z=e(y,2),R=z[0],D=z[1],O=Boolean(R),P=function(){return D(null)},j="".concat(null==T||null===(r=T.first_name)||void 0===r?void 0:r[0]).concat(null==T||null===(A=T.last_name)||void 0===A?void 0:A[0]).toUpperCase();return B("div",{children:[k(n,{position:"static",className:I.appBar,children:B(i,{children:[k(C,{}),k("div",{className:I.grow}),k(l,{control:k(c,{checked:"false"!==localStorage.getItem(g),size:"small",onChange:function(e){localStorage.setItem(g,e.target.checked),window.location.reload()}}),label:"App Isolation",classes:{label:I.formControlLabel},className:I.headerControl}),k(l,{control:k(c,{"data-testid":"".concat("AppBar","_pdfReport"),checked:b,size:"small",onChange:function(e){localStorage.setItem(v,e.target.checked),window.location.reload()}}),label:"PDF report view",classes:{label:I.formControlLabel},className:I.headerControl}),!b&&k(s,{title:"Switch to light theme to tune your app for PDF reports",placement:"bottom",children:k("div",{children:k(f,{"data-testid":"".concat("AppBar","_themeSwitch"),className:I.headerControl,leftLabel:"Dark Theme",rightLabel:"Light Theme",onChange:L,checked:_.isLightTheme,size:"small",title:""})})}),k("div",{children:k(m,{edge:"end","aria-label":"account of current user","aria-controls":"app-bar-menu","aria-haspopup":"true",onClick:function(e){return D(e.currentTarget)},color:"inherit",className:I.iconButtonRoot,children:B("div",{className:I.flex,children:[k(p,{"data-testid":"".concat("AppBar","_userInitials"),children:j}),k(h,{className:I.userProfileIcon})]})})})]})}),k(d,{"data-testid":"".concat("AppBar","_userDropdown"),anchorEl:R,id:"app-bar-menu",keepMounted:!0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:O,onClose:P,children:k(u,{"data-testid":"".concat("AppBar","_signOutMenuItem"),onClick:function(){x(),P()},children:"Sign Out"})})]})}A.propTypes={toggleTheme:t.func.isRequired};export{A as default};
1
+ import{useState as e}from"react";import o from"prop-types";import{makeStyles as r,useTheme as t,AppBar as a,Toolbar as l,FormControlLabel as i,Checkbox as n,Tooltip as c,IconButton as s,Typography as p,Menu as m,MenuItem as d}from"@material-ui/core";import h from"@material-ui/icons/AccountCircle";import u from"@corva/ui/components/SwitchControl";import{FEATURE_FLAG_APPS_ISOLATION as g}from"@corva/ui/clients/clientStorage";import{LOCAL_STORAGE_PDF_REPORT_VIEW_KEY as f}from"@corva/ui/constants/localStorageKeys";import{isPDFReportView as C}from"@corva/ui/utils/reports";import b from"../../../../assets/DevCenterLogo.js";import{useAuth as v}from"../../../../context/auth.js";import{jsxs as w,jsx as B}from"react/jsx-runtime";const k=r((e=>({grow:{flexGrow:1},flex:{display:"flex"},appBar:{backgroundColor:"rgb(30, 31, 31)"},iconButtonRoot:{borderRadius:"unset"},userProfileIcon:{marginLeft:4},headerControl:{marginRight:32},formControlLabel:{fontSize:14}})));function S({toggleTheme:o}){const r=k(),{user:S,logout:L}=v(),A=t(),[I,N]=e(null),x=Boolean(I),T=()=>N(null),_=`${S?.first_name?.[0]}${S?.last_name?.[0]}`.toUpperCase();return w("div",{children:[B(a,{position:"static",className:r.appBar,children:w(l,{children:[B(b,{}),B("div",{className:r.grow}),B(i,{control:B(n,{checked:"false"!==localStorage.getItem(g),size:"small",onChange:e=>{localStorage.setItem(g,e.target.checked),window.location.reload()}}),label:"App Isolation",classes:{label:r.formControlLabel},className:r.headerControl}),B(i,{control:B(n,{"data-testid":"AppBar_pdfReport",checked:C,size:"small",onChange:e=>{localStorage.setItem(f,e.target.checked),window.location.reload()}}),label:"PDF report view",classes:{label:r.formControlLabel},className:r.headerControl}),!C&&B(c,{title:"Switch to light theme to tune your app for PDF reports",placement:"bottom",children:B("div",{children:B(u,{"data-testid":"AppBar_themeSwitch",className:r.headerControl,leftLabel:"Dark Theme",rightLabel:"Light Theme",onChange:o,checked:A.isLightTheme,size:"small",title:""})})}),B("div",{children:B(s,{edge:"end","aria-label":"account of current user","aria-controls":"app-bar-menu","aria-haspopup":"true",onClick:e=>N(e.currentTarget),color:"inherit",className:r.iconButtonRoot,children:w("div",{className:r.flex,children:[B(p,{"data-testid":"AppBar_userInitials",children:_}),B(h,{className:r.userProfileIcon})]})})})]})}),B(m,{"data-testid":"AppBar_userDropdown",anchorEl:I,id:"app-bar-menu",keepMounted:!0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:x,onClose:T,children:B(d,{"data-testid":"AppBar_signOutMenuItem",onClick:()=>{L(),T()},children:"Sign Out"})})]})}S.propTypes={toggleTheme:o.func.isRequired};export{S as default};
@@ -1 +1 @@
1
- var p=new RegExp("^/login.*$"),a="https://app.corva.ai/login/help";export{p as LOGIN_ROUTE_REG_EXP,a as NEED_HELP_EXTERNAL_LINK};
1
+ const p=new RegExp("^/login.*$"),o="https://app.corva.ai/login/help";export{p as LOGIN_ROUTE_REG_EXP,o as NEED_HELP_EXTERNAL_LINK};
@@ -1 +1 @@
1
- import{createContext as r,useContext as t}from"react";var n=r(null),o=function(){return t(n)};export{n as AuthContext,o as useAuth};
1
+ import{createContext as o,useContext as r}from"react";const t=o(null),c=()=>r(t);export{t as AuthContext,c as useAuth};
@@ -1 +1 @@
1
- import{post as r}from"@corva/ui/clients/api/apiCore";var e=function(e){return r("/v1/user_token",e)},i=function(e){return r("/v1/sessions/verification/request",e)};export{e as getUserToken,i as requestVerification};
1
+ import{post as e}from"@corva/ui/clients/api/apiCore";const i=i=>e("/v1/user_token",i),o=i=>e("/v1/sessions/verification/request",i);export{i as getUserToken,o as requestVerification};
@@ -1 +1 @@
1
- var i={wrongEmailOrPassword:"Wrong user name or password",missingVerificationCode:'"Missing verification code',invalidVerificationCode:"Invalid verification code"};export{i as ERRORS};
1
+ const i={wrongEmailOrPassword:"Wrong user name or password",missingVerificationCode:'"Missing verification code',invalidVerificationCode:"Invalid verification code"};export{i as ERRORS};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{useState as e,useRef as o,useEffect as i}from"react";import{get as s}from"lodash";import*as a from"@corva/ui/clients/jsonApi";import{updateUserUnits as u}from"@corva/ui/utils/convert";import c from"../../../../clients/auth0/index.js";import{LOGIN_ROUTE_REG_EXP as m}from"../../../constants/index.js";import{ERRORS as l}from"./constants.js";import{getUserToken as p}from"./api.js";var f=function(t){return fetch("/dotenv",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})};function d(d){var h=e(null),v=n(h,2),y=v[0],g=v[1],w=e(!0),x=n(w,2),C=x[0],_=x[1],b=e(null),T=n(b,2),U=T[0],j=T[1],A=o(null);function k(){return O.apply(this,arguments)}function O(){return(O=t(r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _(!0),t.next=3,a.getCurrentUser();case 3:(n=t.sent)?(g(n),u({userUnits:n.unit_system,companyUnits:s(n,"company.unit_system"),companyCustomUnitSystem:s(n,"company.custom_unit_system"),userCustomUnitSystem:s(n,"custom_unit_system"),companyCustomUnits:s(n,"company.custom_units")})):d.push("/login"),_(!1);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}A.current||(A.current=new c);var V,E,H=(V=t(r.mark((function t(){var n,e,o,i,s,a,u,c=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>0&&void 0!==c[0]?c[0]:"",e=c.length>1?c[1]:void 0,o=c.length>2?c[2]:void 0,j(null),_(!0),i={auth:e},n&&(i.platform=n),t.prev=7,t.next=10,p(i);case 10:s=t.sent,f({AUTH_TOKEN:s.jwt}),k().then(o),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(7),null!==(a=t.t0.isInvalidVerificationCode)&&void 0!==a&&a.call(t.t0)?j(l.invalidVerificationCode):null!==(u=t.t0.isMissingVerificationCode)&&void 0!==u&&u.call(t.t0)?j(l.missingVerificationCode):j(l.wrongEmailOrPassword);case 18:_(!1);case 19:case"end":return t.stop()}}),t,null,[[7,15]])}))),function(){return V.apply(this,arguments)}),N=(E=t(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f({AUTH_TOKEN:""}),t.next=3,a.logout();case 3:d.push("/login");case 4:case"end":return t.stop()}}),t)}))),function(){return E.apply(this,arguments)});return i((function(){m.test(d.location.pathname)?_(!1):k()}),[]),{user:y,loading:C,error:U,login:H,logout:N,auth0:A.current}}export{d as default};
1
+ import{useState as t,useRef as n,useEffect as o}from"react";import{get as i}from"lodash";import*as s from"@corva/ui/clients/jsonApi";import{updateUserUnits as r}from"@corva/ui/utils/convert";import a from"../../../../clients/auth0/index.js";import{LOGIN_ROUTE_REG_EXP as e}from"../../../constants/index.js";import{ERRORS as c}from"./constants.js";import{getUserToken as m}from"./api.js";const u=t=>fetch("/dotenv",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});function l(l){const[p,f]=t(null),[y,d]=t(!0),[h,g]=t(null),C=n(null);async function _(){d(!0);const t=await s.getCurrentUser();t?(f(t),r({userUnits:t.unit_system,companyUnits:i(t,"company.unit_system"),companyCustomUnitSystem:i(t,"company.custom_unit_system"),userCustomUnitSystem:i(t,"custom_unit_system"),companyCustomUnits:i(t,"company.custom_units")})):l.push("/login"),d(!1)}C.current||(C.current=new a);return o((()=>{if(e.test(l.location.pathname))return d(!1);_()}),[l.location.pathname]),{user:p,loading:y,error:h,login:async(t="",n,o)=>{g(null),d(!0);const i={auth:n};t&&(i.platform=t);try{const t=await m(i);u({AUTH_TOKEN:t.jwt}),_().then(o)}catch(t){t.isInvalidVerificationCode?.()?g(c.invalidVerificationCode):t.isMissingVerificationCode?.()?g(c.missingVerificationCode):g(c.wrongEmailOrPassword)}d(!1)},logout:async()=>{u({AUTH_TOKEN:""}),await s.logout(),l.push("/login")},auth0:C.current}}export{l as default};
package/CLI/hocs/utils.js CHANGED
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{DEFAULT_APP_SIZE as t}from"@corva/ui/constants/apps";function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function o(e){return JSON.parse(localStorage.getItem(e))||{}}function i(e,t){var r=o(e)||{};localStorage.setItem(e,JSON.stringify(n(n({},r),t)))}var c=function(e){var r,i,c,l,p=null!==(r=null==e||null===(i=e.application)||void 0===i||null===(c=i.ui)||void 0===c?void 0:c.initial_size)&&void 0!==r?r:t;return o(null==e||null===(l=e.application)||void 0===l?void 0:l.key).coordinates||n(n({},p),{},{x:0,y:0})};export{c as getAppCoordinates,o as getLocalAppData,i as updateLocalAppData};
1
+ import{DEFAULT_APP_SIZE as t}from"@corva/ui/constants/apps";function o(t){return JSON.parse(localStorage.getItem(t))||{}}function i(t,i){const n=o(t)||{};localStorage.setItem(t,JSON.stringify({...n,...i}))}const n=i=>{const n=i?.application?.ui?.initial_size??t;return o(i?.application?.key).coordinates||{...n,x:0,y:0}};export{n as getAppCoordinates,o as getLocalAppData,i as updateLocalAppData};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{DEV_CENTER_CLI_APP_ID as r}from"@corva/ui/constants";import{getFeatureFlagAppsIsolation as o}from"@corva/ui/clients/clientStorage";import{AppsDataProvider as n,DevCenterIsolatedApp as i}from"@corva/ui/components";import{jsx as p}from"react/jsx-runtime";var a=["manifest","dashboardProps","coordinates"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function c(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?s(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var m=o(),f=function(e){var o=e.CLIAppComponent,s=e.CLIAppSettings,f=e.packageJson;return function(e){var u=e.manifest,b=e.dashboardProps,l=e.coordinates,d=t(e,a),O=u.application.key,g=f.version,v={app:{app_key:O,platform:"dev_center"},id:r,package:{manifest:u,build:"".concat(O,"-").concat(g),version:g},segment:u.application.segments,settings:d.settings};return p(n,{dashboardAssetId:b.assetId,apps:[v],children:p(i,c(c({},d),{},{isIsolationFeatureEnabled:m,app:v,coordinates:l,CLIAppComponent:o,CLIAppSettings:s}))})}};export{f as default};
1
+ import{DEV_CENTER_CLI_APP_ID as t}from"@corva/ui/constants";import{getFeatureFlagAppsIsolation as e}from"@corva/ui/clients/clientStorage";import{AppsDataProvider as o,DevCenterIsolatedApp as s}from"@corva/ui/components";import{jsx as a}from"react/jsx-runtime";const n=e(),p=({CLIAppComponent:e,CLIAppSettings:p,packageJson:i})=>({manifest:r,dashboardProps:c,coordinates:m,...d})=>{const l=r.application.key,{version:g}=i,f={app:{app_key:l,platform:"dev_center"},id:t,package:{manifest:r,build:`${l}-${g}`,version:g},segment:r.application.segments,settings:d.settings};return a(o,{dashboardAssetId:c.assetId,apps:[f],children:a(s,{...d,isIsolationFeatureEnabled:n,app:f,coordinates:m,CLIAppComponent:e,CLIAppSettings:p})})};export{p as default};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as r}from"react";import{getLocalAppData as n,updateLocalAppData as o}from"./utils.js";import{useAuth as i}from"../context/auth.js";import{jsx as c}from"react/jsx-runtime";function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?s(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a=function(s){return function(a){var f=i().user,u=a.manifest.application.key,m=r(n(u).settings||{}),b=e(m,2),O=b[0],l=b[1];return c(s,p(p({},a),{},{currentUser:f,settings:O,onSettingChange:function(e,r){var n=p(p({},O||{}),{},t({},e,r));o(u,{settings:n}),l(n)},onSettingsChange:function(t){var e=p(p({},O||{}),t);o(u,{settings:e}),l(e)}}))}};export{a as default};
1
+ import{useState as t}from"react";import{getLocalAppData as s,updateLocalAppData as e}from"./utils.js";import{useAuth as n}from"../context/auth.js";import{jsx as r}from"react/jsx-runtime";const o=o=>i=>{const{user:a}=n(),m=i.manifest.application.key,[c,g]=t(s(m).settings||{});return r(o,{...i,currentUser:a,settings:c,onSettingChange:(t,s)=>{const n={...c||{},[t]:s};e(m,{settings:n}),g(n)},onSettingsChange:t=>{const s={...c||{},...t};e(m,{settings:s}),g(s)}})};export{o as default};
@@ -1 +1 @@
1
- import*as o from"@corva/ui";import{ProvidePermissions as r}from"@corva/ui/permissions";import"@corva/ui/styles/index.global.css.js";import"@corva/ui/styles/reactVirtualized.global.css.js";import"@corva/ui/styles/emojiMart.global.css.js";import"@corva/ui/styles/mapbox.global.css.js";import"@corva/ui/styles/lightbox.global.css.js";import"@corva/ui/styles/generatedThemesVariables.global.css.js";import"@corva/ui/styles/customScrollbars.global.css.js";import"@corva/ui/config/initGlobalDependencies";import{isPDFReportView as t}from"@corva/ui/utils/reports";import s from"./withAppDataProviderHOC.js";import i from"./withCLIAppSettingsHOC.js";import a from"./withReactRouterHOC.js";import e from"./withGridLayoutHOC/withGridLayoutHOC.js";import m from"./withPDFLayoutHOC.js";import{withDevCenterRouterHOC as p}from"./withDevCenterRouterHOC.js";import{jsx as c}from"react/jsx-runtime";window["@corva/ui"]=o;var l=function(o){var l=o.component,n=o.settings,u=o.manifest,v=o.packageJson;return function(){var o=i(s({CLIAppComponent:l,CLIAppSettings:n,packageJson:v})),f=t?m(o):e(o),g=a(p(f));return c(r,{children:c(g,{manifest:u,dashboardProps:{}})})}};export{l as default};
1
+ import*as o from"@corva/ui";import{ProvidePermissions as r}from"@corva/ui/permissions";import"@corva/ui/styles/index.global.css.js";import"@corva/ui/styles/reactVirtualized.global.css.js";import"@corva/ui/styles/emojiMart.global.css.js";import"@corva/ui/styles/mapbox.global.css.js";import"@corva/ui/styles/lightbox.global.css.js";import"@corva/ui/styles/generatedThemesVariables.global.css.js";import"@corva/ui/styles/customScrollbars.global.css.js";import{initGlobalDependencies as s}from"@corva/ui/config/initGlobalDependencies";import{isPDFReportView as t}from"@corva/ui/utils/reports";import i from"./withAppDataProviderHOC.js";import a from"./withCLIAppSettingsHOC.js";import e from"./withReactRouterHOC.js";import m from"./withGridLayoutHOC/withGridLayoutHOC.js";import p from"./withPDFLayoutHOC.js";import{withDevCenterRouterHOC as c}from"./withDevCenterRouterHOC.js";import{jsx as l}from"react/jsx-runtime";window["@corva/ui"]=o,s();const n=({component:o,settings:s,manifest:n,packageJson:u})=>()=>{const f=a(i({CLIAppComponent:o,CLIAppSettings:s,packageJson:u})),g=t?p(f):m(f),j=e(c(g));return l(r,{children:l(j,{manifest:n,dashboardProps:{}})})};export{n as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import{useMemo as t}from"react";import{createDevCenterRouter as o}from"../../utils/devcenter.js";import"../../utils/recaptcha.js";import{jsx as n}from"react/jsx-runtime";var c=["router"];function i(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,o)}return t}function p(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var u=function(r){return function(i){var u=i.router,f=e(i,c),a=t((function(){return o(u)}),[u.location]);return n(r,p(p({},f),{},{devCenterRouter:a}))}};export{u as default,u as withDevCenterRouterHOC};
1
+ import{useMemo as t}from"react";import{createDevCenterRouter as r}from"../../utils/devcenter.js";import"../../utils/recaptcha.js";import{jsx as e}from"react/jsx-runtime";const o=o=>({router:c,...i})=>{const m=t((()=>r(c)),[c.location]);return e(o,{...i,devCenterRouter:m})};export{o as default,o as withDevCenterRouterHOC};
@@ -1 +1 @@
1
- import o from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/objectWithoutProperties";import{useState as r}from"react";import{WidthProvider as i,Responsive as n}from"react-grid-layout";import{pick as s,cloneDeep as p}from"lodash";import{withSize as a}from"react-sizeme";import{isPhoneDetected as m,isNativeDetected as c,isMobileDetected as l}from"@corva/ui/utils/mobileDetect";import{getAppSize as d}from"@corva/ui/utils/apps";import{GRID_BREAKPOINTS as u,GRID_COLUMN_SIZES as g,GRID_ROW_HEIGHT as f,NON_DRAGGABLE_ELEMENT_SELECTOR as b}from"@corva/ui/constants/apps";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import{AppsGridDragHandle as h}from"../../../components/AppsGridDragHandle/AppsGridDragHandle.js";import j from"../../../components/GridLockButton/index.js";import{isAppMaximized as y}from"../../../utils/devcenter.js";import"../../../utils/recaptcha.js";import{getLocalAppData as O,getAppCoordinates as v,updateLocalAppData as L}from"../utils.js";import"./withGridLayoutHOC.global.css.js";import D from"./withGridLayoutHOC.css.js";import{jsxs as w,jsx as S}from"react/jsx-runtime";var P=["size"];function H(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.push.apply(t,r)}return t}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}))}return e}var C=".".concat(h.GRID_LAYOUT_DRAG_HANDLE_CLASS),z=i(n),A=function(o){return a()((function(i){var n,a=i.size,H=t(i,P),A=a.width,G=H.manifest.application.key,R=r(null!==(n=O(G).isDraggable)&&void 0!==n&&n),E=e(R,2),k=E[0],F=E[1],M=c||l,W=y(H.devCenterRouter.location.query),_=r(v(H.manifest)),N=e(_,2),T=N[0],B=N[1],q=d({coordinates:T,dashboardWidth:A,isMaximized:W}),I=q.pixelHeight,U=q.pixelWidth,V=function(o){var t=e(o,1)[0],r=s(t,["x","y","w","h"]);B(r),L(G,{coordinates:r})},Y=r({}),J=e(Y,2),K=J[0],Q=J[1];return w("div",{children:[S(z,{breakpoints:m?u.phone:u.general,cols:g,rowHeight:f,measureBeforeMount:!0,onResizeStop:V,onDragStop:V,isDraggable:!M&&k,isResizable:!M&&k,draggableCancel:b,useCSSTransforms:!1,draggableHandle:C,onLayoutChange:function(o,e){o===e.small?Q(e):Q(x(x({},K),{},{medium:p(o),large:p(o)}))},layouts:K,children:S("div",{"data-grid":T,children:w("div",{className:W?D.appMaximized:"",children:[S(o,x(x({},H),{},{coordinates:x(x({},T),{},{pixelHeight:I,pixelWidth:U}),layoutEnvironment:{type:"general",pdfReportMode:!1}})),!M&&k&&S(h,{})]})},"with-grid-layout-hoc")}),S(j,{isDraggableAndResizable:k,onClick:function(){F(!k),L(G,{isDraggable:!k})},pageName:"DashboardPo"})]})}))};export{A as default};
1
+ import{useState as o}from"react";import{WidthProvider as e,Responsive as i}from"react-grid-layout";import{pick as t,cloneDeep as n}from"lodash";import{withSize as r}from"react-sizeme";import{isPhoneDetected as s,isNativeDetected as p,isMobileDetected as m}from"@corva/ui/utils/mobileDetect";import{getAppSize as a}from"@corva/ui/utils/apps";import{GRID_BREAKPOINTS as c,GRID_COLUMN_SIZES as d,GRID_ROW_HEIGHT as l,NON_DRAGGABLE_ELEMENT_SELECTOR as g}from"@corva/ui/constants/apps";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import{AppsGridDragHandle as u}from"../../../components/AppsGridDragHandle/AppsGridDragHandle.js";import h from"../../../components/GridLockButton/index.js";import{isAppMaximized as f}from"../../../utils/devcenter.js";import"../../../utils/recaptcha.js";import{getLocalAppData as j,getAppCoordinates as L,updateLocalAppData as b}from"../utils.js";import"./withGridLayoutHOC.global.css.js";import D from"./withGridLayoutHOC.css.js";import{jsxs as y,jsx as H}from"react/jsx-runtime";const S=`.${u.GRID_LAYOUT_DRAG_HANDLE_CLASS}`,v=e(i),x=e=>r()((({size:i,...r})=>{const x=i.width,C=r.manifest.application.key,[w,z]=o(j(C).isDraggable??!1),A=p||m,G=f(r.devCenterRouter.location.query),[R,k]=o(L(r.manifest)),{pixelHeight:E,pixelWidth:F}=a({coordinates:R,dashboardWidth:x,isMaximized:G}),M=([o])=>{const e=t(o,["x","y","w","h"]);k(e),b(C,{coordinates:e})},[O,_]=o({});return y("div",{children:[H(v,{breakpoints:s?c.phone:c.general,cols:d,rowHeight:l,measureBeforeMount:!0,onResizeStop:M,onDragStop:M,isDraggable:!A&&w,isResizable:!A&&w,draggableCancel:g,useCSSTransforms:!1,draggableHandle:S,onLayoutChange:(o,e)=>{o===e.small?_(e):_({...O,medium:n(o),large:n(o)})},layouts:O,children:H("div",{"data-grid":R,children:y("div",{className:G?D.appMaximized:"",children:[H(e,{...r,coordinates:{...R,pixelHeight:E,pixelWidth:F},layoutEnvironment:{type:"general",pdfReportMode:!1}}),!A&&w&&H(u,{})]})},"with-grid-layout-hoc")}),H(h,{isDraggableAndResizable:w,onClick:()=>{z(!w),b(C,{isDraggable:!w})},pageName:"DashboardPo"})]})}));export{x as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{makeStyles as r}from"@material-ui/core";import{getAppType as t,getPDFAppPixelSize as o}from"@corva/ui/utils/dashboardReports";import{getAppCoordinates as i}from"./utils.js";import{jsx as n}from"react/jsx-runtime";function p(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 c(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var a=r({page:{backgroundColor:"#fff",width:"21cm",height:"29.7cm",margin:"auto",overflow:"hidden",position:"relative",pageBreakAfter:"always",boxShadow:"#ccc 0px 1px 3px 0px, #ccc 0px 0px 0px 1px",paddingTop:2},pdfReportApp:{display:"inline-block",overflow:"hidden",position:"relative",zoom:"0.5",margin:"0 0.1cm",pointerEvents:"none"}}),l=function(e){return function(r){var p,l=a(),s=i(r.manifest),f=!(null===(p=r.manifest.application.ui)||void 0===p||!p.full_screen_report),d=t({coordinates:s,isFullScreenReport:f});return n("div",{className:l.page,children:n("div",{className:l.pdfReportApp,style:{width:"".concat(d.width,"cm"),height:"".concat(d.height,"cm")},children:n(e,c(c({},r),{},{coordinates:c(c({},s),o(d)),layoutEnvironment:{type:"general",pdfReportMode:!0}}))})})}};export{l as default};
1
+ import{makeStyles as e}from"@material-ui/core";import{getAppType as o,getPDFAppPixelSize as i}from"@corva/ui/utils/dashboardReports";import{getAppCoordinates as r}from"./utils.js";import{jsx as t}from"react/jsx-runtime";const p=e({page:{backgroundColor:"#fff",width:"21cm",height:"29.7cm",margin:"auto",overflow:"hidden",position:"relative",pageBreakAfter:"always",boxShadow:"#ccc 0px 1px 3px 0px, #ccc 0px 0px 0px 1px",paddingTop:2},pdfReportApp:{display:"inline-block",overflow:"hidden",position:"relative",zoom:"0.5",margin:"0 0.1cm",pointerEvents:"none"}}),a=e=>a=>{const n=p(),c=r(a.manifest),d=!!a.manifest.application.ui?.full_screen_report,l=o({coordinates:c,isFullScreenReport:d});return t("div",{className:n.page,children:t("div",{className:n.pdfReportApp,style:{width:`${l.width}cm`,height:`${l.height}cm`},children:t(e,{...a,coordinates:{...c,...i(l)},layoutEnvironment:{type:"general",pdfReportMode:!0}})})})};export{a as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{Route as n,IndexRedirect as o,Router as c,browserHistory as p}from"react-router";import{LoadingIndicator as i}from"@corva/ui/components";import{getCurrentUser as a}from"@corva/ui/clients/jsonApi";import s from"../screens/LoginScreen/LoginScreen.js";import u from"../screens/OAuthCallbackScreen/index.js";import{useAuth as m}from"../context/auth.js";import l from"../components/App/App.js";import{jsxs as f,jsx as b}from"react/jsx-runtime";function h(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}var O,j=(O=e(t.mark((function r(e,n,o){var c;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=null,r.prev=1,r.next=4,a();case 4:c=r.sent,r.next=10;break;case 7:r.prev=7,r.t0=r.catch(1),console.error(r.t0);case 10:if(!e.location.pathname.startsWith("/login")){r.next=15;break}return c&&n("/"),o(),r.abrupt("return");case 15:c||n("/login"),o();case 17:case"end":return r.stop()}}),r,null,[[1,7]])}))),function(r,e,t){return O.apply(this,arguments)}),g=function(e){return function(t){var n=t.route,o=t.location,c=t.router;return m().loading?b(i,{fullscreen:!0}):b(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}({location:o,router:c},n.componentProps||{}))}},y=function(r){return function(e){var t=f(n,{path:"/",component:l,onEnter:j,children:[b(o,{to:"app"}),b(n,{path:"app",component:g(r),componentProps:e}),b(n,{path:"login",component:s}),b(n,{path:"login/oauth-callback",component:u})]});return b(c,{history:p,routes:t})}};export{y as default};
1
+ import{useMemo as o}from"react";import{BrowserRouter as r,useHistory as n,useLocation as t,Switch as e,Redirect as c,Route as p}from"react-router-dom";import{LoadingIndicator as a}from"@corva/ui/components";import i from"../screens/LoginScreen/LoginScreen.js";import m from"../screens/OAuthCallbackScreen/index.js";import{useAuth as s}from"../context/auth.js";import u from"../components/App/App.js";import{jsx as l,jsxs as h}from"react/jsx-runtime";function f(o){const r=new URLSearchParams(o),n={};return r.forEach(((o,r)=>{n[r]=o})),n}function d({WrappedComponent:o,componentProps:r,router:n,location:t}){const{loading:e}=s();return e?l(a,{fullscreen:!0}):l(o,{location:t,router:n,...r})}function g({WrappedComponent:r,componentProps:a}){const s=n(),g=t(),P=o((()=>function(o,r){const n=o=>{if("string"==typeof o)return o;const{pathname:r,query:n}=o;return{pathname:r,search:n?`?${new URLSearchParams(n).toString()}`:""}};return{push:r=>o.push(n(r)),replace:r=>o.replace(n(r)),location:{...r,query:f(r.search)}}}(s,g)),[s,g]);return l(u,{router:P,children:h(e,{children:[l(c,{exact:!0,from:"/",to:"/app"}),l(p,{path:"/login/oauth-callback",children:l(m,{router:P})}),l(p,{path:"/login",children:l(i,{router:P,location:P.location})}),l(p,{path:"/app",children:l(d,{WrappedComponent:r,componentProps:a,router:P,location:P.location})})]})})}const P=o=>n=>l(r,{children:l(g,{WrappedComponent:o,componentProps:n})});export{P as default};
@@ -1 +1 @@
1
- import o from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import{useEffect as t}from"react";import{getCurrentUser as e}from"@corva/ui/clients/jsonApi";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import r from"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import i from"./components/Auth.js";import p from"./components/IconLogo.js";import s from"./LoginScreen.css.js";import{jsx as m}from"react/jsx-runtime";function c(c){var a=c.router,l=c.location;return t((function(){function t(){return(t=o(n.mark((function o(){var t;return n.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t=null,o.prev=1,o.next=4,e();case 4:t=o.sent,o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),console.error(o.t0);case 10:t&&a.replace("/");case 11:case"end":return o.stop()}}),o,null,[[1,7]])})))).apply(this,arguments)}!function(){t.apply(this,arguments)}()}),[]),m("div",{className:s.loginScreen,children:m(r,{location:l,logoIcon:m(p,{}),promoLink:"https://youtu.be/-q6LkceqpGs",children:m(i,{router:a})})})}export{c as default};
1
+ import{useEffect as o}from"react";import{getCurrentUser as n}from"@corva/ui/clients/jsonApi";import"../../../components/Login/components/Chip.js";import"../../../components/Login/components/EmailField.js";import"../../../components/Login/components/HiddenEmailField.js";import t from"../../../components/Login/components/Login.js";import"../../../components/Login/components/OrDivider.js";import"../../../components/Login/components/PasswordField.js";import"../../../components/Login/components/Step.js";import"../../../components/Login/components/StepContent.js";import"../../../components/Login/components/StepFooter.js";import"../../../components/Login/components/StepHeader.js";import"../../../components/Login/components/VerificationStep.js";import e from"./components/Auth.js";import i from"./components/IconLogo.js";import m from"./LoginScreen.css.js";import{jsx as p}from"react/jsx-runtime";function s({router:s,location:r}){return o((()=>{!async function(){let o=null;try{o=await n()}catch(o){console.error(o)}o&&s.replace("/")}()}),[]),p("div",{className:m.loginScreen,children:p(t,{location:r,logoIcon:p(i,{}),promoLink:"https://youtu.be/-q6LkceqpGs",children:p(e,{router:s})})})}export{s as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{useState as t}from"react";import r from"./EmailStep.js";import i from"./AuthStep.js";import{jsx as n}from"react/jsx-runtime";function s(s){var m=s.router,o=t({email:null,schemas:{},step:0}),a=e(o,2),u=a[0],c=a[1];return 0===u.step?n(r,{onNext:function(e,t){return c((function(r){return{step:r.step+1,email:e,schemas:t}}))}}):n(i,{email:u.email,schemas:u.schemas.schemas,identityVerification:u.schemas.identity_verification,onBack:function(){return c((function(e){return{step:e.step-1,email:null,schemas:null}}))},onFinishLogin:function(){return m.push("/")}})}export{s as default};
1
+ import{useState as e}from"react";import t from"./EmailStep.js";import s from"./AuthStep.js";import{jsx as i}from"react/jsx-runtime";function m({router:m}){const[a,o]=e({email:null,schemas:{},step:0});return 0===a.step?i(t,{onNext:(e,t)=>o((s=>({step:s.step+1,email:e,schemas:t})))}):i(s,{email:a.email,schemas:a.schemas.schemas,identityVerification:a.schemas.identity_verification,onBack:()=>o((e=>({step:e.step-1,email:null,schemas:null}))),onFinishLogin:()=>m.push("/")})}export{m as default};
@@ -1 +1 @@
1
- import o from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{memo as e,useState as t,useRef as i,useEffect as a}from"react";import{styled as c,Grid as m,Button as s}from"@material-ui/core";import{showErrorNotification as p}from"@corva/ui/utils";import{isSSOPlatformSupported as l}from"@corva/ui/clients/sso";import{initializeRecaptcha as d,GOOGLE_RECAPTCHA_KEY as u}from"../../../../utils/recaptcha.js";import f from"../../../../components/Login/components/Chip.js";import"../../../../components/Login/components/EmailField.js";import g from"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import h from"../../../../components/Login/components/OrDivider.js";import v from"../../../../components/Login/components/PasswordField.js";import w from"../../../../components/Login/components/Step.js";import b from"../../../../components/Login/components/StepContent.js";import j from"../../../../components/Login/components/StepFooter.js";import L from"../../../../components/Login/components/StepHeader.js";import{VerificationStep as y}from"../../../../components/Login/components/VerificationStep.js";import{useAuth as S}from"../../../context/auth.js";import{NEED_HELP_EXTERNAL_LINK as k}from"../../../constants/index.js";import{ERRORS as C}from"../../../hocs/effects/useProvideAuth/constants.js";import{requestVerification as x}from"../../../hocs/effects/useProvideAuth/api.js";import B from"./SSOButton.js";import{jsx as P,jsxs as _}from"react/jsx-runtime";var F=c(m)((function(o){var n=o.theme;return{marginTop:2*n.spacing(1),marginBottom:2*n.spacing(1),"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0}}})),V=c(s)((function(o){var n=o.theme;return{width:71,padding:n.spacing(),whiteSpace:"nowrap",backgroundColor:n.status.loginButton,"&:hover":{backgroundColor:"".concat(n.status.loginButtonHovered)}}}));var T=e((function(e){var c=e.email,s=e.schemas,T=e.onBack,A=e.onFinishLogin,E=e.identityVerification,H=S(),I=t(""),O=n(I,2),z=O[0],D=O[1],q=t(!1),G=n(q,2),M=G[0],J=G[1],K=t({code:null,mode:null}),N=n(K,2),Q=N[0],R=N[1],U=i(null),W=M&&H.error===C.wrongEmailOrPassword?H.error:null;a((function(){d()}),[]);var X,Y=function(o){if(!o)return p("Problem with initializing recaptcha");U.current=o;var n={email:c,password:z,recaptcha_token:o};Q.code&&(n.verification_code=Q.code,n.verification_mode=Q.mode),H.login(null,n,A).then((function(){return J(!0)}))},Z=(X=o(r.mark((function o(n){var e;return r.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.preventDefault(),window.grecaptcha){o.next=3;break}return o.abrupt("return",Y());case 3:return e=!1,window.grecaptcha.enterprise.ready((function(){e=!0;try{window.grecaptcha.enterprise.execute(u,{action:"login"}).then(Y).catch(console.error)}catch(o){console.error(o),p(o.message)}})),o.abrupt("return",setTimeout((function(){e||Y()}),1e3));case 6:case"end":return o.stop()}}),o)}))),function(o){return X.apply(this,arguments)});a((function(){if(Q.code){var o={email:c,password:z,recaptcha_token:U.current};Q.code&&(o.verification_code=Q.code,o.verification_mode=Q.mode),H.login(null,o,A)}}),[Q.code]);var $=s.find((function(o){return"password"===o.provider})),oo=s.filter((function(o){var n;return"password"!==o.provider&&l(null==o||null===(n=o.platform)||void 0===n?void 0:n.identifier)}));return M&&null!=E&&E.enabled&&!W?P(y,{email:c,identityVerification:E,loginVerificationFailure:H.error===C.invalidVerificationCode,onCodeProvided:R,password:z,requestVerification:x}):_(w,{children:[P(L,{children:"Sign In"}),P(b,{children:_(m,{container:!0,direction:"column",children:[P(f,{"data-not-migrated-MuiChip":!0,label:c,onClick:T}),oo.map((function(o){return P(F,{item:!0,children:P(B,{title:o.title,provider:o.provider,connection:o.connection,platform:o.platform})},o.title)})),$&&oo.length>0&&P(m,{item:!0,children:P(h,{})}),$&&P(F,{item:!0,children:_("form",{id:"sign-in-form",onSubmit:Z,children:[P(g,{email:c}),P(v,{value:z,onChange:function(o){D(o.target.value),J(!1)},disabled:H.loading,error:W})]})})]})}),P(j,{needHelpExternalLink:k,children:$&&P(V,{"data-testid":"".concat("AuthorizationPo","_signInButton"),form:"sign-in-form",type:"submit",variant:"contained",color:"primary",disabled:!z||H.loading||!!W,onClick:Z,children:"Sign In"})})]})}));export{T as default};
1
+ import{memo as o,useState as e,useRef as n,useEffect as i}from"react";import{styled as t,Grid as r,Button as c}from"@material-ui/core";import{showErrorNotification as m}from"@corva/ui/utils";import{isSSOPlatformSupported as a}from"@corva/ui/clients/sso";import{initializeRecaptcha as s,GOOGLE_RECAPTCHA_KEY as p}from"../../../../utils/recaptcha.js";import d from"../../../../components/Login/components/Chip.js";import"../../../../components/Login/components/EmailField.js";import l from"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import f from"../../../../components/Login/components/OrDivider.js";import g from"../../../../components/Login/components/PasswordField.js";import u from"../../../../components/Login/components/Step.js";import h from"../../../../components/Login/components/StepContent.js";import v from"../../../../components/Login/components/StepFooter.js";import j from"../../../../components/Login/components/StepHeader.js";import{VerificationStep as w}from"../../../../components/Login/components/VerificationStep.js";import{useAuth as L}from"../../../context/auth.js";import{NEED_HELP_EXTERNAL_LINK as S}from"../../../constants/index.js";import{ERRORS as C}from"../../../hocs/effects/useProvideAuth/constants.js";import{requestVerification as b}from"../../../hocs/effects/useProvideAuth/api.js";import y from"./SSOButton.js";import{jsx as k,jsxs as B}from"react/jsx-runtime";const P=t(r)((({theme:o})=>({marginTop:2*o.spacing(1),marginBottom:2*o.spacing(1),"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0}}))),_=t(c)((({theme:o})=>({width:71,padding:o.spacing(),whiteSpace:"nowrap",backgroundColor:o.status.loginButton,"&:hover":{backgroundColor:`${o.status.loginButtonHovered}`}})));var x=o((function({email:o,schemas:t,onBack:c,onFinishLogin:x,identityVerification:F}){const V=L(),[E,H]=e(""),[A,I]=e(!1),[O,T]=e({code:null,mode:null}),z=n(null),D=A&&V.error===C.wrongEmailOrPassword?V.error:null;i((()=>{s()}),[]);const q=e=>{if(!e)return m("Problem with initializing recaptcha");z.current=e;const n={email:o,password:E,recaptcha_token:e};O.code&&(n.verification_code=O.code,n.verification_mode=O.mode),V.login(null,n,x).then((()=>I(!0)))},M=async o=>{if(o.preventDefault(),!window.grecaptcha)return q();let e=!1;return window.grecaptcha.enterprise.ready((()=>{e=!0;try{window.grecaptcha.enterprise.execute(p,{action:"login"}).then(q).catch(console.error)}catch(o){console.error(o),m(o.message)}})),setTimeout((()=>{e||q()}),1e3)};i((()=>{if(!O.code)return;const e={email:o,password:E,recaptcha_token:z.current};O.code&&(e.verification_code=O.code,e.verification_mode=O.mode),V.login(null,e,x)}),[O.code]);const $=t.find((o=>"password"===o.provider)),G=t.filter((o=>"password"!==o.provider&&a(o?.platform?.identifier)));return A&&F?.enabled&&!D?k(w,{email:o,identityVerification:F,loginVerificationFailure:V.error===C.invalidVerificationCode,onCodeProvided:T,password:E,requestVerification:b}):B(u,{children:[k(j,{children:"Sign In"}),k(h,{children:B(r,{container:!0,direction:"column",children:[k(d,{"data-not-migrated-MuiChip":!0,label:o,onClick:c}),G.map((o=>k(P,{item:!0,children:k(y,{title:o.title,provider:o.provider,connection:o.connection,platform:o.platform})},o.title))),$&&G.length>0&&k(r,{item:!0,children:k(f,{})}),$&&k(P,{item:!0,children:B("form",{id:"sign-in-form",onSubmit:M,children:[k(l,{email:o}),k(g,{value:E,onChange:o=>{H(o.target.value),I(!1)},disabled:V.loading,error:D})]})})]})}),k(v,{needHelpExternalLink:S,children:$&&k(_,{"data-testid":"AuthorizationPo_signInButton",form:"sign-in-form",type:"submit",variant:"contained",color:"primary",disabled:!E||V.loading||!!D,onClick:M,children:"Sign In"})})]})}));export{x as default};
@@ -1 +1 @@
1
- import o from"@babel/runtime/helpers/slicedToArray";import{memo as n,useState as t}from"react";import{styled as e}from"@material-ui/core/styles";import i from"@material-ui/core/Button";import{getUserAuthSchemas as r}from"@corva/ui/clients/jsonApi";import"../../../../components/Login/components/Chip.js";import m from"../../../../components/Login/components/EmailField.js";import"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import"../../../../components/Login/components/OrDivider.js";import"../../../../components/Login/components/PasswordField.js";import p from"../../../../components/Login/components/Step.js";import s from"../../../../components/Login/components/StepContent.js";import c from"../../../../components/Login/components/StepFooter.js";import a from"../../../../components/Login/components/StepHeader.js";import"../../../../components/Login/components/VerificationStep.js";import{NEED_HELP_EXTERNAL_LINK as l}from"../../../constants/index.js";import{jsxs as u,jsx as d}from"react/jsx-runtime";var f=e(i)((function(o){var n=o.theme;return{width:71,padding:n.spacing(),backgroundColor:n.status.loginButton,"&:hover":{backgroundColor:"".concat(n.status.loginButtonHovered)}}}));var g=n((function(n){var e=n.onNext,i=t(!1),g=o(i,2),h=g[0],j=g[1],v=t(null),L=o(v,2),b=L[0],x=L[1],C=t(""),S=o(C,2),y=S[0],k=S[1],B=function(o){if(o.preventDefault(),!y)return x("Required");j(!0),r({email:y,with_provider:!0}).then((function(o){return e(y,o)})).catch((function(){return x("Invalid email")})).finally((function(){return j(!1)}))};return u(p,{children:[d(a,{children:"Sign In"}),d(s,{children:d("form",{id:"email-form",onSubmit:B,autoComplete:"on",children:d(m,{value:y,onChange:function(o){k(o.target.value),x(null)},disabled:!!h,error:b})})}),d(c,{needHelpExternalLink:l,children:d(f,{"data-testid":"EmailPo_nextButton",form:"email-form",type:"submit",variant:"contained",color:"primary",disabled:h||!!b,onClick:B,children:"Next"})})]})}));export{g as default};
1
+ import{memo as o,useState as n}from"react";import{styled as t}from"@material-ui/core/styles";import e from"@material-ui/core/Button";import{getUserAuthSchemas as i}from"@corva/ui/clients/jsonApi";import"../../../../components/Login/components/Chip.js";import r from"../../../../components/Login/components/EmailField.js";import"../../../../components/Login/components/HiddenEmailField.js";import"../../../../components/Login/components/Login.js";import"../../../../components/Login/components/OrDivider.js";import"../../../../components/Login/components/PasswordField.js";import m from"../../../../components/Login/components/Step.js";import p from"../../../../components/Login/components/StepContent.js";import s from"../../../../components/Login/components/StepFooter.js";import c from"../../../../components/Login/components/StepHeader.js";import"../../../../components/Login/components/VerificationStep.js";import{NEED_HELP_EXTERNAL_LINK as a}from"../../../constants/index.js";import{jsxs as l,jsx as d}from"react/jsx-runtime";const u=t(e)((({theme:o})=>({width:71,padding:o.spacing(),backgroundColor:o.status.loginButton,"&:hover":{backgroundColor:`${o.status.loginButtonHovered}`}})));var f=o((function({onNext:o}){const[t,e]=n(!1),[f,g]=n(null),[h,j]=n(""),L=n=>{if(n.preventDefault(),!h)return g("Required");e(!0),i({email:h,with_provider:!0}).then((n=>o(h,n))).catch((()=>g("Invalid email"))).finally((()=>e(!1)))};return l(m,{children:[d(c,{children:"Sign In"}),d(p,{children:d("form",{id:"email-form",onSubmit:L,autoComplete:"on",children:d(r,{value:h,onChange:o=>{j(o.target.value),g(null)},disabled:!!t,error:f})})}),d(s,{needHelpExternalLink:a,children:d(u,{"data-testid":"EmailPo_nextButton",form:"email-form",type:"submit",variant:"contained",color:"primary",disabled:t||!!f,onClick:L,children:"Next"})})]})}));export{f as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/slicedToArray";import{useState as e}from"react";import{withStyles as t,ButtonBase as o,Grid as i,Avatar as a,Typography as n,CircularProgress as s}from"@material-ui/core";import{getSSOProvider as l}from"@corva/ui/clients/sso";import{jsx as c,jsxs as d}from"react/jsx-runtime";var f={google:"/static/media/55de612562c712e3a9d6ea86000e18c7.svg",microsoft:"/static/media/319d9b9a39d511547cf55d1336a8eca4.svg"};var m=t((function(r){return{button:{width:"100%",height:56,fontSize:16,fontWeight:400,color:"#fff",display:"inline-flex",padding:0,alignItems:"center",justifyContent:"flex-start",whiteSpace:"nowrap",borderRadius:4,borderWidth:1,borderStyle:"solid",borderColor:"#616161",textDecoration:"none","&:hover":{borderColor:r.status.loginButton}},logo:{height:30,width:30,margin:12},avatar:{height:30,width:30,margin:12,color:"#ffffff",backgroundColor:r.status.loginButton},progressRoot:{margin:"12px 24px"},progressColor:{color:r.status.loginButton}}}))((function(t){var m=t.platform,g=t.connection,u=t.title,p=t.provider,h=t.classes,b=e(!1),v=r(b,2),y=v[0],x=v[1],C=f[p];return c(o,{className:h.button,onClick:function(r){if(r.preventDefault(),!y){x(!0),localStorage.setItem("ssoPlatform",m.identifier);var e=l(m.identifier);e.configure(m.options),e.authorize(g)}},children:d(i,{container:!0,justify:"space-between",alignItems:"center",children:[c(i,{item:!0,children:d(i,{container:!0,justify:"flex-start",alignItems:"center",children:[c(i,{item:!0,children:C?c("img",{className:h.logo,src:C,alt:u}):c(a,{className:h.avatar,children:u&&u[0].toUpperCase()})}),c(i,{item:!0,children:c(n,{variant:"body2",children:u})})]})}),c(i,{item:!0,children:y&&c(s,{classes:{root:h.progressRoot,colorPrimary:h.progressColor},color:"primary",size:30})})]})})}));export{m as default};
1
+ import{useState as t}from"react";import{withStyles as e,ButtonBase as o,Grid as r,Avatar as i,Typography as a,CircularProgress as n}from"@material-ui/core";import{getSSOProvider as s}from"@corva/ui/clients/sso";import{jsx as l,jsxs as c}from"react/jsx-runtime";const d={google:"/static/media/55de612562c712e3a9d6ea86000e18c7.svg",microsoft:"/static/media/319d9b9a39d511547cf55d1336a8eca4.svg"};var f=e((t=>({button:{width:"100%",height:56,fontSize:16,fontWeight:400,color:"#fff",display:"inline-flex",padding:0,alignItems:"center",justifyContent:"flex-start",whiteSpace:"nowrap",borderRadius:4,borderWidth:1,borderStyle:"solid",borderColor:"#616161",textDecoration:"none","&:hover":{borderColor:t.status.loginButton}},logo:{height:30,width:30,margin:12},avatar:{height:30,width:30,margin:12,color:"#ffffff",backgroundColor:t.status.loginButton},progressRoot:{margin:"12px 24px"},progressColor:{color:t.status.loginButton}})))((function({platform:e,connection:f,title:m,provider:g,classes:h}){const[p,u]=t(!1),b=d[g];return l(o,{className:h.button,onClick:t=>{if(t.preventDefault(),!p){u(!0),localStorage.setItem("ssoPlatform",e.identifier);const t=s(e.identifier);t.configure(e.options),t.authorize(f)}},children:c(r,{container:!0,justify:"space-between",alignItems:"center",children:[l(r,{item:!0,children:c(r,{container:!0,justify:"flex-start",alignItems:"center",children:[l(r,{item:!0,children:b?l("img",{className:h.logo,src:b,alt:m}):l(i,{className:h.avatar,children:m&&m[0].toUpperCase()})}),l(r,{item:!0,children:l(a,{variant:"body2",children:m})})]})}),l(r,{item:!0,children:p&&l(n,{classes:{root:h.progressRoot,colorPrimary:h.progressColor},color:"primary",size:30})})]})})}));export{f as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{useEffect as e}from"react";import{LoadingIndicator as o}from"@corva/ui/components";import{showErrorNotification as n}from"@corva/ui/utils";import{getUserAuthPlatform as i}from"@corva/ui/clients/jsonApi";import{getSSOProvider as a}from"@corva/ui/clients/sso";import{useAuth as u}from"../../context/auth.js";import{jsx as c}from"react/jsx-runtime";function s(s){var f,m=s.router,p=u().login,l=function(r,t){p(r,{token:t},(function(){return m.push("/")}))},v=function(r){console.error(r),n("Sorry, but we couldn’t log you in. Please contact Corva support if you need assistance"),m.push("/login")},b=(f=r(t.mark((function r(){var e,o,n,u,c;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=localStorage.getItem("ssoPlatform"),localStorage.removeItem("ssoPlatform"),r.next=4,i(e);case 4:if(o=r.sent,n=o.platform,u=a(n.identifier)){r.next=9;break}return r.abrupt("return",v("No authentication platform found for ".concat(n.identifier)));case 9:return r.prev=9,u.configure(n.options),r.next=13,u.authenticate();case 13:return c=r.sent,r.abrupt("return",l(n.identifier,c));case 17:return r.prev=17,r.t0=r.catch(9),r.abrupt("return",v(r.t0));case 20:case"end":return r.stop()}}),r,null,[[9,17]])}))),function(){return f.apply(this,arguments)});return e((function(){b()}),[]),c(o,{fullscreen:!1})}export{s as default};
1
+ import{useEffect as o}from"react";import{LoadingIndicator as t}from"@corva/ui/components";import{showErrorNotification as r}from"@corva/ui/utils";import{getUserAuthPlatform as e}from"@corva/ui/clients/jsonApi";import{getSSOProvider as i}from"@corva/ui/clients/sso";import{useAuth as n}from"../../context/auth.js";import{jsx as a}from"react/jsx-runtime";function c({router:c}){const{login:s}=n(),u=o=>{console.error(o),r("Sorry, but we couldn’t log you in. Please contact Corva support if you need assistance"),c.push("/login")},m=async()=>{const o=localStorage.getItem("ssoPlatform");localStorage.removeItem("ssoPlatform");const{platform:t}=await e(o),r=i(t.identifier);if(!r)return u(`No authentication platform found for ${t.identifier}`);try{r.configure(t.options);const o=await r.authenticate();return((o,t)=>{s(o,{token:t},(()=>c.push("/")))})(t.identifier,o)}catch(o){return u(o)}};return o((()=>{m()}),[]),a(t,{fullscreen:!1})}export{c as default};
package/README.md CHANGED
@@ -1,28 +1,76 @@
1
1
  # corva-dc-platform-shared
2
+
2
3
  A repository to share Dev Center platform code
3
4
 
4
- ## Instalation steps
5
- Clone this repository and run `yarn` inside the directory. On postinstall git hooks would be configured for this repository.
5
+ # Contributing Guide
6
+
7
+ ## Quick Start
8
+
9
+ 1. **Branch Setup**
10
+
11
+ ```bash
12
+ git checkout develop
13
+ git pull
14
+ git checkout -b feature/your-feature # or fix/your-fix
15
+ ```
16
+
17
+ 2. **Development**
18
+
19
+ - Write code
20
+ - Add tests
21
+ - Run:
22
+ ```bash
23
+ yarn install
24
+ yarn lint
25
+ yarn test
26
+ ```
27
+
28
+ 3. **Create PR**
29
+ - Push to your branch
30
+ - Create PR to `develop`
31
+ - PR title must follow conventional commits:
32
+ ```
33
+ feat: add user authentication
34
+ fix: resolve login error
35
+ feat!: change API response format
36
+ ```
6
37
 
7
- ## Development flow
8
- To develop new feature or implement fix one need to create new branch from `main` one and name it properly: branch-type/JIRA_ID-jira_ticket_description i.e.
9
- * `feature/DC-1234-add-Table-component`
10
- * `fix/DR-9999-fix-broken-page`
38
+ ## Branch Strategy
11
39
 
12
- When changes are ready please create commit with meaningful description using [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). Commit message should have form `commit-type(JIRA_ID): commit message`. All types of commits could be found [here](./git-conventional-commits.json)
40
+ - `develop` - main development branch
41
+ - `feature/*` - new features
42
+ - `fix/*` - bug fixes
43
+ - No direct commits to `develop`
13
44
 
14
- Please note that `feat` and `fix` commits messages will be used during automatic changelog creation while `chore`, `docs` and others will not.
45
+ ## Release Process
15
46
 
16
- Do not create 2 commits with same name and consider amending previous commit instead with `git commit --amend --no-edit`.
47
+ 1. Get your PR merged to `develop`
48
+ 2. Release Please automatically:
49
+ - Creates release PR
50
+ - Updates version based on commits
51
+ - Generates changelog
52
+ 3. Merge the Release Please PR
53
+ 4. System automatically:
54
+ - Creates git tag
55
+ - Runs E2E tests
56
+ - Publishes to NPM
17
57
 
18
- ---
19
- **⚠⚠⚠ In case commit introduces breaking changes incompatible with existing API special commit message have to be used. Just type `git commit` and [commit template](./scripts/COMMIT_TEMPLATE) will be opened to edit. The main difference with regular commit messages - such commit MUST have footer(s) BREAKING CHANGES⚠⚠⚠**
58
+ ## Version Bumping
20
59
 
21
- ---
60
+ - Automatic based on PR titles:
61
+ - `fix:` → `0.0.X`
62
+ - `feat:` → `0.X.0`
63
+ - `feat!:` or `BREAKING CHANGE:` → `X.0.0`
64
+ - Never modify version manually
22
65
 
23
- On merging the PR to `main` branch an automatic release flow will be triggered. New package version will be determined based on changes introduced by commit. `fix` corresponds to `patch`, `feat` to `minor` and `breaking changes` to `major` version release.
66
+ ## CI Checks
24
67
 
25
- More details on semantic versioning could be found in official [SemVer specification](https://semver.org/).
68
+ Your PR must pass:
26
69
 
27
- Note: untill first major version is released the package is considered as under development and `breaking changes` will correspond to `minor` release.
70
+ - Linting
71
+ - Unit tests
72
+ - E2E tests (feature/fix branches)
73
+ - PR title validation
74
+ - Code review
28
75
 
76
+ Remember: The key is writing good code and using correct commit conventions - the release process is automated!
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"react";import o from"react-dom";import{createRoot as r}from"react-dom/client";import n from"../../../CLI/hocs/withCorvaMagicHOC.js";import{jsx as m}from"react/jsx-runtime";Promise.all([import("".concat(process.env.DEV_CENTER_APP_PATH,"/src/index.js")),import("".concat(process.env.DEV_CENTER_APP_PATH,"/manifest.json")),import("".concat(process.env.DEV_CENTER_APP_PATH,"/package.json"))]).then((function(s){var a=e(s,3),c=a[0],i=a[1],p=a[2],f=n({component:c.default.component,settings:c.default.settings,manifest:i.default,packageJson:p.default}),d=document.getElementById("root");parseInt(t.version.split(".")[0],10)>=18?r(d).render(m(f,{})):o.render(m(f,{}),d)}));
1
+ import e from"../../../CLI/hocs/withCorvaMagicHOC.js";import{createAdaptiveRoot as t}from"./createAdaptiveRoot.js";import{jsx as o}from"react/jsx-runtime";Promise.all([import(`${process.env.DEV_CENTER_APP_PATH}/src/index.js`),import(`${process.env.DEV_CENTER_APP_PATH}/manifest.json`),import(`${process.env.DEV_CENTER_APP_PATH}/package.json`)]).then((([s,n,r])=>{const m=e({component:s.default.component,settings:s.default.settings,manifest:n.default,packageJson:r.default});t(document.getElementById("root")).render(o(m,{}))}));
@@ -1 +1 @@
1
- import t from"react";import o from"react-dom";import{createRoot as n}from"react-dom/client";import p from"prop-types";import{makeStyles as r}from"@material-ui/core";import*as e from"@corva/ui";import{DevCenterIsolatedAppPage as i}from"@corva/ui/components";import{jsx as m}from"react/jsx-runtime";window["@corva/ui"]=e;var s=r((function(){return{reportsContainer:{zoom:"0.5"}}}));function a(t){var o=t.CLIAppComponent,n=t.CLIAppSettings,p=s();return m(i,{CLIAppComponent:o,CLIAppSettings:n,containerReportClassName:p.reportsContainer})}a.propTypes={CLIAppComponent:p.func,CLIAppSettings:p.func},a.defaultProps={CLIAppComponent:null,CLIAppSettings:null},import("".concat(process.env.DEV_CENTER_APP_PATH,"/src/index.js")).then((function(p){var r=p.default.component,e=p.default.settings,i=document.getElementById("root");parseInt(t.version.split(".")[0],10)>=18?n(i).render(m(a,{CLIAppComponent:r,CLIAppSettings:e})):o.render(m(a,{CLIAppComponent:r,CLIAppSettings:e}),i)}));
1
+ import o from"prop-types";import{makeStyles as t}from"@material-ui/core";import*as n from"@corva/ui";import{DevCenterIsolatedAppPage as p}from"@corva/ui/components";import{initGlobalDependencies as r}from"@corva/ui/config";import{createAdaptiveRoot as e}from"./createAdaptiveRoot.js";import{jsx as i}from"react/jsx-runtime";window["@corva/ui"]=n,r();const m=t((()=>({reportsContainer:{zoom:"0.5"}})));function s({CLIAppComponent:o=null,CLIAppSettings:t=null}){const n=m();return i(p,{CLIAppComponent:o,CLIAppSettings:t,containerReportClassName:n.reportsContainer})}s.propTypes={CLIAppComponent:o.func,CLIAppSettings:o.func},import(`${process.env.DEV_CENTER_APP_PATH}/src/index.js`).then((o=>{const t=o.default.component,n=o.default.settings;e(document.getElementById("root")).render(i(s,{CLIAppComponent:t,CLIAppSettings:n}))}));
@@ -0,0 +1 @@
1
+ import o from"mapbox-gl";try{const i=window["@corva/ui"],n=i&&i.config&&i.config.initMapbox,c=i&&i.config&&i.config.MAP_BOX_ACCESS_TOKEN,a="function"==typeof n?n(o):o;a&&!a.accessToken&&c&&(a.accessToken=c),window["mapbox-gl"]=a}catch(o){console.warn("Failed to initialize mapbox-gl for local development:",o)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require('./../../../ext-cjs/@babel/runtime/helpers/defineProperty.js');function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function a(t){for(var a=1;a<arguments.length;a++){var o=null!=arguments[a]?arguments[a]:{};a%2?r(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var o={qa:"qa",staging:"staging",production:"production"},i={REACT_APP_AUTH0_REDIRECT_URI:"http://app.local.corva.ai:8080/login/oauth-callback",REACT_APP_AUTH0_DOMAIN:"corva.auth0.com",REACT_APP_AUTH0_CLIENT_ID:"L1B0xGD5AuXwuTDFdFA9czDTM7Vvw464"},c=(e(t={},o.qa,a(a({},i),{},{REACT_APP_API_URL:"https://api.qa.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.qa.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.qa.corva.ai/v1"})),e(t,o.staging,a(a({},i),{},{REACT_APP_API_URL:"https://api.staging.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.staging.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.staging.corva.ai/v1"})),e(t,o.production,a(a({},i),{},{REACT_APP_API_URL:"https://api.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.corva.ai/v1"})),t);exports.CORVA_API_ENVS=o,exports.CORVA_API_ENV_VARIABLES=c,exports.CORVA_GLOBAL_DEPENDENCIES={"@corva/ui":"","@material-ui/core":"4.11.2","@material-ui/icons":"4.9.1","@material-ui/lab":"4.0.0-alpha.57","@material-ui/pickers":"3.2.10","@rollbar/react":"0.11.1",classnames:"2.2.6","corva-convert-units":"1.10.33",highcharts:"8.1.2","highcharts-react-official":"2.2.2",html2canvas:"1.0.0-alpha.12","@icon-park/react":"1.4.2",jsona:"1.5.1",lodash:"^4.17.21","mapbox.js":"3.2.1",moment:"2.29.4","moment-timezone":"0.5.43",react:["17.0.1","18.3.1"],"react-dom":["17.0.1","18.3.1"],"react-grid-layout":"1.3.4","react-sortable-hoc":"0.6.8","react-sizeme":"2.5.2","react-redux":"5.1.1","react-virtualized":"9.21.2",redux:"3.7.2","redux-thunk":"2.3.0",reselect:"2.5.4",rollbar:"2.5.1","prop-types":"^15.6.1",uuid:"3.4.0"},exports.UNSUPPORTED_DEPENDENCIES=[{dependency:"date-fns",alternative:"moment"},{dependency:"date-fns-tz",alternative:"moment-timezone"},{dependency:"date-fns-timezone",alternative:"moment-timezone"}];
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const a={qa:"qa",staging:"staging",production:"production"},e={REACT_APP_AUTH0_REDIRECT_URI:"http://app.local.corva.ai:8080/login/oauth-callback",REACT_APP_AUTH0_DOMAIN:"corva.auth0.com",REACT_APP_AUTH0_CLIENT_ID:"L1B0xGD5AuXwuTDFdFA9czDTM7Vvw464"},t={[a.qa]:{...e,REACT_APP_API_URL:"https://api.qa.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.qa.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.qa.corva.ai/v1"},[a.staging]:{...e,REACT_APP_API_URL:"https://api.staging.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.staging.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.staging.corva.ai/v1"},[a.production]:{...e,REACT_APP_API_URL:"https://api.corva.ai",REACT_APP_SUBSCRIPTIONS_URL:"https://subscriptions.corva.ai",REACT_APP_AUTH0_AUDIENCE:"https://api.corva.ai/v1"}};exports.CORVA_API_ENVS=a,exports.CORVA_API_ENV_VARIABLES=t,exports.CORVA_GLOBAL_DEPENDENCIES={"@corva/ui":"","@material-ui/core":"4.11.2","@material-ui/icons":"4.9.1","@material-ui/lab":"4.0.0-alpha.57","@material-ui/pickers":"3.2.10",classnames:"2.2.6","corva-convert-units":"1.10.33",highcharts:"10.3.3","highcharts-react-official":"2.2.2",html2canvas:"1.0.0-alpha.12","@icon-park/react":"1.4.2",jsona:"1.5.1",lodash:["^4.17.21","^4.18.1"],"mapbox-gl":"3.16.0",moment:"2.29.4","moment-timezone":"0.5.43",react:["17.0.1","18.3.1"],"react-dom":["17.0.1","18.3.1"],"react-grid-layout":"1.3.4","react-sortable-hoc":"0.6.8","react-sizeme":"2.5.2","react-redux":"5.1.1","react-virtualized":"9.21.2",redux:"3.7.2","redux-thunk":"2.3.0",reselect:"2.5.4","prop-types":"^15.6.1",uuid:"3.4.0"},exports.DEPRECATED_DEPENDENCIES=[{dependency:"mapbox.js",message:'mapbox.js is deprecated and is no longer provided to Dev Center apps as a shared dependency. Use mapbox-gl 3.16.0 instead (provided by the platform as the window["mapbox-gl"] shared dependency). Remove mapbox.js from your package.json and migrate any L.mapbox usage to mapbox-gl.'}],exports.UNSUPPORTED_DEPENDENCIES=[{dependency:"date-fns",alternative:"moment"},{dependency:"date-fns-tz",alternative:"moment-timezone"},{dependency:"date-fns-timezone",alternative:"moment-timezone"}];
@@ -0,0 +1 @@
1
+ import e from"react-dom";function o(o){return"function"==typeof e.createRoot?e.createRoot(o):(console.info("[dc-platform-shared] React 17 detected — mounting via legacy ReactDOM.render"),{render(t){e.render(t,o)},unmount(){e.unmountComponentAtNode(o)}})}export{o as createAdaptiveRoot};
@@ -1 +1,11 @@
1
- "use strict";var e,r=require('./../../../../ext-cjs/@babel/runtime/helpers/taggedTemplateLiteral.js'),n=require('./../../../../ext-cjs/@babel/runtime/helpers/asyncToGenerator.js'),t=require('./../../../../ext-cjs/@babel/runtime/regenerator/index.js'),o=require("node-fetch"),a=require("chalk"),s=require("semver/functions/gt"),i=require("path"),u=require("fs"),c=process.cwd(),l=JSON.parse(u.readFileSync(i.resolve(c,"./node_modules/@corva/ui/package.json"),"utf-8"));function d(e){return o("https://registry.npmjs.org/@corva/ui/latest").then((function(r){return r.ok?r.json().then((function(e){return e.version})):e.warn("Could not fetch latest @corva/ui version")})).catch((function(r){return e.warn("Connection error",r)}))}var p=null;module.exports=function(o){var i;o.hooks.afterCompile.tapPromise("checkCorvaUIVersion",(i=n(t.mark((function n(o){var i,u;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=o.getLogger("checkCorvaUIVersion"),u=l.version,p){n.next=6;break}return n.next=5,d(i);case 5:p=n.sent;case 6:p&&s(p,u)&&i.warn(a(e||(e=r(["\n ****************************************************************\n\n You are using outdated version of @corva/ui {grey (",")}.\n Current latest version is {green.bold (",")}.\n This may lead to problems once the app is published.\n Please update the @corva/ui with the following command:\n\n {green.bold yarn add @corva/ui@latest}\n\n ****************************************************************"])),u,p));case 7:case"end":return n.stop()}}),n)}))),function(e){return i.apply(this,arguments)}))};
1
+ "use strict";const e=require("node-fetch"),r=require("chalk"),o=require("semver/functions/gt"),t=require("path"),n=require("fs"),s=process.cwd(),a=JSON.parse(n.readFileSync(t.resolve(s,"./node_modules/@corva/ui/package.json"),"utf-8"));let i=null;module.exports=function(t){t.hooks.afterCompile.tapPromise("checkCorvaUIVersion",(async t=>{const n=t.getLogger("checkCorvaUIVersion"),s=a.version;i||(i=await function(r){return e("https://registry.npmjs.org/@corva/ui/latest").then((e=>e.ok?e.json().then((e=>e.version)):r.warn("Could not fetch latest @corva/ui version"))).catch((e=>r.warn("Connection error",e)))}(n)),i&&o(i,s)&&n.warn(r`
2
+ ****************************************************************
3
+
4
+ You are using outdated version of @corva/ui {grey (${s})}.
5
+ Current latest version is {green.bold (${i})}.
6
+ This may lead to problems once the app is published.
7
+ Please update the @corva/ui with the following command:
8
+
9
+ {green.bold yarn add @corva/ui@latest}
10
+
11
+ ****************************************************************`)}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-cjs/@babel/runtime/helpers/asyncToGenerator.js'),r=require('./../../../../ext-cjs/@babel/runtime/regenerator/index.js'),t=require("./serializeDotEnv.js"),n=require("fs").promises,s=require("path"),o=require("express");exports.onBeforeSetupMiddleware=function(a,u){var i,c=u.APP_DIRECTORY;a.use(o.json()),a.patch("/dotenv",(i=e(r.mark((function e(o,a){var u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u="",e.prev=1,e.next=4,n.readFile(s.resolve(c,"./.env"),"utf8");case 4:u=e.sent,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(1);case 9:return e.prev=9,e.next=12,n.writeFile(s.resolve(c,"./.env"),t.updateDotEnv(u,o.body));case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(9),console.error("Could not write to .env file"),console.error(e.t1);case 18:a.sendStatus(200);case 19:case"end":return e.stop()}}),e,null,[[1,7],[9,14]])}))),function(e,r){return i.apply(this,arguments)}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./serializeDotEnv.js");const r=require("fs").promises,t=require("path"),o=require("express");exports.onBeforeSetupMiddleware=function(s,{APP_DIRECTORY:i}){s.use(o.json()),s.patch("/dotenv",(async function(o,s){let n="";try{n=await r.readFile(t.resolve(i,"./.env"),"utf8")}catch(e){}try{await r.writeFile(t.resolve(i,"./.env"),e.updateDotEnv(n,o.body))}catch(e){console.error("Could not write to .env file"),console.error(e)}s.sendStatus(200)}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-cjs/@babel/runtime/helpers/slicedToArray.js'),t=function(e,t){return"".concat(e,"=").concat((((n=t.replace(/\n/g,"\\n")).includes(" ")||n.includes("\t"))&&(n='"'.concat(n.replace(/"/g,'\\"'),'"')),n));var n};exports.updateDotEnv=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,c=r||{};return n.split("\n").map((function(n){if(!n.length||n.startsWith("#"))return n;var r=n.split("="),i=e(r,1)[0];if(Object.keys(c).includes(i)){var u=c[i];return delete c[i],t(i,u)}return n})).concat(Object.entries(c).map((function(n){var r=e(n,2),c=r[0],i=r[1];return t(c,i)}))).join("\n")};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=(e,t)=>`${e}=${(e=>{let t=e.replace(/\n/g,"\\n");return(t.includes(" ")||t.includes("\t"))&&(t=`"${t.replace(/"/g,'\\"')}"`),t})(t)}`;exports.updateDotEnv=(t="",n)=>{const r=n||{};return t.split("\n").map((t=>{if(!t.length||t.startsWith("#"))return t;const[n]=t.split("=");if(Object.keys(r).includes(n)){const t=r[n];return delete r[n],e(n,t)}return t})).concat(Object.entries(r).map((([t,n])=>e(t,n)))).join("\n")};
@@ -1 +1 @@
1
- "use strict";var e=require('./../../../../ext-cjs/@babel/runtime/helpers/slicedToArray.js'),n=require("../constants.js");module.exports=function(r){var o=r.dependencies,c=void 0===o?{}:o,s=[];return Object.entries(n.CORVA_GLOBAL_DEPENDENCIES).forEach((function(n){var r=e(n,2),o=r[0],t=r[1];if(t&&o in c){var a=c[o];Array.isArray(t)?t.includes(a)||s.push("".concat(o," version must be one of [").concat(t.join(", "),"]")):a!==t&&s.push("".concat(o," version must be ").concat(t))}})),n.UNSUPPORTED_DEPENDENCIES.forEach((function(e){var n=e.dependency,r=e.alternative,o=void 0===r?"":r;n in c&&s.push("".concat(n," is not supported.").concat(o?" Please use ".concat(o," instead."):""))})),s};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants.js");exports.default=function({dependencies:n={}}){const s=[];return Object.entries(e.CORVA_GLOBAL_DEPENDENCIES).forEach((([e,t])=>{if(t&&e in n){const r=n[e];Array.isArray(t)?t.includes(r)||s.push(`${e} version must be one of [${t.join(", ")}]`):r!==t&&s.push(`${e} version must be ${t}`)}})),e.UNSUPPORTED_DEPENDENCIES.forEach((({dependency:e,alternative:t=""})=>{e in n&&s.push(`${e} is not supported.${t?` Please use ${t} instead.`:""}`)})),s},exports.getDependenciesWarnings=function({dependencies:n={}}){const s=[];return e.DEPRECATED_DEPENDENCIES.forEach((({dependency:e,message:t})=>{e in n&&s.push(t)})),s};
@@ -1 +1 @@
1
- "use strict";var e=require("./dependencies.js"),r=require("chalk");module.exports=function(n){var o=n.packageJson,c=e(o);c.forEach((function(e){return console.log(r.red(e))})),c.length&&process.exit(1)};
1
+ "use strict";var e=require("./dependencies.js");const o=require("chalk");module.exports=function({packageJson:n}){const s=e.default(n);e.getDependenciesWarnings(n).forEach((e=>console.log(o.yellow(e)))),s.forEach((e=>console.log(o.red(e)))),s.length&&process.exit(1)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./validators/index.js"),s=require("webpack"),o=require("path"),r=require("uuid/v1"),t=require("clean-webpack-plugin").CleanWebpackPlugin,a=require("fs"),l=process.cwd(),n=JSON.parse(a.readFileSync(o.resolve(l,"./package.json"),"utf-8")),p=JSON.parse(a.readFileSync(o.resolve(l,"./manifest.json"),"utf-8"));exports.APP_DIRECTORY=l,exports.default=function(a,l){return e({packageJson:n}),{entry:"./src/index.js",output:{filename:"[name].[contenthash].js",path:o.resolve(process.cwd(),"dist")},devServer:{historyApiFallback:!0},performance:{maxAssetSize:1024e3},plugins:[new t,new s.ProvidePlugin({process:"process/browser"})],resolve:{symlinks:!1,extensions:[".js",".jsx",".json",".ts",".tsx"]},module:{rules:[{test:/\.css$/i,use:["style-loader",{loader:"css-loader",options:{modules:{localIdentName:"development"===l.mode?"[path][name]__[local]__".concat(r().substr(-5)):"[name]__[hash:base64:3]".concat(r().substr(-5))},importLoaders:1}},{loader:"postcss-loader",options:{postcssOptions:{plugins:["postcss-preset-env"]}}}]},{test:/\.(js|jsx)$/,exclude:/[\\/]node_modules[\\/]/,use:{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}}},{test:/\.ts(x?)$/,exclude:/[\\/]node_modules[\\/]/,use:[{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}},{loader:"ts-loader",options:{compilerOptions:{noEmit:!1}}}]},{test:/\.m?js/,resolve:{fullySpecified:!1}}]}}},exports.manifestJson=p,exports.packageJson=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./validators/index.js");const s=require("webpack"),o=require("path"),r=require("uuid/v1"),{CleanWebpackPlugin:t}=require("clean-webpack-plugin"),a=require("fs"),l=process.cwd(),n=JSON.parse(a.readFileSync(o.resolve(l,"./package.json"),"utf-8")),p=JSON.parse(a.readFileSync(o.resolve(l,"./manifest.json"),"utf-8"));exports.APP_DIRECTORY=l,exports.default=function(a,l){return e({packageJson:n}),{entry:"./src/index.js",output:{filename:"[name].[contenthash].js",path:o.resolve(process.cwd(),"dist")},devServer:{historyApiFallback:!0},performance:{maxAssetSize:1024e3},plugins:[new t,new s.ProvidePlugin({process:"process/browser"})],resolve:{symlinks:!1,extensions:[".js",".jsx",".json",".ts",".tsx"]},module:{rules:[{test:/\.(s[ac]|c)ss$/i,use:["style-loader",{loader:"css-loader",options:{modules:{localIdentName:"development"===l.mode?`[path][name]__[local]__[hash:base64:10]__${r().substr(-5)}`:`[name]--[local]__[hash:base64:10]__${r().substr(-5)}`,namedExport:!1},importLoaders:2}},{loader:"postcss-loader",options:{postcssOptions:{plugins:["postcss-preset-env"]}}},{loader:"sass-loader",options:{sourceMap:!0}}]},{test:/\.(js|jsx)$/,exclude:/[\\/]node_modules[\\/]/,use:{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}}},{test:/\.ts(x?)$/,exclude:/[\\/]node_modules[\\/]/,use:[{loader:"babel-loader",options:{presets:["@babel/preset-env",["@babel/preset-react",{runtime:"automatic"}]]}},{loader:"ts-loader",options:{compilerOptions:{noEmit:!1}}}]},{test:/\.m?js/,resolve:{fullySpecified:!1}}]}}},exports.manifestJson=p,exports.packageJson=n;
@@ -1 +1 @@
1
- "use strict";var e=require('./../../../ext-cjs/@babel/runtime/helpers/defineProperty.js'),r=require('./../../../ext-cjs/@babel/runtime/helpers/toConsumableArray.js'),t=require("./webpack.config.common.js"),o=require("./constants.js"),n=require("./plugins/checkCorvaUIVersion.js"),s=require("./utils/middlewares.js");function i(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 c(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var a=require("@pmmmwh/react-refresh-webpack-plugin"),l=require("webpack-merge").merge,p=require("path"),u=require("webpack"),d=require("clean-webpack-plugin").CleanWebpackPlugin,m=require("copy-webpack-plugin"),v=require("html-webpack-plugin"),_=require("chalk");require("dotenv").config({path:p.resolve(t.APP_DIRECTORY,"./.env")});function f(e,t,o){var n=p.join("@corva","dc-platform-shared"),s="@corva/ui",i=new RegExp("(^".concat(s,"$|^").concat(s,"/)([^]+)?"));if(!e.includes(n)){var c=i.exec(t);if(null!==c){var a=c[2]||"";return o(null,["window",s].concat(r(a.split("/").filter(Boolean))))}}return o()}module.exports=function(e,r){var i,P=process.env.HOST||r.host||"app.local.corva.ai",O=process.env.PORT||r.port||8080;return l(t.default(e,r),{mode:"development",devtool:"inline-source-map",devServer:{static:"./dist",host:P,port:O,onBeforeSetupMiddleware:function(e){return s.onBeforeSetupMiddleware(e.app,{APP_DIRECTORY:t.APP_DIRECTORY})},hot:!0,open:!1},entry:{devApp:p.resolve(__dirname,"DevServerEntryPoint.js"),isolatedApp:p.resolve(__dirname,"DevServerIsolatedAppEntryPoint.js")},output:{filename:"[name].js"},plugins:[new d,new m({patterns:[{from:p.resolve(__dirname,"public")},{from:p.resolve(process.cwd(),"node_modules","@corva/ui/assets"),to:"static/media",noErrorOnMissing:!0},{from:p.resolve(process.cwd(),"node_modules","@corva/dc-platform-shared/assets"),to:"static/media",noErrorOnMissing:!0}]}),new v({filename:"index.html",inject:!1,template:p.resolve(__dirname,"public","index.html")}),new v({filename:"DevCenterIsolatedAppPage.html",inject:!1,template:p.resolve(__dirname,"public","DevCenterIsolatedAppPage.html")}),new u.EnvironmentPlugin(c(c({},process.env),{},{DEV_CENTER_APP_PATH:process.cwd(),REACT_APP_ENVIRONMENT:process.env.REACT_APP_ENVIRONMENT||"development"},(i=process.env.CORVA_API_ENV||o.CORVA_API_ENVS.production,i in o.CORVA_API_ENVS?o.CORVA_API_ENV_VARIABLES[i]:(console.log(_.red("CORVA_API_ENV should be one of [".concat(Object.keys(o.CORVA_API_ENVS).join(", "),"]"))),process.exit(1))))),n,new a],externals:f,module:{rules:[{test:/\.(png|jpe?g|gif)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
1
+ "use strict";var e=require("./webpack.config.common.js"),r=require("./constants.js"),o=require("./plugins/checkCorvaUIVersion.js"),n=require("./utils/middlewares.js");const s=require("@pmmmwh/react-refresh-webpack-plugin"),{merge:t}=require("webpack-merge"),i=require("path"),a=require("webpack"),{CleanWebpackPlugin:l}=require("clean-webpack-plugin"),p=require("copy-webpack-plugin"),c=require("html-webpack-plugin"),u=require("chalk");require("dotenv").config({path:i.resolve(e.APP_DIRECTORY,"./.env")});const d=()=>{const e=process.env.CORVA_API_ENV||r.CORVA_API_ENVS.production;return e in r.CORVA_API_ENVS?r.CORVA_API_ENV_VARIABLES[e]:(console.log(u.red(`CORVA_API_ENV should be one of [${Object.keys(r.CORVA_API_ENVS).join(", ")}]`)),process.exit(1))};function m(e,r,o){const n=i.join("@corva","dc-platform-shared"),s="@corva/ui",t=new RegExp("(^@corva/ui$|^@corva/ui/)([^]+)?");if(!e.includes(n)){const e=t.exec(r);if(null!==e){return o(null,["window",s,...(e[2]||"").split("/").filter(Boolean)])}}return o()}const v=r=>i.dirname(require.resolve(`${r}/package.json`,{paths:[e.APP_DIRECTORY]}));module.exports=function(r,u){const _=process.env.HOST||u.host||"app.local.corva.ai",A=process.env.PORT||u.port||8080,P="mapbox-gl"in(e.packageJson.dependencies||{})?[i.resolve(__dirname,"MapboxGlDevSetupEntryPoint.js")]:[];return t(e.default(r,u),{mode:"development",devtool:"inline-source-map",resolve:{alias:{react:v("react"),"react-dom":v("react-dom")}},devServer:{static:"./dist",host:_,port:A,setupMiddlewares:(r,o)=>(n.onBeforeSetupMiddleware(o.app,{APP_DIRECTORY:e.APP_DIRECTORY}),r),hot:!0,open:!1},entry:{devApp:[i.resolve(__dirname,"DevServerEntryPoint.js"),...P],isolatedApp:[i.resolve(__dirname,"DevServerIsolatedAppEntryPoint.js"),...P]},output:{filename:"[name].js"},plugins:[new l,new p({patterns:[{from:i.resolve(__dirname,"public")},{from:i.resolve(process.cwd(),"node_modules","@corva/ui/assets"),to:"static/media",noErrorOnMissing:!0},{from:i.resolve(process.cwd(),"node_modules","@corva/dc-platform-shared/assets"),to:"static/media",noErrorOnMissing:!0}]}),new c({filename:"index.html",inject:!1,template:i.resolve(__dirname,"public","index.html")}),new c({filename:"DevCenterIsolatedAppPage.html",inject:!1,template:i.resolve(__dirname,"public","DevCenterIsolatedAppPage.html")}),new a.EnvironmentPlugin({...process.env,DEV_CENTER_APP_PATH:process.cwd(),REACT_APP_ENVIRONMENT:process.env.REACT_APP_ENVIRONMENT||"development",...d()}),o,new s],externals:m,module:{rules:[{test:/\.(png|jpe?g|gif)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
@@ -1 +1 @@
1
- "use strict";var e=require('./../../../ext-cjs/@babel/runtime/helpers/toConsumableArray.js'),r=require('./../../../ext-cjs/@babel/runtime/helpers/slicedToArray.js'),n=require("./webpack.config.common.js"),t=require("./constants.js"),o=require("webpack"),i=require("webpack-merge").merge,s=require("path"),a=require("terser-webpack-plugin"),l=require("copy-webpack-plugin"),u=n.manifestJson.application.key,c=n.packageJson.version,p=function(e){var r=u.replace(/\./g,"_");return e?r:"".concat(r,"-").concat(c)},m=Object.keys(t.CORVA_GLOBAL_DEPENDENCIES).map((function(e){return[e,new RegExp("(^".concat(e,"$|^").concat(e,"/)([^]+)?"))]})),f=["react/jsx-runtime","highcharts/"];module.exports=function(t,u){var c=!(null==t||!t.local_debug);return i(n.default(t,u),{entry:"./src/index.js",output:{library:p(c),path:s.resolve(n.APP_DIRECTORY,"dist"),filename:"app.js",libraryTarget:"window"},mode:c?"development":"production",plugins:[new o.EnvironmentPlugin(process.env),new l({patterns:[{from:s.resolve(process.cwd(),"manifest.json"),to:"./",noErrorOnMissing:!0}]})],optimization:{minimizer:[new a({parallel:!0})]},externals:[function(n,t,o){for(var i=0;i<f.length;i+=1)if(t.startsWith(f[i]))return o();for(var s=0;s<m.length;s+=1){var a=r(m[s],2),l=a[0],u=a[1].exec(t);if(null!==u){var c=u[2]||"";return o(null,[l].concat(e(c.split("/").filter(Boolean))))}}return o()}],module:{rules:[{test:/\.(png|jpe?g|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
1
+ "use strict";var e=require("./webpack.config.common.js"),r=require("./constants.js");const t=require("webpack"),{merge:n}=require("webpack-merge"),s=require("path"),i=require("terser-webpack-plugin"),o=require("copy-webpack-plugin"),{application:{key:l}}=e.manifestJson,{version:a}=e.packageJson,u=e=>{const r=l.replace(/\./g,"_");return e?r:`${r}-${a}`},p=Object.keys(r.CORVA_GLOBAL_DEPENDENCIES).map((e=>[e,new RegExp(`(^${e}$|^${e}/)([^]+)?`)])),c=["react/jsx-runtime","highcharts/"];module.exports=function(r,l){const a=!!r?.local_debug;return n(e.default(r,l),{entry:"./src/index.js",output:{library:u(a),path:s.resolve(e.APP_DIRECTORY,"dist"),filename:"app.js",libraryTarget:"window"},mode:a?"development":"production",plugins:[new t.EnvironmentPlugin(process.env),new o({patterns:[{from:s.resolve(process.cwd(),"manifest.json"),to:"./",noErrorOnMissing:!0}]})],optimization:{minimizer:[new i({parallel:!0})]},externals:[function(e,r,t){if(r.endsWith(".css"))return t();for(let e=0;e<c.length;e+=1)if(r.startsWith(c[e]))return t();for(let e=0;e<p.length;e+=1){const[n,s]=p[e],i=s.exec(r);if(null!==i){return t(null,[n,...(i[2]||"").split("/").filter(Boolean)])}}return t()}],module:{rules:[{test:/\.(png|jpe?g|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource"},{test:/\.svg$/,use:[{loader:"svg-url-loader",options:{limit:1e4}}]}]}})};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/defineProperty";import o from'./../../ext-esm/auth0-js/dist/auth0.min.esm.js';var i=e((function e(){var i=this;n(this,e),t(this,"handleAuthentication",(function(e,n){return i.webAuth.parseHash((function(t,o){o&&o.accessToken?e(o):t&&n(t)}))})),t(this,"loginWithConnection",(function(e){return i.webAuth.authorize({connection:e})})),this.webAuth=new o.WebAuth({domain:process.env.REACT_APP_AUTH0_DOMAIN,clientID:process.env.REACT_APP_AUTH0_CLIENT_ID,redirectUri:"".concat(window.location.origin,"/login/oauth-callback"),audience:process.env.REACT_APP_AUTH0_AUDIENCE,responseType:"token",scope:"openid profile email"})}));export{i as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import o from'./../../ext-esm/auth0-js/dist/auth0.min.esm.js';class t{constructor(){e(this,"handleAuthentication",((e,o)=>this.webAuth.parseHash(((t,i)=>{i&&i.accessToken?e(i):t&&o(t)})))),e(this,"loginWithConnection",(e=>this.webAuth.authorize({connection:e}))),this.webAuth=new o.WebAuth({domain:process.env.REACT_APP_AUTH0_DOMAIN,clientID:process.env.REACT_APP_AUTH0_CLIENT_ID,redirectUri:`${window.location.origin}/login/oauth-callback`,audience:process.env.REACT_APP_AUTH0_AUDIENCE,responseType:"token",scope:"openid profile email"})}}export{t as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import{makeStyles as e,Tooltip as o,IconButton as t}from"@material-ui/core";import{UnlockIcon as a,LockIcon as c}from"@corva/ui/icons";import n from"classnames";import{jsx as i}from"react/jsx-runtime";function s(r,e){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.push.apply(o,t)}return o}function l(e){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?s(Object(t),!0).forEach((function(o){r(e,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var b=e({root:{width:36,height:36,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"},borderRadius:8},button:{width:"100%",height:"100%","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}}});function d(r){var e=r.className,c=r.disabled,s=r.isDraggableAndResizable,d=r.LockIcon,p=r.lockIconClassName,u=r.onClick,m=r.pageName,f=r.tooltipProps,h=b();return i(o,l(l({title:c?"Can't unlock dashboard layout":s?"Lock Dashboard Layout":"Unlock Dashboard Layout"},f),{},{children:i("div",{className:n(h.root,e),children:i(t,{className:h.button,"data-testid":"".concat(m,"_").concat(s?"gridUnlocked":"gridLocked"),disabled:c,onClick:u,children:s?i(a,{}):i(d,{className:p})})})}))}d.defaultProps={LockIcon:c,tooltipProps:{}};export{d as default};
1
+ import{makeStyles as o,Tooltip as a,IconButton as r}from"@material-ui/core";import{UnlockIcon as t,LockIcon as e}from"@corva/ui/icons";import i from"classnames";import{jsx as c}from"react/jsx-runtime";const s=o({root:{width:36,height:36,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"},borderRadius:8},button:{width:"100%",height:"100%","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}}});function d({className:o,disabled:d,isDraggableAndResizable:l,LockIcon:n=e,lockIconClassName:m,onClick:u,pageName:b,tooltipProps:h={}}){const g=s();return c(a,{title:d?"Can't unlock dashboard layout":l?"Lock Dashboard Layout":"Unlock Dashboard Layout",...h,children:c("div",{className:i(g.root,o),children:c(r,{className:g.button,"data-testid":`${b}_${l?"gridUnlocked":"gridLocked"}`,disabled:d,onClick:u,children:l?c(t,{}):c(n,{className:m})})})})}export{d as default};
@@ -1 +1 @@
1
- import t from"prop-types";import{styled as e,withStyles as r,Grid as i,Chip as a}from"@material-ui/core";import o from"@material-ui/icons/ArrowBack";import{jsx as n}from"react/jsx-runtime";var p=e(o)((function(t){return{color:t.theme.palette.primary.text6,fontSize:16}})),s=function(t){var e=t.label,r=t.onClick,o=t.classes,s=t.dataTestid;return n(i,{item:!0,className:o.chip,children:n(a,{label:e,className:o.chipContent,icon:n(p,{}),variant:"outlined",onClick:r,"data-testid":s})})};s.defaultProps={dataTestid:null},s.propTypes={label:t.string.isRequired,dataTestid:t.string,onClick:t.func.isRequired,classes:t.shape({}).isRequired};var l=r((function(t){return{chip:{marginTop:"-25px",marginBottom:20,textAlign:"center"},chipContent:{color:t.palette.primary.text6,fontSize:13,border:"none",background:"#2C2C2C",padding:"0 5px 0 10px"}}}))(s);export{l as default};
1
+ import e from"prop-types";import{styled as t,withStyles as i,Grid as r,Chip as a}from"@material-ui/core";import o from"@material-ui/icons/ArrowBack";import{jsx as n}from"react/jsx-runtime";const p=t(o)((({theme:e})=>({color:e.palette.primary.text6,fontSize:16}))),s=({label:e,onClick:t,classes:i,dataTestid:o=null})=>n(r,{item:!0,className:i.chip,children:n(a,{label:e,className:i.chipContent,icon:n(p,{}),variant:"outlined",onClick:t,"data-testid":o})});s.propTypes={label:e.string.isRequired,dataTestid:e.string,onClick:e.func.isRequired,classes:e.shape({}).isRequired};var l=i((e=>({chip:{marginTop:"-25px",marginBottom:20,textAlign:"center"},chipContent:{color:e.palette.primary.text6,fontSize:13,border:"none",background:"#2C2C2C",padding:"0 5px 0 10px"}})))(s);export{l as default};