@corva/ui 3.78.0-rc.0 → 3.79.0-1
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/cjs-bundle/components/AddComment/Popover.js +1 -1
- package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/CollapsableSidebar.js +1 -1
- package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/constants.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/useAppsData.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/utils.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/constants.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/constants.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js +2 -0
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js.map +1 -0
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js.map +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/CollapsableSidebar.js +1 -1
- package/components/CollapsableSidebar.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts +3 -21
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/assetDashboard/wellAssetDashboard/appWithDefaultSettings.d.ts +22 -2
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/assetDashboard/wellAssetDashboard/appWithDefaultSettings.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithFracFleetId.d.ts +23 -2
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithFracFleetId.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithPadId.d.ts +20 -2
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithPadId.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithActiveWellId.d.ts +27 -2
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithActiveWellId.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithRigId.d.ts +49 -3
- package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithRigId.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/__tests__/utils.test.d.ts +2 -0
- package/components/DevCenter/AppsDataProvider/effects/__tests__/utils.test.d.ts.map +1 -0
- package/components/DevCenter/AppsDataProvider/effects/constants.d.ts +2 -7
- package/components/DevCenter/AppsDataProvider/effects/constants.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/constants.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.d.ts +14 -10
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/index.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.d.ts +5 -5
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/utils.d.ts +33 -54
- package/components/DevCenter/AppsDataProvider/effects/utils.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/utils.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/index.d.ts +1 -0
- package/components/DevCenter/AppsDataProvider/index.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/types.d.ts +216 -0
- package/components/DevCenter/AppsDataProvider/types.d.ts.map +1 -0
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/__tests__/getAppDataEntryFromContext.test.d.ts +2 -0
- package/components/DevCenter/DevCenterAppContainer/__tests__/getAppDataEntryFromContext.test.d.ts.map +1 -0
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.d.ts +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.d.ts +5 -3
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/constants.d.ts +0 -2
- package/components/DevCenter/DevCenterAppContainer/constants.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/constants.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/constants.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.d.ts +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.d.ts +7 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.d.ts +12 -0
- package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.d.ts.map +1 -0
- package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js +2 -0
- package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js.map +1 -0
- package/components/DevCenter/DevCenterAppContainer/types.d.ts +1 -6
- package/components/DevCenter/DevCenterAppContainer/types.d.ts.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js.map +1 -1
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/components/FeedItem/FeedItem.js +1 -1
- package/components/FeedItem/FeedItem.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/mcp-server/server.mjs +6 -6
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { AppDashboardMeta } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: AppDashboardMeta;\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"s+hBAqH8D,SAsCxDA,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,IAAAA,MACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oCACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,yBACAC,IAAAA,kBACAC,IAAAA,oBACAC,IAAAA,uBACAC,IAAAA,sBACAC,IAAAA,iBACAC,IAAAA,mBACAC,IAAAA,oBACAC,KAAAA,uBAAsBC,GAAA1B,EACtB2B,iBAAAA,gBAAwBD,GACxBE,KAAAA,uBACAC,KAAAA,kBAAiBC,GAAA9B,EACjB+B,oBAAAA,eAAsBC,EAAIA,KAAAF,GAC1BG,KAAAA,YACAC,KAAAA,iBACAC,KAAAA,iBACAC,KAAAA,kBACAC,KAAAA,oBAAmBC,GAAAtC,EACnBuC,gBAAAA,eAAkBP,EAAIA,KAAAM,GAAAE,GAAAxC,EACtByC,iBAAAA,eAAmBT,EAAIA,KAAAQ,GAAAE,GAAA1C,EACvB2C,aAAAA,eAAeX,EAAIA,KAAAU,GACnBE,KAAAA,gBAAeC,GAAA7C,EACf8C,yBAAAA,eAA2Bd,EAAIA,KAAAa,GAC/BE,KAAAA,UACAC,KAAAA,wCACAC,KAAAA,cACAC,KAAAA,UACAC,KAAAA,YAKMC,GAAqDC,aAAWC,GAChEC,GAAQC,EAAAA,WACRC,GAAeC,EAAgBA,kBAAIC,mBACCC,GAAAA,EAAQA,SAAsB,IAAGC,GAAAC,EAAAA,QAAAC,GAAA,GAApEC,GAAaH,GAAA,GAAEI,GAAgBJ,GAAA,GACcD,GAAAA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AKA,EACL8D,QAASsD,GACTkD,aAAcC,EAAkBA,mBAC9BvK,EAAIsK,aACJjK,EAAYmK,QAAQC,mBAEtBlF,SAAUA,GACVvB,UAAWA,GACXO,WAAYA,GACZpD,kBAAmBA,SAAAA,GAAqB,KACxCc,aAAcA,GACdmC,QAASA,GACToC,wBAAyBA,GACzB+B,SAAUA,IAfLzE,GAAQ4G,WAkBjBjC,MAACkC,sBAAmB,CAClB3K,IAAKA,EACL8D,QAASA,GACTe,QAASA,GACTyE,qBAAsBnD,GACtBa,eAAgBA,GAChBC,qBAAsBA,GACtB5G,YAAaA,EACbE,yBAA0BA,EAC1BoG,wBAAyBA,GACzBJ,0BAA2BA,GAC3BhC,WAAYA,GACZrD,uBAAwBA,GACxBC,kBAAmBA,GACnBI,YAAaA,GACbE,iBAAkBA,GAClBM,iBAAkBA,GAClBE,aAAcA,GACd2E,sBAAuBA,GACvBJ,wBAAyBA,KAE1BvB,KAAgBgD,IACfQ,EAAAA,IAACmC,EAAoB,CAAC1F,eAAgBA,MAGtC1E,KAAuByH,IAAyBjE,KAChDyE,EAAAC,IAACmC,mBAAgB,CACf7K,IAAKA,EACLK,YAAaA,EACbC,gBAAiBA,EACjB4G,uBAAwBA,GACxB3B,SAAUA,GACVZ,kBAAmBA,GACnB4E,qBAAsBA,EAAqBA,qBAC3CtE,YAAaA,GACblC,aAAcA,GACdO,cAAeA,GACfI,mBAAoBA,GACpBhC,kBAAmBA,GACnBF,iBAAkBA,GAClBY,yBAA0BA,GAC1B8C,eAAgBA,GAChB0B,sBAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
|
|
1
|
+
{"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport type { AppDataAssets, AppDataEntry } from '../AppsDataProvider/types';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppDataEntryFromContext } from './getAppDataEntryFromContext';\nimport type { AppContextValue } from './getAppDataEntryFromContext';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport { HOME_PATH_PREFIX, MOBILE_CLI_APP_GRID_WIDTH, PAGE_NAME } from './constants';\nimport type {\n AppCoordinates,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { AppDashboardMeta } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: AppDashboardMeta;\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst getAppDataAssets = (appData: AppDataEntry): AppDataAssets => ({\n ...(appData.well && { well: appData.well }),\n ...(appData.rig && { rig: appData.rig }),\n ...(appData.fracFleet && { fracFleet: appData.fracFleet }),\n ...(appData.wells && { wells: appData.wells }),\n ...(appData.interventionUnit && { interventionUnit: appData.interventionUnit }),\n});\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // AppContext remains JavaScript because external consumers also provide a single app resource.\n // This union is the one trust boundary; getAppDataEntryFromContext separates its two modes.\n const appContextValue: AppContextValue = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData = getAppDataEntryFromContext(appContextValue, appDataKey);\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(() => getAppDataAssets(appData), [appData]);\n // AppCommonsContext still models complete assets, while this provider intentionally forwards\n // sparse API projections. Keep its open forwarding seam local until that context is migrated.\n const appCommonsAssets: Record<string, unknown> = filteredAppData;\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...appCommonsAssets}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["_ref","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appContextValue","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","getAppDataEntryFromContext","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","isLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","well","rig","fracFleet","wells","interventionUnit","getAppDataAssets","appCommonsAssets","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","undefined","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialog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AAiBvB,SACtCL,EAACC,IAAA4B,EAAA,QAGC,CAEArE,aAAcA,GACdpG,IAAKA,EACL8D,QAASsD,GACTsD,aAAcC,EAAkBA,mBAC9B3K,EAAI0K,aACJrK,EAAYuK,QAAQC,mBAEtBvF,SAAUA,GACVY,UAAWA,GACX5B,WAAYA,GACZnD,kBAAmBA,SAAAA,GAAqB,KACxCc,aAAcA,GACdkC,QAASA,GACTqC,wBAAyBA,GACzBkC,SAAUA,IAfL5E,GAAQgH,WAkBjBlC,MAACmC,sBAAmB,CAClB/K,IAAKA,EACL8D,QAASA,GACTc,QAASA,GACT6E,qBAAsBtD,GACtBa,eAAgBA,GAChBC,qBAAsBA,GACtB5G,YAAaA,EACbE,yBAA0BA,EAC1BoG,wBAAyBA,GACzBJ,0BAA2BA,GAC3BjC,WAAYA,GACZpD,uBAAwBA,GACxBC,kBAAmBA,GACnBI,YAAaA,GACbE,iBAAkBA,GAClBM,iBAAkBA,GAClBE,aAAcA,GACd2E,sBAAuBA,GACvBJ,wBAAyBA,KAE1BxB,KAAgBoD,IACfQ,EAAAA,IAACoC,EAAoB,CAAC/F,eAAgBA,MAGtCzE,KAAuB4H,IAAyBlC,KAChD0C,EAAAC,IAACoC,mBAAgB,CACfjL,IAAKA,EACLK,YAAaA,EACbC,gBAAiBA,EACjB4G,uBAAwBA,GACxB5B,SAAUA,GACVZ,kBAAmBA,GACnBiF,qBAAsBA,EAAqBA,qBAC3C3E,YAAaA,GACbjC,aAAcA,GACdO,cAAeA,GACfI,mBAAoBA,GACpBhC,kBAAmBA,GACnBF,iBAAkBA,GAClBY,yBAA0BA,GAC1B6C,eAAgBA,GAChB2B,sBAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),n=require("lodash"),o=require("@material-ui/core"),r=require("@material-ui/icons"),t=require("../../../../EmptyState/EmptyState.js"),c=require("../../utils.js"),u=require("./components/RemoveAppButton.js"),a=require("./components/SettingsAccordion.js"),l=require("./styles.js");require("@babel/runtime/helpers/objectWithoutProperties"),require("@material-ui/pickers"),require("@date-io/moment"),require("moment"),require("../../../../../config/theme/index.js");var p=require("react/jsx-runtime"),d=require("../../../../../hocs/withAssetEditorLockHOC.js"),m=require("../../../../ErrorBoundary/ErrorBoundary.js"),j=require("../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js"),q=require("../../../../Button/components/Button/index.js");require("moment-timezone"),require("classnames"),require("../../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../../../../Button/components/LiveButton/styles.js"),require("@icon-park/react/es/all"),require("../../../../../icons/IconParkProvider.js"),require("../../../../../icons/customIcons/icons/AddMessage.js"),require("../../../../../icons/customIcons/icons/DragOne.js"),require("../../../../../icons/customIcons/icons/Attention.js"),require("../../../../../icons/customIcons/icons/Collapse.js"),require("../../../../../icons/customIcons/icons/Dashboard.js"),require("../../../../../icons/customIcons/icons/Expand.js"),require("../../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../../icons/customIcons/icons/Search.js"),require("../../../../../icons/customIcons/icons/SearchOne.js"),require("../../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../../icons/customIcons/icons/MultiRuler.js"),require("../../../../../icons/customIcons/icons/Checkbox.js"),require("../../../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../../../icons/customIcons/icons/Radio.js"),require("../../../../../icons/customIcons/icons/RadioChecked.js"),require("../../../../../icons/customIcons/icons/SimulFrac.js"),require("../../../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../../../icons/customIcons/icons/CautionFilled.js"),require("../../../../../icons/customIcons/icons/InfoRounded.js"),require("../../../../../icons/customIcons/icons/FlameFilled.js"),require("../../../../../icons/customIcons/icons/MoreApp.js"),require("../../../../../icons/customIcons/icons/Pad.js"),require("../../../../../icons/customIcons/icons/DrilloutUnit.js"),require("../../../../../icons/customIcons/icons/FracFleet.js"),require("../../../../../icons/customIcons/icons/Global.js"),require("../../../../../icons/customIcons/icons/Program.js"),require("../../../../../icons/customIcons/icons/Rig.js"),require("../../../../../icons/customIcons/icons/Well.js"),require("../../../../../icons/customIcons/icons/Gap.js"),require("../../../../../icons/customIcons/icons/Pin.js"),require("../../../../../icons/customIcons/icons/PinOne.js"),require("../../../../../icons/customIcons/icons/PinOneCrossed.js"),require("../../../../../icons/customIcons/icons/CloseOneFilled.js"),require("../../../../../icons/customIcons/icons/AttentionFilled.js"),require("../../../../../icons/customIcons/icons/CheckOneFilled.js"),require("../../../../../icons/customIcons/icons/Archive.js"),require("../../../../../icons/customIcons/icons/ArchiveCancel.js"),require("../../../../../icons/customIcons/icons/Unarchive.js"),require("../../../../../icons/customIcons/icons/Archived.js"),require("../../../../../icons/customIcons/icons/InterventionUnit.js"),require("../../../../../icons/customIcons/icons/CloudDelete.js"),require("../../../../../icons/customIcons/icons/Lasso.js"),require("../../../../../icons/customIcons/icons/Radius.js"),require("../../../../../icons/customIcons/icons/ErrorOps.js"),require("../../../../../icons/customIcons/icons/DataTypeOps.js"),require("../../../../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../../../../icons/customIcons/icons/CalibrationOps.js"),require("../../../../../icons/customIcons/icons/CriticalOps.js"),require("../../../../../icons/customIcons/icons/Company.js"),require("../../../../../icons/customIcons/icons/ArchiveOne.js"),require("../../../../../icons/customIcons/icons/ParseBotFusion.js"),require("../../../../../icons/customIcons/icons/Connect.js"),require("../../../../../icons/customIcons/icons/PuzzleOne.js"),require("../../../../../icons/customIcons/icons/Feed.js"),require("../../../../../icons/customIcons/icons/Prompt.js"),require("../../../../../icons/customIcons/icons/Companies.js"),require("../../../../../icons/customIcons/icons/ClipboardAi.js"),require("../../../../../icons/customIcons/icons/Key.js"),require("../../../../../icons/customIcons/icons/AtSignCrossed.js"),require("../../../../../icons/customIcons/icons/MappingManual.js"),require("../../../../../icons/customIcons/icons/Mapping.js"),require("../../../../../icons/customIcons/icons/Metrics.js"),require("../../../../../icons/customIcons/icons/Drops.js"),require("../../../../../icons/customIcons/icons/ClipboardSearch.js"),require("../../../../../icons/customIcons/icons/Template.js"),require("../../../../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../../../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../../../../icons/customIcons/icons/UnitConversion.js"),require("../../../../../icons/customIcons/icons/NPT.js"),require("../../../../../icons/customIcons/icons/GuidedFrac.js");var I=require("../../../../Modal/Modal.js"),v=require("../../../../../constants/devcenter.js");require("../../../../../constants/goals.js");var g=require("../../../../../constants/segment.js");require("../../../../../constants/alerts.js"),require("../../../../../constants/apps.js"),require("../../../../../constants/drillstring.js"),require("../../../../../constants/completion.js"),require("../../../../../constants/appPackages.js"),require("../../../../../constants/notifications.js"),require("../../../../../constants/feed.js"),require("../../../../../constants/bha.js");var f=require("../../../../../constants/assetTypes.js");require("../../../../../constants/corvaCompanyId.js"),require("../../../../GradientManager/configuration/constants.js");var h=require("../../../../AssetEditorV2/index.js"),S=require("../../../../AppVersionsSelect/AppVersionsSelect.js"),C=require("../../../../DisabledSettingsMessage/DisabledSettingsMessage.js"),b=require("../../../../ConfirmationDialog.js");require("../../../../UserMention/utils/index.js"),require("../../../../../utils/convert.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../../../../utils/casing/validation.js"),require("lodash/mean"),require("../../../../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver");var y=require("../../../../../utils/devcenter.js");require("../../../../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/isNumber"),require("lodash/has"),require("../../../../../utils/ga.js"),require("../../../../../utils/goalsConfig/goalsConfig.js"),require("../../../../../utils/lasParser.js"),require("../../../../../utils/main.js"),require("../../../../../utils/metrics/metricsConfig.js");var A=require("../../../../../utils/mobileDetect.js");require("../../../../../utils/feed.js"),require("../../../../../utils/reports.js");var x=require("../../../../../utils/notificationToasts.js");require("@babel/runtime/helpers/typeof"),require("../../../../../utils/dashboardReports.js"),require("../../../../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions"),require("../../../../../utils/jsonaDataFormatter.js"),require("../../../../../utils/bha.js"),require("jsona"),require("../../../../../clients/jsonApi/index.js"),require("../../../../../utils/charts/Styles.scss.js"),require("../../../../../utils/getSingleAsset.js");var O=require("../../../../AppIcon/AppIcon.js"),E=require("../../../../../permissions/usePermissions.js"),P=require("../../../../../permissions/constants/index.js");require("../../../../../permissions/withPermissionsHOC.js"),require("../../../../../permissions/ProvidePermissions.js"),require("../../../../../permissions/PermissionsContext.js");var k=require("../../../../../componentsV2/HideInNativeApp/index.js"),D=require("../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js");function N(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var M=N(e),T=N(s);function R(e,s){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),i.push.apply(i,n)}return i}function w(e){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?R(Object(i),!0).forEach((function(s){M.default(e,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))}))}return e}var F="DC_appSettings",B=function(){return null},V=d(h),_=C,G=g.SEGMENT_TO_ASSET_TYPE,L=function(){return null};exports.PAGE_NAME=F,exports.default=function(e){var s,d,C,N,R,H,U=e.AppSettingsComponent,z=void 0===U?L:U,W=e.app,K=e.appData,Y=e.appName,Z=e.currentUser,J=e.disableAppAssetSelection,Q=void 0!==J&&J,X=e.isMultiRig,$=e.isSettingsDialogHidden,ee=void 0!==$&&$,se=e.layoutEnvironment,ie=e.onAppRemove,ne=e.onCloneDashboard,oe=void 0===ne?n.noop:ne,re=e.onSettingsChange,te=e.openIntercom,ce=e.rigId,ue=e.toggleAppSettingsDialog,ae=y.getAppSegment(W),le=i.useState("string"==typeof ae?ae:g.SEGMENTS.DRILLING),pe=T.default(le,2),de=pe[0],me=pe[1],je=i.useState(!1),qe=T.default(je,2),Ie=qe[0],ve=qe[1],ge=i.useState(!0),fe=T.default(ge,2),he=fe[0],Se=fe[1],Ce=i.useState(""),be=T.default(Ce,2),ye=be[0],Ae=be[1],xe=i.useState((function(){var e,s,i=n.cloneDeep(null!==(e=W.settings)&&void 0!==e?e:{}),o="string"==typeof i.package?i.package:void 0,r="string"==typeof(null===(s=W.package)||void 0===s?void 0:s.version)?W.package.version:void 0;return w(w({},i),{},{package:o||r})})),Oe=T.default(xe,2),Ee=Oe[0],Pe=Oe[1],ke=i.useRef(ce),De=i.useRef(null),Ne=i.useRef(null),Me=E([P.PERMISSIONS.getCanReadAppPackages(W.app.id)]),Te=T.default(Me,1)[0],Re=Te.active,we=Te.loading,Fe=Array.isArray(W.segment)?W.segment.filter((function(e){return"string"==typeof e})):[],Be=Fe.length>1,Ve=de===g.SEGMENTS.COMPLETION,_e=G[de],Ge="asset"===(null==se?void 0:se.type),Le=W.id===v.DEV_CENTER_CLI_APP_ID,He=c.getIsSustainabilityApp(null==W||null===(s=W.app)||void 0===s?void 0:s.id),Ue=!(Q||A.isInsideNewMobileApp||X||Ge&&Ve),ze=!A.isInsideNewMobileApp&&!ee&&!!ie,We=we||Re||Boolean(null===(d=De.current)||void 0===d?void 0:d.clientHeight),Ke=Boolean(null===(C=Ne.current)||void 0===C?void 0:C.clientHeight),Ye=We&&Ke,Ze=Ge?V:h,Je="string"==typeof W.app.app_key?W.app.app_key:null,Qe="string"==typeof Ee.package?Ee.package:void 0,Xe=l.useStyles({isCompletionApp:Ve,isSustainabilityApp:He,isAccordionRequired:Ye,isRemoveButtonVisible:ze}),$e=function(e,s){return Pe((function(i){return w(w({},i),{},M.default({},e,s))}))},es=function(e){return Pe((function(s){return w(w({},s),e)}))};i.useEffect((function(){he||Se(!0)}),[he]),i.useEffect((function(){n.debounce(ve,200)(!0)}),[]);var ss=p.jsxs("div",{className:Xe.modalTitleContainer,children:[p.jsx(O.AppIcon,{className:Xe.appIcon,segment:[de],iconUrl:null==W||null===(N=W.app)||void 0===N||null===(R=N.icon)||void 0===R?void 0:R.url,height:48,width:48}),p.jsxs("div",{children:[p.jsx("div",{children:"".concat(Y," Settings")}),p.jsx(k.HideInNativeApp,{children:p.jsxs("div",{"data-testid":"".concat(F,"_appstoreLink"),className:Xe.appStoreButton,onClick:function(){var e,s;return window.open((s=null==W||null===(e=W.app)||void 0===e?void 0:e.id,"/app-store/app/".concat(s)),"_top")},children:["Open in Appstore ",p.jsx(r.ArrowForward,{className:Xe.arrowIcon})]})})]})]}),is=p.jsxs("div",{className:Xe.modalActions,children:[ze&&p.jsx(u.default,{appName:Y,onAppRemove:ie}),p.jsxs("div",{children:[p.jsx(q,{"data-testid":"".concat(F,"_cancel"),variation:"secondary",onClick:ue,children:"Cancel"}),ee&&p.jsx(q,{variation:"primary",onClick:function(){return oe()},children:"Copy Dashboard"}),!ee&&p.jsx(q,{"data-testid":"".concat(F,"_save"),className:Xe.saveButton,variation:"primary",onClick:function(){if(Ee.package||Le){if(Ue&&!Ge){var e,s,i,n,o=null==_e||null===(e=_e.primaryAsset)||void 0===e||null===(s=e.assetType)||void 0===s?void 0:s.id,r=null==_e||null===(i=_e.primaryAsset)||void 0===i||null===(n=i.assetType)||void 0===n?void 0:n.label;if(o&&!Ee[o])return void Ae("Please select ".concat(r))}re(Ee),x.showSuccessNotification("Successfully saved"),ue()}else Ae("Please select app version")},children:"Save"})]})]});return p.jsx(I,{actions:is,closeIconClassName:Xe.closeIcon,contentContainerClassName:Xe.modalContainer,modalTitleClassName:Xe.modalTitle,onClose:ue,open:!0,title:ss,children:p.jsxs(m,{ErrorView:j,openIntercom:te,children:[p.jsx(b,{open:!!ye,isShowCancel:!1,title:"Validation failed",text:ye,handleOk:function(){return Ae("")},classes:{confirmation:Xe.confirmationText}}),ee&&p.jsx(_,{}),!ee&&Ie&&!Ke&&!We&&p.jsx(t,{image:t.IMAGES.UnderConstruction,title:"No app settings"}),!ee&&p.jsxs(p.Fragment,{children:[p.jsxs(a.SettingsAccordion,{defaultExpanded:!0,className:Xe.assetAccordion,accordionDetailsRef:De,isAccordionRequired:Ye,summary:"Asset",children:[Be&&p.jsxs(o.FormControl,{className:Xe.segmentSelector,children:[p.jsx(o.InputLabel,{children:"Segment"}),p.jsx(o.Select,{value:de,onChange:function(e){var s=String(e.target.value);ke.current=null,Se(!1),me(s),Pe(w(w({package:Ee.package,segment:s},n.mapValues(n.keyBy(f.ASSET_TYPES,"id"),(function(){return null}))),{},{assets:null}))},children:Fe.map((function(e){return p.jsx(o.MenuItem,{className:Xe.segmentMenuItem,value:e,children:e},e)}))})]}),Ue&&he&&_e&&p.jsx(Ze,{appKey:Le?null:Je,appType:_e,defaultValue:ke.current,secondaryDefaultValue:+(null==K||null===(H=K.well)||void 0===H?void 0:H.id),isHiddenTitle:!0,isNullable:Ge,label:"Asset",onSettingsChange:es,settings:Ee}),p.jsx(S.default,{className:Xe.appVersionSelect,appId:W.app.id,value:Qe,onChange:function(e,s,i){return i&&D.isReact18Host()?es({package:e,react18AutoSwitchDisabled:!0}):$e("package",e)}})]}),p.jsx(m,{ErrorView:B,openIntercom:te,children:p.jsx(a.SettingsAccordion,{accordionDetailsRef:Ne,className:Xe.accordion,defaultExpanded:!0,isAccordionRequired:Ye,summary:"App Settings",children:z&&p.jsx(z,{app:W,appData:K,settings:Ee,onSettingChange:$e,onSettingsChange:es,layoutEnvironment:se,currentUser:Z})})})]})]})})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),n=require("lodash"),o=require("@material-ui/core"),r=require("@material-ui/icons"),t=require("../../../../EmptyState/EmptyState.js"),c=require("../../utils.js"),u=require("./components/RemoveAppButton.js"),a=require("./components/SettingsAccordion.js"),l=require("./styles.js");require("@babel/runtime/helpers/objectWithoutProperties"),require("@material-ui/pickers"),require("@date-io/moment"),require("moment"),require("../../../../../config/theme/index.js");var p=require("react/jsx-runtime"),d=require("../../../../../hocs/withAssetEditorLockHOC.js"),m=require("../../../../ErrorBoundary/ErrorBoundary.js"),j=require("../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js"),q=require("../../../../Button/components/Button/index.js");require("moment-timezone"),require("classnames"),require("../../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../../../../Button/components/LiveButton/styles.js"),require("@icon-park/react/es/all"),require("../../../../../icons/IconParkProvider.js"),require("../../../../../icons/customIcons/icons/AddMessage.js"),require("../../../../../icons/customIcons/icons/DragOne.js"),require("../../../../../icons/customIcons/icons/Attention.js"),require("../../../../../icons/customIcons/icons/Collapse.js"),require("../../../../../icons/customIcons/icons/Dashboard.js"),require("../../../../../icons/customIcons/icons/Expand.js"),require("../../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../../icons/customIcons/icons/Search.js"),require("../../../../../icons/customIcons/icons/SearchOne.js"),require("../../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../../icons/customIcons/icons/MultiRuler.js"),require("../../../../../icons/customIcons/icons/Checkbox.js"),require("../../../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../../../icons/customIcons/icons/Radio.js"),require("../../../../../icons/customIcons/icons/RadioChecked.js"),require("../../../../../icons/customIcons/icons/SimulFrac.js"),require("../../../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../../../icons/customIcons/icons/CautionFilled.js"),require("../../../../../icons/customIcons/icons/InfoRounded.js"),require("../../../../../icons/customIcons/icons/FlameFilled.js"),require("../../../../../icons/customIcons/icons/MoreApp.js"),require("../../../../../icons/customIcons/icons/Pad.js"),require("../../../../../icons/customIcons/icons/DrilloutUnit.js"),require("../../../../../icons/customIcons/icons/FracFleet.js"),require("../../../../../icons/customIcons/icons/Global.js"),require("../../../../../icons/customIcons/icons/Program.js"),require("../../../../../icons/customIcons/icons/Rig.js"),require("../../../../../icons/customIcons/icons/Well.js"),require("../../../../../icons/customIcons/icons/Gap.js"),require("../../../../../icons/customIcons/icons/Pin.js"),require("../../../../../icons/customIcons/icons/PinOne.js"),require("../../../../../icons/customIcons/icons/PinOneCrossed.js"),require("../../../../../icons/customIcons/icons/CloseOneFilled.js"),require("../../../../../icons/customIcons/icons/AttentionFilled.js"),require("../../../../../icons/customIcons/icons/CheckOneFilled.js"),require("../../../../../icons/customIcons/icons/Archive.js"),require("../../../../../icons/customIcons/icons/ArchiveCancel.js"),require("../../../../../icons/customIcons/icons/Unarchive.js"),require("../../../../../icons/customIcons/icons/Archived.js"),require("../../../../../icons/customIcons/icons/InterventionUnit.js"),require("../../../../../icons/customIcons/icons/CloudDelete.js"),require("../../../../../icons/customIcons/icons/Lasso.js"),require("../../../../../icons/customIcons/icons/Radius.js"),require("../../../../../icons/customIcons/icons/ErrorOps.js"),require("../../../../../icons/customIcons/icons/DataTypeOps.js"),require("../../../../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../../../../icons/customIcons/icons/CalibrationOps.js"),require("../../../../../icons/customIcons/icons/CriticalOps.js"),require("../../../../../icons/customIcons/icons/Company.js"),require("../../../../../icons/customIcons/icons/ArchiveOne.js"),require("../../../../../icons/customIcons/icons/ParseBotFusion.js"),require("../../../../../icons/customIcons/icons/Connect.js"),require("../../../../../icons/customIcons/icons/PuzzleOne.js"),require("../../../../../icons/customIcons/icons/Feed.js"),require("../../../../../icons/customIcons/icons/Prompt.js"),require("../../../../../icons/customIcons/icons/Companies.js"),require("../../../../../icons/customIcons/icons/ClipboardAi.js"),require("../../../../../icons/customIcons/icons/Key.js"),require("../../../../../icons/customIcons/icons/AtSignCrossed.js"),require("../../../../../icons/customIcons/icons/MappingManual.js"),require("../../../../../icons/customIcons/icons/Mapping.js"),require("../../../../../icons/customIcons/icons/Metrics.js"),require("../../../../../icons/customIcons/icons/Drops.js"),require("../../../../../icons/customIcons/icons/ClipboardSearch.js"),require("../../../../../icons/customIcons/icons/Template.js"),require("../../../../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../../../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../../../../icons/customIcons/icons/UnitConversion.js"),require("../../../../../icons/customIcons/icons/NPT.js"),require("../../../../../icons/customIcons/icons/GuidedFrac.js");var I=require("../../../../Modal/Modal.js"),v=require("../../../../../constants/devcenter.js");require("../../../../../constants/goals.js");var g=require("../../../../../constants/segment.js");require("../../../../../constants/alerts.js"),require("../../../../../constants/apps.js"),require("../../../../../constants/drillstring.js"),require("../../../../../constants/completion.js"),require("../../../../../constants/appPackages.js"),require("../../../../../constants/notifications.js"),require("../../../../../constants/feed.js"),require("../../../../../constants/bha.js");var f=require("../../../../../constants/assetTypes.js");require("../../../../../constants/corvaCompanyId.js"),require("../../../../GradientManager/configuration/constants.js");var h=require("../../../../AssetEditorV2/index.js"),S=require("../../../../AppVersionsSelect/AppVersionsSelect.js"),C=require("../../../../DisabledSettingsMessage/DisabledSettingsMessage.js"),b=require("../../../../ConfirmationDialog.js");require("../../../../UserMention/utils/index.js"),require("../../../../../utils/convert.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../../../../utils/casing/validation.js"),require("lodash/mean"),require("../../../../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver");var y=require("../../../../../utils/devcenter.js");require("../../../../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/isNumber"),require("lodash/has"),require("../../../../../utils/ga.js"),require("../../../../../utils/goalsConfig/goalsConfig.js"),require("../../../../../utils/lasParser.js"),require("../../../../../utils/main.js"),require("../../../../../utils/metrics/metricsConfig.js");var A=require("../../../../../utils/mobileDetect.js");require("../../../../../utils/feed.js"),require("../../../../../utils/reports.js");var x=require("../../../../../utils/notificationToasts.js");require("@babel/runtime/helpers/typeof"),require("../../../../../utils/dashboardReports.js"),require("../../../../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions"),require("../../../../../utils/jsonaDataFormatter.js"),require("../../../../../utils/bha.js"),require("jsona"),require("../../../../../clients/jsonApi/index.js"),require("../../../../../utils/charts/Styles.scss.js"),require("../../../../../utils/getSingleAsset.js");var O=require("../../../../AppIcon/AppIcon.js"),E=require("../../../../../permissions/usePermissions.js"),P=require("../../../../../permissions/constants/index.js");require("../../../../../permissions/withPermissionsHOC.js"),require("../../../../../permissions/ProvidePermissions.js"),require("../../../../../permissions/PermissionsContext.js");var k=require("../../../../../componentsV2/HideInNativeApp/index.js"),N=require("../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js");function D(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var M=D(e),T=D(s);function R(e,s){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),i.push.apply(i,n)}return i}function w(e){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?R(Object(i),!0).forEach((function(s){M.default(e,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))}))}return e}var F="DC_appSettings",B=function(){return null},V=d(h),_=C,G=g.SEGMENT_TO_ASSET_TYPE,L=function(){return null};exports.PAGE_NAME=F,exports.default=function(e){var s,d,C,D,R,H,U=e.AppSettingsComponent,z=void 0===U?L:U,W=e.app,K=e.appData,Y=e.appName,Z=e.currentUser,J=e.disableAppAssetSelection,Q=void 0!==J&&J,X=e.isMultiRig,$=e.isSettingsDialogHidden,ee=void 0!==$&&$,se=e.layoutEnvironment,ie=e.onAppRemove,ne=e.onCloneDashboard,oe=void 0===ne?n.noop:ne,re=e.onSettingsChange,te=e.openIntercom,ce=e.rigId,ue=e.toggleAppSettingsDialog,ae=y.getAppSegment(W),le=i.useState("string"==typeof ae?ae:g.SEGMENTS.DRILLING),pe=T.default(le,2),de=pe[0],me=pe[1],je=i.useState(!1),qe=T.default(je,2),Ie=qe[0],ve=qe[1],ge=i.useState(!0),fe=T.default(ge,2),he=fe[0],Se=fe[1],Ce=i.useState(""),be=T.default(Ce,2),ye=be[0],Ae=be[1],xe=i.useState((function(){var e,s,i=n.cloneDeep(null!==(e=W.settings)&&void 0!==e?e:{}),o="string"==typeof i.package?i.package:void 0,r="string"==typeof(null===(s=W.package)||void 0===s?void 0:s.version)?W.package.version:void 0;return w(w({},i),{},{package:o||r})})),Oe=T.default(xe,2),Ee=Oe[0],Pe=Oe[1],ke=i.useRef(ce),Ne=i.useRef(null),De=i.useRef(null),Me=E([P.PERMISSIONS.getCanReadAppPackages(W.app.id)]),Te=T.default(Me,1)[0],Re=Te.active,we=Te.loading,Fe=Array.isArray(W.segment)?W.segment.filter((function(e){return"string"==typeof e})):[],Be=Fe.length>1,Ve=de===g.SEGMENTS.COMPLETION,_e=G[de],Ge="asset"===(null==se?void 0:se.type),Le=W.id===v.DEV_CENTER_CLI_APP_ID,He=c.getIsSustainabilityApp(null==W||null===(s=W.app)||void 0===s?void 0:s.id),Ue=!(Q||A.isInsideNewMobileApp||X||Ge&&Ve),ze=!A.isInsideNewMobileApp&&!ee&&!!ie,We=we||Re||Boolean(null===(d=Ne.current)||void 0===d?void 0:d.clientHeight),Ke=Boolean(null===(C=De.current)||void 0===C?void 0:C.clientHeight),Ye=We&&Ke,Ze=Ge?V:h,Je="string"==typeof W.app.app_key?W.app.app_key:null,Qe="string"==typeof Ee.package?Ee.package:void 0,Xe=Number(null===(D=K.well)||void 0===D?void 0:D.id),$e=l.useStyles({isCompletionApp:Ve,isSustainabilityApp:He,isAccordionRequired:Ye,isRemoveButtonVisible:ze}),es=function(e,s){return Pe((function(i){return w(w({},i),{},M.default({},e,s))}))},ss=function(e){return Pe((function(s){return w(w({},s),e)}))};i.useEffect((function(){he||Se(!0)}),[he]),i.useEffect((function(){n.debounce(ve,200)(!0)}),[]);var is=p.jsxs("div",{className:$e.modalTitleContainer,children:[p.jsx(O.AppIcon,{className:$e.appIcon,segment:[de],iconUrl:null==W||null===(R=W.app)||void 0===R||null===(H=R.icon)||void 0===H?void 0:H.url,height:48,width:48}),p.jsxs("div",{children:[p.jsx("div",{children:"".concat(Y," Settings")}),p.jsx(k.HideInNativeApp,{children:p.jsxs("div",{"data-testid":"".concat(F,"_appstoreLink"),className:$e.appStoreButton,onClick:function(){var e,s;return window.open((s=null==W||null===(e=W.app)||void 0===e?void 0:e.id,"/app-store/app/".concat(s)),"_top")},children:["Open in Appstore ",p.jsx(r.ArrowForward,{className:$e.arrowIcon})]})})]})]}),ns=p.jsxs("div",{className:$e.modalActions,children:[ze&&p.jsx(u.default,{appName:Y,onAppRemove:ie}),p.jsxs("div",{children:[p.jsx(q,{"data-testid":"".concat(F,"_cancel"),variation:"secondary",onClick:ue,children:"Cancel"}),ee&&p.jsx(q,{variation:"primary",onClick:function(){return oe()},children:"Copy Dashboard"}),!ee&&p.jsx(q,{"data-testid":"".concat(F,"_save"),className:$e.saveButton,variation:"primary",onClick:function(){if(Ee.package||Le){if(Ue&&!Ge){var e,s,i,n,o=null==_e||null===(e=_e.primaryAsset)||void 0===e||null===(s=e.assetType)||void 0===s?void 0:s.id,r=null==_e||null===(i=_e.primaryAsset)||void 0===i||null===(n=i.assetType)||void 0===n?void 0:n.label;if(o&&!Ee[o])return void Ae("Please select ".concat(r))}re(Ee),x.showSuccessNotification("Successfully saved"),ue()}else Ae("Please select app version")},children:"Save"})]})]});return p.jsx(I,{actions:ns,closeIconClassName:$e.closeIcon,contentContainerClassName:$e.modalContainer,modalTitleClassName:$e.modalTitle,onClose:ue,open:!0,title:is,children:p.jsxs(m,{ErrorView:j,openIntercom:te,children:[p.jsx(b,{open:!!ye,isShowCancel:!1,title:"Validation failed",text:ye,handleOk:function(){return Ae("")},classes:{confirmation:$e.confirmationText}}),ee&&p.jsx(_,{}),!ee&&Ie&&!Ke&&!We&&p.jsx(t,{image:t.IMAGES.UnderConstruction,title:"No app settings"}),!ee&&p.jsxs(p.Fragment,{children:[p.jsxs(a.SettingsAccordion,{defaultExpanded:!0,className:$e.assetAccordion,accordionDetailsRef:Ne,isAccordionRequired:Ye,summary:"Asset",children:[Be&&p.jsxs(o.FormControl,{className:$e.segmentSelector,children:[p.jsx(o.InputLabel,{children:"Segment"}),p.jsx(o.Select,{value:de,onChange:function(e){var s=String(e.target.value);ke.current=null,Se(!1),me(s),Pe(w(w({package:Ee.package,segment:s},n.mapValues(n.keyBy(f.ASSET_TYPES,"id"),(function(){return null}))),{},{assets:null}))},children:Fe.map((function(e){return p.jsx(o.MenuItem,{className:$e.segmentMenuItem,value:e,children:e},e)}))})]}),Ue&&he&&_e&&p.jsx(Ze,{appKey:Le?null:Je,appType:_e,defaultValue:ke.current,secondaryDefaultValue:Xe,isHiddenTitle:!0,isNullable:Ge,label:"Asset",onSettingsChange:ss,settings:Ee}),p.jsx(S.default,{className:$e.appVersionSelect,appId:W.app.id,value:Qe,onChange:function(e,s,i){return i&&N.isReact18Host()?ss({package:e,react18AutoSwitchDisabled:!0}):es("package",e)}})]}),p.jsx(m,{ErrorView:B,openIntercom:te,children:p.jsx(a.SettingsAccordion,{accordionDetailsRef:De,className:$e.accordion,defaultExpanded:!0,isAccordionRequired:Ye,summary:"App Settings",children:z&&p.jsx(z,{app:W,appData:K,settings:Ee,onSettingChange:es,onSettingsChange:ss,layoutEnvironment:se,currentUser:Z})})})]})]})})};
|
|
2
2
|
//# sourceMappingURL=AppSettingsDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSettingsDialog.js","sources":["../../../../../../../src/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport type { ComponentType, FC, ReactNode } from 'react';\nimport { cloneDeep, debounce, keyBy, mapValues, noop } from 'lodash';\nimport { FormControl, InputLabel, MenuItem, Select } from '@material-ui/core';\nimport type { SelectProps } from '@material-ui/core/Select';\nimport { ArrowForward as ArrowIcon } from '@material-ui/icons';\n\nimport EmptyState from '../../../../EmptyState';\nimport type {\n AppDataEntry,\n DevCenterAppResource,\n DevCenterCurrentUser,\n LayoutEnvironment,\n} from '../../types';\nimport { getIsSustainabilityApp } from '../../utils';\n\nimport { RemoveAppButton, SettingsAccordion } from './components';\nimport { useStyles } from './styles';\n\nimport { withAssetEditorLockHOC } from '~/hocs';\nimport ErrorBoundary, { DevCenterAppErrorView } from '~/components/ErrorBoundary';\nimport Button from '~/components/Button';\nimport Modal from '~/components/Modal';\nimport { ASSET_TYPES, DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport AssetEditor, { AssetEditorAppType } from '~/components/AssetEditorV2';\nimport AppVersionsSelect from '~/components/AppVersionsSelect';\nimport { DisabledSettingsMessage } from '~/components/DisabledSettingsMessage';\nimport ConfirmationDialog from '~/components/ConfirmationDialog';\nimport { SEGMENT_TO_ASSET_TYPE, SEGMENTS } from '~/constants/segment';\nimport { showSuccessNotification } from '~/utils';\nimport AppIcon from '~/components/AppIcon';\nimport { getAppSegment } from '~/utils/devcenter';\nimport { PERMISSIONS, usePermissions } from '~/permissions';\nimport { isInsideNewMobileApp } from '~/utils/mobileDetect';\nimport { HideInNativeApp } from '~/componentsV2/HideInNativeApp';\n// [REACT-18-MIGRATION-TAG] PLT-3099\nimport { isReact18Host } from '~/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants';\n\nexport const PAGE_NAME = 'DC_appSettings';\n\nconst getAppPageUrl = (appId: number | string | undefined): string => `/app-store/app/${appId}`;\n\nconst AppSettingsErrorView = () => null;\n\nexport type AppSettings = {\n package?: string | null;\n padId?: number | string | null;\n segment?: string;\n} & Record<string, unknown>;\n\nexport type AppSettingsComponentProps = {\n app: DevCenterAppResource;\n appData: AppDataEntry;\n currentUser: DevCenterCurrentUser;\n layoutEnvironment?: LayoutEnvironment | null;\n onSettingChange: (name: string, value: unknown) => void;\n onSettingsChange: (settings: AppSettings) => void;\n settings: AppSettings;\n};\n\nexport type AppSettingsDialogProps = {\n AppSettingsComponent?: ComponentType<AppSettingsComponentProps> | null;\n app: DevCenterAppResource;\n appData: AppDataEntry;\n appName: string;\n currentUser: DevCenterCurrentUser;\n disableAppAssetSelection?: boolean;\n isMultiRig: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onSettingsChange: (settings: AppSettings) => void;\n openIntercom?: () => void;\n rigId?: number | string | null;\n toggleAppSettingsDialog: () => void;\n};\n\nconst AssetEditorWithLock = withAssetEditorLockHOC(AssetEditor);\n\n/*\n * AS-KEEP — DisabledSettingsMessage is still JavaScript and declares a required\n * onCloneDashboard callback, although its rendering supports an omitted callback.\n * Remove this assertion when that component is migrated to TypeScript.\n */\nconst OptionalDisabledSettingsMessage = DisabledSettingsMessage as ComponentType<{\n onCloneDashboard?: () => void;\n}>;\n\nconst ASSET_EDITOR_TYPES_BY_SEGMENT: Partial<Record<string, AssetEditorAppType>> =\n SEGMENT_TO_ASSET_TYPE;\n\nconst DEFAULT_APP_SETTINGS_COMPONENT: ComponentType<AppSettingsComponentProps> = () => null;\n\nconst AppSettingsDialog: FC<AppSettingsDialogProps> = ({\n AppSettingsComponent = DEFAULT_APP_SETTINGS_COMPONENT,\n app,\n appData,\n appName,\n currentUser,\n disableAppAssetSelection = false,\n isMultiRig,\n isSettingsDialogHidden = false,\n layoutEnvironment,\n onAppRemove,\n onCloneDashboard = noop,\n onSettingsChange,\n openIntercom,\n rigId,\n toggleAppSettingsDialog,\n}) => {\n const initialSegment = getAppSegment(app);\n\n const [appSegmentSetting, setAppSegmentSetting] = useState<string>(\n typeof initialSegment === 'string' ? initialSegment : SEGMENTS.DRILLING\n );\n const [isMounted, setIsMounted] = useState(false);\n const [isAssetSelectorRendered, setIsAssetSelectorRendered] = useState(true);\n const [validationError, setValidationError] = useState('');\n const [appSettings, setAppSettings] = useState<AppSettings>(() => {\n const settings: AppSettings = cloneDeep(app.settings ?? {});\n const settingsPackage = typeof settings.package === 'string' ? settings.package : undefined;\n const packageVersion =\n typeof app.package?.version === 'string' ? app.package.version : undefined;\n\n return {\n ...settings,\n package: settingsPackage || packageVersion,\n };\n });\n\n // NOTE: Keep in ref to have a way to reset default value\n // of asset selector when changing app segment\n const defaultRigId = useRef<number | string | null | undefined>(rigId);\n const platformAppSettingsRef = useRef<HTMLDivElement | null>(null);\n const customAppSettingsRef = useRef<HTMLDivElement | null>(null);\n\n const [{ active: canReadAppPackages, loading: isPermissionsLoading }] = usePermissions([\n PERMISSIONS.getCanReadAppPackages(app.app.id),\n ]);\n\n const appSegments = Array.isArray(app.segment)\n ? app.segment.filter((segment): segment is string => typeof segment === 'string')\n : [];\n const hasSegmentSelector = appSegments.length > 1;\n const isCompletionSegment = appSegmentSetting === SEGMENTS.COMPLETION;\n const assetEditorAppType = ASSET_EDITOR_TYPES_BY_SEGMENT[appSegmentSetting];\n const isAssetPage = layoutEnvironment?.type === 'asset';\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n const isSustainabilityApp = getIsSustainabilityApp(app?.app?.id);\n\n const isAssetSelectorVisible =\n !disableAppAssetSelection &&\n !isInsideNewMobileApp &&\n !isMultiRig &&\n !(isAssetPage && isCompletionSegment);\n const isRemoveButtonVisible = !isInsideNewMobileApp && !isSettingsDialogHidden && !!onAppRemove;\n\n const hasPlatformAppSettings =\n isPermissionsLoading ||\n canReadAppPackages ||\n Boolean(platformAppSettingsRef.current?.clientHeight);\n const hasCustomAppSettings = Boolean(customAppSettingsRef.current?.clientHeight);\n const isAccordionRequired = hasPlatformAppSettings && hasCustomAppSettings;\n\n const AssetEditorComponent = isAssetPage ? AssetEditorWithLock : AssetEditor;\n const appKey = typeof app.app.app_key === 'string' ? app.app.app_key : null;\n const selectedPackage = typeof appSettings.package === 'string' ? appSettings.package : undefined;\n\n const styles = useStyles({\n isCompletionApp: isCompletionSegment,\n isSustainabilityApp,\n isAccordionRequired,\n isRemoveButtonVisible,\n });\n\n const handleChangeAppSegment: SelectProps['onChange'] = event => {\n const nextSegment = String(event.target.value);\n\n defaultRigId.current = null;\n setIsAssetSelectorRendered(false);\n\n setAppSegmentSetting(nextSegment);\n setAppSettings({\n package: appSettings.package,\n segment: nextSegment,\n // NOTE: we need to reset asset ids when segment is changed\n ...mapValues(keyBy(ASSET_TYPES, 'id'), () => null),\n assets: null,\n });\n };\n\n const handleAppSettingChange = (name: string, value: unknown) =>\n setAppSettings(prevSettings => ({\n ...prevSettings,\n [name]: value,\n }));\n\n const handleAppSettingsChange = (newSettings: AppSettings) =>\n setAppSettings(prevSettings => ({ ...prevSettings, ...newSettings }));\n\n const handleSave = () => {\n if (!appSettings.package && !isCLIApp) {\n setValidationError('Please select app version');\n return;\n }\n\n if (isAssetSelectorVisible && !isAssetPage) {\n const appTypeKey = assetEditorAppType?.primaryAsset?.assetType?.id;\n const appTypeLabel = assetEditorAppType?.primaryAsset?.assetType?.label;\n\n if (appTypeKey && !appSettings[appTypeKey]) {\n setValidationError(`Please select ${appTypeLabel}`);\n return;\n }\n }\n\n onSettingsChange(appSettings);\n showSuccessNotification('Successfully saved');\n toggleAppSettingsDialog();\n };\n\n const handleAppVersionChange = (value: string, _appPackage: unknown, isUserChange: boolean) =>\n // [REACT-18-MIGRATION-TAG] PLT-3099: a genuine user pick on a React-18 host opts the app out\n // of the auto-switch; the auto-preselect must not (isUserChange).\n isUserChange && isReact18Host()\n ? handleAppSettingsChange({ package: value, react18AutoSwitchDisabled: true })\n : handleAppSettingChange('package', value);\n\n useEffect(() => {\n if (!isAssetSelectorRendered) setIsAssetSelectorRendered(true);\n }, [isAssetSelectorRendered]);\n\n useEffect(() => {\n const debouncedSetIsMounted = debounce(setIsMounted, 200);\n debouncedSetIsMounted(true);\n }, []);\n\n const modalTitle: ReactNode = (\n <div className={styles.modalTitleContainer}>\n <AppIcon\n className={styles.appIcon}\n segment={[appSegmentSetting]}\n iconUrl={app?.app?.icon?.url}\n height={48}\n width={48}\n />\n <div>\n <div>{`${appName} Settings`}</div>\n <HideInNativeApp>\n <div\n data-testid={`${PAGE_NAME}_appstoreLink`}\n className={styles.appStoreButton}\n onClick={() => window.open(getAppPageUrl(app?.app?.id), '_top')}\n >\n Open in Appstore <ArrowIcon className={styles.arrowIcon} />\n </div>\n </HideInNativeApp>\n </div>\n </div>\n );\n\n const modalActions = (\n <div className={styles.modalActions}>\n {isRemoveButtonVisible && <RemoveAppButton appName={appName} onAppRemove={onAppRemove} />}\n <div>\n <Button\n data-testid={`${PAGE_NAME}_cancel`}\n variation=\"secondary\"\n onClick={toggleAppSettingsDialog}\n >\n Cancel\n </Button>\n {isSettingsDialogHidden && (\n <Button variation=\"primary\" onClick={() => onCloneDashboard()}>\n Copy Dashboard\n </Button>\n )}\n {!isSettingsDialogHidden && (\n <Button\n data-testid={`${PAGE_NAME}_save`}\n className={styles.saveButton}\n variation=\"primary\"\n onClick={handleSave}\n >\n Save\n </Button>\n )}\n </div>\n </div>\n );\n\n return (\n <Modal\n actions={modalActions}\n closeIconClassName={styles.closeIcon}\n contentContainerClassName={styles.modalContainer}\n modalTitleClassName={styles.modalTitle}\n onClose={toggleAppSettingsDialog}\n open\n title={modalTitle}\n >\n <ErrorBoundary ErrorView={DevCenterAppErrorView} openIntercom={openIntercom}>\n <ConfirmationDialog\n open={!!validationError}\n isShowCancel={false}\n title=\"Validation failed\"\n text={validationError}\n handleOk={() => setValidationError('')}\n classes={{ confirmation: styles.confirmationText }}\n />\n {isSettingsDialogHidden && <OptionalDisabledSettingsMessage />}\n {!isSettingsDialogHidden &&\n isMounted &&\n !hasCustomAppSettings &&\n !hasPlatformAppSettings && (\n <EmptyState image={EmptyState.IMAGES.UnderConstruction} title=\"No app settings\" />\n )}\n {!isSettingsDialogHidden && (\n <>\n <SettingsAccordion\n defaultExpanded\n className={styles.assetAccordion}\n accordionDetailsRef={platformAppSettingsRef}\n isAccordionRequired={isAccordionRequired}\n summary=\"Asset\"\n >\n {hasSegmentSelector && (\n <FormControl className={styles.segmentSelector}>\n <InputLabel>Segment</InputLabel>\n <Select value={appSegmentSetting} onChange={handleChangeAppSegment}>\n {appSegments.map(segmentItem => (\n <MenuItem\n className={styles.segmentMenuItem}\n key={segmentItem}\n value={segmentItem}\n >\n {segmentItem}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )}\n {isAssetSelectorVisible && isAssetSelectorRendered && assetEditorAppType && (\n <AssetEditorComponent\n appKey={isCLIApp ? null : appKey}\n appType={assetEditorAppType}\n defaultValue={defaultRigId.current}\n secondaryDefaultValue={+appData?.well?.id}\n isHiddenTitle\n isNullable={isAssetPage}\n label=\"Asset\"\n onSettingsChange={handleAppSettingsChange}\n settings={appSettings}\n />\n )}\n <AppVersionsSelect\n className={styles.appVersionSelect}\n appId={app.app.id}\n value={selectedPackage}\n onChange={handleAppVersionChange}\n />\n </SettingsAccordion>\n <ErrorBoundary ErrorView={AppSettingsErrorView} openIntercom={openIntercom}>\n <SettingsAccordion\n accordionDetailsRef={customAppSettingsRef}\n className={styles.accordion}\n defaultExpanded\n isAccordionRequired={isAccordionRequired}\n summary=\"App Settings\"\n >\n {AppSettingsComponent && (\n <AppSettingsComponent\n app={app}\n appData={appData}\n settings={appSettings}\n onSettingChange={handleAppSettingChange}\n onSettingsChange={handleAppSettingsChange}\n layoutEnvironment={layoutEnvironment}\n currentUser={currentUser}\n />\n )}\n </SettingsAccordion>\n </ErrorBoundary>\n </>\n )}\n </ErrorBoundary>\n </Modal>\n );\n};\n\nexport default AppSettingsDialog;\n"],"names":["PAGE_NAME","AppSettingsErrorView","AssetEditorWithLock","withAssetEditorLockHOC","AssetEditor","OptionalDisabledSettingsMessage","DisabledSettingsMessage","ASSET_EDITOR_TYPES_BY_SEGMENT","SEGMENT_TO_ASSET_TYPE","DEFAULT_APP_SETTINGS_COMPONENT","_ref","_app$app","_platformAppSettingsR","_customAppSettingsRef","_app$app2","_app$app2$icon","_appData$well","_ref$AppSettingsCompo","AppSettingsComponent","app","appData","appName","currentUser","_ref$disableAppAssetS","disableAppAssetSelection","isMultiRig","_ref$isSettingsDialog","isSettingsDialogHidden","layoutEnvironment","onAppRemove","_ref$onCloneDashboard","onCloneDashboard","noop","onSettingsChange","openIntercom","rigId","toggleAppSettingsDialog","initialSegment","getAppSegment","_useState","useState","SEGMENTS","DRILLING","_useState2","_slicedToArray","appSegmentSetting","setAppSegmentSetting","_useState4","_useState3","isMounted","setIsMounted","_useState6","_useState5","isAssetSelectorRendered","setIsAssetSelectorRendered","_useState8","_useState7","validationError","setValidationError","_app$settings","_app$package","settings","cloneDeep","settingsPackage","package","undefined","packageVersion","version","_objectSpread","_useState10","_useState9","appSettings","setAppSettings","defaultRigId","useRef","platformAppSettingsRef","customAppSettingsRef","_usePermissions","usePermissions","PERMISSIONS","getCanReadAppPackages","id","_usePermissions2$","canReadAppPackages","active","isPermissionsLoading","loading","appSegments","Array","isArray","segment","filter","hasSegmentSelector","length","isCompletionSegment","COMPLETION","assetEditorAppType","isAssetPage","type","isCLIApp","DEV_CENTER_CLI_APP_ID","isSustainabilityApp","getIsSustainabilityApp","isAssetSelectorVisible","isInsideNewMobileApp","isRemoveButtonVisible","hasPlatformAppSettings","Boolean","current","clientHeight","hasCustomAppSettings","isAccordionRequired","AssetEditorComponent","appKey","app_key","selectedPackage","styles","useStyles","isCompletionApp","handleAppSettingChange","name","value","prevSettings","_defineProperty","handleAppSettingsChange","newSettings","useEffect","debounce","debouncedSetIsMounted","modalTitle","_jsxs","jsxs","className","modalTitleContainer","children","_jsx","AppIcon","appIcon","iconUrl","icon","url","height","width","jsx","concat","HideInNativeApp","appStoreButton","onClick","_app$app3","appId","window","open","ArrowIcon","arrowIcon","modalActions","RemoveAppButton","Button","variation","saveButton","_assetEditorAppType$p","_assetEditorAppType$p2","_assetEditorAppType$p3","_assetEditorAppType$p4","appTypeKey","primaryAsset","assetType","appTypeLabel","label","showSuccessNotification","Modal","actions","closeIconClassName","closeIcon","contentContainerClassName","modalContainer","modalTitleClassName","onClose","title","ErrorBoundary","ErrorView","DevCenterAppErrorView","ConfirmationDialog","isShowCancel","text","handleOk","classes","confirmation","confirmationText","EmptyState","image","IMAGES","UnderConstruction","_Fragment","SettingsAccordion","defaultExpanded","assetAccordion","accordionDetailsRef","summary","FormControl","segmentSelector","InputLabel","Select","onChange","event","nextSegment","String","target","mapValues","keyBy","ASSET_TYPES","assets","map","segmentItem","MenuItem","segmentMenuItem","appType","defaultValue","secondaryDefaultValue","well","isHiddenTitle","isNullable","AppVersionsSelect","appVersionSelect","_appPackage","isUserChange","isReact18Host","react18AutoSwitchDisabled","accordion","onSettingChange"],"mappings":"2/SAsCO,IAAMA,EAAY,iBAInBC,EAAuB,WAAH,OAAS,IAAI,EAoCjCC,EAAsBC,EAAuBC,GAO7CC,EAAkCC,EAIlCC,EACJC,EAAAA,sBAEIC,EAA2E,WAAH,OAAS,IAAI,sCAErC,SAgBhDC,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAP,EAfJQ,qBAAAA,aAAuBT,EAA8BQ,EACr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B2F,GAClB/D,SAAUU,KAGdgE,MAACsF,UAAiB,CAChBzF,UAAWhB,GAAO0G,iBAClBzE,MAAOlI,EAAIA,IAAI8D,GACfwC,MAAON,GACPuF,SA1IiB,SAACjF,EAAesG,EAAsBC,GAAqB,OAGxFA,GAAgBC,EAAAA,gBACZrG,GAAwB,CAAE5D,QAASyD,EAAOyG,2BAA2B,IACrE3G,GAAuB,UAAWE,EAAM,OAwIpCc,MAAC2C,EAAa,CAACC,UAAWlL,EAAsBiC,aAAcA,GAAaoG,SACzEC,MAAC0D,oBAAiB,CAChBG,oBAAqBxH,GACrBwD,UAAWhB,GAAO+G,UAClBjC,iBAAe,EACfnF,oBAAqBA,GACrBsF,QAAQ,eAAc/D,SAErBpH,GACCqH,EAAAQ,IAAC7H,EAAoB,CACnBC,IAAKA,EACLC,QAASA,EACTyC,SAAUU,GACV6J,gBAAiB7G,GACjBtF,iBAAkB2F,GAClBhG,kBAAmBA,GACnBN,YAAaA,eAUjC"}
|
|
1
|
+
{"version":3,"file":"AppSettingsDialog.js","sources":["../../../../../../../src/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport type { ComponentType, FC, ReactNode } from 'react';\nimport { cloneDeep, debounce, keyBy, mapValues, noop } from 'lodash';\nimport { FormControl, InputLabel, MenuItem, Select } from '@material-ui/core';\nimport type { SelectProps } from '@material-ui/core/Select';\nimport { ArrowForward as ArrowIcon } from '@material-ui/icons';\n\nimport EmptyState from '../../../../EmptyState';\nimport type {\n AppDataEntry,\n DevCenterAppResource,\n DevCenterCurrentUser,\n LayoutEnvironment,\n} from '../../types';\nimport { getIsSustainabilityApp } from '../../utils';\n\nimport { RemoveAppButton, SettingsAccordion } from './components';\nimport { useStyles } from './styles';\n\nimport { withAssetEditorLockHOC } from '~/hocs';\nimport ErrorBoundary, { DevCenterAppErrorView } from '~/components/ErrorBoundary';\nimport Button from '~/components/Button';\nimport Modal from '~/components/Modal';\nimport { ASSET_TYPES, DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport AssetEditor, { AssetEditorAppType } from '~/components/AssetEditorV2';\nimport AppVersionsSelect from '~/components/AppVersionsSelect';\nimport { DisabledSettingsMessage } from '~/components/DisabledSettingsMessage';\nimport ConfirmationDialog from '~/components/ConfirmationDialog';\nimport { SEGMENT_TO_ASSET_TYPE, SEGMENTS } from '~/constants/segment';\nimport { showSuccessNotification } from '~/utils';\nimport AppIcon from '~/components/AppIcon';\nimport { getAppSegment } from '~/utils/devcenter';\nimport { PERMISSIONS, usePermissions } from '~/permissions';\nimport { isInsideNewMobileApp } from '~/utils/mobileDetect';\nimport { HideInNativeApp } from '~/componentsV2/HideInNativeApp';\n// [REACT-18-MIGRATION-TAG] PLT-3099\nimport { isReact18Host } from '~/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants';\n\nexport const PAGE_NAME = 'DC_appSettings';\n\nconst getAppPageUrl = (appId: number | string | undefined): string => `/app-store/app/${appId}`;\n\nconst AppSettingsErrorView = () => null;\n\nexport type AppSettings = {\n package?: string | null;\n padId?: number | string | null;\n segment?: string;\n} & Record<string, unknown>;\n\nexport type AppSettingsComponentProps = {\n app: DevCenterAppResource;\n appData: AppDataEntry;\n currentUser: DevCenterCurrentUser;\n layoutEnvironment?: LayoutEnvironment | null;\n onSettingChange: (name: string, value: unknown) => void;\n onSettingsChange: (settings: AppSettings) => void;\n settings: AppSettings;\n};\n\nexport type AppSettingsDialogProps = {\n AppSettingsComponent?: ComponentType<AppSettingsComponentProps> | null;\n app: DevCenterAppResource;\n appData: AppDataEntry;\n appName: string;\n currentUser: DevCenterCurrentUser;\n disableAppAssetSelection?: boolean;\n isMultiRig: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onSettingsChange: (settings: AppSettings) => void;\n openIntercom?: () => void;\n rigId?: number | string | null;\n toggleAppSettingsDialog: () => void;\n};\n\nconst AssetEditorWithLock = withAssetEditorLockHOC(AssetEditor);\n\n/*\n * AS-KEEP — DisabledSettingsMessage is still JavaScript and declares a required\n * onCloneDashboard callback, although its rendering supports an omitted callback.\n * Remove this assertion when that component is migrated to TypeScript.\n */\nconst OptionalDisabledSettingsMessage = DisabledSettingsMessage as ComponentType<{\n onCloneDashboard?: () => void;\n}>;\n\nconst ASSET_EDITOR_TYPES_BY_SEGMENT: Partial<Record<string, AssetEditorAppType>> =\n SEGMENT_TO_ASSET_TYPE;\n\nconst DEFAULT_APP_SETTINGS_COMPONENT: ComponentType<AppSettingsComponentProps> = () => null;\n\nconst AppSettingsDialog: FC<AppSettingsDialogProps> = ({\n AppSettingsComponent = DEFAULT_APP_SETTINGS_COMPONENT,\n app,\n appData,\n appName,\n currentUser,\n disableAppAssetSelection = false,\n isMultiRig,\n isSettingsDialogHidden = false,\n layoutEnvironment,\n onAppRemove,\n onCloneDashboard = noop,\n onSettingsChange,\n openIntercom,\n rigId,\n toggleAppSettingsDialog,\n}) => {\n const initialSegment = getAppSegment(app);\n\n const [appSegmentSetting, setAppSegmentSetting] = useState<string>(\n typeof initialSegment === 'string' ? initialSegment : SEGMENTS.DRILLING\n );\n const [isMounted, setIsMounted] = useState(false);\n const [isAssetSelectorRendered, setIsAssetSelectorRendered] = useState(true);\n const [validationError, setValidationError] = useState('');\n const [appSettings, setAppSettings] = useState<AppSettings>(() => {\n const settings: AppSettings = cloneDeep(app.settings ?? {});\n const settingsPackage = typeof settings.package === 'string' ? settings.package : undefined;\n const packageVersion =\n typeof app.package?.version === 'string' ? app.package.version : undefined;\n\n return {\n ...settings,\n package: settingsPackage || packageVersion,\n };\n });\n\n // NOTE: Keep in ref to have a way to reset default value\n // of asset selector when changing app segment\n const defaultRigId = useRef<number | string | null | undefined>(rigId);\n const platformAppSettingsRef = useRef<HTMLDivElement | null>(null);\n const customAppSettingsRef = useRef<HTMLDivElement | null>(null);\n\n const [{ active: canReadAppPackages, loading: isPermissionsLoading }] = usePermissions([\n PERMISSIONS.getCanReadAppPackages(app.app.id),\n ]);\n\n const appSegments = Array.isArray(app.segment)\n ? app.segment.filter((segment): segment is string => typeof segment === 'string')\n : [];\n const hasSegmentSelector = appSegments.length > 1;\n const isCompletionSegment = appSegmentSetting === SEGMENTS.COMPLETION;\n const assetEditorAppType = ASSET_EDITOR_TYPES_BY_SEGMENT[appSegmentSetting];\n const isAssetPage = layoutEnvironment?.type === 'asset';\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n const isSustainabilityApp = getIsSustainabilityApp(app?.app?.id);\n\n const isAssetSelectorVisible =\n !disableAppAssetSelection &&\n !isInsideNewMobileApp &&\n !isMultiRig &&\n !(isAssetPage && isCompletionSegment);\n const isRemoveButtonVisible = !isInsideNewMobileApp && !isSettingsDialogHidden && !!onAppRemove;\n\n const hasPlatformAppSettings =\n isPermissionsLoading ||\n canReadAppPackages ||\n Boolean(platformAppSettingsRef.current?.clientHeight);\n const hasCustomAppSettings = Boolean(customAppSettingsRef.current?.clientHeight);\n const isAccordionRequired = hasPlatformAppSettings && hasCustomAppSettings;\n\n const AssetEditorComponent = isAssetPage ? AssetEditorWithLock : AssetEditor;\n const appKey = typeof app.app.app_key === 'string' ? app.app.app_key : null;\n const selectedPackage = typeof appSettings.package === 'string' ? appSettings.package : undefined;\n const secondaryDefaultValue = Number(appData.well?.id);\n\n const styles = useStyles({\n isCompletionApp: isCompletionSegment,\n isSustainabilityApp,\n isAccordionRequired,\n isRemoveButtonVisible,\n });\n\n const handleChangeAppSegment: SelectProps['onChange'] = event => {\n const nextSegment = String(event.target.value);\n\n defaultRigId.current = null;\n setIsAssetSelectorRendered(false);\n\n setAppSegmentSetting(nextSegment);\n setAppSettings({\n package: appSettings.package,\n segment: nextSegment,\n // NOTE: we need to reset asset ids when segment is changed\n ...mapValues(keyBy(ASSET_TYPES, 'id'), () => null),\n assets: null,\n });\n };\n\n const handleAppSettingChange = (name: string, value: unknown) =>\n setAppSettings(prevSettings => ({\n ...prevSettings,\n [name]: value,\n }));\n\n const handleAppSettingsChange = (newSettings: AppSettings) =>\n setAppSettings(prevSettings => ({ ...prevSettings, ...newSettings }));\n\n const handleSave = () => {\n if (!appSettings.package && !isCLIApp) {\n setValidationError('Please select app version');\n return;\n }\n\n if (isAssetSelectorVisible && !isAssetPage) {\n const appTypeKey = assetEditorAppType?.primaryAsset?.assetType?.id;\n const appTypeLabel = assetEditorAppType?.primaryAsset?.assetType?.label;\n\n if (appTypeKey && !appSettings[appTypeKey]) {\n setValidationError(`Please select ${appTypeLabel}`);\n return;\n }\n }\n\n onSettingsChange(appSettings);\n showSuccessNotification('Successfully saved');\n toggleAppSettingsDialog();\n };\n\n const handleAppVersionChange = (value: string, _appPackage: unknown, isUserChange: boolean) =>\n // [REACT-18-MIGRATION-TAG] PLT-3099: a genuine user pick on a React-18 host opts the app out\n // of the auto-switch; the auto-preselect must not (isUserChange).\n isUserChange && isReact18Host()\n ? handleAppSettingsChange({ package: value, react18AutoSwitchDisabled: true })\n : handleAppSettingChange('package', value);\n\n useEffect(() => {\n if (!isAssetSelectorRendered) setIsAssetSelectorRendered(true);\n }, [isAssetSelectorRendered]);\n\n useEffect(() => {\n const debouncedSetIsMounted = debounce(setIsMounted, 200);\n debouncedSetIsMounted(true);\n }, []);\n\n const modalTitle: ReactNode = (\n <div className={styles.modalTitleContainer}>\n <AppIcon\n className={styles.appIcon}\n segment={[appSegmentSetting]}\n iconUrl={app?.app?.icon?.url}\n height={48}\n width={48}\n />\n <div>\n <div>{`${appName} Settings`}</div>\n <HideInNativeApp>\n <div\n data-testid={`${PAGE_NAME}_appstoreLink`}\n className={styles.appStoreButton}\n onClick={() => window.open(getAppPageUrl(app?.app?.id), '_top')}\n >\n Open in Appstore <ArrowIcon className={styles.arrowIcon} />\n </div>\n </HideInNativeApp>\n </div>\n </div>\n );\n\n const modalActions = (\n <div className={styles.modalActions}>\n {isRemoveButtonVisible && <RemoveAppButton appName={appName} onAppRemove={onAppRemove} />}\n <div>\n <Button\n data-testid={`${PAGE_NAME}_cancel`}\n variation=\"secondary\"\n onClick={toggleAppSettingsDialog}\n >\n Cancel\n </Button>\n {isSettingsDialogHidden && (\n <Button variation=\"primary\" onClick={() => onCloneDashboard()}>\n Copy Dashboard\n </Button>\n )}\n {!isSettingsDialogHidden && (\n <Button\n data-testid={`${PAGE_NAME}_save`}\n className={styles.saveButton}\n variation=\"primary\"\n onClick={handleSave}\n >\n Save\n </Button>\n )}\n </div>\n </div>\n );\n\n return (\n <Modal\n actions={modalActions}\n closeIconClassName={styles.closeIcon}\n contentContainerClassName={styles.modalContainer}\n modalTitleClassName={styles.modalTitle}\n onClose={toggleAppSettingsDialog}\n open\n title={modalTitle}\n >\n <ErrorBoundary ErrorView={DevCenterAppErrorView} openIntercom={openIntercom}>\n <ConfirmationDialog\n open={!!validationError}\n isShowCancel={false}\n title=\"Validation failed\"\n text={validationError}\n handleOk={() => setValidationError('')}\n classes={{ confirmation: styles.confirmationText }}\n />\n {isSettingsDialogHidden && <OptionalDisabledSettingsMessage />}\n {!isSettingsDialogHidden &&\n isMounted &&\n !hasCustomAppSettings &&\n !hasPlatformAppSettings && (\n <EmptyState image={EmptyState.IMAGES.UnderConstruction} title=\"No app settings\" />\n )}\n {!isSettingsDialogHidden && (\n <>\n <SettingsAccordion\n defaultExpanded\n className={styles.assetAccordion}\n accordionDetailsRef={platformAppSettingsRef}\n isAccordionRequired={isAccordionRequired}\n summary=\"Asset\"\n >\n {hasSegmentSelector && (\n <FormControl className={styles.segmentSelector}>\n <InputLabel>Segment</InputLabel>\n <Select value={appSegmentSetting} onChange={handleChangeAppSegment}>\n {appSegments.map(segmentItem => (\n <MenuItem\n className={styles.segmentMenuItem}\n key={segmentItem}\n value={segmentItem}\n >\n {segmentItem}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )}\n {isAssetSelectorVisible && isAssetSelectorRendered && assetEditorAppType && (\n <AssetEditorComponent\n appKey={isCLIApp ? null : appKey}\n appType={assetEditorAppType}\n defaultValue={defaultRigId.current}\n secondaryDefaultValue={secondaryDefaultValue}\n isHiddenTitle\n isNullable={isAssetPage}\n label=\"Asset\"\n onSettingsChange={handleAppSettingsChange}\n settings={appSettings}\n />\n )}\n <AppVersionsSelect\n className={styles.appVersionSelect}\n appId={app.app.id}\n value={selectedPackage}\n onChange={handleAppVersionChange}\n />\n </SettingsAccordion>\n <ErrorBoundary ErrorView={AppSettingsErrorView} openIntercom={openIntercom}>\n <SettingsAccordion\n accordionDetailsRef={customAppSettingsRef}\n className={styles.accordion}\n defaultExpanded\n isAccordionRequired={isAccordionRequired}\n summary=\"App Settings\"\n >\n {AppSettingsComponent && (\n <AppSettingsComponent\n app={app}\n appData={appData}\n settings={appSettings}\n onSettingChange={handleAppSettingChange}\n onSettingsChange={handleAppSettingsChange}\n layoutEnvironment={layoutEnvironment}\n currentUser={currentUser}\n />\n )}\n </SettingsAccordion>\n </ErrorBoundary>\n </>\n )}\n </ErrorBoundary>\n </Modal>\n );\n};\n\nexport default AppSettingsDialog;\n"],"names":["PAGE_NAME","AppSettingsErrorView","AssetEditorWithLock","withAssetEditorLockHOC","AssetEditor","OptionalDisabledSettingsMessage","DisabledSettingsMessage","ASSET_EDITOR_TYPES_BY_SEGMENT","SEGMENT_TO_ASSET_TYPE","DEFAULT_APP_SETTINGS_COMPONENT","_ref","_app$app","_platformAppSettingsR","_customAppSettingsRef","_appData$well","_app$app2","_app$app2$icon","_ref$AppSettingsCompo","AppSettingsComponent","app","appData","appName","currentUser","_ref$disableAppAssetS","disableAppAssetSelection","isMultiRig","_ref$isSettingsDialog","isSettingsDialogHidden","layoutEnvironment","onAppRemove","_ref$onCloneDashboard","onCloneDashboard","noop","onSettingsChange","openIntercom","rigId","toggleAppSettingsDialog","initialSegment","getAppSegment","_useState","useState","SEGMENTS","DRILLING","_useState2","_slicedToArray","appSegmentSetting","setAppSegmentSetting","_useState4","_useState3","isMounted","setIsMounted","_useState6","_useState5","isAssetSelectorRendered","setIsAssetSelectorRendered","_useState8","_useState7","validationError","setValidationError","_app$settings","_app$package","settings","cloneDeep","settingsPackage","package","undefined","packageVersion","version","_objectSpread","_useState10","_useState9","appSettings","setAppSettings","defaultRigId","useRef","platformAppSettingsRef","customAppSettingsRef","_usePermissions","usePermissions","PERMISSIONS","getCanReadAppPackages","id","_usePermissions2$","canReadAppPackages","active","isPermissionsLoading","loading","appSegments","Array","isArray","segment","filter","hasSegmentSelector","length","isCompletionSegment","COMPLETION","assetEditorAppType","isAssetPage","type","isCLIApp","DEV_CENTER_CLI_APP_ID","isSustainabilityApp","getIsSustainabilityApp","isAssetSelectorVisible","isInsideNewMobileApp","isRemoveButtonVisible","hasPlatformAppSettings","Boolean","current","clientHeight","hasCustomAppSettings","isAccordionRequired","AssetEditorComponent","appKey","app_key","selectedPackage","secondaryDefaultValue","Number","well","styles","useStyles","isCompletionApp","handleAppSettingChange","name","value","prevSettings","_defineProperty","handleAppSettingsChange","newSettings","useEffect","debounce","debouncedSetIsMounted","modalTitle","_jsxs","jsxs","className","modalTitleContainer","children","_jsx","AppIcon","appIcon","iconUrl","icon","url","height","width","jsx","concat","HideInNativeApp","appStoreButton","onClick","_app$app3","appId","window","open","ArrowIcon","arrowIcon","modalActions","RemoveAppButton","Button","variation","saveButton","_assetEditorAppType$p","_assetEditorAppType$p2","_assetEditorAppType$p3","_assetEditorAppType$p4","appTypeKey","primaryAsset","assetType","appTypeLabel","label","showSuccessNotification","Modal","actions","closeIconClassName","closeIcon","contentContainerClassName","modalContainer","modalTitleClassName","onClose","title","ErrorBoundary","ErrorView","DevCenterAppErrorView","ConfirmationDialog","isShowCancel","text","handleOk","classes","confirmation","confirmationText","EmptyState","image","IMAGES","UnderConstruction","_Fragment","SettingsAccordion","defaultExpanded","assetAccordion","accordionDetailsRef","summary","FormControl","segmentSelector","InputLabel","Select","onChange","event","nextSegment","String","target","mapValues","keyBy","ASSET_TYPES","assets","map","segmentItem","MenuItem","segmentMenuItem","appType","defaultValue","isHiddenTitle","isNullable","AppVersionsSelect","appVersionSelect","_appPackage","isUserChange","isReact18Host","react18AutoSwitchDisabled","accordion","onSettingChange"],"mappings":"2/SAsCO,IAAMA,EAAY,iBAInBC,EAAuB,WAAH,OAAS,IAAI,EAoCjCC,EAAsBC,EAAuBC,GAO7CC,EAAkCC,EAIlCC,EACJC,EAAAA,sBAEIC,EAA2E,WAAH,OAAS,IAAI,sCAErC,SAgBhDC,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAP,EAfJQ,qBAAAA,aAAuBT,EAA8BQ,EACrDE,IAAAA,IACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,YAAWC,EAAAb,EACXc,yBAAAA,cAAgCD,EAChCE,IAAAA,WAAUC,EAAAhB,EACViB,uBAAAA,eAA8BD,EAC9BE,KAAAA,kBACAC,KAAAA,YAAWC,GAAApB,EACXqB,iBAAAA,eAAmBC,EAAIA,KAAAF,GACvBG,KAAAA,iBACAC,KAAAA,aACAC,KAAAA,MACAC,KAAAA,wBAEMC,GAAiBC,gBAAcnB,GAErCoB,GAAkDC,EAAAA,SACtB,iBAAnBH,GAA8BA,GAAiBI,EAAQA,SAACC,UAChEC,GAAAC,EAAAA,QAAAL,GAAA,GAFMM,GAAiBF,GAAA,GAAEG,GAAoBH,GAAA,GAGZH,GAAAA,EAAQA,UAAC,GAAMO,GAAAH,EAAAA,QAAAI,GAAA,GAA1CC,GAASF,GAAA,GAAEG,GAAYH,GAAA,GACgCP,GAAAA,EAAQA,UAAC,GAAKW,GAAAP,EAAAA,QAAAQ,GAAA,GAArEC,GAAuBF,GAAA,GAAEG,GAA0BH,GAAA,GACZX,GAAAA,EAAQA,SAAC,IAAGe,GAAAX,EAAAA,QAAAY,GAAA,GAAnDC,GAAeF,GAAA,GAAEG,GAAkBH,GAAA,GACJf,GAAAA,EAAAA,UAAsB,WAAM,IAAAmB,EAAAC,EAC1DC,EAAwBC,EAAAA,UAAsB,QAAZ3C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,WAAA,OAAM,SAAK,CAAA,EAAA,CAClDC,OAAQ,SA8IuE5E,SAChElD,GAAY+H,KAAI,SAAAC,GAAW,OAC1B7E,EAAAA,IAAC8E,EAAAA,SAAQ,CACPjF,UAAWhB,GAAOkG,gBAElB7F,MAAO2F,EAAY9E,SAElB8E,GAHIA,WASdhH,IAA0BlD,IAA2B2C,IACpD0C,EAAAA,IAAC1B,GAAoB,CACnBC,OAAQd,GAAW,KAAOc,GAC1ByG,QAAS1H,GACT2H,aAAclJ,GAAamC,QAC3BQ,sBAAuBA,GACvBwG,eAAa,EACbC,WAAY5H,GACZyE,MAAM,QACNzI,iBAAkB8F,GAClBlE,SAAUU,KAGdmE,MAACoF,UAAiB,CAChBvF,UAAWhB,GAAOwG,iBAClBvE,MAAOrI,EAAIA,IAAI8D,GACf2C,MAAOT,GACP0F,SA1IiB,SAACjF,EAAeoG,EAAsBC,GAAqB,OAGxFA,GAAgBC,EAAAA,gBACZnG,GAAwB,CAAE/D,QAAS4D,EAAOuG,2BAA2B,IACrEzG,GAAuB,UAAWE,EAAM,OAwIpCc,MAAC2C,EAAa,CAACC,UAAWrL,EAAsBiC,aAAcA,GAAauG,SACzEC,MAAC0D,oBAAiB,CAChBG,oBAAqB3H,GACrB2D,UAAWhB,GAAO6G,UAClB/B,iBAAe,EACftF,oBAAqBA,GACrByF,QAAQ,eAAc/D,SAErBvH,GACCwH,EAAAQ,IAAChI,EAAoB,CACnBC,IAAKA,EACLC,QAASA,EACTyC,SAAUU,GACV8J,gBAAiB3G,GACjBzF,iBAAkB8F,GAClBnG,kBAAmBA,GACnBN,YAAaA,eAUjC"}
|
package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevCenterAppDialogs.js","sources":["../../../../../../src/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport AppSettingsDialog from './AppSettingsDialog';\nimport type { AppSettingsDialogProps } from './AppSettingsDialog';\nimport type { AppDataEntry, DevCenterAppResource, DevCenterCurrentUser } from '../types';\nimport type { DevCenterAppContainerProps } from '../DevCenterAppContainer';\n\nimport { AnnotationsList, AnnotationsProvider } from '~/components/Annotations';\n\ntype Props = {\n app: DevCenterAppResource;\n appData: AppDataEntry;\n appName: string;\n appSettingsComponent?: AppSettingsDialogProps['AppSettingsComponent'];\n assetCompanyId?: number;\n assetIdForAnnotation?: number;\n currentUser: DevCenterCurrentUser;\n isAnnotationsListOpened: boolean;\n isAppSettingsDialogOpened: boolean;\n isMultiRig: boolean;\n disableAppAssetSelection?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: DevCenterAppContainerProps['layoutEnvironment'];\n onAppRemove?: () => void;\n onCloneDashboard?: DevCenterAppContainerProps['onCloneDashboard'];\n onSettingsChange: (value: unknown) => void;\n openIntercom?: () => void;\n toggleAnnotationsList: () => void;\n toggleAppSettingsDialog: () => void;\n};\n\n/**\n * The two overlays the container can open on top of a rendered app: its settings dialog and the\n * annotations list. Both mount only while open, so their data hooks stay idle otherwise.\n */\nexport const DevCenterAppDialogs: FC<Props> = ({\n app,\n appData,\n appName,\n appSettingsComponent,\n assetCompanyId,\n assetIdForAnnotation,\n currentUser,\n isAnnotationsListOpened,\n isAppSettingsDialogOpened,\n isMultiRig,\n disableAppAssetSelection,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppRemove,\n onCloneDashboard,\n onSettingsChange,\n openIntercom,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n}) => (\n <>\n {isAppSettingsDialogOpened && (\n <AppSettingsDialog\n AppSettingsComponent={appSettingsComponent}\n app={app}\n appData={appData}\n appName={appName}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n rigId={appData.rig?.id ?? null}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n\n {isAnnotationsListOpened && !!assetCompanyId && !!assetIdForAnnotation && (\n <AnnotationsProvider>\n <AnnotationsList\n appId={app.app.id}\n appSettings={app.settings}\n appTitle={appName}\n assetCompanyId={assetCompanyId}\n assetId={assetIdForAnnotation}\n currentUser={currentUser}\n onClose={toggleAnnotationsList}\n />\n </AnnotationsProvider>\n )}\n </>\n);\n"],"names":["_ref","_appData$rig$id","_appData$rig","app","appData","appName","appSettingsComponent","assetCompanyId","assetIdForAnnotation","currentUser","isAnnotationsListOpened","isAppSettingsDialogOpened","isMultiRig","disableAppAssetSelection","isSettingsDialogHidden","layoutEnvironment","onAppRemove","onCloneDashboard","onSettingsChange","openIntercom","toggleAnnotationsList","toggleAppSettingsDialog","_jsxs","_Fragment","children","_jsx","jsx","AppSettingsDialog","AppSettingsComponent","rigId","rig","id","AnnotationsProvider","AnnotationsList","appId","appSettings","settings","appTitle","assetId","onClose"],"mappings":"8XAmC8C,SAAHA,GAAA,IAAAC,EAAAC,EACzCC,IAAAA,IACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,qBACAC,IAAAA,eACAC,IAAAA,qBACAC,IAAAA,YACAC,IAAAA,wBACAC,IAAAA,0BACAC,IAAAA,WACAC,IAAAA,yBACAC,IAAAA,uBACAC,IAAAA,kBACAC,IAAAA,YACAC,IAAAA,iBACAC,IAAAA,iBACAC,IAAAA,aACAC,IAAAA,sBACAC,IAAAA,wBAAuB,OAEvBC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SACGb,CAAAA,GACCc,EAAAC,IAACC,UAAiB,CAChBC,qBAAsBtB,EACtBH,IAAKA,EACLC,QAASA,EACTC,QAASA,EACTI,YAAaA,EACbI,yBAA0BA,EAC1BD,WAAYA,EACZE,uBAAwBA,EACxBC,kBAAmBA,EACnBC,YAAaA,EACbC,iBAAkBA,EAClBC,iBAAkBA,EAClBC,aAAcA,EACdU,cAAK5B,UAAAC,EAAEE,EAAQ0B,wBAAR5B,EAAa6B,kBAAM,KAC1BV,wBAAyBA,IAI5BX,KAA6BH,KAAoBC,GAChDiB,EAAAC,IAACM,sBAAmB,CAAAR,SAClBC,MAACQ,EAAe,CACdC,MAAO/B,EAAIA,IAAI4B,GACfI,YAAahC,EAAIiC,SACjBC,SAAUhC,EACVE,eAAgBA,EAChB+B,QAAS9B,EACTC,YAAaA,EACb8B,QAASnB,QAId"}
|
|
1
|
+
{"version":3,"file":"DevCenterAppDialogs.js","sources":["../../../../../../src/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport AppSettingsDialog from './AppSettingsDialog';\nimport type { AppSettingsDialogProps } from './AppSettingsDialog';\nimport type { AppDataEntry, DevCenterAppResource, DevCenterCurrentUser } from '../types';\nimport type { DevCenterAppContainerProps } from '../DevCenterAppContainer';\n\nimport { AnnotationsList, AnnotationsProvider } from '~/components/Annotations';\n\ntype Props = {\n app: DevCenterAppResource;\n appData: AppDataEntry;\n appName: string;\n appSettingsComponent?: AppSettingsDialogProps['AppSettingsComponent'];\n assetCompanyId?: number | null;\n assetIdForAnnotation?: number;\n currentUser: DevCenterCurrentUser;\n isAnnotationsListOpened: boolean;\n isAppSettingsDialogOpened: boolean;\n isMultiRig: boolean;\n disableAppAssetSelection?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: DevCenterAppContainerProps['layoutEnvironment'];\n onAppRemove?: () => void;\n onCloneDashboard?: DevCenterAppContainerProps['onCloneDashboard'];\n onSettingsChange: (value: unknown) => void;\n openIntercom?: () => void;\n toggleAnnotationsList: () => void;\n toggleAppSettingsDialog: () => void;\n};\n\n/**\n * The two overlays the container can open on top of a rendered app: its settings dialog and the\n * annotations list. Both mount only while open, so their data hooks stay idle otherwise.\n */\nexport const DevCenterAppDialogs: FC<Props> = ({\n app,\n appData,\n appName,\n appSettingsComponent,\n assetCompanyId,\n assetIdForAnnotation,\n currentUser,\n isAnnotationsListOpened,\n isAppSettingsDialogOpened,\n isMultiRig,\n disableAppAssetSelection,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppRemove,\n onCloneDashboard,\n onSettingsChange,\n openIntercom,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n}) => (\n <>\n {isAppSettingsDialogOpened && (\n <AppSettingsDialog\n AppSettingsComponent={appSettingsComponent}\n app={app}\n appData={appData}\n appName={appName}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n rigId={appData.rig?.id ?? null}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n\n {isAnnotationsListOpened && !!assetCompanyId && !!assetIdForAnnotation && (\n <AnnotationsProvider>\n <AnnotationsList\n appId={app.app.id}\n appSettings={app.settings}\n appTitle={appName}\n assetCompanyId={assetCompanyId}\n assetId={assetIdForAnnotation}\n currentUser={currentUser}\n onClose={toggleAnnotationsList}\n />\n </AnnotationsProvider>\n )}\n </>\n);\n"],"names":["_ref","_appData$rig$id","_appData$rig","app","appData","appName","appSettingsComponent","assetCompanyId","assetIdForAnnotation","currentUser","isAnnotationsListOpened","isAppSettingsDialogOpened","isMultiRig","disableAppAssetSelection","isSettingsDialogHidden","layoutEnvironment","onAppRemove","onCloneDashboard","onSettingsChange","openIntercom","toggleAnnotationsList","toggleAppSettingsDialog","_jsxs","_Fragment","children","_jsx","jsx","AppSettingsDialog","AppSettingsComponent","rigId","rig","id","AnnotationsProvider","AnnotationsList","appId","appSettings","settings","appTitle","assetId","onClose"],"mappings":"8XAmC8C,SAAHA,GAAA,IAAAC,EAAAC,EACzCC,IAAAA,IACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,qBACAC,IAAAA,eACAC,IAAAA,qBACAC,IAAAA,YACAC,IAAAA,wBACAC,IAAAA,0BACAC,IAAAA,WACAC,IAAAA,yBACAC,IAAAA,uBACAC,IAAAA,kBACAC,IAAAA,YACAC,IAAAA,iBACAC,IAAAA,iBACAC,IAAAA,aACAC,IAAAA,sBACAC,IAAAA,wBAAuB,OAEvBC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SACGb,CAAAA,GACCc,EAAAC,IAACC,UAAiB,CAChBC,qBAAsBtB,EACtBH,IAAKA,EACLC,QAASA,EACTC,QAASA,EACTI,YAAaA,EACbI,yBAA0BA,EAC1BD,WAAYA,EACZE,uBAAwBA,EACxBC,kBAAmBA,EACnBC,YAAaA,EACbC,iBAAkBA,EAClBC,iBAAkBA,EAClBC,aAAcA,EACdU,cAAK5B,UAAAC,EAAEE,EAAQ0B,wBAAR5B,EAAa6B,kBAAM,KAC1BV,wBAAyBA,IAI5BX,KAA6BH,KAAoBC,GAChDiB,EAAAC,IAACM,sBAAmB,CAAAR,SAClBC,MAACQ,EAAe,CACdC,MAAO/B,EAAIA,IAAI4B,GACfI,YAAahC,EAAIiC,SACjBC,SAAUhC,EACVE,eAAgBA,EAChB+B,QAAS9B,EACTC,YAAaA,EACb8B,QAASnB,QAId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevCenterAppView.js","sources":["../../../../../../../src/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.tsx"],"sourcesContent":["import type { ComponentType, FC } from 'react';\n\nimport type { AppDataEntry, DevCenterAppResource, LayoutEnvironment } from '../../types';\nimport type { AppAvailabilityFlags } from '../../utils';\n\nimport { AppMessageWrapper } from '../../../../../componentsV2/AppInfoMessage';\nimport { EmptyState } from '../../../../../componentsV2/EmptyState';\nimport { LoaderLogo } from '../../../../../componentsV2/LoaderLogo';\n\nimport { ChooseAssetButton } from './components/ChooseAssetButton';\n\nimport styles from './DevCenterAppView.scss';\n\nimport ErrorBoundary from '~/components/ErrorBoundary';\nimport { SEGMENTS } from '~/constants/segment';\nimport { useAppCommonsInternal } from '~/componentsV2/AppCommonsProvider';\n\nexport const getNoActiveWellMessage = (rigName: string): string => `${rigName} has no active well`;\n\nconst DEFAULT_AVAILABILITY: AppAvailabilityFlags = {\n hasProductSubscription: true,\n isAppSubscribedForAsset: true,\n};\n\nexport const EMPTY_STATE_TEST_ID = 'DevCenterAppView_EmptyState';\nexport const LOADER_TEST_ID = 'DevCenterAppView_Loader';\n\ntype Props = {\n /** A third-party app bundle. Its props are assembled dynamically by the host. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n AppComponent: ComponentType<any> | null;\n app: DevCenterAppResource;\n appData: AppDataEntry;\n appProps: Record<string, unknown>;\n availability?: AppAvailabilityFlags;\n isCLIApp: boolean;\n isLoading: boolean;\n isMultiRig: boolean;\n layoutEnvironment: LayoutEnvironment | null;\n openIntercom: () => void;\n segment: string;\n toggleAppSettingsDialog: () => void;\n onError?: (error: Error) => void;\n};\n\nconst DevCenterAppView: FC<Props> = ({\n AppComponent,\n app,\n appData,\n appProps,\n availability = DEFAULT_AVAILABILITY,\n isCLIApp,\n isLoading,\n isMultiRig,\n layoutEnvironment,\n openIntercom,\n segment,\n toggleAppSettingsDialog,\n onError,\n}) => {\n // Use overridden appSettings from AppCommonsProvider (e.g. localStorage-stable settingsByAsset)\n // so server polling doesn't reset selections passed via {...app.settings} to AppComponent.\n const appCommons = useAppCommonsInternal();\n const effectiveSettings = appCommons?.appSettings ?? app.settings;\n\n if (!app.package)\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title=\"App package was not found\"\n subTitle=\"Please choose another version in the app settings menu or delete and add app again on your dashboard\"\n image=\"appLoadingError\"\n />\n </AppMessageWrapper>\n );\n\n if (isLoading)\n return (\n <AppMessageWrapper showHeader={false}>\n <LoaderLogo className={styles.loader} testId={LOADER_TEST_ID} />\n </AppMessageWrapper>\n );\n\n if (!(availability.hasProductSubscription && availability.isAppSubscribedForAsset)) {\n const { title, subtitle } = !availability.hasProductSubscription\n ? {\n title: 'No Subscription exists for this app.',\n subtitle: 'Contact your Corva Account rep to get access to this app.',\n }\n : {\n title: 'No Subscription exists for this asset.',\n subtitle: 'Contact your Corva Account rep to get access to this asset.',\n };\n\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title={title}\n subTitle={subtitle}\n image=\"noSubscription\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (!AppComponent)\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title=\"App component was not found\"\n image=\"appLoadingError\"\n />\n </AppMessageWrapper>\n );\n\n if (!isMultiRig) {\n const actions = isCLIApp && (\n <ChooseAssetButton toggleAppSettingsDialog={toggleAppSettingsDialog} />\n );\n\n const isInterventionApp = segment === SEGMENTS.INTERVENTION;\n const primaryAsset = isInterventionApp ? appData.interventionUnit : appData.rig;\n\n if (primaryAsset && !appData.well) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title={getNoActiveWellMessage(primaryAsset?.name)}\n image=\"noActiveWell\"\n subTitle={actions}\n />\n </AppMessageWrapper>\n );\n }\n\n const isGeneralDashboard = layoutEnvironment?.type === 'general';\n const isCompletionApp = segment === SEGMENTS.COMPLETION;\n\n if (isGeneralDashboard && isCompletionApp && !appData.fracFleet) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title=\"Frac fleet was not found\"\n subTitle={actions}\n image=\"fleetHasNoPad\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (\n isCompletionApp &&\n appData.fracFleet &&\n !appData.fracFleet.current_pad_id &&\n !app.settings?.padId\n ) {\n // NOTE: completion app has fracFleet, that fracfleet has no current pad id and no specific pad id in settings\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n image=\"fleetHasNoPad\"\n subTitle={actions}\n title=\"Frac fleet has no active pad\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (isCompletionApp && isGeneralDashboard && !appData.wells?.length) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n image=\"noWellsSelected\"\n subTitle={actions}\n title=\"This pad has no wells\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (!appData.rig && !appData.well && !appData.settings && !appData.wells) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n image=\"assetHasNoData\"\n subTitle={actions}\n title=\"Asset unavailable\"\n />\n </AppMessageWrapper>\n );\n }\n }\n\n return (\n <ErrorBoundary openIntercom={openIntercom} onError={onError}>\n <AppComponent app={app} {...app.settings} {...effectiveSettings} {...appData} {...appProps} />\n </ErrorBoundary>\n );\n};\n\nexport default DevCenterAppView;\n"],"names":["getNoActiveWellMessage","rigName","concat","DEFAULT_AVAILABILITY","hasProductSubscription","isAppSubscribedForAsset","EMPTY_STATE_TEST_ID","_ref","_appCommons$appSettin","AppComponent","app","appData","appProps","_ref$availability","availability","isCLIApp","isLoading","isMultiRig","layoutEnvironment","openIntercom","segment","toggleAppSettingsDialog","onError","appCommons","useAppCommonsInternal","effectiveSettings","appSettings","settings","package","_jsx","AppMessageWrapper","logo","headerLogo","children","EmptyState","testId","title","subTitle","image","jsx","showHeader","LoaderLogo","className","styles","loader","_ref2","subtitle","_app$settings","_appData$wells","actions","ChooseAssetButton","primaryAsset","SEGMENTS","INTERVENTION","interventionUnit","rig","well","name","isGeneralDashboard","type","isCompletionApp","COMPLETION","fracFleet","current_pad_id","padId","wells","length","ErrorBoundary","_objectSpread"],"mappings":"s8CAiBaA,EAAyB,SAACC,G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,EAAAA,IAACC,EAAAA,kBAAiB,CAACC,KAAMrB,EAAIsB,WAAWC,SACtCJ,MAACK,aAAU,CACTC,OAAQ7B,EACRgC,MAAM,iBACND,SAAUY,EACVb,MAAM,uBAKhB,CAEA,OACEP,EAAAA,IAACsC,EAAa,CAAChD,aAAcA,EAAcG,QAASA,EAAQW,SAC1DJ,MAACpB,EAAY2D,EAAAA,EAAAA,EAAAA,EAAA,CAAC1D,IAAKA,GAASA,EAAIiB,UAAcF,GAAuBd,GAAaC,KAGxF"}
|
|
1
|
+
{"version":3,"file":"DevCenterAppView.js","sources":["../../../../../../../src/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.tsx"],"sourcesContent":["import type { ComponentType, FC } from 'react';\n\nimport type { AppDataAssets, AppDataEntry } from '../../../AppsDataProvider/types';\nimport type { DevCenterAppResource, LayoutEnvironment } from '../../types';\nimport type { AppAvailabilityFlags } from '../../utils';\n\nimport { AppMessageWrapper } from '../../../../../componentsV2/AppInfoMessage';\nimport { EmptyState } from '../../../../../componentsV2/EmptyState';\nimport { LoaderLogo } from '../../../../../componentsV2/LoaderLogo';\n\nimport { ChooseAssetButton } from './components/ChooseAssetButton';\n\nimport styles from './DevCenterAppView.scss';\n\nimport ErrorBoundary from '~/components/ErrorBoundary';\nimport { SEGMENTS } from '~/constants/segment';\nimport { useAppCommonsInternal } from '~/componentsV2/AppCommonsProvider';\n\nexport const getNoActiveWellMessage = (rigName?: string | null): string =>\n `${rigName} has no active well`;\n\nconst DEFAULT_AVAILABILITY: AppAvailabilityFlags = {\n hasProductSubscription: true,\n isAppSubscribedForAsset: true,\n};\n\nexport const EMPTY_STATE_TEST_ID = 'DevCenterAppView_EmptyState';\nexport const LOADER_TEST_ID = 'DevCenterAppView_Loader';\n\ntype AppViewData = AppDataAssets & Pick<AppDataEntry, 'settings'>;\n\ntype Props = {\n /** A third-party app bundle. Its props are assembled dynamically by the host. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n AppComponent: ComponentType<any> | null;\n app: DevCenterAppResource;\n appData: AppViewData;\n appProps: Record<string, unknown>;\n availability?: AppAvailabilityFlags;\n isCLIApp: boolean;\n isLoading: boolean;\n isMultiRig: boolean;\n layoutEnvironment: LayoutEnvironment | null;\n openIntercom: () => void;\n segment: string;\n toggleAppSettingsDialog: () => void;\n onError?: (error: Error) => void;\n};\n\nconst DevCenterAppView: FC<Props> = ({\n AppComponent,\n app,\n appData,\n appProps,\n availability = DEFAULT_AVAILABILITY,\n isCLIApp,\n isLoading,\n isMultiRig,\n layoutEnvironment,\n openIntercom,\n segment,\n toggleAppSettingsDialog,\n onError,\n}) => {\n // Use overridden appSettings from AppCommonsProvider (e.g. localStorage-stable settingsByAsset)\n // so server polling doesn't reset selections passed via {...app.settings} to AppComponent.\n const appCommons = useAppCommonsInternal();\n const effectiveSettings = appCommons?.appSettings ?? app.settings;\n\n if (!app.package)\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title=\"App package was not found\"\n subTitle=\"Please choose another version in the app settings menu or delete and add app again on your dashboard\"\n image=\"appLoadingError\"\n />\n </AppMessageWrapper>\n );\n\n if (isLoading)\n return (\n <AppMessageWrapper showHeader={false}>\n <LoaderLogo className={styles.loader} testId={LOADER_TEST_ID} />\n </AppMessageWrapper>\n );\n\n if (!(availability.hasProductSubscription && availability.isAppSubscribedForAsset)) {\n const { title, subtitle } = !availability.hasProductSubscription\n ? {\n title: 'No Subscription exists for this app.',\n subtitle: 'Contact your Corva Account rep to get access to this app.',\n }\n : {\n title: 'No Subscription exists for this asset.',\n subtitle: 'Contact your Corva Account rep to get access to this asset.',\n };\n\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title={title}\n subTitle={subtitle}\n image=\"noSubscription\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (!AppComponent)\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title=\"App component was not found\"\n image=\"appLoadingError\"\n />\n </AppMessageWrapper>\n );\n\n if (!isMultiRig) {\n const actions = isCLIApp && (\n <ChooseAssetButton toggleAppSettingsDialog={toggleAppSettingsDialog} />\n );\n\n const isInterventionApp = segment === SEGMENTS.INTERVENTION;\n const primaryAsset = isInterventionApp ? appData.interventionUnit : appData.rig;\n\n if (primaryAsset && !appData.well) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title={getNoActiveWellMessage(primaryAsset?.name)}\n image=\"noActiveWell\"\n subTitle={actions}\n />\n </AppMessageWrapper>\n );\n }\n\n const isGeneralDashboard = layoutEnvironment?.type === 'general';\n const isCompletionApp = segment === SEGMENTS.COMPLETION;\n\n if (isGeneralDashboard && isCompletionApp && !appData.fracFleet) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n title=\"Frac fleet was not found\"\n subTitle={actions}\n image=\"fleetHasNoPad\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (\n isCompletionApp &&\n appData.fracFleet &&\n !appData.fracFleet.current_pad_id &&\n !app.settings?.padId\n ) {\n // NOTE: completion app has fracFleet, that fracfleet has no current pad id and no specific pad id in settings\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n image=\"fleetHasNoPad\"\n subTitle={actions}\n title=\"Frac fleet has no active pad\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (isCompletionApp && isGeneralDashboard && !appData.wells?.length) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n image=\"noWellsSelected\"\n subTitle={actions}\n title=\"This pad has no wells\"\n />\n </AppMessageWrapper>\n );\n }\n\n if (!appData.rig && !appData.well && !appData.settings && !appData.wells) {\n return (\n <AppMessageWrapper logo={app.headerLogo}>\n <EmptyState\n testId={EMPTY_STATE_TEST_ID}\n image=\"assetHasNoData\"\n subTitle={actions}\n title=\"Asset unavailable\"\n />\n </AppMessageWrapper>\n );\n }\n }\n\n return (\n <ErrorBoundary openIntercom={openIntercom} onError={onError}>\n <AppComponent app={app} {...app.settings} {...effectiveSettings} {...appData} {...appProps} />\n </ErrorBoundary>\n );\n};\n\nexport default DevCenterAppView;\n"],"names":["getNoActiveWellMessage","rigName","concat","DEFAULT_AVAILABILITY","hasProductSubscription","isAppSubscribedForAsset","EMPTY_STATE_TEST_ID","_ref","_appCommons$appSettin","AppComponent","app","appData","appProps","_ref$availability","availability","isCLIApp","isLoading","isMultiRig","layoutEnvironment","openIntercom","segment","toggleAppSettingsDialog","onError","appCommons","useAppCommonsInternal","effectiveSettings","appSettings","settings","package","_jsx","AppMessageWrapper","logo","headerLogo","children","EmptyState","testId","title","subTitle","image","jsx","showHeader","LoaderLogo","className","styles","loader","_ref2","subtitle","_app$settings","_appData$wells","actions","ChooseAssetButton","primaryAsset","SEGMENTS","INTERVENTION","interventionUnit","rig","well","name","isGeneralDashboard","type","isCompletionApp","COMPLETION","fracFleet","current_pad_id","padId","wells","length","ErrorBoundary","_objectSpread"],"mappings":"s8CAkBaA,EAAyB,SAACC,GAAuB,MAAA,GAAAC,OACzDD,EAAO,sBAAA,EAENE,EAA6C,CACjDC,wBAAwB,EACxBC,yBAAyB,GAGdC,EAAsB,mFACL,0CAsBM,SAc9BC,GAAA,IAAAC,EAbJC,IAAAA,aACAC,IAAAA,IACAC,IAAAA,QACAC,IAAAA,SAAQC,EAAAN,EACRO,aAAAA,aAAeX,EAAoBU,EACnCE,IAAAA,SACAC,IAAAA,UACAC,IAAAA,WACAC,IAAAA,kBACAC,IAAAA,aACAC,IAAAA,QACAC,IAAAA,wBACAC,IAAAA,QAIMC,EAAaC,EAAAA,wBACbC,EAA2C,QAA1BjB,EAAGe,aAAU,EAAVA,EAAYG,mBAAW,IAAAlB,EAAAA,EAAI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xC,IAAYgC,EAAQA,SAACS,WAE7C,GAAIH,GAAsBE,IAAoBjD,EAAQmD,UACpD,OACEjC,EAAAA,IAACC,EAAAA,kBAAiB,CAACC,KAAMrB,EAAIsB,WAAWC,SACtCJ,MAACK,aAAU,CACTC,OAAQ7B,EACR8B,MAAM,2BACNC,SAAUY,EACVX,MAAM,oBAMd,GACEsB,GACAjD,EAAQmD,YACPnD,EAAQmD,UAAUC,iBAClB,UAAArD,EAAIiB,gBAAJ,IAAAoB,IAAAA,EAAciB,OAGf,OACEnC,EAAAA,IAACC,EAAAA,kBAAiB,CAACC,KAAMrB,EAAIsB,WAAWC,SACtCJ,MAACK,aAAU,CACTC,OAAQ7B,EACRgC,MAAM,gBACND,SAAUY,EACVb,MAAM,mCAMd,GAAIwB,GAAmBF,IAAoC,QAAdV,EAACrC,EAAQsD,aAAK,IAAAjB,IAAbA,EAAekB,QAC3D,OACErC,EAAAA,IAACC,EAAAA,kBAAiB,CAACC,KAAMrB,EAAIsB,WAAWC,SACtCJ,MAACK,aAAU,CACTC,OAAQ7B,EACRgC,MAAM,kBACND,SAAUY,EACVb,MAAM,4BAMd,KAAKzB,EAAQ4C,KAAQ5C,EAAQ6C,MAAS7C,EAAQgB,UAAahB,EAAQsD,OACjE,OACEpC,EAAAA,IAACC,EAAAA,kBAAiB,CAACC,KAAMrB,EAAIsB,WAAWC,SACtCJ,MAACK,aAAU,CACTC,OAAQ7B,EACRgC,MAAM,iBACND,SAAUY,EACVb,MAAM,uBAKhB,CAEA,OACEP,EAAAA,IAACsC,EAAa,CAAChD,aAAcA,EAAcG,QAASA,EAAQW,SAC1DJ,MAACpB,EAAY2D,EAAAA,EAAAA,EAAAA,EAAA,CAAC1D,IAAKA,GAASA,EAAIiB,UAAcF,GAAuBd,GAAaC,KAGxF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.HOME_PATH_PREFIX="/home",exports.MOBILE_CLI_APP_GRID_WIDTH=12,exports.PAGE_NAME="DevCenter_AppContainer",exports.TOOLTIP_TITLES={addAnnotation:"Add Annotation",reportBug:"Report A Bug",helpCenter:"Help Center"};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/constants.ts"],"sourcesContent":["/** Test-id prefix and analytics page name for everything this container renders. */\nexport const PAGE_NAME = 'DevCenter_AppContainer';\n\n/** A CLI app on a phone takes the whole 12-column dashboard grid. */\nexport const MOBILE_CLI_APP_GRID_WIDTH = 12;\n\nexport const HOME_PATH_PREFIX = '/home';\n\
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/constants.ts"],"sourcesContent":["/** Test-id prefix and analytics page name for everything this container renders. */\nexport const PAGE_NAME = 'DevCenter_AppContainer';\n\n/** A CLI app on a phone takes the whole 12-column dashboard grid. */\nexport const MOBILE_CLI_APP_GRID_WIDTH = 12;\n\nexport const HOME_PATH_PREFIX = '/home';\n\nexport const TOOLTIP_TITLES = {\n addAnnotation: 'Add Annotation',\n reportBug: 'Report A Bug',\n helpCenter: 'Help Center',\n};\n"],"names":["addAnnotation","reportBug","helpCenter"],"mappings":"6FAMgC,0CAFS,qBAHhB,gDAOK,CAC5BA,cAAe,iBACfC,UAAW,eACXC,WAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=require("react"),
|
|
1
|
+
"use strict";var n=require("react"),a=require("../../../../constants/devcenter.js");require("../../../../constants/goals.js");var t=require("../../../../constants/segment.js");require("../../../../constants/alerts.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/completion.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("lodash"),require("../../../GradientManager/configuration/constants.js");var s=function(n){var a=Number(n);return Number.isSafeInteger(a)&&a>0?a:null};module.exports=function(e){var r,i,o,u,l,d=e.app,c=e.appData,p=e.currentDashboardAppsLastAnnotations,v=null==d||null===(r=d.package)||void 0===r||null===(i=r.manifest)||void 0===i||null===(o=i.application)||void 0===o||null===(u=o.ui)||void 0===u?void 0:u.disable_platform_annotations,q=c.well,m=c.rig,_=(null==q?void 0:q.asset_id)||(null==m?void 0:m.asset_id),j=s(null==q?void 0:q.companyId)||s(null==q?void 0:q.company_id)||s(null==m?void 0:m.company_id),f=!(!d.package||v||d.id===a.DEV_CENTER_CLI_APP_ID||!_||!j||(null===(l=d.segment)||void 0===l?void 0:l[0])!==t.SEGMENTS.DRILLING),g=n.useMemo((function(){var n;if(!p||!f)return null;var a=p.find((function(n){return n.id===d.id}));return null!=a&&null!==(n=a.last_app_annotation)&&void 0!==n&&n.data?a.last_app_annotation:null}),[d.id,p,f]);return{assetIdForAnnotation:_,assetCompanyId:j,isAppSupportsAnnotations:f,appLastAnnotation:g}};
|
|
2
2
|
//# sourceMappingURL=useAnnotationsData.js.map
|
package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnnotationsData.js","sources":["../../../../../../src/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type {\n AppDataEntry,\n AppLastAnnotation,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n} from '../types';\n\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport { SEGMENTS } from '~/constants/segment';\n\ntype UseAnnotationsDataParams = {\n app: DevCenterAppResource;\n appData: AppDataEntry;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n};\n\n
|
|
1
|
+
{"version":3,"file":"useAnnotationsData.js","sources":["../../../../../../src/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type {\n AppDataEntry,\n AppLastAnnotation,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n} from '../types';\n\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport { SEGMENTS } from '~/constants/segment';\n\ntype UseAnnotationsDataParams = {\n app: DevCenterAppResource;\n appData: AppDataEntry;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n};\n\n// Annotation components require numeric company IDs; JSON:API relationship IDs are strings.\nconst getAnnotationCompanyId = (value: string | number | null | undefined) => {\n const companyId = Number(value);\n\n return Number.isSafeInteger(companyId) && companyId > 0 ? companyId : null;\n};\n\ntype UseAnnotationsDataReturn = {\n appLastAnnotation: AppLastAnnotation | null;\n assetCompanyId: number | null;\n assetIdForAnnotation: number | undefined;\n isAppSupportsAnnotations: boolean;\n};\n\nconst useAnnotationsData = ({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n}: UseAnnotationsDataParams): UseAnnotationsDataReturn => {\n const isPlatformAnnotationsDisabled =\n app?.package?.manifest?.application?.ui?.disable_platform_annotations;\n\n const { well, rig } = appData;\n\n // Legacy external producers use company_id. Preserve fallback per field so a well's asset\n // can still use the rig company when the well has no company relationship.\n const assetIdForAnnotation = well?.asset_id || rig?.asset_id;\n const assetCompanyId =\n getAnnotationCompanyId(well?.companyId) ||\n getAnnotationCompanyId(well?.company_id) ||\n getAnnotationCompanyId(rig?.company_id);\n\n // `assetCompanyId` is part of the predicate, not just `assetIdForAnnotation`: `AnnotationsList`\n // declares both `assetId` and `assetCompanyId` as required and sends the company id on every\n // read and write. Gating on the asset id alone let both headers show the annotations action for\n // an asset that carries an `asset_id` but no `company_id`, and clicking it only toggled state\n // while `DevCenterAppDialogs` rendered nothing.\n const isAppSupportsAnnotations =\n !!app.package &&\n !isPlatformAnnotationsDisabled &&\n app.id !== DEV_CENTER_CLI_APP_ID &&\n !!assetIdForAnnotation &&\n !!assetCompanyId &&\n app.segment?.[0] === SEGMENTS.DRILLING;\n\n const appLastAnnotation = useMemo(() => {\n if (!currentDashboardAppsLastAnnotations || !isAppSupportsAnnotations) {\n return null;\n }\n\n const annotation = currentDashboardAppsLastAnnotations.find(item => item.id === app.id);\n if (!annotation?.last_app_annotation?.data) {\n return null;\n }\n\n // Additional check for broken items on api, required api serializer fixing\n return annotation.last_app_annotation;\n }, [app.id, currentDashboardAppsLastAnnotations, isAppSupportsAnnotations]);\n\n return {\n assetIdForAnnotation,\n assetCompanyId,\n isAppSupportsAnnotations,\n appLastAnnotation,\n };\n};\n\nexport default useAnnotationsData;\n"],"names":["getAnnotationCompanyId","value","companyId","Number","isSafeInteger","_ref","_app$package","_app$package$manifest","_app$package$manifest2","_app$package$manifest3","_app$segment","app","appData","currentDashboardAppsLastAnnotations","isPlatformAnnotationsDisabled","package","manifest","application","ui","disable_platform_annotations","well","rig","assetIdForAnnotation","asset_id","assetCompanyId","company_id","isAppSupportsAnnotations","id","DEV_CENTER_CLI_APP_ID","segment","SEGMENTS","DRILLING","appLastAnnotation","useMemo","_annotation$last_app_","annotation","find","item","last_app_annotation","data"],"mappings":"0pBAmBA,IAAMA,EAAyB,SAACC,GAC9B,IAAMC,EAAYC,OAAOF,GAEzB,OAAOE,OAAOC,cAAcF,IAAcA,EAAY,EAAIA,EAAY,IACxE,iBAS2B,SAI+BG,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAHxDC,IAAAA,IACAC,IAAAA,QACAC,IAAAA,oCAEMC,EACJH,SAAY,QAAZA,EAAAA,EAAKI,eAAO,IAAAT,GAAU,QAAVC,EAAZD,EAAcU,gBAAQ,IAAAT,GAAa,QAAbC,EAAtBD,EAAwBU,mBAAW,IAAAT,GAAI,QAAJC,EAAnCD,EAAqCU,UAAE,IAAAT,OAAvCE,EAAAF,EAAyCU,6BAEnCC,EAAcR,EAAdQ,KAAMC,EAAQT,EAARS,IAIRC,GAAuBF,aAAAA,EAAAA,EAAMG,YAAYF,aAAAA,EAAAA,EAAKE,UAC9CC,EACJxB,EAAuBoB,aAAAA,EAAAA,EAAMlB,YAC7BF,EAAuBoB,aAAAA,EAAAA,EAAMK,aAC7BzB,EAAuBqB,aAAG,EAAHA,EAAKI,YAOxBC,KACFf,EAAII,SACLD,GACDH,EAAIgB,KAAOC,EAAAA,wBACTN,IACAE,IACS,UAAXb,EAAIkB,eAAO,IAAAnB,OAAA,EAAXA,EAAc,MAAOoB,EAAAA,SAASC,UAE1BC,EAAoBC,EAAAA,SAAQ,WAAM,IAAAC,EACtC,IAAKrB,IAAwCa,EAC3C,OAAO,KAGT,IAAMS,EAAatB,EAAoCuB,MAAK,SAAAC,GAAI,OAAIA,EAAKV,KAAOhB,EAAIgB,MACpF,OAAKQ,SAA+B,QAArBD,EAAVC,EAAYG,2BAAmB,IAAAJ,GAA/BA,EAAiCK,KAK/BJ,EAAWG,oBAJT,IAKV,GAAE,CAAC3B,EAAIgB,GAAId,EAAqCa,IAEjD,MAAO,CACLJ,qBAAAA,EACAE,eAAAA,EACAE,yBAAAA,EACAM,kBAAAA,EAEJ"}
|
package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDevCenterAppProps.js","sources":["../../../../../../src/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport type {\n AppCoordinates,\n AppLastAnnotation,\n ChatActions,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from '../types';\n\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\ntype UseDevCenterAppPropsParams = {\n app: DevCenterAppResource;\n /** The entry `useAnnotationsData` resolved, or `null` when the app has no annotation yet. */\n appLastAnnotation: AppLastAnnotation | null;\n appTimestamp: number | undefined;\n chatActions: ChatActions | null | undefined;\n coordinates: AppCoordinates | null | undefined;\n currentUser: DevCenterCurrentUser;\n devCenterRouter: DevCenterRouter;\n filteredAppData:
|
|
1
|
+
{"version":3,"file":"useDevCenterAppProps.js","sources":["../../../../../../src/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport type { AppDataAssets } from '../../AppsDataProvider/types';\n\nimport type {\n AppCoordinates,\n AppLastAnnotation,\n ChatActions,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from '../types';\n\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\ntype UseDevCenterAppPropsParams = {\n app: DevCenterAppResource;\n /** The entry `useAnnotationsData` resolved, or `null` when the app has no annotation yet. */\n appLastAnnotation: AppLastAnnotation | null;\n appTimestamp: number | undefined;\n chatActions: ChatActions | null | undefined;\n coordinates: AppCoordinates | null | undefined;\n currentUser: DevCenterCurrentUser;\n devCenterRouter: DevCenterRouter;\n filteredAppData: AppDataAssets;\n isMaximized: boolean;\n layoutEnvironment: LayoutEnvironment | null | undefined;\n onSettingChange: (key: string, value: unknown) => void;\n onSettingsChange: (value: unknown) => void;\n registerAITools: RegisterAITools | undefined;\n segment: string;\n setIsFullscreenModalMode: SetIsFullscreenModalMode;\n setIsMaximized: (isMaximized: boolean) => void;\n setMainMenuItems: Dispatch<SetStateAction<DevCenterMenuItem[]>>;\n setSecondaryMenuItems: Dispatch<SetStateAction<DevCenterMenuItem[]>>;\n toggleAnnotationsList: () => void;\n toggleAppSettingsDialog: () => void;\n updateCurrentDashboardAppLastAnnotation: UpdateDashboardAppLastAnnotation | undefined;\n};\n\n/**\n * Builds the prop bag handed to the app bundle.\n *\n * Memoised on purpose: the bundle is third-party code that may memoise on prop identity, and\n * the nested `appHeaderProps` object was previously reallocated on every render of the\n * container, so nothing downstream could ever hit a memo.\n */\nexport const useDevCenterAppProps = ({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n}: UseDevCenterAppPropsParams) =>\n useMemo(\n () => ({\n coordinates,\n currentUser,\n devCenterRouter,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAppSettingsDialog,\n // Only the V1 `AppHeader` reads this nested bag; AppHeader V3 takes the same values from\n // `AppCommonsProvider` instead. It exists for apps whose manifest has not set\n // `use_app_header_v3`, and stops being read once none are left.\n appHeaderProps: {\n app,\n appLastAnnotation,\n appSettings: app.settings,\n coordinates,\n currentUser,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n toggleAnnotationsList,\n updateCurrentDashboardAppLastAnnotation,\n ...filteredAppData,\n },\n isNative: isNativeDetected,\n layoutEnvironment,\n timestamp: appTimestamp,\n chatActions,\n }),\n [\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n ]\n );\n"],"names":["_ref","app","appLastAnnotation","appTimestamp","chatActions","coordinates","currentUser","devCenterRouter","filteredAppData","isMaximized","layoutEnvironment","onSettingChange","onSettingsChange","registerAITools","segment","setIsFullscreenModalMode","setIsMaximized","setMainMenuItems","setSecondaryMenuItems","toggleAnnotationsList","toggleAppSettingsDialog","updateCurrentDashboardAppLastAnnotation","useMemo","appHeaderProps","_objectSpread","appSettings","settings","isNative","isNativeDetected","timestamp"],"mappings":"o3BAqDoC,SAAHA,GAAA,IAC/BC,IAAAA,IACAC,IAAAA,kBACAC,IAAAA,aACAC,IAAAA,YACAC,IAAAA,YACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,YACAC,IAAAA,kBACAC,IAAAA,gBACAC,IAAAA,iBACAC,IAAAA,gBACAC,IAAAA,QACAC,IAAAA,yBACAC,IAAAA,eACAC,IAAAA,iBACAC,IAAAA,sBACAC,IAAAA,sBACAC,IAAAA,wBACAC,IAAAA,wCAAuC,OAEvCC,EAAOA,SACL,WAAA,MAAO,CACLjB,YAAAA,EACAC,YAAAA,EACAC,gBAAAA,EACAI,gBAAAA,EACAC,iBAAAA,EACAC,gBAAAA,EACAC,QAAAA,EACAC,yBAAAA,EACAC,eAAAA,EACAC,iBAAAA,EACAC,sBAAAA,EACAE,wBAAAA,EAIAG,eAAcC,EAAA,CACZvB,IAAAA,EACAC,kBAAAA,EACAuB,YAAaxB,EAAIyB,SACjBrB,YAAAA,EACAC,YAAAA,EACAG,YAAAA,EACAC,kBAAAA,EACAC,gBAAAA,EACAQ,sBAAAA,EACAE,wCAAAA,GACGb,GAELmB,SAAUC,EAAgBA,iBAC1BlB,kBAAAA,EACAmB,UAAW1B,EACXC,YAAAA,EACA,GACF,CACEH,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t={isLoading:!0};exports.getAppDataEntryFromContext=function(e,r){var o;return r&&e&&!function(t){return!!t&&Object.prototype.hasOwnProperty.call(t,"app")}(e)&&null!==(o=e[r])&&void 0!==o?o:t};
|
|
2
|
+
//# sourceMappingURL=getAppDataEntryFromContext.js.map
|
package/cjs-bundle/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAppDataEntryFromContext.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.ts"],"sourcesContent":["import type { AppDataDictionary, AppDataEntry } from '../AppsDataProvider/types';\n\nconst LOADING_APP_DATA: AppDataEntry = { isLoading: true };\n\n/** External apps also use the public AppContext to provide one app resource directly. */\nexport type LegacySingleAppContext = {\n app: Record<string, unknown>;\n} & Record<string, unknown>;\n\nexport type AppContextValue = AppDataDictionary | LegacySingleAppContext | undefined;\n\nconst isLegacySingleAppContext = (\n contextValue: AppContextValue\n): contextValue is LegacySingleAppContext =>\n !!contextValue && Object.prototype.hasOwnProperty.call(contextValue, 'app');\n\n/**\n * AppsDataProvider and iframe hosts key their dictionaries by numeric dashboard-app IDs. External\n * single-app providers have an `app` root instead, so the public context can keep both modes.\n */\nexport const getAppDataEntryFromContext = (\n contextValue: AppContextValue,\n appDataKey: number | undefined\n): AppDataEntry => {\n if (!appDataKey || !contextValue || isLegacySingleAppContext(contextValue)) {\n return LOADING_APP_DATA;\n }\n\n return contextValue[appDataKey] ?? LOADING_APP_DATA;\n};\n"],"names":["LOADING_APP_DATA","isLoading","contextValue","appDataKey","_contextValue$appData","Object","prototype","hasOwnProperty","call","isLegacySingleAppContext"],"mappings":"oEAEA,IAAMA,EAAiC,CAAEC,WAAW,sCAkBV,SACxCC,EACAC,GACiB,IAAAC,EACjB,OAAKD,GAAeD,IAbW,SAC/BA,GAA6B,QAE3BA,GAAgBG,OAAOC,UAAUC,eAAeC,KAAKN,EAAc,MAAM,CAUvCO,CAAyBP,YAI7DE,EAAOF,EAAaC,kBAHXH,CAIX"}
|