@corva/ui 0.25.0-3 → 0.25.0-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLI/components/App/App.css.js +1 -1
- package/CLI/components/App/App.js +1 -1
- package/CLI/components/App/components/AppBar/AppBar.js +1 -1
- package/CLI/flags/index.js +1 -0
- package/CLI/hocs/constants.js +1 -0
- package/CLI/hocs/utils.js +1 -1
- package/CLI/hocs/withAppDataProviderHOC.js +1 -1
- package/CLI/hocs/withCorvaMagicHOC.js +1 -1
- package/CLI/hocs/withDevCenterRouterHOC.js +1 -1
- package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
- package/CLI/hocs/withMUIProvidersHOC.js +1 -1
- package/CLI/hocs/withPDFLayoutHOC.js +1 -0
- package/CLI/hocs/withReactRouterHOC.js +1 -1
- package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
- package/clients/api/apiCore.js +1 -1
- package/clients/clientStorage/core.js +1 -1
- package/components/Annotations/AnnotationsContext.js +1 -1
- package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
- package/components/Annotations/components/AnnotationsList/components/AnnotationComments/index.js +1 -1
- package/components/AssetEditor/effects/index.js +1 -1
- package/components/Attachment/index.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/utils/apiCalls.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/Breadcrumbs/index.js +1 -1
- package/components/CollapsableSidebar.js +1 -1
- package/components/Comment/index.js +1 -1
- package/components/CommentInput/index.js +1 -1
- package/components/DevCenter/AppHeader/AppHeader.js +1 -1
- package/components/DevCenter/AppHeader/PadMode.js +1 -1
- package/components/DevCenter/AppSideBar/AppSideBar.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/RemoveAppButton.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
- package/components/EmptyView/index.js +1 -1
- package/components/FileUploadIconButton.js +1 -1
- package/components/FilesLoader/FilesLoader.js +1 -1
- package/components/FilesLoader/partials/Icons/DocFileIcon.js +1 -0
- package/components/FilesLoader/partials/Icons/ExelFileIcon.js +1 -0
- package/components/FilesLoader/partials/Icons/IconCancel.js +1 -0
- package/components/FilesLoader/partials/Icons/IconSuccess.js +1 -0
- package/components/FilesLoader/partials/Icons/IconWarning.js +1 -0
- package/components/FilesLoader/partials/Icons/PdfFileIcon.js +1 -0
- package/components/FilesLoader/partials/Icons/UnknownFileIcon.js +1 -0
- package/components/FilesLoader/partials/UploadingFileState/FileLoadingProgress.js +1 -0
- package/components/InfiniteList/index.js +1 -1
- package/components/Notifications/NotificationsContainer.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/index.js +1 -1
- package/components/OffsetWellPickerV2/constants.js +1 -1
- package/components/OffsetWellPickerV2/effects/index.js +1 -1
- package/components/OffsetWellPickerV2/utils/apiCalls.js +1 -1
- package/components/PadModeSelect/PadModeSelect.js +1 -1
- package/components/ParameterCharts/AddEditTrack.js +1 -1
- package/components/ParameterCharts/components/Track.js +1 -1
- package/components/ParameterCharts/components/TrackSettings.js +1 -1
- package/components/PostPreviewDialog/index.js +1 -1
- package/components/SlateFormattedText/SlateFormattedText.js +1 -1
- package/components/SwitchControl/index.js +1 -1
- package/components/Template/TemplateSharingDialog/ChipSelector.js +1 -1
- package/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/components/WellSummary/WellSummaryItemValue.js +1 -1
- package/components/WellSummary/effects/useWellSummaryData.js +1 -1
- package/config/theme/index.js +1 -1
- package/constants/apps.js +1 -1
- package/constants/index.js +1 -1
- package/constants/theme.js +1 -0
- package/package.json +1 -1
- package/utils/DrillstringUtils.js +1 -1
- package/utils/FluidCheckUtils.js +1 -1
- package/utils/apps.js +1 -0
- package/utils/casing/conversion.js +1 -1
- package/utils/casing/validation.js +1 -1
- package/utils/completion.js +1 -1
- package/utils/dashboardReports.js +1 -0
- package/utils/devcenter.js +1 -1
- package/utils/index.js +1 -1
- package/utils/lasParser.js +1 -1
- package/utils/main.js +1 -1
- package/utils/torqueAndHookloadUtils.js +1 -1
- package/components/FilesLoader/constants.js +0 -1
- package/components/FilesLoader/effects/useUploadingFile.js +0 -1
- package/components/FilesLoader/partials/FileIcon/FileIcon.js +0 -1
- package/components/FilesLoader/partials/UploadingFileState/UploadingFileState.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import i from"@
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import i from"@material-ui/core/colors/grey";import a from"../../utils/main.js";import{isNativeDetected as o}from"../../utils/mobileDetect.js";import r from"@babel/runtime/helpers/createClass";import{jsx as s,jsxs as l,Fragment as n}from"react/jsx-runtime";import{Dialog as m}from"@material-ui/core";import{PureComponent as c}from"react";import{getFileDownloadLink as p}from"../../clients/jsonApi/index.js";import h from"prop-types";import{withStyles as d}from"@material-ui/core/styles";import u from"@babel/runtime/helpers/assertThisInitialized";import f from"@babel/runtime/helpers/inherits";import g from"@babel/runtime/helpers/possibleConstructorReturn";import v from"@babel/runtime/helpers/getPrototypeOf";import b from"@material-ui/core/Typography";import I from"@material-ui/core/IconButton";import w from"file-extension";import x from"image-extensions";import N from"../FileTypeIcon.js";import y from"video-extensions";import L from"react-player";import O from"@material-ui/icons/Image";import P from"@material-ui/icons/SaveAlt";import S from"@material-ui/icons/Fullscreen";import U from"../ImageViewer/index.js";import R from"../GoogleDocsViewer/index.js";import C from"./styles.css.js";function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=v(e);if(t){var o=v(this).constructor;i=Reflect.construct(a,arguments,o)}else i=a.apply(this,arguments);return g(this,i)}}var A=i[200],F=i[400],W=i[600],D={label:"small",value:135},j={label:"medium",value:300},k={fileImage:function(e,t){return{maxWidth:"100%",borderRadius:4,overflow:"hidden",maxHeight:t===D.label?D.value:j.value,display:e?"initial":"none",cursor:"pointer"}},fileDownloadWrapper:{marginTop:10,padding:"10px 10px 10px 5px",border:"1px solid ".concat(W),borderRadius:3,maxWidth:500,width:"75%"},imagePlaceholder:{position:"relative",backgroundColor:A,borderRadius:3,marginTop:10,height:135,width:135}},E=function(e){return l(n,{children:[l("div",{onClick:e.openLightbox,className:C.cAttachmentImg,children:[s("img",{"data-testid":"".concat("attachment","_preview"),src:e.attachmentUrl,style:k.fileImage(e.imageIsLoaded,e.size),alt:"Attachment",onLoad:e.setImageIsLoaded}),s("div",{className:C.cAttachmentImgPreviwBtn,children:s(S,{})})]}),!e.imageIsLoaded&&s("div",{style:k.imagePlaceholder,children:s(O,{className:e.classes.imageIconRoot,htmlColor:F,fontSize:"large"})}),e.lightboxIsOpen&&s(U,{mainSrc:e.attachmentUrl,imagePadding:50,onAfterOpen:e.handleLightboxOpen,onCloseRequest:e.handleLightboxClose})]})},T=function(e){return l("div",{className:C.cAttachmentFileWrapper,children:[l("div",{className:C.cAttachmentFileDownloadWrapper,style:k.fileDownloadWrapper,onClick:e.openPreview,children:[s(N,{fileName:e.displayName||e.attachmentUrl,className:C.cAttachmentFileDownloadWrapperFileIcon,size:e.small?25:50}),s("div",{"data-testid":"".concat("attachment","_name"),className:C.cAttachmentFileDownloadWrapperFileName,children:s(b,{variant:"subtitle2",noWrap:!0,className:e.classes.fileName,children:a.getFileNameWithExtensionFromPath(e.displayName||e.attachmentUrl)})}),s(m,{open:e.previewIsOpen,onClose:e.closePreview,classes:{root:e.classes.dialogRoot,paper:e.isNative?e.classes.nativeDialog:e.classes.dialog},children:s(R,{fileUrl:e.attachmentUrl,fileName:a.getFileNameWithExtensionFromPath(e.displayName||e.attachmentUrl),fileSize:e.attachmentSize,onClose:e.closePreview,width:"100%",height:"100%"})})]}),s("a",{download:e.displayName,href:e.attachmentUrl,className:C.cAttachmentFileDownloadWrapperForm,children:s(I,{"data-testid":"".concat("attachment","_downloadButton"),type:"submit",children:s(P,{className:e.classes.downloadIcon})})})]})},V=function(i){f(o,c);var a=z(o);function o(i){var r;t(this,o),r=a.call(this,i),e(u(r),"preventIOSScroll",(function(e){return e.preventDefault()})),e(u(r),"handleLightboxOpen",(function(){r.props.isNative&&document.documentElement.addEventListener("touchmove",r.preventIOSScroll,{passive:!1})})),e(u(r),"handleLightboxClose",(function(){r.props.isNative&&document.documentElement.removeEventListener("touchmove",r.preventIOSScroll),r.setState({lightboxIsOpen:!1})})),e(u(r),"openLightbox",(function(){return r.setState({lightboxIsOpen:!0})})),e(u(r),"setImageIsLoaded",(function(){return r.setState({imageIsLoaded:!0})})),e(u(r),"openPreview",(function(){return r.setState({previewIsOpen:!0})})),e(u(r),"closePreview",(function(e){e.stopPropagation(),r.setState({previewIsOpen:!1})})),r.state={imageIsLoaded:!1,lightboxIsOpen:!1,previewIsOpen:!1};var s=w(i.displayName||i.attachmentUrl);return r.isImage=x.includes(s),r.isVideo=y.includes(s),r}return r(o,[{key:"render",value:function(){return this.isImage?s("div",{className:C.cAttachment,children:s(E,{size:this.props.size,openLightbox:this.openLightbox,attachmentUrl:this.attachmentUrl,setImageIsLoaded:this.setImageIsLoaded,imageIsLoaded:this.state.imageIsLoaded,lightboxIsOpen:this.state.lightboxIsOpen,handleLightboxOpen:this.handleLightboxOpen,handleLightboxClose:this.handleLightboxClose,classes:this.props.classes})}):this.isVideo&&L.canPlay(this.props.attachmentUrl)?s("div",{className:C.cAttachment,children:s(L,{className:C.cAttachmentReactPlayer,url:this.attachmentUrl,config:{file:{attributes:{preload:"metadata"}}},controls:!0,height:this.props.size===D.label?D.value:j.value,width:null})}):s("div",{className:C.cAttachment,children:s(T,{attachmentUrl:this.attachmentUrl,attachmentSize:this.props.attachmentSize,displayName:this.props.displayName,isNative:this.props.isNative,openPreview:this.openPreview,closePreview:this.closePreview,previewIsOpen:this.state.previewIsOpen,classes:this.props.classes,small:this.props.small})})}},{key:"attachmentUrl",get:function(){return this.props.fileName?p(this.props.fileName):this.props.attachmentUrl}}]),o}();V.propTypes={attachmentUrl:h.string.isRequired,attachmentSize:h.number,displayName:h.string,fileName:h.string,size:h.oneOf([D.label,j.label]),classes:h.shape({}).isRequired,isNative:h.bool,small:h.bool},V.defaultProps={displayName:null,fileName:null,attachmentSize:void 0,size:j.label,small:!1,isNative:o};var q=d((function(e){return{imageIconRoot:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},dialog:{width:"95%",height:"95%",maxWidth:"100%",position:"relative"},nativeDialog:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0},dialogRoot:{backgroundColor:"rgba(0, 0, 0, 0.85)"},fileName:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},downloadIcon:{color:W,"&:hover":{color:e.palette.common.white}}}}))(V);export default q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import t from"lodash/get";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{withStyles as n,Tooltip as i,makeStyles as l,Chip as a,Input as c}from"@material-ui/core";import s from"@material-ui/icons/Close";import{useState as p,useRef as u}from"react";import f from"prop-types";import{withRouter as d}from"react-router";import{SEARCH_CATEGORIES as m,CATEGORY_KEY_VALUES as h}from"./constants.js";import x from"./AssetTypesSection.js";import g from"./AssetResultSection.js";import{useAssetsData as C}from"./effects/useAssetsData.js";var b=n((function(){return{tooltip:{backgroundColor:"#414141",color:"#ffffff",fontSize:"11px",lineHeight:"16px",borderRadius:"4px",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.12)",padding:"4px"}}}))(i),v=l((function(){return{wrapper:{width:"460px",display:"flex",flexDirection:"column",padding:16,minWidth:"376px"},inputWrapper:{display:"flex",width:"auto",margin:"0 8px 8px",alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},selectedChip:{height:"24px",margin:"4px"},selectedChipDeleteIcon:{width:"16px",height:"16px",color:"#BDBDBD","&:hover":{color:"#ffffff"}},closeIconButton:{padding:0,"&:hover $closeIcon":{color:"#fff"}},searchInput:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"2px solid #03BCD4"},closeIcon:{color:"#BDBDBD",fontSize:"18px"}}})),y=function(n){var i=n.onClickAsset,l=n.company,f=p(null),d=e(f,2),y=d[0],D=d[1],I=p(null),w=e(I,2),A=w[0],B=w[1],S=p(1),j=e(S,2),k=j[0],R=j[1],W=v(),N=u(),T=C(A,y,k,l),z=e(T,2),q=z[0],K=z[1];return o("div",{className:W.wrapper,children:[r("div",{className:W.inputWrapper,children:o("div",{className:W.searchInput,children:[y&&r(a,{"data-not-migrated-muichip":!0,classes:{root:W.selectedChip,deleteIcon:W.selectedChipDeleteIcon},label:t(m,[y,"labelPlural"],"Assets"),deleteIcon:r(s,{}),onDelete:function(){D(null),R(1)}}),r(c,{"data-testid":"".concat("AutoCompleteAssetSearch","_searchInput"),inputRef:N,autoFocus:!0,disableUnderline:!0,fullWidth:!0,value:A||"",placeholder:"Search ".concat(t(m,[y,"labelPlural"],"assets"),"..."),onChange:function(e){var t=e.target.value;B(t),R(1)},onKeyUp:function(t){var o=t.target.value,r=t.keyCode,n=h.find((function(t){var r=e(t,2);r[0];return r[1].autoCategorizedKey===o.trim().toLowerCase()}));if(n&&(13===r||32===r))return B(""),D(n[0]),void R(1);""===o&&8===r&&(D(null),R(1))}}),r(b,{title:"Clear",children:r(s,{className:W.selectedChipDeleteIcon,onClick:function(){N.current.focus(),B(""),D(null),R(1)}})})]})}),!y&&!A&&r(x,{onClickAssetType:function(e){N.current.focus(),D(e),R(1)}}),(y||A)&&r(g,{loading:q,page:k,groupedAssets:K,onClickAsset:i,onScrollReached:function(e){"top"===e&&k>1&&R((function(e){return e-1})),"bottom"===e&&R((function(e){return e+1}))}})]})};y.propTypes={company:f.number.isRequired,onClickAsset:f.func.isRequired};var D=d(y);export default D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import r from"lodash/get";import n from"@babel/runtime/regenerator";import a from"@babel/runtime/helpers/asyncToGenerator";import{getAssets as s,getRigs as i,getFracFleets as u,getDrilloutUnits as o}from"../../../../../../clients/jsonApi/index.js";import c from"jsona";import l from"lodash/concat";function p(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 f(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?p(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var b=new c;function m(){return d.apply(this,arguments)}function d(){return(d=a(n.mark((function e(){var t,a,i,u,o=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"well",a=o.length>1?o[1]:void 0,i=null,e.prev=3,e.next=6,s({types:["well"],company_id:a?+a:void 0,fields:["asset.name","asset.parent_asset_id","asset.parent_asset_name","asset.stats","asset.target_formation","asset.string_design","asset.root_asset_name","asset.basin","asset.county","asset.area","asset.visibility","asset.top_hole","asset.settings","well.settings"],per_page:1e4,sort:"name"});case 6:i=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.error(e.t0);case 12:return u=i?i.data.map((function(e){return{id:Number(e.id),name:r(e,"attributes.name"),rigId:r(e,"attributes.parent_asset_id")||"Null",rigName:r(e,"attributes.parent_asset_name")||"Null",formation:r(e,"attributes.target_formation")||"Null",stringDesign:r(e,"attributes.string_design")||"Null",programName:r(e,"attributes.root_asset_name")||"Null",basin:r(e,"attributes.basin")||"Null",county:r(e,"attributes.county")||"Null",area:r(e,"attributes.area")||"Null",visibility:r(e,"attributes.visibility"),topHole:r(e,"attributes.top_hole"),rigReleaseDate:r(e,"attributes.stats.well_end"),totalDepth:r(e,"attributes.stats.total_depth"),is_usable:!0,apiNumber:r(e,"attributes.settings.api_number","-")}})).filter((function(e){return"visible"===e.visibility})):[],e.abrupt("return",u.map((function(e){return{redirectAssetId:e.id,apiNumber:e.api_number,name:e.name,asset_id:e.id,type:t}})));case 14:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function _(e,t){return g.apply(this,arguments)}function g(){return(g=a(n.mark((function e(t,a){var s,u,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s={per_page:1e3,page:t,fields:["rig.name","rig.active_well","rig.asset_id"],sort:"name",company:a},e.prev=2,e.next=5,i(s);case 5:u=e.sent,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),u=[];case 12:return o=b.deserialize(u),e.abrupt("return",o.map((function(e){return f({redirectAssetId:r(e,["active_well","asset_id"])||null},e)})));case 14:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function y(e,t){return h.apply(this,arguments)}function h(){return(h=a(n.mark((function e(t,a){var s,i,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s={per_page:1e3,page:t,fields:["frac_fleet.name","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets"],sort:"name",company:a},e.prev=2,e.next=5,u(s);case 5:i=e.sent,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),i=[];case 12:return o=b.deserialize(i),e.abrupt("return",o.map((function(e){return f({redirectAssetId:r(e,["current_pad_id"])||null},e)})));case 14:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function v(e,t){return w.apply(this,arguments)}function w(){return(w=a(n.mark((function e(t,a){var s,i,u;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s={per_page:1e3,page:t,fields:["drillout_unit.name","drillout_unit.well"],sort:"name",company:a},e.prev=2,e.next=5,o(s);case 5:i=e.sent,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),i=[];case 12:return u=b.deserialize(i),e.abrupt("return",u.map((function(e){return f({redirectAssetId:r(e,["well","asset_id"])||null},e)})));case 14:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function x(e){return O.apply(this,arguments)}function O(){return(O=a(n.mark((function e(r){var a,s,i,u,o,c,p,f=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=f.length>1&&void 0!==f[1]?f[1]:1,s=f.length>2?f[2]:void 0,"well"!==r&&"api_number"!==r){e.next=7;break}return e.next=5,m(r,s);case 5:return i=e.sent,e.abrupt("return",i);case 7:if("rig"!==r){e.next=12;break}return e.next=10,_(a,s);case 10:return u=e.sent,e.abrupt("return",u);case 12:if("frac_fleet"!==r){e.next=17;break}return e.next=15,y(a,s);case 15:return o=e.sent,e.abrupt("return",o);case 17:if("drillout_unit"!==r){e.next=22;break}return e.next=20,v(a,s);case 20:return c=e.sent,e.abrupt("return",c);case 22:return e.next=24,Promise.all([m("well",s),_(a,s),y(a,s),v(a,s)]);case 24:return p=e.sent,e.abrupt("return",l.apply(void 0,t(p)));case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}export{x as fetchAllAssets,m as fetchWells};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/toConsumableArray";import{isEmpty as t}from"lodash";import{showSuccessNotification as r}from"../../../../utils/notificationToasts.js";import"../../../../utils/index.js";import{jsxs as o,jsx as i,Fragment as l}from"react/jsx-runtime";import{makeStyles as a,Typography as c,Tooltip as s,List as p}from"@material-ui/core";import{memo as d,Fragment as m}from"react";import{string as f,arrayOf as u,shape as g,func as h}from"prop-types";import w from"./AssetSearch.js";import x from"./SectionItem.js";import b from"./WellListItem.js";function y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function v(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var j=a({content:{marginTop:"10px"},sectionItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"6px 5px 6px 0px",fontSize:"12px",fontWeight:"normal",color:"#BDBDBD",borderTop:"1px solid grey"},disabledSectionItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"6px 5px 6px 0px",fontSize:"12px",fontWeight:"normal",color:"grey",borderTop:"1px solid grey"},splitLine:{paddingLeft:"5px",height:1,background:"grey"},itemLabelNumber:{marginLeft:"8px"},wellList:{width:"100%",margin:0,padding:0},tooltip:{background:"#201f1f",padding:"8px 12px"},arrow:{color:"#201f1f"},searchContainer:{display:"flex",justifyContent:"space-between",alignItems:"center"},advancedSearch:{fontSize:"14px",fontWeight:500,color:"#03BCD4",cursor:"pointer","&:hover":{textDecoration:"underline"}}});function S(e){var a=e.company,d=e.wellSections,f=e.getWellName,u=e.onChangeWellSections,g=e.onExploreMode,h=j(),y=function(e,n){var t=d.find((function(n){return n.name===e.name})).wells.map((function(e){return e.id})),r=d.map((function(e){var r=e.wells.map((function(e){return t.includes(e.id)?v(v({},e),{},{checked:n}):v({},e)}));return v(v({},e),{},{wells:r})}));u(r)},S=function(e){var n=d.map((function(n){return n.name===e.name?v(v({},n),{},{expanded:!n.expanded}):n}));u(n)},O=function(e){var n=d.map((function(n){var t=n.wells.map((function(n){return n.id===e.id?v(v({},n),{},{checked:!n.checked}):n}));return v(v({},n),{},{wells:t})}));u(n)},C=function(e){y(e,!0)},N=function(e){y(e,!1)};return o("div",{className:h.content,children:[o("div",{className:h.searchContainer,children:[i(w,{company:+a,onClickAsset:function(e,t){var o=d.map((function(r){if("Search Results"===r.name){var o=n(r.wells);return r.wells.find((function(n){return n.id===e}))||o.push({id:e,checked:!0,name:t,kind:"manual"}),v(v({},r),{},{wells:o})}return v(v({},r),{},{wells:r.wells.map((function(n){return n.id===e?v(v({},n),{},{checked:!0}):n}))})}));u(o),r("Offset well successfully added!")},onExploreMode:g}),i(c,{className:h.advancedSearch,onClick:function(){g()},children:"ADVANCED SEARCH"})]}),!t(d)&&o(l,{children:[d.map((function(e){return o(m,{children:[0===e.wells.length?i(s,{classes:{tooltip:h.tooltip,arrow:h.arrow},title:"No Best Wells in ".concat(e.name," Section"),placement:"top-start",arrow:!0,children:i("div",{className:h.disabledSectionItem,children:i(x,{section:e,disabled:!0},"empty-".concat(e.name))})}):i("div",{className:h.sectionItem,children:i(x,{section:e,onExpandCollapse:S,onSelectAll:C,onClearAll:N},"section-".concat(e.name))}),i(p,{dense:!0,className:h.wellList,children:e.expanded&&e.wells.map((function(n,t){return i(b,{noMarginTop:0!==t,well:n,wellName:f(e.wells,n.id),rigName:n.rigName,onToggleWell:O},"well-".concat(e.name,"-").concat(n.id))}))})]},"fragment-".concat(e.name))})),i("div",{className:h.splitLine})]})]})}S.propTypes={company:f.isRequired,wellSections:u(g({})),getWellName:h.isRequired,onChangeWellSections:h.isRequired,onExploreMode:h.isRequired},S.defaultProps={wellSections:[]};var O=d(S);export default O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{get as t,uniq as n,includes as r,isEqual as i}from"lodash";import o from"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/helpers/toConsumableArray";import"../../constants/goals.js";import"../../constants/apps.js";import"../../constants/completion.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/drillstring.js";import"../../utils/mobileDetect.js";import l from"@babel/runtime/helpers/typeof";import"../../utils/index.js";import{jsxs as a,Fragment as p,jsx as m}from"react/jsx-runtime";import{makeStyles as c,Dialog as d,DialogTitle as u,Typography as f,Tooltip as j,IconButton as C,DialogContent as b,DialogActions as v,Button as g}from"@material-ui/core";import{useRef as x,useState as h,useMemo as S,useEffect as y,useCallback as A}from"react";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import I from"prop-types";import W from"classnames";import{Close as D}from"@material-ui/icons";import"../Modal/index.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import E from"../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"../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"../TruncatedText/index.js";import"../AssetEditor/SingleAssetEditor.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/index.js";import"../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"../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{useWells as B,useFetchBicWellsData as P}from"./effects/index.js";import T from"./components/Map/index.js";import w from"./components/WellSection/index.js";import{DEFAULT_WELL_SECTIONS as k}from"./constants.js";import L from"../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 O(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 M(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?O(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var N=c({paper:{width:"541px"},dialogTitles:{display:"flex",flexDirection:"column"},titleContent:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},title:{fontSize:"20px"},description:{fontSize:"12px",lineHeight:"16px",fontWeight:"normal",color:"rgba(255, 255, 255, 0.54)"},closeIconButton:{fontSize:"20px",padding:4,"&:hover $closeIcon":{color:"#fff"}},closeIcon:{color:"#BDBDBD"},dialogActions:{display:"flex",justifyContent:"flex-end",boxShadow:"0px -4px 10px rgba(0, 0, 0, 0.25)",paddingTop:8,paddingBottom:8},dialogActionsSmallScreen:{paddingRight:"100px"},dialogContent:{display:"flex",marginTop:"2px",marginBottom:"24px",flexDirection:"column"}});function F(e,n){var r=e.find((function(e){return e.id===n}));return t(r,"name")||"-"}function R(e,n){var r=e.find((function(e){return e.id===n}));return t(r,"rigName")||"-"}function V(e,t){return"well"===e.value?"Best Wells":"area"===e.value?"Area Offsets":"Best ".concat(e.value,"section"===t?" Wells":' " Wells')}function H(e){return e.map((function(e){return M(M({},e),{},{wells:e.wells.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}))})}))}function U(e){var r=t(e,"bicWellIds")||[],i=t(e,"manualWellIds")||[],o=t(e,"selectedWellIds")||[];return n(r.concat(i).concat(o))}function z(e){var c=e.defaultSubjectWell,I=e.offsetSetting,O=e.currentUser,z=e.isOpen,_=e.onClose,q=e.onSave,G=e.addWellsUsabilityInfo,K=e.unusableWellAlarm,Q=N(),$=x(!0),J=h(t(c,"companyId")||t(I,"companyId")||+t(O,"company_id")),X=o(J,2),Y=X[0],Z=X[1],ee=h(t(c,"asset_id")||t(I,"subjectWellId")||null),te=o(ee,2),ne=te[0],re=te[1],ie=B(Y,z),oe=P(ne,z),se=h([]),le=o(se,2),ae=le[0],pe=le[1],me=h(!1),ce=o(me,2),de=ce[0],ue=ce[1],fe=h(I),je=o(fe,2),Ce=je[0],be=je[1],ve=h(!1),ge=o(ve,2),xe=ge[0],he=ge[1],Se=S((function(){if(ie){var e=U(Ce);return ie.filter((function(n){return e.find((function(e){return e===t(n,"id")}))}))}return[]}),[ie,Ce]);y((function(){z&&(Z(t(c,"companyId")||t(I,"companyId")||+t(O,"company_id")),re(t(c,"asset_id")||t(I,"subjectWellId")||null),be(I),he(!1),$.current=!0)}),[I,z]),y((function(){if(z&&ie&&$.current){var e,i=t(Ce,"selectedWellIds")||[],o=t(Ce,"manualWellIds")||[],a=t(Ce,"bicWellIds")||[],p=i.concat(o),m=p.filter((function(e){return ie.find((function(t){return t.id===e}))})).map((function(e){return{id:e,checked:!0,name:F(ie,e),rigName:R(ie,e),kind:i.includes(e)?"advanced":"manual"}}));if(oe&&oe.filters&&oe.result){var c,d=[],u=[{name:"Wells within Area",value:"area"}].concat(s(t(oe,["filters","filterTabs"]))),f=(null===(c=oe.filters)||void 0===c?void 0:c.filterMode)||"holeSize",j=n(u);e=[{name:"Search Results",wells:m,expanded:xe}].concat(s(j.map((function(e){var t;return{name:V(e,f),wells:(null===(t=oe.result[e.value])||void 0===t?void 0:t.filter((function(e){return ie.find((function(t){return t.id===e}))})).map((function(e){var t="object"===l(e)?e.id:e;return d.push(t),{id:t,checked:!1,name:F(ie,t),rigName:R(ie,t),kind:"best"}})))||[],expanded:!1}}))))}else e=[{name:"Search Results",wells:m,expanded:xe}].concat(s(k));var C=e.map((function(e){var t=e.wells.map((function(e){return r(a,e.id)||r(p,e.id)?M(M({},e),{},{checked:!0}):M({},e)}));return M(M({},e),{},{wells:t})}));pe(H(C))}}),[z,ie,oe,Ce]);var ye=A((function(){return U(Ce).length}),[Ce]),Ae=A((function(){return(t(Ce,"bicWellIds")||[]).length})),Ie=!ie;return a(p,{children:[a(d,{onBackdropClick:_,onEscapeKeyDown:_,open:z,classes:{paper:Q.paper},children:[m(u,{children:a("div",{className:Q.dialogTitles,children:[a("div",{className:Q.titleContent,children:[m(f,{className:Q.title,children:"Select Offset Wells"}),m(j,{title:"Close",children:m(C,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:Q.closeIconButton,onClick:_,children:m(D,{className:Q.closeIcon})})})]}),m("div",{className:Q.description,children:"Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well Selection Application."})]})}),m(b,{className:Q.dialogContent,children:Ie?m(E,{fullscreen:!1}):a(p,{children:[m(T,{wells:Se,offsetWells:Se}),m(w,{company:Y,wellSections:ae,getWellName:F,onChangeWellSections:function(e){var t=H(e);pe(t),he(t[0].expanded);var r=[],i=[],o=[];t.forEach((function(e){e.wells.forEach((function(e){e.checked&&"advanced"===e.kind&&r.push(e.id),e.checked&&"manual"===e.kind&&i.push(e.id),e.checked&&"best"===e.kind&&o.push(e.id)}))}));var s=r.concat(i).concat(o),l=M(M({},Ce),{},{selectedWellIds:n(r),manualWellIds:n(i),bicWellIds:n(o),resultWellIds:n(s)});be(l),$.current=!1},onExploreMode:function(){ue(!0)}})]})}),m(v,{className:W(Q.dialogActions),children:a("div",{children:[m(g,{onClick:_,color:"primary",children:"Cancel"}),a(g,{variant:"contained",color:"primary",onClick:function(){var e=U(Ce),t=ie.filter((function(t){return r(e,t.id)})),n=M(M({},Ce),{},{companyId:+Y,resultWellIds:e});ue(!1),q(n,t)},children:["Add (",ye(),")"]})]})})]}),de&&m(L,{defaultSubjectWellId:t(c,"asset_id"),companyId:+Y,offsetSetting:Ce,currentUser:O,addWellsUsabilityInfo:G,unusableWellAlarm:K,isAdvancedSearch:!0,bestCount:Ae(),isOpen:de,onClose:function(){ue(!1)},onSave:function(e){var n=e;c||(i(ne,t(n,"subjectWellId"))&&i(Y,t(n,"companyId"))||(n=M(M({},n),{},{bicWellIds:[],manualWellIds:[],resultWellIds:[]})),re(t(n,"subjectWellId")),Z(t(n,"companyId")));var r=t(n,"manualWellIds")||[],o=t(n,"selectedWellIds")||[];r=r.filter((function(e){return!o.includes(e)})),n=M(M({},n),{},{manualWellIds:r}),be(n),$.current=!0,he(!0),ue(!1)}})]})}z.propTypes={defaultSubjectWell:I.shape({}),offsetSetting:I.shape({subjectWellId:I.number,companyId:I.number}),currentUser:I.shape({}),isOpen:I.bool.isRequired,onClose:I.func.isRequired,onSave:I.func.isRequired,addWellsUsabilityInfo:I.func,unusableWellAlarm:I.string},z.defaultProps={defaultSubjectWell:null,addWellsUsabilityInfo:null,unusableWellAlarm:"Unable to add",offsetSetting:{},currentUser:{}};export default z;
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import"../../constants/completion.js";import"../../constants/alerts.js";import{get as n,uniq as r,includes as i,isEqual as o}from"lodash";import s from"@babel/runtime/helpers/slicedToArray";import"../../constants/goals.js";import"../../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 l from"@babel/runtime/helpers/typeof";import"../../utils/index.js";import{jsxs as a,Fragment as p,jsx as m}from"react/jsx-runtime";import{makeStyles as c,Dialog as d,DialogTitle as u,Typography as f,Tooltip as j,IconButton as C,DialogContent as b,DialogActions as v,Button as g}from"@material-ui/core";import{useRef as x,useState as h,useMemo as S,useEffect as y,useCallback as A}from"react";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import I from"prop-types";import W from"classnames";import{Close as D}from"@material-ui/icons";import"../Modal/index.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import E from"../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"../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"../TruncatedText/index.js";import"../AssetEditor/SingleAssetEditor.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/index.js";import"../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"../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{useWells as B,useFetchBicWellsData as P}from"./effects/index.js";import T from"./components/Map/index.js";import w from"./components/WellSection/index.js";import{DEFAULT_WELL_SECTIONS as k}from"./constants.js";import L from"../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 O(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 M(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?O(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var N=c({paper:{width:"541px"},dialogTitles:{display:"flex",flexDirection:"column"},titleContent:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},title:{fontSize:"20px"},description:{fontSize:"12px",lineHeight:"16px",fontWeight:"normal",color:"rgba(255, 255, 255, 0.54)"},closeIconButton:{fontSize:"20px",padding:4,"&:hover $closeIcon":{color:"#fff"}},closeIcon:{color:"#BDBDBD"},dialogActions:{display:"flex",justifyContent:"flex-end",boxShadow:"0px -4px 10px rgba(0, 0, 0, 0.25)",paddingTop:8,paddingBottom:8},dialogActionsSmallScreen:{paddingRight:"100px"},dialogContent:{display:"flex",marginTop:"2px",marginBottom:"24px",flexDirection:"column"}});function F(e,t){var r=e.find((function(e){return e.id===t}));return n(r,"name")||"-"}function R(e,t){var r=e.find((function(e){return e.id===t}));return n(r,"rigName")||"-"}function V(e,t){return"well"===e.value?"Best Wells":"area"===e.value?"Area Offsets":"Best ".concat(e.value,"section"===t?" Wells":' " Wells')}function H(e){return e.map((function(e){return M(M({},e),{},{wells:e.wells.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}))})}))}function U(e){var t=n(e,"bicWellIds")||[],i=n(e,"manualWellIds")||[],o=n(e,"selectedWellIds")||[];return r(t.concat(i).concat(o))}function z(e){var c=e.defaultSubjectWell,I=e.offsetSetting,O=e.currentUser,z=e.isOpen,_=e.onClose,q=e.onSave,G=e.addWellsUsabilityInfo,K=e.unusableWellAlarm,Q=N(),$=x(!0),J=h(n(c,"companyId")||n(I,"companyId")||+n(O,"company_id")),X=s(J,2),Y=X[0],Z=X[1],ee=h(n(c,"asset_id")||n(I,"subjectWellId")||null),te=s(ee,2),ne=te[0],re=te[1],ie=B(Y,z),oe=P(ne,z),se=h([]),le=s(se,2),ae=le[0],pe=le[1],me=h(!1),ce=s(me,2),de=ce[0],ue=ce[1],fe=h(I),je=s(fe,2),Ce=je[0],be=je[1],ve=h(!1),ge=s(ve,2),xe=ge[0],he=ge[1],Se=S((function(){if(ie){var e=U(Ce);return ie.filter((function(t){return e.find((function(e){return e===n(t,"id")}))}))}return[]}),[ie,Ce]);y((function(){z&&(Z(n(c,"companyId")||n(I,"companyId")||+n(O,"company_id")),re(n(c,"asset_id")||n(I,"subjectWellId")||null),be(I),he(!1),$.current=!0)}),[I,z]),y((function(){if(z&&ie&&$.current){var e,o=n(Ce,"selectedWellIds")||[],s=n(Ce,"manualWellIds")||[],a=n(Ce,"bicWellIds")||[],p=o.concat(s),m=p.filter((function(e){return ie.find((function(t){return t.id===e}))})).map((function(e){return{id:e,checked:!0,name:F(ie,e),rigName:R(ie,e),kind:o.includes(e)?"advanced":"manual"}}));if(oe&&oe.filters&&oe.result){var c,d=[],u=[{name:"Wells within Area",value:"area"}].concat(t(n(oe,["filters","filterTabs"]))),f=(null===(c=oe.filters)||void 0===c?void 0:c.filterMode)||"holeSize",j=r(u);e=[{name:"Search Results",wells:m,expanded:xe}].concat(t(j.map((function(e){var t;return{name:V(e,f),wells:(null===(t=oe.result[e.value])||void 0===t?void 0:t.filter((function(e){return ie.find((function(t){return t.id===e}))})).map((function(e){var t="object"===l(e)?e.id:e;return d.push(t),{id:t,checked:!1,name:F(ie,t),rigName:R(ie,t),kind:"best"}})))||[],expanded:!1}}))))}else e=[{name:"Search Results",wells:m,expanded:xe}].concat(t(k));var C=e.map((function(e){var t=e.wells.map((function(e){return i(a,e.id)||i(p,e.id)?M(M({},e),{},{checked:!0}):M({},e)}));return M(M({},e),{},{wells:t})}));pe(H(C))}}),[z,ie,oe,Ce]);var ye=A((function(){return U(Ce).length}),[Ce]),Ae=A((function(){return(n(Ce,"bicWellIds")||[]).length})),Ie=!ie;return a(p,{children:[a(d,{onBackdropClick:_,onEscapeKeyDown:_,open:z,classes:{paper:Q.paper},children:[m(u,{children:a("div",{className:Q.dialogTitles,children:[a("div",{className:Q.titleContent,children:[m(f,{className:Q.title,children:"Select Offset Wells"}),m(j,{title:"Close",children:m(C,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:Q.closeIconButton,onClick:_,children:m(D,{className:Q.closeIcon})})})]}),m("div",{className:Q.description,children:"Quickly add all of the Best-In-Class Wells per section selected from the Offsets Well Selection Application."})]})}),m(b,{className:Q.dialogContent,children:Ie?m(E,{fullscreen:!1}):a(p,{children:[m(T,{wells:Se,offsetWells:Se}),m(w,{company:Y,wellSections:ae,getWellName:F,onChangeWellSections:function(e){var t=H(e);pe(t),he(t[0].expanded);var n=[],i=[],o=[];t.forEach((function(e){e.wells.forEach((function(e){e.checked&&"advanced"===e.kind&&n.push(e.id),e.checked&&"manual"===e.kind&&i.push(e.id),e.checked&&"best"===e.kind&&o.push(e.id)}))}));var s=n.concat(i).concat(o),l=M(M({},Ce),{},{selectedWellIds:r(n),manualWellIds:r(i),bicWellIds:r(o),resultWellIds:r(s)});be(l),$.current=!1},onExploreMode:function(){ue(!0)}})]})}),m(v,{className:W(Q.dialogActions),children:a("div",{children:[m(g,{onClick:_,color:"primary",children:"Cancel"}),a(g,{variant:"contained",color:"primary",onClick:function(){var e=U(Ce),t=ie.filter((function(t){return i(e,t.id)})),n=M(M({},Ce),{},{companyId:+Y,resultWellIds:e});ue(!1),q(n,t)},children:["Add (",ye(),")"]})]})})]}),de&&m(L,{defaultSubjectWellId:n(c,"asset_id"),companyId:+Y,offsetSetting:Ce,currentUser:O,addWellsUsabilityInfo:G,unusableWellAlarm:K,isAdvancedSearch:!0,bestCount:Ae(),isOpen:de,onClose:function(){ue(!1)},onSave:function(e){var t=e;c||(o(ne,n(t,"subjectWellId"))&&o(Y,n(t,"companyId"))||(t=M(M({},t),{},{bicWellIds:[],manualWellIds:[],resultWellIds:[]})),re(n(t,"subjectWellId")),Z(n(t,"companyId")));var r=n(t,"manualWellIds")||[],i=n(t,"selectedWellIds")||[];r=r.filter((function(e){return!i.includes(e)})),t=M(M({},t),{},{manualWellIds:r}),be(t),$.current=!0,he(!0),ue(!1)}})]})}z.propTypes={defaultSubjectWell:I.shape({}),offsetSetting:I.shape({subjectWellId:I.number,companyId:I.number}),currentUser:I.shape({}),isOpen:I.bool.isRequired,onClose:I.func.isRequired,onSave:I.func.isRequired,addWellsUsabilityInfo:I.func,unusableWellAlarm:I.string},z.defaultProps={defaultSubjectWell:null,addWellsUsabilityInfo:null,unusableWellAlarm:"Unable to add",offsetSetting:{},currentUser:{}};export default z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import"
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/toConsumableArray";import"../../constants/completion.js";import"../../constants/alerts.js";import"lodash";import"@babel/runtime/helpers/slicedToArray";import"../../constants/goals.js";import"../../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{jsx as e}from"react/jsx-runtime";import{makeStyles as r,Breadcrumbs as o}from"@material-ui/core";import"react";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import i from"prop-types";import n from"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{UniversalLink as s}from"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.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"../TruncatedText/index.js";import"../AssetEditor/SingleAssetEditor.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/index.js";import"../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"../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"../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 p=r((function(t){return{container:{fontSize:"0.8125rem"},pathPart:{color:t.palette.grey[400],"&:hover":{color:"white"}},lastPathPart:{color:"white"}}})),m=function(r){var i=r.pathItems,m=p();return e(o,{className:m.container,children:i.map((function(r,o,i){return e(s,{className:n(m.pathPart,t({},m.lastPathPart,o===i.length-1)),href:r.href,children:r.text},r.text)}))})};m.propTypes={pathItems:i.arrayOf(i.shape({text:i.string,href:i.string})).isRequired};export default m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/toConsumableArray";import"../constants/completion.js";import"../constants/alerts.js";import{noop as t}from"lodash";import o from"@babel/runtime/helpers/slicedToArray";import"../constants/goals.js";import"../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 r,jsx as i}from"react/jsx-runtime";import{withStyles as n,Box as s,IconButton as p}from"@material-ui/core";import{useState as a}from"react";import"querystring";import"uuid/v1";import"../clients/jsonApi/index.js";import"../clients/subscriptions.js";import"uuid";import"@babel/runtime/helpers/objectWithoutProperties";import m from"prop-types";import l from"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"./ConfirmationDialog.js";import"./Annotations/components/AnnotationsList/index.js";import"./Annotations/components/LastAnnotation/index.js";import"./PadModeSelect/PadModeSelect.js";import"./DevCenter/AppHeader/AppHeader.js";import d from"@material-ui/icons/ChevronLeftRounded";import c from"@material-ui/icons/ChevronRightRounded";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 j from"./DevCenter/SideBar/SideBar.js";import"./TruncatedText/index.js";import"./AssetEditor/SingleAssetEditor.js";import"./AssetEditor/AssetEditorAutocomplete.js";import"./AssetEditor/index.js";import"./AppVersionsSelect/AppVersionsSelect.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"./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 C=function(t){var n,m=t.classes,C=t.children,u=t.onStateChange,g=t.initialState,x=t.drawerPaperClassName,h=t.isToolbarGutterShown,b=t.openedDrawerWidth,A=t.anchor,f=a(g),D=o(f,2),S=D[0],v=D[1],T=function(){v(!S),u(!S)},y="left"===A?d:c;return r(j,{isToolbarGutterShown:h,drawerWidth:b,drawerClassName:l(m.drawer,!S&&m.drawerClosed),drawerPaperClassName:l(m.drawer,m.drawerPaper,x,!S&&m.drawerClosed),anchor:A,listClassName:m.list,onClick:function(){S||T()},children:[C,i(s,{className:l(m.openToggleContainer,(n={},e(n,m.openToggleContainerCollapsed,!S),e(n,m.openToggleContainerOpened,S),n)),children:i(p,{"aria-label":"toggle sidebar",className:m.openToggleIconButton,onClick:T,children:i(y,{className:l(m.openToggleIcon,e({},m.openToggleIconClosed,!S))})})})]})};C.propTypes={children:m.node.isRequired,onStateChange:m.func,initialState:m.bool,drawerPaperClassName:m.string,isToolbarGutterShown:m.bool,openedDrawerWidth:m.oneOfType([m.string,m.number]),anchor:m.oneOf(["left","right"]),closedWidth:m.oneOfType([m.string,m.number])},C.defaultProps={onStateChange:t,initialState:!0,closedWidth:48,drawerPaperClassName:null,isToolbarGutterShown:void 0,openedDrawerWidth:void 0,anchor:void 0};var u=n((function(e){return{drawer:{display:"flex",flexDirection:"column",height:"100%"},drawerPaper:{"&$drawerClosed":{cursor:"pointer","&:hover::before":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,background:e.palette.background.b7}}},drawerClosed:{width:function(e){return e.closedWidth}},openToggleIcon:{fontSize:"1.25rem",color:e.palette.primary.text7},openToggleIconClosed:{transform:"rotate(180deg)"},openToggleIconButton:{padding:6},openToggleContainer:{display:"flex",position:"absolute",bottom:0,width:"100%",flex:"0 0",padding:e.spacing(2,1,1.5)},openToggleContainerCollapsed:{paddingRight:e.spacing(1),paddingLeft:e.spacing(1),justifyContent:"center"},openToggleContainerOpened:{justifyContent:function(e){return"left"===e.anchor?"flex-end":"flex-start"}},list:{display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden",paddingBottom:60}}}))(C);export default u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"moment";import{noop as r,get as n}from"lodash";import o from"@babel/runtime/helpers/classCallCheck";import i from"@babel/runtime/regenerator";import a from"@babel/runtime/helpers/asyncToGenerator";import s from"@material-ui/core/colors/grey";import c from"../../utils/main.js";import{isNativeDetected as m}from"../../utils/mobileDetect.js";import l from"@babel/runtime/helpers/createClass";import{jsxs as p,jsx as u}from"react/jsx-runtime";import{createRef as d,PureComponent as h}from"react";import{deleteFeedItemComment as f}from"../../clients/jsonApi/index.js";import g from"prop-types";import y from"classnames";import{withStyles as v}from"@material-ui/core/styles";import b from"@babel/runtime/helpers/assertThisInitialized";import C from"@babel/runtime/helpers/inherits";import D from"@babel/runtime/helpers/possibleConstructorReturn";import M from"@babel/runtime/helpers/getPrototypeOf";import E from"../Avatar/index.js";import w from"@material-ui/core/Typography";import I from"../UserCardPopover.js";import{formatMentionText as O}from"../UserMention/utils/index.js";import{isUserAdmin as j,isUserCorvaAdmin as k}from"../../utils/user.js";import x from"@material-ui/core/IconButton";import A from"@material-ui/icons/MoreVert";import N from"../ConfirmationDialog.js";import S from"../Attachment/index.js";import _ from"../CommentInput/index.js";import R from"../CommentWrapper.js";import P from"../CommentLoader.js";import T from"@material-ui/core/Menu";import U from"@material-ui/core/MenuItem";import z from"./styles.css.js";function L(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 W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=M(e);if(t){var o=M(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}var B={chatAvatarWrapper:{paddingTop:2,position:"absolute",top:6,left:-18},commentInfoContainer:{display:"inline-flex",alignItems:"center",width:"100%",paddingTop:5},userNameWrapper:{overflow:"hidden"},infoContainer:{display:"inline-block",verticalAlign:"top",width:"100%",paddingLeft:10}},q={commentWrapper:{width:"calc(100% - 10px)"},timeRoot:{color:s[700],float:"right",marginRight:5,marginLeft:10,fontSize:"10px"},textRoot:{marginTop:5,color:"#CCC",fontWeight:"normal",fontSize:"14px"},iconButtonRoot:{float:"right",height:40,width:40,padding:0,visibility:"hidden"},userName:{fontSize:"12px"}},F=function(m){C(v,h);var g=W(v);function v(t){var r,n;return o(this,v),r=g.call(this,t),e(b(r),"deleteComment",(n=a(i.mark((function e(t,r){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f(t,r);case 3:n=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0);case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,t){return n.apply(this,arguments)})),e(b(r),"showIntoView",(function(){r.props.handleShowOnMount(),r.commentEl.current.scrollIntoView({block:"end"})})),e(b(r),"handleToggleActionsMenu",(function(e){var t=e.currentTarget;r.setState((function(e){return{actionsMenuAnchorEl:e.actionsMenuAnchorEl?null:t}}))})),e(b(r),"handleKeyDown",(function(e){27===e.keyCode&&r.setState({isEditing:!1}),document.removeEventListener("keydown",r.handleKeyDown,!1)})),e(b(r),"handleEditMenuItem",(function(){document.addEventListener("keydown",r.handleKeyDown,!1),r.setState({isEditing:!0},(function(){r.inputEl.current&&r.inputEl.current.focus()}))})),e(b(r),"getEditCommentProps",(function(){var e=r.props.comment,t=e.id,n=e.body,o=e.attachment;return{editFeedItemId:e.feed_activity_id,editCommentId:t,editComment:n,editAttachment:o}})),e(b(r),"onEditFinish",(function(){r.setState({isEditing:!1,isLoading:!1})})),e(b(r),"handleDeleteMenuItem",(function(){r.setState({openDeleteDialog:!0})})),e(b(r),"handleDelete",a(i.mark((function e(){var t,n,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.props.comment.id,n=r.props.comment.feed_activity_id,r.setState({isLoading:!0}),e.next=5,r.deleteComment(n,t);case 5:o=e.sent,r.setState({isLoading:!1,openDeleteDialog:!1}),o&&r.props.handleDeleteCallback(t);case 8:case"end":return e.stop()}}),e)})))),r.state={actionsMenuAnchorEl:null,isLoading:!1,isEditing:!1,openDeleteDialog:!1},r.inputEl=d(),r.commentEl=d(),r}return l(v,[{key:"componentDidMount",value:function(){this.props.showOnMount&&this.showIntoView()}},{key:"renderMenuIcon",value:function(){var e=this.isCurrentUserCommentCreator,t=this.isCurrentUserCommentCreator||j(this.props.user)||k(this.props.user);return t||e?p("div",{className:z.cCommentMenu,children:[u(x,{"data-testid":"".concat("comment","_menuButton"),"aria-label":"Actions","aria-owns":this.state.actionsMenuAnchorEl?"c-comment__actions-menu":void 0,"aria-haspopup":"true",classes:{root:this.props.classes.iconButtonRoot},onClick:this.handleToggleActionsMenu,children:u(A,{htmlColor:s[400]})}),p(T,{id:"c-comment__actions-menu",anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:this.state.actionsMenuAnchorEl,open:!!this.state.actionsMenuAnchorEl,onClick:this.handleToggleActionsMenu,children:[e&&u(U,{"data-testid":"".concat("comment","_editMenuItem"),onClick:this.handleEditMenuItem,children:"Edit"}),t&&u(U,{"data-testid":"".concat("comment","_deleteMenuItem"),onClick:this.handleDeleteMenuItem,children:"Delete"})]})]}):null}},{key:"render",value:function(){var o=this,i=this.state,a=i.isLoading,s=i.isEditing;if(a){var m=this.props.spaceAround;return u(P,{spaceAround:m})}var l=this.props,d=l.comment,h=l.classes,f=l.spaceAround,g=l.isNative,v=l.patchCommentCallback,b=l.companyId;if(s)return u(_,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?L(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({inputRef:this.inputEl,postComment:r,exitEditMode:this.onEditFinish,setIsEditting:function(){return o.setState({isLoading:!0})},patchCommentCallback:v,companyId:b},this.getEditCommentProps()));var C=c.getUserFullName(d.user),D=g?"MM/DD HH:mm":"MM/DD/YY HH:mm",M=t(d.created_at).format(D),j=n(d,["attachment","url"]),k=n(d,["attachment","size"]);return p("div",{"data-testid":"".concat("comment","_commentItem_").concat(d.body),className:y(z.cComment,e({},z.cCommentNative,g)),ref:this.commentEl,children:[p(R,{spaceAround:f,className:this.props.classes.commentWrapper,children:[u("div",{style:B.chatAvatarWrapper,children:g?u(E,{size:26,displayName:C,imgSrc:n(d,["user","profile_photo"]),className:this.props.classes.avatar}):u(I,{user:d.user,currentUser:this.props.currentUser,children:u(E,{size:26,displayName:C,imgSrc:n(d,["user","profile_photo"]),className:this.props.classes.avatar})})}),p("div",{style:B.infoContainer,children:[u("div",{children:p("div",{style:B.commentInfoContainer,children:[u("div",{style:B.userNameWrapper,children:u(w,{"data-testid":"".concat("comment","_userName"),variant:"subtitle2",noWrap:!0,className:h.userName,children:C})}),u("div",{style:B.timeWrapper,children:u(w,{"data-testid":"".concat("comment","_addTime"),variant:"caption",classes:{root:h.timeRoot},children:M})})]})}),p("div",{className:z.cCommentBody,children:[this.renderMenuIcon(),u(w,{"data-testid":"".concat("comment","_commentMessage"),variant:"body1",classes:{root:h.textRoot},children:O(d.body,d.mentioned_users,g,"#00bcd4",this.props.currentUser)}),j&&u(S,{attachmentUrl:j,attachmentSize:k,size:"small"})]})]})]}),this.state.openDeleteDialog&&u(N,{open:this.state.openDeleteDialog,text:"Do you really want to delete comment?",handleClose:function(){return o.setState({openDeleteDialog:!1})},handleOk:this.handleDelete,okText:"Delete"})]})}},{key:"isCurrentUserCommentCreator",get:function(){return Number(n(this.props.comment,["user","id"]))===Number(this.props.currentUser.id)}}]),v}();F.propTypes={comment:g.shape({}).isRequired,showOnMount:g.bool,spaceAround:g.bool,handleShowOnMount:g.func,handleEdit:g.func,handleDeleteCallback:g.func.isRequired,patchCommentCallback:g.func.isRequired,companyId:g.number,currentUser:g.shape(),classes:g.shape({}).isRequired,isNative:g.bool},F.defaultProps={showOnMount:!1,spaceAround:!1,handleShowOnMount:r,handleEdit:r,companyId:null,isNative:m,currentUser:{}};var H=v(q)(F);export default H;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import{get as o}from"lodash";import i from"@babel/runtime/regenerator";import r from"@babel/runtime/helpers/asyncToGenerator";import a from"@material-ui/core/colors/grey";import s from"../../utils/main.js";import{notifyCommentEdit as l,notifyCommentPost as c}from"../../utils/nativeMessages.js";import{isNativeDetected as p}from"../../utils/mobileDetect.js";import{jsxs as m,jsx as d}from"react/jsx-runtime";import{Paper as u,TextField as h,InputAdornment as f,Tooltip as C,Typography as g,IconButton as b}from"@material-ui/core";import{PureComponent as v}from"react";import{patchFeedItemComment as x}from"../../clients/jsonApi/index.js";import I from"lodash/noop";import y from"prop-types";import E from"classnames";import{withStyles as F}from"@material-ui/core/styles";import S from"@babel/runtime/helpers/assertThisInitialized";import U from"@babel/runtime/helpers/inherits";import k from"@babel/runtime/helpers/possibleConstructorReturn";import N from"@babel/runtime/helpers/getPrototypeOf";import A from"../Avatar/index.js";import{isSuggestionsListOpened as M}from"../UserMention/utils/index.js";import R from"../UserMention/index.js";import j from"../EmojiIconButton.js";import w from"../FailedFileUploading.js";import L from"../FileUploadIconButton.js";import T from"../FilePreview/index.js";import P from"../Icons/SendIcon.js";import D from"./styles.css.js";function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=N(t);if(e){var i=N(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return k(this,n)}}var z={chatAvatarWrapper:{display:"inline-block",verticalAlign:"top",position:"absolute",left:-18},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},_=function(p){U(y,v);var I=B(y);function y(n){var o,a,s;return e(this,y),o=I.call(this,n),t(S(o),"handleSelectEmoji",(function(t){return o.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),t(S(o),"postComment",(a=r(i.mark((function t(e){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return a.apply(this,arguments)})),t(S(o),"patchComment",(s=r(i.mark((function t(e){var n,r,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.props,r=n.editFeedItemId,a=n.editCommentId,t.prev=1,t.next=4,x(r,a,e);case 4:s=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",s);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return s.apply(this,arguments)})),t(S(o),"clearCommentField",(function(t){o.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){o.focusOnRef(),t&&"function"==typeof t&&t()}))})),t(S(o),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&o.props.exitEditMode(),"Enter"===e&&(M()||(t.preventDefault(),o.handleSendComment()))})),t(S(o),"handleAttachmentLoadingError",(function(t){o.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),t(S(o),"handleFileUpload",(function(t,e,n){o.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),t(S(o),"handleNativeFileUpload",(function(){var t=o.state.comment;o.isEditMode?(l(t),o.clearCommentField(o.props.exitEditMode)):(c(t),o.clearCommentField())})),t(S(o),"handleFileDelete",(function(){return o.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),t(S(o),"handleSendComment",r(i.mark((function t(){var e,n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=o.state.comment?o.state.comment.trim():null)||o.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:o.state.attachmentUrl,size:o.state.attachmentSize}}},!o.isEditMode){t.next=16;break}return o.props.setIsEditting(!0),t.next=8,o.patchComment(n);case 8:return r=t.sent,t.next=11,o.props.patchCommentCallback(r);case 11:o.props.setIsEditting(!1),o.clearCommentField(),o.props.exitEditMode(),t.next=24;break;case 16:return o.props.setIsPosting(!0),t.next=19,o.postComment(n);case 19:return r=t.sent,t.next=22,o.props.postCommentCallback(r);case 22:o.props.setIsPosting(!1),o.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),t(S(o),"handleCloseEditClick",(function(){o.setState({comment:""}),o.props.exitEditMode()})),o.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null},o}return n(y,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?s.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.url:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t=this,e=this.props,n=e.classes,i=e.currentUser,r="".concat(o(i,["attributes","first_name"])," ").concat(o(i,["attributes","last_name"]));return m("div",{style:this.props.spaceAround?z.commentTextFieldContainerSpaceAround:z.commentTextFieldContainer,children:[d("div",{style:z.chatAvatarWrapper,children:d(A,{displayName:r,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),d(u,{className:this.props.classes.paperRoot,children:d(h,{"data-testid":"".concat("commentInput","_input"),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:R,inputProps:{onChange:function(e){return t.setState({comment:e})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled},endAdornment:!this.props.isNative&&m(f,{position:"end",className:this.props.classes.iconsContainer,children:[!this.state.attachmentUrl&&d(C,{title:"Attach File",placement:"bottom",classes:{tooltip:n.iconTooltip},children:d("div",{className:E(D.cCommentInputIconContainer,D.cCommentInputIconUpload),children:d(L,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:a[400],inputId:"comment-attachment-".concat(this.props.editCommentId)})})}),d(C,{title:"Add Emoji",placement:"bottom",classes:{tooltip:n.iconTooltip},children:d("div",{className:D.cCommentInputIconContainer,children:d(j,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:a[400],disableRipple:!0})})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&d(w,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&d(T,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),m("div",{className:D.cCommentInputSendContainer,children:[d("div",{className:D.cCommentInputSendContainerCancel,children:this.isEditMode&&d(g,{variant:"caption",className:E(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.props.exitEditMode,children:"Cancel"})}),m("div",{className:D.cCommentInputSendContainerSend,children:[m(g,{variant:"caption",className:E(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",d(g,{variant:"caption",color:"primary",className:E(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),d(b,{"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,children:d(P,{})})]})]})]})}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}}]),y}();_.propTypes={inputRef:y.shape({}),editFeedItemId:y.number,editCommentId:y.number,editComment:y.string,editAttachment:y.shape({}),spaceAround:y.bool,postComment:y.func.isRequired,postCommentCallback:y.func,patchCommentCallback:y.func,exitEditMode:y.func,setIsPosting:y.func,setIsEditting:y.func,onMount:y.func,autoFocus:y.bool,disabled:y.bool,classes:y.shape({}).isRequired,currentUser:y.shape(),isNative:y.bool,companyId:y.number},_.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:I,setIsEditting:I,onMount:I,autoFocus:void 0,disabled:!1,patchCommentCallback:I,postCommentCallback:I,exitEditMode:I,companyId:null,currentUser:{},isNative:p};var H=F((function(t){return{paperRoot:{width:"calc(100% - 28px)",marginLeft:25,display:"inline-block",height:35,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:35,paddingRight:"10px",lineHeight:"29px",paddingLeft:"10px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"5px","&:hover":{backgroundColor:"transparent"}},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:".7rem",color:t.palette.grey[700]},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconsContainer:{marginRight:"8px"},iconTooltip:{marginTop:"3px"}}}))(_);export default H;
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import{get as e}from"lodash";import n from"@babel/runtime/helpers/classCallCheck";import o from"@babel/runtime/regenerator";import i from"@babel/runtime/helpers/asyncToGenerator";import r from"@material-ui/core/colors/grey";import a from"../../utils/main.js";import{isNativeDetected as s}from"../../utils/mobileDetect.js";import{notifyCommentEdit as l,notifyCommentPost as c}from"../../utils/nativeMessages.js";import p from"@babel/runtime/helpers/createClass";import{jsxs as m,jsx as d}from"react/jsx-runtime";import{Paper as u,TextField as h,InputAdornment as f,Tooltip as C,Typography as g,IconButton as b}from"@material-ui/core";import{PureComponent as v}from"react";import{patchFeedItemComment as x}from"../../clients/jsonApi/index.js";import I from"lodash/noop";import y from"prop-types";import E from"classnames";import{withStyles as F}from"@material-ui/core/styles";import S from"@babel/runtime/helpers/assertThisInitialized";import U from"@babel/runtime/helpers/inherits";import k from"@babel/runtime/helpers/possibleConstructorReturn";import N from"@babel/runtime/helpers/getPrototypeOf";import A from"../Avatar/index.js";import{isSuggestionsListOpened as M}from"../UserMention/utils/index.js";import R from"../UserMention/index.js";import j from"../EmojiIconButton.js";import w from"../FailedFileUploading.js";import L from"../FileUploadIconButton.js";import T from"../FilePreview/index.js";import P from"../Icons/SendIcon.js";import D from"./styles.css.js";function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=N(t);if(e){var i=N(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return k(this,n)}}var z={chatAvatarWrapper:{display:"inline-block",verticalAlign:"top",position:"absolute",left:-18},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},_=function(s){U(y,v);var I=B(y);function y(e){var r,a,s;return n(this,y),r=I.call(this,e),t(S(r),"handleSelectEmoji",(function(t){return r.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),t(S(r),"postComment",(a=i(o.mark((function t(e){var n;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return a.apply(this,arguments)})),t(S(r),"patchComment",(s=i(o.mark((function t(e){var n,i,a,s;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.props,i=n.editFeedItemId,a=n.editCommentId,t.prev=1,t.next=4,x(i,a,e);case 4:s=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",s);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return s.apply(this,arguments)})),t(S(r),"clearCommentField",(function(t){r.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){r.focusOnRef(),t&&"function"==typeof t&&t()}))})),t(S(r),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&r.props.exitEditMode(),"Enter"===e&&(M()||(t.preventDefault(),r.handleSendComment()))})),t(S(r),"handleAttachmentLoadingError",(function(t){r.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),t(S(r),"handleFileUpload",(function(t,e,n){r.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),t(S(r),"handleNativeFileUpload",(function(){var t=r.state.comment;r.isEditMode?(l(t),r.clearCommentField(r.props.exitEditMode)):(c(t),r.clearCommentField())})),t(S(r),"handleFileDelete",(function(){return r.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),t(S(r),"handleSendComment",i(o.mark((function t(){var e,n,i;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=r.state.comment?r.state.comment.trim():null)||r.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:r.state.attachmentUrl,size:r.state.attachmentSize}}},!r.isEditMode){t.next=16;break}return r.props.setIsEditting(!0),t.next=8,r.patchComment(n);case 8:return i=t.sent,t.next=11,r.props.patchCommentCallback(i);case 11:r.props.setIsEditting(!1),r.clearCommentField(),r.props.exitEditMode(),t.next=24;break;case 16:return r.props.setIsPosting(!0),t.next=19,r.postComment(n);case 19:return i=t.sent,t.next=22,r.props.postCommentCallback(i);case 22:r.props.setIsPosting(!1),r.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),t(S(r),"handleCloseEditClick",(function(){r.setState({comment:""}),r.props.exitEditMode()})),r.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null},r}return p(y,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?a.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.url:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t=this,n=this.props,o=n.classes,i=n.currentUser,a="".concat(e(i,["attributes","first_name"])," ").concat(e(i,["attributes","last_name"]));return m("div",{style:this.props.spaceAround?z.commentTextFieldContainerSpaceAround:z.commentTextFieldContainer,children:[d("div",{style:z.chatAvatarWrapper,children:d(A,{displayName:a,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),d(u,{className:this.props.classes.paperRoot,children:d(h,{"data-testid":"".concat("commentInput","_input"),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:R,inputProps:{onChange:function(e){return t.setState({comment:e})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled},endAdornment:!this.props.isNative&&m(f,{position:"end",className:this.props.classes.iconsContainer,children:[!this.state.attachmentUrl&&d(C,{title:"Attach File",placement:"bottom",classes:{tooltip:o.iconTooltip},children:d("div",{className:E(D.cCommentInputIconContainer,D.cCommentInputIconUpload),children:d(L,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:r[400],inputId:"comment-attachment-".concat(this.props.editCommentId)})})}),d(C,{title:"Add Emoji",placement:"bottom",classes:{tooltip:o.iconTooltip},children:d("div",{className:D.cCommentInputIconContainer,children:d(j,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:r[400],disableRipple:!0})})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&d(w,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&d(T,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),m("div",{className:D.cCommentInputSendContainer,children:[d("div",{className:D.cCommentInputSendContainerCancel,children:this.isEditMode&&d(g,{variant:"caption",className:E(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.props.exitEditMode,children:"Cancel"})}),m("div",{className:D.cCommentInputSendContainerSend,children:[m(g,{variant:"caption",className:E(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",d(g,{variant:"caption",color:"primary",className:E(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),d(b,{"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,children:d(P,{})})]})]})]})}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}}]),y}();_.propTypes={inputRef:y.shape({}),editFeedItemId:y.number,editCommentId:y.number,editComment:y.string,editAttachment:y.shape({}),spaceAround:y.bool,postComment:y.func.isRequired,postCommentCallback:y.func,patchCommentCallback:y.func,exitEditMode:y.func,setIsPosting:y.func,setIsEditting:y.func,onMount:y.func,autoFocus:y.bool,disabled:y.bool,classes:y.shape({}).isRequired,currentUser:y.shape(),isNative:y.bool,companyId:y.number},_.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:I,setIsEditting:I,onMount:I,autoFocus:void 0,disabled:!1,patchCommentCallback:I,postCommentCallback:I,exitEditMode:I,companyId:null,currentUser:{},isNative:s};var H=F((function(t){return{paperRoot:{width:"calc(100% - 28px)",marginLeft:25,display:"inline-block",height:35,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:35,paddingRight:"10px",lineHeight:"29px",paddingLeft:"10px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"5px","&:hover":{backgroundColor:"transparent"}},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:".7rem",color:t.palette.grey[700]},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconsContainer:{marginRight:"8px"},iconTooltip:{marginTop:"3px"}}}))(_);export default H;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../../constants/completion.js";import"../../../constants/alerts.js";import{get as t}from"lodash";import{DEV_CENTER_CLI_APP_ID as n}from"../../../constants/devcenter.js";import"../../../constants/goals.js";import{SEGMENTS as e}from"../../../constants/segment.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import{getAppName as a}from"../../../utils/devcenter.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";import o from"prop-types";import"../../Annotations/AnnotationsContext.js";import"../../Annotations/components/AnnotationsList/index.js";import r from"../../Annotations/components/LastAnnotation/index.js";import p from"./VersionBadge.js";import l from"./PadMode.js";import d from"../../AssetNameLabel/index.js";import m from"./AppHeader.css.js";function c(o){var c,u,h,g,A,v,f,L,b=o.app,j=o.appLastAnnotation,x=o.appSettings,w=o.badge,C=o.classes,N=o.coordinates,_=o.currentUser,I=o.fracFleet,y=o.isMaximized,D=o.onSettingChange,S=o.openAnnotationsList,H=o.rig,M=o.showLastAnnotation,W=o.updateCurrentDashboardAppLastAnnotation,F=o.well,P=o.wells,z=a(b),R=null==b||null===(c=b.package)||void 0===c||null===(u=c.manifest)||void 0===u||null===(h=u.application)||void 0===h?void 0:h.subtitle,T=null!==(g=null==b||null===(A=b.package)||void 0===A||null===(v=A.manifest)||void 0===v||null===(f=v.application)||void 0===f||null===(L=f.segments)||void 0===L?void 0:L[0])&&void 0!==g?g:e.DRILLING,U=T===e.DRILLING,k=(null==b?void 0:b.settings)||{},O=k.wellId,q=k.rigId,G=k.fracFleetId,V=U?null==H?void 0:H.name:null==I?void 0:I.name,B=O&&(null==F?void 0:F.name),E=!!(O||q||G),J=U?V&&"assets/".concat(null==F?void 0:F.asset_id):"assets/types/pad/".concat(null==I?void 0:I.current_pad_id),K=b&&b.id===n;return s("div",{className:C.appHeader,children:[s("div",{className:C.appHeaderTitleWrapper,children:[s("div",{children:[s("div",{className:m.titleWrapper,children:[i("h6",{"data-testid":"".concat("DevCenter_AppHeader","_name"),className:m.title,children:z}),i(p,{app:b}),T===e.COMPLETION&&i(l,{fracFleet:I,wells:P,well:F,onSettingChange:D,appSettings:x})]}),w]}),b&&N&&i(d,{isPrimaryNameVisible:E,primaryAssetName:V,secondaryAssetName:B,coordinatesPixelWidth:N.pixelWidth,primaryAssetLink:!K&&J,isMaximized:y})]}),R&&i("h6",{"data-testid":"".concat("DevCenter_AppHeader","_subtitle"),className:m.subtitle,children:R}),M&&j&&i(r,{dashboardAppId:b.id,appId:t(b,["app","id"]),annotation:j,openAnnotationsList:S,updateCurrentDashboardAppLastAnnotation:W,currentUser:_})]})}c.propTypes={app:o.object.isRequired,badge:o.node,classes:o.shape({appHeader:o.string,appHeaderTitleWrapper:o.string}),showLastAnnotation:o.bool,currentUser:o.shape({}),appLastAnnotation:o.shape({}),updateCurrentDashboardAppLastAnnotation:o.func,openAnnotationsList:o.func,rig:o.shape({name:o.string,asset_id:o.number}),well:o.shape({name:o.string,asset_id:o.number}),fracFleet:o.shape({name:o.string,current_pad_id:o.number}),wells:o.arrayOf(o.shape({})),coordinates:o.shape({pixelWidth:o.number.isRequired}),isMaximized:o.bool,appSettings:o.shape({}),onSettingChange:o.func},c.defaultProps={appLastAnnotation:null,appSettings:void 0,badge:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null};export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{COMPLETION_APP_TYPES as t}from"../../../constants/completion.js";import{noop as r,get as o,isEmpty as n}from"lodash";import{getAssetKey as p,getDefaultPadModeSetting as i}from"../../../utils/completion.js";import{jsx as s}from"react/jsx-runtime";import l from"prop-types";import c from"../../PadModeSelect/PadModeSelect.js";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?a(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var m=function(r){var l=r.fracFleet,a=r.wells,m=r.well,u=r.onSettingChange,g=r.appSettings,y=r.completionAppType;if(m||!a&&!l)return null;var O=y||t.fracMultiWellApp,b=p(l,m),d=o(g,["settingsByAsset",b]),j=n(d)?i(l,m,O):d;return s(c,{assets:a,completionAppType:O,padModeSetting:j,onChange:function(t){return u("settingsByAsset",f(f({},o(g,"settingsByAsset",{})),{},e({},b,t)))}})};m.propTypes={appSettings:l.shape({}),completionAppType:l.string,fracFleet:l.shape({}),onSettingChange:l.func,well:l.shape({}),wells:l.arrayOf(l.shape())},m.defaultProps={appSettings:{},completionAppType:void 0,fracFleet:void 0,onSettingChange:r,well:void 0,wells:void 0};export default m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/toConsumableArray";import"../../../constants/completion.js";import"../../../constants/alerts.js";import{noop as t}from"lodash";import o from"@babel/runtime/helpers/slicedToArray";import"../../../constants/goals.js";import"../../../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 r,Fragment as i,jsx as n}from"react/jsx-runtime";import{makeStyles as s,Drawer as p,Box as a}from"@material-ui/core";import m from"@material-ui/icons/Close";import{useState as l,useRef as d,useEffect 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 u from"prop-types";import j from"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"../DevCenterRouterContext/UniversalLink/UniversalLink.js";import"../../ConfirmationDialog.js";import"../../Annotations/components/AnnotationsList/index.js";import"../../Annotations/components/LastAnnotation/index.js";import"../../PadModeSelect/PadModeSelect.js";import"../AppHeader/AppHeader.js";import h from"@material-ui/icons/ChevronLeftRounded";import g from"@material-ui/icons/ChevronRightRounded";import x from"@material-ui/icons/Sort";import C from"@material-ui/icons/Check";import"../AppContext.js";import"../AppsDataProvider/AppsDataProvider.js";import"../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"../DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenterAppContainer/components/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"../../AssetEditor/index.js";import"../../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 b 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 f from"../../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"../../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 A=s((function(t){var o,r;return{drawer:function(o){var r=o.openedDrawerWidth;return e({height:"100%",position:"relative",width:r,borderTop:"1px solid",borderTopColor:t.palette.background.b7,boxShadow:"4px 0px 8px rgba(0, 0, 0, 0.15)"},"&.".concat("closed"),{width:"48px"})},drawerPaper:(o={position:"relative",width:"100%",backgroundColor:t.palette.background.b5},e(o,"&.".concat("closed"),{cursor:"pointer","&:hover":{backgroundColor:t.palette.background.b7,"& > $header":{backgroundColor:t.palette.background.b7}}}),e(o,"&.MuiDrawer-paperAnchorDockedLeft",{borderRight:"none"}),e(o,"&.MuiDrawer-paperAnchorDockedRight",{borderLeft:"none"}),o),header:(r={height:48,borderBottom:"1px solid",borderBottomColor:t.palette.background.b7,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:0,left:0,right:0,letterSpacing:"1px",textTransform:"uppercase",fontSize:"14px",fontWeight:500,lineHeight:"20px",backgroundColor:t.palette.background.b5},e(r,"&.".concat("open"),{padding:t.spacing(1.5),justifyContent:"flex-start"}),e(r,"&.".concat("withShadow"),{zIndex:1,boxShadow:"-18px 12px 12px #272727"}),r),openToggleIconOpen:{transform:"rotate(180deg)"},openToggleContainer:function(t){var o,r=t.anchor;return e(o={alignItems:"center",bottom:0,display:"flex",flex:"0 0",height:48,justifyContent:"center",padding:6,position:"absolute",width:"100%"},"&.".concat("withShadow"),{zIndex:1,boxShadow:"-18px -12px 12px #272727"}),e(o,"&.".concat("open"),{justifyContent:"left"===r?"flex-end":"flex-start",paddingRight:6}),o},contentWrapper:{marginTop:48,height:"calc(100% - 96px)",overflowY:"auto"},content:{padding:"16px 12px",display:"flex",flexDirection:"column"},selectAllButton:{textTransform:"none",fontSize:"10px",lineHeight:"14px",letterSpacing:"0.4px",marginLeft:16,"& .MuiButton-startIcon":{marginRight:4}},headerIcon:{cursor:"pointer"},headerIconText:{cursor:"pointer"}}})),S=function(t){var s,u=t.anchor,S=t.children,I=t.drawerPaperClassName,v=t.header,T=t.headerIcon,w=t.headerTitleIcon,y=t.isOpen,D=t.openedDrawerWidth,L=t.setIsOpen,k=t.size,P=t.allOptionsButtonShown,B=t.isAllOptionsSelected,E=t.onAllOptionsClick,O=l(!1),W=o(O,2),M=W[0],N=W[1],F=d(),R=A({anchor:u,openedDrawerWidth:D||{small:235,medium:354,large:473}[k]});c((function(){var e=F.current,t=e.scrollHeight,o=e.clientHeight;N(t>o)}));var H="left"===u?g:h;return r(p,{onClick:function(){y||L(!0)},className:j(R.drawer,!y&&"closed"),variant:"permanent",classes:{paper:j(R.drawerPaper,I,!y&&"closed")},anchor:u,children:[r("div",{className:j(R.header,y&&"open",M&&"withShadow"),onClick:function(){y&&L(!1)},children:[y&&r(i,{children:[w||n(x,{className:R.headerIcon}),n("div",{className:R.headerIconText,children:v}),P&&n(b,{className:R.selectAllButton,onClick:function(e){e.stopPropagation(),E(e)},startIcon:n(B?m:C,{}),children:B?"Clear All":"Select All"})]}),!y&&T]}),n("div",{className:R.contentWrapper,ref:F,children:n("div",{className:R.content,children:y&&S})}),n(a,{className:j(R.openToggleContainer,(s={},e(s,"open",y),e(s,"withShadow",M),s)),children:n(f,{"aria-label":"toggle sidebar",onClick:function(){L(!y)},children:n(H,{className:j(y&&R.openToggleIconOpen)})})})]})};S.propTypes={anchor:u.oneOf(["left","right"]),children:u.node.isRequired,drawerPaperClassName:u.string,header:u.node,headerIcon:u.node,headerTitleIcon:u.node,isOpen:u.bool,openedDrawerWidth:u.oneOfType([u.string,u.number]),setIsOpen:u.func,size:u.oneOf(["small","medium","large"]),allOptionsButtonShown:u.bool,isAllOptionsSelected:u.bool,onAllOptionsClick:u.func},S.defaultProps={anchor:"left",drawerPaperClassName:"",header:null,headerIcon:null,headerTitleIcon:null,isOpen:!1,openedDrawerWidth:0,setIsOpen:t,size:"medium",allOptionsButtonShown:!1,isAllOptionsSelected:!1,onAllOptionsClick:t};export default S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{get as
|
|
1
|
+
import t from"@babel/runtime/helpers/toConsumableArray";import{get as r,keyBy as n,values as e,merge as a,flatten as u,uniq as i}from"lodash";import c from"@babel/runtime/helpers/slicedToArray";import{ASSET_TYPES as o}from"../../../../constants/assetTypes.js";import s from"@babel/runtime/regenerator";import p from"@babel/runtime/helpers/asyncToGenerator";import{getAppsDataByRigs as d,fetchRigs as f,getAppsDataByWells as l,fetchWells as m,fetchAssetEntitiesByAssetIds as b,getAppsDataByFFs as y,getUniqAssetIds as x,fetchFracFleets as h,fetchFracFleetWells as v}from"./utils.js";function k(t,r){return w.apply(this,arguments)}function w(){return(w=p(s.mark((function t(a,u){var i,c,p,y,x,h,v,k,w,g;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b([a]);case 2:if(i=t.sent,c=r(e(i),"[0][0].data")){t.next=6;break}return t.abrupt("return",{});case 6:if(c.type!==o.well.type){t.next=16;break}return t.next=9,m([c.id]);case 9:if(p=t.sent){t.next=12;break}return t.abrupt("return",{});case 12:return y=r(p,"data"),x=y&&n(y.concat(p.included),"id"),h=l(u,x,(function(t){return t[r(p,"data[0].id")]})),t.abrupt("return",h);case 16:if(c.type!==o.rig.type){t.next=24;break}if(v=f([c.id])){t.next=20;break}return t.abrupt("return",{});case 20:return k=r(v,"data"),w=k&&n(k.concat(v.included),"id"),g=d(u,w,(function(t){return t[r(v,"data[0].id")]})),t.abrupt("return",g);case 24:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function g(t,r,n,e){return T.apply(this,arguments)}function T(){return(T=p(s.mark((function r(e,u,i,o){var p,b,k,w,g,T,j,A,P,C,G,S,_,q,z,B;return s.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return p=x(e),b=x(u),k=x(i),w=t(new Set(i)),r.next=6,Promise.all([m(p),f(b),h(k),v(w,o)]);case 6:if(g=r.sent,T=c(g,4),j=T[0],A=T[1],P=T[2],C=T[3],j||A||P||C){r.next=14;break}return r.abrupt("return",{});case 14:return G=(null==j?void 0:j.data)&&n(j.data.concat(j.included),"id"),S=(null==A?void 0:A.data)&&n(A.data.concat(A.included),"id"),_=n(P,"id"),q=l(e,G,(function(t,r){return t[r]})),z=d(u,S,(function(t,r){return t[r]})),B=y(i,_,C),r.abrupt("return",a(q,z,B));case 21:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function j(t,r,n){return A.apply(this,arguments)}function A(){return(A=p(s.mark((function t(p,y,h){var v,k,w,g,T,j,A,P,C,G,S,_,q,z,B,D;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v=x(p),t.next=3,b(v);case 3:return k=t.sent,w=u(e(k)),g=i(w.filter((function(t){return r(t,"data.type")===o.well.type})).map((function(t){return+r(t,"data.id")})).concat(y.map((function(t){var r=c(t,2);r[0];return r[1]})))),T=i(w.filter((function(t){return r(t,"data.type")===o.rig.type})).map((function(t){return+r(t,"data.id")})).concat(h.map((function(t){var r=c(t,2);r[0];return r[1]})))),t.next=9,Promise.all([m(g),f(T)]);case 9:if(j=t.sent,A=c(j,2),P=A[0],C=A[1],P||C){t.next=15;break}return t.abrupt("return",{});case 15:return G=r(P,"data"),S=r(C,"data"),_=G&&n(G.concat(P.included),"id"),q=S&&n(S.concat(C.included),"id"),z=p.map((function(t){var n=c(t,2),e=n[0],a=n[1];return[e,G.concat(S).find((function(t){return r(t,"attributes.asset_id")===a})).id]})).concat(y,h),B=l(z,_,(function(t,r){return t[r]})),D=d(z,q,(function(t,r){return t[r]})),t.abrupt("return",a(B,D));case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}export{k as resolveAppsDataForAssetDashboard,j as resolveAppsDataForFeedPage,g as resolveAppsDataForGeneralDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/defineProperty";import{get as e,mapValues as t,merge as n}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import
|
|
1
|
+
import r from"@babel/runtime/helpers/defineProperty";import{get as e,mapValues as t,merge as n}from"lodash";import i from"@babel/runtime/helpers/slicedToArray";import{ASSET_TYPES as o}from"../../../../constants/assetTypes.js";import{isDevCenterApp as s}from"../../../../utils/devcenter.js";import a from"@babel/runtime/regenerator";import u from"@babel/runtime/helpers/asyncToGenerator";import{useState as c,useEffect as p}from"react";import{getAppAssetSpecificTypeId as f}from"./utils.js";import{resolveAppsDataForAssetDashboard as l,resolveAppsDataForGeneralDashboard as d,resolveAppsDataForFeedPage as m}from"./dataResolvers.js";function b(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var h=function(r){return[f(r,o.well.id),f(r,o.rig.id),f(r,o.frac_fleet.id),f(r,"deprecatedAssetId")].join("-")},O={id:null,rig:null,well:null,fracFleet:null,wells:null,isLoading:!1,appHash:null};function j(b){var j=b.apps,y=b.dashboardAssetId,v=j.filter(s),w=c((function(){return function(e){return e.reduce((function(e,t){return g(g({},e),{},r({},t.id,g(g({},O),{},{id:t.id,isLoading:!0,appHash:h(t)})))}),{})}(v)})),P=i(w,2),x=P[0],S=P[1],k=[],A=[],D=[],H=[],L=[],_=[];v.forEach((function(r){if(!e(r,["app","ui_settings","multi_rig"])){var t=f(r,o.well.id),n=f(r,o.rig.id),i=f(r,o.frac_fleet.id),s=f(r,"deprecatedAssetId"),a=r.id;H.push([a]),t?k.push([a,t]):n?A.push([a,n]):s?L.push([a,s]):i?D.push([a,i]):y&&_.push([a])}}));var E=!!y,I=!y&&L.length,T=function(e){return v.reduce((function(t,n){var i=n.id,o=e[i],s=h(n);return o&&s===o.appHash?g(g({},t),{},r({},i,o)):g(g({},t),{},r({},i,g(g({},O),{},{id:i,isLoading:!0,appHash:s})))}),{})};return p(u(a.mark((function r(){var e;return a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e={},S(T),!I){r.next=8;break}return r.next=5,m(L,k,A);case 5:e=r.sent,r.next=18;break;case 8:return r.next=10,d(k,A,D,v);case 10:if(e=r.sent,!E){r.next=18;break}return r.t0=n,r.t1=e,r.next=16,l(y,_);case 16:r.t2=r.sent,e=(0,r.t0)(r.t1,r.t2);case 18:S((function(r){return t(r,(function(r){var t=e[r.id]||{};return g(g(g({},r),t),{},{isLoading:!1})}))}));case 19:case"end":return r.stop()}}),r)}))),[String(k),String(A),String(D),String(H),String(_),y]),x}export default j;
|