@corva/dc-platform-shared 0.0.0-ada213s → 0.0.0-b3a7dfb7f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLI/hocs/effects/useProvideAuth/api.js +1 -0
- package/CLI/hocs/effects/useProvideAuth/constants.js +1 -0
- package/CLI/hocs/effects/useProvideAuth/useProvideAuth.js +1 -1
- package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
- package/CLI/screens/LoginScreen/LoginScreen.js +1 -1
- package/CLI/screens/LoginScreen/components/Auth.js +1 -1
- package/CLI/screens/LoginScreen/components/AuthStep.js +1 -1
- package/CLI/screens/LoginScreen/components/EmailStep.js +1 -1
- package/cjs/devcenter/webpack/DevServerIsolatedAppEntryPoint.js +1 -1
- package/cjs/devcenter/webpack/constants.js +1 -1
- package/cjs/devcenter/webpack/webpack.config.common.js +1 -1
- package/cjs/devcenter/webpack/webpack.config.prod.js +1 -1
- package/components/GridLockButton/index.js +1 -1
- package/components/Login/components/VerificationStep.js +1 -0
- package/components/Login/index.js +1 -1
- package/package.json +4 -6
- package/cjs/jest/setupTests.js +0 -16
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var 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
|
|
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 p}from"./constants.js";import{getUserToken as l}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();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,l(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(p.invalidVerificationCode):null!==(u=t.t0.isMissingVerificationCode)&&void 0!==u&&u.call(t.t0)?j(p.missingVerificationCode):j(p.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(){if(m.test(d.location.pathname))return _(!1);k()}),[]),{user:y,loading:C,error:U,login:H,logout:N,auth0:A.current}}export{d as default};
|
|
@@ -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
|
|
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 p}from"lodash";import{withSize as s}from"react-sizeme";import{isPhoneDetected as a,isNativeDetected as m,isMobileDetected as c}from"@corva/ui/utils/mobileDetect";import{getAppSize as l}from"@corva/ui/utils/apps";import{GRID_BREAKPOINTS as d,GRID_COLUMN_SIZES as g,GRID_ROW_HEIGHT as u,NON_DRAGGABLE_ELEMENT_SELECTOR as f}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 b}from"../../../components/AppsGridDragHandle/AppsGridDragHandle.js";import j from"../../../components/GridLockButton/index.js";import{isAppMaximized as h}from"../../../utils/devcenter.js";import"../../../utils/recaptcha.js";import{getLocalAppData as y,getAppCoordinates as O,updateLocalAppData as v}from"../utils.js";import"./withGridLayoutHOC.global.css.js";import L from"./withGridLayoutHOC.css.js";import{jsxs as D,jsx as w}from"react/jsx-runtime";var S=["size"];function P(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 H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}))}return e}var x=".".concat(b.GRID_LAYOUT_DRAG_HANDLE_CLASS),C=i(n),z=function(o){return s()((function(i){var n,s=i.size,P=t(i,S),z=s.width,A=P.manifest.application.key,G=r(null!==(n=y(A).isDraggable)&&void 0!==n&&n),R=e(G,2),E=R[0],k=R[1],F=m||c,M=h(P.devCenterRouter.location.query),W=r(O(P.manifest)),_=e(W,2),N=_[0],T=_[1],B=l({coordinates:N,dashboardWidth:z,isMaximized:M}),q=B.pixelHeight,I=B.pixelWidth,U=function(o){var t=e(o,1)[0],r=p(t,["x","y","w","h"]);T(r),v(A,{coordinates:r})};return D("div",{children:[w(C,{breakpoints:a?d.phone:d.general,cols:g,rowHeight:u,measureBeforeMount:!0,onResizeStop:U,onDragStop:U,isDraggable:!F&&E,isResizable:!F&&E,draggableCancel:f,useCSSTransforms:!1,draggableHandle:x,children:w("div",{"data-grid":N,children:D("div",{className:M?L.appMaximized:"",children:[w(o,H(H({},P),{},{coordinates:H(H({},N),{},{pixelHeight:q,pixelWidth:I}),layoutEnvironment:{type:"general",pdfReportMode:!1}})),!F&&E&&w(b,{})]})},"with-grid-layout-hoc")}),w(j,{isDraggableAndResizable:E,onClick:function(){k(!E),v(A,{isDraggable:!E})},pageName:"DashboardPo"})]})}))};export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import{useEffect as
|
|
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 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import{useState as t}from"react";import r from"./EmailStep.js";import
|
|
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 +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
|
|
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 +1 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/
|
|
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 +1 @@
|
|
|
1
|
-
import o from"react-dom";import t from"prop-types";import{makeStyles as n}from"@material-ui/core";import*as p from"@corva/ui";import{DevCenterIsolatedAppPage as
|
|
1
|
+
import o from"react-dom";import t from"prop-types";import{makeStyles as n}from"@material-ui/core";import*as p from"@corva/ui";import{DevCenterIsolatedAppPage as r}from"@corva/ui/components";import{jsx as e}from"react/jsx-runtime";window["@corva/ui"]=p;var i=n((function(){return{reportsContainer:{zoom:"0.5"}}}));function m(o){var t=o.CLIAppComponent,n=o.CLIAppSettings,p=i();return e(r,{CLIAppComponent:t,CLIAppSettings:n,containerReportClassName:p.reportsContainer})}m.propTypes={CLIAppComponent:t.func,CLIAppSettings:t.func},m.defaultProps={CLIAppComponent:null,CLIAppSettings:null},import("".concat(process.env.DEV_CENTER_APP_PATH,"/src/index.js")).then((function(t){var n=t.default.component,p=t.default.settings;o.render(e(m,{CLIAppComponent:n,CLIAppSettings:p}),document.getElementById("root"))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require('./../../../ext-cjs/@babel/runtime/helpers/defineProperty.js');function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require('./../../../ext-cjs/@babel/runtime/helpers/defineProperty.js');function a(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?a(Object(i),!0).forEach((function(a){e(t,a,i[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var i={qa:"qa",staging:"staging",production:"production"},o={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={},i.qa,r(r({},o),{},{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",REACT_APP_FEATURE_FLAGS_URL:"https://feature-flags.qa.corva.ai",REACT_APP_FEATURE_FLAGS_ADMIN_URL:"https://feature-flags-admin.qa.corva.ai"})),e(t,i.staging,r(r({},o),{},{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",REACT_APP_FEATURE_FLAGS_URL:"https://feature-flags.qa.corva.ai",REACT_APP_FEATURE_FLAGS_ADMIN_URL:"https://feature-flags-admin.qa.corva.ai"})),e(t,i.production,r(r({},o),{},{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=i,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","react-dom":"17.0.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 +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"),n=process.cwd(),l=JSON.parse(a.readFileSync(o.resolve(n,"./package.json"),"utf-8")),p=JSON.parse(a.readFileSync(o.resolve(n,"./manifest.json"),"utf-8"));exports.APP_DIRECTORY=n,exports.default=function(a,n){return e({packageJson:l}),{entry:"./src/index.js",output:{filename:"[name].[contenthash].js",path:o.resolve(process.cwd(),"dist")
|
|
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"),n=process.cwd(),l=JSON.parse(a.readFileSync(o.resolve(n,"./package.json"),"utf-8")),p=JSON.parse(a.readFileSync(o.resolve(n,"./manifest.json"),"utf-8"));exports.APP_DIRECTORY=n,exports.default=function(a,n){return e({packageJson:l}),{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"===n.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}}}]}]}}},exports.manifestJson=p,exports.packageJson=l;
|
|
@@ -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"),
|
|
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 +1 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/defineProperty";import{makeStyles as e,Tooltip as
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as n,useEffect as i}from"react";import{Button as o}from"@corva/ui/components";import{makeStyles as a,Grid as c,Typography as l}from"@material-ui/core";import u from"classnames";import d from"./Step.js";import s from"./StepContent.js";import{jsxs as m,jsx as p,Fragment as f}from"react/jsx-runtime";var h=a((function(e){return{stepHeader:{padding:e.spacing(4),textAlign:"center",width:"100%",display:"flex",flexDirection:"column",alignItems:"center"},subtitle:{marginTop:e.spacing(2),color:e.palette.primary.text6,fontSize:16,letterSpacing:-.01,lineHeight:"normal"},form:{display:"flex",justifyContent:"space-between"},actions:{display:"flex",justifyContent:function(e){return e.isResendButtonVisible?"space-between":"end"},width:"100%",padding:"24px 32px 40px"},input:{"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{"-webkit-appearance":"none",margin:0},padding:8,border:"1px solid ".concat(e.palette.primary.text9),borderRadius:4,backgroundColor:e.palette.background.b4,color:e.palette.primary.contrastText,fontSize:30,textAlign:"center","&:active, &:hover, &:focus-visible":{border:"1px solid ".concat(e.palette.primary.main),outline:"none"}},inputError:{border:"1px solid ".concat(e.palette.error.main," !important")},footer:{width:"100%",padding:"0 32px",fontSize:14,letterSpacing:-.01,color:e.palette.primary.text6,textAlign:"center"},divider:{borderTop:"1px solid rgba(255, 255, 255, 0.2)",width:"100%",marginBottom:40},footerButton:{cursor:"pointer",color:e.palette.primary.main}}})),b="email",v="sms",g=Array.from({length:6},(function(){return""}));function y(a){var y=a.email,x=a.identityVerification,S=a.loginVerificationFailure,C=a.onCodeProvided,N=a.requestVerification,w=r(x.enabled_modes[0]),k=t(w,2),B=k[0],T=k[1],j=r(g),V=t(j,2),A=V[0],D=V[1],E=r(S),I=t(E,2),R=I[0],z=I[1],H=r(!1),M=t(H,2),P=M[0],_=M[1],q=h({isResendButtonVisible:P}),F=n(null),W=n(null);i((function(){z(S),S&&(_(!0),W.current=null)}),[S]),i((function(){return N({email:y,mode:B}).then((function(){W.current=setTimeout((function(){_(!0),W.current=null}),15e3)})).catch(console.error),function(){W.current&&clearTimeout(W.current)}}),[]);var Y=function(){A.every(Boolean)&&C({code:A.join(""),mode:B})},G=A.every(Boolean);i((function(){G&&Y()}),[A.join(),G]);var J=function(e){e.preventDefault(),Y()},K=function(r){return function(n){var i=t(n.target.value,2),o=i[0],a=i[1],c=A[r],l=o;a&&a!==c&&(l=a);var u=e(A);u[r]=l,D(u),z(!1),void 0===l&&r>0?F.current.childNodes[r-1].focus():l&&r<5&&F.current.childNodes[r+1].focus()}},L=function(e){return function(){T(e),N({email:y,mode:e}).catch(console.error),_(!1),z(!1),D(g),W.current&&clearTimeout(W.current),W.current=setTimeout((function(){_(!0),W.current=null}),15e3)}};return m(d,{children:[m(c,{item:!0,className:q.stepHeader,children:[p(l,{variant:"h6",children:R?"Invalid Verification Code":"Verify Your Identity"}),p("div",{className:q.subtitle,children:B===b?"Enter a 6-digit code which was set to ".concat(y):"We have sent an SMS with one time verification code to your phone number"})]}),p(s,{children:p("form",{className:q.form,id:"verification-form",onSubmit:J,autoComplete:"on",ref:F,onPaste:function(e){var t=String(e.clipboardData.getData("text")).trim().slice(0,6).split("");t.every((function(e){return Number.isInteger(Number(e))}))&&6===t.length&&D(t)},children:A.map((function(e,t){return p("input",{type:"number",min:0,max:9,onChange:K(t),className:u(q.input,R&&q.inputError),value:e},t)}))})}),m("div",{className:q.actions,children:[P&&p(o,{onClick:L(B),variation:"secondary",children:"Resend Code"}),p(o,{disabled:!G||R,form:"verification-form",onClick:J,type:"submit",variation:"primary",children:"Next"})]}),x.enabled_modes.length>1&&m("div",{className:q.footer,children:[p("div",{className:q.divider}),m(f,B===b?{children:["Send a code via"," ",p("span",{className:q.footerButton,onClick:L(v),children:"SMS"})]}:{children:["Send a code to"," ",p("span",{className:q.footerButton,onClick:L(b),children:"Email"})]})]})]})}export{y as VerificationStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as
|
|
1
|
+
export{default as Chip}from"./components/Chip.js";export{default as EmailField}from"./components/EmailField.js";export{default as HiddenEmailField}from"./components/HiddenEmailField.js";export{default as Login}from"./components/Login.js";export{default as OrDivider}from"./components/OrDivider.js";export{default as PasswordField}from"./components/PasswordField.js";export{default as Step}from"./components/Step.js";export{default as StepContent}from"./components/StepContent.js";export{default as StepFooter}from"./components/StepFooter.js";export{default as StepHeader}from"./components/StepHeader.js";export{VerificationStep}from"./components/VerificationStep.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corva/dc-platform-shared",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-b3a7dfb7f",
|
|
4
4
|
"description": "A library to share internal DC platform specific code",
|
|
5
5
|
"main": "./dist",
|
|
6
6
|
"module": "./src/index.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"author": "Oleksandr Krupko <oleksandr.krupko@corva.ai>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
|
+
"helper-cli": "npx @corva/fe-dev-helper-cli@latest",
|
|
11
12
|
"lint": "eslint --cache ./src/",
|
|
12
13
|
"lint-staged": "lint-staged",
|
|
13
14
|
"build": "./scripts/build.sh production",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"@material-ui/core": "4.11.2",
|
|
76
77
|
"@material-ui/icons": "4.9.1",
|
|
77
78
|
"@material-ui/lab": "4.0.0-alpha.57",
|
|
78
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
79
79
|
"@material-ui/pickers": "3.2.10",
|
|
80
80
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
81
81
|
"babel-eslint": "10.0.3",
|
|
@@ -93,16 +93,15 @@
|
|
|
93
93
|
"eslint-plugin-jest-dom": "^3.2.3",
|
|
94
94
|
"eslint-plugin-prettier": "3.1.1",
|
|
95
95
|
"eslint-plugin-testing-library": "^3.9.2",
|
|
96
|
-
"express": "4.
|
|
96
|
+
"express": "4.18.2",
|
|
97
97
|
"fs": "0.0.1-security",
|
|
98
98
|
"html-webpack-plugin": "4.5.2",
|
|
99
99
|
"jest": "^26.4.1",
|
|
100
100
|
"jsona": "1.5.1",
|
|
101
|
-
"lodash": "4.17.
|
|
101
|
+
"lodash": "4.17.21",
|
|
102
102
|
"mini-css-extract-plugin": "0.9.0",
|
|
103
103
|
"moment": "2.29.4",
|
|
104
104
|
"node-fetch": "^2.6.1",
|
|
105
|
-
"optimize-css-assets-webpack-plugin": "5.0.3",
|
|
106
105
|
"path": "0.12.7",
|
|
107
106
|
"postcss": "8.4.11",
|
|
108
107
|
"postcss-import": "12.0.1",
|
|
@@ -126,7 +125,6 @@
|
|
|
126
125
|
"webpack": "5.88.2",
|
|
127
126
|
"webpack-cli": "5.1.4",
|
|
128
127
|
"webpack-dev-server": "4.15.1",
|
|
129
|
-
"webpack-manifest-plugin": "5.0.0",
|
|
130
128
|
"webpack-merge": "5.9.0"
|
|
131
129
|
},
|
|
132
130
|
"peerDependencies": {
|
package/cjs/jest/setupTests.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from 'react/jsx-runtime';
|
|
2
|
-
require('@testing-library/jest-dom/extend-expect');
|
|
3
|
-
process.env.TZ = 'UTC';
|
|
4
|
-
module.exports = {
|
|
5
|
-
setupTests(jestObj) {
|
|
6
|
-
jestObj.mock(
|
|
7
|
-
'@icon-park/react/es/all',
|
|
8
|
-
() =>
|
|
9
|
-
({ type, ...props }) =>
|
|
10
|
-
/*#__PURE__*/ _jsx('span', {
|
|
11
|
-
'data-testid': `mock-icon-${type}`,
|
|
12
|
-
...props,
|
|
13
|
-
})
|
|
14
|
-
);
|
|
15
|
-
},
|
|
16
|
-
};
|