@itwin/grouping-mapping-widget 0.23.1 → 0.25.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/WidgetShell/GroupingMappingContent.js +2 -2
- package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/common/hooks/useIsMounted.d.ts +2 -1
- package/lib/cjs/common/hooks/useIsMounted.js +3 -3
- package/lib/cjs/common/hooks/useIsMounted.js.map +1 -1
- package/lib/cjs/components/Constants.d.ts +3 -0
- package/lib/cjs/components/Constants.js +5 -2
- package/lib/cjs/components/Constants.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.js +12 -14
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/{GroupItem.d.ts → GroupListItem.d.ts} +4 -3
- package/lib/cjs/components/Groups/GroupListItem.js +49 -0
- package/lib/cjs/components/Groups/GroupListItem.js.map +1 -0
- package/lib/cjs/components/Groups/GroupListItem.scss +13 -0
- package/lib/cjs/components/Groups/GroupsView.js +2 -2
- package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +33 -11
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.js +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +17 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +16 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +17 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +21 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +79 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
- package/lib/cjs/components/Mappings/MappingListItem.d.ts +20 -0
- package/lib/cjs/components/Mappings/MappingListItem.js +96 -0
- package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -0
- package/lib/cjs/components/Mappings/MappingListItem.scss +13 -0
- package/lib/cjs/components/Mappings/MappingViewActionGroup.d.ts +1 -1
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js +3 -3
- package/lib/cjs/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -0
- package/lib/cjs/components/Mappings/MappingsView.js +28 -4
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
- package/lib/cjs/components/Mappings/MappingsView.scss +0 -5
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +55 -0
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +29 -5
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +42 -0
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +28 -59
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.js +30 -26
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +62 -167
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +13 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.js +21 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.scss +14 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +147 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +4 -4
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js +4 -3
- package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenu.js +11 -15
- package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
- package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +1 -2
- package/lib/cjs/components/SharedComponents/DeleteModal.js +1 -2
- package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/cjs/components/context/ExtractionStateJobContext.d.ts +8 -0
- package/lib/cjs/components/context/ExtractionStateJobContext.js +44 -0
- package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -0
- package/lib/cjs/components/context/PropertiesGroupColorContext.d.ts +8 -0
- package/lib/cjs/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +7 -10
- package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -0
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +3 -3
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/WidgetShell/GroupingMappingContent.js +2 -2
- package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/esm/common/hooks/useIsMounted.d.ts +2 -1
- package/lib/esm/common/hooks/useIsMounted.js +4 -4
- package/lib/esm/common/hooks/useIsMounted.js.map +1 -1
- package/lib/esm/components/Constants.d.ts +3 -0
- package/lib/esm/components/Constants.js +3 -0
- package/lib/esm/components/Constants.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.js +12 -14
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/{GroupItem.d.ts → GroupListItem.d.ts} +4 -3
- package/lib/esm/components/Groups/GroupListItem.js +22 -0
- package/lib/esm/components/Groups/GroupListItem.js.map +1 -0
- package/lib/esm/components/Groups/GroupListItem.scss +13 -0
- package/lib/esm/components/Groups/GroupsView.js +3 -3
- package/lib/esm/components/Groups/GroupsView.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +33 -11
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +1 -1
- package/lib/esm/components/Groups/groupsHelpers.js +1 -1
- package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +10 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +9 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +10 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +14 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js +52 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
- package/lib/esm/components/Mappings/MappingListItem.d.ts +20 -0
- package/lib/esm/components/Mappings/MappingListItem.js +69 -0
- package/lib/esm/components/Mappings/MappingListItem.js.map +1 -0
- package/lib/esm/components/Mappings/MappingListItem.scss +13 -0
- package/lib/esm/components/Mappings/MappingViewActionGroup.d.ts +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.js +1 -1
- package/lib/esm/components/Mappings/MappingViewActionGroup.js.map +1 -1
- package/lib/esm/components/Mappings/MappingsView.d.ts +2 -0
- package/lib/esm/components/Mappings/MappingsView.js +31 -7
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/MappingsView.scss +0 -5
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +49 -0
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +30 -6
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js +38 -0
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +29 -60
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.js +32 -28
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +64 -169
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +13 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.js +14 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.scss +14 -0
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +117 -0
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +4 -4
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js +3 -4
- package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenu.js +12 -16
- package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTable.js +1 -1
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
- package/lib/esm/components/SharedComponents/DeleteModal.d.ts +1 -2
- package/lib/esm/components/SharedComponents/DeleteModal.js +1 -2
- package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/esm/components/context/ExtractionStateJobContext.d.ts +8 -0
- package/lib/esm/components/context/ExtractionStateJobContext.js +17 -0
- package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -0
- package/lib/esm/components/context/PropertiesGroupColorContext.d.ts +8 -0
- package/lib/esm/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +5 -8
- package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -0
- package/lib/esm/test/GroupingMappingCustomUI.test.js +3 -3
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/components/Groups/GroupItem.js +0 -23
- package/lib/cjs/components/Groups/GroupItem.js.map +0 -1
- package/lib/cjs/components/Properties/hooks/useFetchData.d.ts +0 -7
- package/lib/cjs/components/Properties/hooks/useFetchData.js +0 -43
- package/lib/cjs/components/Properties/hooks/useFetchData.js.map +0 -1
- package/lib/cjs/components/SharedComponents/HorizontalTile.d.ts +0 -19
- package/lib/cjs/components/SharedComponents/HorizontalTile.js +0 -27
- package/lib/cjs/components/SharedComponents/HorizontalTile.js.map +0 -1
- package/lib/cjs/components/SharedComponents/HorizontalTile.scss +0 -58
- package/lib/cjs/components/context/PropertiesContext.d.ts +0 -15
- package/lib/cjs/components/context/PropertiesContext.js.map +0 -1
- package/lib/esm/components/Groups/GroupItem.js +0 -16
- package/lib/esm/components/Groups/GroupItem.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useFetchData.d.ts +0 -7
- package/lib/esm/components/Properties/hooks/useFetchData.js +0 -37
- package/lib/esm/components/Properties/hooks/useFetchData.js.map +0 -1
- package/lib/esm/components/SharedComponents/HorizontalTile.d.ts +0 -19
- package/lib/esm/components/SharedComponents/HorizontalTile.js +0 -20
- package/lib/esm/components/SharedComponents/HorizontalTile.js.map +0 -1
- package/lib/esm/components/SharedComponents/HorizontalTile.scss +0 -58
- package/lib/esm/components/context/PropertiesContext.d.ts +0 -15
- package/lib/esm/components/context/PropertiesContext.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAO8B;AAC9B,+CAAgE;AAChE,qFAA6D;AAC7D,sEAAwE;AACxE,iDAAoD;AACpD,0CAAwC;AACxC,gFAAuF;AACvF,wEAAqE;AAErE,6EAAsE;AACtE,qFAAqF;AAErF,4DAAsD;AACt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AAC,EACvD,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAlMW,QAAA,uBAAuB,2BAkMlC","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 {\n Alert,\n Fieldset,\n LabeledInput,\n LabeledSelect,\n LabeledTextarea,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError } from \"../../../common/utils\";\nimport \"./CustomCalculationAction.scss\";\nimport { quantityTypesSelectionOptions } from \"../GroupProperties/GroupPropertyAction\";\nimport { useFormulaValidation } from \"../hooks/useFormulaValidation\";\nimport type { PossibleDataType, PropertyMap } from \"../../../formula/Types\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { CalculatedProperty, CustomCalculation, GroupProperty } from \"@itwin/insights-client\";\nimport { QuantityType } from \"@itwin/insights-client\";\nimport { usePropertiesContext } from \"../../context/PropertiesContext\";\n\nexport interface CustomCalculationActionProps {\n mappingId: string;\n groupId: string;\n customCalculation?: CustomCalculation;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\nconst stringToPossibleDataType = (str?: string): PossibleDataType => {\n switch (str?.toLowerCase()) {\n case \"double\":\n case \"number\": return \"Number\";\n case \"string\": return \"String\";\n case \"boolean\": return \"Boolean\";\n default: return \"Undefined\";\n }\n};\n\nconst convertToPropertyMap = (\n groupProperties: GroupProperty[],\n calculatedProperties: CalculatedProperty[],\n customCalculations: CustomCalculation[],\n selectedPropertyName?: string\n): PropertyMap => {\n const map: PropertyMap = {};\n const selectedLowerName = selectedPropertyName?.toLowerCase();\n\n groupProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n calculatedProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName)\n map[lowerName] = \"Number\";\n });\n\n customCalculations.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n return map;\n};\n\nexport const CustomCalculationAction = ({\n mappingId,\n groupId,\n customCalculation,\n onSaveSuccess,\n onClickCancel,\n}: CustomCalculationActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\n customCalculation?.propertyName ?? \"\",\n );\n const [formula, setFormula] = useState<string>(\n customCalculation?.formula ?? \"\",\n );\n const {\n groupProperties,\n setGroupProperties,\n calculatedProperties,\n setCalculatedProperties,\n customCalculationProperties,\n setCustomCalculationProperties,\n } = usePropertiesContext();\n const [quantityType, setQuantityType] = useState<QuantityType>(customCalculation?.quantityType ?? QuantityType.Undefined);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [formulaErrorMessage, setFormulaErrorMessage] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [properties, setProperties] = useState<PropertyMap>({});\n const { isValid, forceValidation } = useFormulaValidation(propertyName.toLowerCase(), formula, properties, setFormulaErrorMessage);\n\n const initialize = useCallback(async () => {\n const accessToken = await getAccessToken();\n const [groupProps, calcProps, customCalcProps] = await Promise.all([\n mappingClient.getGroupProperties(accessToken, iModelId, mappingId, groupId),\n mappingClient.getCalculatedProperties(accessToken, iModelId, mappingId, groupId),\n mappingClient.getCustomCalculations(accessToken, iModelId, mappingId, groupId),\n ]);\n setGroupProperties(groupProps);\n setCalculatedProperties(calcProps);\n setCustomCalculationProperties(customCalcProps);\n }, [getAccessToken, groupId, iModelId, mappingClient, mappingId, setCalculatedProperties, setCustomCalculationProperties, setGroupProperties]);\n\n const fetchAllProperties = useCallback(async () => {\n setIsLoading(true);\n try {\n if (!groupProperties || !calculatedProperties || !customCalculationProperties) {\n await initialize();\n }\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n }, [calculatedProperties, customCalculationProperties, groupProperties, initialize]);\n\n useEffect(() => {\n const propertiesMap = convertToPropertyMap(groupProperties ?? [], calculatedProperties ?? [], customCalculationProperties ?? []);\n setProperties(propertiesMap);\n }, [calculatedProperties, customCalculationProperties, groupProperties]);\n\n useEffect(() => {\n void fetchAllProperties();\n }, [fetchAllProperties]);\n\n const onSave = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n if (!forceValidation()) {\n return;\n }\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n customCalculation\n ? await mappingClient.updateCustomCalculation(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n customCalculation.id,\n {\n propertyName,\n formula,\n quantityType,\n }\n )\n : await mappingClient.createCustomCalculation(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n {\n propertyName,\n formula,\n quantityType,\n }\n );\n onSaveSuccess();\n setPropertyName(\"\");\n setFormula(\"\");\n setQuantityType(QuantityType.Undefined);\n } catch (error: any) {\n // error instanceof Response refuses to be true when it should be.\n if (error.status === 422) {\n error = error as Response;\n const erroredResponse = await error.json();\n if (\n erroredResponse.error.code === \"InvalidInsightsRequest\" &&\n erroredResponse.error.target === \"formula\"\n ) {\n setFormulaErrorMessage(erroredResponse.error.message);\n }\n } else {\n handleError(error.status);\n }\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <div className='gmw-custom-calculation-action-container'>\n <Fieldset legend='Custom Calculation Details' className='gmw-details-form'>\n <Text variant='small' as='small' className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n value={propertyName}\n required\n name='name'\n label='Name'\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", propertyName, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n />\n <Alert\n type='informational'\n clickableText='Click here.'\n clickableTextProps={{ href: \"https://developer.bentley.com/apis/insights/operations/create-customcalculation/\", target: \"_blank\", rel: \"noreferrer\" }}\n >\n To learn more about creating custom calculation formulas, view the documentation.\n </Alert>\n <LabeledTextarea\n value={formula}\n required\n name='formula'\n label='Formula'\n disabled={isLoading}\n onChange={(event) => {\n setFormula(event.target.value);\n }}\n message={formulaErrorMessage}\n status={formulaErrorMessage ? \"negative\" : undefined}\n onBlurCapture={() => {\n forceValidation();\n }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={onClickCancel}\n isSavingDisabled={!(formula && propertyName && isValid)}\n isLoading={isLoading}\n />\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAO8B;AAC9B,+CAAmD;AACnD,qFAA6D;AAC7D,sEAAwE;AACxE,iDAAoD;AACpD,0CAAwC;AACxC,gFAAuF;AACvF,wEAAqE;AAErE,6EAAsE;AACtE,qFAAqF;AAErF,4DAAsD;AACtD,wFAAqF;AACrF,oFAAiF;AACjF,8EAA2E;AAC3E,uDAAoE;AAUpE,MAAM,wBAAw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B,EAC5B,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,aAAa,EAAE,GAAG,EAAE;wBAClB,eAAe,EAAE,CAAC;oBACpB,CAAC,GACD;gBACF,8BAAC,6BAAa,IACZ,KAAK,EAAC,eAAe,EACrB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,mDAA6B,EACtC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACO,CACP;QACN,8BAAC,qBAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,CAAC,CAAC,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,EACvD,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AA/JW,QAAA,uBAAuB,2BA+JlC","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 {\n Alert,\n Fieldset,\n LabeledInput,\n LabeledSelect,\n LabeledTextarea,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useEffect, useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError } from \"../../../common/utils\";\nimport \"./CustomCalculationAction.scss\";\nimport { quantityTypesSelectionOptions } from \"../GroupProperties/GroupPropertyAction\";\nimport { useFormulaValidation } from \"../hooks/useFormulaValidation\";\nimport type { PossibleDataType, PropertyMap } from \"../../../formula/Types\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { CalculatedProperty, CustomCalculation, GroupProperty } from \"@itwin/insights-client\";\nimport { QuantityType } from \"@itwin/insights-client\";\nimport { useCalculatedPropertiesQuery } from \"../hooks/useCalculatedPropertiesQuery\";\nimport { useCustomCalculationsQuery } from \"../hooks/useCustomCalculationsQuery\";\nimport { useGroupPropertiesQuery } from \"../hooks/useGroupPropertiesQuery\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\n\nexport interface CustomCalculationActionProps {\n mappingId: string;\n groupId: string;\n customCalculation?: CustomCalculation;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\nconst stringToPossibleDataType = (str?: string): PossibleDataType => {\n switch (str?.toLowerCase()) {\n case \"double\":\n case \"number\": return \"Number\";\n case \"string\": return \"String\";\n case \"boolean\": return \"Boolean\";\n default: return \"Undefined\";\n }\n};\n\nconst convertToPropertyMap = (\n groupProperties: GroupProperty[],\n calculatedProperties: CalculatedProperty[],\n customCalculations: CustomCalculation[],\n selectedPropertyName?: string\n): PropertyMap => {\n const map: PropertyMap = {};\n const selectedLowerName = selectedPropertyName?.toLowerCase();\n\n groupProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n calculatedProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName)\n map[lowerName] = \"Number\";\n });\n\n customCalculations.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n return map;\n};\n\nexport const CustomCalculationAction = ({\n mappingId,\n groupId,\n customCalculation,\n onSaveSuccess,\n onClickCancel,\n}: CustomCalculationActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\n customCalculation?.propertyName ?? \"\",\n );\n const [formula, setFormula] = useState<string>(\n customCalculation?.formula ?? \"\",\n );\n const [quantityType, setQuantityType] = useState<QuantityType>(customCalculation?.quantityType ?? QuantityType.Undefined);\n const [formulaErrorMessage, setFormulaErrorMessage] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [properties, setProperties] = useState<PropertyMap>({});\n const { isValid, forceValidation } = useFormulaValidation(propertyName.toLowerCase(), formula, properties, setFormulaErrorMessage);\n const queryClient = useQueryClient();\n\n const { data: groupProperties, isFetching: isLoadingGroupProperties } = useGroupPropertiesQuery(iModelId, mappingId, groupId, getAccessToken, mappingClient);\n const { data: calculatedProperties, isFetching: isLoadingCalculatedProperties } = useCalculatedPropertiesQuery(iModelId, mappingId, groupId, getAccessToken, mappingClient);\n const { data: customCalculationProperties, isFetching: isLoadingCustomCalculations } = useCustomCalculationsQuery(iModelId, mappingId, groupId, getAccessToken, mappingClient);\n\n useEffect(() => {\n const propertiesMap = convertToPropertyMap(groupProperties ?? [], calculatedProperties ?? [], customCalculationProperties ?? []);\n setProperties(propertiesMap);\n }, [calculatedProperties, customCalculationProperties, groupProperties]);\n\n const { mutate: saveMutation, isLoading: isSaving } = useMutation(async () => {\n\n const accessToken = await getAccessToken();\n\n return customCalculation\n ? mappingClient.updateCustomCalculation(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n customCalculation.id,\n { propertyName, formula, quantityType }\n )\n : mappingClient.createCustomCalculation(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n { propertyName, formula, quantityType }\n );\n }, {\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"customCalculations\", iModelId, mappingId, groupId] });\n onSaveSuccess();\n setPropertyName(\"\");\n setFormula(\"\");\n setQuantityType(QuantityType.Undefined);\n },\n onError: async (error: any) => {\n if (error.status === 422) {\n const erroredResponse = await error.json();\n if (\n erroredResponse.error.code === \"InvalidInsightsRequest\" &&\n erroredResponse.error.target === \"formula\"\n ) {\n setFormulaErrorMessage(erroredResponse.error.message);\n }\n } else {\n handleError(error.status);\n }\n },\n });\n\n const onSave = () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n if (!forceValidation()) {\n return;\n }\n saveMutation();\n };\n\n const isLoading = isSaving || isLoadingGroupProperties || isLoadingCalculatedProperties || isLoadingCustomCalculations;\n\n return (\n <>\n <div className='gmw-custom-calculation-action-container'>\n <Fieldset legend='Custom Calculation Details' className='gmw-details-form'>\n <Text variant='small' as='small' className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n value={propertyName}\n required\n name='name'\n label='Name'\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", propertyName, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n />\n <Alert\n type='informational'\n clickableText='Click here.'\n clickableTextProps={{ href: \"https://developer.bentley.com/apis/insights/operations/create-customcalculation/\", target: \"_blank\", rel: \"noreferrer\" }}\n >\n To learn more about creating custom calculation formulas, view the documentation.\n </Alert>\n <LabeledTextarea\n value={formula}\n required\n name='formula'\n label='Formula'\n disabled={isLoading}\n onChange={(event) => {\n setFormula(event.target.value);\n }}\n message={formulaErrorMessage}\n status={formulaErrorMessage ? \"negative\" : undefined}\n onBlurCapture={() => {\n forceValidation();\n }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={onClickCancel}\n isSavingDisabled={!(formula && propertyName && isValid)}\n isLoading={isLoading}\n />\n </>\n );\n};\n"]}
|
|
@@ -35,53 +35,50 @@ const MappingClientContext_1 = require("../../context/MappingClientContext");
|
|
|
35
35
|
const PropertyNameCell_1 = require("../PropertyNameCell");
|
|
36
36
|
const PropertyTable_1 = require("../PropertyTable");
|
|
37
37
|
const GroupingApiConfigContext_1 = require("../../context/GroupingApiConfigContext");
|
|
38
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
38
39
|
const CustomCalculationTable = ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, customCalculations, refresh, }) => {
|
|
39
40
|
const mappingClient = (0, MappingClientContext_1.useMappingClient)();
|
|
40
41
|
const { getAccessToken, iModelId } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
42
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
41
43
|
const columnsFactory = (0, react_1.useCallback)((handleShowDeleteModal) => [
|
|
42
44
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless' },
|
|
72
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgMore, { style: {
|
|
73
|
-
width: "16px",
|
|
74
|
-
height: "16px",
|
|
75
|
-
} }))));
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
],
|
|
45
|
+
id: "propertyName",
|
|
46
|
+
Header: "Custom Calculation",
|
|
47
|
+
accessor: "propertyName",
|
|
48
|
+
Cell: (value) => (react_1.default.createElement(PropertyNameCell_1.PropertyNameCell, { property: value.row.original, onClickModify: onClickModify })),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "formula",
|
|
52
|
+
Header: "Formula",
|
|
53
|
+
accessor: "formula",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "dropdown",
|
|
57
|
+
Header: "",
|
|
58
|
+
width: 80,
|
|
59
|
+
Cell: (value) => {
|
|
60
|
+
return (react_1.default.createElement(itwinui_react_1.DropdownMenu, { menuItems: (close) => [onClickModify ? [
|
|
61
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 0, onClick: () => {
|
|
62
|
+
onClickModify(value.row.original);
|
|
63
|
+
close();
|
|
64
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgEdit, null) }, "Modify")
|
|
65
|
+
] : [], react_1.default.createElement(itwinui_react_1.MenuItem, { key: 1, onClick: () => {
|
|
66
|
+
handleShowDeleteModal(value.row.original);
|
|
67
|
+
close();
|
|
68
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgDelete, null) }, "Remove"),
|
|
69
|
+
].flatMap((p) => p) },
|
|
70
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless' },
|
|
71
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgMore, null))));
|
|
72
|
+
},
|
|
79
73
|
},
|
|
80
74
|
], [onClickModify]);
|
|
81
|
-
const deleteProperty = (0,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
const { mutateAsync: deleteProperty } = (0, react_query_1.useMutation)({
|
|
76
|
+
mutationFn: async (propertyId) => {
|
|
77
|
+
const accessToken = await getAccessToken();
|
|
78
|
+
await mappingClient.deleteCustomCalculation(accessToken, iModelId, mappingId, groupId, propertyId);
|
|
79
|
+
},
|
|
80
|
+
onSuccess: async () => queryClient.invalidateQueries({ queryKey: ["customCalculations", iModelId, mappingId, groupId] }),
|
|
81
|
+
});
|
|
85
82
|
return (react_1.default.createElement(PropertyTable_1.PropertyTable, { propertyType: "Custom Calculation", columnsFactory: columnsFactory, data: customCalculations, isLoading: isLoading, onClickAdd: onClickAdd, refreshProperties: refresh, deleteProperty: deleteProperty }));
|
|
86
83
|
};
|
|
87
84
|
exports.CustomCalculationTable = CustomCalculationTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomCalculationTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAIoC;AACpC,wDAI8B;AAC9B,+CAA2C;AAG3C,6EAAsE;AACtE,0DAAuD;AACvD,oDAAiD;AACjD,qFAAqF;
|
|
1
|
+
{"version":3,"file":"CustomCalculationTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAIoC;AACpC,wDAI8B;AAC9B,+CAA2C;AAG3C,6EAAsE;AACtE,0DAAuD;AACvD,oDAAiD;AACjD,qFAAqF;AACrF,uDAAoE;AAY7D,MAAM,sBAAsB,GAAG,CAAC,EACrC,SAAS,EACT,OAAO,EACP,UAAU,EACV,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,OAAO,GACqB,EAAE,EAAE;IAChC,MAAM,aAAa,GAAG,IAAA,uCAAgB,GAAE,CAAC;IACzC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IACnE,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;IAErC,MAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,CAAC,qBAAyD,EAA+B,EAAE,CAAC;QAC1F;YACE,EAAE,EAAE,cAAc;YAClB,MAAM,EAAE,oBAAoB;YAC5B,QAAQ,EAAE,cAAc;YACxB,IAAI,EAAE,CAAC,KAAmC,EAAE,EAAE,CAAC,CAC7C,8BAAC,mCAAgB,IACf,QAAQ,EAAE,KAAK,CAAC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MAAM,aAAa,CAAC,uBAAuB,CACzC,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,CACX,CAAC;QACJ,CAAC;QACD,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,oBAAoB,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;KACzH,CAAC,CAAC;IAEH,OAAO,CACL,8BAAC,6BAAa,IACZ,YAAY,EAAC,oBAAoB,EACjC,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,OAAO,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAjGW,QAAA,sBAAsB,0BAiGjC","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 {\n SvgDelete,\n SvgEdit,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n DropdownMenu,\n IconButton,\n MenuItem,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback } from \"react\";\nimport type { CellProps, Column } from \"react-table\";\nimport type { CustomCalculation } from \"@itwin/insights-client\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport { PropertyNameCell } from \"../PropertyNameCell\";\nimport { PropertyTable } from \"../PropertyTable\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\n\nexport interface CustomCalculationTableProps {\n mappingId: string;\n groupId: string;\n onClickAdd?: () => void;\n onClickModify?: (value: CustomCalculation) => void;\n isLoading: boolean;\n customCalculations: CustomCalculation[];\n refresh: () => Promise<void>;\n}\n\nexport const CustomCalculationTable = ({\n mappingId,\n groupId,\n onClickAdd,\n onClickModify,\n isLoading,\n customCalculations,\n refresh,\n}: CustomCalculationTableProps) => {\n const mappingClient = useMappingClient();\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const queryClient = useQueryClient();\n\n const columnsFactory = useCallback(\n (handleShowDeleteModal: (value: CustomCalculation) => void): Column<CustomCalculation>[] => [\n {\n id: \"propertyName\",\n Header: \"Custom Calculation\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<CustomCalculation>) => (\n <PropertyNameCell\n property={value.row.original}\n onClickModify={onClickModify}\n />\n ),\n },\n {\n id: \"formula\",\n Header: \"Formula\",\n accessor: \"formula\",\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<CustomCalculation>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [onClickModify ? [\n <MenuItem\n key={0}\n onClick={() => {\n onClickModify(value.row.original);\n close();\n }}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>] : [],\n <MenuItem\n key={1}\n onClick={() => {\n handleShowDeleteModal(value.row.original);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ].flatMap((p) => p)}\n >\n <IconButton styleType='borderless'>\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n [onClickModify],\n );\n\n const { mutateAsync: deleteProperty } = useMutation({\n mutationFn: async (propertyId: string) => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteCustomCalculation(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n propertyId,\n );\n },\n onSuccess: async () => queryClient.invalidateQueries({ queryKey: [\"customCalculations\", iModelId, mappingId, groupId] }),\n });\n\n return (\n <PropertyTable\n propertyType=\"Custom Calculation\"\n columnsFactory={columnsFactory}\n data={customCalculations}\n isLoading={isLoading}\n onClickAdd={onClickAdd}\n refreshProperties={refresh}\n deleteProperty={deleteProperty}\n />\n );\n};\n"]}
|
|
@@ -34,39 +34,43 @@ const viewerUtils_1 = require("../../common/viewerUtils");
|
|
|
34
34
|
const presentation_frontend_1 = require("@itwin/presentation-frontend");
|
|
35
35
|
const GroupingApiConfigContext_1 = require("../context/GroupingApiConfigContext");
|
|
36
36
|
const useKeySetHiliteQueries_1 = require("../Groups/hooks/useKeySetHiliteQueries");
|
|
37
|
-
const
|
|
37
|
+
const PropertiesGroupColorContext_1 = require("../context/PropertiesGroupColorContext");
|
|
38
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
39
|
+
const useIsMounted_1 = require("../../common/hooks/useIsMounted");
|
|
38
40
|
const GroupColorToggle = ({ color, group, ...rest }) => {
|
|
39
|
-
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
40
41
|
const { iModelConnection } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
41
42
|
if (!iModelConnection) {
|
|
42
43
|
throw new Error("This component requires an active iModelConnection.");
|
|
43
44
|
}
|
|
44
|
-
const { showGroupColor, setShowGroupColor } = (0,
|
|
45
|
-
const { data: hiliteIdsResult } = (0, useKeySetHiliteQueries_1.useGroupKeySetQuery)(group, iModelConnection, showGroupColor);
|
|
45
|
+
const { showGroupColor, setShowGroupColor } = (0, PropertiesGroupColorContext_1.usePropertiesGroupColorContext)();
|
|
46
|
+
const { data: hiliteIdsResult, isFetched, isFetching } = (0, useKeySetHiliteQueries_1.useGroupKeySetQuery)(group, iModelConnection, showGroupColor);
|
|
47
|
+
const isMounted = (0, useIsMounted_1.useIsMounted)();
|
|
48
|
+
const { mutate: mutateVisualization, isLoading: isVisualizing } = (0, react_query_1.useMutation)({
|
|
49
|
+
mutationFn: async (hiliteIds) => {
|
|
50
|
+
(0, viewerUtils_1.clearAll)();
|
|
51
|
+
presentation_frontend_1.Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
|
|
52
|
+
(0, viewerUtils_1.visualizeElements)(hiliteIds.result.ids, color);
|
|
53
|
+
await (0, viewerUtils_1.zoomToElements)(hiliteIds.result.ids);
|
|
54
|
+
},
|
|
55
|
+
onError: (error) => {
|
|
56
|
+
itwinui_react_1.toaster.negative("There was an error visualizing group.");
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.error(error);
|
|
59
|
+
},
|
|
60
|
+
});
|
|
46
61
|
(0, react_1.useEffect)(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
presentation_frontend_1.Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
|
|
54
|
-
(0, viewerUtils_1.visualizeElements)(hiliteIdsResult.result.ids, color);
|
|
55
|
-
await (0, viewerUtils_1.zoomToElements)(hiliteIdsResult.result.ids);
|
|
56
|
-
}
|
|
62
|
+
isFetched && showGroupColor && hiliteIdsResult && isMounted && mutateVisualization(hiliteIdsResult);
|
|
63
|
+
}, [hiliteIdsResult, isFetched, isMounted, showGroupColor, mutateVisualization]);
|
|
64
|
+
const handleToggleChange = (0, react_1.useCallback)(() => {
|
|
65
|
+
setShowGroupColor((b) => {
|
|
66
|
+
if (b) {
|
|
67
|
+
(0, viewerUtils_1.clearAll)();
|
|
57
68
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
finally {
|
|
64
|
-
setIsLoading(false);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
void visualize();
|
|
68
|
-
}, [color, hiliteIdsResult, iModelConnection, showGroupColor]);
|
|
69
|
-
return (react_1.default.createElement(itwinui_react_1.ToggleSwitch, { label: "Color Group", disabled: isLoading, checked: showGroupColor, onChange: () => setShowGroupColor((b) => !b), ...rest }));
|
|
69
|
+
return !b;
|
|
70
|
+
});
|
|
71
|
+
}, [setShowGroupColor]);
|
|
72
|
+
const isLoading = isFetching || isVisualizing;
|
|
73
|
+
return (react_1.default.createElement(itwinui_react_1.ToggleSwitch, { label: "Color Group", disabled: isLoading, checked: showGroupColor, onChange: handleToggleChange, ...rest }));
|
|
70
74
|
};
|
|
71
75
|
exports.GroupColorToggle = GroupColorToggle;
|
|
72
76
|
//# sourceMappingURL=GroupColorToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+
|
|
1
|
+
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAsD;AAEtD,wDAA6D;AAE7D,0DAAuF;AACvF,wEAA4D;AAC5D,kFAAkF;AAElF,mFAA6E;AAC7E,wFAAwF;AACxF,uDAAoD;AACpD,kEAA+D;AAOxD,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,GAAG,IAAI,EACe,EAAE,EAAE;IAC1B,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC3D,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,IAAA,4DAA8B,GAAE,CAAC;IAC/E,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAA,4CAAmB,EAAC,KAAK,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;IACtH,MAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IAEjC,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAA,yBAAW,EAAC;QAC5E,UAAU,EAAE,KAAK,EAAE,SAAuB,EAAE,EAAE;YAC5C,IAAA,sBAAQ,GAAE,CAAC;YACX,oCAAY,CAAC,SAAS,CAAC,cAAc,CACnC,uBAAuB,EACvB,gBAAgB,CACjB,CAAC;YACF,IAAA,+BAAiB,EAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC/C,MAAM,IAAA,4BAAc,EAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,uBAAO,CAAC,QAAQ,CAAC,uCAAuC,CAAC,CAAC;YAC1D,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;KACF,CAAC,CAAC;IAEH,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,SAAS,IAAI,cAAc,IAAI,eAAe,IAAI,SAAS,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACtG,CAAC,EAAE,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEjF,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC1C,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;YACtB,IAAI,CAAC,EAAE;gBACL,IAAA,sBAAQ,GAAE,CAAC;aACZ;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,CACL,8BAAC,4BAAY,IACX,KAAK,EAAC,aAAa,EACnB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,kBAAkB,KACxB,IAAI,GACM,CACjB,CAAC;AACJ,CAAC,CAAC;AAtDW,QAAA,gBAAgB,oBAsD3B","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 { Group } 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\";\n\nexport type GroupColorToggleProps = Partial<ToggleSwitchProps> & {\n color: string;\n group: Group;\n};\n\nexport const GroupColorToggle = ({\n color,\n group,\n ...rest\n}: 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 { 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(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n visualizeElements(hiliteIds.result.ids, color);\n await zoomToElements(hiliteIds.result.ids);\n },\n onError: (error) => {\n toaster.negative(\"There was an error visualizing group.\");\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 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 (\n <ToggleSwitch\n label=\"Color Group\"\n disabled={isLoading}\n checked={showGroupColor}\n onChange={handleToggleChange}\n {...rest}\n ></ToggleSwitch>\n );\n};\n"]}
|
|
@@ -31,26 +31,21 @@ exports.GroupPropertyAction = exports.quantityTypesSelectionOptions = void 0;
|
|
|
31
31
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
32
32
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
|
-
const server_1 = require("react-dom/server");
|
|
35
34
|
const presentation_common_1 = require("@itwin/presentation-common");
|
|
36
35
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
37
36
|
const react_1 = __importStar(require("react"));
|
|
38
37
|
const ActionPanel_1 = __importDefault(require("../../SharedComponents/ActionPanel"));
|
|
39
38
|
const useValidator_1 = __importStar(require("../hooks/useValidator"));
|
|
40
|
-
const utils_1 = require("../../../common/utils");
|
|
41
39
|
const MappingClientContext_1 = require("../../context/MappingClientContext");
|
|
42
40
|
const GroupingApiConfigContext_1 = require("../../context/GroupingApiConfigContext");
|
|
43
|
-
const HorizontalTile_1 = require("../../SharedComponents/HorizontalTile");
|
|
44
41
|
const insights_client_1 = require("@itwin/insights-client");
|
|
45
|
-
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
46
|
-
const core_1 = require("@dnd-kit/core");
|
|
47
|
-
const sortable_1 = require("@dnd-kit/sortable");
|
|
48
|
-
const SortableHorizontalTile_1 = __importDefault(require("./SortableHorizontalTile"));
|
|
49
|
-
const react_split_1 = __importDefault(require("react-split"));
|
|
50
42
|
require("./GroupPropertyAction.scss");
|
|
51
43
|
const GroupPropertyUtils_1 = require("./GroupPropertyUtils");
|
|
52
44
|
const viewerUtils_1 = require("../../../common/viewerUtils");
|
|
53
45
|
const SaveModal_1 = require("./SaveModal");
|
|
46
|
+
const GroupsPropertiesSelectionModal_1 = require("./GroupsPropertiesSelectionModal");
|
|
47
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
48
|
+
const GroupPropertyListItem_1 = require("./GroupPropertyListItem");
|
|
54
49
|
exports.quantityTypesSelectionOptions = [
|
|
55
50
|
{ value: insights_client_1.QuantityType.Area, label: "Area" },
|
|
56
51
|
{ value: insights_client_1.QuantityType.Distance, label: "Distance" },
|
|
@@ -72,93 +67,49 @@ const GroupPropertyAction = ({ mappingId, group, groupProperty, onSaveSuccess, o
|
|
|
72
67
|
const [propertiesMetaData, setPropertiesMetaData] = (0, react_1.useState)([]);
|
|
73
68
|
const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = (0, react_1.useState)(false);
|
|
74
69
|
const [validator, showValidationMessage] = (0, useValidator_1.default)();
|
|
75
|
-
const [
|
|
76
|
-
const [
|
|
77
|
-
const
|
|
78
|
-
const [searched, setSearched] = (0, react_1.useState)(false);
|
|
79
|
-
const [activeDragProperty, setActiveDragProperty] = (0, react_1.useState)();
|
|
80
|
-
const sensors = (0, core_1.useSensors)((0, core_1.useSensor)(core_1.PointerSensor), (0, core_1.useSensor)(core_1.KeyboardSensor, {
|
|
81
|
-
coordinateGetter: sortable_1.sortableKeyboardCoordinates,
|
|
82
|
-
}));
|
|
83
|
-
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
|
84
|
-
const [showSaveModal, setShowSaveModal] = (0, react_1.useState)(false);
|
|
85
|
-
const handleDragStart = (0, react_1.useCallback)((event) => {
|
|
86
|
-
const { active } = event;
|
|
87
|
-
const activeProperty = selectedProperties.find((p) => active.id === p.key);
|
|
88
|
-
setActiveDragProperty(activeProperty);
|
|
89
|
-
}, [selectedProperties]);
|
|
90
|
-
const handleDragEnd = (0, react_1.useCallback)((event) => {
|
|
91
|
-
const { active, over } = event;
|
|
92
|
-
if (over && (active.id !== over.id)) {
|
|
93
|
-
setSelectedProperties((items) => {
|
|
94
|
-
const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);
|
|
95
|
-
const newIndex = selectedProperties.findIndex((p) => over.id === p.key);
|
|
96
|
-
return (0, sortable_1.arrayMove)(items, oldIndex, newIndex);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
setActiveDragProperty(undefined);
|
|
100
|
-
}, [selectedProperties]);
|
|
101
|
-
const filteredProperties = (0, react_1.useMemo)(() => propertiesMetaData.filter((p) => [p.displayLabel, p.categoryLabel, p.actualECClassName]
|
|
102
|
-
.map((l) => l.toLowerCase())
|
|
103
|
-
.some((l) => l.includes(activeSearchInput.toLowerCase()))), [activeSearchInput, propertiesMetaData]);
|
|
70
|
+
const [showPropertiesSelectionModal, setShowPropertiesSelectionModal] = (0, react_1.useState)(false);
|
|
71
|
+
const [showSaveConfirmationModal, setShowSaveConfirmationModal] = (0, react_1.useState)(false);
|
|
72
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
104
73
|
const reset = (0, react_1.useCallback)(() => {
|
|
105
74
|
setPropertyName("");
|
|
106
75
|
setDataType(insights_client_1.DataType.Undefined);
|
|
107
76
|
setSelectedProperties([]);
|
|
108
77
|
}, []);
|
|
78
|
+
const fetchPropertiesMetadata = (0, react_1.useCallback)(async () => {
|
|
79
|
+
if (!iModelConnection)
|
|
80
|
+
return;
|
|
81
|
+
const result = await (0, viewerUtils_1.manufactureKeys)(group.query, iModelConnection);
|
|
82
|
+
const descriptor = await (0, GroupPropertyUtils_1.fetchPresentationDescriptor)(iModelConnection, result);
|
|
83
|
+
// Only allow primitives and structs
|
|
84
|
+
const propertyFields = descriptor?.fields.filter((field) => field.type.valueFormat === presentation_common_1.PropertyValueFormat.Primitive ||
|
|
85
|
+
field.type.valueFormat === presentation_common_1.PropertyValueFormat.Struct) ?? [];
|
|
86
|
+
const propertiesMetaData = (0, GroupPropertyUtils_1.convertPresentationFields)(propertyFields);
|
|
87
|
+
let groupPropertyDetails = null;
|
|
88
|
+
if (groupProperty) {
|
|
89
|
+
const accessToken = await getAccessToken();
|
|
90
|
+
groupPropertyDetails = await mappingClient.getGroupProperty(accessToken, iModelId, mappingId, group.id, groupProperty.id);
|
|
91
|
+
}
|
|
92
|
+
return { propertiesMetaData, groupPropertyDetails };
|
|
93
|
+
}, [getAccessToken, group.id, group.query, groupProperty, iModelConnection, iModelId, mappingClient, mappingId]);
|
|
94
|
+
const { data, isFetching: isLoadingProperties, isSuccess: isLoadingPropertiesSuccessful } = (0, react_query_1.useQuery)(["groupProperties", iModelId, mappingId, group.id, groupProperty?.id, "metadata"], fetchPropertiesMetadata);
|
|
109
95
|
(0, react_1.useEffect)(() => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
setPropertiesMetaData(propertiesMetaData);
|
|
121
|
-
if (groupProperty) {
|
|
122
|
-
const accessToken = await getAccessToken();
|
|
123
|
-
let response;
|
|
124
|
-
try {
|
|
125
|
-
response = await mappingClient.getGroupProperty(accessToken, iModelId, mappingId, group.id, groupProperty.id);
|
|
126
|
-
setPropertyName(response.propertyName);
|
|
127
|
-
setOldPropertyName(response.propertyName);
|
|
128
|
-
setDataType(response.dataType);
|
|
129
|
-
setQuantityType(response.quantityType);
|
|
130
|
-
const properties = (0, GroupPropertyUtils_1.findProperties)(response.ecProperties, propertiesMetaData);
|
|
131
|
-
if (properties.length === 0) {
|
|
132
|
-
setPropertiesNotFoundAlert(true);
|
|
133
|
-
}
|
|
134
|
-
setSelectedProperties(properties);
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
(0, utils_1.handleError)(error.status);
|
|
96
|
+
if (isLoadingPropertiesSuccessful && data?.propertiesMetaData) {
|
|
97
|
+
setPropertiesMetaData(data.propertiesMetaData);
|
|
98
|
+
if (data.groupPropertyDetails) {
|
|
99
|
+
setPropertyName(data.groupPropertyDetails.propertyName);
|
|
100
|
+
setOldPropertyName(data.groupPropertyDetails.propertyName);
|
|
101
|
+
setDataType(data.groupPropertyDetails.dataType);
|
|
102
|
+
setQuantityType(data.groupPropertyDetails.quantityType);
|
|
103
|
+
const properties = (0, GroupPropertyUtils_1.findProperties)(data.groupPropertyDetails.ecProperties, data.propertiesMetaData);
|
|
104
|
+
if (properties.length === 0) {
|
|
105
|
+
setPropertiesNotFoundAlert(true);
|
|
138
106
|
}
|
|
107
|
+
setSelectedProperties(properties);
|
|
139
108
|
}
|
|
140
|
-
setIsLoading(false);
|
|
141
|
-
};
|
|
142
|
-
void generateProperties();
|
|
143
|
-
}, [getAccessToken, mappingClient, iModelConnection, iModelId, groupProperty, mappingId, group]);
|
|
144
|
-
const handleSaveClick = async () => {
|
|
145
|
-
if (!validator.allValid()) {
|
|
146
|
-
showValidationMessage(true);
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (oldPropertyName !== propertyName && oldPropertyName !== "") {
|
|
150
|
-
setShowSaveModal(true);
|
|
151
109
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
const handleCloseSaveModal = () => {
|
|
157
|
-
setShowSaveModal(false);
|
|
158
|
-
};
|
|
159
|
-
const onSave = async () => {
|
|
160
|
-
try {
|
|
161
|
-
setIsLoading(true);
|
|
110
|
+
}, [data, isLoadingPropertiesSuccessful]);
|
|
111
|
+
const { mutate: onSave, isLoading: isSaving } = (0, react_query_1.useMutation)({
|
|
112
|
+
mutationFn: async () => {
|
|
162
113
|
const accessToken = await getAccessToken();
|
|
163
114
|
const newGroupProperty = {
|
|
164
115
|
propertyName,
|
|
@@ -166,37 +117,33 @@ const GroupPropertyAction = ({ mappingId, group, groupProperty, onSaveSuccess, o
|
|
|
166
117
|
quantityType,
|
|
167
118
|
ecProperties: selectedProperties.map((p) => (0, GroupPropertyUtils_1.convertToECProperties)(p)).flat(),
|
|
168
119
|
};
|
|
169
|
-
groupProperty
|
|
170
|
-
?
|
|
171
|
-
:
|
|
120
|
+
return groupProperty
|
|
121
|
+
? mappingClient.updateGroupProperty(accessToken, iModelId, mappingId, group.id, groupProperty.id, newGroupProperty)
|
|
122
|
+
: mappingClient.createGroupProperty(accessToken, iModelId, mappingId, group.id, newGroupProperty);
|
|
123
|
+
},
|
|
124
|
+
onSuccess: async () => {
|
|
172
125
|
onSaveSuccess();
|
|
173
126
|
reset();
|
|
127
|
+
await queryClient.invalidateQueries(["groupProperties", iModelId, mappingId, group.id]);
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
const handleSaveClick = async () => {
|
|
131
|
+
if (!validator.allValid()) {
|
|
132
|
+
showValidationMessage(true);
|
|
133
|
+
return;
|
|
174
134
|
}
|
|
175
|
-
|
|
176
|
-
(
|
|
135
|
+
if (oldPropertyName !== propertyName && oldPropertyName !== "") {
|
|
136
|
+
setShowSaveConfirmationModal(true);
|
|
177
137
|
}
|
|
178
|
-
|
|
179
|
-
|
|
138
|
+
else {
|
|
139
|
+
onSave();
|
|
180
140
|
}
|
|
181
141
|
};
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, [searchInput]);
|
|
188
|
-
const clearSearch = (0, react_1.useCallback)(() => {
|
|
189
|
-
setSearchInput("");
|
|
190
|
-
setActiveSearchInput("");
|
|
191
|
-
setSearched(false);
|
|
192
|
-
}, []);
|
|
193
|
-
(0, react_1.useEffect)(() => {
|
|
194
|
-
if (searchInput.length === 0) {
|
|
195
|
-
setSearched(false);
|
|
196
|
-
clearSearch();
|
|
197
|
-
}
|
|
198
|
-
}, [searchInput, setSearched, clearSearch]);
|
|
199
|
-
return (react_1.default.createElement(core_1.DndContext, { sensors: sensors, collisionDetection: core_1.closestCenter, onDragStart: handleDragStart, onDragEnd: handleDragEnd },
|
|
142
|
+
const handleCloseSaveModal = () => {
|
|
143
|
+
setShowSaveConfirmationModal(false);
|
|
144
|
+
};
|
|
145
|
+
const isLoading = isLoadingProperties || isSaving;
|
|
146
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
200
147
|
react_1.default.createElement("div", { className: 'gmw-group-property-action-container' },
|
|
201
148
|
react_1.default.createElement(itwinui_react_1.Fieldset, { disabled: isLoading, className: 'gmw-property-options', legend: 'Property Details' },
|
|
202
149
|
react_1.default.createElement(itwinui_react_1.Text, { variant: 'small', as: 'small', className: 'gmw-field-legend' }, "Asterisk * indicates mandatory fields."),
|
|
@@ -225,67 +172,15 @@ const GroupPropertyAction = ({ mappingId, group, groupProperty, onSaveSuccess, o
|
|
|
225
172
|
react_1.default.createElement(itwinui_react_1.Alert, { type: "warning" }, "Warning: Could not match saved properties from the current generated list. It does not confirm or deny validity. Overwriting will occur if a new selection is made and saved."),
|
|
226
173
|
react_1.default.createElement(itwinui_react_1.Fieldset, { className: 'gmw-property-view-container', legend: "Mapped Properties" },
|
|
227
174
|
react_1.default.createElement("div", { className: "gmw-property-view-button" },
|
|
228
|
-
react_1.default.createElement(itwinui_react_1.Button, { onClick: async () =>
|
|
175
|
+
react_1.default.createElement(itwinui_react_1.Button, { onClick: async () => setShowPropertiesSelectionModal(true), disabled: isLoading }, "Select Properties")),
|
|
229
176
|
react_1.default.createElement("div", { className: "gmw-properties-list" }, selectedProperties.length === 0 && !isLoading ?
|
|
230
177
|
react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
231
178
|
react_1.default.createElement(itwinui_react_1.Text, null, "No properties selected."),
|
|
232
179
|
react_1.default.createElement(itwinui_react_1.Text, null, "Press the \"Select Properties\" button for options.")) :
|
|
233
|
-
selectedProperties.map((property) => (react_1.default.createElement(
|
|
180
|
+
selectedProperties.map((property) => (react_1.default.createElement(GroupPropertyListItem_1.GroupPropertyListItem, { key: property.key, content: `${property.displayLabel} (${property.propertyType})`, title: `${property.actualECClassName}`, description: property.categoryLabel })))))),
|
|
234
181
|
react_1.default.createElement(ActionPanel_1.default, { onSave: handleSaveClick, onCancel: onClickCancel, isLoading: isLoading, isSavingDisabled: selectedProperties.length === 0 || !propertyName || dataType === insights_client_1.DataType.Undefined }),
|
|
235
|
-
react_1.default.createElement(
|
|
236
|
-
|
|
237
|
-
clearSearch();
|
|
238
|
-
}, closeOnExternalClick: false },
|
|
239
|
-
react_1.default.createElement(react_split_1.default, { expandToMin: false, className: "gmw-property-selection-container", gutterAlign: "center", gutterSize: 2, gutter: () => {
|
|
240
|
-
// Expects HTMLElement
|
|
241
|
-
const dragHangle = (0, server_1.renderToStaticMarkup)(react_1.default.createElement(itwinui_react_1.Icon, { className: "gmw-gutter-drag-icon", size: "large" },
|
|
242
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgMoreVerticalSmall, null)));
|
|
243
|
-
const gutter = document.createElement("div");
|
|
244
|
-
gutter.className = `gmw-gutter`;
|
|
245
|
-
gutter.innerHTML = dragHangle;
|
|
246
|
-
return gutter;
|
|
247
|
-
}, direction: "horizontal" },
|
|
248
|
-
react_1.default.createElement(itwinui_react_1.Surface, { className: "gmw-available-properties", elevation: 1 },
|
|
249
|
-
react_1.default.createElement("div", { className: "gmw-available-properties-header" },
|
|
250
|
-
react_1.default.createElement(itwinui_react_1.Label, { as: "span" }, "Available Properties"),
|
|
251
|
-
react_1.default.createElement(itwinui_react_1.LabeledInput, { displayStyle: "inline", iconDisplayStyle: "inline", className: "gmw-available-prop-search", value: searchInput, size: "small", placeholder: "Search....", onChange: (event) => {
|
|
252
|
-
const { target: { value }, } = event;
|
|
253
|
-
setSearchInput(value);
|
|
254
|
-
}, onKeyDown: (event) => {
|
|
255
|
-
if (event.key === "Enter") {
|
|
256
|
-
startSearch();
|
|
257
|
-
}
|
|
258
|
-
}, svgIcon: searched ? (react_1.default.createElement(itwinui_react_1.IconButton, { onClick: clearSearch, styleType: "borderless", title: 'Clear Search' },
|
|
259
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgClose, null))) : (react_1.default.createElement(itwinui_react_1.IconButton, { onClick: startSearch, styleType: "borderless", title: 'Search' },
|
|
260
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgSearch, null))) })),
|
|
261
|
-
filteredProperties.length === 0 ?
|
|
262
|
-
react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
263
|
-
react_1.default.createElement(itwinui_react_1.Text, null, "No properties available. ")) :
|
|
264
|
-
react_1.default.createElement("div", { className: "gmw-properties-list" }, filteredProperties.map((property) => (react_1.default.createElement(HorizontalTile_1.HorizontalTile, { key: property.key, title: `${property.displayLabel} (${property.propertyType})`, titleTooltip: `${property.actualECClassName}`, subText: (0, utils_1.getLocalizedStringPresentation)(property.categoryLabel), actionGroup: null, selected: selectedProperties.some((p) => property.key === p.key), onClick: () => setSelectedProperties((sp) => sp.some((p) => property.key === p.key)
|
|
265
|
-
? sp.filter((p) => property.key !== p.key)
|
|
266
|
-
: [...sp, property]) }))))),
|
|
267
|
-
react_1.default.createElement(itwinui_react_1.Surface, { className: "gmw-selected-properties", elevation: 1 },
|
|
268
|
-
react_1.default.createElement(itwinui_react_1.Label, { as: "span" }, "Selected Properties"),
|
|
269
|
-
selectedProperties.length === 0 ?
|
|
270
|
-
react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
271
|
-
react_1.default.createElement(itwinui_react_1.Text, null, "No properties selected."),
|
|
272
|
-
react_1.default.createElement(itwinui_react_1.Text, null, "Add some by clicking on the properties shown left.")) :
|
|
273
|
-
react_1.default.createElement("div", { className: "gmw-properties-list" },
|
|
274
|
-
react_1.default.createElement(sortable_1.SortableContext, { items: selectedProperties.map((p) => p.key), strategy: sortable_1.verticalListSortingStrategy }, selectedProperties.map((property) => react_1.default.createElement(SortableHorizontalTile_1.default, { key: property.key, id: property.key, title: `${property.displayLabel} (${property.propertyType})`, titleTooltip: `${property.actualECClassName}`, subText: property.categoryLabel, actionGroup: react_1.default.createElement("div", null,
|
|
275
|
-
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless", title: "Remove", onClick: () => {
|
|
276
|
-
setSelectedProperties((sp) => sp.filter((p) => property.key !== p.key));
|
|
277
|
-
} },
|
|
278
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgRemove, null))) })))))),
|
|
279
|
-
react_1.default.createElement(itwinui_react_1.ModalButtonBar, null,
|
|
280
|
-
react_1.default.createElement(itwinui_react_1.Button, { onClick: () => {
|
|
281
|
-
setShowModal(false);
|
|
282
|
-
clearSearch();
|
|
283
|
-
}, styleType: "high-visibility" }, "Close"))),
|
|
284
|
-
react_1.default.createElement(SaveModal_1.SaveModal, { onSave: onSave, onClose: handleCloseSaveModal, showSaveModal: showSaveModal }),
|
|
285
|
-
react_1.default.createElement(core_1.DragOverlay, { zIndex: 9999 }, activeDragProperty ?
|
|
286
|
-
react_1.default.createElement(HorizontalTile_1.HorizontalTile, { title: `${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`, titleTooltip: `${activeDragProperty.actualECClassName}`, subText: activeDragProperty.categoryLabel, actionGroup: react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless" },
|
|
287
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgRemove, null)), dragHandle: react_1.default.createElement(itwinui_react_1.Icon, { className: "gmw-drag-icon", size: "large" },
|
|
288
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgDragHandleVertical, null)) }) : null)));
|
|
182
|
+
react_1.default.createElement(GroupsPropertiesSelectionModal_1.GroupsPropertiesSelectionModal, { showModal: showPropertiesSelectionModal, setShowModal: setShowPropertiesSelectionModal, selectedProperties: selectedProperties, setSelectedProperties: setSelectedProperties, propertiesMetaData: propertiesMetaData }),
|
|
183
|
+
react_1.default.createElement(SaveModal_1.SaveModal, { onSave: onSave, onClose: handleCloseSaveModal, showSaveModal: showSaveConfirmationModal })));
|
|
289
184
|
};
|
|
290
185
|
exports.GroupPropertyAction = GroupPropertyAction;
|
|
291
186
|
//# sourceMappingURL=GroupPropertyAction.js.map
|