@corva/ui 0.24.0-4 → 0.24.0-8
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/README.md +4 -2
- package/assets/49092309a3fda5ecf77311bd794ac103.svg +40 -0
- package/assets/9bda514bfc837939d0b6f7d8dbe94d03.svg +9 -0
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/components/WellSummary/ActivitySummaryChart.js +1 -1
- package/components/WellSummary/WellSummaryItemValue.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,10 +4,12 @@ This repo contains components/utils which are shared for Corva ui apps.
|
|
|
4
4
|
|
|
5
5
|
#### Things to know:
|
|
6
6
|
|
|
7
|
-
1.
|
|
7
|
+
1. How to bump the version? What should be the branch name? And other more advanced cases, like release/hotfixes. The guideline for all of these cases can be found [here (Corva access required)](https://www.notion.so/corva/corva-web-repo-d510f545ffb74c9bafd6b1bfbc0b99bf#2283b08cd4c8477981dabc8974cc13c0)
|
|
8
|
+
|
|
9
|
+
2. `yarn start` will open ExampleApp.js in your browser.
|
|
8
10
|
That's a playground for building components.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
3. To link this repo with your app, you should:
|
|
11
13
|
|
|
12
14
|
### Mac
|
|
13
15
|
1. Run `yarn build` or `yarn build-watch` in @corva/ui repo (only first time)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<svg width="217" height="217" viewBox="0 0 217 217" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<mask id="mask0_3151_161440" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="217" height="217">
|
|
3
|
+
<circle cx="108.237" cy="108.236" r="108" fill="#C4C4C4"/>
|
|
4
|
+
</mask>
|
|
5
|
+
<g mask="url(#mask0_3151_161440)">
|
|
6
|
+
<g filter="url(#filter0_f_3151_161440)">
|
|
7
|
+
<circle cx="108.237" cy="108.236" r="107" stroke="#64B5F6" stroke-width="2"/>
|
|
8
|
+
</g>
|
|
9
|
+
<g filter="url(#filter1_f_3151_161440)">
|
|
10
|
+
<circle cx="108.237" cy="108.236" r="107" stroke="#64B5F6" stroke-width="2"/>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
<defs>
|
|
14
|
+
<filter id="filter0_f_3151_161440" x="-31.7632" y="-31.7637" width="280" height="280" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
15
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
16
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
17
|
+
<feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_3151_161440"/>
|
|
18
|
+
</filter>
|
|
19
|
+
<filter id="filter1_f_3151_161440" x="-31.7632" y="-31.7637" width="280" height="280" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
20
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
21
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
22
|
+
<feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_3151_161440"/>
|
|
23
|
+
</filter>
|
|
24
|
+
<filter id="filter2_di_3151_161440" x="61.2368" y="63.2363" width="94" height="94" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
25
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
26
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
27
|
+
<feOffset dy="2"/>
|
|
28
|
+
<feGaussianBlur stdDeviation="1"/>
|
|
29
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
|
30
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_3151_161440"/>
|
|
31
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_3151_161440" result="shape"/>
|
|
32
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
33
|
+
<feOffset dy="1"/>
|
|
34
|
+
<feGaussianBlur stdDeviation="0.5"/>
|
|
35
|
+
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
|
36
|
+
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0"/>
|
|
37
|
+
<feBlend mode="normal" in2="shape" result="effect2_innerShadow_3151_161440"/>
|
|
38
|
+
</filter>
|
|
39
|
+
</defs>
|
|
40
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="229" height="229" viewBox="0 0 229 229" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="114.237" cy="114.236" r="113" stroke="url(#paint0_linear_3151_161439)" stroke-width="2"/>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="paint0_linear_3151_161439" x1="114.237" y1="103.736" x2="114.237" y2="228.236" gradientUnits="userSpaceOnUse">
|
|
5
|
+
<stop stop-color="#414141"/>
|
|
6
|
+
<stop offset="1" stop-color="#333333" stop-opacity="0"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
</svg>
|
package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import{cloneDeep as e,get as r}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/helpers/toConsumableArray";import"../../../../../constants/goals.js";import"../../../../../constants/apps.js";import"../../../../../constants/completion.js";import{SEGMENT_TO_ASSET_TYPE as o,SEGMENTS as n}from"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import{DEV_CENTER_CLI_APP_ID as p}from"../../../../../constants/devcenter.js";import"../../../../../constants/drillstring.js";import"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/typeof";import"../../../../../utils/index.js";import{jsxs as s,jsx as a,Fragment as m}from"react/jsx-runtime";import{withStyles as l,Dialog as
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import{cloneDeep as e,get as r}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/helpers/toConsumableArray";import"../../../../../constants/goals.js";import"../../../../../constants/apps.js";import"../../../../../constants/completion.js";import{SEGMENT_TO_ASSET_TYPE as o,SEGMENTS as n}from"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import{DEV_CENTER_CLI_APP_ID as p}from"../../../../../constants/devcenter.js";import"../../../../../constants/drillstring.js";import"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/typeof";import"../../../../../utils/index.js";import{jsxs as s,jsx as a,Fragment as m}from"react/jsx-runtime";import{withStyles as l,Dialog as d,Tabs as c,DialogTitle as u,Divider as j,DialogContent as g,Tab as A,DialogActions as b}from"@material-ui/core";import{useState as S}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 C,shape as y,string as x,bool as f}from"prop-types";import"classnames";import"../../../../Modal/index.js";import"../../../../IconMenu/index.js";import"../../../../StyledMenuItem/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Avatar/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import"../../../DevCenterRouterContext/UniversalLink/UniversalLink.js";import v 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 h from"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../Typography.js";import P from"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import E from"./RemoveAppButton.js";import"../../../../SlateFormattedText/RenderElements.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import D from"./AppDetails.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 T from"../../../../AssetEditor/index.js";import L 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 I 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"../../../../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"../../../../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 k(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 B(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?k(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var O="DC_appSettings",R=l({paper:{minWidth:"50rem",height:"40rem"}})(d),w=l({root:{marginBottom:10}})(c),F="SETTINGS",M="APP DETAILS",V="VIEW APP PAGE";function W(l){var d=l.AppSettingsComponent,c=l.app,C=l.appData,y=l.appName,x=l.currentUser,f=l.isMultiRig,k=l.isProductSubscriptionFeatureActive,W=l.layoutEnvironment,N=l.onAppRemove,q=l.onSettingsChange,H=l.segment,_=l.toggleAppSettingsDialog,U=S(F),G=i(U,2),z=G[0],K=G[1],Y=S((function(){var t;return B(B({},e(c.settings)),{},{package:c.settings.package||(null==c||null===(t=c.package)||void 0===t?void 0:t.version)})})),J=i(Y,2),Q=J[0],X=J[1],Z=S(!0),$=i(Z,2),tt=$[0],et=$[1],rt=c.id===p,it=function(e,r){return X((function(i){return B(B({},i),{},t({},e,r))}))},ot=function(t){return X((function(e){return B(B({},e),t)}))},nt=W&&"asset"===W.type,pt=!(f||nt&&H===n.COMPLETION);return s(R,{open:!0,onBackdropClick:_,children:[s(u,{children:[y," settings"]}),a(j,{}),s(g,{children:[s(w,{value:z,onChange:function(t,e){return K(e)},indicatorColor:"primary",textColor:"primary",children:[a(A,{"data-testid":"".concat(O,"_settingsTab"),label:F,value:F}),a(A,{"data-testid":"".concat(O,"_appDetailsTab"),label:M,value:M}),a(A,{"data-testid":"".concat(O,"_viewAppPageTab"),label:V,value:V})]}),s(h,{ErrorView:P,app:c,children:[a(v,{open:!tt&&!Q.package,isShowCancel:!1,title:"Validation failed",text:"You should select the app version to proceed",handleOk:function(){return et(!0)}}),z===F&&s(m,{children:[pt&&a(T,{appKey:k&&!rt?c.app_key:null,settings:Q,onSettingsChange:ot,appType:o[H],isNullable:!1,label:"Active Asset"}),d&&a(d,{app:c,appData:C,settings:Q,onSettingChange:it,onSettingsChange:ot,layoutEnvironment:W,currentUser:x}),!rt&&a(L,{appId:c.app.id,value:Q.package,onChange:function(t){return it("package",t)},currentUser:x})]}),z===M&&a(D,{appDescription:r(c,"app.description"),appSummary:r(c,"app.summary")})]})]}),s(b,{children:[N&&a(E,{appName:y,onAppRemove:N}),a(I,{"data-testid":"".concat(O,"_cancel"),variation:"secondary",onClick:_,children:"Cancel"}),a(I,{"data-testid":"".concat(O,"_save"),variation:"primary",onClick:function(){Q.package||rt?(q(Q),_()):et(!1)},children:"Save"})]})]})}W.propTypes={AppSettingsComponent:C,app:y({}).isRequired,appData:y({}).isRequired,appName:x.isRequired,currentUser:y({}).isRequired,isMultiRig:f.isRequired,isProductSubscriptionFeatureActive:f,layoutEnvironment:y({}).isRequired,onAppRemove:C,onSettingsChange:C.isRequired,segment:x.isRequired,toggleAppSettingsDialog:C.isRequired},W.defaultProps={AppSettingsComponent:null,isProductSubscriptionFeatureActive:!1,onAppRemove:void 0};export default W;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import{sumBy as e,upperFirst as
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import{sumBy as e,upperFirst as o}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import{jsxs as a,jsx as n,Fragment as r}from"react/jsx-runtime";import{makeStyles as c,Typography as l,Tooltip as d}from"@material-ui/core";import{useRef as s,useState as p,useMemo as h,useEffect as u,createRef as f}from"react";import m from"prop-types";import g from"classnames";import{Regular14 as x}from"../Typography.js";var v=c({root:{width:"228px",height:"228px",borderRadius:"50%",padding:"6px",position:"relative",background:"url(".concat("/static/media/9bda514bfc837939d0b6f7d8dbe94d03.svg",")"),backgroundRepeat:"no-repeat"},backgroundRoot:{width:"100%",height:"100%",borderRadius:"50%",border:"2px solid #616161",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"url(".concat("/static/media/49092309a3fda5ecf77311bd794ac103.svg",")")},emptyStateBackground:{background:"radial-gradient(50% 50% at 50% 50%, rgba(100, 181, 246, 0) 54.4%, rgba(100, 181, 246, 0.01) 76.49%, rgba(100, 181, 246, 0.06) 100%)"},dropShadowRoot:{width:"100%",height:"100%",borderRadius:"50%",filter:"blur(36px)",border:"2px solid #64B5F6",display:"flex",alignItems:"center",justifyContent:"center"},content:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",left:0,top:0},lastActivityRoot:{width:"90px",height:"90px",background:"#3B3B3B",boxShadow:"0px 2px 2px rgba(0, 0, 0, 0.1), inset 0px 1px 1px rgba(255, 255, 255, 0.05)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"8px 0"},activityDuration:{fontSize:"36px",lineHeight:"24px",fontWeight:300,letterSpacing:"0.4px"},durationUnit:{fontSize:"12px",lineHeight:"24px",fontWeight:500,letterSpacing:"0.4px"},activityTimeRange:{fontSize:"10px",textTransform:"uppercase",color:"#9E9E9E",lineHeight:"24px",fontWeight:500,letterSpacing:"1px"},activityName:{fontSize:"12px",lineHeight:"14px",fontWeight:500},noOperationsRoot:{width:90,height:90},noOperationsText:{marginTop:24,color:"#9E9E9E"},chart:{position:"absolute",left:2,top:2,width:"100%",height:"100%",padding:"12px"},canvas:{width:"100%",height:"100%"},activities:{position:"absolute",left:12,top:12}});function b(t,e,o,i,a,n){t.moveTo(e,o),t.arc(e,o,i,a,n)}function y(t,e,o,i,a,n,r,c){var l=n-a>.0833393628,d=l?.0416696814:0,s=l?4:0,p=100-s;(t.beginPath(),t.moveTo(e,o),t.arc(e,o,i,a+d,n-d),c&&l)&&(b(t,100+p*Math.cos(a+d),100+p*Math.sin(a+d),s,0,2*Math.PI),b(t,100+p*Math.cos(n-d),100+p*Math.sin(n-d),s,0,2*Math.PI));t.closePath();var h=t.createRadialGradient(e,o,8,e,o,i);h.addColorStop(0,"".concat(r,"00")),h.addColorStop(.9,"".concat(r,"00")),h.addColorStop(.93,r),h.addColorStop(1,r),t.fillStyle=h,t.fill()}function S(c){var m=c.currentActivityName,b=c.activities,S=c.showTooltip,w=v(),N=s(null),R=s([]),C=p(!1),T=i(C,2),E=T[0],P=T[1],A=p(null),k=i(A,2),I=k[0],D=k[1],M=h((function(){return b.filter((function(t){return t.duration}))}),[b]),j=h((function(){return e(b,"duration")}),[b]),B=h((function(){return b.find((function(t){return t.name===m}))}),[b,m]),O=function(){P(!0)},z=function(){P(!1),D(null)},H=function(t){var e=!1;E&&R.current.forEach((function(o,i){var a=o.current;if(a&&!e){var n=a.getContext("2d");(e=n.isPointInPath(t.offsetX,t.offsetY))&&D(i)}})),e||D(null)};return u((function(){var t=N.current,e=t.getContext("2d");t.width=200,t.height=200,t.style.width="".concat(200,"px"),t.style.height="".concat(200,"px");var o=M.length;R.current.length!==o&&(R.current=Array(o).fill().map((function(t,e){return R.current[e]||f()})));var i=0;M.forEach((function(t,o){var a=i,n=a+t.duration/j*Math.PI*2;t.name===m&&function(t,e,o,i,a,n){t.beginPath(),t.moveTo(e,o),t.arc(e,o,i-8,a,n),t.closePath();var r=t.createRadialGradient(e,o,5,e,o,i);r.addColorStop(0,"#3E4D5A00"),r.addColorStop(.3,"#3E4D5A00"),r.addColorStop(.6,"#3E4D5A4d"),r.addColorStop(.9,"#3E4D5Ab3"),t.fillStyle=r,t.fill()}(e,100,100,100,a,n);var r=R.current[o].current;r?(r.width=200,r.height=200,r.style.width="".concat(200,"px"),r.style.height="".concat(200,"px"),S&&(r.onmouseenter=O,r.onmouseleave=z,r.onmousemove=H),y(r.getContext("2d"),100,100,100,a,n,t.color||"#000000",!0)):y(e,100,100,100,a,n,t.color||"#000000",!0);i=n}))})),a("div",{className:w.root,children:[n("div",{className:g(w.backgroundRoot,t({},w.emptyStateBackground,!b.length)),children:n("div",{className:w.dropShadowRoot})}),a("div",{className:w.content,children:[n(l,{className:w.activityTimeRange,children:"Last 24hrs"}),b.length?a(r,{children:[n("div",{className:w.lastActivityRoot,children:B&&B.duration?a(l,{className:w.activityDuration,children:[(B.duration/3600).toFixed(1),n("span",{className:w.durationUnit,children:"h"})]}):null}),n(l,{className:w.activityName,children:o(m)})]}):n("div",{className:w.noOperationsRoot,children:n(x,{className:w.noOperationsText,children:"No operations"})})]}),n(d,{title:null!==I?"".concat(M[I].name,": ").concat((M[I].duration/3600).toFixed(3),"h"):"",placement:"bottom",children:a("div",{className:w.chart,children:[n("canvas",{ref:N,className:w.canvas}),M.map((function(t,e){return n("canvas",{ref:R.current[e],className:w.activities})}))]})})]})}S.propTypes={activities:m.arrayOf(m.shape({name:m.string,day:m.number,night:m.number})).isRequired,currentActivityName:m.string.isRequired,showTooltip:m.bool},S.defaultProps={showTooltip:!1};export default S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import a from"moment";import{upperFirst as t}from"lodash";import{convertValue as r,getUnitDisplay as n}from"../../utils/convert.js";import"../../constants/goals.js";import"../../constants/apps.js";import i from"../../utils/main.js";import"../../constants/completion.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/drillstring.js";import{DRILLING_WELL_SUMMARY as l,COMPLETION_WELL_SUMMARY as s,DRILLOUT_WELL_SUMMARY as c}from"../../constants/wellSummary.js";import"../../utils/drillstring/conversion.js";import{getBHASchematic as o}from"../../utils/drillstring/schematic.js";import{orDash as m}from"../../utils/formatting.js";import{jsxs as d,jsx as p,Fragment as u}from"react/jsx-runtime";import{makeStyles as h,Typography as f}from"@material-ui/core";import g from"prop-types";import y from"classnames";import v from"../Drillstring/BHASchematic.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentDetail/index.js";var N="/static/media/6684df900ff63f28b07f9c505fb7a66e.svg",k=h({value:{fontSize:"14px",fontWeight:500},valueSuffix:{color:"#9E9E9E"},hasLeftMargin:{marginLeft:4},bhaRoot:{display:"flex",alignItems:"center"},bhaIdRoot:{backgroundColor:"#2196F3",borderRadius:"50%",marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},realBhaRoot:{width:"16px",height:"16px"},bhaIdLabel:{fontWeight:500,fontSize:"12px"},dummyBhaIdLabel:{paddingLeft:"4px",paddingRight:"4px"},bhaActiveIndicator:{fontSize:"12px",padding:"4px",fontWeight:500},nptRoot:{display:"flex",alignItems:"center"},rectIndicator:{width:"8px",height:"8px",backgroundColor:"#D32F2F",borderRadius:"2px",marginRight:"8px"},stageActual:{fontSize:"16px"},stagePercent:{color:"#9E9E9E",marginLeft:"4px"},fluidProppantType:{color:"#9E9E9E"},valueWrapper:{display:"flex",alignItems:"center"},rightImg:{marginRight:"4px"},centerImg:{marginLeft:"4px",marginRight:"4px"},rotate:{transform:"rotate(180deg)"},profileRoot:{display:"flex",alignItems:"flex-start"},profile:{width:"20px",height:"20px",borderRadius:"50%",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px",backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"center"},plugsIcon:{marginLeft:-8}});function b(h){var g=h.item,b=h.summaryData,I=k();if(!b)return null;if(g.key===l.HOLE_DEPTH.key){var x=g.dataGetter(b).holeDepth;return Number.isFinite(x)?d("div",{className:I.valueWrapper,children:[p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:y(I.value,I.hasLeftMargin),children:[Math.floor(x),"’"]})]}):"-"}if(g.key===l.BIT_HOLE_DEPTH.key){var T=g.dataGetter(b),R=T.bitDepth,A=T.holeDepth;return[R,A].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/fa2667bad3591deb178e99b521571578.svg",alt:"bit_depth",className:I.rightImg}),d("span",{className:I.value,children:[Math.floor(R),"’ / "]}),p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:I.value,children:[Math.floor(A),"’"]})]}):"-"}if(g.key===l.DIVERGENCE.key){var E=g.dataGetter(b),S=E.distance,D=E.ahead,G=E.right;return[S,D,G].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("span",{className:I.value,children:"".concat(r(S,"length","ft")," ").concat(n("length"))}),p("img",{src:"/static/media/53cecdbd86f03352bda956fca25b537d.svg",alt:"up_arrow",className:y(I.centerImg,e({},I.rotate,D<0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(D,"length","ft"))," ").concat(n("length")," ").concat(D>0?"Ahead":"Behind")}),p("img",{src:"/static/media/d32edb0ff9a69145d2c7917855263251.svg",alt:"left_arrow",className:y(I.centerImg,e({},I.rotate,G>0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(G,"length","ft"))," ").concat(n("length")," ").concat(G>0?"Right":"Left")})]}):"-"}if(g.key===l.LAST_ACTIVE.key||g.key===s.LAST_ACTIVE.key){var L=g.dataGetter(b).timestamp;return p(f,{className:I.value,children:L?a.unix(L).format("MM/DD/YYYY HH:mm"):"-"})}if(g.key===l.CURRENT_ACTIVITY.key||g.key===s.CURRENT_ACTIVITY.key){var _=g.dataGetter(b).activityName;return p(f,{className:I.value,children:m(t(_||"-"))})}if(g.key===l.PHASE.key){var C=g.dataGetter(b).phaseName;return p(f,{className:I.value,children:m(C)})}if(g.key===l.HOLE_SECTION.key){var P=g.dataGetter(b).sectionName;return p(f,{className:I.value,children:m(P)})}if([l.MUD.key,c.MUD.key].includes(g.key)){var j=g.dataGetter(b),H=j.mudType,M=j.mudDensity;return p(f,{className:I.value,children:H||M?d(u,{children:[H&&"".concat(H,", "),M&&"".concat(r(M,"density","ppg")," ").concat(n("density"))]}):"-"})}if(g.key===l.NPT.key||g.key===s.NPT.key){var O=g.dataGetter(b),B=O.nptType,Y=O.startTime,F=O.endTime;return B&&Y&&F?d("div",{className:I.nptRoot,children:[p("div",{className:I.rectIndicator}),d(f,{className:I.value,children:[t(B),": ",((F-Y)/3600).fixFloat(1)," hr"]})]}):"-"}if(g.key===l.OPERATIONS_SUMMARY.key||g.key===s.OPERATIONS_SUMMARY.key){var U=g.dataGetter(b),W=U.dateTime,w=U.summary;return d(f,{className:I.value,children:[W?a.unix(W).format("MM/DD/YYYY HH:mm"):"-",p("br",{}),w]})}if(g.key===s.STAGE.key){var V=g.dataGetter(b),z=V.planned,q=V.actual;return q&&z?d(f,{className:I.value,children:[p("span",{className:I.stageActual,children:q
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import a from"moment";import{upperFirst as t}from"lodash";import{convertValue as r,getUnitDisplay as n}from"../../utils/convert.js";import"../../constants/goals.js";import"../../constants/apps.js";import i from"../../utils/main.js";import"../../constants/completion.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/drillstring.js";import{DRILLING_WELL_SUMMARY as l,COMPLETION_WELL_SUMMARY as s,DRILLOUT_WELL_SUMMARY as c}from"../../constants/wellSummary.js";import"../../utils/drillstring/conversion.js";import{getBHASchematic as o}from"../../utils/drillstring/schematic.js";import{orDash as m}from"../../utils/formatting.js";import{jsxs as d,jsx as p,Fragment as u}from"react/jsx-runtime";import{makeStyles as h,Typography as f}from"@material-ui/core";import g from"prop-types";import y from"classnames";import v from"../Drillstring/BHASchematic.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentDetail/index.js";var N="/static/media/6684df900ff63f28b07f9c505fb7a66e.svg",k=h({value:{fontSize:"14px",fontWeight:500},valueSuffix:{color:"#9E9E9E"},hasLeftMargin:{marginLeft:4},bhaRoot:{display:"flex",alignItems:"center"},bhaIdRoot:{backgroundColor:"#2196F3",borderRadius:"50%",marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},realBhaRoot:{width:"16px",height:"16px"},bhaIdLabel:{fontWeight:500,fontSize:"12px"},dummyBhaIdLabel:{paddingLeft:"4px",paddingRight:"4px"},bhaActiveIndicator:{fontSize:"12px",padding:"4px",fontWeight:500},nptRoot:{display:"flex",alignItems:"center"},rectIndicator:{width:"8px",height:"8px",backgroundColor:"#D32F2F",borderRadius:"2px",marginRight:"8px"},stageActual:{fontSize:"16px"},stagePercent:{color:"#9E9E9E",marginLeft:"4px"},fluidProppantType:{color:"#9E9E9E"},valueWrapper:{display:"flex",alignItems:"center"},rightImg:{marginRight:"4px"},centerImg:{marginLeft:"4px",marginRight:"4px"},rotate:{transform:"rotate(180deg)"},profileRoot:{display:"flex",alignItems:"flex-start"},profile:{width:"20px",height:"20px",borderRadius:"50%",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px",backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"center"},plugsIcon:{marginLeft:-8}});function b(h){var g=h.item,b=h.summaryData,I=k();if(!b)return null;if(g.key===l.HOLE_DEPTH.key){var x=g.dataGetter(b).holeDepth;return Number.isFinite(x)?d("div",{className:I.valueWrapper,children:[p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:y(I.value,I.hasLeftMargin),children:[Math.floor(x),"’"]})]}):"-"}if(g.key===l.BIT_HOLE_DEPTH.key){var T=g.dataGetter(b),R=T.bitDepth,A=T.holeDepth;return[R,A].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/fa2667bad3591deb178e99b521571578.svg",alt:"bit_depth",className:I.rightImg}),d("span",{className:I.value,children:[Math.floor(R),"’ / "]}),p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:I.value,children:[Math.floor(A),"’"]})]}):"-"}if(g.key===l.DIVERGENCE.key){var E=g.dataGetter(b),S=E.distance,D=E.ahead,G=E.right;return[S,D,G].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("span",{className:I.value,children:"".concat(r(S,"length","ft")," ").concat(n("length"))}),p("img",{src:"/static/media/53cecdbd86f03352bda956fca25b537d.svg",alt:"up_arrow",className:y(I.centerImg,e({},I.rotate,D<0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(D,"length","ft"))," ").concat(n("length")," ").concat(D>0?"Ahead":"Behind")}),p("img",{src:"/static/media/d32edb0ff9a69145d2c7917855263251.svg",alt:"left_arrow",className:y(I.centerImg,e({},I.rotate,G>0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(G,"length","ft"))," ").concat(n("length")," ").concat(G>0?"Right":"Left")})]}):"-"}if(g.key===l.LAST_ACTIVE.key||g.key===s.LAST_ACTIVE.key){var L=g.dataGetter(b).timestamp;return p(f,{className:I.value,children:L?a.unix(L).format("MM/DD/YYYY HH:mm"):"-"})}if(g.key===l.CURRENT_ACTIVITY.key||g.key===s.CURRENT_ACTIVITY.key){var _=g.dataGetter(b).activityName;return p(f,{className:I.value,children:m(t(_||"-"))})}if(g.key===l.PHASE.key){var C=g.dataGetter(b).phaseName;return p(f,{className:I.value,children:m(C)})}if(g.key===l.HOLE_SECTION.key){var P=g.dataGetter(b).sectionName;return p(f,{className:I.value,children:m(P)})}if([l.MUD.key,c.MUD.key].includes(g.key)){var j=g.dataGetter(b),H=j.mudType,M=j.mudDensity;return p(f,{className:I.value,children:H||M?d(u,{children:[H&&"".concat(H,", "),M&&"".concat(r(M,"density","ppg")," ").concat(n("density"))]}):"-"})}if(g.key===l.NPT.key||g.key===s.NPT.key){var O=g.dataGetter(b),B=O.nptType,Y=O.startTime,F=O.endTime;return B&&Y&&F?d("div",{className:I.nptRoot,children:[p("div",{className:I.rectIndicator}),d(f,{className:I.value,children:[t(B),": ",((F-Y)/3600).fixFloat(1)," hr"]})]}):"-"}if(g.key===l.OPERATIONS_SUMMARY.key||g.key===s.OPERATIONS_SUMMARY.key){var U=g.dataGetter(b),W=U.dateTime,w=U.summary;return d(f,{className:I.value,children:[W?a.unix(W).format("MM/DD/YYYY HH:mm"):"-",p("br",{}),w]})}if(g.key===s.STAGE.key){var V=g.dataGetter(b),z=V.planned,q=V.actual;return q&&z?d(f,{className:I.value,children:[p("span",{className:I.stageActual,children:q}),p("span",{children:"/"}),p("span",{children:z}),d("span",{className:I.stagePercent,children:["Stg ",Math.floor(q/z*100)," %"]})]}):"-"}if(g.key===s.FLUIDS.key){var J=g.dataGetter(b).fluids;return p("div",{children:0===J.length?"-":J.map((function(e){var a=e.type,t=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(r(t,"oil",i)," ").concat(n("oil"))})]},"".concat(a,"_").concat(t))}))})}if(g.key===s.PROPPANTS.key){var K=g.dataGetter(b).proppants;return p("div",{children:0===K.length?"-":K.map((function(e){var a=e.type,t=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(r(t,"mass",i)," ").concat(n("mass"))})]},"".concat(a,"_").concat(t))}))})}if(g.key===l.ALERT.key||g.key===s.ALERT.key){var Q=g.dataGetter(b).decisionPath;return p(f,{className:I.value,children:m(Q)})}if(g.key===l.ANNOTATION.key||g.key===s.ANNOTATION.key){var X=g.dataGetter(b),Z=X.firstName,$=X.lastName,ee=X.profilePhoto,ae=X.content,te="".concat(Z," ").concat($),re="".concat((Z||"").charAt(0)).concat(($||"").charAt(0));return ae?d("div",{className:I.profileRoot,children:[p("div",{className:I.profile,style:{backgroundColor:"#".concat(i.getColorFromString(te)),backgroundImage:"url(".concat(ee,")")},children:ee?null:re}),p(f,{className:I.value,children:ae})]}):"-"}if([l.BHA.key,c.BHA.key].includes(g.key)){var ne=c.BHA.key===g.key,ie=g.dataGetter(b),le=ie.bhaId,se=ie.components,ce=le&&String(le)||"-",oe=le&&o(se||[],ne)||[];return d("div",{className:I.bhaRoot,children:[p("div",{className:y(I.bhaIdRoot,e({},I.realBhaRoot,!ce.includes("."))),children:p(f,{className:y(I.bhaIdLabel,e({},I.dummyBhaIdLabel,ce.includes("."))),children:ce})}),p(v,{schematic:oe,containerHeight:20,containerWidth:120})]})}if(g.key===l.CASING.key){var me=g.dataGetter(b).outerDiameter;return me?p(f,{className:I.value,children:"".concat(r(me,"shortLength")," ").concat(n("shortLength"))}):null}if(g.key===l.BHA_COUNT.key){var de=g.dataGetter(b).count;return p(f,{className:I.value,children:m(de)})}if(g.key===s.STAGES_DESIGN.key){var pe=g.dataGetter(b).totalNumberOfStages;return Number.isFinite(pe)?d(f,{className:I.value,children:["-/",pe," ",p("span",{className:I.valueSuffix,children:"Stg"})]}):"-"}if(g.key===s.PLUGS_DRILLED_COUNT.key){var ue=g.dataGetter(b).plugsDrilledCount;return Number.isFinite(ue)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/b0c8b3ba66c35ef3128cc93c5c538060.svg",alt:"drillout",className:I.plugsIcon}),p("span",{className:y(I.value,I.hasLeftMargin),children:ue})]}):"-"}if("development"===process.env.NODE_ENV)throw new Error("".concat(g.key," wasn't handled in WellSummaryItemValue. Returning null"));return null}b.propTypes={item:g.shape({key:g.string,label:g.string,icon:g.node,dataGetter:g.func}).isRequired,summaryData:g.shape({}).isRequired};export default b;
|