@itwin/grouping-mapping-widget 0.36.0 → 0.37.0
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/lib/cjs/GroupingMappingWidget.js +15 -28
- package/lib/cjs/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMapping.d.ts +1 -2
- package/lib/cjs/WidgetShell/GroupingMapping.js +1 -1
- package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingContent.d.ts +2 -3
- package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/WidgetShell/GroupingMappingHeader.d.ts +0 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js +2 -1
- package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.d.ts +2 -3
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.d.ts +0 -1
- package/lib/cjs/common/hooks/useIsMounted.d.ts +0 -1
- package/lib/cjs/common/hooks/useMemoizedCollectionPick.js +1 -2
- package/lib/cjs/common/hooks/useMemoizedCollectionPick.js.map +1 -1
- package/lib/cjs/common/utils.d.ts +1 -1
- package/lib/cjs/common/utils.js +10 -21
- package/lib/cjs/common/utils.js.map +1 -1
- package/lib/cjs/common/viewerUtils.js.map +1 -1
- package/lib/cjs/components/Constants.js +1 -1
- package/lib/cjs/components/Constants.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +0 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.js +9 -5
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/Editing/GroupDetails.d.ts +0 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.d.ts +0 -1
- package/lib/cjs/components/Groups/Editing/GroupDetailsStep.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupColorLegend.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupListItem.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupListItem.js.map +1 -1
- package/lib/cjs/components/Groups/GroupMenuActions.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/cjs/components/Groups/GroupOverlapProgressBar.d.ts +0 -1
- package/lib/cjs/components/Groups/Groups.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsAddButton.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsView.d.ts +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualizationActions.d.ts +0 -1
- package/lib/cjs/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.d.ts +0 -1
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js +28 -9
- package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js +36 -33
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.d.ts +0 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +0 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +0 -1
- package/lib/cjs/components/Groups/ToggleGroupVisibility.d.ts +0 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.d.ts +0 -1
- package/lib/cjs/components/Groups/hooks/useGroupsOperations.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js +1 -2
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.d.ts +0 -1
- package/lib/cjs/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/cjs/components/Mappings/BlockingOverlay.d.ts +0 -1
- package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +0 -1
- package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js +1 -2
- package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.d.ts +0 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +8 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +0 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +0 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +0 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +0 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +0 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatusIcon.d.ts +1 -2
- package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.d.ts +0 -1
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +1 -2
- package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectIModel.d.ts +0 -1
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.d.ts +0 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.js +1 -1
- package/lib/cjs/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/cjs/components/Mappings/Import/SelectMappings.d.ts +0 -1
- package/lib/cjs/components/Mappings/MappingListItem.d.ts +0 -1
- package/lib/cjs/components/Mappings/MappingListItem.js +1 -2
- package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingViewActionGroup.d.ts +0 -1
- package/lib/cjs/components/Mappings/Mappings.d.ts +1 -2
- package/lib/cjs/components/Mappings/MappingsView.js +1 -1
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +1 -2
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +0 -1
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +0 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +2 -3
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +0 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +17 -4
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.d.ts +0 -1
- package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupColorToggle.d.ts +1 -2
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupInformationPanel.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +4 -6
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/SaveModal.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +0 -1
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyAction.d.ts +0 -1
- package/lib/cjs/components/Properties/PropertyAction.js +7 -3
- package/lib/cjs/components/Properties/PropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenu.d.ts +0 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.d.ts +0 -1
- package/lib/cjs/components/Properties/PropertyNameCell.d.ts +0 -1
- package/lib/cjs/components/Properties/PropertyTable.d.ts +0 -1
- package/lib/cjs/components/Properties/PropertyTableToolbar.d.ts +0 -1
- package/lib/cjs/components/Properties/ScrollableExpandableBlock.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js +2 -2
- package/lib/cjs/components/Properties/hooks/useFormulaValidation.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useForwardRef.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/cjs/components/SharedComponents/ActionPanel.d.ts +0 -1
- package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +0 -1
- package/lib/cjs/components/SharedComponents/EmptyMessage.d.ts +0 -1
- package/lib/cjs/components/SharedComponents/LoadingOverlay.d.ts +0 -1
- package/lib/cjs/components/SharedComponents/LoadingSpinner.d.ts +0 -1
- package/lib/cjs/components/SharedComponents/StatusIcon.d.ts +1 -1
- package/lib/cjs/components/context/ExtractionClientContext.d.ts +0 -1
- package/lib/cjs/components/context/ExtractionClientContext.js.map +1 -1
- package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -1
- package/lib/cjs/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/cjs/components/context/GroupingApiConfigContext.d.ts +2 -2
- package/lib/cjs/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/cjs/components/context/GroupingMappingCustomUIContext.d.ts +0 -1
- package/lib/cjs/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/cjs/components/context/GroupsClientContext.d.ts +0 -1
- package/lib/cjs/components/context/GroupsClientContext.js.map +1 -1
- package/lib/cjs/components/context/IModelsClientContext.d.ts +0 -1
- package/lib/cjs/components/context/IModelsClientContext.js.map +1 -1
- package/lib/cjs/components/context/ITwinsClientContext.d.ts +0 -1
- package/lib/cjs/components/context/ITwinsClientContext.js.map +1 -1
- package/lib/cjs/components/context/MappingClientContext.d.ts +0 -1
- package/lib/cjs/components/context/MappingClientContext.js.map +1 -1
- package/lib/cjs/components/context/PropertiesClientContext.d.ts +0 -1
- package/lib/cjs/components/context/PropertiesClientContext.js.map +1 -1
- package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -1
- package/lib/cjs/components/context/PropertyGridWrapperContext.d.ts +1 -0
- package/lib/cjs/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.d.ts +0 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +2 -1
- package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.d.ts +1 -1
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js +1 -1
- package/lib/cjs/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.d.ts +0 -1
- package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.d.ts +0 -1
- package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/decorators/BboxDimensionsDecorator.d.ts +2 -0
- package/lib/cjs/decorators/BboxDimensionsDecorator.js +80 -29
- package/lib/cjs/decorators/BboxDimensionsDecorator.js.map +1 -1
- package/lib/cjs/formula/FormulaDataTypeResolver.js +1 -2
- package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/FormulaFunctionProvider.js +3 -4
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaOperatorsProvider.js +11 -11
- package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaSplitter.js +1 -2
- package/lib/cjs/formula/FormulaSplitter.js.map +1 -1
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +1 -2
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/InfixToPostfixConverter.js +3 -3
- package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -1
- package/lib/cjs/formula/InputStream.js +3 -2
- package/lib/cjs/formula/InputStream.js.map +1 -1
- package/lib/cjs/formula/ParenthesisValidator.js +3 -3
- package/lib/cjs/formula/ParenthesisValidator.js.map +1 -1
- package/lib/cjs/formula/Queue.js +1 -0
- package/lib/cjs/formula/Queue.js.map +1 -1
- package/lib/cjs/formula/Stack.js +2 -3
- package/lib/cjs/formula/Stack.js.map +1 -1
- package/lib/cjs/formula/StringBuilder.js +1 -0
- package/lib/cjs/formula/StringBuilder.js.map +1 -1
- package/lib/cjs/formula/Types.d.ts +4 -4
- package/lib/cjs/formula/Utils.js +6 -7
- package/lib/cjs/formula/Utils.js.map +1 -1
- package/lib/cjs/test/CalculatedPropertyActionWithVisuals.test.d.ts +2 -0
- package/lib/cjs/test/CalculatedPropertyActionWithVisuals.test.js +137 -0
- package/lib/cjs/test/CalculatedPropertyActionWithVisuals.test.js.map +1 -0
- package/lib/cjs/test/GroupingMappingCustomUI.test.d.ts +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +37 -28
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/MockFactory.d.ts +1 -1
- package/lib/cjs/test/MockFactory.js.map +1 -1
- package/lib/cjs/test/PropertyFieldsHelpers.d.ts +22 -20
- package/lib/cjs/test/QueryBuilder.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.d.ts +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +2 -2
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/setup.d.ts +1 -1
- package/lib/cjs/test/setup.js +1 -0
- package/lib/cjs/test/setup.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +3 -3
- package/lib/cjs/test/test-utils.js +12 -6
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/esm/GroupingMappingWidget.js +15 -28
- package/lib/esm/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMapping.d.ts +1 -2
- package/lib/esm/WidgetShell/GroupingMappingContent.d.ts +2 -3
- package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingHeader.d.ts +0 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.js +2 -1
- package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.d.ts +2 -3
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.d.ts +0 -1
- package/lib/esm/common/hooks/useIsMounted.d.ts +0 -1
- package/lib/esm/common/hooks/useMemoizedCollectionPick.js.map +1 -1
- package/lib/esm/common/utils.d.ts +1 -1
- package/lib/esm/common/utils.js +8 -19
- package/lib/esm/common/utils.js.map +1 -1
- package/lib/esm/common/viewerUtils.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupAction.d.ts +0 -1
- package/lib/esm/components/Groups/Editing/GroupAction.js +9 -5
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/Editing/GroupDetails.d.ts +0 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.d.ts +0 -1
- package/lib/esm/components/Groups/Editing/GroupDetailsStep.d.ts +0 -1
- package/lib/esm/components/Groups/GroupColorLegend.d.ts +0 -1
- package/lib/esm/components/Groups/GroupListItem.d.ts +0 -1
- package/lib/esm/components/Groups/GroupListItem.js.map +1 -1
- package/lib/esm/components/Groups/GroupMenuActions.d.ts +0 -1
- package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
- package/lib/esm/components/Groups/GroupOverlapProgressBar.d.ts +0 -1
- package/lib/esm/components/Groups/Groups.js.map +1 -1
- package/lib/esm/components/Groups/GroupsAddButton.d.ts +0 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.d.ts +0 -1
- package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
- package/lib/esm/components/Groups/GroupsView.d.ts +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.d.ts +0 -1
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualizationActions.d.ts +0 -1
- package/lib/esm/components/Groups/GroupsVisualizationActions.js.map +1 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.d.ts +0 -1
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js +1 -2
- package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js +36 -33
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.d.ts +0 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +0 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +0 -1
- package/lib/esm/components/Groups/ToggleGroupVisibility.d.ts +0 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +1 -1
- package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useGroupsOperations.d.ts +0 -1
- package/lib/esm/components/Groups/hooks/useGroupsOperations.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js +1 -2
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useVisualization.d.ts +0 -1
- package/lib/esm/components/Groups/hooks/useVisualization.js.map +1 -1
- package/lib/esm/components/Mappings/BlockingOverlay.d.ts +0 -1
- package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +0 -1
- package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.d.ts +0 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +8 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +0 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +0 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +0 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +0 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +0 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStatusIcon.d.ts +1 -2
- package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.d.ts +0 -1
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +1 -2
- package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectIModel.d.ts +0 -1
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectITwin.d.ts +0 -1
- package/lib/esm/components/Mappings/Import/SelectITwin.js.map +1 -1
- package/lib/esm/components/Mappings/Import/SelectMappings.d.ts +0 -1
- package/lib/esm/components/Mappings/MappingListItem.d.ts +0 -1
- package/lib/esm/components/Mappings/MappingListItem.js +1 -2
- package/lib/esm/components/Mappings/MappingListItem.js.map +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.d.ts +0 -1
- package/lib/esm/components/Mappings/Mappings.d.ts +1 -2
- package/lib/esm/components/Mappings/MappingsView.js +1 -1
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +1 -2
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +0 -1
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +0 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +2 -3
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +0 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +17 -4
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.d.ts +0 -1
- package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +0 -1
- package/lib/esm/components/Properties/GroupColorToggle.d.ts +1 -2
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupInformationPanel.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +2 -4
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/SaveModal.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +0 -1
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/esm/components/Properties/PropertyAction.d.ts +0 -1
- package/lib/esm/components/Properties/PropertyAction.js +7 -3
- package/lib/esm/components/Properties/PropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenu.d.ts +0 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.d.ts +0 -1
- package/lib/esm/components/Properties/PropertyNameCell.d.ts +0 -1
- package/lib/esm/components/Properties/PropertyTable.d.ts +0 -1
- package/lib/esm/components/Properties/PropertyTableToolbar.d.ts +0 -1
- package/lib/esm/components/Properties/ScrollableExpandableBlock.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useFormulaValidation.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useForwardRef.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useValidator.js.map +1 -1
- package/lib/esm/components/SharedComponents/ActionPanel.d.ts +0 -1
- package/lib/esm/components/SharedComponents/DeleteModal.d.ts +0 -1
- package/lib/esm/components/SharedComponents/EmptyMessage.d.ts +0 -1
- package/lib/esm/components/SharedComponents/LoadingOverlay.d.ts +0 -1
- package/lib/esm/components/SharedComponents/LoadingSpinner.d.ts +0 -1
- package/lib/esm/components/SharedComponents/StatusIcon.d.ts +1 -1
- package/lib/esm/components/context/ExtractionClientContext.d.ts +0 -1
- package/lib/esm/components/context/ExtractionClientContext.js.map +1 -1
- package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -1
- package/lib/esm/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/esm/components/context/GroupingApiConfigContext.d.ts +2 -2
- package/lib/esm/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/esm/components/context/GroupingMappingCustomUIContext.d.ts +0 -1
- package/lib/esm/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/esm/components/context/GroupsClientContext.d.ts +0 -1
- package/lib/esm/components/context/GroupsClientContext.js.map +1 -1
- package/lib/esm/components/context/IModelsClientContext.d.ts +0 -1
- package/lib/esm/components/context/IModelsClientContext.js.map +1 -1
- package/lib/esm/components/context/ITwinsClientContext.d.ts +0 -1
- package/lib/esm/components/context/ITwinsClientContext.js.map +1 -1
- package/lib/esm/components/context/MappingClientContext.d.ts +0 -1
- package/lib/esm/components/context/MappingClientContext.js.map +1 -1
- package/lib/esm/components/context/PropertiesClientContext.d.ts +0 -1
- package/lib/esm/components/context/PropertiesClientContext.js.map +1 -1
- package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -1
- package/lib/esm/components/context/PropertyGridWrapperContext.d.ts +1 -0
- package/lib/esm/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.d.ts +0 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +2 -1
- package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/GroupingMappingCustomUI.d.ts +1 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.d.ts +0 -1
- package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.d.ts +0 -1
- package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/decorators/BboxDimensionsDecorator.d.ts +2 -0
- package/lib/esm/decorators/BboxDimensionsDecorator.js +79 -28
- package/lib/esm/decorators/BboxDimensionsDecorator.js.map +1 -1
- package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/esm/formula/FormulaSplitter.js.map +1 -1
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/esm/formula/InfixToPostfixConverter.js.map +1 -1
- package/lib/esm/formula/InputStream.js +3 -2
- package/lib/esm/formula/InputStream.js.map +1 -1
- package/lib/esm/formula/ParenthesisValidator.js.map +1 -1
- package/lib/esm/formula/Queue.js +1 -0
- package/lib/esm/formula/Queue.js.map +1 -1
- package/lib/esm/formula/Stack.js +2 -3
- package/lib/esm/formula/Stack.js.map +1 -1
- package/lib/esm/formula/StringBuilder.js +1 -0
- package/lib/esm/formula/StringBuilder.js.map +1 -1
- package/lib/esm/formula/Types.d.ts +4 -4
- package/lib/esm/test/CalculatedPropertyActionWithVisuals.test.d.ts +2 -0
- package/lib/esm/test/CalculatedPropertyActionWithVisuals.test.js +132 -0
- package/lib/esm/test/CalculatedPropertyActionWithVisuals.test.js.map +1 -0
- package/lib/esm/test/GroupingMappingCustomUI.test.d.ts +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +37 -28
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/test/MockFactory.d.ts +1 -1
- package/lib/esm/test/MockFactory.js.map +1 -1
- package/lib/esm/test/PropertyFieldsHelpers.d.ts +22 -20
- package/lib/esm/test/QueryBuilder.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.d.ts +1 -1
- package/lib/esm/test/WidgetHeader.test.js +2 -2
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/setup.d.ts +1 -1
- package/lib/esm/test/setup.js +1 -0
- package/lib/esm/test/setup.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +3 -3
- package/lib/esm/test/test-utils.js +3 -2
- package/lib/esm/test/test-utils.js.map +1 -1
- package/package.json +43 -66
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MappingListItem.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingListItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,+CAAgE;AAEhE,qEAAkE;AAClE,wDAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"MappingListItem.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingListItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,+CAAgE;AAEhE,qEAAkE;AAClE,wDAAwD;AACxD,oEAAoF;AACpF,oFAAoF;AACpF,6FAA0F;AAC1F,kCAAgC;AAChC,kFAAkF;AAClF,uDAAuD;AAiBhD,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACG,EAAE,EAAE;IACzB,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAA+B,mCAAgB,CAAC,IAAI,CAAC,CAAC;IAC5G,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,IAAA,wDAA4B,GAAE,CAAC;IACjF,MAAM,wBAAwB,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC/D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,IAAA,iEAA+B,EAAC,EAAE,GAAG,wBAAwB,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACrH,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC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mCAAgB,IACf,KAAK,EAAE,eAAe,EACtB,oBAAoB,EAAE,GAAG,EAAE;gBACzB,kBAAkB,CAAC,mCAAgB,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC,GACiB;QACpB,8BAAC,+CAAsB,IACrB,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,iBAAiB,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,GACtC,CACO,CACZ,CAAC;AACJ,CAAC,CAAC;AA/FW,QAAA,eAAe,mBA+F1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { Mapping } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type { BeEvent } from \"@itwin/core-bentley\";\nimport { MappingViewActionGroup } from \"./MappingViewActionGroup\";\nimport { Anchor, ListItem } from \"@itwin/itwinui-react\";\nimport { ExtractionStates , ExtractionStatus } from \"./Extraction/ExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useFetchMappingExtractionStatus } from \"./hooks/useFetchMappingExtractionStatus\";\nimport \"./MappingListItem.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nexport interface MappingListItemProps {\n selected: boolean;\n mapping: Mapping;\n jobId: string;\n jobStartEvent: BeEvent<(mappingId: string) => void>;\n onSelectionChange?: (mapping: Mapping) => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n onRefreshMappings: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n setShowDeleteModal: (mapping?: Mapping) => void;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n}\n\nexport const MappingListItem = ({\n selected,\n onSelectionChange,\n mapping,\n jobId,\n jobStartEvent,\n onClickMappingModify,\n onClickMappingTitle,\n onRefreshMappings,\n onToggleExtraction,\n setShowDeleteModal,\n}: MappingListItemProps) => {\n const [extractionState, setExtractionState] = useState<ExtractionStates | undefined>(ExtractionStates.None);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const statusQuery = useFetchMappingExtractionStatus({ ...groupingMappingApiConfig, mapping, enabled: isJobStarted });\n const queryClient = useQueryClient();\n\n const onClickTile = useCallback(() => {\n onSelectionChange && onSelectionChange(mapping);\n }, [mapping, onSelectionChange]);\n\n // Check whether the job is still running when users refresh the mapping list\n // or modify any mappings\n useEffect(() => {\n if (mappingIdJobInfo.get(mapping.id)) {\n setIsJobStarted(true);\n }\n }, [mappingIdJobInfo, mapping.id]);\n\n const resolveTerminalExtractionStatus = useCallback(async () => {\n const state = statusQuery.data!.finalExtractionStateValue;\n if (state === ExtractionStates.Failed || state === ExtractionStates.Succeeded) {\n setIsJobStarted(false);\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.delete(mapping.id);\n return newMap;\n });\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n }\n }, [mapping.id, queryClient, setMappingIdJobInfo, statusQuery.data]);\n\n useEffect(() => {\n const listener = (startedMappingId: string) => {\n if (startedMappingId === mapping.id) {\n setExtractionState(ExtractionStates.Starting);\n setIsJobStarted(true);\n }\n };\n jobStartEvent.addListener(listener);\n\n return () => {\n jobStartEvent.removeListener(listener);\n };\n }, [jobStartEvent, mapping.id, jobId]);\n\n useEffect(() => {\n const isStatusReady = statusQuery.data && statusQuery.isFetched;\n if (isStatusReady) {\n setExtractionState(statusQuery.data.finalExtractionStateValue);\n // No need to await. We don't need to wait for the status to be resolved in invalidation.\n void resolveTerminalExtractionStatus();\n }\n }, [resolveTerminalExtractionStatus, statusQuery]);\n\n return (\n <ListItem\n actionable={!!onSelectionChange}\n className=\"gmw-mapping-list-item\"\n active={selected}\n key={mapping.id}\n onClick={onClickTile}\n title={mapping.mappingName}\n >\n <ListItem.Content>\n {onClickMappingTitle ? <Anchor onClick={() => onClickMappingTitle(mapping)}>{mapping.mappingName}</Anchor> : mapping.mappingName}\n <ListItem.Description>{mapping.description}</ListItem.Description>\n </ListItem.Content>\n <ExtractionStatus\n state={extractionState}\n clearExtractionState={() => {\n setExtractionState(ExtractionStates.None);\n }}\n ></ExtractionStatus>\n <MappingViewActionGroup\n mapping={mapping}\n onToggleExtraction={onToggleExtraction}\n onRefresh={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n </ListItem>\n );\n};\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { Mapping } from "@itwin/insights-client";
|
|
3
2
|
import type { CreateTypeFromInterface } from "../../common/utils";
|
|
4
3
|
import type { getMappingViewDefaultDisplayStrings } from "./MappingsView";
|
|
5
|
-
export
|
|
4
|
+
export type IMappingTyped = CreateTypeFromInterface<Mapping>;
|
|
6
5
|
/**
|
|
7
6
|
* Props for the {@link Mappings} component.
|
|
8
7
|
* @public
|
|
@@ -108,7 +108,7 @@ const MappingsView = ({ mappings, isLoading, extractionStatusData, showExtractio
|
|
|
108
108
|
alert,
|
|
109
109
|
react_1.default.createElement("div", { className: "gmw-mappings-border" }),
|
|
110
110
|
isLoading && !isTogglingExtraction ? (react_1.default.createElement(LoadingOverlay_1.LoadingOverlay, null)) : mappings.length === 0 ? (react_1.default.createElement(EmptyMessage_1.EmptyMessage, { message: GroupingMappingWidget_1.GroupingMappingWidget.translate("mappings.noMappings", { mappings: displayStrings.mappings }) })) : (react_1.default.createElement(itwinui_react_1.List, { className: "gmw-mappings-list" }, mappings.map((mapping) => (react_1.default.createElement(MappingListItem_1.MappingListItem, { key: mapping.id, mapping: mapping, jobId: mappingIdJobInfo?.get(mapping.id) ?? "", jobStartEvent: jobStartEvent, onClickMappingTitle: onClickMappingTitle, onSelectionChange: onSelectionChange, selected: selectedMappings.some((eachMapping) => mapping.id === eachMapping.id), onToggleExtraction: onToggleExtraction, onRefreshMappings: onRefreshMappings, onClickMappingModify: onClickMappingModify, setShowDeleteModal: setShowDeleteModal })))))),
|
|
111
|
-
showExtractionMessageModal && (react_1.default.createElement(ExtractionMessageModal_1.ExtractionMessageModal, { isOpen: showExtractionMessageModal, onClose: () => setShowExtractionMessageModal(false), extractionMessageData: extractionMessageData, timestamp: extractionMessageData.length
|
|
111
|
+
showExtractionMessageModal && (react_1.default.createElement(ExtractionMessageModal_1.ExtractionMessageModal, { isOpen: showExtractionMessageModal, onClose: () => setShowExtractionMessageModal(false), extractionMessageData: extractionMessageData, timestamp: extractionMessageData.find((data) => data.date?.trim().length > 0)?.date ?? "" })),
|
|
112
112
|
showDeleteModal && (react_1.default.createElement(DeleteModal_1.default, { entityName: showDeleteModal?.mappingName, onClose: () => setShowDeleteModal(undefined), onDelete: async () => {
|
|
113
113
|
await onDelete(showDeleteModal);
|
|
114
114
|
} })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MappingsView.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAA8D;AAE9D,wDAAgE;AAChE,oEAAoF;AACpF,uEAAoE;AACpE,mEAAgE;AAChE,uEAAoE;AACpE,+BAA6B;AAC7B,kFAA0D;AAC1D,gFAA6E;AAE7E,uDAAoD;AAEpD,4EAAyE;AACzE,uDAAoD;AAEpD,gFAA6E;AAC7E,sDAA8C;AAC9C,oFAAoF;AACpF,kFAAkF;AAClF,+DAA4D;AAErD,MAAM,mCAAmC,GAAG,GAA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C,EACnD,qBAAqB,EAAE,qBAAqB,EAC5C,SAAS,EAAE,qBAAqB,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,GAClF,CACH;QACA,eAAe,IAAI,CAClB,8BAAC,qBAAW,IACV,UAAU,EAAE,eAAe,EAAE,WAAW,EACxC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAC5C,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACnB,MAAM,QAAQ,CAAC,eAAe,CAAC,CAAC;YAClC,CAAC,GACD,CACH;QACA,eAAe,IAAI,kBAAkB,IAAI,CACxC,8BAAC,mDAAwB,IAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,GAAI,CAC9I,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,YAAY,gBAwIvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Alert } from \"@itwin/itwinui-react\";\nimport { Button, IconButton, List } from \"@itwin/itwinui-react\";\nimport { SvgAdd, SvgImport, SvgPlay, SvgRefresh } from \"@itwin/itwinui-icons-react\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\nimport { EmptyMessage } from \"../SharedComponents/EmptyMessage\";\nimport { LoadingOverlay } from \"../SharedComponents/LoadingOverlay\";\nimport \"./MappingsView.scss\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { MappingImportWizardModal } from \"./Import/MappingImportWizardModal\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { BlockingOverlay } from \"./BlockingOverlay\";\nimport type { ExtractionStatusData } from \"./Extraction/ExtractionStatusIcon\";\nimport { ExtractionStatusIcon } from \"./Extraction/ExtractionStatusIcon\";\nimport { MappingListItem } from \"./MappingListItem\";\nimport type { ExtractionMessageData } from \"./Extraction/ExtractionMessageModal\";\nimport { ExtractionMessageModal } from \"./Extraction/ExtractionMessageModal\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useRunExtraction } from \"./hooks/useRunExtraction\";\n\nexport const getMappingViewDefaultDisplayStrings = () => ({\n mappings: GroupingMappingWidget.translate(\"mappings.mappings\"),\n iTwins: \"iTwins\",\n iTwinNumber: GroupingMappingWidget.translate(\"common.number\"),\n iTwinName: GroupingMappingWidget.translate(\"common.name\"),\n iTwinStatus: GroupingMappingWidget.translate(\"common.status\"),\n iModels: \"iModels\",\n iModelName: GroupingMappingWidget.translate(\"common.name\"),\n iModelDescription: GroupingMappingWidget.translate(\"common.description\"),\n});\n\n/**\n * @internal\n */\nexport interface MappingsViewProps {\n mappings: Mapping[];\n isLoading: boolean;\n extractionStatusData: ExtractionStatusData;\n showExtractionMessageModal: boolean;\n extractionMessageData: ExtractionMessageData[];\n setShowExtractionMessageModal: (show: boolean) => void;\n isTogglingExtraction: boolean;\n onRefreshMappings: () => Promise<void>;\n onRefreshExtractionStatus: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n onDelete: (mapping: Mapping) => Promise<void>;\n showDeleteModal: Mapping | undefined;\n setShowDeleteModal: (mapping?: Mapping) => void;\n displayStrings?: Partial<ReturnType<typeof getMappingViewDefaultDisplayStrings>>;\n showImportModal?: boolean;\n setShowImportModal?: (show: boolean) => void;\n onClickAddMapping?: () => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n alert?: React.ReactElement<typeof Alert>;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n hideRefreshIcon?: boolean;\n}\n\n/**\n * UI Component to list mappings and handle extraction.\n * @internal\n */\nexport const MappingsView = ({\n mappings,\n isLoading,\n extractionStatusData,\n showExtractionMessageModal,\n extractionMessageData,\n setShowExtractionMessageModal,\n isTogglingExtraction,\n onRefreshMappings,\n onRefreshExtractionStatus,\n onToggleExtraction,\n onDelete,\n showDeleteModal,\n setShowDeleteModal,\n displayStrings: userDisplayStrings,\n showImportModal,\n setShowImportModal,\n onClickAddMapping,\n onClickMappingTitle,\n onClickMappingModify,\n alert,\n hideRefreshIcon,\n}: MappingsViewProps) => {\n const displayStrings = React.useMemo(() => ({ ...getMappingViewDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const { runExtraction } = useRunExtraction(groupingMappingApiConfig);\n\n const jobStartEvent = useMemo(() => new BeEvent<(mappingId: string) => void>(), []);\n\n const refreshAll = useCallback(async () => {\n await Promise.all([onRefreshMappings(), onRefreshExtractionStatus()]);\n }, [onRefreshMappings, onRefreshExtractionStatus]);\n\n const onSelectionChange = (mapping: Mapping) => {\n setSelectedMappings((mappingIdList) => {\n return mappingIdList.some((eachId) => mapping.id === eachId.id)\n ? mappingIdList.filter((eachId) => mapping.id !== eachId.id)\n : [...mappingIdList, mapping];\n });\n };\n\n const onRunExtraction = useCallback(async () => {\n await runExtraction(selectedMappings);\n selectedMappings.map((mapping) => {\n jobStartEvent.raiseEvent(mapping.id);\n });\n setSelectedMappings([]);\n }, [selectedMappings, jobStartEvent, runExtraction]);\n\n return (\n <>\n <BlockingOverlay isVisible={isTogglingExtraction} />\n <div className=\"gmw-mappings-view-container\">\n <div className=\"gmw-table-toolbar\">\n <div className=\"gmw-button-spacing\">\n {onClickAddMapping && (\n <Button startIcon={<SvgAdd />} onClick={onClickAddMapping} styleType=\"high-visibility\" title={GroupingMappingWidget.translate(\"mappings.newMapping\")}>\n {GroupingMappingWidget.translate(\"common.new\")}\n </Button>\n )}\n {showImportModal !== undefined && setShowImportModal && (\n <IconButton title={GroupingMappingWidget.translate(\"mappings.importMappings\", { mappings: displayStrings.mappings })} onClick={() => setShowImportModal(true)}>\n <SvgImport />\n </IconButton>\n )}\n <IconButton title={GroupingMappingWidget.translate(\"mappings.runExtraction\")} onClick={onRunExtraction} disabled={selectedMappings.length === 0}>\n <SvgPlay />\n </IconButton>\n </div>\n <div className=\"gmw-button-spacing\">\n <ExtractionStatusIcon\n iconStatus={extractionStatusData.iconStatus}\n onClick={() => {\n if (extractionStatusData.iconStatus === \"negative\") {\n setShowExtractionMessageModal(true);\n }\n }}\n iconMessage={extractionStatusData.iconMessage}\n />\n {!hideRefreshIcon && (\n <IconButton title={GroupingMappingWidget.translate(\"common.refresh\")} onClick={refreshAll} disabled={isLoading} styleType=\"borderless\">\n <SvgRefresh />\n </IconButton>\n )}\n </div>\n </div>\n {alert}\n <div className=\"gmw-mappings-border\" />\n {isLoading && !isTogglingExtraction ? (\n <LoadingOverlay />\n ) : mappings.length === 0 ? (\n <EmptyMessage message={GroupingMappingWidget.translate(\"mappings.noMappings\", { mappings: displayStrings.mappings })} />\n ) : (\n <List className=\"gmw-mappings-list\">\n {mappings.map((mapping) => (\n <MappingListItem\n key={mapping.id}\n mapping={mapping}\n jobId={mappingIdJobInfo?.get(mapping.id) ?? \"\"}\n jobStartEvent={jobStartEvent}\n onClickMappingTitle={onClickMappingTitle}\n onSelectionChange={onSelectionChange}\n selected={selectedMappings.some((eachMapping) => mapping.id === eachMapping.id)}\n onToggleExtraction={onToggleExtraction}\n onRefreshMappings={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n ))}\n </List>\n )}\n </div>\n {showExtractionMessageModal && (\n <ExtractionMessageModal\n isOpen={showExtractionMessageModal}\n onClose={() => setShowExtractionMessageModal(false)}\n extractionMessageData={extractionMessageData}\n timestamp={extractionMessageData.length === 0 ? \"\" : extractionMessageData[0].date}\n />\n )}\n {showDeleteModal && (\n <DeleteModal\n entityName={showDeleteModal?.mappingName}\n onClose={() => setShowDeleteModal(undefined)}\n onDelete={async () => {\n await onDelete(showDeleteModal);\n }}\n />\n )}\n {showImportModal && setShowImportModal && (\n <MappingImportWizardModal show={showImportModal} setShow={setShowImportModal} onFinish={onRefreshMappings} displayStrings={displayStrings} />\n )}\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"MappingsView.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAA8D;AAE9D,wDAAgE;AAChE,oEAAoF;AACpF,uEAAoE;AACpE,mEAAgE;AAChE,uEAAoE;AACpE,+BAA6B;AAC7B,kFAA0D;AAC1D,gFAA6E;AAE7E,uDAAoD;AAEpD,4EAAyE;AACzE,uDAAoD;AAEpD,gFAA6E;AAC7E,sDAA8C;AAC9C,oFAAoF;AACpF,kFAAkF;AAClF,+DAA4D;AAErD,MAAM,mCAAmC,GAAG,GAAG,EAAE,CAAC,CAAC;IACxD,QAAQ,EAAE,6CAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC;IAC9D,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,eAAe,CAAC;IAC7D,SAAS,EAAE,6CAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,eAAe,CAAC;IAC7D,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,6CAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;IAC1D,iBAAiB,EAAE,6CAAqB,CAAC,SAAS,CAAC,oBAAoB,CAAC;CACzE,CAAC,CAAC;AATU,QAAA,mCAAmC,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QACA,eAAe,IAAI,kBAAkB,IAAI,CACxC,8BAAC,mDAAwB,IAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,GAAI,CAC9I,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,YAAY,gBAwIvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Alert } from \"@itwin/itwinui-react\";\nimport { Button, IconButton, List } from \"@itwin/itwinui-react\";\nimport { SvgAdd, SvgImport, SvgPlay, SvgRefresh } from \"@itwin/itwinui-icons-react\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\nimport { EmptyMessage } from \"../SharedComponents/EmptyMessage\";\nimport { LoadingOverlay } from \"../SharedComponents/LoadingOverlay\";\nimport \"./MappingsView.scss\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { MappingImportWizardModal } from \"./Import/MappingImportWizardModal\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { BlockingOverlay } from \"./BlockingOverlay\";\nimport type { ExtractionStatusData } from \"./Extraction/ExtractionStatusIcon\";\nimport { ExtractionStatusIcon } from \"./Extraction/ExtractionStatusIcon\";\nimport { MappingListItem } from \"./MappingListItem\";\nimport type { ExtractionMessageData } from \"./Extraction/ExtractionMessageModal\";\nimport { ExtractionMessageModal } from \"./Extraction/ExtractionMessageModal\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useRunExtraction } from \"./hooks/useRunExtraction\";\n\nexport const getMappingViewDefaultDisplayStrings = () => ({\n mappings: GroupingMappingWidget.translate(\"mappings.mappings\"),\n iTwins: \"iTwins\",\n iTwinNumber: GroupingMappingWidget.translate(\"common.number\"),\n iTwinName: GroupingMappingWidget.translate(\"common.name\"),\n iTwinStatus: GroupingMappingWidget.translate(\"common.status\"),\n iModels: \"iModels\",\n iModelName: GroupingMappingWidget.translate(\"common.name\"),\n iModelDescription: GroupingMappingWidget.translate(\"common.description\"),\n});\n\n/**\n * @internal\n */\nexport interface MappingsViewProps {\n mappings: Mapping[];\n isLoading: boolean;\n extractionStatusData: ExtractionStatusData;\n showExtractionMessageModal: boolean;\n extractionMessageData: ExtractionMessageData[];\n setShowExtractionMessageModal: (show: boolean) => void;\n isTogglingExtraction: boolean;\n onRefreshMappings: () => Promise<void>;\n onRefreshExtractionStatus: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n onDelete: (mapping: Mapping) => Promise<void>;\n showDeleteModal: Mapping | undefined;\n setShowDeleteModal: (mapping?: Mapping) => void;\n displayStrings?: Partial<ReturnType<typeof getMappingViewDefaultDisplayStrings>>;\n showImportModal?: boolean;\n setShowImportModal?: (show: boolean) => void;\n onClickAddMapping?: () => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n alert?: React.ReactElement<typeof Alert>;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n hideRefreshIcon?: boolean;\n}\n\n/**\n * UI Component to list mappings and handle extraction.\n * @internal\n */\nexport const MappingsView = ({\n mappings,\n isLoading,\n extractionStatusData,\n showExtractionMessageModal,\n extractionMessageData,\n setShowExtractionMessageModal,\n isTogglingExtraction,\n onRefreshMappings,\n onRefreshExtractionStatus,\n onToggleExtraction,\n onDelete,\n showDeleteModal,\n setShowDeleteModal,\n displayStrings: userDisplayStrings,\n showImportModal,\n setShowImportModal,\n onClickAddMapping,\n onClickMappingTitle,\n onClickMappingModify,\n alert,\n hideRefreshIcon,\n}: MappingsViewProps) => {\n const displayStrings = React.useMemo(() => ({ ...getMappingViewDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const { runExtraction } = useRunExtraction(groupingMappingApiConfig);\n\n const jobStartEvent = useMemo(() => new BeEvent<(mappingId: string) => void>(), []);\n\n const refreshAll = useCallback(async () => {\n await Promise.all([onRefreshMappings(), onRefreshExtractionStatus()]);\n }, [onRefreshMappings, onRefreshExtractionStatus]);\n\n const onSelectionChange = (mapping: Mapping) => {\n setSelectedMappings((mappingIdList) => {\n return mappingIdList.some((eachId) => mapping.id === eachId.id)\n ? mappingIdList.filter((eachId) => mapping.id !== eachId.id)\n : [...mappingIdList, mapping];\n });\n };\n\n const onRunExtraction = useCallback(async () => {\n await runExtraction(selectedMappings);\n selectedMappings.map((mapping) => {\n jobStartEvent.raiseEvent(mapping.id);\n });\n setSelectedMappings([]);\n }, [selectedMappings, jobStartEvent, runExtraction]);\n\n return (\n <>\n <BlockingOverlay isVisible={isTogglingExtraction} />\n <div className=\"gmw-mappings-view-container\">\n <div className=\"gmw-table-toolbar\">\n <div className=\"gmw-button-spacing\">\n {onClickAddMapping && (\n <Button startIcon={<SvgAdd />} onClick={onClickAddMapping} styleType=\"high-visibility\" title={GroupingMappingWidget.translate(\"mappings.newMapping\")}>\n {GroupingMappingWidget.translate(\"common.new\")}\n </Button>\n )}\n {showImportModal !== undefined && setShowImportModal && (\n <IconButton title={GroupingMappingWidget.translate(\"mappings.importMappings\", { mappings: displayStrings.mappings })} onClick={() => setShowImportModal(true)}>\n <SvgImport />\n </IconButton>\n )}\n <IconButton title={GroupingMappingWidget.translate(\"mappings.runExtraction\")} onClick={onRunExtraction} disabled={selectedMappings.length === 0}>\n <SvgPlay />\n </IconButton>\n </div>\n <div className=\"gmw-button-spacing\">\n <ExtractionStatusIcon\n iconStatus={extractionStatusData.iconStatus}\n onClick={() => {\n if (extractionStatusData.iconStatus === \"negative\") {\n setShowExtractionMessageModal(true);\n }\n }}\n iconMessage={extractionStatusData.iconMessage}\n />\n {!hideRefreshIcon && (\n <IconButton title={GroupingMappingWidget.translate(\"common.refresh\")} onClick={refreshAll} disabled={isLoading} styleType=\"borderless\">\n <SvgRefresh />\n </IconButton>\n )}\n </div>\n </div>\n {alert}\n <div className=\"gmw-mappings-border\" />\n {isLoading && !isTogglingExtraction ? (\n <LoadingOverlay />\n ) : mappings.length === 0 ? (\n <EmptyMessage message={GroupingMappingWidget.translate(\"mappings.noMappings\", { mappings: displayStrings.mappings })} />\n ) : (\n <List className=\"gmw-mappings-list\">\n {mappings.map((mapping) => (\n <MappingListItem\n key={mapping.id}\n mapping={mapping}\n jobId={mappingIdJobInfo?.get(mapping.id) ?? \"\"}\n jobStartEvent={jobStartEvent}\n onClickMappingTitle={onClickMappingTitle}\n onSelectionChange={onSelectionChange}\n selected={selectedMappings.some((eachMapping) => mapping.id === eachMapping.id)}\n onToggleExtraction={onToggleExtraction}\n onRefreshMappings={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n ))}\n </List>\n )}\n </div>\n {showExtractionMessageModal && (\n <ExtractionMessageModal\n isOpen={showExtractionMessageModal}\n onClose={() => setShowExtractionMessageModal(false)}\n extractionMessageData={extractionMessageData}\n timestamp={extractionMessageData.find((data) => data.date?.trim().length > 0)?.date ?? \"\"}\n />\n )}\n {showDeleteModal && (\n <DeleteModal\n entityName={showDeleteModal?.mappingName}\n onClose={() => setShowDeleteModal(undefined)}\n onDelete={async () => {\n await onDelete(showDeleteModal);\n }}\n />\n )}\n {showImportModal && setShowImportModal && (\n <MappingImportWizardModal show={showImportModal} setShow={setShowImportModal} onFinish={onRefreshMappings} displayStrings={displayStrings} />\n )}\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,4DAAyD;AACzD,uDAAiD;AAIjD,0EAAuE;AAEhE,MAAM,wBAAwB,GAAG,CAAC,EACvC,QAAQ,EACR,cAAc,EACd,gBAAgB,GAKjB,EAAE,EAAE;IACH,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC;QAC9C,SAAS,EAAE,QAAQ;QACnB,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,gBAAgB,CAAC,4BAA4B,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC3F,MAAM,sBAAsB,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;YAEvD,IAAI,oBAA0C,CAAC;YAC/C,IAAI,qBAAqB,GAA4B,EAAE,CAAC;YAExD,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,KAAK,EAAE,EAAE,CAAC;YAClE,IAAI,eAA6C,CAAC;YAClD,IAAI,wBAAwB,EAAE;
|
|
1
|
+
{"version":3,"file":"useFetchExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,4DAAyD;AACzD,uDAAiD;AAIjD,0EAAuE;AAEhE,MAAM,wBAAwB,GAAG,CAAC,EACvC,QAAQ,EACR,cAAc,EACd,gBAAgB,GAKjB,EAAE,EAAE;IACH,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC;QAC9C,SAAS,EAAE,QAAQ;QACnB,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,WAAW,GAAG,MAAM,cAAc,EAA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,UAAU;wBACtB,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,6BAA6B,CAAC;qBAC5E,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,oBAAoB,GAAG;wBACrB,UAAU,EAAE,UAAU;wBACtB,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,iCAAiC,CAAC;qBAChF,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC;QACjF,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AA1DW,QAAA,wBAAwB,4BA0DnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { ExtractionStatus, IExtractionClient } from \"@itwin/insights-client\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport type { ExtractionMessageData } from \"../Extraction/ExtractionMessageModal\";\nimport type { ExtractionStatusData } from \"../Extraction/ExtractionStatusIcon\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nexport const useFetchExtractionStatus = ({\n iModelId,\n getAccessToken,\n extractionClient,\n}: {\n iModelId: string;\n getAccessToken: GetAccessTokenFn;\n extractionClient: IExtractionClient;\n}) => {\n return useQuery({\n queryKey: [\"iModelExtractionStatus\", iModelId],\n staleTime: Infinity,\n placeholderData: undefined,\n queryFn: async () => {\n const accessToken = await getAccessToken();\n const extraction = extractionClient.getIModelExtractionsIterator(accessToken, iModelId, 1);\n const latestExtractionResult = await extraction.next();\n\n let extractionStatusIcon: ExtractionStatusData;\n let extractionMessageData: ExtractionMessageData[] = [];\n\n const latestExtractionResultId = latestExtractionResult.value?.id;\n let latestJobStatus: ExtractionStatus | undefined;\n if (latestExtractionResultId) {\n latestJobStatus = latestExtractionResult.value;\n }\n\n if (latestExtractionResult.done) {\n extractionStatusIcon = {\n iconStatus: \"negative\",\n iconMessage: GroupingMappingWidget.translate(\"extraction.noExtraction\"),\n };\n } else {\n if (latestJobStatus?.state === ExtractionState.PartiallySucceeded || latestJobStatus?.state === ExtractionState.Failed) {\n const logs = await extractionClient.getExtractionLogs(accessToken, latestExtractionResultId);\n extractionMessageData = logs.logs\n .filter((log) => log.message !== null)\n .map((log) => ({\n date: log.dateTime,\n category: log.category,\n level: log.level,\n message: log.message ?? \"\",\n }));\n extractionStatusIcon = {\n iconStatus: \"negative\",\n iconMessage: GroupingMappingWidget.translate(\"extraction.extractionIssues\"),\n };\n } else {\n extractionStatusIcon = {\n iconStatus: \"positive\",\n iconMessage: GroupingMappingWidget.translate(\"extraction.extractionSuccessful\"),\n };\n }\n }\n\n return { extractionStatusIcon, extractionMessageData, latestExtractionResult };\n },\n });\n};\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { QueryClient } from "@tanstack/react-query";
|
|
2
|
-
import type { IExtractionClient } from "@itwin/insights-client";
|
|
3
|
-
import type { Mapping } from "@itwin/insights-client";
|
|
2
|
+
import type { IExtractionClient, Mapping } from "@itwin/insights-client";
|
|
4
3
|
import { ExtractionStates } from "../Extraction/ExtractionStatus";
|
|
5
4
|
import type { GetAccessTokenFn, GroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
|
|
6
5
|
export interface MappingExtractionStatusProps extends GroupingMappingApiConfig {
|
|
@@ -47,7 +47,7 @@ const useFetchMappingExtractionStatus = ({ getAccessToken, mapping, enabled }) =
|
|
|
47
47
|
// This should not happen as jobId should be defined if enabled is true
|
|
48
48
|
throw new Error("Job ID is undefined");
|
|
49
49
|
},
|
|
50
|
-
enabled: enabled && Boolean(jobId),
|
|
50
|
+
enabled: enabled && Boolean(jobId), // Only enable the query if enabled is true and jobId is defined
|
|
51
51
|
refetchInterval: Constants_1.STATUS_CHECK_INTERVAL,
|
|
52
52
|
});
|
|
53
53
|
return statusQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchMappingExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchMappingExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAEjD,4DAAyD;
|
|
1
|
+
{"version":3,"file":"useFetchMappingExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchMappingExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAEjD,4DAAyD;AACzD,+CAAwD;AACxD,qEAAkE;AAElE,mFAA4E;AAC5E,uFAAuF;AAYhF,MAAM,kBAAkB,GAAG,KAAK,EAAE,SAAiB,EAAE,KAAa,EAAE,cAAgC,EAAE,gBAAmC,EAAE,EAAE;IAClJ,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAE3C,MAAM,wBAAwB,GAAG,CAAC,wBAA0C,EAAE,EAAE;QAC9E,QAAQ,wBAAwB,CAAC,KAAK,EAAE,CAAC;YACvC,KAAK,SAAS;gBACZ,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,QAAQ,EAAE,CAAC;YAC7E,KAAK,iCAAe,CAAC,OAAO;gBAC1B,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,OAAO,EAAE,CAAC;YAC5E,KAAK,iCAAe,CAAC,MAAM;gBACzB,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,MAAM,EAAE,CAAC;YAC3E,KAAK,iCAAe,CAAC,MAAM;gBACzB,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,MAAM,EAAE,CAAC;YAC3E,KAAK,iCAAe,CAAC,SAAS,CAAC;YAC/B,KAAK,iCAAe,CAAC,kBAAkB;gBACrC,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,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EAAgE;QACpG,eAAe,EAAE,iCAAqB;KACvC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAnBW,QAAA,+BAA+B,mCAmB1C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { QueryClient } from \"@tanstack/react-query\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ExtractionStatus, IExtractionClient , Mapping } from \"@itwin/insights-client\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport { STATUS_CHECK_INTERVAL } from \"../../Constants\";\nimport { ExtractionStates } from \"../Extraction/ExtractionStatus\";\nimport type { GetAccessTokenFn, GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\nexport interface MappingExtractionStatusProps extends GroupingMappingApiConfig {\n mapping: Mapping;\n enabled: boolean;\n}\n\nexport interface MappingQueryResult {\n mappingId: string;\n finalExtractionStateValue: ExtractionStates;\n}\n\nexport const fetchMappingStatus = async (mappingId: string, jobId: string, getAccessToken: GetAccessTokenFn, extractionClient: IExtractionClient) => {\n const accessToken = await getAccessToken();\n\n const getFinalExtractionStatus = (extractionStatusResponse: ExtractionStatus) => {\n switch (extractionStatusResponse.state) {\n case undefined:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Starting };\n case ExtractionState.Running:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Running };\n case ExtractionState.Failed:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Failed };\n case ExtractionState.Queued:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Queued };\n case ExtractionState.Succeeded:\n case ExtractionState.PartiallySucceeded:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Succeeded };\n default:\n return { mappingId, finalExtractionStateValue: ExtractionStates.None };\n }\n };\n const extractionStatusResponse = await extractionClient.getExtractionStatus(accessToken, jobId);\n return getFinalExtractionStatus(extractionStatusResponse);\n};\n\nexport const resetMappingExtractionStatus = async (queryClient: QueryClient) => {\n await queryClient.invalidateQueries({ queryKey: [\"extractionState\"] });\n};\n\nexport const useFetchMappingExtractionStatus = ({ getAccessToken, mapping, enabled }: MappingExtractionStatusProps) => {\n const extractionClient = useExtractionClient();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const jobId = mappingIdJobInfo.get(mapping.id);\n\n const statusQuery = useQuery<MappingQueryResult>({\n queryKey: [\"extractionState\", jobId],\n queryFn: async () => {\n if (jobId) {\n return fetchMappingStatus(mapping.id, jobId, getAccessToken, extractionClient);\n }\n // This should not happen as jobId should be defined if enabled is true\n throw new Error(\"Job ID is undefined\");\n },\n enabled: enabled && Boolean(jobId), // Only enable the query if enabled is true and jobId is defined\n refetchInterval: STATUS_CHECK_INTERVAL,\n });\n\n return statusQuery;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMappingsOperations.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useMappingsOperations.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,iCAAyD;AACzD,4DAAyD;AAGzD,mFAA4E;AAC5E,uDAAoE;AACpE,yDAAsD;AACtD,yEAAsE;AACtE,uFAAuF;AACvF,0EAAuE;AAUvE;;;GAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAA2B,EAAE,EAAE;IAC5G,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAsB,KAAK,CAAC,CAAC;IACnF,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAsB,SAAS,CAAC,CAAC;IACvF,MAAM,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C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BAAqB,EAAE,EAAE;SAC1B;QACH,CAAC,CAAC,gBAAgB,CAAC;IAEvB,OAAO;QACL,QAAQ;QACR,SAAS;QACT,0BAA0B;QAC1B,gBAAgB,EAAE,qBAAqB;QACvC,6BAA6B;QAC7B,eAAe;QACf,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;QACR,kBAAkB;QAClB,eAAe;QACf,kBAAkB;QAClB,eAAe;QACf,oBAAoB;KACrB,CAAC;AACJ,CAAC,CAAC;AA5FW,QAAA,qBAAqB,yBA4FhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useCallback, useEffect, useState } from \"react\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport type { IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport type { GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useFetchMappings } from \"./useFetchMappings\";\nimport { useFetchExtractionStatus } from \"./useFetchExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * Props for the {@link useMappingsOperations} hook.\n * @internal\n */\nexport interface MappingsOperationsProps extends GroupingMappingApiConfig {\n mappingClient: IMappingsClient;\n}\n\n/**\n * Custom hook to handle mapping operations.\n * @internal\n */\nexport const useMappingsOperations = ({ iModelId, getAccessToken, mappingClient }: MappingsOperationsProps) => {\n const [showImportModal, setShowImportModal] = useState<boolean | undefined>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<Mapping | undefined>(undefined);\n const extractionClient = useExtractionClient();\n const [showExtractionMessageModal, setShowExtractionMessageModal] = useState<boolean>(false);\n const queryClient = useQueryClient();\n const [initialStateExtractionFlag, setInitialExtractionStateFlag] = useState<boolean>(true);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n\n const { data: mappings, isFetched: isMappingsFetched, isFetching: isLoadingMappings } = useFetchMappings(iModelId, getAccessToken, mappingClient);\n\n const {\n data: extractionStatus,\n isFetched: isExtractionStatusFetched,\n isFetching: isLoadingExtractionStatus,\n } = useFetchExtractionStatus({ iModelId, getAccessToken, extractionClient });\n\n const refreshExtractionStatus = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n setInitialExtractionStateFlag(false);\n }, [queryClient]);\n\n useEffect(() => {\n if (initialStateExtractionFlag && isMappingsFetched && isExtractionStatusFetched && mappings && extractionStatus && !mappingIdJobInfo.size) {\n const newMappingIdJobInfo = new Map<string, string>();\n const latestExtractionResultId = extractionStatus.latestExtractionResult.value?.id;\n const state = extractionStatus.latestExtractionResult.value?.state;\n if (state === ExtractionState.Failed || state === ExtractionState.Succeeded || state === ExtractionState.PartiallySucceeded) return;\n !!latestExtractionResultId &&\n mappings.forEach((mapping) => {\n const mappingId = mapping.id;\n const latestExtractionResultId = extractionStatus.latestExtractionResult.value.id;\n newMappingIdJobInfo.set(mappingId, latestExtractionResultId);\n });\n setMappingIdJobInfo(newMappingIdJobInfo);\n setInitialExtractionStateFlag(false);\n }\n }, [extractionStatus, initialStateExtractionFlag, isExtractionStatusFetched, isMappingsFetched, mappingIdJobInfo.size, mappings, setMappingIdJobInfo]);\n\n const refreshMappings = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"mappings\"] });\n }, [queryClient]);\n\n const { mutateAsync: toggleExtraction, isLoading: isTogglingExtraction } = useMutation({\n mutationFn: async (mapping: Mapping) => {\n const accessToken = await getAccessToken();\n const newState = !mapping.extractionEnabled;\n await mappingClient.updateMapping(accessToken, mapping.id, { extractionEnabled: newState });\n },\n onSuccess: async () => {\n await refreshMappings();\n },\n });\n\n const { mutateAsync: onDelete, isLoading: isDeletingMapping } = useMutation({\n mutationFn: async (mapping: Mapping) => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteMapping(accessToken, mapping.id);\n },\n onSuccess: async () => {\n await refreshMappings();\n },\n });\n\n const isLoading = isLoadingMappings || isTogglingExtraction || isDeletingMapping;\n const extractionStatusGated =\n !extractionStatus || isLoadingExtractionStatus\n ? {\n extractionStatusIcon: {\n iconStatus: undefined,\n iconMessage: GroupingMappingWidget.translate(\"common.loading\"),\n },\n extractionMessageData: [],\n }\n : extractionStatus;\n\n return {\n mappings,\n isLoading,\n showExtractionMessageModal,\n extractionStatus: extractionStatusGated,\n setShowExtractionMessageModal,\n refreshMappings,\n refreshExtractionStatus,\n toggleExtraction,\n onDelete,\n setShowImportModal,\n showImportModal,\n setShowDeleteModal,\n showDeleteModal,\n isTogglingExtraction,\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRunExtraction.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useRunExtraction.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,mFAA4E;AAC5E,uDAAoD;AAEpD,qFAAqF;AAErF,iCAAiC;AACjC,uFAAuF;AAMhF,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAA8B,EAAE,EAAE;IAC3F,MAAM,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACjE,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,IAAA,wDAA4B,GAAE,CAAC;IACjF,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAEtD,MAAM,EACJ,WAAW,EAAE,aAAa,EAC1B,SAAS,EAAE,sBAAsB,EACjC,SAAS,EAAE,sBAAsB,GAClC,GAAG,IAAA,yBAAW,EAAC;QACd,WAAW,EA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,WAAW,EAAE,WAAW;iBACzB,CAAC;gBAEF,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,aAAa,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;gBACnG,OAAO,qBAAqB,CAAC;YAC/B,CAAC;YACD,OAAO;QACT,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,EAAE;YACnD,IAAI,qBAAqB,EAAE,CAAC;gBAC1B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;oBAC/B,IAAI,gBAAgB,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC;wBACpD,mBAAmB,CAAC,CAAC,OAA4B,EAAE,EAAE;4BACnD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;4BAChC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;4BACjD,OAAO,MAAM,CAAC;wBAChB,CAAC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC1G,CAAC,CAAC;AA7CW,QAAA,gBAAgB,oBA6C3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { ExtractionMapping, ExtractionRequestDetails, Mapping } from \"@itwin/insights-client\";\nimport { useState } from \"react\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\nexport interface FetchExtractionStatesProps extends GroupingMappingApiConfig {\n jobId?: string;\n}\n\nexport const useRunExtraction = ({ iModelId, getAccessToken }: FetchExtractionStatesProps) => {\n const extractionClient = useExtractionClient();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const { changeSetId } = useGroupingMappingApiConfig();\n\n const {\n mutateAsync: runExtraction,\n isLoading: isRunExtractionLoading,\n isSuccess: isRunExtractionSuccess,\n } = useMutation({\n mutationKey: [\"runExtraction\"],\n mutationFn: async (mappings: Mapping[]) => {\n if (mappings.length > 0) {\n const accessToken = await getAccessToken();\n const mappingIds: ExtractionMapping[] = mappings.map((mapping) => {\n return { id: mapping.id };\n });\n const extractionRequest: ExtractionRequestDetails = {\n mappings: mappingIds,\n iModelId,\n changesetId: changeSetId,\n };\n\n const runExtractionResponse = await extractionClient.runExtraction(accessToken, extractionRequest);\n return runExtractionResponse;\n }\n return;\n },\n onSuccess: async (runExtractionResponse, mappings) => {\n if (runExtractionResponse) {\n for (const mapping of mappings) {\n if (mappingIdJobInfo?.get(mapping.id) === undefined) {\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.set(mapping.id, runExtractionResponse.id);\n return newMap;\n });\n }\n }\n }\n },\n });\n\n return { isRunExtractionLoading, isRunExtractionSuccess, isJobStarted, setIsJobStarted, runExtraction };\n};\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import "./CalculatedPropertyAction.scss";
|
|
3
2
|
import type { Group, Property } from "@itwin/insights-client";
|
|
4
3
|
/**
|
|
5
|
-
* @deprecated in 0.27.0 The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.
|
|
4
|
+
* @deprecated in 0.27.0. The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.
|
|
6
5
|
* Props for the {@link CalculatedPropertyAction} component.
|
|
7
6
|
* @public
|
|
8
7
|
*/
|
|
@@ -14,7 +13,7 @@ export interface CalculatedPropertyActionProps {
|
|
|
14
13
|
onClickCancel?: () => void;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
|
-
* @deprecated in 0.27.0 The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
|
|
16
|
+
* @deprecated in 0.27.0. The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
|
|
18
17
|
* Component to create or update a calculated property.
|
|
19
18
|
* @public
|
|
20
19
|
*/
|
|
@@ -43,7 +43,7 @@ const react_query_1 = require("@tanstack/react-query");
|
|
|
43
43
|
const PropertiesClientContext_1 = require("../../context/PropertiesClientContext");
|
|
44
44
|
const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
|
|
45
45
|
/**
|
|
46
|
-
* @deprecated in 0.27.0 The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
|
|
46
|
+
* @deprecated in 0.27.0. The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
|
|
47
47
|
* Component to create or update a calculated property.
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalculatedPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAsD;AACtD,+CAAwC;AACxC,qFAA6D;AAC7D,yEAAiD;AACjD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,YAAY;gBACZ,QAAQ,EAAE,0BAAQ,CAAC,MAAM;gBACzB,sBAAsB,EAAE,IAAI;aAC7B,CAAC,CAAC;IACT,CAAC,EACD;QACE,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,MAAM,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACjG,aAAa,EAAE,CAAC;YAChB,eAAe,CAAC,EAAE,CAAC,CAAC;YACpB,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC;KACF,CACF,CAAC;IAEF,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"CalculatedPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAsD;AACtD,+CAAwC;AACxC,qFAA6D;AAC7D,yEAAiD;AACjD,2CAAyC;AAEzC,4DAAkD;AAClD,mFAAgF;AAChF,qFAAqF;AACrF,uDAAoE;AACpE,mFAA4E;AAC5E,0EAAuE;AAevE;;;;GAIG;AACI,MAAM,wBAAwB,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAiC,EAAE,EAAE;IAChJ,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IACnE,MAAM,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAS,kBAAkB,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IACjG,MAAM,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,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;YACnC,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,CACL;QACE,uCAAK,SAAS,EAAC,4CAA4C;YACzD,8BAAC,wBAAQ,IAAC,MAAM,EAAE,6CAAqB,CAAC,SAAS,CAAC,sCAAsC,CAAC,EAAE,SAAS,EAAC,kBAAkB;gBACrH,uCAAK,SAAS,EAAC,4BAA4B;oBACzC,8BAAC,oBAAI,IAAC,OAAO,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,kBAAkB,IAC1D,6CAAqB,CAAC,SAAS,CAAC,wBAAwB,CAAC,CACrD,CACH;gBACN,8BAAC,6DAA6B,IAAC,sBAAsB,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,GAAI,CAC1F,CACP;QACN,8BAAC,qBAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,CAAC,IAAI,IAAI,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,CACxH,CACJ,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,wBAAwB,4BA2DnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { Fieldset, Text } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator from \"../hooks/useValidator\";\nimport \"./CalculatedPropertyAction.scss\";\nimport type { CalculatedPropertyType, Group, Property } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * @deprecated in 0.27.0. The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.\n * Props for the {@link CalculatedPropertyAction} component.\n * @public\n */\nexport interface CalculatedPropertyActionProps {\n mappingId: string;\n group: Group;\n calculatedProperty?: Property;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\n/**\n * @deprecated in 0.27.0. The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.\n * Component to create or update a calculated property.\n * @public\n */\nexport const CalculatedPropertyAction = ({ mappingId, group, calculatedProperty, onSaveSuccess, onClickCancel }: CalculatedPropertyActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const propertiesClient = usePropertiesClient();\n const [propertyName, setPropertyName] = useState<string>(calculatedProperty?.propertyName ?? \"\");\n const [type, setType] = useState<CalculatedPropertyType | undefined>(calculatedProperty?.calculatedPropertyType ?? undefined);\n const [validator, showValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const { mutate: saveMutation, isLoading } = useMutation(\n async (type: CalculatedPropertyType) => {\n const accessToken = await getAccessToken();\n\n return calculatedProperty\n ? propertiesClient.updateProperty(accessToken, mappingId, group.id, calculatedProperty.id, {\n ...calculatedProperty,\n propertyName,\n dataType: calculatedProperty.dataType,\n calculatedPropertyType: type,\n })\n : propertiesClient.createProperty(accessToken, mappingId, group.id, {\n propertyName,\n dataType: DataType.Double,\n calculatedPropertyType: type,\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, group.id] });\n onSaveSuccess();\n setPropertyName(\"\");\n setType(undefined);\n },\n },\n );\n\n const onSave = () => {\n if (!validator.allValid() || !type) {\n showValidationMessage(true);\n return;\n }\n\n saveMutation(type);\n };\n\n return (\n <>\n <div className=\"gmw-calculated-properties-action-container\">\n <Fieldset legend={GroupingMappingWidget.translate(\"properties.calculatedPropertyDetails\")} className=\"gmw-details-form\">\n <div className=\"gmw-field-legend-container\">\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n {GroupingMappingWidget.translate(\"common.mandatoryFields\")}\n </Text>\n </div>\n <SharedCalculatedPropertyForms calculatedPropertyType={type} setCalculatedPropertyType={setType} />\n </Fieldset>\n </div>\n <ActionPanel onSave={onSave} onCancel={onClickCancel} isSavingDisabled={!(type && propertyName)} isLoading={isLoading} />\n </>\n );\n};\n"]}
|
package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js
CHANGED
|
@@ -38,6 +38,7 @@ const GroupingApiConfigContext_1 = require("../../context/GroupingApiConfigConte
|
|
|
38
38
|
const SharedCalculatedPropertyForms_1 = require("./SharedCalculatedPropertyForms");
|
|
39
39
|
const useKeySetHiliteQueries_1 = require("../../Groups/hooks/useKeySetHiliteQueries");
|
|
40
40
|
const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
|
|
41
|
+
const MAX_CONTEXT_CANDIDATES = 25;
|
|
41
42
|
/**
|
|
42
43
|
* Component to create or update a calculated property with visualizations.
|
|
43
44
|
* @internal
|
|
@@ -72,16 +73,28 @@ const CalculatedPropertyActionWithVisuals = ({ group, calculatedPropertyType, is
|
|
|
72
73
|
void (0, viewerUtils_1.zoomToElements)([resolvedHiliteIds[0]]);
|
|
73
74
|
}, [colorProperty, resolvedHiliteIds]);
|
|
74
75
|
(0, react_1.useEffect)(() => {
|
|
75
|
-
if (!colorProperty || resolvedHiliteIds.length === 0) {
|
|
76
|
+
if (!colorProperty || resolvedHiliteIds.length === 0 || !bboxDecorator) {
|
|
77
|
+
setInferredSpatialData(undefined);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
80
|
+
let disposed = false;
|
|
78
81
|
const setContext = async () => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
const candidateIds = resolvedHiliteIds.slice(0, MAX_CONTEXT_CANDIDATES);
|
|
83
|
+
let contextSet = false;
|
|
84
|
+
for (const instanceId of candidateIds) {
|
|
85
|
+
contextSet = await bboxDecorator.setContext(instanceId);
|
|
86
|
+
if (contextSet) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!disposed) {
|
|
91
|
+
setInferredSpatialData(contextSet ? bboxDecorator.getInferredSpatialData() : undefined);
|
|
82
92
|
}
|
|
83
93
|
};
|
|
84
94
|
void setContext();
|
|
95
|
+
return () => {
|
|
96
|
+
disposed = true;
|
|
97
|
+
};
|
|
85
98
|
}, [bboxDecorator, colorProperty, resolvedHiliteIds]);
|
|
86
99
|
(0, react_1.useEffect)(() => {
|
|
87
100
|
if (bboxDecorator && calculatedPropertyType && inferredSpatialData) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalculatedPropertyActionWithVisuals.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,wDAA0E;AAC1E,+CAA4D;AAC5D,yFAAqG;AACrG,6DAA0F;AAC1F,sDAAoD;AACpD,qFAAqF;AAErF,mFAAgF;AAChF,sFAAgF;AAChF,0EAAuE;
|
|
1
|
+
{"version":3,"file":"CalculatedPropertyActionWithVisuals.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,wDAA0E;AAC1E,+CAA4D;AAC5D,yFAAqG;AACrG,6DAA0F;AAC1F,s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AsB,EAAE,sBAAsB,EAC9C,yBAAyB,EAAE,yBAAyB,EACpD,YAAY,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAC1D,8BAAC,wBAAQ;oBACP,uCAAK,SAAS,EAAC,qBAAqB;wBAClC,2CAAM,MAAM,CAAC,KAAK,CAAO;wBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACG,CACZ,EACD,oBAAoB,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAClE,uCAAK,SAAS,EAAC,iBAAiB;oBAC9B,2CAAM,MAAM,CAAC,KAAK,CAAO;oBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACP,GACD,CACS,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AA/GW,QAAA,mCAAmC,uCA+G9C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { InputGroup, MenuItem, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { BboxDimension, BboxDimensionsDecorator } from \"../../../decorators/BboxDimensionsDecorator\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../../common/viewerUtils\";\nimport \"./CalculatedPropertyActionWithVisuals.scss\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { CalculatedPropertyType, GroupMinimal } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupKeySetQuery } from \"../../Groups/hooks/useKeySetHiliteQueries\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nconst MAX_CONTEXT_CANDIDATES = 25;\n\n/**\n * Props for the {@link CalculatedPropertyActionWithVisuals} component.\n * @internal\n */\nexport interface CalculatedPropertyActionWithVisualsProps {\n group: GroupMinimal;\n calculatedPropertyType?: CalculatedPropertyType;\n isLoading?: boolean;\n setCalculatedPropertyType: (calculatedPropertyType: CalculatedPropertyType | undefined) => void;\n}\n\n/**\n * Component to create or update a calculated property with visualizations.\n * @internal\n */\nexport const CalculatedPropertyActionWithVisuals = ({\n group,\n calculatedPropertyType,\n isLoading,\n setCalculatedPropertyType,\n}: CalculatedPropertyActionWithVisualsProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [bboxDecorator, setBboxDecorator] = useState<BboxDimensionsDecorator | undefined>();\n const [inferredSpatialData, setInferredSpatialData] = useState<Map<BboxDimension, number> | undefined>();\n const [colorProperty, setColorProperty] = useState<boolean>(false);\n const { data } = useGroupKeySetQuery(group, iModelConnection, true);\n\n const resolvedHiliteIds = useMemo(() => {\n // Resolved ids, default to an empty array if not available\n return data?.result?.ids ?? [];\n }, [data?.result?.ids]);\n\n useEffect(() => {\n const decorator = new BboxDimensionsDecorator();\n IModelApp.viewManager.addDecorator(decorator);\n setBboxDecorator(decorator);\n return () => {\n IModelApp.viewManager.dropDecorator(decorator);\n };\n }, []);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0) {\n clearAll();\n return;\n }\n visualizeElements(resolvedHiliteIds, \"red\");\n void zoomToElements([resolvedHiliteIds[0]]);\n }, [colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0 || !bboxDecorator) {\n setInferredSpatialData(undefined);\n return;\n }\n let disposed = false;\n const setContext = async () => {\n const candidateIds = resolvedHiliteIds.slice(0, MAX_CONTEXT_CANDIDATES);\n let contextSet = false;\n for (const instanceId of candidateIds) {\n contextSet = await bboxDecorator.setContext(instanceId);\n if (contextSet) {\n break;\n }\n }\n if (!disposed) {\n setInferredSpatialData(contextSet ? bboxDecorator.getInferredSpatialData() : undefined);\n }\n };\n void setContext();\n return () => {\n disposed = true;\n };\n }, [bboxDecorator, colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (bboxDecorator && calculatedPropertyType && inferredSpatialData) {\n inferredSpatialData.has(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension]) && colorProperty\n ? bboxDecorator.drawContext(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension])\n : bboxDecorator.clearContext();\n } else {\n bboxDecorator?.clearContext();\n }\n }, [bboxDecorator, colorProperty, inferredSpatialData, calculatedPropertyType]);\n\n const getSpatialData = (value: string | undefined) =>\n value &&\n inferredSpatialData?.has(BboxDimension[value as keyof typeof BboxDimension]) && (\n <div>{`${inferredSpatialData?.get(BboxDimension[value as keyof typeof BboxDimension])?.toPrecision(4)}m`}</div>\n );\n\n return (\n <div className=\"gmw-calculated-properties-action-container\">\n <InputGroup className=\"gmw-details-form\">\n <ToggleSwitch\n className=\"gmw-field-legend-container\"\n label={GroupingMappingWidget.translate(\"properties.visualizeDimensions\")}\n labelPosition=\"left\"\n disabled={isLoading}\n checked={colorProperty}\n onChange={() => setColorProperty((b) => !b)}\n ></ToggleSwitch>\n <SharedCalculatedPropertyForms\n calculatedPropertyType={calculatedPropertyType}\n setCalculatedPropertyType={setCalculatedPropertyType}\n itemRenderer={(option: SelectOption<string | undefined>) => (\n <MenuItem>\n <div className=\"gmw-gr-cp-menu-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n </MenuItem>\n )}\n selectedItemRenderer={(option: SelectOption<string | undefined>) => (\n <div className=\"gmw-select-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n )}\n />\n </InputGroup>\n </div>\n );\n};\n"]}
|
package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,4DAAgE;AAChE,+CAA2C;AAE3C,wDAAqD;AACrD,0EAAuE;AAShE,MAAM,6BAA6B,GAAG,CAAC,EAC5C,sBAAsB,EACtB,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,GACe,EAAE,EAAE;IACvC,MAAM,yCAAyC,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACjE,MAAM,OAAO,GAAuD,EAAE,CAAC;QACvE,MAAM,aAAa,GAAG,wCAA8D,CAAC;QAErF,OAAO,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,qCAAqC,CAAC,EAAC,CAAC,CAAC;QAChH,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,4DAAgE;AAChE,+CAA2C;AAE3C,wDAAqD;AACrD,0EAAuE;AAShE,MAAM,6BAA6B,GAAG,CAAC,EAC5C,sBAAsB,EACtB,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,GACe,EAAE,EAAE;IACvC,MAAM,yCAAyC,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACjE,MAAM,OAAO,GAAuD,EAAE,CAAC;QACvE,MAAM,aAAa,GAAG,wCAA8D,CAAC;QAErF,OAAO,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,qCAAqC,CAAC,EAAC,CAAC,CAAC;QAChH,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;YAChC,IAAI,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;gBAClE,mDAAmD;gBACnD,MAAM,KAAK,GAAG,GAAG;qBACd,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;qBAC1B,IAAI,EAAE;qBACN,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC1C,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAA2B,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL;QACE,8BAAC,6BAAa,IACZ,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,mCAAmC,CAAC,EAC3E,OAAO,EAAE,yCAAyC,EAAE,EACpD,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,EAAE,yBAAyB,EACnC,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,qCAAqC,CAAC,EACnF,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,6BAA6B,iCAuCxC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { CalculatedPropertyType } from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect } from \"@itwin/itwinui-react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\ninterface SharedCalculatedPropertyFormsProps {\n calculatedPropertyType: CalculatedPropertyType | undefined;\n setCalculatedPropertyType: (value: CalculatedPropertyType | undefined) => void;\n itemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n calculatedPropertyType,\n setCalculatedPropertyType,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType | undefined>[] = [];\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n \n options.push({value: undefined, label: GroupingMappingWidget.translate(\"properties.noCalculatedPropertyType\")});\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledSelect<CalculatedPropertyType | undefined>\n label={GroupingMappingWidget.translate(\"properties.calculatedPropertyType\")}\n options={generateOptionsFromCalculatedPropertyType()}\n value={calculatedPropertyType}\n onChange={setCalculatedPropertyType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n placeholder={GroupingMappingWidget.translate(\"properties.noCalculatedPropertyType\")}\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { ToggleSwitchProps } from "@itwin/itwinui-react";
|
|
3
2
|
import type { GroupMinimal } from "@itwin/insights-client";
|
|
4
|
-
export
|
|
3
|
+
export type GroupColorToggleProps = Partial<ToggleSwitchProps> & {
|
|
5
4
|
color: string;
|
|
6
5
|
group: GroupMinimal;
|
|
7
6
|
disableZoom?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAsD;AAEtD,wDAA6D;AAE7D,0DAAuF;AACvF,wEAA4D;AAC5D,kFAAkF;AAElF,mFAA6E;AAC7E,wFAAwF;AACxF,uDAAoD;AACpD,kEAA+D;AAC/D,wFAAwF;AACxF,uEAAoE;AAQ7D,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,EAAyB,EAAE,EAAE;IAChG,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC3D,IAAI,CAAC,gBAAgB,EAAE;
|
|
1
|
+
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAsD;AAEtD,wDAA6D;AAE7D,0DAAuF;AACvF,wEAA4D;AAC5D,kFAAkF;AAElF,mFAA6E;AAC7E,wFAAwF;AACxF,uDAAoD;AACpD,kEAA+D;AAC/D,wFAAwF;AACxF,uEAAoE;AAQ7D,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,EAAyB,EAAE,EAAE;IAChG,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC3D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,IAAA,4DAA8B,GAAE,CAAC;IAC/E,MAAM,EAAE,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5B,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,EAAE,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEjD,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC1C,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;YACtB,IAAI,CAAC,EAAE,CAAC;gBACN,IAAA,sBAAQ,GAAE,CAAC;YACb,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,MAAM,SAAS,GAAG,UAAU,IAAI,aAAa,CAAC;IAE9C,OAAO,8BAAC,4BAAY,IAAC,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,KAAM,IAAI,GAAiB,CAAC;AAC1L,CAAC,CAAC;AAhDW,QAAA,gBAAgB,oBAgD3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect } from \"react\";\nimport type { ToggleSwitchProps } from \"@itwin/itwinui-react\";\nimport { toaster, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../common/viewerUtils\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { QueryResults } from \"../Groups/hooks/useKeySetHiliteQueries\";\nimport { useGroupKeySetQuery } from \"../Groups/hooks/useKeySetHiliteQueries\";\nimport { usePropertiesGroupColorContext } from \"../context/PropertiesGroupColorContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\n\nexport type GroupColorToggleProps = Partial<ToggleSwitchProps> & {\n color: string;\n group: GroupMinimal;\n disableZoom?: boolean;\n};\n\nexport const GroupColorToggle = ({ color, group, disableZoom, ...rest }: GroupColorToggleProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const { showGroupColor, setShowGroupColor } = usePropertiesGroupColorContext();\n const { showGroupColor: isGroupsVisualizationOn } = useGroupHilitedElementsContext();\n const { data: hiliteIdsResult, isFetched, isFetching } = useGroupKeySetQuery(group, iModelConnection, showGroupColor);\n const isMounted = useIsMounted();\n\n const { mutate: mutateVisualization, isLoading: isVisualizing } = useMutation({\n mutationFn: async (hiliteIds: QueryResults) => {\n clearAll();\n Presentation.selection.clearSelection(\"GroupingMappingWidget\", iModelConnection);\n visualizeElements(hiliteIds.result.ids, color);\n if (!disableZoom) {\n await zoomToElements(hiliteIds.result.ids);\n }\n },\n onError: (error) => {\n toaster.negative(GroupingMappingWidget.translate(\"errors.visualizingGroup\"));\n // eslint-disable-next-line no-console\n console.error(error);\n },\n });\n\n useEffect(() => {\n isFetched && showGroupColor && hiliteIdsResult && isMounted && mutateVisualization(hiliteIdsResult);\n }, [hiliteIdsResult, isFetched, isMounted, showGroupColor, mutateVisualization]);\n\n useEffect(() => {\n if (isGroupsVisualizationOn) {\n setShowGroupColor(true);\n }\n }, [isGroupsVisualizationOn, setShowGroupColor]);\n\n const handleToggleChange = useCallback(() => {\n setShowGroupColor((b) => {\n if (b) {\n clearAll();\n }\n return !b;\n });\n }, [setShowGroupColor]);\n\n const isLoading = isFetching || isVisualizing;\n\n return <ToggleSwitch label={GroupingMappingWidget.translate(\"groups.colorGroup\")} disabled={isLoading} checked={showGroupColor} onChange={handleToggleChange} {...rest}></ToggleSwitch>;\n};\n"]}
|