@corva/dc-platform-shared 0.0.0-ada213s → 0.0.0-b64b89e
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/components/App/App.css.js +1 -1
- package/CLI/context/auth.js +1 -1
- 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/withCorvaMagicHOC.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/README.md +64 -15
- 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/AppsGridDragHandle/AppsGridDragHandle.scss.js +1 -1
- package/components/GridLockButton/index.js +1 -1
- package/components/Login/components/EmailField.js +1 -1
- package/components/Login/components/VerificationStep.js +1 -0
- package/components/Login/index.js +1 -1
- package/package.json +1 -168
- package/cjs/jest/setupTests.js +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import p from'./../../../ext-esm/style-inject/dist/style-inject.es.js';var t={app:"App_app__szh89",appContent:"App_appContent__ig-1i",pdfAppContent:"App_pdfAppContent__MCvHU",lightAppContent:"App_lightAppContent__7PeHo"};p(".App_app__szh89{display:flex;flex-direction:column;min-height:100%;touch-action:manipulation}.App_appContent__ig-1i{flex-grow:1;padding:10px;position:relative}.App_pdfAppContent__MCvHU{background-color:#fff;padding:30px 0}.App_lightAppContent__7PeHo{background-color:#fff;color:#000}");export{t as default};
|
|
1
|
+
import p from'./../../../ext-esm/style-inject/dist/style-inject.es.js';var t={app:"App_app__szh89",appContent:"App_appContent__ig-1i",pdfAppContent:"App_pdfAppContent__MCvHU",lightAppContent:"App_lightAppContent__7PeHo"};p(".App_app__szh89{background-color:#141414;display:flex;flex-direction:column;min-height:100%;touch-action:manipulation}.App_appContent__ig-1i{flex-grow:1;padding:10px;position:relative}.App_pdfAppContent__MCvHU{background-color:#fff;padding:30px 0}.App_lightAppContent__7PeHo{background-color:#fff;color:#000}");export{t as default};
|
package/CLI/context/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as r,useContext as t}from"react";var
|
|
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};
|
|
@@ -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 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(){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*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
|
|
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 t}from"@corva/ui/config/initGlobalDependencies";import{isPDFReportView as s}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,t();var n=function(o){var t=o.component,n=o.settings,u=o.manifest,f=o.packageJson;return function(){var o=a(i({CLIAppComponent:t,CLIAppSettings:n,packageJson:f})),v=s?p(o):m(o),g=e(c(v));return l(r,{children:l(g,{manifest:u,dashboardProps:{}})})}};export{n 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 s}from"lodash";import{withSize 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 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 +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};
|
package/README.md
CHANGED
|
@@ -1,27 +1,76 @@
|
|
|
1
1
|
# corva-dc-platform-shared
|
|
2
|
+
|
|
2
3
|
A repository to share Dev Center platform code
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
```
|
|
37
|
+
|
|
38
|
+
## Branch Strategy
|
|
6
39
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
40
|
+
- `develop` - main development branch
|
|
41
|
+
- `feature/*` - new features
|
|
42
|
+
- `fix/*` - bug fixes
|
|
43
|
+
- No direct commits to `develop`
|
|
11
44
|
|
|
12
|
-
|
|
45
|
+
## Release Process
|
|
13
46
|
|
|
14
|
-
|
|
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
|
|
15
57
|
|
|
16
|
-
|
|
58
|
+
## Version Bumping
|
|
17
59
|
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
20
65
|
|
|
21
|
-
|
|
66
|
+
## CI Checks
|
|
22
67
|
|
|
23
|
-
|
|
68
|
+
Your PR must pass:
|
|
24
69
|
|
|
25
|
-
|
|
70
|
+
- Linting
|
|
71
|
+
- Unit tests
|
|
72
|
+
- E2E tests (feature/fix branches)
|
|
73
|
+
- PR title validation
|
|
74
|
+
- Code review
|
|
26
75
|
|
|
27
|
-
|
|
76
|
+
Remember: The key is writing good code and using correct commit conventions - the release process is automated!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"react-dom";import t from"prop-types";import{makeStyles as n}from"@material-ui/core";import*as
|
|
1
|
+
import o from"react-dom";import t from"prop-types";import{makeStyles as n}from"@material-ui/core";import*as r from"@corva/ui";import{DevCenterIsolatedAppPage as p}from"@corva/ui/components";import{initGlobalDependencies as e}from"@corva/ui/config";import{jsx as i}from"react/jsx-runtime";window["@corva/ui"]=r,e();var m=n((function(){return{reportsContainer:{zoom:"0.5"}}}));function a(o){var t=o.CLIAppComponent,n=o.CLIAppSettings,r=m();return i(p,{CLIAppComponent:t,CLIAppSettings:n,containerReportClassName:r.reportsContainer})}a.propTypes={CLIAppComponent:t.func,CLIAppSettings:t.func},a.defaultProps={CLIAppComponent:null,CLIAppSettings:null},import("".concat(process.env.DEV_CENTER_APP_PATH,"/src/index.js")).then((function(t){var n=t.default.component,r=t.default.settings;o.render(i(a,{CLIAppComponent:n,CLIAppSettings:r}),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 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.
|
|
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","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"),
|
|
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:/\.(s[ac]|c)ss$/i,use:["style-loader",{loader:"css-loader",options:{modules:{localIdentName:"development"===l.mode?"[path][name]__[local]__[hash:base64:10]__".concat(r().substr(-5)):"[name]--[local]__[hash:base64:10]__".concat(r().substr(-5))},importLoaders:1}},{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/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'./../../ext-esm/style-inject/dist/style-inject.es.js';var a={dragLine:"AppsGridDragHandle_dragLine__7wqiq",dragIcon:"AppsGridDragHandle_dragIcon__-GDHv",dragOverlay:"AppsGridDragHandle_dragOverlay__RiAt5",dragIconContainer:"AppsGridDragHandle_dragIconContainer__ATh0-"};r(":hover>.AppsGridDragHandle_dragLine__7wqiq{align-items:center;border:5px solid rgba(3,188,212,.32);border-radius:8px 8px 0 0;cursor:pointer;display:flex;height:0;justify-content:center;margin-left:-2px;position:absolute;top:-6px;width:calc(100% + 4px);z-index:
|
|
1
|
+
import r from'./../../ext-esm/style-inject/dist/style-inject.es.js';var a={dragLine:"AppsGridDragHandle_dragLine__7wqiq",dragIcon:"AppsGridDragHandle_dragIcon__-GDHv",dragOverlay:"AppsGridDragHandle_dragOverlay__RiAt5",dragIconContainer:"AppsGridDragHandle_dragIconContainer__ATh0-"};r(":hover>.AppsGridDragHandle_dragLine__7wqiq{align-items:center;border:5px solid rgba(3,188,212,.32);border-radius:8px 8px 0 0;cursor:pointer;display:flex;height:0;justify-content:center;margin-left:-2px;position:absolute;top:-6px;width:calc(100% + 4px);z-index:1000}:hover>.AppsGridDragHandle_dragLine__7wqiq :active{cursor:move;cursor:grabbing}:hover>.AppsGridDragHandle_dragLine__7wqiq .AppsGridDragHandle_dragIcon__-GDHv{border-radius:30px;font-size:.75rem}:hover>.AppsGridDragHandle_dragLine__7wqiq:active{cursor:move;cursor:grabbing}.AppsGridDragHandle_dragLine__7wqiq,.AppsGridDragHandle_dragOverlay__RiAt5{display:none}.AppsGridDragHandle_dragLine__7wqiq:active+.AppsGridDragHandle_dragOverlay__RiAt5{display:block;height:100%;position:absolute;width:100%}.AppsGridDragHandle_dragLine__7wqiq :active{cursor:move;cursor:grabbing}.AppsGridDragHandle_dragIconContainer__ATh0-{align-items:center;background-color:var(--palette-primary-main);border-radius:30px;display:flex;height:24px;justify-content:center;width:24px}");export{a as default};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"prop-types";import{withStyles as l,TextField as i}from"@material-ui/core";import{jsx as o}from"react/jsx-runtime";var a=function(e){var l=e.value,a=e.onChange,r=e.disabled,t=e.error,d=e.classes;return o(i,{"data-testid":"".concat("EmailField","_emailInput"),id:"email-input",label:"Email",type:"email",name:"email",autoComplete:"email",value:l,placeholder:"Enter your email address",variant:"outlined",InputLabelProps:{classes:{root:d.emailFieldLabelRoot,focused:d.emailFieldFocused}},InputProps:{classes:{root:d.emailFieldRoot,input:d.emailInput,disabled:d.emailFieldDisabled,focused:d.emailFieldFocused,error:d.emailFieldError}},onChange:a,disabled:r,error:!!t,helperText:t,fullWidth:!0})};a.defaultProps={disabled:!1,error:null},a.propTypes={value:e.string.isRequired,onChange:e.func.isRequired,disabled:e.bool,error:e.string,classes:e.shape().isRequired};var r=l((function(e){return{emailFieldRoot:{"&:hover:not($emailFieldDisabled):not($emailFieldFocused):not($emailFieldError) $emailFieldNotchedOutline":{borderColor:e.status.loginButton},"&$emailFieldFocused $emailFieldNotchedOutline":{borderColor:e.status.loginButton}},emailInput:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #233 inset"}},emailFieldLabelRoot:{color:"#666","&$emailFieldFocused":{color:e.status.loginButton}}}}))(a);export{r as default};
|
|
1
|
+
import e from"prop-types";import{withStyles as l,TextField as i}from"@material-ui/core";import{jsx as o}from"react/jsx-runtime";var a=function(e){var l=e.value,a=e.onChange,r=e.disabled,t=e.error,d=e.classes;return o(i,{"data-testid":"".concat("EmailField","_emailInput"),id:"email-input",label:"Email",type:"email",name:"email",autoComplete:"email",value:l,placeholder:"Enter your email address",variant:"outlined",InputLabelProps:{classes:{root:d.emailFieldLabelRoot,focused:d.emailFieldFocused}},InputProps:{classes:{root:d.emailFieldRoot,input:d.emailInput,disabled:d.emailFieldDisabled,focused:d.emailFieldFocused,error:d.emailFieldError}},onChange:a,disabled:r,error:!!t,helperText:t,fullWidth:!0})};a.defaultProps={disabled:!1,error:null},a.propTypes={value:e.string.isRequired,onChange:e.func.isRequired,disabled:e.bool,error:e.string,classes:e.shape({}).isRequired};var r=l((function(e){return{emailFieldRoot:{"&:hover:not($emailFieldDisabled):not($emailFieldFocused):not($emailFieldError) $emailFieldNotchedOutline":{borderColor:e.status.loginButton},"&$emailFieldFocused $emailFieldNotchedOutline":{borderColor:e.status.loginButton}},emailInput:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #233 inset"}},emailFieldLabelRoot:{color:"#666","&$emailFieldFocused":{color:e.status.loginButton}}}}))(a);export{r 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,168 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@corva/dc-platform-shared",
|
|
3
|
-
"version": "0.0.0-ada213s",
|
|
4
|
-
"description": "A library to share internal DC platform specific code",
|
|
5
|
-
"main": "./dist",
|
|
6
|
-
"module": "./src/index.js",
|
|
7
|
-
"repository": "git@github.com:corva-ai/corva-dc-platform-shared.git",
|
|
8
|
-
"author": "Oleksandr Krupko <oleksandr.krupko@corva.ai>",
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"lint": "eslint --cache ./src/",
|
|
12
|
-
"lint-staged": "lint-staged",
|
|
13
|
-
"build": "./scripts/build.sh production",
|
|
14
|
-
"build-watch": "./scripts/build.sh development -w",
|
|
15
|
-
"get-changelog": "conventional-changelog -r 2 -p angular",
|
|
16
|
-
"release": "git fetch --tags && git add -A && standard-version -a",
|
|
17
|
-
"start": "yarn generate-css-themes && cross-env NODE_ENV=local rollup -c -w",
|
|
18
|
-
"test": "jest",
|
|
19
|
-
"test-coverage": "jest --watchAll --coverage && http-serve coverage",
|
|
20
|
-
"test-watch": "jest --watch"
|
|
21
|
-
},
|
|
22
|
-
"lint-staged": {
|
|
23
|
-
"*.js": [
|
|
24
|
-
"eslint --fix"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"standard-version": {
|
|
28
|
-
"skip": {
|
|
29
|
-
"tag": true
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"jest": {
|
|
33
|
-
"collectCoverageFrom": [
|
|
34
|
-
"./**/*.{js,jsx,mjs}"
|
|
35
|
-
],
|
|
36
|
-
"coverageReporters": [
|
|
37
|
-
"html",
|
|
38
|
-
"text-summary"
|
|
39
|
-
],
|
|
40
|
-
"moduleNameMapper": {
|
|
41
|
-
"~(.*)": "<rootDir>/src/$1",
|
|
42
|
-
"\\.(css|less|scss)$": "identity-obj-proxy"
|
|
43
|
-
},
|
|
44
|
-
"setupFiles": [
|
|
45
|
-
"<rootDir>/jest/setEnvVars.js"
|
|
46
|
-
],
|
|
47
|
-
"testMatch": [
|
|
48
|
-
"**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)"
|
|
49
|
-
],
|
|
50
|
-
"transform": {
|
|
51
|
-
"^.+\\.jsx?$": "babel-jest",
|
|
52
|
-
"^.+\\.mjs$": "babel-jest",
|
|
53
|
-
"^.+\\.svg$": "<rootDir>/jest/svgTransform.js"
|
|
54
|
-
},
|
|
55
|
-
"transformIgnorePatterns": [
|
|
56
|
-
"node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)"
|
|
57
|
-
],
|
|
58
|
-
"moduleFileExtensions": [
|
|
59
|
-
"js",
|
|
60
|
-
"jsx",
|
|
61
|
-
"json",
|
|
62
|
-
"mjs",
|
|
63
|
-
"node"
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
"dependencies": {
|
|
67
|
-
"@babel/core": "^7.12.10",
|
|
68
|
-
"@babel/plugin-transform-react-jsx": "^7.12.11",
|
|
69
|
-
"@babel/plugin-transform-runtime": "^7.12.10",
|
|
70
|
-
"@babel/preset-env": "^7.12.11",
|
|
71
|
-
"@babel/preset-react": "^7.12.10",
|
|
72
|
-
"@corva/eslint-config-browser": "^0.0.4",
|
|
73
|
-
"@date-io/moment": "1.3.13",
|
|
74
|
-
"@icon-park/react": "1.4.2",
|
|
75
|
-
"@material-ui/core": "4.11.2",
|
|
76
|
-
"@material-ui/icons": "4.9.1",
|
|
77
|
-
"@material-ui/lab": "4.0.0-alpha.57",
|
|
78
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
79
|
-
"@material-ui/pickers": "3.2.10",
|
|
80
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
81
|
-
"babel-eslint": "10.0.3",
|
|
82
|
-
"babel-jest": "^26.3.0",
|
|
83
|
-
"babel-loader": "8.1.0",
|
|
84
|
-
"babel-plugin-file-loader": "^2.0.0",
|
|
85
|
-
"babel-plugin-root-import": "^6.5.0",
|
|
86
|
-
"chalk": "4.1.1",
|
|
87
|
-
"classnames": "2.2.6",
|
|
88
|
-
"clean-webpack-plugin": "3.0.0",
|
|
89
|
-
"copy-webpack-plugin": "6.1.1",
|
|
90
|
-
"css-loader": "3.4.2",
|
|
91
|
-
"dotenv": "^10.0.0",
|
|
92
|
-
"eslint-config-airbnb": "17.1.0",
|
|
93
|
-
"eslint-plugin-jest-dom": "^3.2.3",
|
|
94
|
-
"eslint-plugin-prettier": "3.1.1",
|
|
95
|
-
"eslint-plugin-testing-library": "^3.9.2",
|
|
96
|
-
"express": "4.17.1",
|
|
97
|
-
"fs": "0.0.1-security",
|
|
98
|
-
"html-webpack-plugin": "4.5.2",
|
|
99
|
-
"jest": "^26.4.1",
|
|
100
|
-
"jsona": "1.5.1",
|
|
101
|
-
"lodash": "4.17.20",
|
|
102
|
-
"mini-css-extract-plugin": "0.9.0",
|
|
103
|
-
"moment": "2.29.4",
|
|
104
|
-
"node-fetch": "^2.6.1",
|
|
105
|
-
"optimize-css-assets-webpack-plugin": "5.0.3",
|
|
106
|
-
"path": "0.12.7",
|
|
107
|
-
"postcss": "8.4.11",
|
|
108
|
-
"postcss-import": "12.0.1",
|
|
109
|
-
"postcss-loader": "4.2.0",
|
|
110
|
-
"postcss-preset-env": "6.7.0",
|
|
111
|
-
"prettier": "^2.1.2",
|
|
112
|
-
"process": "^0.11.10",
|
|
113
|
-
"prop-types": "15.7.2",
|
|
114
|
-
"react": "17.0.1",
|
|
115
|
-
"react-dom": "17.0.1",
|
|
116
|
-
"react-grid-layout": "1.3.4",
|
|
117
|
-
"react-router": "3.2.1",
|
|
118
|
-
"react-sizeme": "2.5.2",
|
|
119
|
-
"rollup-plugin-copy": "^3.4.0",
|
|
120
|
-
"sass": "^1.51.0",
|
|
121
|
-
"semver": "7.2.1",
|
|
122
|
-
"style-loader": "1.0.0",
|
|
123
|
-
"svg-url-loader": "6.0.0",
|
|
124
|
-
"terser-webpack-plugin": "4.2.3",
|
|
125
|
-
"uuid": "3.4.0",
|
|
126
|
-
"webpack": "5.88.2",
|
|
127
|
-
"webpack-cli": "5.1.4",
|
|
128
|
-
"webpack-dev-server": "4.15.1",
|
|
129
|
-
"webpack-manifest-plugin": "5.0.0",
|
|
130
|
-
"webpack-merge": "5.9.0"
|
|
131
|
-
},
|
|
132
|
-
"peerDependencies": {
|
|
133
|
-
"@corva/ui": "*"
|
|
134
|
-
},
|
|
135
|
-
"devDependencies": {
|
|
136
|
-
"@corva/ui": "0.77.0-4",
|
|
137
|
-
"@rollup/plugin-babel": "^5.2.1",
|
|
138
|
-
"@rollup/plugin-commonjs": "^15.0.0",
|
|
139
|
-
"@rollup/plugin-image": "^2.0.6",
|
|
140
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
141
|
-
"@rollup/plugin-node-resolve": "^9.0.0",
|
|
142
|
-
"@testing-library/jest-dom": "5.16.5",
|
|
143
|
-
"@testing-library/react": "^11.1.0",
|
|
144
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
145
|
-
"babel-plugin-external-helpers": "^6.22.0",
|
|
146
|
-
"conventional-changelog-cli": "^2.1.0",
|
|
147
|
-
"cross-env": "^7.0.3",
|
|
148
|
-
"git-conventional-commits": "^1.1.0",
|
|
149
|
-
"identity-obj-proxy": "^3.0.0",
|
|
150
|
-
"lint-staged": "^10.5.4",
|
|
151
|
-
"postcss-url": "9.0.0",
|
|
152
|
-
"pre-commit": "1.2.2",
|
|
153
|
-
"rollup": "^2.28.2",
|
|
154
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
155
|
-
"rollup-plugin-css-bundle": "^1.0.4",
|
|
156
|
-
"rollup-plugin-css-only": "^2.1.0",
|
|
157
|
-
"rollup-plugin-node-externals": "^2.2.0",
|
|
158
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
159
|
-
"rollup-plugin-rename-node-modules": "^1.0.1",
|
|
160
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
161
|
-
"rollup-plugin-visualizer": "^4.1.1",
|
|
162
|
-
"sass-loader": "10.1.1",
|
|
163
|
-
"standard-version": "^9.0.0"
|
|
164
|
-
},
|
|
165
|
-
"engines": {
|
|
166
|
-
"node": ">=16"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
1
|
+
{"name":"@corva/dc-platform-shared","version":"0.0.0-b64b89e","description":"A library to share internal DC platform specific code","main":"./dist","module":"./src/index.js","repository":"git@github.com:corva-ai/corva-dc-platform-shared.git","author":"Oleksandr Krupko <oleksandr.krupko@corva.ai>","license":"MIT","scripts":{"helper-cli":"npx @corva/fe-dev-helper-cli@latest","lint":"eslint --cache ./src/","lint-staged":"lint-staged","build":"./scripts/build.sh production","build-watch":"./scripts/build.sh development -w","get-changelog":"conventional-changelog -r 2 -p angular","release":"git fetch --tags && git add -A && standard-version -a","start":"yarn generate-css-themes && cross-env NODE_ENV=local rollup -c -w","test":"jest","test-coverage":"jest --watchAll --coverage && http-serve coverage","test-watch":"jest --watch"},"lint-staged":{"*.js":["eslint --fix"]},"standard-version":{"skip":{"tag":true}},"jest":{"collectCoverageFrom":["./**/*.{js,jsx,mjs}"],"coverageReporters":["html","text-summary"],"moduleNameMapper":{"~(.*)":"<rootDir>/src/$1","\\.(css|less|scss|sass)$":"identity-obj-proxy"},"setupFiles":["<rootDir>/jest/setEnvVars.js"],"testMatch":["**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)"],"transform":{"^.+\\.jsx?$":"babel-jest","^.+\\.mjs$":"babel-jest","^.+\\.svg$":"<rootDir>/jest/svgTransform.js"},"transformIgnorePatterns":["node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)"],"moduleFileExtensions":["js","jsx","json","mjs","node"]},"dependencies":{"@babel/core":"^7.12.10","@babel/plugin-transform-react-jsx":"^7.12.11","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-react":"^7.12.10","@corva/eslint-config-browser":"^0.0.4","@date-io/moment":"1.3.13","@icon-park/react":"1.4.2","@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","@pmmmwh/react-refresh-webpack-plugin":"0.5.10","babel-eslint":"10.0.3","babel-jest":"^26.3.0","babel-loader":"8.1.0","babel-plugin-file-loader":"^2.0.0","babel-plugin-root-import":"^6.5.0","chalk":"4.1.1","classnames":"2.2.6","clean-webpack-plugin":"3.0.0","copy-webpack-plugin":"6.1.1","css-loader":"3.4.2","dotenv":"^10.0.0","eslint-config-airbnb":"17.1.0","eslint-plugin-jest-dom":"3.9.4","eslint-plugin-prettier":"3.1.1","eslint-plugin-testing-library":"^3.9.2","express":"4.21.2","fs":"0.0.1-security","html-webpack-plugin":"4.5.2","identity-obj-proxy":"^3.0.0","jest":"^26.4.1","jsona":"1.5.1","lodash":"4.17.21","mini-css-extract-plugin":"0.9.0","moment":"2.29.4","node-fetch":"^2.6.1","path":"0.12.7","postcss":"8.4.31","postcss-import":"12.0.1","postcss-loader":"4.2.0","postcss-preset-env":"6.7.0","prettier":"^2.1.2","process":"^0.11.10","prop-types":"15.7.2","react":"17.0.1","react-dom":"17.0.1","react-grid-layout":"1.3.4","react-router":"3.2.1","react-sizeme":"2.5.2","rollup-plugin-copy":"^3.4.0","sass":"^1.89.2","sass-loader":"^16.0.5","semver":"7.5.2","style-loader":"1.0.0","svg-url-loader":"6.0.0","terser-webpack-plugin":"4.2.3","uuid":"3.4.0","webpack":"5.94.0","webpack-cli":"5.1.4","webpack-dev-server":"4.15.2","webpack-merge":"5.9.0"},"peerDependencies":{"@corva/ui":"*"},"devDependencies":{"@corva/ui":"3.14.1","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^15.0.0","@rollup/plugin-image":"^2.0.6","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^9.0.0","@testing-library/jest-dom":"5.16.5","@testing-library/react":"^11.1.0","@testing-library/react-hooks":"^8.0.1","babel-plugin-external-helpers":"^6.22.0","conventional-changelog-cli":"^2.1.0","cross-env":"^7.0.3","git-conventional-commits":"^1.1.0","lint-staged":"^10.5.4","postcss-url":"9.0.0","pre-commit":"1.2.2","rollup":"^2.28.2","rollup-plugin-cleanup":"^3.2.1","rollup-plugin-css-bundle":"^1.0.4","rollup-plugin-css-only":"^2.1.0","rollup-plugin-node-externals":"^2.2.0","rollup-plugin-postcss":"^4.0.2","rollup-plugin-rename-node-modules":"^1.0.1","rollup-plugin-terser":"^7.0.2","rollup-plugin-visualizer":"^4.1.1","standard-version":"^9.0.0"},"engines":{"node":">=18"},"resolutions":{"braces":"3.0.3"}}
|
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
|
-
};
|