@itwin/grouping-mapping-widget 0.23.0 → 0.24.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/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/Editing/GroupAction.js +5 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +44 -12
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +2 -1
- package/lib/cjs/components/Groups/groupsHelpers.js +8 -5
- 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/Import/SelectIModel.js +1 -2
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
- 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 +25 -0
- 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/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 +61 -166
- 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/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/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/esm/WidgetShell/GroupingMappingContent.js +2 -2
- package/lib/esm/WidgetShell/GroupingMappingContent.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/Editing/GroupAction.js +5 -1
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +45 -13
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +2 -1
- package/lib/esm/components/Groups/groupsHelpers.js +6 -4
- 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/Import/SelectIModel.js +1 -2
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
- 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 +25 -0
- package/lib/esm/components/Mappings/MappingsView.d.ts +2 -0
- package/lib/esm/components/Mappings/MappingsView.js +30 -6
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- 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 +63 -168
- 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/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/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/package.json +3 -2
- 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/context/PropertiesContext.d.ts +0 -15
- package/lib/cjs/components/context/PropertiesContext.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/context/PropertiesContext.d.ts +0 -15
- package/lib/esm/components/context/PropertiesContext.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAAwD;AACxD,oEAAiE;AAEjE,wDAa8B;AAC9B,+CAAyE;AACzE,qFAA6D;AAC7D,sEAAwE;AACxE,iDAAoF;AACpF,6EAAsE;AACtE,qFAAqF;AACrF,0EAAuE;AACvE,4DAAgE;AAMhE,oEAMoC;AAEpC,wCAQuB;AACvB,gDAK2B;AAC3B,sFAA8D;AAC9D,8DAAgC;AAChC,sCAAoC;AAEpC,6DAK8B;AAC9B,6DAA8D;AAC9D,2CAAwC;AAU3B,QAAA,6BAA6B,GAAiC;IACzE,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7C,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC/C,EAAE,KAAK,EAAE,8BAAY,CAAC,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC7D,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAAC,EAClC,SAAS,EACT,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O;oBAC1C,8BAAC,2CAAqB,OAAG,CACpB,GAET,CAAC,CAAC,CAAC,IAAI,CACC,CACH,CACd,CAAC;AACJ,CAAC,CAAC;AAldW,QAAA,mBAAmB,uBAkd9B","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 { renderToStaticMarkup } from \"react-dom/server\";\nimport { PropertyValueFormat } from \"@itwin/presentation-common\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport {\n Alert,\n Button,\n Fieldset,\n Icon,\n IconButton,\n Label,\n LabeledInput,\n LabeledSelect,\n Modal,\n ModalButtonBar,\n Surface,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { getLocalizedStringPresentation, handleError } from \"../../../common/utils\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { HorizontalTile } from \"../../SharedComponents/HorizontalTile\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport type {\n Group,\n GroupProperty,\n GroupPropertyCreate,\n} from \"@itwin/insights-client\";\nimport {\n SvgClose,\n SvgDragHandleVertical,\n SvgMoreVerticalSmall,\n SvgRemove,\n SvgSearch,\n} from \"@itwin/itwinui-icons-react\";\nimport type { DragEndEvent, DragStartEvent } from \"@dnd-kit/core\";\nimport {\n closestCenter,\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport SortableHorizontalTile from \"./SortableHorizontalTile\";\nimport Split from \"react-split\";\nimport \"./GroupPropertyAction.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport {\n convertPresentationFields,\n convertToECProperties,\n fetchPresentationDescriptor,\n findProperties,\n} from \"./GroupPropertyUtils\";\nimport { manufactureKeys } from \"../../../common/viewerUtils\";\nimport { SaveModal } from \"./SaveModal\";\n\nexport interface GroupPropertyActionProps {\n mappingId: string;\n group: Group;\n groupProperty?: GroupProperty;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<QuantityType>[] = [\n { value: QuantityType.Area, label: \"Area\" },\n { value: QuantityType.Distance, label: \"Distance\" },\n { value: QuantityType.Force, label: \"Force\" },\n { value: QuantityType.Mass, label: \"Mass\" },\n { value: QuantityType.Monetary, label: \"Monetary\" },\n { value: QuantityType.Time, label: \"Time\" },\n { value: QuantityType.Volume, label: \"Volume\" },\n { value: QuantityType.Undefined, label: \"No Quantity Type\" },\n];\n\nexport const GroupPropertyAction = ({\n mappingId,\n group,\n groupProperty,\n onSaveSuccess,\n onClickCancel,\n}: GroupPropertyActionProps) => {\n const { getAccessToken, iModelId, iModelConnection } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [oldPropertyName, setOldPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(DataType.Undefined);\n const [quantityType, setQuantityType] = useState<QuantityType>(QuantityType.Undefined);\n const [selectedProperties, setSelectedProperties] = useState<PropertyMetaData[]>([]);\n const [propertiesMetaData, setPropertiesMetaData] = useState<PropertyMetaData[]>([]);\n const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = useState<boolean>(false);\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [searched, setSearched] = useState<boolean>(false);\n const [activeDragProperty, setActiveDragProperty] = useState<PropertyMetaData | undefined>();\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n const [showModal, setShowModal] = useState<boolean>(false);\n const [showSaveModal, setShowSaveModal] = useState<boolean>(false);\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n const { active } = event;\n const activeProperty = selectedProperties.find((p) => active.id === p.key);\n setActiveDragProperty(activeProperty);\n }, [selectedProperties]);\n\n const handleDragEnd = useCallback((event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && (active.id !== over.id)) {\n setSelectedProperties((items) => {\n const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);\n const newIndex = selectedProperties.findIndex((p) => over.id === p.key);\n\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n\n setActiveDragProperty(undefined);\n }, [selectedProperties]);\n\n const filteredProperties = useMemo(\n () =>\n propertiesMetaData.filter((p) =>\n [p.displayLabel, p.categoryLabel, p.actualECClassName]\n .map((l) => l.toLowerCase())\n .some((l) => l.includes(activeSearchInput.toLowerCase()))\n ),\n [activeSearchInput, propertiesMetaData]\n );\n\n const reset = useCallback(() => {\n setPropertyName(\"\");\n setDataType(DataType.Undefined);\n setSelectedProperties([]);\n }, []);\n\n useEffect(() => {\n const generateProperties = async () => {\n setIsLoading(true);\n\n if (!iModelConnection) return;\n\n const result = await manufactureKeys(group.query, iModelConnection);\n\n const descriptor = await fetchPresentationDescriptor(iModelConnection, result);\n\n // Only allow primitives and structs\n const propertyFields =\n descriptor?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n const propertiesMetaData = convertPresentationFields(propertyFields);\n\n setPropertiesMetaData(propertiesMetaData);\n\n if (groupProperty) {\n const accessToken = await getAccessToken();\n let response: GroupProperty | undefined;\n try {\n response = await mappingClient.getGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n group.id,\n groupProperty.id\n );\n\n setPropertyName(response.propertyName);\n setOldPropertyName(response.propertyName);\n setDataType(response.dataType);\n setQuantityType(response.quantityType);\n const properties = findProperties(response.ecProperties, propertiesMetaData);\n if (properties.length === 0) {\n setPropertiesNotFoundAlert(true);\n }\n\n setSelectedProperties(properties);\n } catch (error: any) {\n handleError(error.status);\n }\n }\n\n setIsLoading(false);\n };\n void generateProperties();\n }, [getAccessToken, mappingClient, iModelConnection, iModelId, groupProperty, mappingId, group]);\n\n const handleSaveClick = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n if (oldPropertyName !== propertyName && oldPropertyName !== \"\") {\n setShowSaveModal(true);\n } else {\n await onSave();\n }\n };\n\n const handleCloseSaveModal = () => {\n setShowSaveModal(false);\n };\n\n const onSave = async () => {\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const newGroupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: selectedProperties.map((p) => convertToECProperties(p)).flat(),\n };\n groupProperty\n ? await mappingClient.updateGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n group.id,\n groupProperty.id,\n newGroupProperty\n )\n : await mappingClient.createGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n group.id,\n newGroupProperty\n );\n onSaveSuccess();\n reset();\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n };\n\n const startSearch = useCallback(() => {\n if (!searchInput) return;\n setActiveSearchInput(searchInput);\n setSearched(true);\n }, [searchInput]);\n\n const clearSearch = useCallback(() => {\n setSearchInput(\"\");\n setActiveSearchInput(\"\");\n setSearched(false);\n }, []);\n\n useEffect(() => {\n if (searchInput.length === 0) {\n setSearched(false);\n clearSearch();\n }\n }, [searchInput, setSearched, clearSearch]);\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <div className='gmw-group-property-action-container'>\n <Fieldset disabled={isLoading} className='gmw-property-options' legend='Property Details'>\n <Text variant='small' as='small' className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={\"Data Type\"}\n id='dataType'\n options={[\n { value: DataType.Boolean, label: \"Boolean\" },\n { value: DataType.Number, label: \"Number\" },\n { value: DataType.String, label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n {propertiesNotFoundAlert &&\n <Alert type=\"warning\">\n 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.\n </Alert>\n }\n <Fieldset className='gmw-property-view-container' legend=\"Mapped Properties\">\n <div className=\"gmw-property-view-button\">\n <Button\n onClick={async () => setShowModal(true)}\n disabled={isLoading}\n >\n Select Properties\n </Button>\n </div>\n <div className=\"gmw-properties-list\">\n {selectedProperties.length === 0 && !isLoading ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Press the "Select Properties" button for options.</Text>\n </div> :\n selectedProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={getLocalizedStringPresentation(property.categoryLabel)}\n actionGroup={null}\n />\n ))}\n </div>\n </Fieldset>\n </div>\n <ActionPanel\n onSave={handleSaveClick}\n onCancel={onClickCancel}\n isLoading={isLoading}\n isSavingDisabled={\n selectedProperties.length === 0 || !propertyName || dataType === DataType.Undefined\n }\n />\n <Modal\n title=\"Properties Selection\"\n isOpen={showModal}\n onClose={() => {\n setShowModal(false);\n clearSearch();\n }}\n closeOnExternalClick={false}\n >\n <Split\n expandToMin={false}\n className=\"gmw-property-selection-container\"\n gutterAlign=\"center\"\n gutterSize={2}\n gutter={() => {\n // Expects HTMLElement\n const dragHangle = renderToStaticMarkup(\n <Icon className=\"gmw-gutter-drag-icon\" size=\"large\">\n <SvgMoreVerticalSmall />\n </Icon>\n );\n const gutter = document.createElement(\"div\");\n gutter.className = `gmw-gutter`;\n gutter.innerHTML = dragHangle;\n return gutter;\n }}\n direction=\"horizontal\">\n <Surface className=\"gmw-available-properties\" elevation={1}>\n <div className=\"gmw-available-properties-header\">\n <Label as=\"span\">Available Properties</Label>\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"gmw-available-prop-search\"\n value={searchInput}\n size=\"small\"\n placeholder=\"Search....\"\n onChange={(event) => {\n const {\n target: { value },\n } = event;\n setSearchInput(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n startSearch();\n }\n }}\n svgIcon={\n searched ? (\n <IconButton onClick={clearSearch} styleType=\"borderless\" title='Clear Search'>\n <SvgClose />\n </IconButton>\n ) : (\n <IconButton onClick={startSearch} styleType=\"borderless\" title='Search'>\n <SvgSearch />\n </IconButton>\n )\n }\n />\n </div>\n {filteredProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties available. </Text>\n </div> :\n <div className=\"gmw-properties-list\">\n {\n filteredProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={getLocalizedStringPresentation(property.categoryLabel)}\n actionGroup={null}\n selected={selectedProperties.some((p) => property.key === p.key)}\n onClick={() =>\n setSelectedProperties((sp) =>\n sp.some((p) => property.key === p.key)\n ? sp.filter(\n (p) => property.key !== p.key\n )\n : [...sp, property]\n )\n }\n />\n ))}\n </div>}\n </Surface>\n <Surface className=\"gmw-selected-properties\" elevation={1}>\n <Label as=\"span\">Selected Properties</Label>\n {selectedProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Add some by clicking on the properties shown left.</Text>\n </div> :\n <div className=\"gmw-properties-list\" >\n <SortableContext\n items={selectedProperties.map((p) => p.key)}\n strategy={verticalListSortingStrategy}\n >\n {selectedProperties.map((property) =>\n <SortableHorizontalTile\n key={property.key}\n id={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={\n <div>\n <IconButton\n styleType=\"borderless\"\n title=\"Remove\"\n onClick={() => {\n setSelectedProperties((sp) => sp.filter(\n (p) => property.key !== p.key\n ));\n }\n }>\n <SvgRemove />\n </IconButton>\n </div>\n }\n />)}\n </SortableContext>\n </div>}\n </Surface>\n </Split>\n <ModalButtonBar>\n <Button\n onClick={() => {\n setShowModal(false);\n clearSearch();\n }}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n <SaveModal\n onSave={onSave}\n onClose={handleCloseSaveModal}\n showSaveModal={showSaveModal}\n />\n <DragOverlay zIndex={9999}>\n {activeDragProperty ?\n <HorizontalTile\n title={`${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`}\n titleTooltip={`${activeDragProperty.actualECClassName}`}\n subText={activeDragProperty.categoryLabel}\n actionGroup={\n <IconButton\n styleType=\"borderless\">\n <SvgRemove />\n </IconButton>}\n dragHandle={\n <Icon className=\"gmw-drag-icon\" size=\"large\">\n <SvgDragHandleVertical />\n </Icon>\n }\n /> : null}\n </DragOverlay>\n </DndContext>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAAiE;AAEjE,wDAO8B;AAC9B,+CAAgE;AAChE,qFAA6D;AAC7D,sEAAwE;AACxE,6EAAsE;AACtE,qFAAqF;AACrF,0EAAuE;AACvE,4DAAgE;AAMhE,sCAAoC;AAEpC,6DAK8B;AAC9B,6DAA8D;AAC9D,2CAAwC;AACxC,qFAAkF;AAClF,uDAA8E;AAUjE,QAAA,6BAA6B,GAAiC;IACzE,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7C,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC/C,EAAE,KAAK,EAAE,8BAAY,CAAC,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC7D,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAAC,EAClC,SAAS,EACT,KAAK,EACL,aAAa,EACb,aAAa,EACb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G,QAAQ,CAAC,YAAY,KAAK,QAAQ,CAAC,YAAY,GAAG,EAC5D,YAAY,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE,EAC7C,OAAO,EAAE,QAAQ,CAAC,aAAa,EAC/B,WAAW,EAAE,IAAI,GACjB,CACH,CAAC,CACA,CACG,CACP;QACN,8BAAC,qBAAW,IACV,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EACd,kBAAkB,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,QAAQ,KAAK,0BAAQ,CAAC,SAAS,GAErF;QACF,8BAAC,+DAA8B,IAC7B,SAAS,EAAE,4BAA4B,EACvC,YAAY,EAAE,+BAA+B,EAC7C,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,GACtC;QACF,8BAAC,qBAAS,IACR,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,oBAAoB,EAC7B,aAAa,EAAE,yBAAyB,GACxC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AA1PW,QAAA,mBAAmB,uBA0P9B","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 { PropertyValueFormat } from \"@itwin/presentation-common\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport {\n Alert,\n Button,\n Fieldset,\n LabeledInput,\n LabeledSelect,\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 { useMappingClient } from \"../../context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { HorizontalTile } from \"../../SharedComponents/HorizontalTile\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport type {\n Group,\n GroupProperty,\n GroupPropertyCreate,\n} from \"@itwin/insights-client\";\nimport \"./GroupPropertyAction.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport {\n convertPresentationFields,\n convertToECProperties,\n fetchPresentationDescriptor,\n findProperties,\n} from \"./GroupPropertyUtils\";\nimport { manufactureKeys } from \"../../../common/viewerUtils\";\nimport { SaveModal } from \"./SaveModal\";\nimport { GroupsPropertiesSelectionModal } from \"./GroupsPropertiesSelectionModal\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nexport interface GroupPropertyActionProps {\n mappingId: string;\n group: Group;\n groupProperty?: GroupProperty;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<QuantityType>[] = [\n { value: QuantityType.Area, label: \"Area\" },\n { value: QuantityType.Distance, label: \"Distance\" },\n { value: QuantityType.Force, label: \"Force\" },\n { value: QuantityType.Mass, label: \"Mass\" },\n { value: QuantityType.Monetary, label: \"Monetary\" },\n { value: QuantityType.Time, label: \"Time\" },\n { value: QuantityType.Volume, label: \"Volume\" },\n { value: QuantityType.Undefined, label: \"No Quantity Type\" },\n];\n\nexport const GroupPropertyAction = ({\n mappingId,\n group,\n groupProperty,\n onSaveSuccess,\n onClickCancel,\n}: GroupPropertyActionProps) => {\n const { getAccessToken, iModelId, iModelConnection } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [oldPropertyName, setOldPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(DataType.Undefined);\n const [quantityType, setQuantityType] = useState<QuantityType>(QuantityType.Undefined);\n const [selectedProperties, setSelectedProperties] = useState<PropertyMetaData[]>([]);\n const [propertiesMetaData, setPropertiesMetaData] = useState<PropertyMetaData[]>([]);\n const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = useState<boolean>(false);\n const [validator, showValidationMessage] = useValidator();\n const [showPropertiesSelectionModal, setShowPropertiesSelectionModal] = useState<boolean>(false);\n const [showSaveConfirmationModal, setShowSaveConfirmationModal] = useState<boolean>(false);\n const queryClient = useQueryClient();\n\n const reset = useCallback(() => {\n setPropertyName(\"\");\n setDataType(DataType.Undefined);\n setSelectedProperties([]);\n }, []);\n\n const fetchPropertiesMetadata = useCallback(async () => {\n if (!iModelConnection) return;\n\n const result = await manufactureKeys(group.query, iModelConnection);\n const descriptor = await fetchPresentationDescriptor(iModelConnection, result);\n\n // Only allow primitives and structs\n const propertyFields = descriptor?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n const propertiesMetaData = convertPresentationFields(propertyFields);\n\n let groupPropertyDetails = null;\n if (groupProperty) {\n const accessToken = await getAccessToken();\n groupPropertyDetails = await mappingClient.getGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n group.id,\n groupProperty.id\n );\n }\n\n return { propertiesMetaData, groupPropertyDetails };\n }, [getAccessToken, group.id, group.query, groupProperty, iModelConnection, iModelId, mappingClient, mappingId]);\n\n const { data, isFetching: isLoadingProperties, isSuccess: isLoadingPropertiesSuccessful } = useQuery([\"groupProperties\", iModelId, mappingId, group.id, groupProperty?.id, \"metadata\"], fetchPropertiesMetadata);\n\n useEffect(() => {\n if (isLoadingPropertiesSuccessful && data?.propertiesMetaData) {\n setPropertiesMetaData(data.propertiesMetaData);\n\n if (data.groupPropertyDetails) {\n setPropertyName(data.groupPropertyDetails.propertyName);\n setOldPropertyName(data.groupPropertyDetails.propertyName);\n setDataType(data.groupPropertyDetails.dataType);\n setQuantityType(data.groupPropertyDetails.quantityType);\n\n const properties = findProperties(data.groupPropertyDetails.ecProperties, data.propertiesMetaData);\n if (properties.length === 0) {\n setPropertiesNotFoundAlert(true);\n }\n\n setSelectedProperties(properties);\n }\n }\n }, [data, isLoadingPropertiesSuccessful]);\n\n const { mutate: onSave, isLoading: isSaving } = useMutation({\n mutationFn: async () => {\n const accessToken = await getAccessToken();\n const newGroupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: selectedProperties.map((p) => convertToECProperties(p)).flat(),\n };\n\n return groupProperty\n ? mappingClient.updateGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n group.id,\n groupProperty.id,\n newGroupProperty\n )\n : mappingClient.createGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n group.id,\n newGroupProperty\n );\n },\n onSuccess: async () => {\n onSaveSuccess();\n reset();\n await queryClient.invalidateQueries([\"groupProperties\", iModelId, mappingId, group.id]);\n },\n });\n\n const handleSaveClick = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n if (oldPropertyName !== propertyName && oldPropertyName !== \"\") {\n setShowSaveConfirmationModal(true);\n } else {\n onSave();\n }\n };\n\n const handleCloseSaveModal = () => {\n setShowSaveConfirmationModal(false);\n };\n\n const isLoading = isLoadingProperties || isSaving;\n\n return (\n <>\n <div className='gmw-group-property-action-container'>\n <Fieldset disabled={isLoading} className='gmw-property-options' legend='Property Details'>\n <Text variant='small' as='small' className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={\"Data Type\"}\n id='dataType'\n options={[\n { value: DataType.Boolean, label: \"Boolean\" },\n { value: DataType.Number, label: \"Number\" },\n { value: DataType.String, label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n {propertiesNotFoundAlert &&\n <Alert type=\"warning\">\n 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.\n </Alert>\n }\n <Fieldset className='gmw-property-view-container' legend=\"Mapped Properties\">\n <div className=\"gmw-property-view-button\">\n <Button\n onClick={async () => setShowPropertiesSelectionModal(true)}\n disabled={isLoading}\n >\n Select Properties\n </Button>\n </div>\n <div className=\"gmw-properties-list\">\n {selectedProperties.length === 0 && !isLoading ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Press the "Select Properties" button for options.</Text>\n </div> :\n selectedProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={null}\n />\n ))}\n </div>\n </Fieldset>\n </div>\n <ActionPanel\n onSave={handleSaveClick}\n onCancel={onClickCancel}\n isLoading={isLoading}\n isSavingDisabled={\n selectedProperties.length === 0 || !propertyName || dataType === DataType.Undefined\n }\n />\n <GroupsPropertiesSelectionModal\n showModal={showPropertiesSelectionModal}\n setShowModal={setShowPropertiesSelectionModal}\n selectedProperties={selectedProperties}\n setSelectedProperties={setSelectedProperties}\n propertiesMetaData={propertiesMetaData}\n />\n <SaveModal\n onSave={onSave}\n onClose={handleCloseSaveModal}\n showSaveModal={showSaveConfirmationModal}\n />\n </>\n );\n};\n"]}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
flex-grow: 1;
|
|
41
41
|
gap: var(--iui-size-s);
|
|
42
|
-
min-height:
|
|
42
|
+
min-height: calc(var(--iui-size-3x1) * 2);
|
|
43
43
|
padding: var(--iui-size-s) var(--iui-size-m);
|
|
44
44
|
min-width: 0;
|
|
45
45
|
.gmw-property-view-button {
|
|
@@ -47,51 +47,6 @@
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.gmw-property-selection-container {
|
|
51
|
-
display: flex;
|
|
52
|
-
gap: var(--iui-size-xs);
|
|
53
|
-
width: 45vw;
|
|
54
|
-
min-width: 100%;
|
|
55
|
-
height: 75vh;
|
|
56
|
-
|
|
57
|
-
.gmw-gutter {
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
align-items: center;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.gmw-selected-properties {
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
gap: var(--iui-size-s);
|
|
68
|
-
padding: var(--iui-size-s) var(--iui-size-m);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.gmw-available-properties {
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
gap: var(--iui-size-s);
|
|
75
|
-
padding: var(--iui-size-s) var(--iui-size-m);
|
|
76
|
-
.gmw-available-properties-header {
|
|
77
|
-
display: flex;
|
|
78
|
-
justify-content: space-between;
|
|
79
|
-
flex-wrap: wrap;
|
|
80
|
-
gap: var(--iui-size-xs);
|
|
81
|
-
.gmw-available-prop-search {
|
|
82
|
-
flex: 1 1 80px;
|
|
83
|
-
min-width: 80px;
|
|
84
|
-
max-width: 300px;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.gmw-gutter-drag-icon {
|
|
91
|
-
justify-content: center;
|
|
92
|
-
cursor: col-resize;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
50
|
.gmw-empty-selection {
|
|
96
51
|
display: flex;
|
|
97
52
|
justify-content: center;
|
|
@@ -35,50 +35,47 @@ 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 GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, groupProperties, 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
|
-
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless', title: 'Property Options' },
|
|
69
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgMore, { style: {
|
|
70
|
-
width: "16px",
|
|
71
|
-
height: "16px",
|
|
72
|
-
} }))));
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
],
|
|
45
|
+
id: "propertyName",
|
|
46
|
+
Header: "Property",
|
|
47
|
+
accessor: "propertyName",
|
|
48
|
+
Cell: (value) => (react_1.default.createElement(PropertyNameCell_1.PropertyNameCell, { property: value.row.original, onClickModify: onClickModify })),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "dropdown",
|
|
52
|
+
Header: "",
|
|
53
|
+
width: 80,
|
|
54
|
+
Cell: (value) => {
|
|
55
|
+
return (react_1.default.createElement(itwinui_react_1.DropdownMenu, { menuItems: (close) => [
|
|
56
|
+
onClickModify ? [
|
|
57
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 0, onClick: () => {
|
|
58
|
+
onClickModify(value.row.original);
|
|
59
|
+
close();
|
|
60
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgEdit, null) }, "Modify"),
|
|
61
|
+
] : [],
|
|
62
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 1, onClick: () => {
|
|
63
|
+
handleShowDeleteModal(value.row.original);
|
|
64
|
+
close();
|
|
65
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgDelete, null) }, "Remove"),
|
|
66
|
+
].flatMap((p) => p) },
|
|
67
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless', title: 'Property Options' },
|
|
68
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgMore, null))));
|
|
69
|
+
},
|
|
76
70
|
},
|
|
77
71
|
], [onClickModify]);
|
|
78
|
-
const deleteProperty = (0,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
const { mutateAsync: deleteProperty } = (0, react_query_1.useMutation)({
|
|
73
|
+
mutationFn: async (propertyId) => {
|
|
74
|
+
const accessToken = await getAccessToken();
|
|
75
|
+
await mappingClient.deleteGroupProperty(accessToken, iModelId, mappingId, groupId, propertyId);
|
|
76
|
+
},
|
|
77
|
+
onSuccess: async () => queryClient.invalidateQueries({ queryKey: ["groupProperties", iModelId, mappingId, groupId] }),
|
|
78
|
+
});
|
|
82
79
|
return (react_1.default.createElement(PropertyTable_1.PropertyTable, { propertyType: "Group", columnsFactory: columnsFactory, data: groupProperties, isLoading: isLoading, onClickAdd: onClickAdd, refreshProperties: refresh, deleteProperty: deleteProperty }));
|
|
83
80
|
};
|
|
84
81
|
exports.GroupPropertyTable = GroupPropertyTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyTable.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":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAIoC;AACpC,wDAI8B;AAC9B,+CAA2C;AAG3C,6EAAsE;AACtE,0DAAuD;AACvD,oDAAiD;AACjD,qFAAqF;AACrF,uDAAoE;AAa7D,MAAM,kBAAkB,GAAG,CAAC,EACjC,SAAS,EACT,OAAO,EACP,UAAU,EACV,aAAa,EACb,SAAS,EACT,eAAe,EACf,OAAO,GACiB,EAAE,EAAE;IAC5B,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,qBAAqD,EAA2B,EAAE,CAAC;QAClF;YACE,EAAE,EAAE,cAAc;YAClB,MAAM,EAAE,UAAU;YAClB,QAAQ,EAAE,cAAc;YACxB,IAAI,EAAE,CAA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Ac,EAAE,CAAC;YAC3C,MAAM,aAAa,CAAC,mBAAmB,CACrC,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,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;KACtH,CAAC,CAAC;IAEH,OAAO,CACL,8BAAC,6BAAa,IACZ,YAAY,EAAC,OAAO,EACpB,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,eAAe,EACrB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,OAAO,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AA9FW,QAAA,kBAAkB,sBA8F7B","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 { GroupProperty } 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 GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n onClickAdd?: () => void;\n onClickModify?: (value: GroupProperty) => void;\n isLoading: boolean;\n groupProperties: GroupProperty[];\n refresh: () => Promise<void>;\n}\n\nexport const GroupPropertyTable = ({\n mappingId,\n groupId,\n onClickAdd,\n onClickModify,\n isLoading,\n groupProperties,\n refresh,\n}: GroupPropertyTableProps) => {\n const mappingClient = useMappingClient();\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const queryClient = useQueryClient();\n\n const columnsFactory = useCallback(\n (handleShowDeleteModal: (value: GroupProperty) => void): Column<GroupProperty>[] => [\n {\n id: \"propertyName\",\n Header: \"Property\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<GroupProperty>) => (\n <PropertyNameCell\n property={value.row.original}\n onClickModify={onClickModify}\n />\n ),\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<GroupProperty>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n 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 ] : [],\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' title='Property Options'>\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.deleteGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n propertyId,\n );\n },\n onSuccess: async () => queryClient.invalidateQueries({ queryKey: [\"groupProperties\", iModelId, mappingId, groupId] }),\n });\n\n return (\n <PropertyTable\n propertyType=\"Group\"\n columnsFactory={columnsFactory}\n data={groupProperties}\n isLoading={isLoading}\n onClickAdd={onClickAdd}\n refreshProperties={refresh}\n deleteProperty={deleteProperty}\n />\n );\n};\n"]}
|
|
@@ -21,6 +21,9 @@ const convertType = (type) => {
|
|
|
21
21
|
return insights_client_1.DataType.String;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
+
const generateKey = (parentPropertyClassName, actualECClassName, propertyTraversal) => {
|
|
25
|
+
return `${parentPropertyClassName}|${actualECClassName}|${propertyTraversal.join("|")}`;
|
|
26
|
+
};
|
|
24
27
|
const extractPrimitives = (propertyTraversal, propertyField) => propertyField.properties.map((property) => {
|
|
25
28
|
const propertyName = property.property.name;
|
|
26
29
|
const displayLabel = propertyField.label;
|
|
@@ -43,7 +46,7 @@ const extractPrimitives = (propertyTraversal, propertyField) => propertyField.pr
|
|
|
43
46
|
primitiveNavigationClass,
|
|
44
47
|
actualECClassName,
|
|
45
48
|
parentPropertyClassName,
|
|
46
|
-
key:
|
|
49
|
+
key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),
|
|
47
50
|
categoryLabel: propertyField.category.label,
|
|
48
51
|
});
|
|
49
52
|
});
|
|
@@ -62,7 +65,7 @@ const extractPrimitiveStructProperties = (propertyTraversal, members, categoryLa
|
|
|
62
65
|
primitiveNavigationClass: "",
|
|
63
66
|
actualECClassName,
|
|
64
67
|
parentPropertyClassName,
|
|
65
|
-
key:
|
|
68
|
+
key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),
|
|
66
69
|
categoryLabel,
|
|
67
70
|
});
|
|
68
71
|
}
|
|
@@ -123,64 +126,75 @@ const extractNested = (propertyTraversal, propertyFields) => propertyFields.flat
|
|
|
123
126
|
}
|
|
124
127
|
return [];
|
|
125
128
|
});
|
|
126
|
-
const convertPresentationFields = (propertyFields) =>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
extractedPrimitive
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// Get structs
|
|
139
|
-
case presentation_common_1.PropertyValueFormat.Struct: {
|
|
140
|
-
const nestedContentField = property;
|
|
141
|
-
// Only handling single path and not handling nested content fields within navigations
|
|
142
|
-
if (nestedContentField.pathToPrimaryClass &&
|
|
143
|
-
nestedContentField.pathToPrimaryClass.length > 1) {
|
|
129
|
+
const convertPresentationFields = (propertyFields) => {
|
|
130
|
+
const uniquePropertiesMap = new Map();
|
|
131
|
+
propertyFields.forEach((property) => {
|
|
132
|
+
switch (property.type.valueFormat) {
|
|
133
|
+
case presentation_common_1.PropertyValueFormat.Primitive: {
|
|
134
|
+
// Generate base ECProperty
|
|
135
|
+
const extractedPrimitives = extractPrimitives([], property);
|
|
136
|
+
extractedPrimitives.forEach((extractedPrimitive) => {
|
|
137
|
+
extractedPrimitive.sourceSchema = "*";
|
|
138
|
+
extractedPrimitive.sourceClassName = "*";
|
|
139
|
+
uniquePropertiesMap.set(extractedPrimitive.key, extractedPrimitive);
|
|
140
|
+
});
|
|
144
141
|
break;
|
|
145
142
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
.name === "BisCore:ElementOwnsMultiAspects")) {
|
|
153
|
-
const fullClassName = nestedContentField.contentClassInfo.name;
|
|
154
|
-
const sourceSchema = fullClassName.split(":")[0];
|
|
155
|
-
const sourceClassName = fullClassName.split(":")[1];
|
|
156
|
-
const extractedNested = extractNested([], nestedContentField.nestedFields);
|
|
157
|
-
const aspectExtractedNested = extractedNested.map((ecProperty) => ({ ...ecProperty, sourceSchema, sourceClassName }));
|
|
158
|
-
return aspectExtractedNested;
|
|
159
|
-
}
|
|
143
|
+
case presentation_common_1.PropertyValueFormat.Struct: {
|
|
144
|
+
// Get structs
|
|
145
|
+
const nestedContentField = property;
|
|
146
|
+
// Only handling single path and not handling nested content fields within navigations
|
|
147
|
+
if (nestedContentField.pathToPrimaryClass &&
|
|
148
|
+
nestedContentField.pathToPrimaryClass.length > 1) {
|
|
160
149
|
break;
|
|
161
150
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
151
|
+
switch (nestedContentField.relationshipMeaning) {
|
|
152
|
+
case presentation_common_1.RelationshipMeaning.SameInstance: {
|
|
153
|
+
// Check for aspects.
|
|
154
|
+
if ((nestedContentField.pathToPrimaryClass[0].relationshipInfo
|
|
155
|
+
.name === "BisCore:ElementOwnsUniqueAspect" ||
|
|
156
|
+
nestedContentField.pathToPrimaryClass[0].relationshipInfo
|
|
157
|
+
.name === "BisCore:ElementOwnsMultiAspects")) {
|
|
158
|
+
const fullClassName = nestedContentField.contentClassInfo.name;
|
|
159
|
+
const sourceSchema = fullClassName.split(":")[0];
|
|
160
|
+
const sourceClassName = fullClassName.split(":")[1];
|
|
161
|
+
const extractedNested = extractNested([], nestedContentField.nestedFields);
|
|
162
|
+
extractedNested.forEach((ecProperty) => {
|
|
163
|
+
const propertyWithSchema = { ...ecProperty, sourceSchema, sourceClassName };
|
|
164
|
+
uniquePropertiesMap.set(propertyWithSchema.key, propertyWithSchema);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
169
168
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
case presentation_common_1.RelationshipMeaning.RelatedInstance: {
|
|
170
|
+
// Navigation properties
|
|
171
|
+
if (
|
|
172
|
+
// Deal with a TypeDefinition
|
|
173
|
+
nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===
|
|
174
|
+
"BisCore:GeometricElement3dHasTypeDefinition") {
|
|
175
|
+
const extractedNested = extractNested(["TypeDefinition"], nestedContentField.nestedFields);
|
|
176
|
+
extractedNested.forEach((ecProperty) => {
|
|
177
|
+
uniquePropertiesMap.set(ecProperty.key, ecProperty);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
default: {
|
|
183
|
+
// Some elements don't have a path to primary class or relationship meaning..
|
|
184
|
+
// Most likely a simple struct property
|
|
185
|
+
if (!nestedContentField.pathToPrimaryClass) {
|
|
186
|
+
const extractedStruct = extractStruct(property);
|
|
187
|
+
extractedStruct.forEach((ecProperty) => {
|
|
188
|
+
uniquePropertiesMap.set(ecProperty.key, ecProperty);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
177
191
|
}
|
|
178
192
|
}
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
|
-
}
|
|
182
|
-
return
|
|
183
|
-
}
|
|
195
|
+
});
|
|
196
|
+
return Array.from(uniquePropertiesMap.values());
|
|
197
|
+
};
|
|
184
198
|
exports.convertPresentationFields = convertPresentationFields;
|
|
185
199
|
const convertToECProperties = (property) => {
|
|
186
200
|
const ecProperty = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyUtils.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyUtils.ts"],"names":[],"mappings":";;;AAMA,4DAAkD;AAWlD,oEAMoC;AACpC,wEAA4D;AAC5D,6CAAwC;AAexC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAY,EAAE;IAC7C,QAAQ,IAAI,EAAE;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,SAAS;YACZ,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB;YACE,OAAO,0BAAQ,CAAC,MAAM,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CACxB,iBAA2B,EAC3B,aAA8B,EACV,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;IACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ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AA+E;QACjG,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,gDAA0B,CAAC,YAAY;KACrD,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,oCAAY,CAAC,YAAY,CAAC,oBAAoB,CACrE,cAAc,CACf,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA3BW,QAAA,2BAA2B,+BA2BtC","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 { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ECProperty } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { deepEqual } from \"fast-equals\";\n\nexport interface PropertyMetaData {\n displayLabel: string;\n sourceSchema: string;\n sourceClassName: string;\n categoryLabel: string;\n propertyType: DataType;\n actualECClassName: string;\n parentPropertyClassName: string | undefined;\n ecPropertyTraversal: string[];\n primitiveNavigationClass: string;\n key: string;\n}\n\nconst convertType = (type: string): DataType => {\n switch (type) {\n case \"int\":\n case \"enum\":\n case \"long\":\n return DataType.Integer;\n case \"boolean\":\n return DataType.Boolean;\n case \"double\":\n return DataType.Double;\n case \"number\":\n return DataType.Number;\n default:\n return DataType.String;\n }\n};\n\nconst extractPrimitives = (\n propertyTraversal: string[],\n propertyField: PropertiesField\n): PropertyMetaData[] => propertyField.properties.map((property) => {\n const propertyName = property.property.name;\n const displayLabel = propertyField.label;\n // It belongs to this parent class\n const parentPropertyClassName = propertyField.parent?.contentClassInfo.name;\n const primitiveNavigationClass = property.property.navigationPropertyInfo?.classInfo.name ?? \"\";\n /* Presentation assigns primitive navigations properties as a long type due to how it stores the\n ECInstanceId of the class in the meta.ECClassDef table on the C++ layer.\n We are handling this special case.\n */\n const propertyType = primitiveNavigationClass ? DataType.String : convertType(property.property.type);\n const actualECClassName = property.property.classInfo.name;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return (\n {\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass,\n actualECClassName,\n parentPropertyClassName,\n key: `${parentPropertyClassName}|${actualECClassName}|${newPropertyTraversal.join(\"|\")}`,\n categoryLabel: propertyField.category.label,\n }\n );\n});\n\nconst extractPrimitiveStructProperties = (\n propertyTraversal: string[],\n members: StructFieldMemberDescription[],\n categoryLabel: string,\n actualECClassName: string,\n parentPropertyClassName?: string,\n): PropertyMetaData[] => members.flatMap((member) => {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n const propertyName = member.name;\n const displayLabel = member.label;\n const propertyType = convertType(member.type.typeName);\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return ({\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass: \"\",\n actualECClassName,\n parentPropertyClassName,\n key: `${parentPropertyClassName}|${actualECClassName}|${newPropertyTraversal.join(\"|\")}`,\n categoryLabel,\n });\n\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n const structName = member.name;\n return extractPrimitiveStructProperties(\n [...propertyTraversal, structName],\n member.type.members,\n categoryLabel,\n actualECClassName,\n parentPropertyClassName\n );\n }\n\n return [];\n});\n\nconst extractStruct = (property: Field) => {\n if (property.type.valueFormat !== PropertyValueFormat.Struct) {\n return [];\n }\n\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const actualECClassName = (property as PropertiesField).properties[0].property.classInfo.name;\n return extractPrimitiveStructProperties(\n [columnName],\n property.type.members,\n property.category.label,\n actualECClassName\n );\n};\n\nconst extractNested = (propertyTraversal: string[], propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n return extractPrimitives([...propertyTraversal], property as PropertiesField);\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n // Hardcoded navigation to external source repository metadata.\n if (nestedContentField.contentClassInfo.name === \"BisCore:RepositoryLink\") {\n return extractNested([...propertyTraversal, \"Source\", \"Repository\"], nestedContentField.nestedFields);\n }\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n // Aspects are not looked at again. Extraction does not support aspects within navigations.\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([...propertyTraversal, \"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertPresentationFields = (propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n const extractedPrimitives = extractPrimitives([], property as PropertiesField);\n for (const extractedPrimitive of extractedPrimitives) {\n extractedPrimitive.sourceSchema = \"*\";\n extractedPrimitive.sourceClassName = \"*\";\n return extractedPrimitive;\n }\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects.\n if (\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const fullClassName = nestedContentField.contentClassInfo.name;\n const sourceSchema = fullClassName.split(\":\")[0];\n const sourceClassName = fullClassName.split(\":\")[1];\n const extractedNested = extractNested([], nestedContentField.nestedFields);\n const aspectExtractedNested = extractedNested.map((ecProperty) => ({ ...ecProperty, sourceSchema, sourceClassName }));\n return aspectExtractedNested;\n }\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([\"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertToECProperties = (property: PropertyMetaData): ECProperty[] => {\n const ecProperty: ECProperty = {\n ecSchemaName: property.sourceSchema,\n ecClassName: property.sourceClassName,\n ecPropertyType: property.propertyType,\n ecPropertyName: \"\",\n };\n switch (property.primitiveNavigationClass) {\n // Hardcode Models navigation path and label behavior\n case \"BisCore:ModelContainsElements\": {\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n }\n // Hardcode Category and Physical Material navigation path and label behavior\n case \"BisCore:GeometricElement3dIsInCategory\":\n case \"BisCore:PhysicalElementIsOfPhysicalMaterial\":\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n default: {\n return [\n {\n ...ecProperty,\n ecPropertyName: property.ecPropertyTraversal.join(\".\"),\n },\n ];\n }\n }\n};\n\nexport const findProperties = (ecProperties: ECProperty[], propertiesMetaData: PropertyMetaData[]) => {\n let ecPropertiesCopy = [...ecProperties];\n const propertiesMetaDataResult: PropertyMetaData[] = new Array<PropertyMetaData>();\n let notFound = false;\n while (ecPropertiesCopy.length !== 0) {\n for (let i = 0; i < propertiesMetaData.length; i++) {\n const generatedProperty = convertToECProperties(propertiesMetaData[i]);\n const slicedEcProperties = ecPropertiesCopy.slice(0, generatedProperty.length);\n if (deepEqual(generatedProperty, slicedEcProperties)) {\n propertiesMetaDataResult.push(propertiesMetaData[i]);\n ecPropertiesCopy = ecPropertiesCopy.slice(generatedProperty.length);\n break;\n }\n if (i === propertiesMetaData.length - 1) {\n notFound = true;\n }\n }\n if (notFound)\n break;\n }\n return notFound ? [] : propertiesMetaDataResult;\n};\n\nexport const fetchPresentationDescriptor = async (iModelConnection: IModelConnection, keySet: KeySet) => {\n const ruleSet: Ruleset = {\n id: \"gmw-element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n propertyOverrides: [{\n name: \"*\",\n isDisplayed: true,\n }],\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const descriptor = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n return descriptor;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupPropertyUtils.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyUtils.ts"],"names":[],"mappings":";;;AAMA,4DAAkD;AAWlD,oEAMoC;AACpC,wEAA4D;AAC5D,6CAAwC;AAexC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAY,EAAE;IAC7C,QAAQ,IAAI,EAAE;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,SAAS;YACZ,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB;YACE,OAAO,0BAAQ,CAAC,MAAM,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,uBAA2C,EAC3C,iBAAyB,EACzB,iBAA2B,EACnB,EAAE;IACV,OAAO,GAAG,uBAAuB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CACxB,iBAA2B,EAC3B,aAA8B,EACV,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;IACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5C,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC;IACzC,kCAAkC;IAClC,MAAM,uBAAuB,GAAG,aAAa,CAAC,MAAM,EA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,CAAC,CAAC;AArBW,QAAA,cAAc,kBAqBzB;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAAE,gBAAkC,EAAE,MAAc,EAAE,EAAE;IACtG,MAAM,OAAO,GAAY;QACvB,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,+BAAS,CAAC,OAAO;gBAC3B,cAAc,EAAE;oBACd;wBACE,QAAQ,EAAE,+CAAyB,CAAC,qBAAqB;wBACzD,iBAAiB,EAAE,CAAC;gCAClB,IAAI,EAAE,GAAG;gCACT,WAAW,EAAE,IAAI;6BAClB,CAAC;qBACH;iBACF;aACF;SAAC;KACL,CAAC;IACF,MAAM,cAAc,GAA+E;QACjG,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,gDAA0B,CAAC,YAAY;KACrD,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,oCAAY,CAAC,YAAY,CAAC,oBAAoB,CACrE,cAAc,CACf,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA3BW,QAAA,2BAA2B,+BA2BtC","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 { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ECProperty } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { deepEqual } from \"fast-equals\";\n\nexport interface PropertyMetaData {\n displayLabel: string;\n sourceSchema: string;\n sourceClassName: string;\n categoryLabel: string;\n propertyType: DataType;\n actualECClassName: string;\n parentPropertyClassName: string | undefined;\n ecPropertyTraversal: string[];\n primitiveNavigationClass: string;\n key: string;\n}\n\nconst convertType = (type: string): DataType => {\n switch (type) {\n case \"int\":\n case \"enum\":\n case \"long\":\n return DataType.Integer;\n case \"boolean\":\n return DataType.Boolean;\n case \"double\":\n return DataType.Double;\n case \"number\":\n return DataType.Number;\n default:\n return DataType.String;\n }\n};\n\nconst generateKey = (\n parentPropertyClassName: string | undefined,\n actualECClassName: string,\n propertyTraversal: string[]\n): string => {\n return `${parentPropertyClassName}|${actualECClassName}|${propertyTraversal.join(\"|\")}`;\n};\n\nconst extractPrimitives = (\n propertyTraversal: string[],\n propertyField: PropertiesField\n): PropertyMetaData[] => propertyField.properties.map((property) => {\n const propertyName = property.property.name;\n const displayLabel = propertyField.label;\n // It belongs to this parent class\n const parentPropertyClassName = propertyField.parent?.contentClassInfo.name;\n const primitiveNavigationClass = property.property.navigationPropertyInfo?.classInfo.name ?? \"\";\n /* Presentation assigns primitive navigations properties as a long type due to how it stores the\n ECInstanceId of the class in the meta.ECClassDef table on the C++ layer.\n We are handling this special case.\n */\n const propertyType = primitiveNavigationClass ? DataType.String : convertType(property.property.type);\n const actualECClassName = property.property.classInfo.name;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return (\n {\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass,\n actualECClassName,\n parentPropertyClassName,\n key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),\n categoryLabel: propertyField.category.label,\n }\n );\n});\n\nconst extractPrimitiveStructProperties = (\n propertyTraversal: string[],\n members: StructFieldMemberDescription[],\n categoryLabel: string,\n actualECClassName: string,\n parentPropertyClassName?: string,\n): PropertyMetaData[] => members.flatMap((member) => {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n const propertyName = member.name;\n const displayLabel = member.label;\n const propertyType = convertType(member.type.typeName);\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return ({\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass: \"\",\n actualECClassName,\n parentPropertyClassName,\n key: generateKey(parentPropertyClassName, actualECClassName, newPropertyTraversal),\n categoryLabel,\n });\n\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n const structName = member.name;\n return extractPrimitiveStructProperties(\n [...propertyTraversal, structName],\n member.type.members,\n categoryLabel,\n actualECClassName,\n parentPropertyClassName\n );\n }\n\n return [];\n});\n\nconst extractStruct = (property: Field) => {\n if (property.type.valueFormat !== PropertyValueFormat.Struct) {\n return [];\n }\n\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const actualECClassName = (property as PropertiesField).properties[0].property.classInfo.name;\n return extractPrimitiveStructProperties(\n [columnName],\n property.type.members,\n property.category.label,\n actualECClassName\n );\n};\n\nconst extractNested = (propertyTraversal: string[], propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n return extractPrimitives([...propertyTraversal], property as PropertiesField);\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n // Hardcoded navigation to external source repository metadata.\n if (nestedContentField.contentClassInfo.name === \"BisCore:RepositoryLink\") {\n return extractNested([...propertyTraversal, \"Source\", \"Repository\"], nestedContentField.nestedFields);\n }\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n // Aspects are not looked at again. Extraction does not support aspects within navigations.\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([...propertyTraversal, \"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertPresentationFields = (propertyFields: Field[]): PropertyMetaData[] => {\n const uniquePropertiesMap = new Map<string, PropertyMetaData>();\n\n propertyFields.forEach((property) => {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n // Generate base ECProperty\n const extractedPrimitives = extractPrimitives([], property as PropertiesField);\n extractedPrimitives.forEach((extractedPrimitive) => {\n extractedPrimitive.sourceSchema = \"*\";\n extractedPrimitive.sourceClassName = \"*\";\n uniquePropertiesMap.set(extractedPrimitive.key, extractedPrimitive);\n });\n break;\n }\n case PropertyValueFormat.Struct: {\n // Get structs\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects.\n if (\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const fullClassName = nestedContentField.contentClassInfo.name;\n const sourceSchema = fullClassName.split(\":\")[0];\n const sourceClassName = fullClassName.split(\":\")[1];\n const extractedNested = extractNested([], nestedContentField.nestedFields);\n extractedNested.forEach((ecProperty) => {\n const propertyWithSchema = { ...ecProperty, sourceSchema, sourceClassName };\n uniquePropertiesMap.set(propertyWithSchema.key, propertyWithSchema);\n });\n }\n break;\n }\n case RelationshipMeaning.RelatedInstance: {\n // Navigation properties\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const extractedNested = extractNested([\"TypeDefinition\"], nestedContentField.nestedFields);\n extractedNested.forEach((ecProperty) => {\n uniquePropertiesMap.set(ecProperty.key, ecProperty);\n });\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const extractedStruct = extractStruct(property);\n extractedStruct.forEach((ecProperty) => {\n uniquePropertiesMap.set(ecProperty.key, ecProperty);\n });\n }\n }\n }\n }\n }\n });\n\n return Array.from(uniquePropertiesMap.values());\n};\n\nexport const convertToECProperties = (property: PropertyMetaData): ECProperty[] => {\n const ecProperty: ECProperty = {\n ecSchemaName: property.sourceSchema,\n ecClassName: property.sourceClassName,\n ecPropertyType: property.propertyType,\n ecPropertyName: \"\",\n };\n switch (property.primitiveNavigationClass) {\n // Hardcode Models navigation path and label behavior\n case \"BisCore:ModelContainsElements\": {\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n }\n // Hardcode Category and Physical Material navigation path and label behavior\n case \"BisCore:GeometricElement3dIsInCategory\":\n case \"BisCore:PhysicalElementIsOfPhysicalMaterial\":\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n default: {\n return [\n {\n ...ecProperty,\n ecPropertyName: property.ecPropertyTraversal.join(\".\"),\n },\n ];\n }\n }\n};\n\nexport const findProperties = (ecProperties: ECProperty[], propertiesMetaData: PropertyMetaData[]) => {\n let ecPropertiesCopy = [...ecProperties];\n const propertiesMetaDataResult: PropertyMetaData[] = new Array<PropertyMetaData>();\n let notFound = false;\n while (ecPropertiesCopy.length !== 0) {\n for (let i = 0; i < propertiesMetaData.length; i++) {\n const generatedProperty = convertToECProperties(propertiesMetaData[i]);\n const slicedEcProperties = ecPropertiesCopy.slice(0, generatedProperty.length);\n if (deepEqual(generatedProperty, slicedEcProperties)) {\n propertiesMetaDataResult.push(propertiesMetaData[i]);\n ecPropertiesCopy = ecPropertiesCopy.slice(generatedProperty.length);\n break;\n }\n if (i === propertiesMetaData.length - 1) {\n notFound = true;\n }\n }\n if (notFound)\n break;\n }\n return notFound ? [] : propertiesMetaDataResult;\n};\n\nexport const fetchPresentationDescriptor = async (iModelConnection: IModelConnection, keySet: KeySet) => {\n const ruleSet: Ruleset = {\n id: \"gmw-element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n propertyOverrides: [{\n name: \"*\",\n isDisplayed: true,\n }],\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const descriptor = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n return descriptor;\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./GroupsPropertiesSelectionModal.scss";
|
|
3
|
+
import type { PropertyMetaData } from "./GroupPropertyUtils";
|
|
4
|
+
export interface GroupPropertiesSelectionModalProps {
|
|
5
|
+
showModal: boolean;
|
|
6
|
+
setShowModal: (showModal: boolean) => void;
|
|
7
|
+
selectedProperties: PropertyMetaData[];
|
|
8
|
+
setSelectedProperties: (selectedProperties: (selectedProperties: PropertyMetaData[]) => PropertyMetaData[]) => void;
|
|
9
|
+
propertiesMetaData: PropertyMetaData[];
|
|
10
|
+
}
|
|
11
|
+
export declare const GroupsPropertiesSelectionModal: ({ showModal, setShowModal, selectedProperties, setSelectedProperties, propertiesMetaData, }: GroupPropertiesSelectionModalProps) => JSX.Element;
|
|
12
|
+
//# sourceMappingURL=GroupsPropertiesSelectionModal.d.ts.map
|