@corva/ui 0.26.0-8 → 0.26.0-rc.2

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.
@@ -10,9 +10,9 @@
10
10
  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
11
11
  <title>Corva React App</title>
12
12
  </head>
13
- <body>
13
+ <body data-corva-theme-dark>
14
14
  <noscript>You need to enable JavaScript to run this app.</noscript>
15
- <div id="root" data-corva-theme-dark></div>
15
+ <div id="root"></div>
16
16
  <!--
17
17
  This HTML file is a template.
18
18
  If you open it directly in the browser, you will see an empty page.
@@ -1 +1 @@
1
- import{maxBy as e}from"lodash";import a from"@babel/runtime/helpers/slicedToArray";import{jsx as t,jsxs as l}from"react/jsx-runtime";import{makeStyles as r,Grid as n,FormControl as o,InputLabel as i,Select as s,ListSubheader as c,MenuItem as u}from"@material-ui/core";import{useState as d,useMemo as p,useEffect as v}from"react";import{string as b,func as f,shape as m}from"prop-types";import{isUserDeveloperAdmin as h}from"../../utils/user.js";import g from"./effects/index.js";var R=r({select:{width:250,margin:"8px 0"},group:{fontStyle:"italic",fontWeight:"bold",fontSize:"12px",color:"#999"}}),S=function(r){var b=r.value,f=r.onChange,m=r.appId,S=r.currentUser,_=R(),w=g(m),V=w.isLoading,y=w.packages,C=h(S),D=d(b),x=a(D,2),A=x[0],P=x[1],B=p((function(){var e=[{label:"Stable Release - no stable version",value:"PROD",disabled:!0},{label:"Beta - no beta version",value:"BETA",disabled:!0}],a=[];return y.forEach((function(t){var l=t.attributes,r=l.version,n=l.notes,o=l.label,i=l.status;if(o){var s="PROD"===o?e[0]:e[1];s.label="".concat("PROD"===o?"Stable Release":"Beta"," v").concat(r," ").concat(n?"- ".concat(n):""),s.disabled=!1}else C&&a.push({label:"v".concat(r," ").concat(n?"- ".concat(n):""),value:r,status:i})})),{labeled:e,unlabeled:a}}),[y,C]),I=B.labeled,O=B.unlabeled;return v((function(){if(C&&!b){var a=I.find((function(e){return!e.disabled}))||e(O.filter((function(e){return"published"===e.status})),"value");P(null==a?void 0:a.value),f(null==a?void 0:a.value)}}),[I,O]),t(n,{children:l(o,{className:_.select,children:[t(i,{shrink:!(!b&&!A),htmlFor:"appVersion",children:"App Version"}),l(s,{"data-testid":"".concat("DC_versionSelect","_dropdown"),value:b||A,onChange:function(e){f(e.target.value)},autoWidth:!0,disabled:V,label:"App Version",inputProps:{name:"appVersion",id:"appVersion"},children:[C&&t(c,{className:_.group,children:"Labelled Versions (When selected always shows current Beta or Stable Release Versions)"}),I.map((function(e){var a=e.label,l=e.value,r=e.disabled;return t(u,{"data-testid":"".concat("DC_versionSelect","_option_").concat(a,"MenuItem"),value:l,disabled:r,children:a})})),C&&t(c,{className:_.group,children:"Other versions (App will always show selected version until version is deleted)"}),O.map((function(e){var a=e.label,l=e.value;return t(u,{"data-testid":"".concat("DC_versionSelect","_option_").concat(a,"MenuItem"),value:l,children:a})}))]})]})})};S.propTypes={value:b,onChange:f.isRequired,appId:b.isRequired,currentUser:m({}).isRequired},S.defaultProps={value:null};export default S;
1
+ import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/toConsumableArray";import"../../constants/completion.js";import"../../constants/alerts.js";import{maxBy as e}from"lodash";import t from"@babel/runtime/helpers/slicedToArray";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import{PACKAGE_STATUSES as r}from"../../constants/appPackages.js";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import"../../utils/mobileDetect.js";import"@babel/runtime/helpers/typeof";import"../../utils/index.js";import{jsx as o,jsxs as i}from"react/jsx-runtime";import{makeStyles as n,Grid as s,FormControl as p,InputLabel as a,Select as m,ListSubheader as l,MenuItem as d}from"@material-ui/core";import{useState as c,useMemo as u,useEffect as j}from"react";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import{string as C,func as v,shape as b}from"prop-types";import"classnames";import"../Modal/index.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../LoadingIndicator/LoadingIndicator.js";import"../Tooltip.js";import"../Avatar/index.js";import"../Annotations/AnnotationsContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import{isUserDeveloperAdmin as A}from"../../utils/user.js";import"../ConfirmationDialog.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../PadModeSelect/PadModeSelect.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppContext.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../ErrorBoundary/InternalErrorView/InternalErrorView.js";import"../ErrorBoundary/ErrorBoundary.js";import"../Typography.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/RenderElements.js";import"../SlateFormattedText/SlateFormattedText.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import f from"../TruncatedText/index.js";import"../AssetEditor/SingleAssetEditor.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/index.js";import x from"./effects/index.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ColorPicker/ColorPicker.js";import"../ParameterCharts/AddEditTrack.js";import"../ParameterCharts/ParameterCharts.js";import"../ChartActionsList/ChartActionsList.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import"../SwitchControl/index.js";import"../RangeSlider/RangeSlider.js";import"../Login/components/Login.js";import"../Login/components/PasswordField.js";import"../Login/components/Chip.js";import"../Login/components/StepFooter.js";import"../Login/components/StepContent.js";import"../Login/components/StepHeader.js";import"../Login/components/Step.js";import"../Login/components/OrDivider.js";import"../Login/components/HiddenEmailField.js";import"../Login/components/EmailField.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/index.js";import"../EmptyView/EmptyAppView/index.js";import"../Button/index.js";import"../MenuItem/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTable/index.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../Notifications/Notifications.js";import"../TextLink/index.js";import"../Template/TemplatePopover/index.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";var g=r,D=n({select:{width:250,margin:"8px 0"},menuListRoot:{maxWidth:580},group:{fontStyle:"italic",fontWeight:"bold",fontSize:"12px",color:"#999"}}),S=function(r){var n=r.value,C=r.onChange,v=r.appId,b=r.currentUser,S=D(),h=x(v,{status:[g.DRAFT,g.PUBLISHED]}),P=h.isLoading,L=h.packages,y=A(b),E=c(n),T=t(E,2),I=T[0],B=T[1],k=u((function(){var e=[{label:"Stable Release - no stable version",value:"PROD",disabled:!0},{label:"Beta - no beta version",value:"BETA",disabled:!0}],t=[];return L.filter((function(e){return e.attributes.status!==g.FAILURE})).forEach((function(r){var o=r.attributes,i=o.version,n=o.notes,s=o.label,p=o.status;if(s){var a="PROD"===s?e[0]:e[1];a.label="".concat("PROD"===s?"Stable Release":"Beta"," v").concat(i," ").concat(n?"- ".concat(n):""),a.disabled=!1}else y&&t.push({label:"v".concat(i," ").concat(n?"- ".concat(n):""),value:i,status:p})})),{labeled:e,unlabeled:t}}),[L,y]),R=k.labeled,F=k.unlabeled;return j((function(){if(y&&!n){var t=R.find((function(e){return!e.disabled}))||e(F.filter((function(e){return"published"===e.status})),"value");B(null==t?void 0:t.value),C(null==t?void 0:t.value)}}),[R,F]),o(s,{children:i(p,{className:S.select,children:[o(a,{shrink:!(!n&&!I),htmlFor:"appVersion",children:"App Version"}),i(m,{"data-testid":"".concat("DC_versionSelect","_dropdown"),value:n||I,onChange:function(e){C(e.target.value)},disabled:P,label:"App Version",inputProps:{name:"appVersion",id:"appVersion"},MenuProps:{MenuListProps:{classes:{root:S.menuListRoot}}},children:[y&&o(l,{className:S.group,children:"Labelled Versions (When selected always shows current Beta or Stable Release Versions)"}),R.map((function(e){var t=e.label,r=e.value,i=e.disabled;return o(d,{"data-testid":"".concat("DC_versionSelect","_option_").concat(t,"MenuItem"),value:r,disabled:i,children:t})})),y&&o(l,{className:S.group,children:"Other versions (App will always show selected version until version is deleted)"}),F.map((function(e){var t=e.label,r=e.value;return o(d,{"data-testid":"".concat("DC_versionSelect","_option_").concat(t,"MenuItem"),value:r,children:o(f,{children:t})})}))]})]})})};S.propTypes={value:C,onChange:v.isRequired,appId:C.isRequired,currentUser:b({}).isRequired},S.defaultProps={value:null};export default S;
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/regenerator";import n from"@babel/runtime/helpers/asyncToGenerator";import{useState as t,useEffect as a}from"react";import{getAppPackages as o}from"../../../clients/jsonApi/index.js";export default function(i){var s=t({isLoading:!1,packages:[],error:null}),c=r(s,2),p=c[0],u=c[1];return a((function(){var r;(r=n(e.mark((function r(){var n,t;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o(i);case 3:n=r.sent,t=n.data,u({isLoading:!1,packages:t,error:null}),r.next=12;break;case 8:r.prev=8,r.t0=r.catch(0),console.error(r.t0),u({isLoading:!1,packages:[],error:r.t0});case 12:case"end":return r.stop()}}),r,null,[[0,8]])}))),function(){return r.apply(this,arguments)})()}),[i]),p}
1
+ import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/regenerator";import n from"@babel/runtime/helpers/asyncToGenerator";import{useState as t,useEffect as a}from"react";import{getAppPackages as o}from"../../../clients/jsonApi/index.js";export default function(i,s){var c=t({isLoading:!1,packages:[],error:null}),p=r(c,2),u=p[0],l=p[1];return a((function(){var r;(r=n(e.mark((function r(){var n,t;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o(i,s);case 3:n=r.sent,t=n.data,l({isLoading:!1,packages:t,error:null}),r.next=12;break;case 8:r.prev=8,r.t0=r.catch(0),console.error(r.t0),l({isLoading:!1,packages:[],error:r.t0});case 12:case"end":return r.stop()}}),r,null,[[0,8]])}))),function(){return r.apply(this,arguments)})()}),[i]),u}
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{debounce as t,identity as r}from"lodash";import n from"@babel/runtime/helpers/slicedToArray";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{withStyles as a,List as l,FormControl as s,InputLabel as p,FormHelperText as u,Typography as c,TextField as d,InputAdornment as f,Chip as m}from"@material-ui/core";import{forwardRef as b,useState as g,useEffect as h,useMemo as y}from"react";import O from"@babel/runtime/helpers/objectWithoutProperties";import x from"prop-types";import{Search as v}from"@material-ui/icons";import T from"../TruncatedText/index.js";import{PER_PAGE as I,SCROLL_THRESHOLD as j}from"./constants.js";import{useAssetAutoCompleteSelectData as P}from"./effects/index.js";import{Autocomplete as A}from"@material-ui/lab";function C(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 S(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?C(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var M="DC_SingleAssetEditorAutocomplete",w={paddingLeft:"16px",height:36,listStyleType:"none",display:"flex",alignItems:"center"},L=function(e){var t=e.text;return i("li",{style:w,children:i(c,{variant:"body2",color:"textSecondary",children:void 0===t?"Loading...":t})},"loading")},D=b((function(e,t){var r=e.children,n=e.loading,a=e.hasMore,s=O(e,["children","loading","hasMore"]);return o(l,S(S({},s),{},{ref:t,role:"listbox",children:[r,(a||n)&&i(L,{})]}))})),N=function(e){var a=e["data-testid"],l=e.appKey,c=e.assetType,b=e.classes,O=e.companyId,x=e.currentValue,C=e.disabled,w=e.errorText,N=e.isMultiple,R=e.isNullable,V=e.label,E=e.onChange,K=e.parentAssetId,_=e.parentAssetType,k=g(N?[]:null),q=n(k,2),z=q[0],H=q[1],B=g(""),W=n(B,2),F=W[0],G=W[1],J=g(""),Q=n(J,2),U=Q[0],X=Q[1],Y=g(!1),Z=n(Y,2),$=Z[0],ee=Z[1],te=g(1),re=n(te,2),ne=re[0],oe=re[1],ie=g(!0),ae=n(ie,2),le=ae[0],se=ae[1];h((function(){H(N?[]:null),oe(1),ee(!1)}),[c]);var pe=P({appKey:l,assetType:c,companyId:O,currentValue:x,isMultiple:N,parentAssetId:K,parentAssetType:_,scrollPage:ne,searchText:F,setCurrentOption:H}),ue=pe.assets,ce=pe.loading;h((function(){var e=ue.length>=I*ne;se(e)}),[ue,ne]);var de=y((function(){return t((function(e){oe(1),G(e)}),200)}),[]),fe=y((function(){return t((function(){return oe((function(e){return e+1}))}),250)}),[]),me={root:b.root,inputRoot:b.inputRoot,popupIndicator:b.popupIndicator,option:b.option,noOptions:b.noOptions,listbox:b.listbox};return o(s,{disabled:C,error:!!w,className:b.formControl,children:[!R&&i(p,{shrink:!0,children:V}),i(A,S({disabled:C,blurOnSelect:!0,classes:me,clearOnBlur:!0,clearOnEscape:!0,"data-testid":a,disableClearable:!0,filterOptions:r,getOptionLabel:function(e){return null==e?void 0:e.name},getOptionSelected:function(e,t){return e&&t&&e.id===t.id},inputValue:$?U:(null==z?void 0:z.name)||"",ListboxComponent:D,ListboxProps:{onScroll:function(e){if(le&&!ce){var t=e.currentTarget;t.scrollTop+t.clientHeight>t.scrollHeight-j&&fe()}},loading:ce,hasMore:le},options:ue,onChange:function(e,t){H(t),E(N?t.map((function(e){return e.id})):null==t?void 0:t.id,t)},onClose:function(){X(""),G(""),ee(!1),oe(1)},onInputChange:function(e,t,r){"input"===r?(X(t),ee(!0),de(t)):G("")},noOptionsText:i(L,{text:ce?"Loading...":"No options"}),renderInput:function(e){return i(d,S(S({},e),{},{variant:"standard",placeholder:"Search for asset..."},!N&&{InputProps:S(S({},e.InputProps),{},{startAdornment:i(f,{children:i(v,{className:b.searchIcon})})})}))},renderOption:function(e){var t=e.id,r=e.name;return i(T,{"data-testid":"".concat(M,"_option_").concat(r,"MenuItem"),children:N&&x.includes(t)?"".concat(r," (already selected)"):r},t)},value:z,multiple:N},N&&{renderTags:function(e,t){return e.map((function(e,r){return i(m,S({label:null==e?void 0:e.name},t({index:r})),e.id)}))},getOptionDisabled:function(e){return x.includes(e.id)}})),i(u,{children:w})]})};N.defaultProps={label:"Choose An Asset",currentValue:void 0,isNullable:!1,parentAssetId:void 0,parentAssetType:void 0,companyId:void 0,errorText:"","data-testid":"".concat(M,"_autoComplete"),disabled:!1,isMultiple:!1,appKey:null},N.propTypes={label:x.string,currentValue:x.oneOfType([x.number,x.arrayOf(x.number)]),isNullable:x.bool,onChange:x.func.isRequired,classes:x.shape({}).isRequired,parentAssetId:x.number,parentAssetType:x.string,companyId:x.number,assetType:x.string.isRequired,errorText:x.string,"data-testid":x.string,disabled:x.bool,isMultiple:x.bool,appKey:x.string};var R=a((function(e){return{formControl:{},listbox:{maxHeight:350},root:{fontSize:16},inputRoot:{paddingTop:16,padding:"8px 0",paddingBottom:0,width:350,fontSize:16},popupIndicator:{display:"none"},option:{paddingLeft:"16px !important",height:36,"&[aria-disabled=true]":{color:e.palette.primary.text9,opacity:1,backgroundColor:"unset"}},noOptions:{padding:0},searchIcon:{fontSize:"20px !important"}}}))(N);export default R;
1
+ import e from"@babel/runtime/helpers/defineProperty";import{debounce as t,identity as n}from"lodash";import r from"@babel/runtime/helpers/slicedToArray";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{withStyles as a,List as l,FormControl as s,InputLabel as p,FormHelperText as d,Typography as u,TextField as c,InputAdornment as f,Chip as m}from"@material-ui/core";import{forwardRef as b,useState as g,useEffect as h,useMemo as y}from"react";import O from"@babel/runtime/helpers/objectWithoutProperties";import v from"prop-types";import{Search as x}from"@material-ui/icons";import T from"../TruncatedText/index.js";import{PER_PAGE as I,SCROLL_THRESHOLD as C}from"./constants.js";import{useAssetAutoCompleteSelectData as j}from"./effects/index.js";import{Autocomplete as A}from"@material-ui/lab";function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?P(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var M="DC_SingleAssetEditorAutocomplete",w={paddingLeft:"16px",height:36,listStyleType:"none",display:"flex",alignItems:"center"},L=function(e){var t=e.text;return i("li",{style:w,children:i(u,{variant:"body2",color:"textSecondary",children:void 0===t?"Loading...":t})},"loading")},D=b((function(e,t){var n=e.children,r=e.loading,a=e.hasMore,s=O(e,["children","loading","hasMore"]);return o(l,S(S({},s),{},{ref:t,role:"listbox",children:[n,(a||r)&&i(L,{})]}))})),N=function(e){var a=e["data-testid"],l=e.appKey,u=e.assetType,b=e.classes,O=e.companyId,v=e.currentValue,P=e.disabled,w=e.disableClearable,N=e.errorText,R=e.isMultiple,V=e.isNullable,E=e.label,K=e.onChange,_=e.parentAssetId,k=e.parentAssetType,q=g(R?[]:null),z=r(q,2),H=z[0],B=z[1],W=g(""),F=r(W,2),G=F[0],J=F[1],Q=g(""),U=r(Q,2),X=U[0],Y=U[1],Z=g(!1),$=r(Z,2),ee=$[0],te=$[1],ne=g(1),re=r(ne,2),oe=re[0],ie=re[1],ae=g(!0),le=r(ae,2),se=le[0],pe=le[1];h((function(){B(R?[]:null),ie(1),te(!1)}),[u]);var de=j({appKey:l,assetType:u,companyId:O,currentValue:v,isMultiple:R,parentAssetId:_,parentAssetType:k,scrollPage:oe,searchText:G,setCurrentOption:B}),ue=de.assets,ce=de.loading;h((function(){var e=ue.length>=I*oe;pe(e)}),[ue,oe]);var fe=y((function(){return t((function(e){ie(1),J(e)}),200)}),[]),me=y((function(){return t((function(){return ie((function(e){return e+1}))}),250)}),[]),be={endAdornment:b.endAdornment,inputRoot:b.inputRoot,listbox:b.listbox,noOptions:b.noOptions,option:b.option,popupIndicator:b.popupIndicator,root:b.root};return o(s,{disabled:P,error:!!N,className:b.formControl,children:[!V&&i(p,{shrink:!0,children:E}),i(A,S({disabled:P,blurOnSelect:!0,classes:be,clearOnBlur:!0,clearOnEscape:!0,"data-testid":a,disableClearable:w,filterOptions:n,getOptionLabel:function(e){return null==e?void 0:e.name},getOptionSelected:function(e,t){return e&&t&&e.id===t.id},inputValue:ee?X:(null==H?void 0:H.name)||"",ListboxComponent:D,ListboxProps:{onScroll:function(e){if(se&&!ce){var t=e.currentTarget;t.scrollTop+t.clientHeight>t.scrollHeight-C&&me()}},loading:ce,hasMore:se},options:ue,onChange:function(e,t){var n;B(t),K(R?t.map((function(e){return e.id})):null!==(n=null==t?void 0:t.id)&&void 0!==n?n:null,t)},onClose:function(){Y(""),J(""),te(!1),ie(1)},onInputChange:function(e,t,n){"input"===n?(Y(t),te(!0),fe(t)):J("")},noOptionsText:i(L,{text:ce?"Loading...":"No options"}),renderInput:function(e){return i(c,S(S({},e),{},{variant:"standard",placeholder:"Search for asset..."},!R&&{InputProps:S(S({},e.InputProps),{},{startAdornment:i(f,{children:i(x,{className:b.searchIcon})})})}))},renderOption:function(e){var t=e.id,n=e.name;return i(T,{"data-testid":"".concat(M,"_option_").concat(n,"MenuItem"),children:R&&v.includes(t)?"".concat(n," (already selected)"):n},t)},value:H,multiple:R},R&&{renderTags:function(e,t){return e.map((function(e,n){return i(m,S({label:null==e?void 0:e.name},t({index:n})),e.id)}))},getOptionDisabled:function(e){return v.includes(e.id)}})),i(d,{children:N})]})};N.defaultProps={label:"Choose An Asset",currentValue:void 0,disableClearable:!0,isNullable:!1,parentAssetId:void 0,parentAssetType:void 0,companyId:void 0,errorText:"","data-testid":"".concat(M,"_autoComplete"),disabled:!1,isMultiple:!1,appKey:null},N.propTypes={label:v.string,currentValue:v.oneOfType([v.number,v.arrayOf(v.number)]),isNullable:v.bool,onChange:v.func.isRequired,classes:v.shape({}).isRequired,disableClearable:v.bool,parentAssetId:v.number,parentAssetType:v.string,companyId:v.number,assetType:v.string.isRequired,errorText:v.string,"data-testid":v.string,disabled:v.bool,isMultiple:v.bool,appKey:v.string};var R=a((function(e){return{formControl:{},listbox:{maxHeight:350},root:{fontSize:16},inputRoot:{paddingTop:16,padding:"8px 0",paddingBottom:0,width:350,fontSize:16},popupIndicator:{display:"none"},option:{paddingLeft:"16px !important",height:36,"&[aria-disabled=true]":{color:e.palette.primary.text9,opacity:1,backgroundColor:"unset"}},noOptions:{padding:0},searchIcon:{fontSize:"20px !important"}}}))(N);export default R;
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/toConsumableArray";import"../../../../../constants/completion.js";import"../../../../../constants/alerts.js";import{cloneDeep as e,get as r}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import{DEV_CENTER_CLI_APP_ID as o}from"../../../../../constants/devcenter.js";import"../../../../../constants/goals.js";import{SEGMENT_TO_ASSET_TYPE as n,SEGMENTS as s}from"../../../../../constants/segment.js";import"../../../../../constants/apps.js";import"../../../../../constants/drillstring.js";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/typeof";import"../../../../../utils/index.js";import{jsxs as p,jsx as a,Fragment as m}from"react/jsx-runtime";import{withStyles as l,Dialog as c,Tabs as d,DialogTitle as u,Divider as j,DialogContent as g,Tab as f,DialogActions as A}from"@material-ui/core";import{useState as C}from"react";import"querystring";import"uuid/v1";import"../../../../../clients/jsonApi/index.js";import"../../../../../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import{func as S,shape as b,string as x,bool as y}from"prop-types";import"classnames";import"../../../../Modal/index.js";import"../../../../IconMenu/index.js";import"../../../../StyledMenuItem/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Tooltip.js";import"../../../../Avatar/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import{useDevCenterRouter as v}from"../../../DevCenterRouterContext/effects/useDevCenterRouter.js";import"../../../DevCenterRouterContext/UniversalLink/UniversalLink.js";import h from"../../../../ConfirmationDialog.js";import"../../../../Annotations/components/AnnotationsList/index.js";import"../../../../Annotations/components/LastAnnotation/index.js";import"../../../../PadModeSelect/PadModeSelect.js";import"../../../AppHeader/AppHeader.js";import"../../../AppSideBar/AppSideBar.js";import"../../../AppContext.js";import"../../../AppsDataProvider/AppsDataProvider.js";import"../AppActions/AppActions.css.js";import"../../../../ErrorBoundary/InternalErrorView/InternalErrorView.js";import P from"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../Typography.js";import E from"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import D from"./RemoveAppButton.js";import"../../../../SlateFormattedText/RenderElements.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import T from"./AppDetails.js";import k from"./AppSettingsDialog.module.css.js";import"../AnnotationsButton/AnnotationsButton.js";import"../NonPriorityMenus/NonPriorityMenus.js";import"../FullscreenButton/FullscreenButton.js";import"../AppInfoMessage/AppInfoMessage.js";import"../../DevCenterAppContainer.css.js";import"../RestoreAppSizeButton/index.js";import"../PriorityMenus/PriorityMenus.css.js";import"../../../NavigationBar/NavigationBar.js";import"../../../SideBar/SideBar.js";import"../../../../TruncatedText/index.js";import"../../../../AssetEditor/SingleAssetEditor.js";import"../../../../AssetEditor/AssetEditorAutocomplete.js";import L from"../../../../AssetEditor/index.js";import I from"../../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../../CollapsableSidebar.js";import"../../../../DateTimePicker/index.js";import"../../../../DatePicker/index.js";import"../../../../ColorPicker/ColorPicker.js";import"../../../../ParameterCharts/AddEditTrack.js";import"../../../../ParameterCharts/ParameterCharts.js";import"../../../../ChartActionsList/ChartActionsList.js";import"../../../../SettingEditors/ColorEditor/index.js";import"../../../../SettingEditors/DropdownEditor/index.js";import"../../../../SettingEditors/RadioEditor/index.js";import"../../../../SwitchControl/index.js";import"../../../../RangeSlider/RangeSlider.js";import"../../../../Login/components/Login.js";import"../../../../Login/components/PasswordField.js";import"../../../../Login/components/Chip.js";import"../../../../Login/components/StepFooter.js";import"../../../../Login/components/StepContent.js";import"../../../../Login/components/StepHeader.js";import"../../../../Login/components/Step.js";import"../../../../Login/components/OrDivider.js";import"../../../../Login/components/HiddenEmailField.js";import"../../../../Login/components/EmailField.js";import"../../../../Breadcrumbs/index.js";import"../../../../VirtualizedTable/index.js";import"../../../../EmptyView/index.js";import"../../../../EmptyView/EmptyAppView/index.js";import O from"../../../../Button/index.js";import"../../../../MenuItem/index.js";import"../../../../ContextMenuItem/index.js";import"../../../../FolderMenuItem/index.js";import"../../../../EditableItem/EditableItem/index.js";import"../../../../EditableItem/EditableItemWithBadge/index.js";import"../../../../Checkbox/index.js";import"../../../../FolderMenuItemWithLinks/index.js";import"../../../../IconButton/index.js";import"../../../../Chip/index.js";import"../../../../Counter/index.js";import"../../../../AnchorsList/AnchorsList.js";import"../../../../Select/index.js";import"../../../../Tabs/Tabs.js";import"../../../../Tabs/Tab.js";import"../../../../Drillstring/BHASchematic.js";import"../../../../Drillstring/BHAComponentIcon.js";import"../../../../Drillstring/BHATable/index.js";import"../../../../Drillstring/BHAComponentDetail/index.js";import"../../../../Casing/CasingComponentIcon.js";import"../../../../Casing/CasingTable/index.js";import"../../../../WellSummary/WellSummaryItemLabel.js";import"../../../../WellSummary/WellSummaryItemTitle.js";import"../../../../WellSummary/WellSummaryItemValue.js";import"../../../../WellSummary/ActivitySummaryChart.js";import"../../../../WellSummary/FracWirelineTimeChart.js";import"../../../../BICOffsetPickerDialog/index.js";import"../../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../../Notifications/Notifications.js";import"../../../../TextLink/index.js";import"../../../../Template/TemplatePopover/index.js";import"../../../../PinnableFilters/PinnableFilters.js";import"../../../../HeaderLayout/HeaderLayout.js";import"../../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../../PadOffsetsPicker/StagesSelector.js";import"../../../../Table/TableToolbar/TableToolbar.js";import"../../../../PriceInput/PriceInput.js";import"../../../../LabelsCounter/LabelsCounter.js";import"../../../../Stepper/Step.js";import"../../../../Stepper/StepsWrapper.js";import"../../../../Stepper/Stepper.js";import"../../../../Comment/CommentIcon/index.js";import"../../../../FilesLoader/FilesLoader.js";function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function R(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?B(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var w="DC_appSettings",F=l({paper:{minWidth:"50rem",height:"40rem"}})(c),M=l({root:{marginBottom:10}})(d),W="SETTINGS",V="APP DETAILS";function N(l){var c=l.AppSettingsComponent,d=l.app,S=l.appData,b=l.appName,x=l.currentUser,y=l.isMultiRig,B=l.isProductSubscriptionFeatureActive,N=l.layoutEnvironment,q=l.onAppRemove,H=l.onSettingsChange,U=l.segment,_=l.toggleAppSettingsDialog,G=C(W),z=i(G,2),K=z[0],Y=z[1],J=C((function(){var t;return R(R({},e(d.settings)),{},{package:d.settings.package||(null==d||null===(t=d.package)||void 0===t?void 0:t.version)})})),Q=i(J,2),X=Q[0],Z=Q[1],$=C(!0),tt=i($,2),et=tt[0],rt=tt[1],it=v(),ot=d.id===o,nt=function(e,r){return Z((function(i){return R(R({},i),{},t({},e,r))}))},st=function(t){return Z((function(e){return R(R({},e),t)}))},pt=N&&"asset"===N.type,at=!(y||pt&&U===s.COMPLETION);return p(F,{open:!0,onBackdropClick:_,children:[p(u,{children:[b," settings"]}),a(j,{}),p(g,{children:[p(M,{value:K,onChange:function(t,e){return Y(e)},indicatorColor:"primary",textColor:"primary",children:[a(f,{"data-testid":"".concat(w,"_settingsTab"),label:W,value:W}),a(f,{"data-testid":"".concat(w,"_appDetailsTab"),label:V,value:V}),a(O,{className:k.viewAppButton,onClick:function(){var t,e;return it.push((e=null==d||null===(t=d.app)||void 0===t?void 0:t.id,"/apps/".concat(e)))},children:"VIEW APP PAGE"})]}),p(P,{ErrorView:E,app:d,children:[a(h,{open:!et&&!X.package,isShowCancel:!1,title:"Validation failed",text:"You should select the app version to proceed",handleOk:function(){return rt(!0)}}),K===W&&p(m,{children:[at&&a(L,{appKey:B&&!ot?d.app_key:null,settings:X,onSettingsChange:st,appType:n[U],isNullable:!1,label:"Active Asset"}),c&&a(c,{app:d,appData:S,settings:X,onSettingChange:nt,onSettingsChange:st,layoutEnvironment:N,currentUser:x}),!ot&&a(I,{appId:d.app.id,value:X.package,onChange:function(t){return nt("package",t)},currentUser:x})]}),K===V&&a(T,{appDescription:r(d,"app.description"),appSummary:r(d,"app.summary")})]})]}),p(A,{children:[q&&a(D,{appName:b,onAppRemove:q}),a(O,{"data-testid":"".concat(w,"_cancel"),variation:"secondary",onClick:_,children:"Cancel"}),a(O,{"data-testid":"".concat(w,"_save"),variation:"primary",onClick:function(){X.package||ot?(H(X),_()):rt(!1)},children:"Save"})]})]})}N.propTypes={AppSettingsComponent:S,app:b({}).isRequired,appData:b({}).isRequired,appName:x.isRequired,currentUser:b({}).isRequired,isMultiRig:y.isRequired,isProductSubscriptionFeatureActive:y,layoutEnvironment:b({}).isRequired,onAppRemove:S,onSettingsChange:S.isRequired,segment:x.isRequired,toggleAppSettingsDialog:S.isRequired},N.defaultProps={AppSettingsComponent:null,isProductSubscriptionFeatureActive:!1,onAppRemove:void 0};export default N;
1
+ import t from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/toConsumableArray";import"../../../../../constants/completion.js";import"../../../../../constants/alerts.js";import{cloneDeep as e,get as r}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import{DEV_CENTER_CLI_APP_ID as o}from"../../../../../constants/devcenter.js";import"../../../../../constants/goals.js";import{SEGMENT_TO_ASSET_TYPE as n,SEGMENTS as s}from"../../../../../constants/segment.js";import"../../../../../constants/apps.js";import"../../../../../constants/drillstring.js";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/typeof";import"../../../../../utils/index.js";import{jsxs as p,jsx as a,Fragment as m}from"react/jsx-runtime";import{withStyles as l,Dialog as c,Tabs as d,DialogTitle as u,Divider as j,DialogContent as g,Tab as f,DialogActions as A}from"@material-ui/core";import{useState as C}from"react";import"querystring";import"uuid/v1";import"../../../../../clients/jsonApi/index.js";import"../../../../../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import{func as S,shape as b,string as x,bool as y}from"prop-types";import"classnames";import"../../../../Modal/index.js";import"../../../../IconMenu/index.js";import"../../../../StyledMenuItem/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Tooltip.js";import"../../../../Avatar/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import{useDevCenterRouter as v}from"../../../DevCenterRouterContext/effects/useDevCenterRouter.js";import"../../../DevCenterRouterContext/UniversalLink/UniversalLink.js";import h from"../../../../ConfirmationDialog.js";import"../../../../Annotations/components/AnnotationsList/index.js";import"../../../../Annotations/components/LastAnnotation/index.js";import"../../../../PadModeSelect/PadModeSelect.js";import"../../../AppHeader/AppHeader.js";import"../../../AppSideBar/AppSideBar.js";import"../../../AppContext.js";import"../../../AppsDataProvider/AppsDataProvider.js";import"../AppActions/AppActions.css.js";import"../../../../ErrorBoundary/InternalErrorView/InternalErrorView.js";import P from"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../Typography.js";import E from"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import D from"./RemoveAppButton.js";import"../../../../SlateFormattedText/RenderElements.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import T from"./AppDetails.js";import k from"./AppSettingsDialog.module.css.js";import"../AnnotationsButton/AnnotationsButton.js";import"../NonPriorityMenus/NonPriorityMenus.js";import"../FullscreenButton/FullscreenButton.js";import"../AppInfoMessage/AppInfoMessage.js";import"../../DevCenterAppContainer.css.js";import"../RestoreAppSizeButton/index.js";import"../PriorityMenus/PriorityMenus.css.js";import"../../../NavigationBar/NavigationBar.js";import"../../../SideBar/SideBar.js";import"../../../../TruncatedText/index.js";import"../../../../AssetEditor/SingleAssetEditor.js";import"../../../../AssetEditor/AssetEditorAutocomplete.js";import L from"../../../../AssetEditor/index.js";import I from"../../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../../CollapsableSidebar.js";import"../../../../DateTimePicker/index.js";import"../../../../DatePicker/index.js";import"../../../../ColorPicker/ColorPicker.js";import"../../../../ParameterCharts/AddEditTrack.js";import"../../../../ParameterCharts/ParameterCharts.js";import"../../../../ChartActionsList/ChartActionsList.js";import"../../../../SettingEditors/ColorEditor/index.js";import"../../../../SettingEditors/DropdownEditor/index.js";import"../../../../SettingEditors/RadioEditor/index.js";import"../../../../SwitchControl/index.js";import"../../../../RangeSlider/RangeSlider.js";import"../../../../Login/components/Login.js";import"../../../../Login/components/PasswordField.js";import"../../../../Login/components/Chip.js";import"../../../../Login/components/StepFooter.js";import"../../../../Login/components/StepContent.js";import"../../../../Login/components/StepHeader.js";import"../../../../Login/components/Step.js";import"../../../../Login/components/OrDivider.js";import"../../../../Login/components/HiddenEmailField.js";import"../../../../Login/components/EmailField.js";import"../../../../Breadcrumbs/index.js";import"../../../../VirtualizedTable/index.js";import"../../../../EmptyView/index.js";import"../../../../EmptyView/EmptyAppView/index.js";import O from"../../../../Button/index.js";import"../../../../MenuItem/index.js";import"../../../../ContextMenuItem/index.js";import"../../../../FolderMenuItem/index.js";import"../../../../EditableItem/EditableItem/index.js";import"../../../../EditableItem/EditableItemWithBadge/index.js";import"../../../../Checkbox/index.js";import"../../../../FolderMenuItemWithLinks/index.js";import"../../../../IconButton/index.js";import"../../../../Chip/index.js";import"../../../../Counter/index.js";import"../../../../AnchorsList/AnchorsList.js";import"../../../../Select/index.js";import"../../../../Tabs/Tabs.js";import"../../../../Tabs/Tab.js";import"../../../../Drillstring/BHASchematic.js";import"../../../../Drillstring/BHAComponentIcon.js";import"../../../../Drillstring/BHATable/index.js";import"../../../../Drillstring/BHAComponentDetail/index.js";import"../../../../Casing/CasingComponentIcon.js";import"../../../../Casing/CasingTable/index.js";import"../../../../WellSummary/WellSummaryItemLabel.js";import"../../../../WellSummary/WellSummaryItemTitle.js";import"../../../../WellSummary/WellSummaryItemValue.js";import"../../../../WellSummary/ActivitySummaryChart.js";import"../../../../WellSummary/FracWirelineTimeChart.js";import"../../../../BICOffsetPickerDialog/index.js";import"../../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../../Notifications/Notifications.js";import"../../../../TextLink/index.js";import"../../../../Template/TemplatePopover/index.js";import"../../../../PinnableFilters/PinnableFilters.js";import"../../../../HeaderLayout/HeaderLayout.js";import"../../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../../PadOffsetsPicker/StagesSelector.js";import"../../../../Table/TableToolbar/TableToolbar.js";import"../../../../PriceInput/PriceInput.js";import"../../../../LabelsCounter/LabelsCounter.js";import"../../../../Stepper/Step.js";import"../../../../Stepper/StepsWrapper.js";import"../../../../Stepper/Stepper.js";import"../../../../Comment/CommentIcon/index.js";import"../../../../FilesLoader/FilesLoader.js";function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function R(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?B(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var w="DC_appSettings",F=l({paper:{minWidth:"50rem",height:"40rem"}})(c),M=l({root:{marginBottom:10}})(d),W="SETTINGS",V="APP DETAILS";function N(l){var c=l.AppSettingsComponent,d=l.app,S=l.appData,b=l.appName,x=l.currentUser,y=l.isMultiRig,B=l.isProductSubscriptionFeatureActive,N=l.layoutEnvironment,q=l.onAppRemove,H=l.onSettingsChange,U=l.segment,_=l.toggleAppSettingsDialog,G=C(W),z=i(G,2),K=z[0],Y=z[1],J=C((function(){var t;return R(R({},e(d.settings)),{},{package:d.settings.package||(null==d||null===(t=d.package)||void 0===t?void 0:t.version)})})),Q=i(J,2),X=Q[0],Z=Q[1],$=C(!0),tt=i($,2),et=tt[0],rt=tt[1],it=v(),ot=d.id===o,nt=function(e,r){return Z((function(i){return R(R({},i),{},t({},e,r))}))},st=function(t){return Z((function(e){return R(R({},e),t)}))},pt=N&&"asset"===N.type,at=!(y||pt&&U===s.COMPLETION);return p(F,{open:!0,onBackdropClick:_,children:[p(u,{children:[b," settings"]}),a(j,{}),p(g,{children:[p(M,{value:K,onChange:function(t,e){return Y(e)},indicatorColor:"primary",textColor:"primary",children:[a(f,{"data-testid":"".concat(w,"_settingsTab"),label:W,value:W}),a(f,{"data-testid":"".concat(w,"_appDetailsTab"),label:V,value:V}),a(O,{className:k.viewAppButton,onClick:function(){var t,e;return it.push((e=null==d||null===(t=d.app)||void 0===t?void 0:t.id,"/apps/".concat(e)))},children:"VIEW APP PAGE"})]}),p(P,{ErrorView:E,app:d,children:[a(h,{open:!et&&!X.package,isShowCancel:!1,title:"Validation failed",text:"You should select the app version to proceed",handleOk:function(){return rt(!0)}}),K===W&&p(m,{children:[at&&a(L,{appKey:B&&!ot?d.app_key:null,settings:X,onSettingsChange:st,appType:n[U],isNullable:pt,label:"Active Asset"}),c&&a(c,{app:d,appData:S,settings:X,onSettingChange:nt,onSettingsChange:st,layoutEnvironment:N,currentUser:x}),!ot&&a(I,{appId:d.app.id,value:X.package,onChange:function(t){return nt("package",t)},currentUser:x})]}),K===V&&a(T,{appDescription:r(d,"app.description"),appSummary:r(d,"app.summary")})]})]}),p(A,{children:[q&&a(D,{appName:b,onAppRemove:q}),a(O,{"data-testid":"".concat(w,"_cancel"),variation:"secondary",onClick:_,children:"Cancel"}),a(O,{"data-testid":"".concat(w,"_save"),variation:"primary",onClick:function(){X.package||ot?(H(X),_()):rt(!1)},children:"Save"})]})]})}N.propTypes={AppSettingsComponent:S,app:b({}).isRequired,appData:b({}).isRequired,appName:x.isRequired,currentUser:b({}).isRequired,isMultiRig:y.isRequired,isProductSubscriptionFeatureActive:y,layoutEnvironment:b({}).isRequired,onAppRemove:S,onSettingsChange:S.isRequired,segment:x.isRequired,toggleAppSettingsDialog:S.isRequired},N.defaultProps={AppSettingsComponent:null,isProductSubscriptionFeatureActive:!1,onAppRemove:void 0};export default N;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import n from"@babel/runtime/helpers/slicedToArray";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{makeStyles as r,Button as o,Typography as a}from"@material-ui/core";import{useRef as l,useState as c}from"react";import p from"prop-types";import{Publish as u}from"@material-ui/icons";import m from"./partials/UploadingFileState/FileLoadingProgress.js";var s=r({filesLoader:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%"},uploadingFiles:{width:"100%"},fileInput:{display:"none"},inputButton:{display:"flex",alignItems:"center"},inputButtonText:{marginLeft:"6px",fontSize:"14px"}});function f(r){var p=s(),f=r.onLoad,d=l(),g=c([]),h=n(g,2),v=h[0],x=h[1],y=function(e,n){f(e,n)};return t("div",{className:p.filesLoader,children:[i("div",{className:p.uploadingFiles,children:v.map((function(n){return i(m,{file:n,onLoad:function(e){return y(n,e)},onDelete:function(t){return i=n,(r=v.findIndex((function(e){return e.name===i.name})))>-1&&v.splice(r,1),void x(e(v));var i,r}},n.name)}))}),!v.length&&i("div",{className:p.inputButton,children:t(o,{color:"primary",variant:"contained",onClick:function(){return d.current.click()},children:[i("input",{ref:d,type:"file",accept:".csv, text/csv",className:p.fileInput,onChange:function(e){var n=Array.from(e.target.files);n.length&&x(n)}}),i(u,{}),i(a,{className:p.inputButtonText,children:"Upload File"})]})})]})}f.propTypes={onLoad:p.func.isRequired};export default f;
1
+ import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{Typography as t,LinearProgress as a,Tooltip as i,IconButton as c}from"@material-ui/core";import{useState as l,useEffect as s}from"react";import d from"prop-types";import{Delete as m}from"@material-ui/icons";import p from"./Icons/IconWarning.js";import f from"./Icons/IconCancel.js";import u from"./Icons/IconSuccess.js";import{useStyles as h}from"./useStyles.js";import v from"./Icons/FileIcon.js";function y(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,n)}return o}function b(r){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?y(Object(n),!0).forEach((function(o){e(r,o,n[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function j(e){var d=h(),y=l({}),j=r(y,2),w=j[0],O=j[1],g=l(0),N=r(g,2),P=N[0],S=N[1],z=e.name,B=e.sizeBytes,I=e.handleCancel,M=e.onDelete,C=e.loadedBytes,D=e.error;return s((function(){B&&O(B>=Math.pow(10,6)?{downloaded:0,unit:"MB",convertedSize:Math.floor(B/Math.pow(10,5))/10}:B>=Math.pow(10,3)?{downloaded:0,unit:"KB",convertedSize:Math.floor(B/Math.pow(10,2))/10}:{downloaded:0,unit:"B",convertedSize:Math.floor(10*B)/10})}),[B]),s((function(){if(C){var e=Math.round(C/B*100);O((function(r){return b(b({},r),{},{downloaded:Math.floor(r.convertedSize*e/10)/10})})),S(e)}}),[C]),o("div",{className:d.fileStateWrapper,children:[n("div",{className:d.fileIconContainer,children:n(v,{name:z})}),o("div",{className:d.fileState,children:[o("div",{className:d.fileStateProgress,children:[n("div",{className:d.fileNameWrapper,children:n(t,{className:d.fileName,children:z})}),n(a,{className:d.progressBar,variant:"determinate",value:P,classes:{colorPrimary:d.progressBackground}}),o("div",{className:d.loaderProgressContainer,children:[n(t,{className:d.fileSize,component:"span",children:"".concat(w.downloaded," of ").concat(w.convertedSize," ").concat(w.unit)}),n("div",{className:d.progressStatus,children:D?n(i,{title:"There was a server error during the upload request. Please try later.",children:o(t,{component:"div",className:d.errorContainer,children:[n(t,{component:"span",className:d.errorText,children:"Upload Error"}),n(p,{})]})}):"".concat(P," %")})]})]}),o("div",{className:d.fileActions,children:[P<100&&!D&&n(c,{size:"small",onClick:function(){I(z),S(0),O((function(e){return b(b({},e),{},{downloaded:0})}))},children:n(f,{})}),100===P&&!D&&(M?n(c,{size:"small",onClick:M,children:n(m,{className:d.deleteIcon})}):n(u,{}))]})]})]})}j.propTypes={onDelete:d.func,handleCancel:d.func,name:d.string,sizeBytes:d.number,error:d.bool,loadedBytes:d.number.isRequired},j.defaultProps={onDelete:null,name:"",sizeBytes:1,error:null,handleCancel:null};export default j;
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import r from"prop-types";import e from"./DocFileIcon.js";import i from"./PdfFileIcon.js";import n from"./ExelFileIcon.js";import m from"./UnknownFileIcon.js";var p=function(r){var p=r.name;return p.includes(".doc")?o(e,{}):p.includes(".pdf")?o(i,{}):p.includes(".xls")?o(n,{}):o(m,{})};p.propTypes={name:r.string.isRequired};export default p;
@@ -0,0 +1 @@
1
+ import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{fileStateWrapper:{display:"flex",alignItems:"center"},fileIconContainer:{display:"flex",alignItems:"center",marginRight:"10px"},fileState:{display:"flex",flexGrow:"1",alignItems:"center"},fileStateProgress:{flexGrow:"1"},fileNameWrapper:{display:"table",tableLayout:"fixed",width:"100%"},fileName:{display:"table-cell",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:"14px",lineHeight:"16px"},fileSize:{fontSize:"11px",lineHeight:"12px",color:e.palette.primary.text6},checkIcon:{color:e.palette.success.bright},deleteIcon:{color:e.palette.primary.text6,cursor:"pointer"},progressBar:{borderRadius:"2px",height:"2px",margin:"4px 0"},fileActions:{display:"flex",alignItems:"center",paddingLeft:"24px"},progressBackground:{backgroundColor:e.palette.primary.dark},loaderProgressContainer:{display:"flex",width:"100%",fontSize:"11px",fontWeight:"400",letterSpacing:"0.4px",color:e.palette.primary.text6,marginTop:"4px"},progressStatus:{flexGrow:1,display:"flex",justifyContent:"flex-end"},errorContainer:{display:"flex",cursor:"pointer"},errorText:{color:e.palette.error.main,fontSize:"11px",fontWeight:"400",letterSpacing:"0.4px",marginRight:"5px",lineHeight:"16px"}}}));export{t as useStyles};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{isEmpty as n,get as r}from"lodash";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{makeStyles as s,Fab as c,Dialog as l,DialogTitle as o,DialogContent as d,FormControl as u,InputLabel as f,Select as p,MenuItem as m,Checkbox as h,ListItemText as S,DialogActions as g,Button as E}from"@material-ui/core";import{useMemo as I,useEffect as b}from"react";import{getPads as C}from"../../clients/jsonApi/index.js";import _ from"prop-types";import{Add as D}from"@material-ui/icons";import O from"jsona";import P from"use-tiny-state-machine";function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v=new O,w=s({fabSmallBtn:{width:24,height:24,minHeight:24,margin:"0 6px 0 1px"},fabSmallBtnIcon:{width:20,height:20},dialogPaper:{width:"75%",maxWidth:420}});var L={id:"requests",initial:"idle",context:{padsData:[],wellsData:[],lastStage:[],error:null,companyId:0},states:{idle:{on:{FETCH_PADS:{target:"pending",action:function(e){var t=e.dispatch,a=e.context;C({fields:["pad.name","pad.wells"],sort:"name",per_page:1e3,company:a.companyId}).then((function(e){return v.deserialize(e)})).then((function(e){return e.filter((function(e){return!n(r(e,"wells"))}))})).then((function(e){return t("PADS_REQUEST_SUCCESS",e)})).catch((function(e){return t("FAILURE",e)}))}}}},pending:{on:{PADS_REQUEST_SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{padsData:t})}))}},FAILURE:{target:"failure",beforeStateChange:function(e,t){throw new Error(t.message)}}}},success:{on:{FETCH_WELLS:{target:"success",action:function(e,t){(0,e.dispatch)("WELLS_REQUEST_SUCCESS",t.reduce((function(e,t){return e.concat(t.wells)}),[]))}},WELLS_REQUEST_SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{wellsData:t})}))}}}}}},x={id:"dialog",initial:"closed",context:{selectedPadIds:[],selectedWellIds:[]},states:{closed:{on:{OPEN_DIALOG:{target:"open",beforeStateChange:function(e,n){var r=e.updateContext,a=n.currentWellIds,i=n.padsData,s=[];return a&&a.size>0&&i.forEach((function(e){e.wells.forEach((function(t){a.includes(t.asset_id)&&!s.includes(e.id)&&s.push(e.id)}))})),r((function(e){return W(W({},e),{},{selectedPadIds:[].concat(s),selectedWellIds:t(a)})}))}}}},open:{on:{CLOSE_DIALOG:{target:"closed",beforeStateChange:function(e){return(0,e.updateContext)((function(e){return W(W({},e),{},{selectedPadIds:[],selectedWellIds:[]})}))}},SET_PAD_ID:{target:"open",beforeStateChange:function(e,t){var n=e.updateContext,r=t.selectedPadIds,a=t.currentWellIds,i=t.padsData,s=[];return a&&a.size>0&&i.forEach((function(e){e.wells.forEach((function(t){r.includes(e.id)&&a.includes(t.asset_id)&&s.push(t.asset_id)}))})),n((function(e){return W(W({},e),{},{selectedPadIds:r,selectedWellIds:[].concat(s)})}))}},SET_WELL_ID:{target:"open",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{selectedWellIds:t})}))}}}}}},j=function(e){var r=e.onSave,s=e.currentOffsetSetting,C=e.assets,_=e.companyId,O=w(),y=P(L),W=y.state,v=y.dispatch,j=y.context,A=P(x),T=A.state,k=A.dispatch,R=A.context,U=I((function(){return 0===s.size&&C?C.map((function(e){return e.id})):s.map((function(e){return e.selectedWellId}))}),[s,C]),F=function(){return k("CLOSE_DIALOG")},q=R.selectedPadIds,z=R.selectedWellIds;return b((function(){j.companyId=_,v("FETCH_PADS")}),[]),b((function(){if(!n(q)){var e=j.padsData.filter((function(e){return q.includes(e.id)}));v("FETCH_WELLS",e)}}),[q]),a("div",{children:[i(c,{size:"small",color:"primary",classes:{sizeSmall:O.fabSmallBtn},onClick:function(){return k("OPEN_DIALOG",{currentWellIds:U,padsData:j.padsData})},disabled:"success"!==W,children:i(D,{className:O.fabSmallBtnIcon})}),"success"===W&&a(l,{open:"open"===T,onBackdropClick:F,classes:{paper:O.dialogPaper},children:[i(o,{children:"Offset Wells"}),a(d,{children:[a(u,{margin:"normal",fullWidth:!0,required:!0,children:[i(f,{htmlFor:"pad-select",shrink:!n(q),children:"Pad"}),i(p,{multiple:!0,inputProps:{name:"pads",id:"pad-select"},value:q,onChange:function(e){return k("SET_PAD_ID",{selectedPadIds:e.target.value,currentWellIds:U,padsData:j.padsData})},renderValue:function(e){return"".concat(e.length," selected")},children:j.padsData.map((function(e){return a(m,{value:e.id,children:[i(h,{checked:q.includes(e.id)}),i(S,{primary:e.name})]},e.id)}))})]}),a(u,{margin:"normal",disabled:n(q),fullWidth:!0,required:!0,children:[i(f,{htmlFor:"wells",shrink:!n(z),children:"Well"}),i(p,{multiple:!0,inputProps:{name:"wells",id:"well-select"},value:z,onChange:function(e){return k("SET_WELL_ID",e.target.value)},renderValue:function(e){return"".concat(e.length," selected")},children:j.wellsData.map((function(e){var t=U.includes(e.asset_id);return a(m,{value:e.asset_id,disabled:t,children:[i(h,{checked:z.includes(e.asset_id)}),i(S,{primary:e.name})]},e.id)}))})]})]}),a(g,{children:[i(E,{onClick:F,children:"Cancel"}),i(E,{variant:"contained",color:"primary",disabled:n(z),onClick:function(){var e=j.wellsData.filter((function(e){return z.includes(e.asset_id)})).map((function(e){return{selectedWellId:Number(e.asset_id),selectedWellName:e.name,selectedWellStatus:e.status,selectedStages:[],stages:{}}})),n=s.filter((function(t){return!e.find((function(e){return e.selectedWellId===t.selectedWellId}))}));n=[].concat(t(n),t(e)),F(),r(n)},children:"Save"})]})]})]})};j.propTypes={currentOffsetSetting:_.arrayOf(_.shape({})).isRequired,onSave:_.func.isRequired,companyId:_.string.isRequired,assets:_.arrayOf(_.shape({})).isRequired};export default j;
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{isEmpty as n,get as r}from"lodash";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{makeStyles as c,Fab as s,Dialog as l,DialogTitle as o,DialogContent as d,FormControl as u,InputLabel as f,Select as p,MenuItem as m,Checkbox as h,ListItemText as S,DialogActions as g,Button as E}from"@material-ui/core";import{useMemo as I,useEffect as b}from"react";import{getPads as C}from"../../clients/jsonApi/index.js";import _ from"prop-types";import{Add as D}from"@material-ui/icons";import O from"jsona";import P from"use-tiny-state-machine";function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v=new O,w=c({fabSmallBtn:{width:24,height:24,minHeight:24,margin:"0 6px 0 1px"},fabSmallBtnIcon:{width:20,height:20},dialogPaper:{width:"75%",maxWidth:420}});var L={id:"requests",initial:"idle",context:{padsData:[],wellsData:[],lastStage:[],error:null,companyId:0},states:{idle:{on:{FETCH_PADS:{target:"pending",action:function(e){var t=e.dispatch,a=e.context;C({fields:["pad.name","pad.wells"],sort:"name",per_page:1e3,company:a.companyId}).then((function(e){return v.deserialize(e)})).then((function(e){return e.filter((function(e){return!n(r(e,"wells"))}))})).then((function(e){return t("PADS_REQUEST_SUCCESS",e)})).catch((function(e){return t("FAILURE",e)}))}}}},pending:{on:{PADS_REQUEST_SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{padsData:t})}))}},FAILURE:{target:"failure",beforeStateChange:function(e,t){throw new Error(t.message)}}}},success:{on:{FETCH_WELLS:{target:"success",action:function(e,t){(0,e.dispatch)("WELLS_REQUEST_SUCCESS",t.reduce((function(e,t){return e.concat(t.wells)}),[]))}},WELLS_REQUEST_SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{wellsData:t})}))}}}}}},x={id:"dialog",initial:"closed",context:{selectedPadIds:[],selectedWellIds:[]},states:{closed:{on:{OPEN_DIALOG:{target:"open",beforeStateChange:function(e,r){var a=e.updateContext,i=r.currentWellIds,c=r.padsData,s=[];return n(i)||c.forEach((function(e){e.wells.forEach((function(t){i.includes(t.asset_id)&&!s.includes(e.id)&&s.push(e.id)}))})),a((function(e){return W(W({},e),{},{selectedPadIds:[].concat(s),selectedWellIds:t(i)})}))}}}},open:{on:{CLOSE_DIALOG:{target:"closed",beforeStateChange:function(e){return(0,e.updateContext)((function(e){return W(W({},e),{},{selectedPadIds:[],selectedWellIds:[]})}))}},SET_PAD_ID:{target:"open",beforeStateChange:function(e,t){var r=e.updateContext,a=t.selectedPadIds,i=t.currentWellIds,c=t.padsData,s=[];return n(i)||c.forEach((function(e){e.wells.forEach((function(t){a.includes(e.id)&&i.includes(t.asset_id)&&s.push(t.asset_id)}))})),r((function(e){return W(W({},e),{},{selectedPadIds:a,selectedWellIds:[].concat(s)})}))}},SET_WELL_ID:{target:"open",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{selectedWellIds:t})}))}}}}}},j=function(e){var r=e.onSave,c=e.currentOffsetSetting,C=e.assets,_=e.companyId,O=w(),y=P(L),W=y.state,v=y.dispatch,j=y.context,A=P(x),T=A.state,k=A.dispatch,R=A.context,U=I((function(){return n(c)&&!n(C)?C.map((function(e){return e.asset_id})):c.map((function(e){return e.selectedWellId}))}),[c,C]),F=function(){return k("CLOSE_DIALOG")},q=R.selectedPadIds,B=R.selectedWellIds;return b((function(){j.companyId=_,v("FETCH_PADS")}),[]),b((function(){if(!n(q)){var e=j.padsData.filter((function(e){return q.includes(e.id)}));v("FETCH_WELLS",e)}}),[q]),a("div",{children:[i(s,{size:"small",color:"primary",classes:{sizeSmall:O.fabSmallBtn},onClick:function(){return k("OPEN_DIALOG",{currentWellIds:U,padsData:j.padsData})},disabled:"success"!==W,children:i(D,{className:O.fabSmallBtnIcon})}),"success"===W&&a(l,{open:"open"===T,onBackdropClick:F,classes:{paper:O.dialogPaper},children:[i(o,{children:"Offset Wells"}),a(d,{children:[a(u,{margin:"normal",fullWidth:!0,required:!0,children:[i(f,{htmlFor:"pad-select",shrink:!n(q),children:"Pad"}),i(p,{multiple:!0,inputProps:{name:"pads",id:"pad-select"},value:q,onChange:function(e){return k("SET_PAD_ID",{selectedPadIds:e.target.value,currentWellIds:U,padsData:j.padsData})},renderValue:function(e){return"".concat(e.length," selected")},children:j.padsData.map((function(e){return a(m,{value:e.id,children:[i(h,{checked:q.includes(e.id)}),i(S,{primary:e.name})]},e.id)}))})]}),a(u,{margin:"normal",disabled:n(q),fullWidth:!0,required:!0,children:[i(f,{htmlFor:"wells",shrink:!n(B),children:"Well"}),i(p,{multiple:!0,inputProps:{name:"wells",id:"well-select"},value:B,onChange:function(e){return k("SET_WELL_ID",e.target.value)},renderValue:function(e){return"".concat(e.length," selected")},children:j.wellsData.map((function(e){var t=U.includes(e.asset_id);return a(m,{value:e.asset_id,disabled:t,children:[i(h,{checked:B.includes(e.asset_id)}),i(S,{primary:e.name})]},e.id)}))})]})]}),a(g,{children:[i(E,{onClick:F,children:"Cancel"}),i(E,{variant:"contained",color:"primary",disabled:n(B),onClick:function(){var e=j.wellsData.filter((function(e){return B.includes(e.asset_id)})).map((function(e){return{selectedWellId:Number(e.asset_id),selectedWellName:e.name,selectedWellStatus:e.status,selectedStages:[],stages:{}}})),n=c.filter((function(t){return!e.find((function(e){return e.selectedWellId===t.selectedWellId}))}));n=[].concat(t(n),t(e)),F(),r(n)},children:"Save"})]})]})]})};j.propTypes={currentOffsetSetting:_.arrayOf(_.shape({})).isRequired,onSave:_.func.isRequired,companyId:_.string.isRequired,assets:_.arrayOf(_.shape({})).isRequired};export default j;
@@ -1 +1 @@
1
- var o=function(o,r,t){return 100*(o-r)/(t-r)},r=function(o,r,t){return o*(t-r)/100},t=function(o,r,t,n,f){return o<n?{from:n,to:t}:o>t-f?{from:t-f,to:t}:{from:o,to:t}},n=function(o,r,t,n,f){return o>n?{from:r,to:n}:o<r+f?{from:r,to:r+f}:{from:r,to:o}};export{o as calculatePercentForValue,r as calculateValueFromPercent,t as updateFromValue,n as updateToValue};
1
+ var o=function(o,r,t){return 100*(o-r)/(t-r)},r=function(o,r,t){return r+o*(t-r)/100},t=function(o,r,t,n,f){return o<n?{from:n,to:t}:o>t-f?{from:t-f,to:t}:{from:o,to:t}},n=function(o,r,t,n,f){return o>n?{from:r,to:n}:o<r+f?{from:r,to:r+f}:{from:r,to:o}};export{o as calculatePercentForValue,r as calculateValueFromPercent,t as updateFromValue,n as updateToValue};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{withStyles as l,Grid as t,Typography as r,Switch as s}from"@material-ui/core";import o from"prop-types";import c from"classnames";import n from"./style.css.js";var d=function(l){var o,d,b=l.title,m=l.leftLabel,p=l.rightLabel,h=l.checked,f=l.onChange,g=l.disabled,u=l.classes,L=l.size,k=l.className,w=m&&p;return a("div",{className:k,children:[b&&i("div",{className:n.switchControlTitle,children:b}),i("div",{className:n.switchControlWithLabels,children:a(t,{component:"label",container:!0,alignItems:"center",spacing:0,children:[m&&i(t,{item:!0,children:i(r,{variant:"body2",className:c(u.label,"small"===L&&u.labelSmall,!h&&!g&&u.activeLabel,g&&u.disabledLabel),children:m})}),i(t,{item:!0,children:i(s,{checked:h,onChange:f,color:"primary",disabled:g,classes:{root:u.root,switchBase:c((o={},e(o,u.switchBase,w||h&&!g),e(o,u.switchBaseDisabled,g&&(w||h)),e(o,u.switchBaseDisabledNoLabels,!w&&g&&!h),o)),track:c((d={},e(d,u.track,w||h&&!g),e(d,u.trackDisabled,g&&(w||h)),e(d,u.trackDisabledNoLabels,!w&&g&&!h),d))},size:L})}),p&&i(t,{item:!0,children:i(r,{variant:"body2",className:c(u.label,"small"===L&&u.labelSmall,h&&u.activeLabel,g&&u.disabledLabel),children:p})})]})})]})};d.propTypes={title:o.string,leftLabel:o.string,rightLabel:o.string,checked:o.bool.isRequired,onChange:o.func.isRequired,disabled:o.bool,classes:o.shape({}).isRequired,size:o.string,className:o.string},d.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:""};var b=l({root:{paddingLeft:10,paddingRight:10,width:56,"&.MuiSwitch-sizeSmall":{width:48,"& .MuiSwitch-switchBase":{paddingLeft:7}}},switchBase:{color:"#03BCD4","&.Mui-checked":{paddingLeft:7}},switchBaseDisabled:{color:"#196069 !important"},track:{backgroundColor:"#196069 !important",opacity:"1 !important",border:"none"},trackDisabled:{backgroundColor:"#223D40 !important",opacity:"1 !important",border:"none"},switchBaseDisabledNoLabels:{color:"#545454 !important"},trackDisabledNoLabels:{backgroundColor:"#3D3D3D !important",opacity:"1 !important",border:"none"},label:{display:"flex",justifyContent:"center",flexDirection:"column",fontSize:"16px",lineHeight:"22px",color:"#bdbdbd",margin:"8px 0px",cursor:"pointer"},labelSmall:{fontSize:"14px",lineHeight:"20px"},disabledLabel:{cursor:"default",color:"#616161"},activeLabel:{color:"#ffffff"}})(d);export default b;
1
+ import e from"@babel/runtime/helpers/defineProperty";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{withStyles as l,Grid as r,Typography as t,Switch as o}from"@material-ui/core";import{forwardRef as s}from"react";import c from"prop-types";import n from"classnames";import d from"./style.css.js";var b=s((function(l,s){var c,b,m=l.title,p=l.leftLabel,h=l.rightLabel,f=l.checked,g=l.onChange,u=l.disabled,L=l.classes,k=l.size,D=l.className,w=p&&h;return a("div",{className:D,children:[m&&i("div",{className:d.switchControlTitle,children:m}),a(r,{component:"label",container:!0,alignItems:"center",spacing:0,children:[p&&i(r,{item:!0,children:i(t,{variant:"body2",className:n(L.label,"small"===k&&L.labelSmall,!f&&!u&&L.activeLabel,u&&L.disabledLabel),children:p})}),i(r,{item:!0,children:i(o,{ref:s,checked:f,onChange:g,color:"primary",disabled:u,classes:{root:L.root,switchBase:n((c={},e(c,L.switchBase,w||f&&!u),e(c,L.switchBaseDisabled,u&&(w||f)),e(c,L.switchBaseDisabledNoLabels,!w&&u&&!f),c)),track:n((b={},e(b,L.track,w||f&&!u),e(b,L.trackDisabled,u&&(w||f)),e(b,L.trackDisabledNoLabels,!w&&u&&!f),b))},size:k})}),h&&i(r,{item:!0,children:i(t,{variant:"body2",className:n(L.label,"small"===k&&L.labelSmall,f&&!u&&L.activeLabel,u&&L.disabledLabel),children:h})})]})]})}));b.propTypes={title:c.string,leftLabel:c.string,rightLabel:c.string,checked:c.bool.isRequired,onChange:c.func.isRequired,disabled:c.bool,classes:c.shape({}).isRequired,size:c.string,className:c.string},b.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:""};var m=l({root:{width:60,height:40,padding:13,"&.MuiSwitch-sizeSmall":{width:52,height:36,padding:13},"& .MuiSwitch-switchBase":{padding:10}},switchBase:{padding:10,color:"#03BCD4","&.MuiIconButton-root:hover":{backgroundColor:"rgba(3, 188, 212, 0.08)"}},switchBaseDisabled:{color:"#196069 !important"},track:{backgroundColor:"#196069 !important",opacity:"1 !important",border:"none"},trackDisabled:{backgroundColor:"#223D40 !important",opacity:"1 !important",border:"none"},switchBaseDisabledNoLabels:{color:"#545454 !important"},trackDisabledNoLabels:{backgroundColor:"#3D3D3D !important",opacity:"1 !important",border:"none"},label:{display:"flex",justifyContent:"center",flexDirection:"column",fontSize:"16px",lineHeight:"22px",color:"#bdbdbd",margin:"8px 0px",cursor:"pointer"},labelSmall:{fontSize:"14px",lineHeight:"20px"},disabledLabel:{cursor:"default",color:"#616161"},activeLabel:{color:"#ffffff"}})(b);export default m;
@@ -0,0 +1 @@
1
+ var r={PUBLISHED:"published",DRAFT:"draft",FAILURE:"failure"};export{r as PACKAGE_STATUSES};
@@ -1 +1 @@
1
- import*as r from"./completion.js";export{r as completion};import*as o from"./alerts.js";export{o as alerts};export{DEV_CENTER_CLI_APP_ID}from"./devcenter.js";import*as s from"./goals.js";export{s as goals};export{ASSET_TYPES}from"./assetTypes.js";import*as t from"./segment.js";export{t as segment};import*as e from"./apps.js";export{e as apps};import*as m from"./drillstring.js";export{m as drillstring};export{COMPLETION_WELL_SUMMARY,DRILLING_WELL_SUMMARY,DRILLOUT_WELL_SUMMARY}from"./wellSummary.js";export{RIG_ACTIVITY_COLORS}from"./rigActivity.js";
1
+ import*as r from"./completion.js";export{r as completion};import*as o from"./alerts.js";export{o as alerts};export{DEV_CENTER_CLI_APP_ID}from"./devcenter.js";import*as s from"./goals.js";export{s as goals};export{ASSET_TYPES}from"./assetTypes.js";import*as t from"./segment.js";export{t as segment};import*as p from"./apps.js";export{p as apps};import*as e from"./drillstring.js";export{e as drillstring};import*as m from"./appPackages.js";export{m as appPackages};export{COMPLETION_WELL_SUMMARY,DRILLING_WELL_SUMMARY,DRILLOUT_WELL_SUMMARY}from"./wellSummary.js";export{RIG_ACTIVITY_COLORS}from"./rigActivity.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.26.0-8",
3
+ "version": "0.26.0-rc.2",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{makeStyles as n,Typography as i,LinearProgress as l,Tooltip as a,IconButton as c}from"@material-ui/core";import{useState as s,useEffect as p}from"react";import d from"prop-types";import{Delete as f}from"@material-ui/icons";import m from"../Icons/IconWarning.js";import u from"../Icons/IconCancel.js";import h from"../Icons/IconSuccess.js";import g from"../Icons/DocFileIcon.js";import x from"../Icons/PdfFileIcon.js";import y from"../Icons/UnknownFileIcon.js";import b from"../Icons/ExelFileIcon.js";function w(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,t)}return o}function v(r){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?w(Object(t),!0).forEach((function(o){e(r,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var S=n((function(e){return{fileStateWrapper:{display:"flex",alignItems:"center"},fileIconContainer:{display:"flex",alignItems:"center",marginRight:"10px"},fileState:{display:"flex",flexGrow:"1",alignItems:"center"},fileStateProgress:{flexGrow:"1"},fileNameWrapper:{display:"table",tableLayout:"fixed",width:"100%"},fileName:{display:"table-cell",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:"14px",lineHeight:"16px"},fileSize:{fontSize:"11px",lineHeight:"12px",color:e.palette.primary.text6},checkIcon:{color:e.palette.success.bright},deleteIcon:{color:e.palette.primary.text6,cursor:"pointer"},progressBar:{borderRadius:"2px",height:"2px",margin:"4px 0"},fileActions:{display:"flex",alignItems:"center",paddingLeft:"24px"},progressBackground:{backgroundColor:e.palette.primary.dark},loaderProgressContainer:{display:"flex",width:"100%",fontSize:"11px",fontWeight:"400",letterSpacing:"0.4px",color:e.palette.primary.text6,marginTop:"4px"},progressStatus:{flexGrow:1,display:"flex",justifyContent:"flex-end"},errorContainer:{display:"flex",cursor:"pointer"},errorText:{color:e.palette.error.main,fontSize:"11px",fontWeight:"400",letterSpacing:"0.4px",marginRight:"5px",lineHeight:"16px"}}}));function I(e){var n=S(),d=s({}),w=r(d,2),I=w[0],j=w[1],N=s(0),O=r(N,2),P=O[0],z=O[1],C=e.name,B=e.sizeBytes,M=e.handleCancel,k=e.onDelete,D=e.loadedBytes,W=e.error;return p((function(){B&&j(B>=Math.pow(10,6)?{downloaded:0,unit:"MB",convertedSize:Math.floor(B/Math.pow(10,5))/10}:B>=Math.pow(10,3)?{downloaded:0,unit:"KB",convertedSize:Math.floor(B/Math.pow(10,2))/10}:{downloaded:0,unit:"B",convertedSize:Math.floor(10*B)/10})}),[B]),p((function(){if(D){var e=Math.round(D/B*100);j((function(r){return v(v({},r),{},{downloaded:Math.floor(r.convertedSize*e/10)/10})})),z(e)}}),[D]),o("div",{className:n.fileStateWrapper,children:[t("div",{className:n.fileIconContainer,children:C.includes(".doc")?t(g,{}):C.includes(".pdf")?t(x,{}):C.includes(".xls")?t(b,{}):t(y,{})}),o("div",{className:n.fileState,children:[o("div",{className:n.fileStateProgress,children:[t("div",{className:n.fileNameWrapper,children:t(i,{className:n.fileName,children:C})}),t(l,{className:n.progressBar,variant:"determinate",value:P,classes:{colorPrimary:n.progressBackground}}),o("div",{className:n.loaderProgressContainer,children:[t(i,{className:n.fileSize,component:"span",children:"".concat(I.downloaded," of ").concat(I.convertedSize," ").concat(I.unit)}),t("div",{className:n.progressStatus,children:W?t(a,{title:"There was a server error during the upload request. Please try later.",children:o(i,{component:"div",className:n.errorContainer,children:[t(i,{component:"span",className:n.errorText,children:"Upload Error"}),t(m,{})]})}):"".concat(P," %")})]})]}),o("div",{className:n.fileActions,children:[P<100&&!W&&t(c,{size:"small",onClick:function(){M(C),z(0),j((function(e){return v(v({},e),{},{downloaded:0})}))},children:t(u,{})}),100===P&&!W&&(k?t(c,{size:"small",onClick:k,children:t(f,{className:n.deleteIcon})}):t(h,{}))]})]})]})}I.propTypes={onDelete:d.func,handleCancel:d.func,name:d.string,sizeBytes:d.number,error:d.bool,loadedBytes:d.number.isRequired},I.defaultProps={onDelete:null,name:"",sizeBytes:1,error:null,handleCancel:null};export default I;