@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":"ExtractionMessageModal.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Extraction/ExtractionMessageModal.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjI,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAA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AS,GACpB,CACW;QACf,oBAAC,cAAc;YACb,oBAAC,MAAM,IACL,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,iBAAiB,YAGpB,CACM,CACX,CACT,CAAC;AACJ,CAAC,CAAC","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 { Button, DefaultCell, Icon, Modal, ModalButtonBar, ModalContent, Table, tableFilters, Text } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../../../common/utils\";\nimport \"./ExtractionMessageModal.scss\";\nimport { SvgClock } from \"@itwin/itwinui-icons-react\";\nimport type { CellRendererProps, Column } from \"react-table\";\nimport { StatusIcon } from \"../../SharedComponents/StatusIcon\";\nimport { ExtractionLogCustomFilter } from \"./ExtractionLogCustomFilter\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport { useMappingsOperations } from \"../hooks/useMappingsOperations\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { useMemoizedCollectionPick } from \"../../../common/hooks/useMemoizedCollectionPick\";\nimport { fetchGroups } from \"../../Groups/hooks/useFetchGroups\";\n\nexport interface ExtractionMessageData {\n date: string;\n category: string;\n level: string;\n message: string;\n}\n\nexport interface ExtractionMessageModalProps {\n isOpen: boolean;\n onClose: () => void;\n extractionMessageData: ExtractionMessageData[];\n timestamp: string;\n}\n\nexport const ExtractionMessageModal = ({ isOpen, onClose, extractionMessageData, timestamp }: ExtractionMessageModalProps) => {\n const [formattedExtractionMessage, setFormattedExtractionMessage] = useState<ExtractionMessageData[] | undefined>(undefined);\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const { mappings, isLoading: isMappingsLoading } = useMappingsOperations({ ...groupingMappingApiConfig, mappingClient });\n const [formattedTimestamp, setFormattedTimestamp] = useState<string>(\"\");\n\n const getMappingName = useCallback((mappingId: string, mappings: Mapping[]) => {\n return mappings.find((mapping) => mapping.id === mappingId)?.mappingName ?? \"\";\n }, []);\n\n // Extract groupIds and mappingIds from messages\n const extractionInfo = useMemo(() => {\n return extractionMessageData.reduce<{\n mappingId: string;\n groupId: string;\n }[]>((acc, message) => {\n const splittedMessage = message.message.split(\" \");\n const mappingId = splittedMessage[splittedMessage.indexOf(\"MappingId:\") + 1]?.match(/^([^,]+),$/)?.[1];\n const groupId = splittedMessage[splittedMessage.indexOf(\"GroupId:\") + 1]?.match(/^([^,]+).$/)?.[1];\n\n if (mappingId && groupId) {\n acc.push({ mappingId, groupId });\n }\n return acc;\n }, []);\n }, [extractionMessageData]);\n\n // useQueries to fetch all group names\n const groupQueriesResults = useQueries({\n queries: extractionInfo.map(({ mappingId }) => ({\n queryKey: [\"groups\", mappingId],\n queryFn: async () => fetchGroups(groupingMappingApiConfig.iModelId, mappingId, groupingMappingApiConfig.getAccessToken, mappingClient),\n })),\n });\n\n // Workaround to get data from useQueries with more stability\n const pickedResult = useMemoizedCollectionPick(groupQueriesResults, [\"data\", \"error\", \"isLoading\", \"isSuccess\"]);\n\n useEffect(() => {\n if (pickedResult.every((query) => query.isSuccess) && mappings) {\n const formattedMessages = extractionMessageData.map((extractionMessage, index) => {\n let replacedMessage: string = extractionMessage.message;\n\n const { mappingId, groupId } = extractionInfo[index];\n const groupName = pickedResult[index].data!.find((group) => group.id === groupId)?.groupName;\n\n if (replacedMessage.includes(\"MappingId:\")) {\n const mappingName = getMappingName(mappingId, mappings);\n replacedMessage = replacedMessage.replace(/MappingId: [\\w-]+/, `Mapping: ${mappingName}`);\n }\n\n if (replacedMessage.includes(\"GroupId:\")) {\n replacedMessage = replacedMessage.replace(/GroupId: [\\w-]+/, `Group: ${groupName ? groupName : \"<Not Found>\"}`);\n }\n\n return { ...extractionMessage, message: replacedMessage };\n });\n\n setFormattedExtractionMessage(formattedMessages);\n }\n }, [extractionMessageData, mappings, extractionInfo, getMappingName, pickedResult]);\n\n useEffect(() => {\n const newDateTime: Date = new Date(timestamp);\n const options: Intl.DateTimeFormatOptions = {\n day: \"numeric\", month: \"numeric\", year: \"numeric\",\n hour: \"2-digit\", minute: \"2-digit\",\n };\n setFormattedTimestamp(newDateTime.toLocaleString(undefined, options));\n }, [timestamp]);\n\n const translatedLabels = useMemo(() => ({\n filter: \"Filter\",\n clear: \"Clear\",\n }), []);\n\n const columns = useMemo(\n (): Column<CreateTypeFromInterface<ExtractionMessageData>>[] => [\n {\n id: \"category\",\n Header: \"Category\",\n accessor: \"category\",\n fieldType: \"text\",\n Filter: ExtractionLogCustomFilter,\n filter: \"equals\",\n },\n {\n id: \"level\",\n Header: \"Level\",\n accessor: \"level\",\n cellRenderer: ({ cellElementProps, cellProps }: CellRendererProps<CreateTypeFromInterface<ExtractionMessageData>>) => {\n const level = cellProps.row.original.level;\n return (\n <DefaultCell\n cellElementProps={cellElementProps}\n cellProps={cellProps}\n startIcon={\n level === \"Error\" ? (\n <StatusIcon status='error' />\n ) : level === \"Warning\" ? (\n <StatusIcon status='warning' />\n ) : level === \"Info\" ? (\n <StatusIcon status='informational' />\n ) : <StatusIcon status='trace' />\n }\n >\n {level}\n </DefaultCell>\n );\n },\n Filter: ExtractionLogCustomFilter,\n filter: \"equals\",\n },\n {\n id: \"message\",\n Header: \"Message\",\n accessor: \"message\",\n width: \"25vw\",\n fieldType: \"text\",\n Filter: tableFilters.TextFilter(translatedLabels),\n },\n ],\n [translatedLabels]\n );\n const isLoading = pickedResult.some((query) => query.isLoading) || isMappingsLoading;\n\n return (\n <Modal className=\"gmw-message-modal-container\"\n title=\"Extraction Logs\"\n isOpen={isOpen}\n onClose={onClose}\n closeOnExternalClick={false}\n >\n <ModalContent>\n <div className=\"gmw-timestamp-icon\">\n <Icon\n title=\"Extraction Timestamp\"\n size=\"medium\"\n >\n <SvgClock />\n </Icon>\n <Text>{formattedTimestamp}</Text>\n </div>\n <Table<CreateTypeFromInterface<ExtractionMessageData>>\n columns={columns}\n data={formattedExtractionMessage ?? []}\n emptyTableContent={\"\"}\n emptyFilteredTableContent=\"No results match filters.\"\n className=\"gmw-extraction-message-table-container\"\n isLoading={isLoading}\n />\n </ModalContent>\n <ModalButtonBar>\n <Button\n onClick={onClose}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ExtractionMessageModal.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Extraction/ExtractionMessageModal.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjI,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAgB7D,MAAM,CAAC,MAAM,sBAAsB,GA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CACT,CAAC;AACJ,CAAC,CAAC","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 { Button, DefaultCell, Icon, Modal, ModalButtonBar, ModalContent, Table, tableFilters, Text } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../../../common/utils\";\nimport \"./ExtractionMessageModal.scss\";\nimport { SvgClock } from \"@itwin/itwinui-icons-react\";\nimport type { CellRendererProps, Column } from \"react-table\";\nimport { StatusIcon } from \"../../SharedComponents/StatusIcon\";\nimport { ExtractionLogCustomFilter } from \"./ExtractionLogCustomFilter\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { useMemoizedCollectionPick } from \"../../../common/hooks/useMemoizedCollectionPick\";\nimport { fetchGroups } from \"../../Groups/hooks/useFetchGroups\";\nimport { useFetchMappings } from \"../hooks/useFetchMappings\";\n\nexport interface ExtractionMessageData {\n date: string;\n category: string;\n level: string;\n message: string;\n}\n\nexport interface ExtractionMessageModalProps {\n isOpen: boolean;\n onClose: () => void;\n extractionMessageData: ExtractionMessageData[];\n timestamp: string;\n}\n\nexport const ExtractionMessageModal = ({ isOpen, onClose, extractionMessageData, timestamp }: ExtractionMessageModalProps) => {\n const [formattedExtractionMessage, setFormattedExtractionMessage] = useState<ExtractionMessageData[] | undefined>(undefined);\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const { iModelId, getAccessToken } = groupingMappingApiConfig;\n const mappingClient = useMappingClient();\n const { data: mappings, isLoading: isMappingsLoading } = useFetchMappings(iModelId, getAccessToken, mappingClient);\n const [formattedTimestamp, setFormattedTimestamp] = useState<string>(\"\");\n\n const getMappingName = useCallback((mappingId: string, mappings: Mapping[]) => {\n return mappings.find((mapping) => mapping.id === mappingId)?.mappingName ?? \"\";\n }, []);\n\n const extractionInfo = useMemo(() => {\n const infoMap = new Map<string, { mappingId: string, groupId: string }>();\n\n extractionMessageData.forEach((message) => {\n const splittedMessage = message.message.split(\" \");\n const mappingId = splittedMessage[splittedMessage.indexOf(\"MappingId:\") + 1]?.match(/^([^,]+),$/)?.[1];\n const groupId = splittedMessage[splittedMessage.indexOf(\"GroupId:\") + 1]?.match(/^([^,]+).$/)?.[1];\n\n if (mappingId && groupId) {\n infoMap.set(message.message, { mappingId, groupId });\n }\n });\n\n return infoMap;\n }, [extractionMessageData]);\n\n // useQueries to fetch all group names\n const groupQueriesResults = useQueries({\n queries: Array.from(extractionInfo.values()).map(({ mappingId }) => ({\n queryKey: [\"groups\", mappingId],\n queryFn: async () => {\n const groups = await fetchGroups(groupingMappingApiConfig.iModelId, mappingId, groupingMappingApiConfig.getAccessToken, mappingClient);\n // Return both mappingId and groups in the result\n return { mappingId, groups };\n },\n })),\n });\n\n // Workaround to get data from useQueries with more stability\n const pickedResult = useMemoizedCollectionPick(groupQueriesResults, [\"data\", \"error\", \"isLoading\", \"isSuccess\"]);\n\n useEffect(() => {\n if (pickedResult.every((query) => query.isSuccess) && mappings) {\n const formattedMessages = extractionMessageData.map((extractionMessage) => {\n let replacedMessage: string = extractionMessage.message;\n\n const info = extractionInfo.get(extractionMessage.message);\n if (info) {\n const { mappingId, groupId } = info;\n\n const queryResult = pickedResult.find((result) => result.data?.mappingId === mappingId);\n const groupName = queryResult?.data?.groups?.find((group) => group.id === groupId)?.groupName;\n\n if (replacedMessage.includes(\"MappingId:\")) {\n const mappingName = getMappingName(mappingId, mappings);\n replacedMessage = replacedMessage.replace(/MappingId: [\\w-]+/, `Mapping: ${mappingName}`);\n }\n\n if (replacedMessage.includes(\"GroupId:\")) {\n replacedMessage = replacedMessage.replace(/GroupId: [\\w-]+/, `Group: ${groupName ? groupName : \"<Not Found>\"}`);\n }\n }\n\n return { ...extractionMessage, message: replacedMessage };\n });\n\n setFormattedExtractionMessage(formattedMessages);\n }\n }, [extractionMessageData, mappings, extractionInfo, getMappingName, pickedResult]);\n\n useEffect(() => {\n const newDateTime: Date = new Date(timestamp);\n const options: Intl.DateTimeFormatOptions = {\n day: \"numeric\", month: \"numeric\", year: \"numeric\",\n hour: \"2-digit\", minute: \"2-digit\",\n };\n setFormattedTimestamp(newDateTime.toLocaleString(undefined, options));\n }, [timestamp]);\n\n const translatedLabels = useMemo(() => ({\n filter: \"Filter\",\n clear: \"Clear\",\n }), []);\n\n const columns = useMemo(\n (): Column<CreateTypeFromInterface<ExtractionMessageData>>[] => [\n {\n id: \"category\",\n Header: \"Category\",\n accessor: \"category\",\n fieldType: \"text\",\n Filter: ExtractionLogCustomFilter,\n filter: \"equals\",\n },\n {\n id: \"level\",\n Header: \"Level\",\n accessor: \"level\",\n cellRenderer: ({ cellElementProps, cellProps }: CellRendererProps<CreateTypeFromInterface<ExtractionMessageData>>) => {\n const level = cellProps.row.original.level;\n return (\n <DefaultCell\n cellElementProps={cellElementProps}\n cellProps={cellProps}\n startIcon={\n level === \"Error\" ? (\n <StatusIcon status='error' />\n ) : level === \"Warning\" ? (\n <StatusIcon status='warning' />\n ) : level === \"Info\" ? (\n <StatusIcon status='informational' />\n ) : <StatusIcon status='trace' />\n }\n >\n {level}\n </DefaultCell>\n );\n },\n Filter: ExtractionLogCustomFilter,\n filter: \"equals\",\n },\n {\n id: \"message\",\n Header: \"Message\",\n accessor: \"message\",\n width: \"25vw\",\n fieldType: \"text\",\n Filter: tableFilters.TextFilter(translatedLabels),\n },\n ],\n [translatedLabels]\n );\n const isLoading = pickedResult.some((query) => query.isLoading) || isMappingsLoading;\n\n return (\n <Modal className=\"gmw-message-modal-container\"\n title=\"Extraction Logs\"\n isOpen={isOpen}\n onClose={onClose}\n closeOnExternalClick={false}\n >\n <ModalContent>\n <div className=\"gmw-timestamp-icon\">\n <Icon\n title=\"Extraction Timestamp\"\n size=\"medium\"\n >\n <SvgClock />\n </Icon>\n <Text>{formattedTimestamp}</Text>\n </div>\n <Table<CreateTypeFromInterface<ExtractionMessageData>>\n columns={columns}\n data={formattedExtractionMessage ?? []}\n emptyTableContent={\"\"}\n emptyFilteredTableContent=\"No results match filters.\"\n className=\"gmw-extraction-message-table-container\"\n isLoading={isLoading}\n />\n </ModalContent>\n <ModalButtonBar>\n <Button\n onClick={onClose}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n );\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusPending } from "@itwin/itwinui-icons-react";
|
|
7
|
+
export const QueuedExtractionState = () => (React.createElement("div", { title: "Queued", className: "gmw-extraction-status" },
|
|
8
|
+
React.createElement("div", { className: "gmw-status-icon" },
|
|
9
|
+
React.createElement(SvgStatusPending, null))));
|
|
10
|
+
//# sourceMappingURL=QueuedExtractionState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueuedExtractionState.js","sourceRoot":"","sources":["../../../../../../src/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,CACzC,6BACE,KAAK,EAAC,QAAQ,EACd,SAAS,EAAC,uBAAuB;IACjC,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,oBAAC,gBAAgB,OAAG,CAChB,CACF,CACP,CAAC","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 from \"react\";\nimport { SvgStatusPending } from \"@itwin/itwinui-icons-react\";\n\nexport const QueuedExtractionState = () => (\n <div\n title=\"Queued\"\n className=\"gmw-extraction-status\">\n <div className=\"gmw-status-icon\">\n <SvgStatusPending />\n </div>\n </div>\n);\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ProgressRadial } from "@itwin/itwinui-react";
|
|
7
|
+
export const RunningExtractionState = () => (React.createElement("div", { title: "Running", className: "gmw-extraction-status-running" },
|
|
8
|
+
React.createElement(ProgressRadial, { size: "x-small", indeterminate: true })));
|
|
9
|
+
//# sourceMappingURL=RunningExtractionState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunningExtractionState.js","sourceRoot":"","sources":["../../../../../../src/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,CAC1C,6BACE,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,+BAA+B;IACzC,oBAAC,cAAc,IAAC,IAAI,EAAC,SAAS,EAAC,aAAa,SAAG,CAC3C,CACP,CAAC","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 from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\nexport const RunningExtractionState = () => (\n <div\n title=\"Running\"\n className=\"gmw-extraction-status-running\">\n <ProgressRadial size=\"x-small\" indeterminate />\n </div>\n);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusPendingHollow } from "@itwin/itwinui-icons-color-react";
|
|
7
|
+
export const StartingExtractionState = () => (React.createElement("div", { title: "Starting", className: "gmw-extraction-status" },
|
|
8
|
+
React.createElement("div", { className: "gmw-status-icon" },
|
|
9
|
+
React.createElement(SvgStatusPendingHollow, null))));
|
|
10
|
+
//# sourceMappingURL=StartingExtractionState.js.map
|
package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StartingExtractionState.js","sourceRoot":"","sources":["../../../../../../src/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE,CAAC,CAC3C,6BACE,KAAK,EAAC,UAAU,EAChB,SAAS,EAAC,uBAAuB;IACjC,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,oBAAC,sBAAsB,OAAG,CACtB,CACF,CACP,CAAC","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 from \"react\";\nimport { SvgStatusPendingHollow } from \"@itwin/itwinui-icons-color-react\";\n\nexport const StartingExtractionState = () => (\n <div\n title=\"Starting\"\n className=\"gmw-extraction-status\">\n <div className=\"gmw-status-icon\">\n <SvgStatusPendingHollow />\n </div>\n </div>\n);\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ExtractionStateProps {
|
|
3
|
+
status: string;
|
|
4
|
+
animation: boolean;
|
|
5
|
+
onAnimationEnd: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TerminalExtractionState: ({ status, animation, onAnimationEnd }: ExtractionStateProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=TerminalExtractionState.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusError, SvgStatusSuccess } from "@itwin/itwinui-icons-color-react";
|
|
7
|
+
import { ANIMATION_DELAY, ANIMATION_DURATION } from "../../../Constants";
|
|
8
|
+
export const TerminalExtractionState = ({ status, animation, onAnimationEnd }) => (React.createElement("div", { title: status, className: "gmw-extraction-status" },
|
|
9
|
+
React.createElement("div", { className: `gmw-status-icon`, style: {
|
|
10
|
+
animationName: animation ? "gmw-fade-out" : "",
|
|
11
|
+
animationDelay: ANIMATION_DELAY,
|
|
12
|
+
animationDuration: ANIMATION_DURATION,
|
|
13
|
+
}, onAnimationEnd: onAnimationEnd }, status === "Succeeded" ? React.createElement(SvgStatusSuccess, null) : React.createElement(SvgStatusError, null))));
|
|
14
|
+
//# sourceMappingURL=TerminalExtractionState.js.map
|
package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalExtractionState.js","sourceRoot":"","sources":["../../../../../../src/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAwB,EAAE,EAAE,CAAC,CACtG,6BACE,KAAK,EAAE,MAAM,EACb,SAAS,EAAC,uBAAuB;IACjC,6BACE,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE;YACL,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;YAC9C,cAAc,EAAE,eAAe;YAC/B,iBAAiB,EAAE,kBAAkB;SACtC,EACD,cAAc,EAAE,cAAc,IAE7B,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,oBAAC,gBAAgB,OAAG,CAAC,CAAC,CAAC,oBAAC,cAAc,OAAG,CAC/D,CACF,CACP,CAAC","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 from \"react\";\nimport { SvgStatusError, SvgStatusSuccess } from \"@itwin/itwinui-icons-color-react\";\nimport { ANIMATION_DELAY, ANIMATION_DURATION } from \"../../../Constants\";\n\ninterface ExtractionStateProps {\n status: string;\n animation: boolean;\n onAnimationEnd: () => void;\n}\n\nexport const TerminalExtractionState = ({ status, animation, onAnimationEnd }: ExtractionStateProps) => (\n <div\n title={status}\n className=\"gmw-extraction-status\">\n <div\n className={`gmw-status-icon`}\n style={{\n animationName: animation ? \"gmw-fade-out\" : \"\",\n animationDelay: ANIMATION_DELAY,\n animationDuration: ANIMATION_DURATION,\n }}\n onAnimationEnd={onAnimationEnd}\n >\n {status === \"Succeeded\" ? <SvgStatusSuccess /> : <SvgStatusError />}\n </div>\n </div>\n);\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./ExtractionStatus.scss";
|
|
3
|
+
export declare enum ExtractionStates {
|
|
4
|
+
None = 0,
|
|
5
|
+
Starting = 1,
|
|
6
|
+
Queued = 2,
|
|
7
|
+
Running = 3,
|
|
8
|
+
Succeeded = 4,
|
|
9
|
+
Failed = 5
|
|
10
|
+
}
|
|
11
|
+
interface ExtractionStatusProps {
|
|
12
|
+
state: ExtractionStates | undefined;
|
|
13
|
+
clearExtractionState: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const ExtractionStatus: ({ state, clearExtractionState, }: ExtractionStatusProps) => JSX.Element | null;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ExtractionStatus.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { STATUS_CHECK_INTERVAL } from "../../Constants";
|
|
8
|
+
import { StartingExtractionState } from "./ExtractionStates/StartingExtractionState";
|
|
9
|
+
import { QueuedExtractionState } from "./ExtractionStates/QueuedExtractionState";
|
|
10
|
+
import { TerminalExtractionState } from "./ExtractionStates/TerminalExtractionState";
|
|
11
|
+
import { RunningExtractionState } from "./ExtractionStates/RunningExtractionState";
|
|
12
|
+
import "./ExtractionStatus.scss";
|
|
13
|
+
export var ExtractionStates;
|
|
14
|
+
(function (ExtractionStates) {
|
|
15
|
+
ExtractionStates[ExtractionStates["None"] = 0] = "None";
|
|
16
|
+
ExtractionStates[ExtractionStates["Starting"] = 1] = "Starting";
|
|
17
|
+
ExtractionStates[ExtractionStates["Queued"] = 2] = "Queued";
|
|
18
|
+
ExtractionStates[ExtractionStates["Running"] = 3] = "Running";
|
|
19
|
+
ExtractionStates[ExtractionStates["Succeeded"] = 4] = "Succeeded";
|
|
20
|
+
ExtractionStates[ExtractionStates["Failed"] = 5] = "Failed";
|
|
21
|
+
})(ExtractionStates || (ExtractionStates = {}));
|
|
22
|
+
export const ExtractionStatus = ({ state, clearExtractionState, }) => {
|
|
23
|
+
const [fadeOut, setFadeOut] = useState(false);
|
|
24
|
+
const onAnimationEnd = () => {
|
|
25
|
+
clearExtractionState();
|
|
26
|
+
setFadeOut(false);
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
let timer;
|
|
30
|
+
switch (state) {
|
|
31
|
+
case ExtractionStates.Succeeded:
|
|
32
|
+
case ExtractionStates.Failed:
|
|
33
|
+
timer = window.setTimeout(() => setFadeOut(true), STATUS_CHECK_INTERVAL);
|
|
34
|
+
}
|
|
35
|
+
return () => window.clearTimeout(timer);
|
|
36
|
+
}, [state]);
|
|
37
|
+
switch (state) {
|
|
38
|
+
case ExtractionStates.Starting:
|
|
39
|
+
return (React.createElement(StartingExtractionState, null));
|
|
40
|
+
case ExtractionStates.Queued:
|
|
41
|
+
return (React.createElement(QueuedExtractionState, null));
|
|
42
|
+
case ExtractionStates.Running:
|
|
43
|
+
return (React.createElement(RunningExtractionState, null));
|
|
44
|
+
case ExtractionStates.Succeeded:
|
|
45
|
+
return (React.createElement(TerminalExtractionState, { status: "Succeeded", animation: fadeOut, onAnimationEnd: onAnimationEnd }));
|
|
46
|
+
case ExtractionStates.Failed:
|
|
47
|
+
return (React.createElement(TerminalExtractionState, { status: "Failed", animation: fadeOut, onAnimationEnd: onAnimationEnd }));
|
|
48
|
+
default:
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=ExtractionStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Extraction/ExtractionStatus.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,yBAAyB,CAAC;AAEjC,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,uDAAI,CAAA;IACJ,+DAAQ,CAAA;IACR,2DAAM,CAAA;IACN,6DAAO,CAAA;IACP,iEAAS,CAAA;IACT,2DAAM,CAAA;AACR,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B;AAOD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAEvD,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,oBAAoB,EAAE,CAAC;QACvB,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAa,CAAC;QAClB,QAAQ,KAAK,EAAE;YACb,KAAK,gBAAgB,CAAC,SAAS,CAAC;YAChC,KAAK,gBAAgB,CAAC,MAAM;gBAC1B,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,qBAAqB,CAAC,CAAC;SAC5E;QACD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,QAAQ,KAAK,EAAE;QACb,KAAK,gBAAgB,CAAC,QAAQ;YAC5B,OAAO,CAAC,oBAAC,uBAAuB,OAAG,CAAC,CAAC;QACvC,KAAK,gBAAgB,CAAC,MAAM;YAC1B,OAAO,CAAC,oBAAC,qBAAqB,OAAG,CAAC,CAAC;QACrC,KAAK,gBAAgB,CAAC,OAAO;YAC3B,OAAO,CAAC,oBAAC,sBAAsB,OAAG,CAAC,CAAC;QACtC,KAAK,gBAAgB,CAAC,SAAS;YAC7B,OAAO,CAAC,oBAAC,uBAAuB,IAC9B,MAAM,EAAC,WAAW,EAClB,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,cAAc,GAC9B,CAAC,CAAC;QACN,KAAK,gBAAgB,CAAC,MAAM;YAC1B,OAAO,CAAC,oBAAC,uBAAuB,IAC9B,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,cAAc,GAC9B,CAAC,CAAC;QACN;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC","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 { useEffect, useState } from \"react\";\nimport * as React from \"react\";\nimport { STATUS_CHECK_INTERVAL } from \"../../Constants\";\nimport { StartingExtractionState } from \"./ExtractionStates/StartingExtractionState\";\nimport { QueuedExtractionState } from \"./ExtractionStates/QueuedExtractionState\";\nimport { TerminalExtractionState } from \"./ExtractionStates/TerminalExtractionState\";\nimport { RunningExtractionState } from \"./ExtractionStates/RunningExtractionState\";\nimport \"./ExtractionStatus.scss\";\n\nexport enum ExtractionStates {\n None,\n Starting,\n Queued,\n Running,\n Succeeded,\n Failed,\n}\n\ninterface ExtractionStatusProps {\n state: ExtractionStates | undefined;\n clearExtractionState: () => void;\n}\n\nexport const ExtractionStatus = ({\n state,\n clearExtractionState,\n}: ExtractionStatusProps) => {\n const [fadeOut, setFadeOut] = useState<boolean>(false);\n\n const onAnimationEnd = () => {\n clearExtractionState();\n setFadeOut(false);\n };\n\n useEffect(() => {\n let timer: number;\n switch (state) {\n case ExtractionStates.Succeeded:\n case ExtractionStates.Failed:\n timer = window.setTimeout(() => setFadeOut(true), STATUS_CHECK_INTERVAL);\n }\n return () => window.clearTimeout(timer);\n }, [state]);\n\n switch (state) {\n case ExtractionStates.Starting:\n return (<StartingExtractionState />);\n case ExtractionStates.Queued:\n return (<QueuedExtractionState />);\n case ExtractionStates.Running:\n return (<RunningExtractionState />);\n case ExtractionStates.Succeeded:\n return (<TerminalExtractionState\n status=\"Succeeded\"\n animation={fadeOut}\n onAnimationEnd={onAnimationEnd}\n />);\n case ExtractionStates.Failed:\n return (<TerminalExtractionState\n status=\"Failed\"\n animation={fadeOut}\n onAnimationEnd={onAnimationEnd}\n />);\n default:\n return null;\n }\n};\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
.gmw-extraction-status {
|
|
7
|
+
align-items: center;
|
|
8
|
+
height: 38px;
|
|
9
|
+
display: flex;
|
|
10
|
+
|
|
11
|
+
.gmw-status-icon {
|
|
12
|
+
width: var(--iui-size-m);
|
|
13
|
+
height: var(--iui-size-m);
|
|
14
|
+
align-items: center;
|
|
15
|
+
margin: auto calc(var(--iui-size-2xs) * 3);
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.gmw-extraction-status-running {
|
|
21
|
+
align-items: center;
|
|
22
|
+
height: 38px;
|
|
23
|
+
display: flex;
|
|
24
|
+
margin: auto calc(var(--iui-size-2xs) * 3);
|
|
25
|
+
|
|
26
|
+
.gmw-status-icon {
|
|
27
|
+
width: var(--iui-size-m);
|
|
28
|
+
height: var(--iui-size-m);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes gmw-fade-out {
|
|
33
|
+
0% {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
100% {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Mapping } from "@itwin/insights-client";
|
|
3
|
+
import type { BeEvent } from "@itwin/core-bentley";
|
|
4
|
+
import "./MappingListItem.scss";
|
|
5
|
+
export interface MappingListItemProps {
|
|
6
|
+
selected: boolean;
|
|
7
|
+
mapping: Mapping;
|
|
8
|
+
jobId: string;
|
|
9
|
+
jobStartEvent: BeEvent<(mappingId: string) => void>;
|
|
10
|
+
onSelectionChange?: (mapping: Mapping) => void;
|
|
11
|
+
onClickMappingTitle?: (mapping: Mapping) => void;
|
|
12
|
+
onClickMappingModify?: (mapping: Mapping) => void;
|
|
13
|
+
onRefreshMappings: () => Promise<void>;
|
|
14
|
+
onToggleExtraction: (mapping: Mapping) => Promise<void>;
|
|
15
|
+
setShowDeleteModal: (mapping?: Mapping) => void;
|
|
16
|
+
initialStateExtractionFlag?: boolean;
|
|
17
|
+
setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const MappingListItem: ({ selected, onSelectionChange, mapping, jobId, jobStartEvent, onClickMappingModify, onClickMappingTitle, onRefreshMappings, onToggleExtraction, setShowDeleteModal, }: MappingListItemProps) => JSX.Element;
|
|
20
|
+
//# sourceMappingURL=MappingListItem.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { MappingViewActionGroup } from "./MappingViewActionGroup";
|
|
3
|
+
import { Anchor, ListItem } from "@itwin/itwinui-react";
|
|
4
|
+
import { ExtractionStates } from "./Extraction/ExtractionStatus";
|
|
5
|
+
import { ExtractionStatus } from "./Extraction/ExtractionStatus";
|
|
6
|
+
import { useExtractionStateJobContext } from "../context/ExtractionStateJobContext";
|
|
7
|
+
import { useFetchMappingExtractionStatus } from "./hooks/useFetchMappingExtractionStatus";
|
|
8
|
+
import "./MappingListItem.scss";
|
|
9
|
+
import { useGroupingMappingApiConfig } from "../context/GroupingApiConfigContext";
|
|
10
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
11
|
+
export const MappingListItem = ({ selected, onSelectionChange, mapping, jobId, jobStartEvent, onClickMappingModify, onClickMappingTitle, onRefreshMappings, onToggleExtraction, setShowDeleteModal, }) => {
|
|
12
|
+
const [extractionState, setExtractionState] = useState(ExtractionStates.None);
|
|
13
|
+
const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();
|
|
14
|
+
const groupingMappingApiConfig = useGroupingMappingApiConfig();
|
|
15
|
+
const [isJobStarted, setIsJobStarted] = useState(false);
|
|
16
|
+
const statusQuery = useFetchMappingExtractionStatus({ ...groupingMappingApiConfig, mapping, enabled: isJobStarted });
|
|
17
|
+
const queryClient = useQueryClient();
|
|
18
|
+
const onClickTile = useCallback(() => {
|
|
19
|
+
onSelectionChange && onSelectionChange(mapping);
|
|
20
|
+
}, [mapping, onSelectionChange]);
|
|
21
|
+
// Check whether the job is still running when users refresh the mapping list
|
|
22
|
+
// or modify any mappings
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (mappingIdJobInfo.get(mapping.id)) {
|
|
25
|
+
setIsJobStarted(true);
|
|
26
|
+
}
|
|
27
|
+
}, [mappingIdJobInfo, mapping.id]);
|
|
28
|
+
const resolveTerminalExtractionStatus = useCallback(async () => {
|
|
29
|
+
const state = statusQuery.data.finalExtractionStateValue;
|
|
30
|
+
if (state === ExtractionStates.Failed || state === ExtractionStates.Succeeded) {
|
|
31
|
+
setIsJobStarted(false);
|
|
32
|
+
setMappingIdJobInfo((prevMap) => {
|
|
33
|
+
const newMap = new Map(prevMap);
|
|
34
|
+
newMap.delete(mapping.id);
|
|
35
|
+
return newMap;
|
|
36
|
+
});
|
|
37
|
+
await queryClient.invalidateQueries({ queryKey: ["iModelExtractionStatus"] });
|
|
38
|
+
}
|
|
39
|
+
}, [mapping.id, queryClient, setMappingIdJobInfo, statusQuery.data]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const listener = (startedMappingId) => {
|
|
42
|
+
if (startedMappingId === mapping.id) {
|
|
43
|
+
setExtractionState(ExtractionStates.Starting);
|
|
44
|
+
setIsJobStarted(true);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
jobStartEvent.addListener(listener);
|
|
48
|
+
return () => {
|
|
49
|
+
jobStartEvent.removeListener(listener);
|
|
50
|
+
};
|
|
51
|
+
}, [jobStartEvent, mapping.id, jobId]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const isStatusReady = statusQuery.data && statusQuery.isFetched;
|
|
54
|
+
if (isStatusReady) {
|
|
55
|
+
setExtractionState(statusQuery.data.finalExtractionStateValue);
|
|
56
|
+
// No need to await. We don't need to wait for the status to be resolved in invalidation.
|
|
57
|
+
void resolveTerminalExtractionStatus();
|
|
58
|
+
}
|
|
59
|
+
}, [resolveTerminalExtractionStatus, statusQuery]);
|
|
60
|
+
return (React.createElement(ListItem, { actionable: !!onSelectionChange, className: "gmw-mapping-list-item", active: selected, key: mapping.id, onClick: onClickTile, title: mapping.mappingName },
|
|
61
|
+
React.createElement(ListItem.Content, null,
|
|
62
|
+
onClickMappingTitle ? React.createElement(Anchor, { onClick: () => onClickMappingTitle(mapping) }, mapping.mappingName) : mapping.mappingName,
|
|
63
|
+
React.createElement(ListItem.Description, null, mapping.description)),
|
|
64
|
+
React.createElement(ExtractionStatus, { state: extractionState, clearExtractionState: () => {
|
|
65
|
+
setExtractionState(ExtractionStates.None);
|
|
66
|
+
} }),
|
|
67
|
+
React.createElement(MappingViewActionGroup, { mapping: mapping, onToggleExtraction: onToggleExtraction, onRefresh: onRefreshMappings, onClickMappingModify: onClickMappingModify, setShowDeleteModal: setShowDeleteModal })));
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=MappingListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MappingListItem.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingListItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiBvD,MAAM,CAA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+B,EAAE,WAAW,CAAC,CAAC,CAAC;IAEnD,OAAO,CACL,oBAAC,QAAQ,IACP,UAAU,EAAE,CAAC,CAAC,iBAAiB,EAC/B,SAAS,EAAC,uBAAuB,EACjC,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EACf,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,OAAO,CAAC,WAAW;QAC1B,oBAAC,QAAQ,CAAC,OAAO;YACd,mBAAmB,CAAC,CAAC,CAAC,oBAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAG,OAAO,CAAC,WAAW,CAAU,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW;YAChI,oBAAC,QAAQ,CAAC,WAAW,QAClB,OAAO,CAAC,WAAW,CACC,CACN;QACnB,oBAAC,gBAAgB,IACf,KAAK,EAAE,eAAe,EACtB,oBAAoB,EAAE,GAAG,EAAE;gBACzB,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC,GACkB;QACrB,oBAAC,sBAAsB,IACrB,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,iBAAiB,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,GACtC,CACO,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { Mapping } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type { BeEvent } from \"@itwin/core-bentley\";\nimport { MappingViewActionGroup } from \"./MappingViewActionGroup\";\nimport { Anchor, ListItem } from \"@itwin/itwinui-react\";\nimport { ExtractionStates } from \"./Extraction/ExtractionStatus\";\nimport { ExtractionStatus } from \"./Extraction/ExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useFetchMappingExtractionStatus } from \"./hooks/useFetchMappingExtractionStatus\";\nimport \"./MappingListItem.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nexport interface MappingListItemProps {\n selected: boolean;\n mapping: Mapping;\n jobId: string;\n jobStartEvent: BeEvent<(mappingId: string) => void>;\n onSelectionChange?: (mapping: Mapping) => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n onRefreshMappings: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n setShowDeleteModal: (mapping?: Mapping) => void;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n}\n\nexport const MappingListItem = ({\n selected,\n onSelectionChange,\n mapping,\n jobId,\n jobStartEvent,\n onClickMappingModify,\n onClickMappingTitle,\n onRefreshMappings,\n onToggleExtraction,\n setShowDeleteModal,\n}: MappingListItemProps) => {\n const [extractionState, setExtractionState] = useState<ExtractionStates | undefined>(ExtractionStates.None);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const statusQuery = useFetchMappingExtractionStatus({ ...groupingMappingApiConfig, mapping, enabled: isJobStarted });\n const queryClient = useQueryClient();\n\n const onClickTile = useCallback(() => {\n onSelectionChange && onSelectionChange(mapping);\n }, [mapping, onSelectionChange]);\n\n // Check whether the job is still running when users refresh the mapping list\n // or modify any mappings\n useEffect(() => {\n if(mappingIdJobInfo.get(mapping.id)){\n setIsJobStarted(true);\n }\n }, [mappingIdJobInfo, mapping.id]);\n\n const resolveTerminalExtractionStatus = useCallback(async () => {\n const state = statusQuery.data!.finalExtractionStateValue;\n if (state === ExtractionStates.Failed || state === ExtractionStates.Succeeded) {\n setIsJobStarted(false);\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.delete(mapping.id);\n return newMap;\n });\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n }\n }, [mapping.id, queryClient, setMappingIdJobInfo, statusQuery.data]);\n\n useEffect(() => {\n const listener = (startedMappingId: string) => {\n if (startedMappingId === mapping.id) {\n setExtractionState(ExtractionStates.Starting);\n setIsJobStarted(true);\n }\n };\n jobStartEvent.addListener(listener);\n\n return () => {\n jobStartEvent.removeListener(listener);\n };\n }, [jobStartEvent, mapping.id, jobId]);\n\n useEffect(() => {\n const isStatusReady = statusQuery.data && statusQuery.isFetched;\n if (isStatusReady) {\n setExtractionState(statusQuery.data.finalExtractionStateValue);\n // No need to await. We don't need to wait for the status to be resolved in invalidation.\n void resolveTerminalExtractionStatus();\n }\n }, [resolveTerminalExtractionStatus, statusQuery]);\n\n return (\n <ListItem\n actionable={!!onSelectionChange}\n className=\"gmw-mapping-list-item\"\n active={selected}\n key={mapping.id}\n onClick={onClickTile}\n title={mapping.mappingName}>\n <ListItem.Content>\n {onClickMappingTitle ? <Anchor onClick={() => onClickMappingTitle(mapping)}>{mapping.mappingName}</Anchor> : mapping.mappingName}\n <ListItem.Description>\n {mapping.description}\n </ListItem.Description>\n </ListItem.Content>\n <ExtractionStatus\n state={extractionState}\n clearExtractionState={() => {\n setExtractionState(ExtractionStates.None);\n }}\n ></ExtractionStatus >\n <MappingViewActionGroup\n mapping={mapping}\n onToggleExtraction={onToggleExtraction}\n onRefresh={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n </ListItem>\n );\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
.gmw-mapping-list-item {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
border-radius: 5px;
|
|
9
|
+
min-height: calc(var(--iui-size-s) * 5);
|
|
10
|
+
padding: 5.5px var(--iui-size-xs);
|
|
11
|
+
padding-bottom: 2px var(--iui-size-xs);
|
|
12
|
+
padding-top: 2px var(--iui-size-xs);
|
|
13
|
+
}
|
|
@@ -7,6 +7,6 @@ interface MappingUIActionGroupProps {
|
|
|
7
7
|
onClickMappingModify?: (mapping: Mapping) => void;
|
|
8
8
|
setShowDeleteModal: (mapping?: Mapping) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const MappingViewActionGroup: ({ mapping, onToggleExtraction, onRefresh, onClickMappingModify, setShowDeleteModal, }: MappingUIActionGroupProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=MappingViewActionGroup.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { DropdownMenu, IconButton, MenuItem, } from "@itwin/itwinui-react";
|
|
7
7
|
import { SvgDelete, SvgEdit, SvgMore, SvgProcess, } from "@itwin/itwinui-icons-react";
|
|
8
|
-
export const
|
|
8
|
+
export const MappingViewActionGroup = ({ mapping, onToggleExtraction, onRefresh, onClickMappingModify, setShowDeleteModal, }) => {
|
|
9
9
|
return (React.createElement(DropdownMenu, { menuItems: (close) => [
|
|
10
10
|
onClickMappingModify ? (React.createElement(MenuItem, { key: 0, onClick: () => {
|
|
11
11
|
onClickMappingModify(mapping);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MappingViewActionGroup.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingViewActionGroup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,GACX,MAAM,4BAA4B,CAAC;AAWpC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"MappingViewActionGroup.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingViewActionGroup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,GACX,MAAM,4BAA4B,CAAC;AAWpC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,OAAO,EACP,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,GACQ,EAAE,EAAE;IAC9B,OAAO,CACL,oBAAC,YAAY,IACX,SAAS,EAAE,CAAC,KAAiB,EAAE,EAAE,CAAC;YAChC,oBAAoB,CAAC,CAAC,CAAC,CACrB,oBAAC,QAAQ,IACP,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,GAAG,EAAE;oBACZ,oBAAoB,CAAC,OAAO,CAAC,CAAC;oBAC9B,KAAK,EAAE,CAAC;gBACV,CAAC,EACD,IAAI,EAAE,oBAAC,OAAO,OAAG,aAGR,CACZ,CAAC,CAAC,CAAC,EAAE;YACN,oBAAC,QAAQ,IACP,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,KAAK,EAAE,CAAC;oBACR,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC;oBAClC,MAAM,SAAS,EAAE,CAAC;gBACpB,CAAC,EACD,IAAI,EAAE,oBAAC,UAAU,OAAG,IAEnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,CAC9D;YACX,oBAAC,QAAQ,IACP,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,GAAG,EAAE;oBACZ,kBAAkB,CAAC,OAAO,CAAC,CAAC;oBAC5B,KAAK,EAAE,CAAC;gBACV,CAAC,EACD,IAAI,EAAE,oBAAC,SAAS,OAAG,aAGV;SACZ,CAAC,IAAI,EAAE;QAER,oBAAC,UAAU,IAAC,SAAS,EAAC,YAAY,EAAC,KAAK,EAAC,iBAAiB;YACxD,oBAAC,OAAO,OACN,CACS,CACA,CAChB,CAAC;AACJ,CAAC,CAAC","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 from \"react\";\nimport {\n DropdownMenu,\n IconButton,\n MenuItem,\n} from \"@itwin/itwinui-react\";\nimport {\n SvgDelete,\n SvgEdit,\n SvgMore,\n SvgProcess,\n} from \"@itwin/itwinui-icons-react\";\nimport type { Mapping } from \"@itwin/insights-client\";\n\ninterface MappingUIActionGroupProps {\n mapping: Mapping;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n onRefresh: () => Promise<void>;\n onClickMappingModify?: (mapping: Mapping) => void;\n setShowDeleteModal: (mapping?: Mapping) => void;\n}\n\nexport const MappingViewActionGroup = ({\n mapping,\n onToggleExtraction,\n onRefresh,\n onClickMappingModify,\n setShowDeleteModal,\n}: MappingUIActionGroupProps) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n onClickMappingModify ? (\n <MenuItem\n key={0}\n onClick={() => {\n onClickMappingModify(mapping);\n close();\n }}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>\n ) : [],\n <MenuItem\n key={1}\n onClick={async () => {\n close();\n await onToggleExtraction(mapping);\n await onRefresh();\n }}\n icon={<SvgProcess />}\n >\n {mapping.extractionEnabled ? \"Disable extraction\" : \"Enable extraction\"}\n </MenuItem>,\n <MenuItem\n key={2}\n onClick={() => {\n setShowDeleteModal(mapping);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ].flat()}\n >\n <IconButton styleType=\"borderless\" title='Mapping Options'>\n <SvgMore\n />\n </IconButton>\n </DropdownMenu>\n );\n};\n"]}
|
|
@@ -35,6 +35,8 @@ export interface MappingsViewProps {
|
|
|
35
35
|
onClickMappingTitle?: (mapping: Mapping) => void;
|
|
36
36
|
onClickMappingModify?: (mapping: Mapping) => void;
|
|
37
37
|
alert?: React.ReactElement<typeof Alert>;
|
|
38
|
+
initialStateExtractionFlag?: boolean;
|
|
39
|
+
setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;
|
|
38
40
|
}
|
|
39
41
|
export declare const MappingsView: ({ mappings, isLoading, extractionStatusData, showExtractionMessageModal, extractionMessageData, setShowExtractionMessageModal, isTogglingExtraction, onRefreshMappings, onRefreshExtractionStatus, onToggleExtraction, onDelete, showDeleteModal, setShowDeleteModal, displayStrings: userDisplayStrings, showImportModal, setShowImportModal, onClickAddMapping, onClickMappingTitle, onClickMappingModify, alert, }: MappingsViewProps) => JSX.Element;
|
|
40
42
|
//# sourceMappingURL=MappingsView.d.ts.map
|
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import React, { useCallback } from "react";
|
|
6
|
-
import { Button, IconButton, } from "@itwin/itwinui-react";
|
|
7
|
-
import { SvgAdd, SvgImport, SvgRefresh, } from "@itwin/itwinui-icons-react";
|
|
5
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
6
|
+
import { Button, IconButton, List, } from "@itwin/itwinui-react";
|
|
7
|
+
import { SvgAdd, SvgImport, SvgPlay, SvgRefresh, } from "@itwin/itwinui-icons-react";
|
|
8
8
|
import { EmptyMessage } from "../SharedComponents/EmptyMessage";
|
|
9
9
|
import { LoadingOverlay } from "../SharedComponents/LoadingOverlay";
|
|
10
10
|
import "./MappingsView.scss";
|
|
11
11
|
import DeleteModal from "../SharedComponents/DeleteModal";
|
|
12
12
|
import { MappingImportWizardModal } from "./Import/MappingImportWizardModal";
|
|
13
|
-
import { HorizontalTile } from "../SharedComponents/HorizontalTile";
|
|
14
13
|
import { BlockingOverlay } from "./BlockingOverlay";
|
|
15
|
-
import { MappingUIActionGroup } from "./MappingViewActionGroup";
|
|
16
14
|
import { ExtractionStatusIcon } from "./Extraction/ExtractionStatusIcon";
|
|
15
|
+
import { MappingListItem } from "./MappingListItem";
|
|
17
16
|
import { ExtractionMessageModal } from "./Extraction/ExtractionMessageModal";
|
|
17
|
+
import { BeEvent } from "@itwin/core-bentley";
|
|
18
|
+
import { useExtractionStateJobContext } from "../context/ExtractionStateJobContext";
|
|
19
|
+
import { useGroupingMappingApiConfig } from "../context/GroupingApiConfigContext";
|
|
20
|
+
import { useRunExtraction } from "./hooks/useRunExtraction";
|
|
18
21
|
export const mappingViewDefaultDisplayStrings = {
|
|
19
22
|
mappings: "Mappings",
|
|
20
23
|
iTwins: "iTwins",
|
|
@@ -27,9 +30,28 @@ export const mappingViewDefaultDisplayStrings = {
|
|
|
27
30
|
};
|
|
28
31
|
export const MappingsView = ({ mappings, isLoading, extractionStatusData, showExtractionMessageModal, extractionMessageData, setShowExtractionMessageModal, isTogglingExtraction, onRefreshMappings, onRefreshExtractionStatus, onToggleExtraction, onDelete, showDeleteModal, setShowDeleteModal, displayStrings: userDisplayStrings, showImportModal, setShowImportModal, onClickAddMapping, onClickMappingTitle, onClickMappingModify, alert, }) => {
|
|
29
32
|
const displayStrings = React.useMemo(() => ({ ...mappingViewDefaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
|
|
33
|
+
const [selectedMappings, setSelectedMappings] = useState([]);
|
|
34
|
+
const groupingMappingApiConfig = useGroupingMappingApiConfig();
|
|
35
|
+
const { mappingIdJobInfo } = useExtractionStateJobContext();
|
|
36
|
+
const { runExtraction } = useRunExtraction(groupingMappingApiConfig);
|
|
37
|
+
const jobStartEvent = useMemo(() => new BeEvent(), []);
|
|
30
38
|
const refreshAll = useCallback(async () => {
|
|
31
39
|
await Promise.all([onRefreshMappings(), onRefreshExtractionStatus()]);
|
|
32
40
|
}, [onRefreshMappings, onRefreshExtractionStatus]);
|
|
41
|
+
const onSelectionChange = (mapping) => {
|
|
42
|
+
setSelectedMappings((mappingIdList) => {
|
|
43
|
+
return mappingIdList.some((eachId) => mapping.id === eachId.id)
|
|
44
|
+
? mappingIdList.filter((eachId) => mapping.id !== eachId.id)
|
|
45
|
+
: [...mappingIdList, mapping];
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const onRunExtraction = useCallback(async () => {
|
|
49
|
+
await runExtraction(selectedMappings);
|
|
50
|
+
selectedMappings.map((mapping) => {
|
|
51
|
+
jobStartEvent.raiseEvent(mapping.id);
|
|
52
|
+
});
|
|
53
|
+
setSelectedMappings([]);
|
|
54
|
+
}, [selectedMappings, jobStartEvent, runExtraction]);
|
|
33
55
|
return (React.createElement(React.Fragment, null,
|
|
34
56
|
React.createElement(BlockingOverlay, { isVisible: isTogglingExtraction }),
|
|
35
57
|
React.createElement("div", { className: "gmw-mappings-view-container" },
|
|
@@ -38,7 +60,9 @@ export const MappingsView = ({ mappings, isLoading, extractionStatusData, showEx
|
|
|
38
60
|
onClickAddMapping &&
|
|
39
61
|
React.createElement(Button, { startIcon: React.createElement(SvgAdd, null), onClick: onClickAddMapping, styleType: "high-visibility", title: "New Mapping" }, "New"),
|
|
40
62
|
showImportModal !== undefined && setShowImportModal && React.createElement(IconButton, { title: `Import ${displayStrings.mappings}`, onClick: () => setShowImportModal(true) },
|
|
41
|
-
React.createElement(SvgImport, null))
|
|
63
|
+
React.createElement(SvgImport, null)),
|
|
64
|
+
React.createElement(IconButton, { title: "Run extraction", onClick: onRunExtraction, disabled: selectedMappings.length === 0 },
|
|
65
|
+
React.createElement(SvgPlay, null))),
|
|
42
66
|
React.createElement("div", { className: "gmw-button-spacing" },
|
|
43
67
|
React.createElement(ExtractionStatusIcon, { iconStatus: extractionStatusData.iconStatus, onClick: () => {
|
|
44
68
|
if (extractionStatusData.iconStatus === "negative") {
|
|
@@ -49,7 +73,7 @@ export const MappingsView = ({ mappings, isLoading, extractionStatusData, showEx
|
|
|
49
73
|
React.createElement(SvgRefresh, null)))),
|
|
50
74
|
alert,
|
|
51
75
|
React.createElement("div", { className: 'gmw-mappings-border' }),
|
|
52
|
-
isLoading ? (React.createElement(LoadingOverlay, null)) : mappings.length === 0 ? (React.createElement(EmptyMessage, { message: `No ${displayStrings.mappings} available.` })) : (React.createElement(
|
|
76
|
+
isLoading ? (React.createElement(LoadingOverlay, null)) : mappings.length === 0 ? (React.createElement(EmptyMessage, { message: `No ${displayStrings.mappings} available.` })) : (React.createElement(List, { className: "gmw-mappings-list" }, mappings.map((mapping) => (React.createElement(MappingListItem, { key: mapping.id, mapping: mapping, jobId: mappingIdJobInfo?.get(mapping.id) ?? "", jobStartEvent: jobStartEvent, onClickMappingTitle: onClickMappingTitle, onSelectionChange: onSelectionChange, selected: selectedMappings.some((eachMapping) => mapping.id === eachMapping.id), onToggleExtraction: onToggleExtraction, onRefreshMappings: onRefreshMappings, onClickMappingModify: onClickMappingModify, setShowDeleteModal: setShowDeleteModal })))))),
|
|
53
77
|
showExtractionMessageModal && React.createElement(ExtractionMessageModal, { isOpen: showExtractionMessageModal, onClose: () => setShowExtractionMessageModal(false), extractionMessageData: extractionMessageData, timestamp: extractionMessageData.length === 0 ? "" : extractionMessageData[0].date }),
|
|
54
78
|
showDeleteModal &&
|
|
55
79
|
React.createElement(DeleteModal, { entityName: showDeleteModal?.mappingName, onClose: () => setShowDeleteModal(undefined), onDelete: async () => {
|