@corva/ui 3.80.0-1 → 3.80.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
- package/cjs-bundle/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js.map +1 -1
- package/cjs-bundle/components/Annotations/components/AnnotationsList/index.js +1 -1
- package/cjs-bundle/components/Annotations/components/AnnotationsList/index.js.map +1 -1
- package/cjs-bundle/components/AppVersionsSelect/AppVersionsSelect.js +1 -1
- package/cjs-bundle/components/AppVersionsSelect/AppVersionsSelect.js.map +1 -1
- package/cjs-bundle/components/AssetsMultipleSelector/AssetsMultipleSelector.js +1 -1
- package/cjs-bundle/components/AssetsMultipleSelector/AssetsMultipleSelector.js.map +1 -1
- package/cjs-bundle/components/Attachment/index.js +1 -1
- package/cjs-bundle/components/Attachment/index.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.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/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/CommentsSwitch/CommentsSwitchButton.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js.map +1 -1
- 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/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js +1 -1
- package/cjs-bundle/components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js.map +1 -1
- package/cjs-bundle/components/FilesLoaderV2/utils.js +1 -1
- package/cjs-bundle/components/FilesLoaderV2/utils.js.map +1 -1
- package/cjs-bundle/components/GradientManager/GradientManager.js +1 -1
- package/cjs-bundle/components/GradientManager/GradientManager.js.map +1 -1
- package/cjs-bundle/components/GradientManager/GradientSelect.js +1 -1
- package/cjs-bundle/components/GradientManager/GradientSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js +1 -1
- package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/OffsetWellPickerDialog.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/Map/Map.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.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/OffsetWellPickerV2/constants.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/constants.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.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/constants.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/constants.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.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/OffsetWellPickerV3/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.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/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.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/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/constants.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/constants.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useCompanySelectorPermission.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useCompanySelectorPermission.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useIsAdmin.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useIsAdmin.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useLimitNotification.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useLimitNotification.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.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/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
- package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
- package/cjs-bundle/components/StatusBadge/api.js +1 -1
- package/cjs-bundle/components/StatusBadge/api.js.map +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js.map +1 -1
- package/cjs-bundle/components/UserMention/index.js +1 -1
- package/cjs-bundle/components/UserMention/index.js.map +1 -1
- package/cjs-bundle/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js +1 -1
- package/cjs-bundle/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js.map +1 -1
- package/cjs-bundle/componentsV2/AppFooter/DqPopover/DqPopover.js +1 -1
- package/cjs-bundle/componentsV2/AppFooter/DqPopover/DqPopover.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/AppAssets/utils.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/AppAssets/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js.map +1 -1
- package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
- package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
- package/cjs-bundle/componentsV2/FilesDropzone/utils.js +1 -1
- package/cjs-bundle/componentsV2/FilesDropzone/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/FilesLoader/utils.js +1 -1
- package/cjs-bundle/componentsV2/FilesLoader/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/PublishModal/PublishModal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/PublishModal/PublishModal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useInitialize.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useInitialize.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.js.map +1 -1
- package/cjs-bundle/componentsV2/TextInputBase/TextInputBase.js +1 -1
- package/cjs-bundle/componentsV2/TextInputBase/TextInputBase.js.map +1 -1
- package/cjs-bundle/componentsV2/TextInputNext/TextInputNext.js +1 -1
- package/cjs-bundle/componentsV2/TextInputNext/TextInputNext.js.map +1 -1
- package/cjs-bundle/effects/useGlobalOffsetWellsSync.js +1 -1
- package/cjs-bundle/effects/useGlobalOffsetWellsSync.js.map +1 -1
- package/cjs-bundle/effects/useSharedDCStore.js +1 -1
- package/cjs-bundle/effects/useSharedDCStore.js.map +1 -1
- package/cjs-bundle/permissions/useProvidePermissions.js +1 -1
- package/cjs-bundle/permissions/useProvidePermissions.js.map +1 -1
- package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js +1 -1
- package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
- package/cjs-bundle/utils/apps.js +1 -1
- package/cjs-bundle/utils/apps.js.map +1 -1
- package/cjs-bundle/utils/resolveWellHubSlug.js +1 -1
- package/cjs-bundle/utils/resolveWellHubSlug.js.map +1 -1
- package/cjs-bundle/utils/shareRecentRequest.js +2 -0
- package/cjs-bundle/utils/shareRecentRequest.js.map +1 -0
- 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/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
- package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js.map +1 -1
- package/components/Annotations/components/AnnotationsList/index.js +1 -1
- package/components/Annotations/components/AnnotationsList/index.js.map +1 -1
- package/components/AppVersionsSelect/AppVersionsSelect.js +1 -1
- package/components/AppVersionsSelect/AppVersionsSelect.js.map +1 -1
- package/components/AssetsMultipleSelector/AssetsMultipleSelector.js +1 -1
- package/components/AssetsMultipleSelector/AssetsMultipleSelector.js.map +1 -1
- package/components/Attachment/index.js +1 -1
- package/components/Attachment/index.js.map +1 -1
- package/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
- package/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/index.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/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.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/CommentsSwitch/CommentsSwitchButton.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js.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/BHAComponentDetail/constants.d.ts +2 -2
- 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/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js +1 -1
- package/components/FeedItem/FeedItemEditProvider/FeedItemEditProvider.js.map +1 -1
- package/components/FilesLoaderV2/utils.js +1 -1
- package/components/FilesLoaderV2/utils.js.map +1 -1
- package/components/GradientManager/GradientManager.js +1 -1
- package/components/GradientManager/GradientManager.js.map +1 -1
- package/components/GradientManager/GradientSelect.js +1 -1
- package/components/GradientManager/GradientSelect.js.map +1 -1
- package/components/OffsetWellMap/OffsetWellMap.js +1 -1
- package/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
- package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
- package/components/OffsetWellPickerV2/OffsetWellPickerDialog.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/Map/Map.js +1 -1
- package/components/OffsetWellPickerV2/components/Map/Map.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/OffsetWellPickerV2/constants.js +1 -1
- package/components/OffsetWellPickerV2/constants.js.map +1 -1
- package/components/OffsetWellPickerV2/effects/index.js +1 -1
- package/components/OffsetWellPickerV2/effects/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.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/constants.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/constants.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.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/OffsetWellPickerV3/index.js +1 -1
- package/components/OffsetWellPickerV3/index.js.map +1 -1
- package/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
- package/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.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/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useOffsetWellMapState.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.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/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js.map +1 -1
- package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
- package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js.map +1 -1
- package/components/OffsetWellPickerV5/constants.js +1 -1
- package/components/OffsetWellPickerV5/constants.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useAutoSyncOffsetWells.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useCompanySelectorPermission.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useCompanySelectorPermission.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useIsAdmin.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useIsAdmin.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useLimitNotification.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useLimitNotification.js.map +1 -1
- package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js +1 -1
- package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map +1 -1
- package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
- package/components/OffsetWellPickerV5/utils/getCoordinatedWells.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/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
- package/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
- package/components/StatusBadge/api.d.ts.map +1 -1
- package/components/StatusBadge/api.js +1 -1
- package/components/StatusBadge/api.js.map +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js.map +1 -1
- package/components/UserMention/index.js +1 -1
- package/components/UserMention/index.js.map +1 -1
- package/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js +1 -1
- package/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js.map +1 -1
- package/componentsV2/AppFooter/DqPopover/DqPopover.js +1 -1
- package/componentsV2/AppFooter/DqPopover/DqPopover.js.map +1 -1
- package/componentsV2/AppHeader/AppAssets/utils.js +1 -1
- package/componentsV2/AppHeader/AppAssets/utils.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
- package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js.map +1 -1
- package/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js +1 -1
- package/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js.map +1 -1
- package/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
- package/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/hooks/useNonActivePads.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
- package/componentsV2/FilesDropzone/utils.js +1 -1
- package/componentsV2/FilesDropzone/utils.js.map +1 -1
- package/componentsV2/FilesLoader/utils.js +1 -1
- package/componentsV2/FilesLoader/utils.js.map +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
- package/componentsV2/TemplatesControl/PublishModal/PublishModal.js +1 -1
- package/componentsV2/TemplatesControl/PublishModal/PublishModal.js.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useCopyTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useCreateTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useDeleteFolder.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useDeleteTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useExportTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useImportTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useInitialize.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useInitialize.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useMoveToFolder.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useRevertToOriginal.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useShareTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useUnfollowTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useUpdateFolderName.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useUpdateTemplateName.js.map +1 -1
- package/componentsV2/TemplatesControl/Toggle/Toggle.js +1 -1
- package/componentsV2/TemplatesControl/Toggle/Toggle.js.map +1 -1
- package/componentsV2/TextInputBase/TextInputBase.js +1 -1
- package/componentsV2/TextInputBase/TextInputBase.js.map +1 -1
- package/componentsV2/TextInputNext/TextInputNext.js +1 -1
- package/componentsV2/TextInputNext/TextInputNext.js.map +1 -1
- package/effects/useGlobalOffsetWellsSync.js +1 -1
- package/effects/useGlobalOffsetWellsSync.js.map +1 -1
- package/effects/useSharedDCStore.js +1 -1
- package/effects/useSharedDCStore.js.map +1 -1
- package/mcp-server/server.mjs +1 -1
- package/package.json +1 -1
- package/permissions/useProvidePermissions.d.ts.map +1 -1
- package/permissions/useProvidePermissions.js +1 -1
- package/permissions/useProvidePermissions.js.map +1 -1
- package/testing/AppTestWrapper/AppTestWrapper.js +1 -1
- package/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/__tests__/resolveWellHubSlug.test.d.ts +2 -0
- package/utils/__tests__/resolveWellHubSlug.test.d.ts.map +1 -0
- package/utils/apps.js +1 -1
- package/utils/apps.js.map +1 -1
- package/utils/resolveWellHubSlug.d.ts.map +1 -1
- package/utils/resolveWellHubSlug.js +1 -1
- package/utils/resolveWellHubSlug.js.map +1 -1
- package/utils/shareRecentRequest.d.ts +7 -0
- package/utils/shareRecentRequest.d.ts.map +1 -0
- package/utils/shareRecentRequest.js +2 -0
- package/utils/shareRecentRequest.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../src/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js"],"sourcesContent":["import { memo, useState, useRef } from 'react';\nimport { number, shape, string } from 'prop-types';\nimport classNames from 'classnames';\nimport { get, flowRight } from 'lodash';\nimport moment from 'moment';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Paper, Fade, Typography } from '@material-ui/core';\n\nimport { useAnnotationsDispatch } from '../../../../AnnotationsContext';\nimport { ADD_ANNOTATION } from '../../../../constants';\nimport AnnotationInput from '../AnnotationInput';\n\nimport styles from './style.css';\n\nimport Avatar from '~components/Avatar';\nimport useOutsideClick from '~effects/useOutsideClick';\nimport { showSuccessNotification, showErrorNotification } from '~/utils';\nimport { postAnnotation } from '~/clients/jsonApi';\nimport { withUniversalLocationHOC } from '~/components/DevCenter/DevCenterRouterContext';\n\nconst PAGE_NAME = 'AppAnnotationsPo';\n\nconst ANNOTATION_PLACEHOLDER = 'Type annotation here';\n\nconst muiStyles = theme => ({\n inputLabel: {\n color: theme.palette.grey[700],\n fontWeight: 200,\n width: '100%',\n },\n});\n\nconst AddAnnotationForm = ({\n appId,\n assetId,\n assetCompanyId,\n appSettings,\n currentUser = DEFAULT_ADD_ANNOTATION_FORM_CURRENT_USER,\n classes,\n location,\n dashboardType = null,\n}) => {\n const dispatch = useAnnotationsDispatch();\n\n const [inputIsOpen, setInputIsOpen] = useState(false);\n\n const containerRef = useRef(null);\n useOutsideClick(containerRef, () => {\n setInputIsOpen(false);\n });\n\n const handlePost = async (body, period, attachment) => {\n try {\n const annotation = {\n app_id: appId,\n asset_id: assetId,\n body,\n active_until: period,\n attachment: {\n file_name: attachment && attachment.attachmentName,\n s3_link: attachment && attachment.attachmentUrl,\n },\n settings: appSettings,\n };\n const options = {};\n if (dashboardType) options.dashboard_type = dashboardType;\n\n const queryTime = get(location, 'query.time');\n if (queryTime) annotation.data_timestamp = moment(queryTime).format();\n\n const newAnnotation = await postAnnotation(annotation, options);\n dispatch({ type: ADD_ANNOTATION, annotation: newAnnotation });\n } catch (e) {\n showErrorNotification('Error during annotation creation');\n console.error(e);\n return;\n }\n\n showSuccessNotification('Annotation has been added');\n setInputIsOpen(false);\n };\n\n return (\n <div className={styles.cAddAnnotationFormInput}>\n <Avatar\n displayName={`${currentUser.first_name} ${currentUser.last_name}`}\n imgSrc={currentUser.profile_photo}\n size={36}\n />\n <div\n className={classNames(styles.cAddAnnotationFormInputPaper, {\n [styles.cAddAnnotationFormInputPaperOpened]: inputIsOpen,\n [styles.cAddAnnotationFormInputPaperClosed]: !inputIsOpen,\n })}\n >\n <Fade in={!inputIsOpen} timeout={500}>\n <Paper className={styles.cAddAnnotationFormInputPaperLabel}>\n <Typography\n variant=\"body2\"\n data-testid={`${PAGE_NAME}_collapsedInput`}\n className={classes.inputLabel}\n onClick={() => setInputIsOpen(true)}\n >\n {ANNOTATION_PLACEHOLDER}\n </Typography>\n </Paper>\n </Fade>\n <Fade in={inputIsOpen} timeout={100}>\n <div className={styles.cAddAnnotationFormInputPaperAddAnnotation}>\n {inputIsOpen && (\n <AnnotationInput\n onSend={handlePost}\n assetCompanyId={assetCompanyId}\n currentUser={currentUser}\n />\n )}\n </div>\n </Fade>\n </div>\n </div>\n );\n};\n\nAddAnnotationForm.propTypes = {\n appId: number.isRequired,\n assetId: number.isRequired,\n assetCompanyId: number.isRequired,\n appSettings: shape().isRequired,\n currentUser: shape({}),\n classes: shape().isRequired,\n location: shape().isRequired,\n dashboardType: string,\n};\n\nconst DEFAULT_ADD_ANNOTATION_FORM_CURRENT_USER = {};\n\nexport default flowRight([withStyles(muiStyles), withUniversalLocationHOC])(\n memo(AddAnnotationForm)\n);\n"],"names":["AddAnnotationForm","_ref","_classNames","appId","assetId","assetCompanyId","appSettings","_ref$currentUser","currentUser","DEFAULT_ADD_ANNOTATION_FORM_CURRENT_USER","classes","location","_ref$dashboardType","dashboardType","dispatch","useAnnotationsDispatch","useState","_useState2","_slicedToArray","_useState","inputIsOpen","setInputIsOpen","containerRef","useRef","useOutsideClick","_ref2","handlePost","_asyncToGenerator","_regeneratorRuntime","mark","body","period","attachment","annotation","options","queryTime","newAnnotation","wrap","_context","prev","next","app_id","asset_id","active_until","file_name","attachmentName","s3_link","attachmentUrl","settings","dashboard_type","get","data_timestamp","moment","format","postAnnotation","sent","type","ADD_ANNOTATION","t0","showErrorNotification","console","error","abrupt","showSuccessNotification","stop","_callee","_x","_x2","_x3","apply","this","arguments","_jsxs","className","styles","cAddAnnotationFormInput","children","_jsx","Avatar","displayName","concat","first_name","last_name","imgSrc","profile_photo","size","jsxs","classNames","cAddAnnotationFormInputPaper","cAddAnnotationFormInputPaperOpened","cAddAnnotationFormInputPaperClosed","Fade","in","timeout","Paper","cAddAnnotationFormInputPaperLabel","Typography","variant","inputLabel","onClick","jsx","cAddAnnotationFormInputPaperAddAnnotation","AnnotationInput","onSend","propTypes","number","isRequired","shape","string","AddAnnotationForm$1","flowRight","withStyles","theme","color","palette","grey","fontWeight","width","withUniversalLocationHOC","memo"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../src/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js"],"sourcesContent":["import { memo, useState, useRef } from 'react';\nimport { number, shape, string } from 'prop-types';\nimport classNames from 'classnames';\nimport { get, flowRight } from 'lodash';\nimport moment from 'moment';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Paper, Fade, Typography } from '@material-ui/core';\n\nimport { useAnnotationsDispatch } from '../../../../AnnotationsContext';\nimport { ADD_ANNOTATION } from '../../../../constants';\nimport AnnotationInput from '../AnnotationInput';\n\nimport styles from './style.css';\n\nimport Avatar from '~components/Avatar';\nimport useOutsideClick from '~effects/useOutsideClick';\nimport { showSuccessNotification, showErrorNotification } from '~/utils';\nimport { postAnnotation } from '~/clients/jsonApi';\nimport { withUniversalLocationHOC } from '~/components/DevCenter/DevCenterRouterContext';\n\nconst PAGE_NAME = 'AppAnnotationsPo';\n\nconst ANNOTATION_PLACEHOLDER = 'Type annotation here';\n\nconst muiStyles = theme => ({\n inputLabel: {\n color: theme.palette.grey[700],\n fontWeight: 200,\n width: '100%',\n },\n});\n\nconst AddAnnotationForm = ({\n appId,\n assetId,\n assetCompanyId,\n appSettings,\n currentUser = DEFAULT_ADD_ANNOTATION_FORM_CURRENT_USER,\n classes,\n location,\n dashboardType = null,\n}) => {\n const dispatch = useAnnotationsDispatch();\n\n const [inputIsOpen, setInputIsOpen] = useState(false);\n\n const containerRef = useRef(null);\n useOutsideClick(containerRef, () => {\n setInputIsOpen(false);\n });\n\n const handlePost = async (body, period, attachment) => {\n try {\n const annotation = {\n app_id: appId,\n asset_id: assetId,\n body,\n active_until: period,\n attachment: {\n file_name: attachment && attachment.attachmentName,\n s3_link: attachment && attachment.attachmentUrl,\n },\n settings: appSettings,\n };\n const options = {};\n if (dashboardType) options.dashboard_type = dashboardType;\n\n const queryTime = get(location, 'query.time');\n if (queryTime) annotation.data_timestamp = moment(queryTime).format();\n\n const newAnnotation = await postAnnotation(annotation, options);\n dispatch({ type: ADD_ANNOTATION, annotation: newAnnotation });\n } catch (e) {\n showErrorNotification('Error during annotation creation');\n console.error(e);\n return;\n }\n\n showSuccessNotification('Annotation has been added');\n setInputIsOpen(false);\n };\n\n return (\n <div className={styles.cAddAnnotationFormInput}>\n <Avatar\n displayName={`${currentUser.first_name} ${currentUser.last_name}`}\n imgSrc={currentUser.profile_photo}\n size={36}\n />\n <div\n className={classNames(styles.cAddAnnotationFormInputPaper, {\n [styles.cAddAnnotationFormInputPaperOpened]: inputIsOpen,\n [styles.cAddAnnotationFormInputPaperClosed]: !inputIsOpen,\n })}\n >\n <Fade in={!inputIsOpen} timeout={500}>\n <Paper className={styles.cAddAnnotationFormInputPaperLabel}>\n <Typography\n variant=\"body2\"\n data-testid={`${PAGE_NAME}_collapsedInput`}\n className={classes.inputLabel}\n onClick={() => setInputIsOpen(true)}\n >\n {ANNOTATION_PLACEHOLDER}\n </Typography>\n </Paper>\n </Fade>\n <Fade in={inputIsOpen} timeout={100}>\n <div className={styles.cAddAnnotationFormInputPaperAddAnnotation}>\n {inputIsOpen && (\n <AnnotationInput\n onSend={handlePost}\n assetCompanyId={assetCompanyId}\n currentUser={currentUser}\n />\n )}\n </div>\n </Fade>\n </div>\n </div>\n );\n};\n\nAddAnnotationForm.propTypes = {\n appId: number.isRequired,\n assetId: number.isRequired,\n assetCompanyId: number.isRequired,\n appSettings: shape().isRequired,\n currentUser: shape({}),\n classes: shape().isRequired,\n location: shape().isRequired,\n dashboardType: string,\n};\n\nconst DEFAULT_ADD_ANNOTATION_FORM_CURRENT_USER = {};\n\nexport default flowRight([withStyles(muiStyles), withUniversalLocationHOC])(\n memo(AddAnnotationForm)\n);\n"],"names":["AddAnnotationForm","_ref","_classNames","appId","assetId","assetCompanyId","appSettings","_ref$currentUser","currentUser","DEFAULT_ADD_ANNOTATION_FORM_CURRENT_USER","classes","location","_ref$dashboardType","dashboardType","dispatch","useAnnotationsDispatch","useState","_useState2","_slicedToArray","_useState","inputIsOpen","setInputIsOpen","containerRef","useRef","useOutsideClick","_ref2","handlePost","_asyncToGenerator","_regeneratorRuntime","mark","body","period","attachment","annotation","options","queryTime","newAnnotation","wrap","_context","prev","next","app_id","asset_id","active_until","file_name","attachmentName","s3_link","attachmentUrl","settings","dashboard_type","get","data_timestamp","moment","format","postAnnotation","sent","type","ADD_ANNOTATION","t0","showErrorNotification","console","error","abrupt","showSuccessNotification","stop","_callee","_x","_x2","_x3","apply","this","arguments","_jsxs","className","styles","cAddAnnotationFormInput","children","_jsx","Avatar","displayName","concat","first_name","last_name","imgSrc","profile_photo","size","jsxs","classNames","cAddAnnotationFormInputPaper","cAddAnnotationFormInputPaperOpened","cAddAnnotationFormInputPaperClosed","Fade","in","timeout","Paper","cAddAnnotationFormInputPaperLabel","Typography","variant","inputLabel","onClick","jsx","cAddAnnotationFormInputPaperAddAnnotation","AnnotationInput","onSend","propTypes","number","isRequired","shape","string","AddAnnotationForm$1","flowRight","withStyles","theme","color","palette","grey","fontWeight","width","withUniversalLocationHOC","memo"],"mappings":"qvGAgCMA,EAAoB,SASpBC,GAAA,IAAAC,EARJC,IAAAA,MACAC,IAAAA,QACAC,IAAAA,eACAC,IAAAA,YAAWC,EAA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AAA,EAEjDoG,EAAeC,YAAU,CAACC,EAAUA,YAhHlB,SAAAC,GAAK,MAAK,CAC1Bd,WAAY,CACVe,MAAOD,EAAME,QAAQC,KAAK,KAC1BC,WAAY,IACZC,MAAO,QAEV,IA0GgDC,EAAwBA,0BAA1DR,CACbS,EAAAA,KAAKvH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/regenerator"),n=require("react"),i=require("prop-types"),a=require("classnames"),o=require("@material-ui/core/styles"),u=require("@material-ui/core"),c=require("@material-ui/icons/ChevronLeft"),l=require("../../../../clients/jsonApi/index.js"),d=require("../../AnnotationsContext.js"),p=require("../../constants.js"),q=require("./components/AddAnnotationForm/index.js"),m=require("./components/Annotation/index.js"),h=require("./style.css.js");require("../../../UserMention/utils/index.js"),require("../../../../utils/convert.js"),require("../../../../constants/completion.js"),require("moment"),require("../../../../constants/alerts.js"),require("../../../../utils/casing/validation.js"),require("lodash/mean"),require("lodash"),require("../../../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("query-string"),require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("../../../GradientManager/configuration/constants.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 j=require("../../../../utils/mobileDetect.js");require("../../../../utils/feed.js"),require("../../../../utils/reports.js"),require("moment-timezone");var f=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("@babel/runtime/helpers/objectWithoutProperties"),require("../../../../utils/charts/Styles.scss.js"),require("../../../../utils/getSingleAsset.js");var g=require("../../../InfiniteList/index.js"),b=require("../../../../effects/useOutsideClick.js"),y=require("react/jsx-runtime");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=v(e),A=v(t),T=v(r),N=v(s),C=v(a),I=v(c),S="AppAnnotationsPo",R=function(e){var t,r=e.appId,s=e.appTitle,i=e.assetId,a=e.assetCompanyId,o=e.appSettings,c=void 0===o?_:o,j=e.currentUser,v=e.onClose,R=e.isNative,L=void 0===R?k:R,w=e.classes,P=e.dashboardType,O=void 0===P?null:P,D=d.useAnnotationsState().annotations,F=d.useAnnotationsDispatch(),U=n.useRef(),E=n.useRef();b(U,v);var H=n.useState(!1),W=T.default(H,2),B=W[0],M=W[1],G=n.useState(!0),z=T.default(G,2),J=z[0],K=z[1],Q=n.useState(!0),V=T.default(Q,2),X=V[0],Y=V[1],Z=n.useState(1),$=T.default(Z,2),ee=$[0],te=$[1];function re(){return(re=A.default(N.default.mark((function e(){var t,s,n;return N.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&i){e.next=2;break}return e.abrupt("return");case 2:return K(!0),e.prev=3,s={page:ee,per_page:4,sort:"created_at",order:"desc"},O&&(s.dashboard_type=O),e.next=8,l.getAnnotations(r,i,s);case 8:t=e.sent,F({type:1===ee?p.SET_ANNOTATIONS:p.APPEND_ANNOTATIONS,annotations:t}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),console.error(e.t0);case 15:n=t&&t.data.length<4,te(ee+1),Y(!n),K(!1);case 19:case"end":return e.stop()}}),e,null,[[3,12]])})))).apply(this,arguments)}return n.useEffect((function(){M(!0)}),[]),y.jsx(u.RootRef,{rootRef:U,children:y.jsxs(u.Paper,{className:C.default(h.cAnnotationsList,(t={},x.default(t,h.cAnnotationsListOpen,B),x.default(t,h.cAnnotationsListOpenNative,L),t)),children:[y.jsx(g,{infiniteClassName:h.cAnnotationsListContentContainer,headerComponent:y.jsxs(y.Fragment,{children:[y.jsx(u.Typography,{"data-testid":"".concat(S,"_appTitle"),variant:"body1",className:w.title,children:s}),y.jsx("div",{className:h.cAnnotationsListContentTop,children:y.jsxs(u.Typography,{"data-testid":"".concat(S,"_annotationsTitle"),variant:"caption",className:w.secondaryTitle,children:["Annotations (",D.data?D.data.length:0,")"]})}),y.jsx(q,{appId:r,assetId:i,assetCompanyId:a,appSettings:c,currentUser:j,dashboardType:O})]}),useWindow:L,items:D.data||[],showNoItemsFound:!(D.data&&0!==D.data.length||J),noItemsFoundLabel:y.jsx(u.Typography,{variant:"body2","data-testid":"".concat(S,"_noAnnotations"),className:w.noAnnotations,children:"No Annotations yet"}),threshold:50,infiniteContainerHeight:U.current&&E.current?U.current.clientHeight-E.current.clientHeight:null,moreItemsMayExist:X,pathToCreatedAt:["attributes","created_at"],renderItem:function(e){return y.jsx(m,{isNative:L,annotation:e,assetCompanyId:a,included:D.included,currentUser:j,showSuccessNotification:f.showSuccessNotification},e.id)},loadItems:function(){return re.apply(this,arguments)}}),y.jsx("div",{className:h.cAnnotationsListActions,ref:E,children:y.jsx(u.Tooltip,{title:"Hide",placement:"bottom",children:y.jsx(u.IconButton,{"data-testid":"".concat(S,"_hideButton"),onClick:v,className:w.backIcon,children:y.jsx(I.default,{})})})})]})})};R.propTypes={appId:i.number.isRequired,appTitle:i.string.isRequired,assetId:i.number.isRequired,assetCompanyId:i.number.isRequired,appSettings:i.shape(),classes:i.shape().isRequired,onClose:i.func.isRequired,currentUser:i.shape({}).isRequired,isNative:i.bool,dashboardType:i.string};var _={},k=j.isNativeDetected,L=o.withStyles((function(e){return{title:{fontWeight:200,marginBottom:20},secondaryTitle:{fontWeight:200,textTransform:"uppercase",color:e.palette.grey[600]},annotateIcon:{padding:0,"&:hover":{backgroundColor:"transparent",boxShadow:"none"}},noAnnotations:{marginTop:16},backIcon:{cursor:"pointer",color:e.palette.grey[600],padding:5}}}))(n.memo(R));module.exports=L;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/regenerator"),n=require("react"),i=require("prop-types"),a=require("classnames"),o=require("@material-ui/core/styles"),u=require("@material-ui/core"),c=require("@material-ui/icons/ChevronLeft"),l=require("../../../../clients/jsonApi/index.js"),d=require("../../AnnotationsContext.js"),p=require("../../constants.js"),q=require("./components/AddAnnotationForm/index.js"),m=require("./components/Annotation/index.js"),h=require("./style.css.js");require("../../../UserMention/utils/index.js"),require("../../../../utils/convert.js"),require("../../../../constants/completion.js"),require("moment"),require("../../../../constants/alerts.js"),require("../../../../utils/casing/validation.js"),require("lodash/mean"),require("lodash"),require("../../../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("query-string"),require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("../../../GradientManager/configuration/constants.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 j=require("../../../../utils/mobileDetect.js");require("../../../../utils/feed.js"),require("../../../../utils/reports.js"),require("moment-timezone");var f=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("../../../../utils/shareRecentRequest.js"),require("@babel/runtime/helpers/objectWithoutProperties"),require("../../../../utils/charts/Styles.scss.js"),require("../../../../utils/getSingleAsset.js");var g=require("../../../InfiniteList/index.js"),b=require("../../../../effects/useOutsideClick.js"),y=require("react/jsx-runtime");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=v(e),A=v(t),T=v(r),N=v(s),C=v(a),I=v(c),S="AppAnnotationsPo",R=function(e){var t,r=e.appId,s=e.appTitle,i=e.assetId,a=e.assetCompanyId,o=e.appSettings,c=void 0===o?_:o,j=e.currentUser,v=e.onClose,R=e.isNative,L=void 0===R?k:R,w=e.classes,P=e.dashboardType,O=void 0===P?null:P,D=d.useAnnotationsState().annotations,F=d.useAnnotationsDispatch(),U=n.useRef(),E=n.useRef();b(U,v);var H=n.useState(!1),W=T.default(H,2),B=W[0],M=W[1],G=n.useState(!0),z=T.default(G,2),J=z[0],K=z[1],Q=n.useState(!0),V=T.default(Q,2),X=V[0],Y=V[1],Z=n.useState(1),$=T.default(Z,2),ee=$[0],te=$[1];function re(){return(re=A.default(N.default.mark((function e(){var t,s,n;return N.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&i){e.next=2;break}return e.abrupt("return");case 2:return K(!0),e.prev=3,s={page:ee,per_page:4,sort:"created_at",order:"desc"},O&&(s.dashboard_type=O),e.next=8,l.getAnnotations(r,i,s);case 8:t=e.sent,F({type:1===ee?p.SET_ANNOTATIONS:p.APPEND_ANNOTATIONS,annotations:t}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),console.error(e.t0);case 15:n=t&&t.data.length<4,te(ee+1),Y(!n),K(!1);case 19:case"end":return e.stop()}}),e,null,[[3,12]])})))).apply(this,arguments)}return n.useEffect((function(){M(!0)}),[]),y.jsx(u.RootRef,{rootRef:U,children:y.jsxs(u.Paper,{className:C.default(h.cAnnotationsList,(t={},x.default(t,h.cAnnotationsListOpen,B),x.default(t,h.cAnnotationsListOpenNative,L),t)),children:[y.jsx(g,{infiniteClassName:h.cAnnotationsListContentContainer,headerComponent:y.jsxs(y.Fragment,{children:[y.jsx(u.Typography,{"data-testid":"".concat(S,"_appTitle"),variant:"body1",className:w.title,children:s}),y.jsx("div",{className:h.cAnnotationsListContentTop,children:y.jsxs(u.Typography,{"data-testid":"".concat(S,"_annotationsTitle"),variant:"caption",className:w.secondaryTitle,children:["Annotations (",D.data?D.data.length:0,")"]})}),y.jsx(q,{appId:r,assetId:i,assetCompanyId:a,appSettings:c,currentUser:j,dashboardType:O})]}),useWindow:L,items:D.data||[],showNoItemsFound:!(D.data&&0!==D.data.length||J),noItemsFoundLabel:y.jsx(u.Typography,{variant:"body2","data-testid":"".concat(S,"_noAnnotations"),className:w.noAnnotations,children:"No Annotations yet"}),threshold:50,infiniteContainerHeight:U.current&&E.current?U.current.clientHeight-E.current.clientHeight:null,moreItemsMayExist:X,pathToCreatedAt:["attributes","created_at"],renderItem:function(e){return y.jsx(m,{isNative:L,annotation:e,assetCompanyId:a,included:D.included,currentUser:j,showSuccessNotification:f.showSuccessNotification},e.id)},loadItems:function(){return re.apply(this,arguments)}}),y.jsx("div",{className:h.cAnnotationsListActions,ref:E,children:y.jsx(u.Tooltip,{title:"Hide",placement:"bottom",children:y.jsx(u.IconButton,{"data-testid":"".concat(S,"_hideButton"),onClick:v,className:w.backIcon,children:y.jsx(I.default,{})})})})]})})};R.propTypes={appId:i.number.isRequired,appTitle:i.string.isRequired,assetId:i.number.isRequired,assetCompanyId:i.number.isRequired,appSettings:i.shape(),classes:i.shape().isRequired,onClose:i.func.isRequired,currentUser:i.shape({}).isRequired,isNative:i.bool,dashboardType:i.string};var _={},k=j.isNativeDetected,L=o.withStyles((function(e){return{title:{fontWeight:200,marginBottom:20},secondaryTitle:{fontWeight:200,textTransform:"uppercase",color:e.palette.grey[600]},annotateIcon:{padding:0,"&:hover":{backgroundColor:"transparent",boxShadow:"none"}},noAnnotations:{marginTop:16},backIcon:{cursor:"pointer",color:e.palette.grey[600],padding:5}}}))(n.memo(R));module.exports=L;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/components/Annotations/components/AnnotationsList/index.js"],"sourcesContent":["import { memo, useState, useEffect, useRef } from 'react';\nimport { func, bool, shape, number, string } from 'prop-types';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Paper, Typography, IconButton, Tooltip, RootRef } from '@material-ui/core';\nimport BackIcon from '@material-ui/icons/ChevronLeft';\n\nimport { getAnnotations } from '../../../../clients/jsonApi';\nimport { useAnnotationsState, useAnnotationsDispatch } from '../../AnnotationsContext';\nimport { SET_ANNOTATIONS, APPEND_ANNOTATIONS } from '../../constants';\n\nimport AddAnnotationForm from './components/AddAnnotationForm';\nimport Annotation from './components/Annotation';\n\nimport styles from './style.css';\n\nimport { showSuccessNotification } from '~/utils';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport InfiniteList from '~components/InfiniteList';\nimport useOutsideClick from '~effects/useOutsideClick';\n\nconst PAGE_NAME = 'AppAnnotationsPo';\n\nconst muiStyles = theme => ({\n title: { fontWeight: 200, marginBottom: 20 },\n secondaryTitle: {\n fontWeight: 200,\n textTransform: 'uppercase',\n color: theme.palette.grey[600],\n },\n annotateIcon: {\n padding: 0,\n '&:hover': {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n },\n noAnnotations: { marginTop: 16 },\n backIcon: { cursor: 'pointer', color: theme.palette.grey[600], padding: 5 },\n});\n\nconst PER_PAGE = 4;\n\nconst AnnotationsList = ({\n appId,\n appTitle,\n assetId,\n assetCompanyId,\n appSettings = DEFAULT_ANNOTATIONS_LIST_APP_SETTINGS,\n currentUser,\n onClose,\n isNative = DEFAULT_ANNOTATIONS_LIST_IS_NATIVE,\n classes,\n dashboardType = null,\n}) => {\n const { annotations } = useAnnotationsState();\n const dispatch = useAnnotationsDispatch();\n\n const rootRef = useRef();\n const footerRef = useRef();\n\n const infiniteContainerHeight = () => {\n if (rootRef.current && footerRef.current)\n return rootRef.current.clientHeight - footerRef.current.clientHeight;\n return null;\n };\n\n useOutsideClick(rootRef, onClose);\n\n const [isOpen, setIsOpen] = useState(false);\n const [isInfiniteLoading, setIsInfiniteLoading] = useState(true);\n const [moreItemsMayExist, setMoreItemsMayExist] = useState(true);\n const [page, setPage] = useState(1);\n\n async function handleFetchAnnotations() {\n if (!(appId && assetId)) return;\n setIsInfiniteLoading(true);\n\n let response;\n try {\n const options = {\n page,\n per_page: PER_PAGE,\n sort: 'created_at',\n order: 'desc',\n };\n if (dashboardType) options.dashboard_type = dashboardType;\n\n response = await getAnnotations(appId, assetId, options);\n dispatch({\n type: page === 1 ? SET_ANNOTATIONS : APPEND_ANNOTATIONS,\n annotations: response,\n });\n } catch (e) {\n console.error(e);\n }\n\n const lessThanPerPage = response && response.data.length < PER_PAGE;\n\n setPage(page + 1);\n setMoreItemsMayExist(!lessThanPerPage);\n setIsInfiniteLoading(false);\n }\n\n useEffect(() => {\n setIsOpen(true); // NOTE: Opens here because of for the sliding effect on open\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <RootRef rootRef={rootRef}>\n <Paper\n className={classNames(styles.cAnnotationsList, {\n [styles.cAnnotationsListOpen]: isOpen,\n [styles.cAnnotationsListOpenNative]: isNative,\n })}\n >\n <InfiniteList\n infiniteClassName={styles.cAnnotationsListContentContainer}\n headerComponent={\n <>\n <Typography\n data-testid={`${PAGE_NAME}_appTitle`}\n variant=\"body1\"\n className={classes.title}\n >\n {appTitle}\n </Typography>\n\n <div className={styles.cAnnotationsListContentTop}>\n <Typography\n data-testid={`${PAGE_NAME}_annotationsTitle`}\n variant=\"caption\"\n className={classes.secondaryTitle}\n >\n Annotations ({annotations.data ? annotations.data.length : 0})\n </Typography>\n </div>\n\n <AddAnnotationForm\n appId={appId}\n assetId={assetId}\n assetCompanyId={assetCompanyId}\n appSettings={appSettings}\n currentUser={currentUser}\n dashboardType={dashboardType}\n />\n </>\n }\n useWindow={isNative}\n items={annotations.data || []}\n showNoItemsFound={\n (!annotations.data || annotations.data.length === 0) && !isInfiniteLoading\n }\n noItemsFoundLabel={\n <Typography\n variant=\"body2\"\n data-testid={`${PAGE_NAME}_noAnnotations`}\n className={classes.noAnnotations}\n >\n No Annotations yet\n </Typography>\n }\n threshold={50}\n infiniteContainerHeight={infiniteContainerHeight()}\n moreItemsMayExist={moreItemsMayExist}\n pathToCreatedAt={['attributes', 'created_at']}\n renderItem={item => (\n <Annotation\n key={item.id}\n isNative={isNative}\n annotation={item}\n assetCompanyId={assetCompanyId}\n included={annotations.included}\n currentUser={currentUser}\n showSuccessNotification={showSuccessNotification}\n />\n )}\n loadItems={handleFetchAnnotations}\n />\n <div className={styles.cAnnotationsListActions} ref={footerRef}>\n <Tooltip title=\"Hide\" placement=\"bottom\">\n <IconButton\n data-testid={`${PAGE_NAME}_hideButton`}\n onClick={onClose}\n className={classes.backIcon}\n >\n <BackIcon />\n </IconButton>\n </Tooltip>\n </div>\n </Paper>\n </RootRef>\n );\n};\n\nAnnotationsList.propTypes = {\n appId: number.isRequired,\n appTitle: string.isRequired,\n assetId: number.isRequired,\n assetCompanyId: number.isRequired,\n appSettings: shape(),\n classes: shape().isRequired,\n onClose: func.isRequired,\n currentUser: shape({}).isRequired,\n isNative: bool,\n dashboardType: string,\n};\n\nconst DEFAULT_ANNOTATIONS_LIST_APP_SETTINGS = {};\nconst DEFAULT_ANNOTATIONS_LIST_IS_NATIVE = isNativeDetected;\n\nexport default withStyles(muiStyles)(memo(AnnotationsList));\n"],"names":["PAGE_NAME","AnnotationsList","_ref","_classNames","appId","appTitle","assetId","assetCompanyId","_ref$appSettings","appSettings","DEFAULT_ANNOTATIONS_LIST_APP_SETTINGS","currentUser","onClose","_ref$isNative","isNative","DEFAULT_ANNOTATIONS_LIST_IS_NATIVE","classes","_ref$dashboardType","dashboardType","annotations","useAnnotationsState","dispatch","useAnnotationsDispatch","rootRef","useRef","footerRef","useOutsideClick","useState","_useState2","_slicedToArray","_useState","isOpen","setIsOpen","_useState4","_useState3","isInfiniteLoading","setIsInfiniteLoading","_useState6","_useState5","moreItemsMayExist","setMoreItemsMayExist","_useState8","_useState7","page","setPage","_handleFetchAnnotations","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","options","lessThanPerPage","wrap","_context","prev","next","abrupt","per_page","sort","order","dashboard_type","getAnnotations","sent","type","SET_ANNOTATIONS","APPEND_ANNOTATIONS","t0","console","error","data","length","stop","apply","this","arguments","useEffect","_jsx","RootRef","children","_jsxs","Paper","className","classNames","styles","cAnnotationsList","cAnnotationsListOpen","cAnnotationsListOpenNative","InfiniteList","infiniteClassName","cAnnotationsListContentContainer","headerComponent","jsxs","_Fragment","Typography","concat","variant","title","jsx","cAnnotationsListContentTop","secondaryTitle","AddAnnotationForm","useWindow","items","showNoItemsFound","noItemsFoundLabel","noAnnotations","threshold","infiniteContainerHeight","current","clientHeight","pathToCreatedAt","renderItem","item","Annotation","annotation","included","showSuccessNotification","id","loadItems","cAnnotationsListActions","ref","Tooltip","placement","IconButton","onClick","backIcon","BackIcon","propTypes","number","isRequired","string","shape","func","bool","isNativeDetected","withStyles","theme","fontWeight","marginBottom","textTransform","color","palette","grey","annotateIcon","padding","backgroundColor","boxShadow","marginTop","cursor","memo"],"mappings":"2zFAqBMA,EAAY,mBAsBZC,EAAkB,SAWlBC,GAAA,IAAAC,EAVJC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,QACAC,IAAAA,eAAcC,EAAAN,EACdO,YAAAA,aAAcC,EAAqCF,EACnDG,IAAAA,YACAC,IAAAA,QAAOC,EAAAX,EACPY,SAAAA,aAAWC,EAAkCF,EAC7CG,IAAAA,QAAOC,EAAAf,EACPgB,c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MAAK,CAC1BxC,MAAO,CAAEyC,WAAY,IAAKC,aAAc,IACxCvC,eAAgB,CACdsC,WAAY,IACZE,cAAe,YACfC,MAAOJ,EAAMK,QAAQC,KAAK,MAE5BC,aAAc,CACZC,QAAS,EACT,UAAW,CACTC,gBAAiB,cACjBC,UAAW,SAGfzC,cAAe,CAAE0C,UAAW,IAC5BtB,SAAU,CAAEuB,OAAQ,UAAWR,MAAOJ,EAAMK,QAAQC,KAAK,KAAME,QAAS,GACzE,GA4KcT,CAAsBc,EAAIA,KAACrJ"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/Annotations/components/AnnotationsList/index.js"],"sourcesContent":["import { memo, useState, useEffect, useRef } from 'react';\nimport { func, bool, shape, number, string } from 'prop-types';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Paper, Typography, IconButton, Tooltip, RootRef } from '@material-ui/core';\nimport BackIcon from '@material-ui/icons/ChevronLeft';\n\nimport { getAnnotations } from '../../../../clients/jsonApi';\nimport { useAnnotationsState, useAnnotationsDispatch } from '../../AnnotationsContext';\nimport { SET_ANNOTATIONS, APPEND_ANNOTATIONS } from '../../constants';\n\nimport AddAnnotationForm from './components/AddAnnotationForm';\nimport Annotation from './components/Annotation';\n\nimport styles from './style.css';\n\nimport { showSuccessNotification } from '~/utils';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport InfiniteList from '~components/InfiniteList';\nimport useOutsideClick from '~effects/useOutsideClick';\n\nconst PAGE_NAME = 'AppAnnotationsPo';\n\nconst muiStyles = theme => ({\n title: { fontWeight: 200, marginBottom: 20 },\n secondaryTitle: {\n fontWeight: 200,\n textTransform: 'uppercase',\n color: theme.palette.grey[600],\n },\n annotateIcon: {\n padding: 0,\n '&:hover': {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n },\n noAnnotations: { marginTop: 16 },\n backIcon: { cursor: 'pointer', color: theme.palette.grey[600], padding: 5 },\n});\n\nconst PER_PAGE = 4;\n\nconst AnnotationsList = ({\n appId,\n appTitle,\n assetId,\n assetCompanyId,\n appSettings = DEFAULT_ANNOTATIONS_LIST_APP_SETTINGS,\n currentUser,\n onClose,\n isNative = DEFAULT_ANNOTATIONS_LIST_IS_NATIVE,\n classes,\n dashboardType = null,\n}) => {\n const { annotations } = useAnnotationsState();\n const dispatch = useAnnotationsDispatch();\n\n const rootRef = useRef();\n const footerRef = useRef();\n\n const infiniteContainerHeight = () => {\n if (rootRef.current && footerRef.current)\n return rootRef.current.clientHeight - footerRef.current.clientHeight;\n return null;\n };\n\n useOutsideClick(rootRef, onClose);\n\n const [isOpen, setIsOpen] = useState(false);\n const [isInfiniteLoading, setIsInfiniteLoading] = useState(true);\n const [moreItemsMayExist, setMoreItemsMayExist] = useState(true);\n const [page, setPage] = useState(1);\n\n async function handleFetchAnnotations() {\n if (!(appId && assetId)) return;\n setIsInfiniteLoading(true);\n\n let response;\n try {\n const options = {\n page,\n per_page: PER_PAGE,\n sort: 'created_at',\n order: 'desc',\n };\n if (dashboardType) options.dashboard_type = dashboardType;\n\n response = await getAnnotations(appId, assetId, options);\n dispatch({\n type: page === 1 ? SET_ANNOTATIONS : APPEND_ANNOTATIONS,\n annotations: response,\n });\n } catch (e) {\n console.error(e);\n }\n\n const lessThanPerPage = response && response.data.length < PER_PAGE;\n\n setPage(page + 1);\n setMoreItemsMayExist(!lessThanPerPage);\n setIsInfiniteLoading(false);\n }\n\n useEffect(() => {\n setIsOpen(true); // NOTE: Opens here because of for the sliding effect on open\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <RootRef rootRef={rootRef}>\n <Paper\n className={classNames(styles.cAnnotationsList, {\n [styles.cAnnotationsListOpen]: isOpen,\n [styles.cAnnotationsListOpenNative]: isNative,\n })}\n >\n <InfiniteList\n infiniteClassName={styles.cAnnotationsListContentContainer}\n headerComponent={\n <>\n <Typography\n data-testid={`${PAGE_NAME}_appTitle`}\n variant=\"body1\"\n className={classes.title}\n >\n {appTitle}\n </Typography>\n\n <div className={styles.cAnnotationsListContentTop}>\n <Typography\n data-testid={`${PAGE_NAME}_annotationsTitle`}\n variant=\"caption\"\n className={classes.secondaryTitle}\n >\n Annotations ({annotations.data ? annotations.data.length : 0})\n </Typography>\n </div>\n\n <AddAnnotationForm\n appId={appId}\n assetId={assetId}\n assetCompanyId={assetCompanyId}\n appSettings={appSettings}\n currentUser={currentUser}\n dashboardType={dashboardType}\n />\n </>\n }\n useWindow={isNative}\n items={annotations.data || []}\n showNoItemsFound={\n (!annotations.data || annotations.data.length === 0) && !isInfiniteLoading\n }\n noItemsFoundLabel={\n <Typography\n variant=\"body2\"\n data-testid={`${PAGE_NAME}_noAnnotations`}\n className={classes.noAnnotations}\n >\n No Annotations yet\n </Typography>\n }\n threshold={50}\n infiniteContainerHeight={infiniteContainerHeight()}\n moreItemsMayExist={moreItemsMayExist}\n pathToCreatedAt={['attributes', 'created_at']}\n renderItem={item => (\n <Annotation\n key={item.id}\n isNative={isNative}\n annotation={item}\n assetCompanyId={assetCompanyId}\n included={annotations.included}\n currentUser={currentUser}\n showSuccessNotification={showSuccessNotification}\n />\n )}\n loadItems={handleFetchAnnotations}\n />\n <div className={styles.cAnnotationsListActions} ref={footerRef}>\n <Tooltip title=\"Hide\" placement=\"bottom\">\n <IconButton\n data-testid={`${PAGE_NAME}_hideButton`}\n onClick={onClose}\n className={classes.backIcon}\n >\n <BackIcon />\n </IconButton>\n </Tooltip>\n </div>\n </Paper>\n </RootRef>\n );\n};\n\nAnnotationsList.propTypes = {\n appId: number.isRequired,\n appTitle: string.isRequired,\n assetId: number.isRequired,\n assetCompanyId: number.isRequired,\n appSettings: shape(),\n classes: shape().isRequired,\n onClose: func.isRequired,\n currentUser: shape({}).isRequired,\n isNative: bool,\n dashboardType: string,\n};\n\nconst DEFAULT_ANNOTATIONS_LIST_APP_SETTINGS = {};\nconst DEFAULT_ANNOTATIONS_LIST_IS_NATIVE = isNativeDetected;\n\nexport default withStyles(muiStyles)(memo(AnnotationsList));\n"],"names":["PAGE_NAME","AnnotationsList","_ref","_classNames","appId","appTitle","assetId","assetCompanyId","_ref$appSettings","appSettings","DEFAULT_ANNOTATIONS_LIST_APP_SETTINGS","currentUser","onClose","_ref$isNative","isNative","DEFAULT_ANNOTATIONS_LIST_IS_NATIVE","classes","_ref$dashboardType","dashboardType","annotations","useAnnotationsState","dispatch","useAnnotationsDispatch","rootRef","useRef","footerRef","useOutsideClick","useState","_useState2","_slicedToArray","_useState","isOpen","setIsOpen","_useState4","_useState3","isInfiniteLoading","setIsInfiniteLoading","_useState6","_useState5","moreItemsMayExist","setMoreItemsMayExist","_useState8","_useState7","page","setPage","_handleFetchAnnotations","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","options","lessThanPerPage","wrap","_context","prev","next","abrupt","per_page","sort","order","dashboard_type","getAnnotations","sent","type","SET_ANNOTATIONS","APPEND_ANNOTATIONS","t0","console","error","data","length","stop","apply","this","arguments","useEffect","_jsx","RootRef","children","_jsxs","Paper","className","classNames","styles","cAnnotationsList","cAnnotationsListOpen","cAnnotationsListOpenNative","InfiniteList","infiniteClassName","cAnnotationsListContentContainer","headerComponent","jsxs","_Fragment","Typography","concat","variant","title","jsx","cAnnotationsListContentTop","secondaryTitle","AddAnnotationForm","useWindow","items","showNoItemsFound","noItemsFoundLabel","noAnnotations","threshold","infiniteContainerHeight","current","clientHeight","pathToCreatedAt","renderItem","item","Annotation","annotation","included","showSuccessNotification","id","loadItems","cAnnotationsListActions","ref","Tooltip","placement","IconButton","onClick","backIcon","BackIcon","propTypes","number","isRequired","string","shape","func","bool","isNativeDetected","withStyles","theme","fontWeight","marginBottom","textTransform","color","palette","grey","annotateIcon","padding","backgroundColor","boxShadow","marginTop","cursor","memo"],"mappings":"82FAqBMA,EAAY,mBAsBZC,EAAkB,SAWlBC,GAAA,IAAAC,EAVJC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,QACAC,IAAAA,eAAcC,EAAAN,EACdO,YAAAA,aAAcC,EAAq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cAAeiH,EAAAA,QAGjB,IAAMzH,EAAwC,CAAA,EACxCK,EAAqCwH,EAAAA,iBAE5BC,EAAAA,EAAAA,YA5LG,SAAAC,GAAK,MAAK,CAC1BxC,MAAO,CAAEyC,WAAY,IAAKC,aAAc,IACxCvC,eAAgB,CACdsC,WAAY,IACZE,cAAe,YACfC,MAAOJ,EAAMK,QAAQC,KAAK,MAE5BC,aAAc,CACZC,QAAS,EACT,UAAW,CACTC,gBAAiB,cACjBC,UAAW,SAGfzC,cAAe,CAAE0C,UAAW,IAC5BtB,SAAU,CAAEuB,OAAQ,UAAWR,MAAOJ,EAAMK,QAAQC,KAAK,KAAME,QAAS,GACzE,GA4KcT,CAAsBc,EAAIA,KAACrJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),a=require("prop-types"),s=require("lodash"),i=require("classnames"),o=require("@material-ui/core"),l=require("./effects/index.js");require("../../permissions/PermissionsContext.js");var u=require("../../permissions/constants/index.js"),c=require("../../permissions/withPermissionsHOC.js");require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../clients/jsonApi/index.js"),require("../../permissions/ProvidePermissions.js");var d=require("../TruncatedText/index.js");require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/alerts.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/completion.js");var p=require("../../constants/appPackages.js");require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.js");var v=require("react/jsx-runtime");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=b(e),j=b(r),m=b(t),h=b(i),g=["appId","value"],
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),a=require("prop-types"),s=require("lodash"),i=require("classnames"),o=require("@material-ui/core"),l=require("./effects/index.js");require("../../permissions/PermissionsContext.js");var u=require("../../permissions/constants/index.js"),c=require("../../permissions/withPermissionsHOC.js");require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../clients/jsonApi/index.js"),require("../../utils/shareRecentRequest.js"),require("../../permissions/ProvidePermissions.js");var d=require("../TruncatedText/index.js");require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/alerts.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/completion.js");var p=require("../../constants/appPackages.js");require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.js");var v=require("react/jsx-runtime");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=b(e),j=b(r),m=b(t),h=b(i),g=["appId","value"],q=["canReadAppPackages"];function P(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function y(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?P(Object(t),!0).forEach((function(r){j.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var x=p.PACKAGE_STATUSES,O=p.PACKAGE_LABELS,S=p.TEXT_FOR_PACKAGE_LABELS,A=o.makeStyles((function(e){return{select:{width:250,margin:"8px 0"},menuListRoot:{maxWidth:580},group:{fontStyle:"italic",fontWeight:"bold",fontSize:"12px",color:"#999",backgroundColor:e.palette.background.b9}}})),E=function(e){var r=e.className,t=e.value,a=void 0===t?null:t,i=e.onChange,l=e.isLoading,u=void 0!==l&&l,c=e.disabled,p=void 0!==c&&c,b=e.error,f=void 0===b?null:b,g=e.packages,q=void 0===g?_:g,P=A(),y=n.useState(a),E=m.default(y,2),R=E[0],w=E[1],C=n.useMemo((function(){var e,r={},t=(e={},j.default(e,O.PROD,{label:"Stable Release - no stable version",value:O.PROD,disabled:!0}),j.default(e,O.BETA,{label:"Beta - no beta version",value:O.BETA,disabled:!0}),j.default(e,O.DEV,{label:"Dev - no dev version",value:O.DEV,disabled:!0}),e),n=[];return q.filter((function(e){return e.status!==x.FAILURE})).forEach((function(e){var a=e.version,s=e.package_code_version,i=e.notes,o=e.label,l=e.status,u="v".concat(s||a);if(o){var c=t[o];c.label="".concat(S[o]," ").concat(u," ").concat(i?"- ".concat(i):""),c.disabled=!1,r[c.value]=e}else r[a]=e,n.push({label:"".concat(u," ").concat(i?"- ".concat(i):""),value:a,status:l})})),{labeled:Object.values(t),unlabeled:n,packageByValue:r}}),[q]),D=C.labeled,I=C.unlabeled,L=C.packageByValue,k=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i(e,L[e],r)},T=q.some((function(e){return!e.label})),V=!s.isEmpty(q);return n.useEffect((function(){if(V&&!a){var e=D.find((function(e){return!e.disabled}))||s.maxBy(I.filter((function(e){return e.status===x.PUBLISHED})),"value");w(null==e?void 0:e.value),k(null==e?void 0:e.value)}}),[D,I]),u||f?null:v.jsx(o.Grid,{children:v.jsxs(o.FormControl,{className:h.default(P.select,r),children:[v.jsx(o.InputLabel,{shrink:!(!a&&!R),htmlFor:"appVersion",children:"App Version"}),v.jsxs(o.Select,{"data-testid":"".concat("DC_versionSelect","_dropdown"),value:a||R,onChange:function(e){return k(e.target.value,!0)},disabled:u||p,label:"App Version",inputProps:{name:"appVersion",id:"appVersion"},MenuProps:{MenuListProps:{classes:{root:P.menuListRoot}}},children:[T&&v.jsx(o.ListSubheader,{className:P.group,children:"Labelled Versions (When selected always shows current Stable Release, Beta or Dev version)"}),D.map((function(e){var r=e.label,t=e.value,n=e.disabled;return v.jsx(o.MenuItem,{"data-testid":"".concat("DC_versionSelect","_option_").concat(r,"MenuItem"),value:t,disabled:n,children:v.jsx(d,{children:r})},t)})),T&&v.jsx(o.ListSubheader,{className:P.group,children:"Other versions (App will always show selected version until version is deleted)"}),I.map((function(e){var r=e.label,t=e.value;return v.jsx(o.MenuItem,{"data-testid":"".concat("DC_versionSelect","_option_").concat(r,"MenuItem"),value:t,children:v.jsx(d,{children:r})},t)}))]})]})})},_=[],R=function(e){var r=e.appId,t=void 0===r?null:r,n=e.value,a=void 0===n?null:n,s=f.default(e,g),i=l(t,{status:[x.DRAFT,x.PUBLISHED],order:"desc",sort:"created_at"});return v.jsx(E,y(y({value:a},s),i))};R.propTypes={value:a.string,onChange:a.func.isRequired,appId:a.string};var w=c.withPermissionsHOC({canReadAppPackages:function(e){var r=e.appId;return u.PERMISSIONS.getCanReadAppPackages(r)}},{loader:null})((function(e){var r=e.canReadAppPackages,t=f.default(e,q);return r&&v.jsx(R,y({},t))}));exports.AppVersionsSelectView=E,exports.default=w;
|
|
2
2
|
//# sourceMappingURL=AppVersionsSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppVersionsSelect.js","sources":["../../../../src/components/AppVersionsSelect/AppVersionsSelect.js"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport { useEffect, useMemo, useState } from 'react';\nimport { string, func } from 'prop-types';\nimport { maxBy, isEmpty } from 'lodash';\nimport classNames from 'classnames';\nimport {\n FormControl,\n Grid,\n InputLabel,\n ListSubheader,\n MenuItem,\n Select,\n makeStyles,\n} from '@material-ui/core';\n\nimport usePackages from './effects';\n\nimport { withPermissionsHOC, PERMISSIONS } from '~/permissions';\nimport TruncatedText from '~/components/TruncatedText';\nimport { appPackages } from '~/constants';\n\nconst { PACKAGE_STATUSES, PACKAGE_LABELS, TEXT_FOR_PACKAGE_LABELS } = appPackages;\n\nconst useStyles = makeStyles(theme => ({\n select: { width: 250, margin: '8px 0' },\n menuListRoot: { maxWidth: 580 },\n group: {\n fontStyle: 'italic',\n fontWeight: 'bold',\n fontSize: '12px',\n color: '#999',\n backgroundColor: theme.palette.background.b9,\n },\n}));\n\nconst PAGE_NAME = 'DC_versionSelect';\n\n// View Component\nexport const AppVersionsSelectView = ({\n className,\n value = null,\n onChange,\n isLoading = false,\n disabled = false,\n error = null,\n packages = DEFAULT_APP_VERSIONS_SELECT_VIEW_PACKAGES,\n}) => {\n const styles = useStyles();\n\n const [preselectedVersion, setPreselectedVersion] = useState(value);\n\n const { labeled, unlabeled, packageByValue } = useMemo(() => {\n const packageByValue = {};\n const labeledMenuItemsMap = {\n [PACKAGE_LABELS.PROD]: {\n label: 'Stable Release - no stable version',\n value: PACKAGE_LABELS.PROD,\n disabled: true,\n },\n [PACKAGE_LABELS.BETA]: {\n label: 'Beta - no beta version',\n value: PACKAGE_LABELS.BETA,\n disabled: true,\n },\n [PACKAGE_LABELS.DEV]: {\n label: 'Dev - no dev version',\n value: PACKAGE_LABELS.DEV,\n disabled: true,\n },\n };\n\n const unlabeled = [];\n\n packages\n // TODO: replace with query param filtering\n .filter(appPackage => appPackage.status !== PACKAGE_STATUSES.FAILURE)\n .forEach(appPackage => {\n const {\n version: apiVersion,\n package_code_version: packageCodeVersion,\n notes,\n label,\n status,\n } = appPackage;\n // NOTE: API version is deprecated, using version from package.json by default\n const version = `v${packageCodeVersion || apiVersion}`;\n\n if (label) {\n const item = labeledMenuItemsMap[label];\n item.label = `${TEXT_FOR_PACKAGE_LABELS[label]} ${version} ${notes ? `- ${notes}` : ''}`;\n item.disabled = false;\n packageByValue[item.value] = appPackage;\n } else {\n packageByValue[apiVersion] = appPackage;\n unlabeled.push({\n label: `${version} ${notes ? `- ${notes}` : ''}`,\n value: apiVersion,\n status,\n });\n }\n });\n\n return {\n // Note: order is always the same here, non-integer keys are returned in insertion order.\n labeled: Object.values(labeledMenuItemsMap),\n unlabeled,\n packageByValue,\n };\n }, [packages]);\n\n // [REACT-18-MIGRATION-TAG] PLT-3099: isUserChange distinguishes a genuine selection from the\n // auto-preselect effect below, so only the former opts the app out of the React-18 auto-switch.\n const handleChange = (value, isUserChange = false) =>\n onChange(value, packageByValue[value], isUserChange);\n\n const hasUnlabeledVersion = packages.some(appPackage => !appPackage.label);\n const hasPackages = !isEmpty(packages);\n\n useEffect(() => {\n if (hasPackages && !value) {\n const labeledVersion = labeled.find(item => !item.disabled);\n\n const version =\n labeledVersion ||\n maxBy(\n unlabeled.filter(item => item.status === PACKAGE_STATUSES.PUBLISHED),\n 'value'\n );\n\n setPreselectedVersion(version?.value);\n handleChange(version?.value);\n }\n }, [labeled, unlabeled]);\n\n if (isLoading || error) return null;\n\n return (\n <Grid>\n <FormControl className={classNames(styles.select, className)}>\n <InputLabel shrink={!!(value || preselectedVersion)} htmlFor=\"appVersion\">\n App Version\n </InputLabel>\n <Select\n data-testid={`${PAGE_NAME}_dropdown`}\n value={value || preselectedVersion}\n onChange={e => handleChange(e.target.value, true)}\n disabled={isLoading || disabled}\n label=\"App Version\"\n inputProps={{\n name: 'appVersion',\n id: 'appVersion',\n }}\n MenuProps={{\n MenuListProps: {\n classes: {\n root: styles.menuListRoot,\n },\n },\n }}\n >\n {hasUnlabeledVersion && (\n <ListSubheader className={styles.group}>\n Labelled Versions (When selected always shows current Stable Release, Beta or Dev\n version)\n </ListSubheader>\n )}\n {labeled.map(({ label, value, disabled }) => (\n <MenuItem\n key={value}\n data-testid={`${PAGE_NAME}_option_${label}MenuItem`}\n value={value}\n disabled={disabled}\n >\n <TruncatedText>{label}</TruncatedText>\n </MenuItem>\n ))}\n {hasUnlabeledVersion && (\n <ListSubheader className={styles.group}>\n Other versions (App will always show selected version until version is deleted)\n </ListSubheader>\n )}\n {unlabeled.map(({ label, value }) => (\n <MenuItem\n data-testid={`${PAGE_NAME}_option_${label}MenuItem`}\n value={value}\n key={value}\n >\n <TruncatedText>{label}</TruncatedText>\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </Grid>\n );\n};\n\nconst DEFAULT_APP_VERSIONS_SELECT_VIEW_PACKAGES = [];\n\n// Wrapper that fetches packages on its own\nconst AppVersionsSelect = ({ appId = null, value = null, ...otherProps }) => {\n const packagesState = usePackages(appId, {\n status: [PACKAGE_STATUSES.DRAFT, PACKAGE_STATUSES.PUBLISHED],\n order: 'desc',\n sort: 'created_at',\n });\n return <AppVersionsSelectView value={value} {...otherProps} {...packagesState} />;\n};\n\nAppVersionsSelect.propTypes = {\n value: string,\n onChange: func.isRequired,\n appId: string,\n};\n\n// Export default with permissions check\nexport default withPermissionsHOC(\n { canReadAppPackages: ({ appId }) => PERMISSIONS.getCanReadAppPackages(appId) },\n { loader: null }\n)(({ canReadAppPackages, ...props }) => canReadAppPackages && <AppVersionsSelect {...props} />);\n"],"names":["PACKAGE_STATUSES","appPackages","PACKAGE_LABELS","TEXT_FOR_PACKAGE_LABELS","useStyles","makeStyles","theme","select","width","margin","menuListRoot","maxWidth","group","fontStyle","fontWeight","fontSize","color","backgroundColor","palette","background","b9","AppVersionsSelectView","_ref","className","_ref$value","value","onChange","_ref$isLoading","isLoading","_ref$disabled","disabled","_ref$error","error","_ref$packages","packages","DEFAULT_APP_VERSIONS_SELECT_VIEW_PACKAGES","styles","useState","_useState2","_slicedToArray","_useState","preselectedVersion","setPreselectedVersion","useMemo","_labeledMenuItemsMap","packageByValue","labeledMenuItemsMap","_defineProperty","PROD","label","BETA","DEV","unlabeled","filter","appPackage","status","FAILURE","forEach","apiVersion","version","packageCodeVersion","package_code_version","notes","concat","item","push","labeled","Object","values","handleChange","isUserChange","hasUnlabeledVersion","some","hasPackages","isEmpty","useEffect","find","maxBy","PUBLISHED","_jsx","Grid","children","_jsxs","FormControl","classNames","InputLabel","shrink","htmlFor","Select","e","target","inputProps","name","id","MenuProps","MenuListProps","classes","root","jsx","ListSubheader","map","_ref2","MenuItem","PAGE_NAME","TruncatedText","_ref3","AppVersionsSelect","_ref4","_ref4$appId","appId","_ref4$value","otherProps","_objectWithoutProperties","_excluded","packagesState","usePackages","DRAFT","order","sort","_objectSpread","propTypes","string","func","isRequired","AppVersionsSelect$1","withPermissionsHOC","canReadAppPackages","_ref5","PERMISSIONS","getCanReadAppPackages","loader","_ref6","props","_excluded2"],"mappings":"y+DAqBA,IAAQA,EAA8DC,EAA9CD,iBAAEE,EAA4CD,EAA9BC,eAAEC,EAA4BF,EAAAA,wBAEhEG,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,OAAQ,CAAEC,MAAO,IAAKC,OAAQ,SAC9BC,aAAc,CAAEC,SAAU,KAC1BC,MAAO,CACLC,UAAW,SACXC,WAAY,OACZC,SAAU,OACVC,MAAO,OACPC,gBAAiBX,EAAMY,QAAQC,WAAWC,IAE7C,IAKYC,EAAwB,SAQ/BC,GAAA,IAPJC,IAAAA,UAASC,EAAAF,EACTG,MAAAA,aAAQ,KAAID,EACZE,IAAAA,SAAQC,EAAAL,EACRM,UAAAA,cAAiBD,EAAAE,EAAAP,EACjBQ,SAAAA,cAAgBD,EAAAE,EAAAT,EAChBU,MAAAA,aAAQ,KAAID,EAAAE,EAAAX,EACZY,SAAAA,aAAWC,EAAyCF,EAE9CG,EAAShC,IAEqCiC,EAAAA,EAAQA,SAACZ,GAAMa,EAAAC,EAAAA,QAAAC,EAAA,GAA5DC,EAAkBH,EAAA,GAAEI,EAAqBJ,EAAA,GAEDK,EAAAA,EAAAA,SAAQ,WAAM,IAAAC,EACrDC,EAAiB,CAAA,EACjBC,GAAmBF,EAAA,CAAA,EAAAG,EAAA,QAAAH,EACtB1C,EAAe8C,KAAO,CACrBC,MAAO,qCACPxB,MAAOvB,EAAe8C,KACtBlB,UAAU,IAEX5B,EAAAA,QAAAA,EAAAA,EAAegD,KAAO,CACrBD,MAAO,yBACPxB,MAAOvB,EAAegD,KACtBpB,UAAU,IAEX5B,EAAAA,QAAAA,EAA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,EAAa,CAAAvB,SAAEhC,KAFXxB,EAGI,WAMvB,EAEMU,EAA4C,GAG5CuE,EAAoB,SAAmDC,GAAA,IAAAC,EAAAD,EAAhDE,MAAAA,aAAQ,KAAID,EAAAE,EAAAH,EAAElF,MAAAA,aAAQ,KAAIqF,EAAKC,EAAUC,EAAA,QAAAL,EAAAM,GAC9DC,EAAgBC,EAAYN,EAAO,CACvCtD,OAAQ,CAACvD,EAAiBoH,MAAOpH,EAAiB8E,WAClDuC,MAAO,OACPC,KAAM,eAER,OAAOvC,MAAC1D,EAAqBkG,EAAAA,EAAA,CAAC9F,MAAOA,GAAWsF,GAAgBG,GAClE,EAEAR,EAAkBc,UAAY,CAC5B/F,MAAOgG,EAAMA,OACb/F,SAAUgG,EAAIA,KAACC,WACfd,MAAOY,EAAAA,QAIT,IAAAG,EAAeC,qBACb,CAAEC,mBAAoB,SAAAC,GAAA,IAAGlB,IAAAA,MAAK,OAAOmB,EAAWA,YAACC,sBAAsBpB,EAAM,GAC7E,CAAEqB,OAAQ,MAFGL,EAGb,SAAAM,GAAA,IAAGL,IAAAA,mBAAuBM,EAAKpB,EAAA,QAAAmB,EAAAE,GAAA,OAAOP,GAAsB/C,EAAAA,IAAC2B,EAAiBa,EAAA,CAAA,EAAKa,GAAS"}
|
|
1
|
+
{"version":3,"file":"AppVersionsSelect.js","sources":["../../../../src/components/AppVersionsSelect/AppVersionsSelect.js"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport { useEffect, useMemo, useState } from 'react';\nimport { string, func } from 'prop-types';\nimport { maxBy, isEmpty } from 'lodash';\nimport classNames from 'classnames';\nimport {\n FormControl,\n Grid,\n InputLabel,\n ListSubheader,\n MenuItem,\n Select,\n makeStyles,\n} from '@material-ui/core';\n\nimport usePackages from './effects';\n\nimport { withPermissionsHOC, PERMISSIONS } from '~/permissions';\nimport TruncatedText from '~/components/TruncatedText';\nimport { appPackages } from '~/constants';\n\nconst { PACKAGE_STATUSES, PACKAGE_LABELS, TEXT_FOR_PACKAGE_LABELS } = appPackages;\n\nconst useStyles = makeStyles(theme => ({\n select: { width: 250, margin: '8px 0' },\n menuListRoot: { maxWidth: 580 },\n group: {\n fontStyle: 'italic',\n fontWeight: 'bold',\n fontSize: '12px',\n color: '#999',\n backgroundColor: theme.palette.background.b9,\n },\n}));\n\nconst PAGE_NAME = 'DC_versionSelect';\n\n// View Component\nexport const AppVersionsSelectView = ({\n className,\n value = null,\n onChange,\n isLoading = false,\n disabled = false,\n error = null,\n packages = DEFAULT_APP_VERSIONS_SELECT_VIEW_PACKAGES,\n}) => {\n const styles = useStyles();\n\n const [preselectedVersion, setPreselectedVersion] = useState(value);\n\n const { labeled, unlabeled, packageByValue } = useMemo(() => {\n const packageByValue = {};\n const labeledMenuItemsMap = {\n [PACKAGE_LABELS.PROD]: {\n label: 'Stable Release - no stable version',\n value: PACKAGE_LABELS.PROD,\n disabled: true,\n },\n [PACKAGE_LABELS.BETA]: {\n label: 'Beta - no beta version',\n value: PACKAGE_LABELS.BETA,\n disabled: true,\n },\n [PACKAGE_LABELS.DEV]: {\n label: 'Dev - no dev version',\n value: PACKAGE_LABELS.DEV,\n disabled: true,\n },\n };\n\n const unlabeled = [];\n\n packages\n // TODO: replace with query param filtering\n .filter(appPackage => appPackage.status !== PACKAGE_STATUSES.FAILURE)\n .forEach(appPackage => {\n const {\n version: apiVersion,\n package_code_version: packageCodeVersion,\n notes,\n label,\n status,\n } = appPackage;\n // NOTE: API version is deprecated, using version from package.json by default\n const version = `v${packageCodeVersion || apiVersion}`;\n\n if (label) {\n const item = labeledMenuItemsMap[label];\n item.label = `${TEXT_FOR_PACKAGE_LABELS[label]} ${version} ${notes ? `- ${notes}` : ''}`;\n item.disabled = false;\n packageByValue[item.value] = appPackage;\n } else {\n packageByValue[apiVersion] = appPackage;\n unlabeled.push({\n label: `${version} ${notes ? `- ${notes}` : ''}`,\n value: apiVersion,\n status,\n });\n }\n });\n\n return {\n // Note: order is always the same here, non-integer keys are returned in insertion order.\n labeled: Object.values(labeledMenuItemsMap),\n unlabeled,\n packageByValue,\n };\n }, [packages]);\n\n // [REACT-18-MIGRATION-TAG] PLT-3099: isUserChange distinguishes a genuine selection from the\n // auto-preselect effect below, so only the former opts the app out of the React-18 auto-switch.\n const handleChange = (value, isUserChange = false) =>\n onChange(value, packageByValue[value], isUserChange);\n\n const hasUnlabeledVersion = packages.some(appPackage => !appPackage.label);\n const hasPackages = !isEmpty(packages);\n\n useEffect(() => {\n if (hasPackages && !value) {\n const labeledVersion = labeled.find(item => !item.disabled);\n\n const version =\n labeledVersion ||\n maxBy(\n unlabeled.filter(item => item.status === PACKAGE_STATUSES.PUBLISHED),\n 'value'\n );\n\n setPreselectedVersion(version?.value);\n handleChange(version?.value);\n }\n }, [labeled, unlabeled]);\n\n if (isLoading || error) return null;\n\n return (\n <Grid>\n <FormControl className={classNames(styles.select, className)}>\n <InputLabel shrink={!!(value || preselectedVersion)} htmlFor=\"appVersion\">\n App Version\n </InputLabel>\n <Select\n data-testid={`${PAGE_NAME}_dropdown`}\n value={value || preselectedVersion}\n onChange={e => handleChange(e.target.value, true)}\n disabled={isLoading || disabled}\n label=\"App Version\"\n inputProps={{\n name: 'appVersion',\n id: 'appVersion',\n }}\n MenuProps={{\n MenuListProps: {\n classes: {\n root: styles.menuListRoot,\n },\n },\n }}\n >\n {hasUnlabeledVersion && (\n <ListSubheader className={styles.group}>\n Labelled Versions (When selected always shows current Stable Release, Beta or Dev\n version)\n </ListSubheader>\n )}\n {labeled.map(({ label, value, disabled }) => (\n <MenuItem\n key={value}\n data-testid={`${PAGE_NAME}_option_${label}MenuItem`}\n value={value}\n disabled={disabled}\n >\n <TruncatedText>{label}</TruncatedText>\n </MenuItem>\n ))}\n {hasUnlabeledVersion && (\n <ListSubheader className={styles.group}>\n Other versions (App will always show selected version until version is deleted)\n </ListSubheader>\n )}\n {unlabeled.map(({ label, value }) => (\n <MenuItem\n data-testid={`${PAGE_NAME}_option_${label}MenuItem`}\n value={value}\n key={value}\n >\n <TruncatedText>{label}</TruncatedText>\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </Grid>\n );\n};\n\nconst DEFAULT_APP_VERSIONS_SELECT_VIEW_PACKAGES = [];\n\n// Wrapper that fetches packages on its own\nconst AppVersionsSelect = ({ appId = null, value = null, ...otherProps }) => {\n const packagesState = usePackages(appId, {\n status: [PACKAGE_STATUSES.DRAFT, PACKAGE_STATUSES.PUBLISHED],\n order: 'desc',\n sort: 'created_at',\n });\n return <AppVersionsSelectView value={value} {...otherProps} {...packagesState} />;\n};\n\nAppVersionsSelect.propTypes = {\n value: string,\n onChange: func.isRequired,\n appId: string,\n};\n\n// Export default with permissions check\nexport default withPermissionsHOC(\n { canReadAppPackages: ({ appId }) => PERMISSIONS.getCanReadAppPackages(appId) },\n { loader: null }\n)(({ canReadAppPackages, ...props }) => canReadAppPackages && <AppVersionsSelect {...props} />);\n"],"names":["PACKAGE_STATUSES","appPackages","PACKAGE_LABELS","TEXT_FOR_PACKAGE_LABELS","useStyles","makeStyles","theme","select","width","margin","menuListRoot","maxWidth","group","fontStyle","fontWeight","fontSize","color","backgroundColor","palette","background","b9","AppVersionsSelectView","_ref","className","_ref$value","value","onChange","_ref$isLoading","isLoading","_ref$disabled","disabled","_ref$error","error","_ref$packages","packages","DEFAULT_APP_VERSIONS_SELECT_VIEW_PACKAGES","styles","useState","_useState2","_slicedToArray","_useState","preselectedVersion","setPreselectedVersion","useMemo","_labeledMenuItemsMap","packageByValue","labeledMenuItemsMap","_defineProperty","PROD","label","BETA","DEV","unlabeled","filter","appPackage","status","FAILURE","forEach","apiVersion","version","packageCodeVersion","package_code_version","notes","concat","item","push","labeled","Object","values","handleChange","isUserChange","hasUnlabeledVersion","some","hasPackages","isEmpty","useEffect","find","maxBy","PUBLISHED","_jsx","Grid","children","_jsxs","FormControl","classNames","InputLabel","shrink","htmlFor","Select","e","target","inputProps","name","id","MenuProps","MenuListProps","classes","root","jsx","ListSubheader","map","_ref2","MenuItem","PAGE_NAME","TruncatedText","_ref3","AppVersionsSelect","_ref4","_ref4$appId","appId","_ref4$value","otherProps","_objectWithoutProperties","_excluded","packagesState","usePackages","DRAFT","order","sort","_objectSpread","propTypes","string","func","isRequired","AppVersionsSelect$1","withPermissionsHOC","canReadAppPackages","_ref5","PERMISSIONS","getCanReadAppPackages","loader","_ref6","props","_excluded2"],"mappings":"shEAqBA,IAAQA,EAA8DC,EAA9CD,iBAAEE,EAA4CD,EAA9BC,eAAEC,EAA4BF,EAAAA,wBAEhEG,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,OAAQ,CAAEC,MAAO,IAAKC,OAAQ,SAC9BC,aAAc,CAAEC,SAAU,KAC1BC,MAAO,CACLC,UAAW,SACXC,WAAY,OACZC,SAAU,OACVC,MAAO,OACPC,gBAAiBX,EAAMY,QAAQC,WAAWC,IAE7C,IAKYC,EAAwB,SAQ/BC,GAAA,IAPJC,IAAAA,UAASC,EAAAF,EACTG,MAAAA,aAAQ,KAAID,EACZE,IAAAA,SAAQC,EAAAL,EACRM,UAAAA,cAAiBD,EAAAE,EAAAP,EACjBQ,SAAAA,cAAgBD,EAAAE,EAAAT,EAChBU,MAAAA,aAAQ,KAAID,EAAAE,EAAAX,EACZY,SAAAA,aAAWC,EAAyCF,EAE9CG,EAAShC,IAEqCiC,EAAAA,EAAQA,SAACZ,GAAMa,EAAAC,EAAAA,QAAAC,EAAA,GAA5DC,EAAkBH,EAAA,GAAEI,EAAqBJ,EAAA,GAEDK,EAAAA,EAAAA,SAAQ,WAAM,IAAAC,EACrDC,EAAiB,CAAA,EACjBC,GAAmBF,EAAA,CAAA,EAAAG,EAAA,QAAAH,EACtB1C,EAAe8C,KAAO,CACrBC,MAAO,qCACPxB,MAAOvB,EAAe8C,KACtBlB,UAAU,IAEX5B,EAAAA,QAAAA,EAAAA,EAAegD,KAAO,CACrBD,MAAO,yBACPxB,MAAOvB,EAAegD,KACtBpB,UAAU,IAEX5B,EAAAA,QAAAA,EAAAA,EA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,CAAAvB,SAAEhC,KAFXxB,EAGI,WAMvB,EAEMU,EAA4C,GAG5CuE,EAAoB,SAAmDC,GAAA,IAAAC,EAAAD,EAAhDE,MAAAA,aAAQ,KAAID,EAAAE,EAAAH,EAAElF,MAAAA,aAAQ,KAAIqF,EAAKC,EAAUC,EAAA,QAAAL,EAAAM,GAC9DC,EAAgBC,EAAYN,EAAO,CACvCtD,OAAQ,CAACvD,EAAiBoH,MAAOpH,EAAiB8E,WAClDuC,MAAO,OACPC,KAAM,eAER,OAAOvC,MAAC1D,EAAqBkG,EAAAA,EAAA,CAAC9F,MAAOA,GAAWsF,GAAgBG,GAClE,EAEAR,EAAkBc,UAAY,CAC5B/F,MAAOgG,EAAMA,OACb/F,SAAUgG,EAAIA,KAACC,WACfd,MAAOY,EAAAA,QAIT,IAAAG,EAAeC,qBACb,CAAEC,mBAAoB,SAAAC,GAAA,IAAGlB,IAAAA,MAAK,OAAOmB,EAAWA,YAACC,sBAAsBpB,EAAM,GAC7E,CAAEqB,OAAQ,MAFGL,EAGb,SAAAM,GAAA,IAAGL,IAAAA,mBAAuBM,EAAKpB,EAAA,QAAAmB,EAAAE,GAAA,OAAOP,GAAsB/C,EAAAA,IAAC2B,EAAiBa,EAAA,CAAA,EAAKa,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),s=require("classnames"),a=require("@material-ui/core"),n=require("lodash"),o=require("../Search/Search.js"),u=require("../../clients/jsonApi/index.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("../../constants/completion.js"),require("moment"),require("../../constants/alerts.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"),require("query-string"),require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.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"),require("../../utils/mobileDetect.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions");var l=require("../../utils/jsonaDataFormatter.js");require("../../utils/bha.js"),require("jsona"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js");var c=require("../../effects/useLoadedData.js"),d=require("react/jsx-runtime");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),s=require("classnames"),a=require("@material-ui/core"),n=require("lodash"),o=require("../Search/Search.js"),u=require("../../clients/jsonApi/index.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("../../constants/completion.js"),require("moment"),require("../../constants/alerts.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"),require("query-string"),require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.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"),require("../../utils/mobileDetect.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions");var l=require("../../utils/jsonaDataFormatter.js");require("../../utils/bha.js"),require("jsona"),require("../../utils/shareRecentRequest.js"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js");var c=require("../../effects/useLoadedData.js"),d=require("react/jsx-runtime");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var q=p(e),f=p(r),m=p(t),j=p(s),b=["listbox","paper"];function g(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?g(Object(t),!0).forEach((function(r){f.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var v=a.makeStyles((function(e){return{listbox:{maxHeight:360},paper:{width:364},footer:{fontSize:12,color:e.palette.primary.text6,lineHeight:"16.872px",padding:"8px 16px"}}})),y=function(e){var r;return{data:l.jsonaDataFormatter.deserialize(e.data),total:Number(null===(r=e.headers)||void 0===r?void 0:r.get("total"))||0}},O=[],x={},P={data:[],total:0},S=i.memo((function(e){var r=e.selectedAssets,t=void 0===r?O:r,s=e.onChange,a=e.label,l=e.className,p=e.type,f=e.customRequestQueryParams,g=e.classes,S=void 0===g?{}:g,D=v(),C=c({loadFn:u.mapAssetGetRequest(p,!0),initialData:P,getDataFromResponseFn:y,isCacheEnabled:!0}),w=C.isLoading,A=C.setIsLoading,F=C.data,R=C.loadData,k=null!=F?F:P,E=k.data,I=k.total,M=i.useState(""),N=m.default(M,2),z=N[0],T=N[1];i.useEffect((function(){L("",f)}),[]);var G=i.useMemo((function(){return t.map((function(e){return h(h({},e),{},{id:e.id,label:e.name})}))}),[t]),H=i.useMemo((function(){var e={};return(G.length?E.concat(G):E).forEach((function(r){e[r.id]=h(h({},r),{},{id:r.id,label:r.name})})),Object.values(n.sortBy(e,"label"))}),[E,t,z]),L=i.useCallback((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=h(h(h({},x),{},{per_page:50},r),{},{fields:["".concat(p,".name")].concat((null==r?void 0:r.fields)||[])});R(h({search:e},t))}),[]),B=function(){T(""),L("",f)},Q=i.useMemo((function(){var e,r=0===(e=I-(null==E?void 0:E.length))?null:e;return r&&!w&&z?d.jsxs("div",{className:D.footer,children:[r," additional items not displayed. Continue typing for more refined results."]}):null}),[E,w,!!z,I]),U=S.listbox,W=S.paper,_=q.default(S,b);return d.jsx(o.Search,{"data-testid":"offsetPadDropdown",value:G,onChange:function(e,r,t){if("reset"!==t){var i=r.map((function(e){return h(h({},e),{},{name:e.label})}));s(i)}},TextFieldProps:{label:a},className:l,classes:h({listbox:j.default(D.listbox,U),paper:j.default(D.paper,W)},_),loading:w,options:H,placeholder:"",multiple:!0,filterSelectedOptions:!1,AutocompleteProps:{forcePopupIcon:!0},isHiddenAllOption:!0,onInputChangeCallback:function(e,r){"reset"!==r&&""!==e?e.trimStart()!==z&&(T(e.trimStart()),A(!0),L(e.trimStart(),f)):B()},onInputReset:B,paperFooter:Q,getOptionSelected:function(e,r){return+e.id==+r.id},isPrioritizedSelectedOptions:!0})}));module.exports=S;
|
|
2
2
|
//# sourceMappingURL=AssetsMultipleSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsMultipleSelector.js","sources":["../../../../src/components/AssetsMultipleSelector/AssetsMultipleSelector.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport classnames from 'classnames';\nimport { makeStyles } from '@material-ui/core';\nimport { sortBy } from 'lodash';\n\nimport { Search } from '../Search';\n\nimport { mapAssetGetRequest } from '~/clients/jsonApi';\nimport { jsonaDataFormatter } from '~/utils';\nimport useLoadedData from '~/effects/useLoadedData';\n\nconst useStyles = makeStyles(theme => ({\n listbox: {\n maxHeight: 360,\n },\n paper: {\n width: 364,\n },\n footer: {\n fontSize: 12,\n color: theme.palette.primary.text6,\n lineHeight: '16.872px',\n padding: '8px 16px',\n },\n}));\n\nconst getDataFromResponseFn = (response: {\n data: unknown;\n headers?: { get(name: string): string | null };\n}) => {\n return {\n data: jsonaDataFormatter.deserialize(response.data as string) as Asset[],\n total: Number(response.headers?.get('total')) || 0,\n };\n};\nconst initialSelectedAssets: Asset[] = [];\nconst defaultQueryParams = {};\nconst DEFAULT_ASSETS_PER_PAGE = 50;\nconst initialData: { data: Asset[]; total: number } = { data: [], total: 0 };\n\ntype Asset = { id: string; name: string } & Record<string, unknown>;\nexport type AssetsMultipleSelectorProps = {\n /**\n array of asset objects with required id and name fields.\n */\n selectedAssets: [] | Asset[];\n /**\n callback fires on asset selection with array of all selected assets.\n */\n onChange: (assets: Asset[] | []) => void;\n /**\n label for autocomplete input.\n */\n label: string;\n /**\n type of asset.\n */\n type: 'program' | 'rig' | 'well' | 'frac_fleet' | 'drillout_unit' | 'pad' | 'assets';\n /**\n css for root component.\n */\n className?: string;\n /**\n custom query params for assets request like fields, per_page.\n */\n customRequestQueryParams?: Record<string, unknown> & {\n fields?: string[];\n per_page?: number | string;\n };\n /**\n material ui autocomplete classes.\n */\n classes?: any;\n};\n\nconst AssetsMultipleSelector = memo(\n ({\n selectedAssets = initialSelectedAssets,\n onChange,\n label,\n className,\n type,\n customRequestQueryParams,\n classes = {},\n }: AssetsMultipleSelectorProps) => {\n const styles = useStyles();\n\n const { isLoading, setIsLoading, data, loadData } = useLoadedData({\n loadFn: mapAssetGetRequest(type, true),\n initialData: initialData as any,\n getDataFromResponseFn,\n isCacheEnabled: true,\n });\n const { data: assetsData, total } = data ?? initialData;\n const [searchValue, setSearchValue] = useState('');\n\n useEffect(() => {\n loadAssets('', customRequestQueryParams);\n }, []);\n\n const selectedOptions: AssetsMultipleSelectorProps['selectedAssets'] & {} = useMemo(\n () =>\n selectedAssets.map(asset => ({\n ...asset,\n id: asset.id,\n label: asset.name,\n })),\n [selectedAssets]\n );\n\n const options: (Asset & { label: string })[] = useMemo(() => {\n const optionsMap: Record<string, Asset & { label: string }> = {};\n const allOptions = selectedOptions.length ? assetsData.concat(selectedOptions) : assetsData;\n allOptions.forEach((asset: Asset) => {\n optionsMap[asset.id] = {\n ...asset,\n id: asset.id,\n label: asset.name,\n };\n });\n\n return Object.values(sortBy(optionsMap, 'label'));\n }, [assetsData, selectedAssets, searchValue]);\n\n const loadAssets = useCallback(\n (\n search: string,\n customRequestQueryParams: AssetsMultipleSelectorProps['customRequestQueryParams'] = {}\n ) => {\n const params = {\n ...defaultQueryParams,\n per_page: DEFAULT_ASSETS_PER_PAGE,\n ...customRequestQueryParams,\n fields: [`${type}.name`].concat(customRequestQueryParams?.fields || []),\n };\n\n loadData({\n search,\n ...params,\n });\n },\n []\n );\n\n const handleChange = (_event: unknown, visibleSelectedOptions: Asset[], reason?: string) => {\n if (reason === 'reset') return;\n\n const newAssets = visibleSelectedOptions.map(option => {\n return {\n ...option,\n name: option.label as string,\n };\n });\n\n onChange(newAssets);\n };\n\n const onInputReset = () => {\n setSearchValue('');\n loadAssets('', customRequestQueryParams);\n };\n\n const handleInputChange = (value: string, reason: string) => {\n if (reason === 'reset' || value === '') {\n onInputReset();\n return;\n }\n\n if (value.trimStart() !== searchValue) {\n setSearchValue(value.trimStart());\n setIsLoading(true);\n loadAssets(value.trimStart(), customRequestQueryParams);\n }\n };\n\n const countNotShowedAssets = () => {\n const optionsCount = total - assetsData?.length;\n if (optionsCount === 0) return null;\n\n return optionsCount;\n };\n\n const paperFooter = useMemo(() => {\n const notShowedAssetsQuantity = countNotShowedAssets();\n return notShowedAssetsQuantity && !isLoading && searchValue ? (\n <div className={styles.footer}>\n {notShowedAssetsQuantity} additional items not displayed. Continue typing for more refined\n results.\n </div>\n ) : null;\n }, [assetsData, isLoading, !!searchValue, total]);\n\n const { listbox, paper, ...restClasses } = classes;\n\n return (\n <Search\n data-testid=\"offsetPadDropdown\"\n value={selectedOptions}\n onChange={handleChange}\n TextFieldProps={{ label }}\n className={className}\n classes={{\n listbox: classnames(styles.listbox, listbox),\n paper: classnames(styles.paper, paper),\n ...restClasses,\n }}\n loading={isLoading}\n options={options}\n placeholder=\"\"\n multiple\n filterSelectedOptions={false}\n AutocompleteProps={{ forcePopupIcon: true }}\n isHiddenAllOption\n onInputChangeCallback={handleInputChange}\n onInputReset={onInputReset}\n paperFooter={paperFooter}\n getOptionSelected={(option, value) => +option.id === +value.id}\n isPrioritizedSelectedOptions\n />\n );\n }\n);\n\nexport default AssetsMultipleSelector;\n"],"names":["useStyles","makeStyles","theme","listbox","maxHeight","paper","width","footer","fontSize","color","palette","primary","text6","lineHeight","padding","getDataFromResponseFn","response","_response$headers","data","jsonaDataFormatter","deserialize","total","Number","headers","get","initialSelectedAssets","defaultQueryParams","initialData","AssetsMultipleSelector","memo","_ref","_ref$selectedAssets","selectedAssets","onChange","label","className","type","customRequestQueryParams","_ref$classes","classes","styles","_useLoadedData","useLoadedData","loadFn","mapAssetGetRequest","isCacheEnabled","isLoading","setIsLoading","loadData","_ref2","assetsData","useState","_useState2","_slicedToArray","_useState","searchValue","setSearchValue","useEffect","loadAssets","selectedOptions","useMemo","map","asset","_objectSpread","id","name","options","optionsMap","length","concat","forEach","Object","values","sortBy","useCallback","search","arguments","undefined","params","per_page","fields","onInputReset","paperFooter","optionsCount","notShowedAssetsQuantity","_jsxs","children","restClasses","_excluded","_jsx","Search","value","_event","visibleSelectedOptions","reason","newAssets","option","TextFieldProps","classnames","loading","placeholder","multiple","filterSelectedOptions","AutocompleteProps","forcePopupIcon","isHiddenAllOption","onInputChangeCallback","trimStart","getOptionSelected","isPrioritizedSelectedOptions"],"mappings":"40FAWA,IAAMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,UAAW,KAEbC,MAAO,CACLC,MAAO,KAETC,OAAQ,CACNC,SAAU,GACVC,MAAOP,EAAMQ,QAAQC,QAAQC,MAC7BC,WAAY,WACZC,QAAS,YAEZ,IAEKC,EAAwB,SAACC,GAGzB,IAAAC,EACJ,MAAO,CACLC,KAAMC,EAAkBA,mBAACC,YAAYJ,EAASE,MAC9CG,MAAOC,OAAO,QAAAN,EAAAA,EAASO,eAAT,IAAAN,OAAA,EAAAA,EAAkBO,IAAI,WAAa,EAErD,EACMC,EAAiC,GACjCC,EAAqB,CAAA,EAErBC,EAAgD,CAAET,KAAM,GAAIG,MAAO,GAqCnEO,EAAyBC,EAAAA,MAC7B,SAQmCC,GAAA,IAAAC,EAAAD,EAPjCE,eAAAA,aAAiBP,EAAqBM,EACtCE,IAAAA,SACAC,IAAAA,MACAC,IAAAA,UACAC,IAAAA,KACAC,IAAAA,yBAAwBC,EAAAR,EACxBS,QAAAA,OAAO,IAAAD,EAAG,CAAA,EAAEA,EAENE,EAASxC,IAEfyC,EAAoDC,EAAc,CAChEC,OAAQC,EAAAA,mBAAmBR,GAAM,GACjCT,YAAaA,EACbZ,sBAAAA,EACA8B,gBAAgB,IAJVC,IAAAA,UAAWC,IAAAA,aAAc7B,IAAAA,KAAM8B,IAAAA,SAMvCC,EAAoC/B,QAAAA,EAAQS,EAA9BuB,IAANhC,KAAkBG,IAAAA,MACY8B,EAAAA,EAAQA,SAAC,IAAGC,EAAAC,EA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,EAAYJ,IAAaS,EAAalC,IAElClB,EAAmCoC,EAAnCpC,QAASE,EAA0BkC,EAA1BlC,MAAUkF,YAAgBhD,EAAOiD,GAElD,OACEC,EAAAA,IAACC,EAAAA,OAAM,CACL,cAAY,oBACZC,MAAOhC,EACP1B,SAtDiB,SAAC2D,EAAiBC,EAAiCC,GACtE,GAAe,UAAXA,EAAJ,CAEA,IAAMC,EAAYF,EAAuBhC,KAAI,SAAAmC,GAC3C,OAAAjC,EAAAA,EAAA,CAAA,EACKiC,GAAM,CAAA,EAAA,CACT/B,KAAM+B,EAAO9D,OAEjB,IAEAD,EAAS8D,EATe,GAsDtBE,eAAgB,CAAE/D,MAAAA,GAClBC,UAAWA,EACXI,QAAOwB,EAAA,CACL5D,QAAS+F,EAAU,QAAC1D,EAAOrC,QAASA,GACpCE,MAAO6F,EAAU,QAAC1D,EAAOnC,MAAOA,IAC7BkF,GAELY,QAASrD,EACToB,QAASA,EACTkC,YAAY,GACZC,UAAQ,EACRC,uBAAuB,EACvBC,kBAAmB,CAAEC,gBAAgB,GACrCC,mBAAiB,EACjBC,sBAnDsB,SAACf,EAAeG,GACzB,UAAXA,GAAgC,KAAVH,EAKtBA,EAAMgB,cAAgBpD,IACxBC,EAAemC,EAAMgB,aACrB5D,GAAa,GACbW,EAAWiC,EAAMgB,YAAatE,IAP9B4C,KAkDAA,aAAcA,EACdC,YAAaA,EACb0B,kBAAmB,SAACZ,EAAQL,GAAK,OAAMK,EAAOhC,KAAQ2B,EAAM3B,EAAG,EAC/D6C,8BAA4B,GAGlC"}
|
|
1
|
+
{"version":3,"file":"AssetsMultipleSelector.js","sources":["../../../../src/components/AssetsMultipleSelector/AssetsMultipleSelector.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport classnames from 'classnames';\nimport { makeStyles } from '@material-ui/core';\nimport { sortBy } from 'lodash';\n\nimport { Search } from '../Search';\n\nimport { mapAssetGetRequest } from '~/clients/jsonApi';\nimport { jsonaDataFormatter } from '~/utils';\nimport useLoadedData from '~/effects/useLoadedData';\n\nconst useStyles = makeStyles(theme => ({\n listbox: {\n maxHeight: 360,\n },\n paper: {\n width: 364,\n },\n footer: {\n fontSize: 12,\n color: theme.palette.primary.text6,\n lineHeight: '16.872px',\n padding: '8px 16px',\n },\n}));\n\nconst getDataFromResponseFn = (response: {\n data: unknown;\n headers?: { get(name: string): string | null };\n}) => {\n return {\n data: jsonaDataFormatter.deserialize(response.data as string) as Asset[],\n total: Number(response.headers?.get('total')) || 0,\n };\n};\nconst initialSelectedAssets: Asset[] = [];\nconst defaultQueryParams = {};\nconst DEFAULT_ASSETS_PER_PAGE = 50;\nconst initialData: { data: Asset[]; total: number } = { data: [], total: 0 };\n\ntype Asset = { id: string; name: string } & Record<string, unknown>;\nexport type AssetsMultipleSelectorProps = {\n /**\n array of asset objects with required id and name fields.\n */\n selectedAssets: [] | Asset[];\n /**\n callback fires on asset selection with array of all selected assets.\n */\n onChange: (assets: Asset[] | []) => void;\n /**\n label for autocomplete input.\n */\n label: string;\n /**\n type of asset.\n */\n type: 'program' | 'rig' | 'well' | 'frac_fleet' | 'drillout_unit' | 'pad' | 'assets';\n /**\n css for root component.\n */\n className?: string;\n /**\n custom query params for assets request like fields, per_page.\n */\n customRequestQueryParams?: Record<string, unknown> & {\n fields?: string[];\n per_page?: number | string;\n };\n /**\n material ui autocomplete classes.\n */\n classes?: any;\n};\n\nconst AssetsMultipleSelector = memo(\n ({\n selectedAssets = initialSelectedAssets,\n onChange,\n label,\n className,\n type,\n customRequestQueryParams,\n classes = {},\n }: AssetsMultipleSelectorProps) => {\n const styles = useStyles();\n\n const { isLoading, setIsLoading, data, loadData } = useLoadedData({\n loadFn: mapAssetGetRequest(type, true),\n initialData: initialData as any,\n getDataFromResponseFn,\n isCacheEnabled: true,\n });\n const { data: assetsData, total } = data ?? initialData;\n const [searchValue, setSearchValue] = useState('');\n\n useEffect(() => {\n loadAssets('', customRequestQueryParams);\n }, []);\n\n const selectedOptions: AssetsMultipleSelectorProps['selectedAssets'] & {} = useMemo(\n () =>\n selectedAssets.map(asset => ({\n ...asset,\n id: asset.id,\n label: asset.name,\n })),\n [selectedAssets]\n );\n\n const options: (Asset & { label: string })[] = useMemo(() => {\n const optionsMap: Record<string, Asset & { label: string }> = {};\n const allOptions = selectedOptions.length ? assetsData.concat(selectedOptions) : assetsData;\n allOptions.forEach((asset: Asset) => {\n optionsMap[asset.id] = {\n ...asset,\n id: asset.id,\n label: asset.name,\n };\n });\n\n return Object.values(sortBy(optionsMap, 'label'));\n }, [assetsData, selectedAssets, searchValue]);\n\n const loadAssets = useCallback(\n (\n search: string,\n customRequestQueryParams: AssetsMultipleSelectorProps['customRequestQueryParams'] = {}\n ) => {\n const params = {\n ...defaultQueryParams,\n per_page: DEFAULT_ASSETS_PER_PAGE,\n ...customRequestQueryParams,\n fields: [`${type}.name`].concat(customRequestQueryParams?.fields || []),\n };\n\n loadData({\n search,\n ...params,\n });\n },\n []\n );\n\n const handleChange = (_event: unknown, visibleSelectedOptions: Asset[], reason?: string) => {\n if (reason === 'reset') return;\n\n const newAssets = visibleSelectedOptions.map(option => {\n return {\n ...option,\n name: option.label as string,\n };\n });\n\n onChange(newAssets);\n };\n\n const onInputReset = () => {\n setSearchValue('');\n loadAssets('', customRequestQueryParams);\n };\n\n const handleInputChange = (value: string, reason: string) => {\n if (reason === 'reset' || value === '') {\n onInputReset();\n return;\n }\n\n if (value.trimStart() !== searchValue) {\n setSearchValue(value.trimStart());\n setIsLoading(true);\n loadAssets(value.trimStart(), customRequestQueryParams);\n }\n };\n\n const countNotShowedAssets = () => {\n const optionsCount = total - assetsData?.length;\n if (optionsCount === 0) return null;\n\n return optionsCount;\n };\n\n const paperFooter = useMemo(() => {\n const notShowedAssetsQuantity = countNotShowedAssets();\n return notShowedAssetsQuantity && !isLoading && searchValue ? (\n <div className={styles.footer}>\n {notShowedAssetsQuantity} additional items not displayed. Continue typing for more refined\n results.\n </div>\n ) : null;\n }, [assetsData, isLoading, !!searchValue, total]);\n\n const { listbox, paper, ...restClasses } = classes;\n\n return (\n <Search\n data-testid=\"offsetPadDropdown\"\n value={selectedOptions}\n onChange={handleChange}\n TextFieldProps={{ label }}\n className={className}\n classes={{\n listbox: classnames(styles.listbox, listbox),\n paper: classnames(styles.paper, paper),\n ...restClasses,\n }}\n loading={isLoading}\n options={options}\n placeholder=\"\"\n multiple\n filterSelectedOptions={false}\n AutocompleteProps={{ forcePopupIcon: true }}\n isHiddenAllOption\n onInputChangeCallback={handleInputChange}\n onInputReset={onInputReset}\n paperFooter={paperFooter}\n getOptionSelected={(option, value) => +option.id === +value.id}\n isPrioritizedSelectedOptions\n />\n );\n }\n);\n\nexport default AssetsMultipleSelector;\n"],"names":["useStyles","makeStyles","theme","listbox","maxHeight","paper","width","footer","fontSize","color","palette","primary","text6","lineHeight","padding","getDataFromResponseFn","response","_response$headers","data","jsonaDataFormatter","deserialize","total","Number","headers","get","initialSelectedAssets","defaultQueryParams","initialData","AssetsMultipleSelector","memo","_ref","_ref$selectedAssets","selectedAssets","onChange","label","className","type","customRequestQueryParams","_ref$classes","classes","styles","_useLoadedData","useLoadedData","loadFn","mapAssetGetRequest","isCacheEnabled","isLoading","setIsLoading","loadData","_ref2","assetsData","useState","_useState2","_slicedToArray","_useState","searchValue","setSearchValue","useEffect","loadAssets","selectedOptions","useMemo","map","asset","_objectSpread","id","name","options","optionsMap","length","concat","forEach","Object","values","sortBy","useCallback","search","arguments","undefined","params","per_page","fields","onInputReset","paperFooter","optionsCount","notShowedAssetsQuantity","_jsxs","children","restClasses","_excluded","_jsx","Search","value","_event","visibleSelectedOptions","reason","newAssets","option","TextFieldProps","classnames","loading","placeholder","multiple","filterSelectedOptions","AutocompleteProps","forcePopupIcon","isHiddenAllOption","onInputChangeCallback","trimStart","getOptionSelected","isPrioritizedSelectedOptions"],"mappings":"y3FAWA,IAAMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,UAAW,K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ACT/B,KAAM+B,EAAO9D,OAEjB,IAEAD,EAAS8D,EATe,GAsDtBE,eAAgB,CAAE/D,MAAAA,GAClBC,UAAWA,EACXI,QAAOwB,EAAA,CACL5D,QAAS+F,EAAU,QAAC1D,EAAOrC,QAASA,GACpCE,MAAO6F,EAAU,QAAC1D,EAAOnC,MAAOA,IAC7BkF,GAELY,QAASrD,EACToB,QAASA,EACTkC,YAAY,GACZC,UAAQ,EACRC,uBAAuB,EACvBC,kBAAmB,CAAEC,gBAAgB,GACrCC,mBAAiB,EACjBC,sBAnDsB,SAACf,EAAeG,GACzB,UAAXA,GAAgC,KAAVH,EAKtBA,EAAMgB,cAAgBpD,IACxBC,EAAemC,EAAMgB,aACrB5D,GAAa,GACbW,EAAWiC,EAAMgB,YAAatE,IAP9B4C,KAkDAA,aAAcA,EACdC,YAAaA,EACb0B,kBAAmB,SAACZ,EAAQL,GAAK,OAAMK,EAAOhC,KAAQ2B,EAAM3B,EAAG,EAC/D6C,8BAA4B,GAGlC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),r=require("prop-types"),n=require("react-player"),t=require("classnames"),c=require("@material-ui/core/styles"),a=require("@material-ui/core"),l=require("@material-ui/icons/Image"),u=require("@material-ui/icons/Fullscreen"),m=require("@material-ui/core/colors/grey"),d=require("../NewDocumentViewer/NewDocumentViewer.js"),p=require("../NewDocumentViewer/icons/UnavailableFileIcon.js"),j=require("../../componentsV2/ImageViewer/ImageViewer.js"),q=require("./styles.css.js"),h=require("../FileTypeIcon.js"),I=require("../IconButton/index.js"),g=require("../../utils/mobileDetect.js"),f=require("../../utils/fileExtension.js"),v=require("../../utils/filePreview.js"),b=require("../../icons/iconParkIcons.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"),require("querystring"),require("lodash"),require("../../clients/subscriptions/subscriptions-client.factory.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../clients/jsonApi/index.js"),require("query-string"),require("../../constants/goals.js"),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("../GradientManager/configuration/constants.js");var x=require("../../effects/useSignedURL.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("moment"),require("../../utils/casing/validation.js"),require("lodash/mean"),require("../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),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");var C=require("../../utils/main.js");require("../../utils/metrics/metricsConfig.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("../../utils/jsonaDataFormatter.js"),require("../../utils/bha.js"),require("jsona"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js"),require("uuid"),require("../StatusBadge/constants.js"),require("lodash/unset"),require("../../clients/api/apiCore.js"),require("../../clients/constants.js"),require("../../clients/sso/auth0.js"),require("../../clients/sso/oauth2.js"),require("../../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsProvider.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsContext.js"),require("../../componentsV2/AppPanel/AppPanelsContext.js");var y=require("react/jsx-runtime");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=w(e),P=w(s),F=w(i),O=w(r),A=w(n),D=w(t),S=w(l),z=w(u),k=w(m),W=["displayName","fileName","attachmentSize","size","small"];function U(e,s){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);s&&(o=o.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),i.push.apply(i,o)}return i}function R(e){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?U(Object(i),!0).forEach((function(s){P.default(e,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):U(Object(i)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))}))}return e}var L=k.default[200],E=k.default[400],T={label:"small",value:135},V={label:"medium",value:300},M={fileImage:function(e,s){return{maxWidth:"100%",borderRadius:4,overflow:"hidden",maxHeight:s===T.label?T.value:V.value,display:e?"initial":"none",cursor:"pointer"}},fileDownloadWrapper:{padding:"10px 10px 10px 5px",border:"1px solid #616161",borderRadius:3,maxWidth:500,width:"75%"},imagePlaceholder:{position:"relative",backgroundColor:L,borderRadius:3,marginTop:10,height:135,width:135}},B=function(e){var s,i,o=x(e.attachmentFileName)||e.attachmentUrl;return y.jsxs(y.Fragment,{children:[y.jsxs("div",{onClick:e.openLightbox,className:q.cAttachmentImg,children:[y.jsx("img",{"data-testid":"".concat("Attachment","_image"),src:o,style:M.fileImage(!!e.imageDimensions,e.size),alt:"Attachment",onLoad:e.onImageLoaded}),y.jsx("div",{"data-testid":"".concat("Attachment","_button"),className:q.cAttachmentImgPreviwBtn,children:y.jsx(z.default,{})})]}),!e.imageDimensions&&y.jsx("div",{style:M.imagePlaceholder,children:y.jsx(S.default,{"data-testid":"".concat("Attachment","_placeholder"),className:e.classes.imageIconRoot,htmlColor:E,fontSize:"large"})}),e.lightboxIsOpen&&y.jsx(j.ImageViewer,{src:o,onClose:e.handleLightboxClose,onOpen:e.handleLightboxOpen,width:null===(s=e.imageDimensions)||void 0===s?void 0:s.width,height:null===(i=e.imageDimensions)||void 0===i?void 0:i.height})]})},G=function(e){var s=C.default.getFileNameWithExtensionFromPath(e.displayName||e.attachmentUrl),i=x(e.attachmentFileName,"inline"),o=x(e.attachmentFileName,"attachment"),r=v.getIsPreviewUnavailable(s);return y.jsxs("div",{className:q.cAttachmentFileWrapper,children:[y.jsxs("div",{className:D.default(q.cAttachmentFileDownloadWrapper,r&&e.classes.disabledPreview),style:M.fileDownloadWrapper,onClick:function(){r||e.openPreview()},children:[r?y.jsx(p.UnavailableFileIcon,{className:e.classes.unavailableFileIcon}):y.jsx(h,{fileName:e.displayName||e.attachmentUrl,className:q.cAttachmentFileDownloadWrapperFileIcon,size:e.small?25:50}),y.jsxs("div",{className:e.classes.titleContainer,children:[r&&y.jsx("div",{className:e.classes.caption,children:"Preview unavailable"}),y.jsx("div",{"data-testid":"".concat("Attachment","_name"),className:D.default(q.cAttachmentFileDownloadWrapperFileName,r&&e.classes.fileName),children:y.jsx(a.Typography,{variant:"subtitle2",noWrap:!0,className:e.classes.unavailableFileName,children:s})})]}),y.jsx(d,{fileUrl:i,classes:{root:e.classes.dialogRoot,paper:g.isNativeDetected?e.classes.nativeDialog:e.classes.dialog},fileName:s,fileSize:e.attachmentSize,onClose:e.closePreview,open:e.previewIsOpen})]}),y.jsx("a",{download:e.displayName,href:o,className:q.cAttachmentFileDownloadWrapperForm,children:y.jsx(I,{"data-testid":"".concat("Attachment","_downloadButton"),className:e.classes.downloadIcon,type:"submit",children:y.jsx(b.DownloadIcon,{size:24,className:e.classes.downloadIcon})})})]})};function _(e){var s=e.displayName,i=void 0===s?null:s,r=e.fileName,n=void 0===r?null:r,t=e.attachmentSize,c=void 0===t?void 0:t,a=e.size,l=void 0===a?V.label:a,u=e.small,m=void 0!==u&&u,d=R(R({},F.default(e,W)),{},{displayName:i,fileName:n,attachmentSize:c,size:l,small:m}),p=o.useState(void 0),j=N.default(p,2),h=j[0],I=j[1],v=o.useState(!1),b=N.default(v,2),C=b[0],w=b[1],P=o.useState(!1),O=N.default(P,2),D=O[0],S=O[1],z=d.displayName||d.attachmentUrl||d.fileName,k=f.getIsImage(z),U=f.getIsVideo(z),L=x(!d.attachmentUrl&&d.fileName),E=d.attachmentUrl||L,M=o.useCallback((function(e){return e.preventDefault()}),[]),_=o.useCallback((function(){g.isNativeDetected&&document.documentElement.addEventListener("touchmove",M,{passive:!1})}),[M]),H=o.useCallback((function(){g.isNativeDetected&&document.documentElement.removeEventListener("touchmove",M),w(!1)}),[M]),K=o.useCallback((function(){return w(!0)}),[]),Z=o.useCallback((function(e){var s=e.currentTarget,i=s.naturalWidth,o=s.naturalHeight;I({width:i,height:o})}),[]),J=o.useCallback((function(){return S(!0)}),[]),Q=o.useCallback((function(e){e.stopPropagation(),S(!1)}),[]);return k?y.jsx("div",{className:q.cAttachment,children:y.jsx(B,{size:d.size,openLightbox:K,attachmentFileName:d.fileName,attachmentUrl:d.attachmentUrl,onImageLoaded:Z,imageDimensions:h,lightboxIsOpen:C,handleLightboxOpen:_,handleLightboxClose:H,classes:d.classes})}):U&&A.default.canPlay(E)?y.jsx("div",{className:q.cAttachment,children:y.jsx(A.default,{"data-testid":"".concat("Attachment","_player"),className:q.cAttachmentReactPlayer,url:E,config:{file:{attributes:{preload:"metadata"}}},controls:!0,height:d.size===T.label?T.value:V.value,width:null})}):y.jsx("div",{className:q.cAttachment,children:y.jsx(G,{attachmentUrl:E,attachmentFileName:d.fileName,attachmentSize:d.attachmentSize,displayName:d.displayName,openPreview:J,closePreview:Q,previewIsOpen:D,classes:d.classes,small:d.small})})}_.propTypes={attachmentUrl:O.default.string.isRequired,attachmentSize:O.default.number,displayName:O.default.string,fileName:O.default.string,size:O.default.oneOf([T.label,V.label]),classes:O.default.shape({}).isRequired,small:O.default.bool};var H=c.withStyles((function(e){return{imageIconRoot:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},dialog:{width:"95%",height:"95%",maxWidth:"100%",position:"relative"},nativeDialog:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0},dialogRoot:{backgroundColor:"rgba(0, 0, 0, 0.85)"},fileName:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400},downloadIcon:{color:e.palette.primary.text3},disabledPreview:{backgroundColor:e.palette.primary.text9},unavailableFileIcon:{marginRight:12,minWidth:32},titleContainer:{display:"flex",flexDirection:"column",width:"100%"},caption:{fontSize:12,fontWeight:400,width:"fit-content"},unavailableFileName:{fontSize:12,fontWeight:400}}}))(_);module.exports=H;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),r=require("prop-types"),n=require("react-player"),t=require("classnames"),c=require("@material-ui/core/styles"),a=require("@material-ui/core"),l=require("@material-ui/icons/Image"),u=require("@material-ui/icons/Fullscreen"),m=require("@material-ui/core/colors/grey"),d=require("../NewDocumentViewer/NewDocumentViewer.js"),j=require("../NewDocumentViewer/icons/UnavailableFileIcon.js"),p=require("../../componentsV2/ImageViewer/ImageViewer.js"),q=require("./styles.css.js"),h=require("../FileTypeIcon.js"),I=require("../IconButton/index.js"),g=require("../../utils/mobileDetect.js"),f=require("../../utils/fileExtension.js"),v=require("../../utils/filePreview.js"),b=require("../../icons/iconParkIcons.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"),require("querystring"),require("lodash"),require("../../clients/subscriptions/subscriptions-client.factory.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../clients/jsonApi/index.js"),require("query-string"),require("../../constants/goals.js"),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("../GradientManager/configuration/constants.js");var x=require("../../effects/useSignedURL.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("moment"),require("../../utils/casing/validation.js"),require("lodash/mean"),require("../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),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");var C=require("../../utils/main.js");require("../../utils/metrics/metricsConfig.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("../../utils/jsonaDataFormatter.js"),require("../../utils/bha.js"),require("jsona"),require("../../utils/shareRecentRequest.js"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js"),require("uuid"),require("../StatusBadge/constants.js"),require("lodash/unset"),require("../../clients/api/apiCore.js"),require("../../clients/constants.js"),require("../../clients/sso/auth0.js"),require("../../clients/sso/oauth2.js"),require("../../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsProvider.js"),require("../../componentsV2/AppCommonsProvider/AppCommonsContext.js"),require("../../componentsV2/AppPanel/AppPanelsContext.js");var y=require("react/jsx-runtime");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=w(e),P=w(s),F=w(i),O=w(r),A=w(n),D=w(t),S=w(l),z=w(u),k=w(m),R=["displayName","fileName","attachmentSize","size","small"];function W(e,s){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);s&&(o=o.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),i.push.apply(i,o)}return i}function U(e){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?W(Object(i),!0).forEach((function(s){P.default(e,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):W(Object(i)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))}))}return e}var L=k.default[200],E=k.default[400],T={label:"small",value:135},V={label:"medium",value:300},M={fileImage:function(e,s){return{maxWidth:"100%",borderRadius:4,overflow:"hidden",maxHeight:s===T.label?T.value:V.value,display:e?"initial":"none",cursor:"pointer"}},fileDownloadWrapper:{padding:"10px 10px 10px 5px",border:"1px solid #616161",borderRadius:3,maxWidth:500,width:"75%"},imagePlaceholder:{position:"relative",backgroundColor:L,borderRadius:3,marginTop:10,height:135,width:135}},B=function(e){var s,i,o=x(e.attachmentFileName)||e.attachmentUrl;return y.jsxs(y.Fragment,{children:[y.jsxs("div",{onClick:e.openLightbox,className:q.cAttachmentImg,children:[y.jsx("img",{"data-testid":"".concat("Attachment","_image"),src:o,style:M.fileImage(!!e.imageDimensions,e.size),alt:"Attachment",onLoad:e.onImageLoaded}),y.jsx("div",{"data-testid":"".concat("Attachment","_button"),className:q.cAttachmentImgPreviwBtn,children:y.jsx(z.default,{})})]}),!e.imageDimensions&&y.jsx("div",{style:M.imagePlaceholder,children:y.jsx(S.default,{"data-testid":"".concat("Attachment","_placeholder"),className:e.classes.imageIconRoot,htmlColor:E,fontSize:"large"})}),e.lightboxIsOpen&&y.jsx(p.ImageViewer,{src:o,onClose:e.handleLightboxClose,onOpen:e.handleLightboxOpen,width:null===(s=e.imageDimensions)||void 0===s?void 0:s.width,height:null===(i=e.imageDimensions)||void 0===i?void 0:i.height})]})},G=function(e){var s=C.default.getFileNameWithExtensionFromPath(e.displayName||e.attachmentUrl),i=x(e.attachmentFileName,"inline"),o=x(e.attachmentFileName,"attachment"),r=v.getIsPreviewUnavailable(s);return y.jsxs("div",{className:q.cAttachmentFileWrapper,children:[y.jsxs("div",{className:D.default(q.cAttachmentFileDownloadWrapper,r&&e.classes.disabledPreview),style:M.fileDownloadWrapper,onClick:function(){r||e.openPreview()},children:[r?y.jsx(j.UnavailableFileIcon,{className:e.classes.unavailableFileIcon}):y.jsx(h,{fileName:e.displayName||e.attachmentUrl,className:q.cAttachmentFileDownloadWrapperFileIcon,size:e.small?25:50}),y.jsxs("div",{className:e.classes.titleContainer,children:[r&&y.jsx("div",{className:e.classes.caption,children:"Preview unavailable"}),y.jsx("div",{"data-testid":"".concat("Attachment","_name"),className:D.default(q.cAttachmentFileDownloadWrapperFileName,r&&e.classes.fileName),children:y.jsx(a.Typography,{variant:"subtitle2",noWrap:!0,className:e.classes.unavailableFileName,children:s})})]}),y.jsx(d,{fileUrl:i,classes:{root:e.classes.dialogRoot,paper:g.isNativeDetected?e.classes.nativeDialog:e.classes.dialog},fileName:s,fileSize:e.attachmentSize,onClose:e.closePreview,open:e.previewIsOpen})]}),y.jsx("a",{download:e.displayName,href:o,className:q.cAttachmentFileDownloadWrapperForm,children:y.jsx(I,{"data-testid":"".concat("Attachment","_downloadButton"),className:e.classes.downloadIcon,type:"submit",children:y.jsx(b.DownloadIcon,{size:24,className:e.classes.downloadIcon})})})]})};function _(e){var s=e.displayName,i=void 0===s?null:s,r=e.fileName,n=void 0===r?null:r,t=e.attachmentSize,c=void 0===t?void 0:t,a=e.size,l=void 0===a?V.label:a,u=e.small,m=void 0!==u&&u,d=U(U({},F.default(e,R)),{},{displayName:i,fileName:n,attachmentSize:c,size:l,small:m}),j=o.useState(void 0),p=N.default(j,2),h=p[0],I=p[1],v=o.useState(!1),b=N.default(v,2),C=b[0],w=b[1],P=o.useState(!1),O=N.default(P,2),D=O[0],S=O[1],z=d.displayName||d.attachmentUrl||d.fileName,k=f.getIsImage(z),W=f.getIsVideo(z),L=x(!d.attachmentUrl&&d.fileName),E=d.attachmentUrl||L,M=o.useCallback((function(e){return e.preventDefault()}),[]),_=o.useCallback((function(){g.isNativeDetected&&document.documentElement.addEventListener("touchmove",M,{passive:!1})}),[M]),H=o.useCallback((function(){g.isNativeDetected&&document.documentElement.removeEventListener("touchmove",M),w(!1)}),[M]),K=o.useCallback((function(){return w(!0)}),[]),Z=o.useCallback((function(e){var s=e.currentTarget,i=s.naturalWidth,o=s.naturalHeight;I({width:i,height:o})}),[]),J=o.useCallback((function(){return S(!0)}),[]),Q=o.useCallback((function(e){e.stopPropagation(),S(!1)}),[]);return k?y.jsx("div",{className:q.cAttachment,children:y.jsx(B,{size:d.size,openLightbox:K,attachmentFileName:d.fileName,attachmentUrl:d.attachmentUrl,onImageLoaded:Z,imageDimensions:h,lightboxIsOpen:C,handleLightboxOpen:_,handleLightboxClose:H,classes:d.classes})}):W&&A.default.canPlay(E)?y.jsx("div",{className:q.cAttachment,children:y.jsx(A.default,{"data-testid":"".concat("Attachment","_player"),className:q.cAttachmentReactPlayer,url:E,config:{file:{attributes:{preload:"metadata"}}},controls:!0,height:d.size===T.label?T.value:V.value,width:null})}):y.jsx("div",{className:q.cAttachment,children:y.jsx(G,{attachmentUrl:E,attachmentFileName:d.fileName,attachmentSize:d.attachmentSize,displayName:d.displayName,openPreview:J,closePreview:Q,previewIsOpen:D,classes:d.classes,small:d.small})})}_.propTypes={attachmentUrl:O.default.string.isRequired,attachmentSize:O.default.number,displayName:O.default.string,fileName:O.default.string,size:O.default.oneOf([T.label,V.label]),classes:O.default.shape({}).isRequired,small:O.default.bool};var H=c.withStyles((function(e){return{imageIconRoot:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},dialog:{width:"95%",height:"95%",maxWidth:"100%",position:"relative"},nativeDialog:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0},dialogRoot:{backgroundColor:"rgba(0, 0, 0, 0.85)"},fileName:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400},downloadIcon:{color:e.palette.primary.text3},disabledPreview:{backgroundColor:e.palette.primary.text9},unavailableFileIcon:{marginRight:12,minWidth:32},titleContainer:{display:"flex",flexDirection:"column",width:"100%"},caption:{fontSize:12,fontWeight:400,width:"fit-content"},unavailableFileName:{fontSize:12,fontWeight:400}}}))(_);module.exports=H;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Attachment/index.js"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactPlayer from 'react-player';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Typography } from '@material-ui/core';\nimport ImageIcon from '@material-ui/icons/Image';\nimport FullSizeIcon from '@material-ui/icons/Fullscreen';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { NewDocumentViewer } from '../NewDocumentViewer';\nimport { UnavailableFileIcon } from '../NewDocumentViewer/icons/UnavailableFileIcon';\nimport { ImageViewer } from '../../componentsV2/ImageViewer';\n\nimport styles from './styles.css';\n\nimport FileTypeIcon from '~components/FileTypeIcon';\nimport IconButton from '~components/IconButton';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { getIsImage, getIsVideo } from '~/utils/fileExtension';\nimport { getIsPreviewUnavailable } from '~/utils/filePreview';\nimport { DownloadIcon } from '~/icons';\nimport { useSignedURL } from '~/effects';\nimport utils from '~utils/main';\n\nconst PAGE_NAME = 'Attachment';\n\nconst grey200 = grey[200];\nconst grey400 = grey[400];\n\nconst SIZES = {\n small: { label: 'small', value: 135 },\n medium: { label: 'medium', value: 300 },\n};\n\nconst style = {\n fileImage: (imageIsLoaded, size) => ({\n maxWidth: '100%',\n borderRadius: 4,\n overflow: 'hidden',\n // NOTE: Makes one-line comment with image fits into comments container. Equals to\n // imagePlaceholder height\n maxHeight: size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value,\n display: imageIsLoaded ? 'initial' : 'none',\n cursor: 'pointer',\n }),\n fileDownloadWrapper: {\n padding: '10px 10px 10px 5px',\n border: `1px solid #616161`,\n borderRadius: 3,\n maxWidth: 500, // NOTE: Corresponds to react-player max width\n width: '75%',\n },\n imagePlaceholder: {\n position: 'relative',\n backgroundColor: grey200,\n borderRadius: 3,\n marginTop: 10,\n height: 135,\n width: 135,\n },\n};\n\nconst muiStyles = theme => ({\n imageIconRoot: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n dialog: {\n width: '95%',\n height: '95%',\n maxWidth: '100%',\n position: 'relative',\n },\n nativeDialog: {\n width: '100%',\n height: '100%',\n maxWidth: '100%',\n maxHeight: '100%',\n margin: 0,\n },\n dialogRoot: {\n // NOTE: Make background color similar to lightbox\n backgroundColor: 'rgba(0, 0, 0, 0.85)',\n },\n fileName: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n fontWeight: 400,\n },\n downloadIcon: {\n color: theme.palette.primary.text3,\n },\n disabledPreview: {\n backgroundColor: theme.palette.primary.text9,\n },\n unavailableFileIcon: {\n marginRight: 12,\n minWidth: 32,\n },\n titleContainer: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n },\n caption: {\n fontSize: 12,\n fontWeight: 400,\n width: 'fit-content',\n },\n unavailableFileName: {\n fontSize: 12,\n fontWeight: 400,\n },\n});\n\n/* eslint-disable react/prop-types */\nconst ImageAttachment = props => {\n const downloadLink = useSignedURL(props.attachmentFileName) || props.attachmentUrl;\n\n return (\n <>\n <div onClick={props.openLightbox} className={styles.cAttachmentImg}>\n <img\n data-testid={`${PAGE_NAME}_image`}\n src={downloadLink}\n style={style.fileImage(!!props.imageDimensions, props.size)}\n alt=\"Attachment\"\n onLoad={props.onImageLoaded}\n />\n <div data-testid={`${PAGE_NAME}_button`} className={styles.cAttachmentImgPreviwBtn}>\n <FullSizeIcon />\n </div>\n </div>\n\n {!props.imageDimensions && (\n <div style={style.imagePlaceholder}>\n <ImageIcon\n data-testid={`${PAGE_NAME}_placeholder`}\n className={props.classes.imageIconRoot}\n htmlColor={grey400}\n fontSize=\"large\"\n />\n </div>\n )}\n\n {props.lightboxIsOpen && (\n <ImageViewer\n src={downloadLink}\n onClose={props.handleLightboxClose}\n onOpen={props.handleLightboxOpen}\n width={props.imageDimensions?.width}\n height={props.imageDimensions?.height}\n />\n )}\n </>\n );\n};\n\nconst FileAttachment = props => {\n const fileName = utils.getFileNameWithExtensionFromPath(props.displayName || props.attachmentUrl);\n\n const previewUrl = useSignedURL(props.attachmentFileName, 'inline');\n const downloadUrl = useSignedURL(props.attachmentFileName, 'attachment');\n\n const isPreviewUnavailable = getIsPreviewUnavailable(fileName);\n\n const handleFilePreviewOpen = () => {\n if (isPreviewUnavailable) return;\n props.openPreview();\n };\n\n return (\n <div className={styles.cAttachmentFileWrapper}>\n <div\n className={classNames(\n styles.cAttachmentFileDownloadWrapper,\n isPreviewUnavailable && props.classes.disabledPreview\n )}\n style={style.fileDownloadWrapper}\n onClick={handleFilePreviewOpen}\n >\n {isPreviewUnavailable ? (\n <UnavailableFileIcon className={props.classes.unavailableFileIcon} />\n ) : (\n <FileTypeIcon\n fileName={props.displayName || props.attachmentUrl}\n className={styles.cAttachmentFileDownloadWrapperFileIcon}\n size={props.small ? 25 : 50}\n />\n )}\n <div className={props.classes.titleContainer}>\n {isPreviewUnavailable && <div className={props.classes.caption}>Preview unavailable</div>}\n <div\n data-testid={`${PAGE_NAME}_name`}\n className={classNames(\n styles.cAttachmentFileDownloadWrapperFileName,\n isPreviewUnavailable && props.classes.fileName\n )}\n >\n <Typography variant=\"subtitle2\" noWrap className={props.classes.unavailableFileName}>\n {fileName}\n </Typography>\n </div>\n </div>\n <NewDocumentViewer\n fileUrl={previewUrl}\n classes={{\n root: props.classes.dialogRoot,\n paper: isNativeDetected ? props.classes.nativeDialog : props.classes.dialog,\n }}\n fileName={fileName}\n fileSize={props.attachmentSize}\n onClose={props.closePreview}\n open={props.previewIsOpen}\n />\n </div>\n <a\n download={props.displayName}\n href={downloadUrl}\n className={styles.cAttachmentFileDownloadWrapperForm}\n >\n <IconButton\n data-testid={`${PAGE_NAME}_downloadButton`}\n className={props.classes.downloadIcon}\n type=\"submit\"\n >\n <DownloadIcon size={24} className={props.classes.downloadIcon} />\n </IconButton>\n </a>\n </div>\n );\n};\n\n/* eslint-enable react/prop-types */\n\nfunction Attachment(rawProps) {\n const {\n displayName = null,\n fileName: attachmentFileName = null,\n attachmentSize = undefined,\n size = SIZES.medium.label,\n small = false,\n ...otherProps\n } = rawProps;\n const props = {\n ...otherProps,\n displayName,\n fileName: attachmentFileName,\n attachmentSize,\n size,\n small,\n };\n\n const [imageDimensions, setImageDimensions] = useState(undefined);\n const [isLightboxOpen, setIsLightboxOpen] = useState(false);\n const [isPreviewOpen, setIsPreviewOpen] = useState(false);\n\n const fileName = props.displayName || props.attachmentUrl || props.fileName;\n const isImage = getIsImage(fileName);\n const isVideo = getIsVideo(fileName);\n\n // Don't fetch download link if attachmentUrl is provided\n const downloadLink = useSignedURL(!props.attachmentUrl && props.fileName);\n const attachmentUrl = props.attachmentUrl || downloadLink;\n const preventIOSScroll = useCallback(e => e.preventDefault(), []);\n\n // NOTE: iOS WebView has a bug when background content of React Modal is scrollable\n // Source: https://github.com/reactjs/react-modal/issues/369\n const handleLightboxOpen = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'hidden';\n document.documentElement.addEventListener('touchmove', preventIOSScroll, {\n passive: false,\n });\n }\n }, [preventIOSScroll]);\n\n const handleLightboxClose = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'visible';\n document.documentElement.removeEventListener('touchmove', preventIOSScroll);\n }\n setIsLightboxOpen(false);\n }, [preventIOSScroll]);\n\n const openLightbox = useCallback(() => setIsLightboxOpen(true), []);\n const onImageLoaded = useCallback(e => {\n const { naturalWidth, naturalHeight } = e.currentTarget;\n setImageDimensions({ width: naturalWidth, height: naturalHeight });\n }, []);\n const openPreview = useCallback(() => setIsPreviewOpen(true), []);\n const closePreview = useCallback(e => {\n e.stopPropagation();\n setIsPreviewOpen(false);\n }, []);\n\n if (isImage)\n return (\n <div className={styles.cAttachment}>\n <ImageAttachment\n size={props.size}\n openLightbox={openLightbox}\n attachmentFileName={props.fileName}\n attachmentUrl={props.attachmentUrl}\n onImageLoaded={onImageLoaded}\n imageDimensions={imageDimensions}\n lightboxIsOpen={isLightboxOpen}\n handleLightboxOpen={handleLightboxOpen}\n handleLightboxClose={handleLightboxClose}\n classes={props.classes}\n />\n </div>\n );\n\n if (isVideo && ReactPlayer.canPlay(attachmentUrl))\n return (\n <div className={styles.cAttachment}>\n <ReactPlayer\n data-testid={`${PAGE_NAME}_player`}\n className={styles.cAttachmentReactPlayer}\n url={attachmentUrl}\n config={{ file: { attributes: { preload: 'metadata' } } }}\n controls\n height={props.size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value}\n width={null}\n />\n </div>\n );\n\n return (\n <div className={styles.cAttachment}>\n <FileAttachment\n attachmentUrl={attachmentUrl}\n attachmentFileName={props.fileName}\n attachmentSize={props.attachmentSize}\n displayName={props.displayName}\n openPreview={openPreview}\n closePreview={closePreview}\n previewIsOpen={isPreviewOpen}\n classes={props.classes}\n small={props.small}\n />\n </div>\n );\n}\n\nAttachment.propTypes = {\n attachmentUrl: PropTypes.string.isRequired,\n attachmentSize: PropTypes.number,\n displayName: PropTypes.string,\n fileName: PropTypes.string,\n size: PropTypes.oneOf([SIZES.small.label, SIZES.medium.label]),\n classes: PropTypes.shape({}).isRequired,\n small: PropTypes.bool,\n};\n\nexport default withStyles(muiStyles)(Attachment);\n"],"names":["grey200","grey","grey400","SIZES","label","value","style","fileImage","imageIsLoaded","size","maxWidth","borderRadius","overflow","maxHeight","display","cursor","fileDownloadWrapper","padding","border","width","imagePlaceholder","position","backgroundColor","marginTop","height","ImageAttachment","props","_props$imageDimension","_props$imageDimension2","downloadLink","useSignedURL","attachmentFileName","attachmentUrl","_jsxs","_Fragment","children","jsxs","onClick","openLightbox","className","styles","cAttachmentImg","_jsx","jsx","concat","src","imageDimensions","alt","onLoad","onImageLoaded","cAttachmentImgPreviwBtn","FullSizeIcon","ImageIcon","classes","imageIconRoot","htmlColor","fontSize","lightboxIsOpen","ImageViewer","onClose","handleLightboxClose","onOpen","handleLightboxOpen","FileAttachment","fileName","utils","getFileNameWithExtensionFromPath","displayName","previewUrl","downloadUrl","isPreviewUnavailable","getIsPreviewUnavailable","cAttachmentFileWrapper","classNames","cAttachmentFileDownloadWrapper","disabledPreview","openPreview","UnavailableFileIcon","unavailableFileIcon","FileTypeIcon","cAttachmentFileDownloadWrapperFileIcon","small","titleContainer","caption","cAttachmentFileDownloadWrapperFileName","Typography","variant","noWrap","unavailableFileName","NewDocumentViewer","fileUrl","root","dialogRoot","paper","isNativeDetected","nativeDialog","dialog","fileSize","attachmentSize","closePreview","open","previewIsOpen","download","href","cAttachmentFileDownloadWrapperForm","IconButton","downloadIcon","type","DownloadIcon","Attachment","rawProps","_rawProps$displayName","_rawProps$fileName","_rawProps$attachmentS","undefined","_rawProps$size","_rawProps$small","_excluded","useState","_useState2","_slicedToArray","_useState","setImageDimensions","_useState4","_useState3","isLightboxOpen","setIsLightboxOpen","_useState6","_useState5","isPreviewOpen","setIsPreviewOpen","isImage","getIsImage","isVideo","getIsVideo","preventIOSScroll","useCallback","e","preventDefault","document","documentElement","addEventListener","passive","removeEventListener","currentTarget","naturalWidth","naturalHeight","stopPropagation","cAttachment","ReactPlayer","canPlay","cAttachmentReactPlayer","url","config","file","attributes","preload","controls","propTypes","PropTypes","string","isRequired","number","oneOf","shape","bool","Attachment$1","withStyles","theme","top","left","transform","margin","whiteSpace","textOverflow","fontWeight","color","palette","primary","text3","text9","marginRight","minWidth","flexDirection"],"mappings":"ylQAyBA,IAEMA,EAAUC,EAAAA,QAAK,KACfC,EAAUD,EAAAA,QAAK,KAEfE,EACG,CAAEC,MAAO,QAASC,MAAO,KAD5BF,EAEI,CAAEC,MAAO,SAAUC,MAAO,KAG9BC,EAAQ,CACZC,UAAW,SAACC,EAAeC,GAAI,MAAM,CACnCC,SAAU,OACVC,aAAc,EACdC,SAAU,SAGVC,UAAWJ,IAASN,EAAYC,MAAQD,EAAYE,MAAQF,EAAaE,MACzES,QAASN,EAAgB,UAAY,OACrCO,OAAQ,UACR,EACFC,oBAAqB,CACnBC,QAAS,qBACTC,OAA2B,oBAC3BP,aAAc,EACdD,SAAU,IACVS,MAAO,OAETC,iBAAkB,CAChBC,SAAU,WACVC,gBAAiBtB,EACjBW,aAAc,EACdY,UAAW,GACXC,OAAQ,IACRL,MAAO,MA6DLM,EAAkB,SAAAC,GAAS,IAAAC,EAAAC,EACzBC,EAAeC,EAAaJ,EAAMK,qBAAuBL,EAAMM,cAErE,OACEC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SACE,CAAAF,EAAAG,KAAA,MAAA,CAAKC,QAASX,EAAMY,aAAcC,UAAWC,EAAOC,eAAeN,SACjE,CAAAO,EAAAC,IAAA,MAAA,CACE,cAAA,GAAAC,OAtGQ,aAsG0B,UAClCC,IAAKhB,EACLvB,MAAOA,EA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H,WAC7BhF,MAAO8E,EAAS,QAACM,MAGnB,IAAAC,EAAeC,cAzSG,SAAAC,GAAK,MAAK,CAC1BlH,cAAe,CACbjC,SAAU,WACVoJ,IAAK,MACLC,KAAM,MACNC,UAAW,yBAEb3E,OAAQ,CACN7E,MAAO,MACPK,OAAQ,MACRd,SAAU,OACVW,SAAU,YAEZ0E,aAAc,CACZ5E,MAAO,OACPK,OAAQ,OACRd,SAAU,OACVG,UAAW,OACX+J,OAAQ,GAEVhF,WAAY,CAEVtE,gBAAiB,uBAEnB0C,SAAU,CACRpD,SAAU,SACViK,WAAY,SACZC,aAAc,WACdC,WAAY,KAEdrE,aAAc,CACZsE,MAAOR,EAAMS,QAAQC,QAAQC,OAE/BxG,gBAAiB,CACfrD,gBAAiBkJ,EAAMS,QAAQC,QAAQE,OAEzCtG,oBAAqB,CACnBuG,YAAa,GACbC,SAAU,IAEZpG,eAAgB,CACdpE,QAAS,OACTyK,cAAe,SACfpK,MAAO,QAETgE,QAAS,CACP3B,SAAU,GACVuH,WAAY,IACZ5J,MAAO,eAETqE,oBAAqB,CACnBhC,SAAU,GACVuH,WAAY,KAEf,GAmPcR,CAAsB1D"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Attachment/index.js"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactPlayer from 'react-player';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Typography } from '@material-ui/core';\nimport ImageIcon from '@material-ui/icons/Image';\nimport FullSizeIcon from '@material-ui/icons/Fullscreen';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { NewDocumentViewer } from '../NewDocumentViewer';\nimport { UnavailableFileIcon } from '../NewDocumentViewer/icons/UnavailableFileIcon';\nimport { ImageViewer } from '../../componentsV2/ImageViewer';\n\nimport styles from './styles.css';\n\nimport FileTypeIcon from '~components/FileTypeIcon';\nimport IconButton from '~components/IconButton';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { getIsImage, getIsVideo } from '~/utils/fileExtension';\nimport { getIsPreviewUnavailable } from '~/utils/filePreview';\nimport { DownloadIcon } from '~/icons';\nimport { useSignedURL } from '~/effects';\nimport utils from '~utils/main';\n\nconst PAGE_NAME = 'Attachment';\n\nconst grey200 = grey[200];\nconst grey400 = grey[400];\n\nconst SIZES = {\n small: { label: 'small', value: 135 },\n medium: { label: 'medium', value: 300 },\n};\n\nconst style = {\n fileImage: (imageIsLoaded, size) => ({\n maxWidth: '100%',\n borderRadius: 4,\n overflow: 'hidden',\n // NOTE: Makes one-line comment with image fits into comments container. Equals to\n // imagePlaceholder height\n maxHeight: size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value,\n display: imageIsLoaded ? 'initial' : 'none',\n cursor: 'pointer',\n }),\n fileDownloadWrapper: {\n padding: '10px 10px 10px 5px',\n border: `1px solid #616161`,\n borderRadius: 3,\n maxWidth: 500, // NOTE: Corresponds to react-player max width\n width: '75%',\n },\n imagePlaceholder: {\n position: 'relative',\n backgroundColor: grey200,\n borderRadius: 3,\n marginTop: 10,\n height: 135,\n width: 135,\n },\n};\n\nconst muiStyles = theme => ({\n imageIconRoot: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n dialog: {\n width: '95%',\n height: '95%',\n maxWidth: '100%',\n position: 'relative',\n },\n nativeDialog: {\n width: '100%',\n height: '100%',\n maxWidth: '100%',\n maxHeight: '100%',\n margin: 0,\n },\n dialogRoot: {\n // NOTE: Make background color similar to lightbox\n backgroundColor: 'rgba(0, 0, 0, 0.85)',\n },\n fileName: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n fontWeight: 400,\n },\n downloadIcon: {\n color: theme.palette.primary.text3,\n },\n disabledPreview: {\n backgroundColor: theme.palette.primary.text9,\n },\n unavailableFileIcon: {\n marginRight: 12,\n minWidth: 32,\n },\n titleContainer: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n },\n caption: {\n fontSize: 12,\n fontWeight: 400,\n width: 'fit-content',\n },\n unavailableFileName: {\n fontSize: 12,\n fontWeight: 400,\n },\n});\n\n/* eslint-disable react/prop-types */\nconst ImageAttachment = props => {\n const downloadLink = useSignedURL(props.attachmentFileName) || props.attachmentUrl;\n\n return (\n <>\n <div onClick={props.openLightbox} className={styles.cAttachmentImg}>\n <img\n data-testid={`${PAGE_NAME}_image`}\n src={downloadLink}\n style={style.fileImage(!!props.imageDimensions, props.size)}\n alt=\"Attachment\"\n onLoad={props.onImageLoaded}\n />\n <div data-testid={`${PAGE_NAME}_button`} className={styles.cAttachmentImgPreviwBtn}>\n <FullSizeIcon />\n </div>\n </div>\n\n {!props.imageDimensions && (\n <div style={style.imagePlaceholder}>\n <ImageIcon\n data-testid={`${PAGE_NAME}_placeholder`}\n className={props.classes.imageIconRoot}\n htmlColor={grey400}\n fontSize=\"large\"\n />\n </div>\n )}\n\n {props.lightboxIsOpen && (\n <ImageViewer\n src={downloadLink}\n onClose={props.handleLightboxClose}\n onOpen={props.handleLightboxOpen}\n width={props.imageDimensions?.width}\n height={props.imageDimensions?.height}\n />\n )}\n </>\n );\n};\n\nconst FileAttachment = props => {\n const fileName = utils.getFileNameWithExtensionFromPath(props.displayName || props.attachmentUrl);\n\n const previewUrl = useSignedURL(props.attachmentFileName, 'inline');\n const downloadUrl = useSignedURL(props.attachmentFileName, 'attachment');\n\n const isPreviewUnavailable = getIsPreviewUnavailable(fileName);\n\n const handleFilePreviewOpen = () => {\n if (isPreviewUnavailable) return;\n props.openPreview();\n };\n\n return (\n <div className={styles.cAttachmentFileWrapper}>\n <div\n className={classNames(\n styles.cAttachmentFileDownloadWrapper,\n isPreviewUnavailable && props.classes.disabledPreview\n )}\n style={style.fileDownloadWrapper}\n onClick={handleFilePreviewOpen}\n >\n {isPreviewUnavailable ? (\n <UnavailableFileIcon className={props.classes.unavailableFileIcon} />\n ) : (\n <FileTypeIcon\n fileName={props.displayName || props.attachmentUrl}\n className={styles.cAttachmentFileDownloadWrapperFileIcon}\n size={props.small ? 25 : 50}\n />\n )}\n <div className={props.classes.titleContainer}>\n {isPreviewUnavailable && <div className={props.classes.caption}>Preview unavailable</div>}\n <div\n data-testid={`${PAGE_NAME}_name`}\n className={classNames(\n styles.cAttachmentFileDownloadWrapperFileName,\n isPreviewUnavailable && props.classes.fileName\n )}\n >\n <Typography variant=\"subtitle2\" noWrap className={props.classes.unavailableFileName}>\n {fileName}\n </Typography>\n </div>\n </div>\n <NewDocumentViewer\n fileUrl={previewUrl}\n classes={{\n root: props.classes.dialogRoot,\n paper: isNativeDetected ? props.classes.nativeDialog : props.classes.dialog,\n }}\n fileName={fileName}\n fileSize={props.attachmentSize}\n onClose={props.closePreview}\n open={props.previewIsOpen}\n />\n </div>\n <a\n download={props.displayName}\n href={downloadUrl}\n className={styles.cAttachmentFileDownloadWrapperForm}\n >\n <IconButton\n data-testid={`${PAGE_NAME}_downloadButton`}\n className={props.classes.downloadIcon}\n type=\"submit\"\n >\n <DownloadIcon size={24} className={props.classes.downloadIcon} />\n </IconButton>\n </a>\n </div>\n );\n};\n\n/* eslint-enable react/prop-types */\n\nfunction Attachment(rawProps) {\n const {\n displayName = null,\n fileName: attachmentFileName = null,\n attachmentSize = undefined,\n size = SIZES.medium.label,\n small = false,\n ...otherProps\n } = rawProps;\n const props = {\n ...otherProps,\n displayName,\n fileName: attachmentFileName,\n attachmentSize,\n size,\n small,\n };\n\n const [imageDimensions, setImageDimensions] = useState(undefined);\n const [isLightboxOpen, setIsLightboxOpen] = useState(false);\n const [isPreviewOpen, setIsPreviewOpen] = useState(false);\n\n const fileName = props.displayName || props.attachmentUrl || props.fileName;\n const isImage = getIsImage(fileName);\n const isVideo = getIsVideo(fileName);\n\n // Don't fetch download link if attachmentUrl is provided\n const downloadLink = useSignedURL(!props.attachmentUrl && props.fileName);\n const attachmentUrl = props.attachmentUrl || downloadLink;\n const preventIOSScroll = useCallback(e => e.preventDefault(), []);\n\n // NOTE: iOS WebView has a bug when background content of React Modal is scrollable\n // Source: https://github.com/reactjs/react-modal/issues/369\n const handleLightboxOpen = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'hidden';\n document.documentElement.addEventListener('touchmove', preventIOSScroll, {\n passive: false,\n });\n }\n }, [preventIOSScroll]);\n\n const handleLightboxClose = useCallback(() => {\n if (isNativeDetected) {\n // document.documentElement.style.overflowY = 'visible';\n document.documentElement.removeEventListener('touchmove', preventIOSScroll);\n }\n setIsLightboxOpen(false);\n }, [preventIOSScroll]);\n\n const openLightbox = useCallback(() => setIsLightboxOpen(true), []);\n const onImageLoaded = useCallback(e => {\n const { naturalWidth, naturalHeight } = e.currentTarget;\n setImageDimensions({ width: naturalWidth, height: naturalHeight });\n }, []);\n const openPreview = useCallback(() => setIsPreviewOpen(true), []);\n const closePreview = useCallback(e => {\n e.stopPropagation();\n setIsPreviewOpen(false);\n }, []);\n\n if (isImage)\n return (\n <div className={styles.cAttachment}>\n <ImageAttachment\n size={props.size}\n openLightbox={openLightbox}\n attachmentFileName={props.fileName}\n attachmentUrl={props.attachmentUrl}\n onImageLoaded={onImageLoaded}\n imageDimensions={imageDimensions}\n lightboxIsOpen={isLightboxOpen}\n handleLightboxOpen={handleLightboxOpen}\n handleLightboxClose={handleLightboxClose}\n classes={props.classes}\n />\n </div>\n );\n\n if (isVideo && ReactPlayer.canPlay(attachmentUrl))\n return (\n <div className={styles.cAttachment}>\n <ReactPlayer\n data-testid={`${PAGE_NAME}_player`}\n className={styles.cAttachmentReactPlayer}\n url={attachmentUrl}\n config={{ file: { attributes: { preload: 'metadata' } } }}\n controls\n height={props.size === SIZES.small.label ? SIZES.small.value : SIZES.medium.value}\n width={null}\n />\n </div>\n );\n\n return (\n <div className={styles.cAttachment}>\n <FileAttachment\n attachmentUrl={attachmentUrl}\n attachmentFileName={props.fileName}\n attachmentSize={props.attachmentSize}\n displayName={props.displayName}\n openPreview={openPreview}\n closePreview={closePreview}\n previewIsOpen={isPreviewOpen}\n classes={props.classes}\n small={props.small}\n />\n </div>\n );\n}\n\nAttachment.propTypes = {\n attachmentUrl: PropTypes.string.isRequired,\n attachmentSize: PropTypes.number,\n displayName: PropTypes.string,\n fileName: PropTypes.string,\n size: PropTypes.oneOf([SIZES.small.label, SIZES.medium.label]),\n classes: PropTypes.shape({}).isRequired,\n small: PropTypes.bool,\n};\n\nexport default withStyles(muiStyles)(Attachment);\n"],"names":["grey200","grey","grey400","SIZES","label","value","style","fileImage","imageIsLoaded","size","maxWidth","borderRadius","overflow","maxHeight","display","cursor","fileDownloadWrapper","padding","border","width","imagePlaceholder","position","backgroundColor","marginTop","height","ImageAttachment","props","_props$imageDimension","_props$imageDimension2","downloadLink","useSignedURL","attachmentFileName","attachmentUrl","_jsxs","_Fragment","children","jsxs","onClick","openLightbox","className","styles","cAttachmentImg","_jsx","jsx","concat","src","imageDimensions","alt","onLoad","onImageLoaded","cAttachmentImgPreviwBtn","FullSizeIcon","ImageIcon","classes","imageIconRoot","htmlColor","fontSize","lightboxIsOpen","ImageViewer","onClose","handleLightboxClose","onOpen","handleLightboxOpen","FileAttachment","fileName","utils","getFileNameWithExtensionFromPath","displayName","previewUrl","downloadUrl","isPreviewUnavailable","getIsPreviewUnavailable","cAttachmentFileWrapper","classNames","cAttachmentFileDownloadWrapper","disabledPreview","openPreview","UnavailableFileIcon","unavailableFileIcon","FileTypeIcon","cAttachmentFileDownloadWrapperFileIcon","small","titleContainer","caption","cAttachmentFileDownloadWrapperFileName","Typography","variant","noWrap","unavailableFileName","NewDocumentViewer","fileUrl","root","dialogRoot","paper","isNativeDetected","nativeDialog","dialog","fileSize","attachmentSize","closePreview","open","previewIsOpen","download","href","cAttachmentFileDownloadWrapperForm","IconButton","downloadIcon","type","DownloadIcon","Attachment","rawProps","_rawProps$displayName","_rawProps$fileName","_rawProps$attachmentS","undefined","_rawProps$size","_rawProps$small","_excluded","useState","_useState2","_slicedToArray","_useState","setImageDimensions","_useState4","_useState3","isLightboxOpen","setIsLightboxOpen","_useState6","_useState5","isPreviewOpen","setIsPreviewOpen","isImage","getIsImage","isVideo","getIsVideo","preventIOSScroll","useCallback","e","preventDefault","document","documentElement","addEventListener","passive","removeEventListener","currentTarget","naturalWidth","naturalHeight","stopPropagation","cAttachment","ReactPlayer","canPlay","cAttachmentReactPlayer","url","config","file","attributes","preload","controls","propTypes","PropTypes","string","isRequired","number","oneOf","shape","bool","Attachment$1","withStyles","theme","top","left","transform","margin","whiteSpace","textOverflow","fontWeight","color","palette","primary","text3","text9","marginRight","minWidth","flexDirection"],"mappings":"soQAyBA,IAEMA,EAAUC,EAAAA,QAAK,KACfC,EAAUD,EAAAA,QAAK,KAEfE,EACG,CAAEC,MAAO,QAASC,MAAO,KAD5BF,EAEI,CAAEC,MAAO,SAAUC,MAAO,KAG9BC,EAAQ,CACZC,UAAW,SAACC,EAAeC,GAAI,MAAM,CACnCC,SAAU,OACVC,aAAc,EACdC,SAAU,SAGVC,UAAWJ,IAASN,EAAYC,MAAQD,EAAYE,MAAQF,EAAaE,MACzES,QAASN,EAAgB,UAAY,OACrCO,OAAQ,UACR,EACFC,oBAAqB,CACnBC,QAAS,qBACTC,OAA2B,oBAC3BP,aAAc,EACdD,SAAU,IACVS,MAAO,OAETC,iBAAkB,CAChBC,SAAU,WACVC,gBAAiBtB,EACjBW,aAAc,EACdY,UAAW,GACXC,OAAQ,IACRL,MAAO,MA6DLM,EAAkB,SAAAC,GAAS,IAAAC,EAAAC,EACzBC,EAAeC,EAAaJ,EAAMK,qBAAuBL,EAAMM,cAErE,OACEC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SACE,CAAAF,EAAAG,KAAA,MAAA,CAAKC,QAASX,EAAMY,aAAcC,UAAWC,EAAOC,eAAeN,SACjE,CAAAO,EAAAC,IAAA,MAAA,CACE,cAAA,GAAAC,OAtGQ,aAsG0B,UAClCC,IAAKhB,EACLvB,MAAOA,EAAMC,YAAYmB,EAAMoB,gBAAiBpB,EAAMjB,MACt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