@itwin/grouping-mapping-widget 0.23.1 → 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/GroupsVisualization.js +31 -9
- 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 +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/GroupsVisualization.js +31 -9
- 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 +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":"ExtractionMessageModal.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Extraction/ExtractionMessageModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAAiI;AACjI,+CAAyE;AAEzE,yCAAuC;AACvC,oEAAsD;AAEtD,kEAA+D;AAC/D,2EAAwE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MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,MAAM;YACjB,MAAM,EAAE,4BAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC;SAClD;KACF,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,iBAAiB,CAAC;IAErF,OAAO,CACL,8BAAC,qBAAK,IAAC,SAAS,EAAC,6BAA6B,EAC5C,KAAK,EAAC,iBAAiB,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,KAAK;QAE3B,8BAAC,4BAAY;YACX,uCAAK,SAAS,EAAC,oBAAoB;gBACjC,8BAAC,oBAAI,IACH,KAAK,EAAC,sBAAsB,EAC5B,IAAI,EAAC,QAAQ;oBAEb,8BAAC,8BAAQ,OAAG,CACP;gBACP,8BAAC,oBAAI,QAAE,kBAAkB,CAAQ,CAC7B;YACN,8BAAC,qBAAK,IACJ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,0BAA0B,IAAI,EAAE,EACtC,iBAAiB,EAAE,EAAE,EACrB,yBAAyB,EAAC,2BAA2B,EACrD,SAAS,EAAC,wCAAwC,EAClD,SAAS,EAAE,SAAS,GACpB,CACW;QACf,8BAAC,8BAAc;YACb,8BAAC,sBAAM,IACL,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,iBAAiB,YAGpB,CACM,CACX,CACT,CAAC;AACJ,CAAC,CAAC;AAnKW,QAAA,sBAAsB,0BAmKjC","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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BAAoB;gBACjC,8BAAC,oBAAI,IACH,KAAK,EAAC,sBAAsB,EAC5B,IAAI,EAAC,QAAQ;oBAEb,8BAAC,8BAAQ,OAAG,CACP;gBACP,8BAAC,oBAAI,QAAE,kBAAkB,CAAQ,CAC7B;YACN,8BAAC,qBAAK,IACJ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,0BAA0B,IAAI,EAAE,EACtC,iBAAiB,EAAE,EAAE,EACrB,yBAAyB,EAAC,2BAA2B,EACrD,SAAS,EAAC,wCAAwC,EAClD,SAAS,EAAE,SAAS,GACpB,CACW;QACf,8BAAC,8BAAc;YACb,8BAAC,sBAAM,IACL,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,iBAAiB,YAGpB,CACM,CACX,CACT,CAAC;AACJ,CAAC,CAAC;AA5KW,QAAA,sBAAsB,0BA4KjC","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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QueuedExtractionState = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
13
|
+
const QueuedExtractionState = () => (react_1.default.createElement("div", { title: "Queued", className: "gmw-extraction-status" },
|
|
14
|
+
react_1.default.createElement("div", { className: "gmw-status-icon" },
|
|
15
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgStatusPending, null))));
|
|
16
|
+
exports.QueuedExtractionState = QueuedExtractionState;
|
|
17
|
+
//# 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,kDAA0B;AAC1B,oEAA8D;AAEvD,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,CACzC,uCACE,KAAK,EAAC,QAAQ,EACd,SAAS,EAAC,uBAAuB;IACjC,uCAAK,SAAS,EAAC,iBAAiB;QAC9B,8BAAC,sCAAgB,OAAG,CAChB,CACF,CACP,CAAC;AARW,QAAA,qBAAqB,yBAQhC","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,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RunningExtractionState = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
|
+
const RunningExtractionState = () => (react_1.default.createElement("div", { title: "Running", className: "gmw-extraction-status-running" },
|
|
14
|
+
react_1.default.createElement(itwinui_react_1.ProgressRadial, { size: "x-small", indeterminate: true })));
|
|
15
|
+
exports.RunningExtractionState = RunningExtractionState;
|
|
16
|
+
//# 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,kDAA0B;AAC1B,wDAAsD;AAE/C,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,CAC1C,uCACE,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,+BAA+B;IACzC,8BAAC,8BAAc,IAAC,IAAI,EAAC,SAAS,EAAC,aAAa,SAAG,CAC3C,CACP,CAAC;AANW,QAAA,sBAAsB,0BAMjC","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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.StartingExtractionState = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const itwinui_icons_color_react_1 = require("@itwin/itwinui-icons-color-react");
|
|
13
|
+
const StartingExtractionState = () => (react_1.default.createElement("div", { title: "Starting", className: "gmw-extraction-status" },
|
|
14
|
+
react_1.default.createElement("div", { className: "gmw-status-icon" },
|
|
15
|
+
react_1.default.createElement(itwinui_icons_color_react_1.SvgStatusPendingHollow, null))));
|
|
16
|
+
exports.StartingExtractionState = StartingExtractionState;
|
|
17
|
+
//# sourceMappingURL=StartingExtractionState.js.map
|
package/lib/cjs/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,kDAA0B;AAC1B,gFAA0E;AAEnE,MAAM,uBAAuB,GAAG,GAAG,EAAE,CAAC,CAC3C,uCACE,KAAK,EAAC,UAAU,EAChB,SAAS,EAAC,uBAAuB;IACjC,uCAAK,SAAS,EAAC,iBAAiB;QAC9B,8BAAC,kDAAsB,OAAG,CACtB,CACF,CACP,CAAC;AARW,QAAA,uBAAuB,2BAQlC","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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TerminalExtractionState = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const itwinui_icons_color_react_1 = require("@itwin/itwinui-icons-color-react");
|
|
13
|
+
const Constants_1 = require("../../../Constants");
|
|
14
|
+
const TerminalExtractionState = ({ status, animation, onAnimationEnd }) => (react_1.default.createElement("div", { title: status, className: "gmw-extraction-status" },
|
|
15
|
+
react_1.default.createElement("div", { className: `gmw-status-icon`, style: {
|
|
16
|
+
animationName: animation ? "gmw-fade-out" : "",
|
|
17
|
+
animationDelay: Constants_1.ANIMATION_DELAY,
|
|
18
|
+
animationDuration: Constants_1.ANIMATION_DURATION,
|
|
19
|
+
}, onAnimationEnd: onAnimationEnd }, status === "Succeeded" ? react_1.default.createElement(itwinui_icons_color_react_1.SvgStatusSuccess, null) : react_1.default.createElement(itwinui_icons_color_react_1.SvgStatusError, null))));
|
|
20
|
+
exports.TerminalExtractionState = TerminalExtractionState;
|
|
21
|
+
//# sourceMappingURL=TerminalExtractionState.js.map
|
package/lib/cjs/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,kDAA0B;AAC1B,gFAAoF;AACpF,kDAAyE;AAQlE,MAAM,uBAAuB,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAwB,EAAE,EAAE,CAAC,CACtG,uCACE,KAAK,EAAE,MAAM,EACb,SAAS,EAAC,uBAAuB;IACjC,uCACE,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE;YACL,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;YAC9C,cAAc,EAAE,2BAAe;YAC/B,iBAAiB,EAAE,8BAAkB;SACtC,EACD,cAAc,EAAE,cAAc,IAE7B,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,8BAAC,4CAAgB,OAAG,CAAC,CAAC,CAAC,8BAAC,0CAAc,OAAG,CAC/D,CACF,CACP,CAAC;AAhBW,QAAA,uBAAuB,2BAgBlC","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,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ExtractionStatus = exports.ExtractionStates = void 0;
|
|
27
|
+
/*---------------------------------------------------------------------------------------------
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
|
+
const react_1 = require("react");
|
|
32
|
+
const React = __importStar(require("react"));
|
|
33
|
+
const Constants_1 = require("../../Constants");
|
|
34
|
+
const StartingExtractionState_1 = require("./ExtractionStates/StartingExtractionState");
|
|
35
|
+
const QueuedExtractionState_1 = require("./ExtractionStates/QueuedExtractionState");
|
|
36
|
+
const TerminalExtractionState_1 = require("./ExtractionStates/TerminalExtractionState");
|
|
37
|
+
const RunningExtractionState_1 = require("./ExtractionStates/RunningExtractionState");
|
|
38
|
+
require("./ExtractionStatus.scss");
|
|
39
|
+
var ExtractionStates;
|
|
40
|
+
(function (ExtractionStates) {
|
|
41
|
+
ExtractionStates[ExtractionStates["None"] = 0] = "None";
|
|
42
|
+
ExtractionStates[ExtractionStates["Starting"] = 1] = "Starting";
|
|
43
|
+
ExtractionStates[ExtractionStates["Queued"] = 2] = "Queued";
|
|
44
|
+
ExtractionStates[ExtractionStates["Running"] = 3] = "Running";
|
|
45
|
+
ExtractionStates[ExtractionStates["Succeeded"] = 4] = "Succeeded";
|
|
46
|
+
ExtractionStates[ExtractionStates["Failed"] = 5] = "Failed";
|
|
47
|
+
})(ExtractionStates = exports.ExtractionStates || (exports.ExtractionStates = {}));
|
|
48
|
+
const ExtractionStatus = ({ state, clearExtractionState, }) => {
|
|
49
|
+
const [fadeOut, setFadeOut] = (0, react_1.useState)(false);
|
|
50
|
+
const onAnimationEnd = () => {
|
|
51
|
+
clearExtractionState();
|
|
52
|
+
setFadeOut(false);
|
|
53
|
+
};
|
|
54
|
+
(0, react_1.useEffect)(() => {
|
|
55
|
+
let timer;
|
|
56
|
+
switch (state) {
|
|
57
|
+
case ExtractionStates.Succeeded:
|
|
58
|
+
case ExtractionStates.Failed:
|
|
59
|
+
timer = window.setTimeout(() => setFadeOut(true), Constants_1.STATUS_CHECK_INTERVAL);
|
|
60
|
+
}
|
|
61
|
+
return () => window.clearTimeout(timer);
|
|
62
|
+
}, [state]);
|
|
63
|
+
switch (state) {
|
|
64
|
+
case ExtractionStates.Starting:
|
|
65
|
+
return (React.createElement(StartingExtractionState_1.StartingExtractionState, null));
|
|
66
|
+
case ExtractionStates.Queued:
|
|
67
|
+
return (React.createElement(QueuedExtractionState_1.QueuedExtractionState, null));
|
|
68
|
+
case ExtractionStates.Running:
|
|
69
|
+
return (React.createElement(RunningExtractionState_1.RunningExtractionState, null));
|
|
70
|
+
case ExtractionStates.Succeeded:
|
|
71
|
+
return (React.createElement(TerminalExtractionState_1.TerminalExtractionState, { status: "Succeeded", animation: fadeOut, onAnimationEnd: onAnimationEnd }));
|
|
72
|
+
case ExtractionStates.Failed:
|
|
73
|
+
return (React.createElement(TerminalExtractionState_1.TerminalExtractionState, { status: "Failed", animation: fadeOut, onAnimationEnd: onAnimationEnd }));
|
|
74
|
+
default:
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.ExtractionStatus = ExtractionStatus;
|
|
79
|
+
//# 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,iCAA4C;AAC5C,6CAA+B;AAC/B,+CAAwD;AACxD,wFAAqF;AACrF,oFAAiF;AACjF,wFAAqF;AACrF,sFAAmF;AACnF,mCAAiC;AAEjC,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,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B;AAOM,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAEvD,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,oBAAoB,EAAE,CAAC;QACvB,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,IAAA,iBAAS,EAAC,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,iCAAqB,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,iDAAuB,OAAG,CAAC,CAAC;QACvC,KAAK,gBAAgB,CAAC,MAAM;YAC1B,OAAO,CAAC,oBAAC,6CAAqB,OAAG,CAAC,CAAC;QACrC,KAAK,gBAAgB,CAAC,OAAO;YAC3B,OAAO,CAAC,oBAAC,+CAAsB,OAAG,CAAC,CAAC;QACtC,KAAK,gBAAgB,CAAC,SAAS;YAC7B,OAAO,CAAC,oBAAC,iDAAuB,IAC9B,MAAM,EAAC,WAAW,EAClB,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,cAAc,GAC9B,CAAC,CAAC;QACN,KAAK,gBAAgB,CAAC,MAAM;YAC1B,OAAO,CAAC,oBAAC,iDAAuB,IAC9B,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,cAAc,GAC9B,CAAC,CAAC;QACN;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AA3CW,QAAA,gBAAgB,oBA2C3B","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
|
+
onSelectionChange: (mapping: Mapping) => void;
|
|
8
|
+
mapping: Mapping;
|
|
9
|
+
jobId: string;
|
|
10
|
+
jobStartEvent: BeEvent<(mappingId: string) => 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,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.MappingListItem = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const MappingViewActionGroup_1 = require("./MappingViewActionGroup");
|
|
29
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
30
|
+
const ExtractionStatus_1 = require("./Extraction/ExtractionStatus");
|
|
31
|
+
const ExtractionStatus_2 = require("./Extraction/ExtractionStatus");
|
|
32
|
+
const ExtractionStateJobContext_1 = require("../context/ExtractionStateJobContext");
|
|
33
|
+
const useFetchMappingExtractionStatus_1 = require("./hooks/useFetchMappingExtractionStatus");
|
|
34
|
+
require("./MappingListItem.scss");
|
|
35
|
+
const GroupingApiConfigContext_1 = require("../context/GroupingApiConfigContext");
|
|
36
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
37
|
+
const MappingListItem = ({ selected, onSelectionChange, mapping, jobId, jobStartEvent, onClickMappingModify, onClickMappingTitle, onRefreshMappings, onToggleExtraction, setShowDeleteModal, }) => {
|
|
38
|
+
const [extractionState, setExtractionState] = (0, react_1.useState)(ExtractionStatus_1.ExtractionStates.None);
|
|
39
|
+
const { mappingIdJobInfo, setMappingIdJobInfo } = (0, ExtractionStateJobContext_1.useExtractionStateJobContext)();
|
|
40
|
+
const groupingMappingApiConfig = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
41
|
+
const [isJobStarted, setIsJobStarted] = (0, react_1.useState)(false);
|
|
42
|
+
const statusQuery = (0, useFetchMappingExtractionStatus_1.useFetchMappingExtractionStatus)({ ...groupingMappingApiConfig, mapping, enabled: isJobStarted });
|
|
43
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
44
|
+
const onClickTile = () => {
|
|
45
|
+
onSelectionChange(mapping);
|
|
46
|
+
};
|
|
47
|
+
// Check whether the job is still running when users refresh the mapping list
|
|
48
|
+
// or modify any mappings
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
50
|
+
if (mappingIdJobInfo.get(mapping.id)) {
|
|
51
|
+
setIsJobStarted(true);
|
|
52
|
+
}
|
|
53
|
+
}, [mappingIdJobInfo, mapping.id]);
|
|
54
|
+
const resolveTerminalExtractionStatus = (0, react_1.useCallback)(async () => {
|
|
55
|
+
const state = statusQuery.data.finalExtractionStateValue;
|
|
56
|
+
if (state === ExtractionStatus_1.ExtractionStates.Failed || state === ExtractionStatus_1.ExtractionStates.Succeeded) {
|
|
57
|
+
setIsJobStarted(false);
|
|
58
|
+
setMappingIdJobInfo((prevMap) => {
|
|
59
|
+
const newMap = new Map(prevMap);
|
|
60
|
+
newMap.delete(mapping.id);
|
|
61
|
+
return newMap;
|
|
62
|
+
});
|
|
63
|
+
await queryClient.invalidateQueries({ queryKey: ["iModelExtractionStatus"] });
|
|
64
|
+
}
|
|
65
|
+
}, [mapping.id, queryClient, setMappingIdJobInfo, statusQuery.data]);
|
|
66
|
+
(0, react_1.useEffect)(() => {
|
|
67
|
+
const listener = (startedMappingId) => {
|
|
68
|
+
if (startedMappingId === mapping.id) {
|
|
69
|
+
setExtractionState(ExtractionStatus_1.ExtractionStates.Starting);
|
|
70
|
+
setIsJobStarted(true);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
jobStartEvent.addListener(listener);
|
|
74
|
+
return () => {
|
|
75
|
+
jobStartEvent.removeListener(listener);
|
|
76
|
+
};
|
|
77
|
+
}, [jobStartEvent, mapping.id, jobId]);
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
const isStatusReady = statusQuery.data && statusQuery.isFetched;
|
|
80
|
+
if (isStatusReady) {
|
|
81
|
+
setExtractionState(statusQuery.data.finalExtractionStateValue);
|
|
82
|
+
// No need to await. We don't need to wait for the status to be resolved in invalidation.
|
|
83
|
+
void resolveTerminalExtractionStatus();
|
|
84
|
+
}
|
|
85
|
+
}, [resolveTerminalExtractionStatus, statusQuery]);
|
|
86
|
+
return (react_1.default.createElement(itwinui_react_1.ListItem, { actionable: true, className: "gmw-list-item-container", active: selected, key: mapping.id, onClick: onClickTile, title: mapping.mappingName },
|
|
87
|
+
react_1.default.createElement(itwinui_react_1.ListItem.Content, null,
|
|
88
|
+
react_1.default.createElement(itwinui_react_1.Anchor, { onClick: onClickMappingTitle ? () => onClickMappingTitle?.(mapping) : undefined }, mapping.mappingName ? mapping.mappingName : "Untitled"),
|
|
89
|
+
mapping.description && react_1.default.createElement(itwinui_react_1.Text, { className: "gmw-body-text", isMuted: true, title: mapping.description, variant: "small" }, mapping.description)),
|
|
90
|
+
react_1.default.createElement(ExtractionStatus_2.ExtractionStatus, { state: extractionState, clearExtractionState: () => {
|
|
91
|
+
setExtractionState(ExtractionStatus_1.ExtractionStates.None);
|
|
92
|
+
} }),
|
|
93
|
+
react_1.default.createElement(MappingViewActionGroup_1.MappingUIActionGroup, { mapping: mapping, onToggleExtraction: onToggleExtraction, onRefresh: onRefreshMappings, onClickMappingModify: onClickMappingModify, setShowDeleteModal: setShowDeleteModal })));
|
|
94
|
+
};
|
|
95
|
+
exports.MappingListItem = MappingListItem;
|
|
96
|
+
//# sourceMappingURL=MappingListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MappingListItem.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingListItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,+CAAgE;AAEhE,qEAAgE;AAChE,wDAA8D;AAC9D,oEAAiE;AACjE,oEAAiE;AACjE,oFAAoF;AACpF,6FAA0F;AAC1F,kCAAgC;AAChC,kFAAkF;AAClF,uDAAuD;AAiBhD,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACG,EAAE,EAAE;IACzB,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAA+B,mCAAgB,CAAC,IAAI,CAAC,CAAC;IAC5G,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,IAAA,wDAA4B,GAAE,CAAC;IACjF,MAAM,wBAAwB,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC/D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,IAAA,iEAA+B,EAAC,EAAE,GAAG,wBAAwB,EAAE,OAAO,EAAE,O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,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAC,OAAO,IAAE,OAAO,CAAC,WAAW,CAAQ,CAC9H;QACnB,8BAAC,mCAAgB,IACf,KAAK,EAAE,eAAe,EACtB,oBAAoB,EAAE,GAAG,EAAE;gBACzB,kBAAkB,CAAC,mCAAgB,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC,GACkB;QACrB,8BAAC,6CAAoB,IACnB,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;AA7FW,QAAA,eAAe,mBA6F1B","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 { MappingUIActionGroup } from \"./MappingViewActionGroup\";\nimport { Anchor, ListItem, Text } 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 onSelectionChange: (mapping: Mapping) => void;\n mapping: Mapping;\n jobId: string;\n jobStartEvent: BeEvent<(mappingId: string) => 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 = () => {\n onSelectionChange(mapping);\n };\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 actionable\n className=\"gmw-list-item-container\"\n active={selected}\n key={mapping.id}\n onClick={onClickTile}\n title={mapping.mappingName}>\n <ListItem.Content>\n <Anchor onClick={onClickMappingTitle ? () => onClickMappingTitle?.(mapping) : undefined}>{mapping.mappingName ? mapping.mappingName : \"Untitled\"}</Anchor>\n {mapping.description && <Text className=\"gmw-body-text\" isMuted={true} title={mapping.description} variant=\"small\">{mapping.description}</Text>}\n </ListItem.Content>\n <ExtractionStatus\n state={extractionState}\n clearExtractionState={() => {\n setExtractionState(ExtractionStates.None);\n }}\n ></ExtractionStatus >\n <MappingUIActionGroup\n mapping={mapping}\n onToggleExtraction={onToggleExtraction}\n onRefresh={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n </ListItem>\n );\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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-list-item-container{
|
|
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
|
+
}
|
|
14
|
+
|
|
15
|
+
.gmw-body {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
&-text {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -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
|
|
@@ -39,11 +39,14 @@ const LoadingOverlay_1 = require("../SharedComponents/LoadingOverlay");
|
|
|
39
39
|
require("./MappingsView.scss");
|
|
40
40
|
const DeleteModal_1 = __importDefault(require("../SharedComponents/DeleteModal"));
|
|
41
41
|
const MappingImportWizardModal_1 = require("./Import/MappingImportWizardModal");
|
|
42
|
-
const HorizontalTile_1 = require("../SharedComponents/HorizontalTile");
|
|
43
42
|
const BlockingOverlay_1 = require("./BlockingOverlay");
|
|
44
|
-
const MappingViewActionGroup_1 = require("./MappingViewActionGroup");
|
|
45
43
|
const ExtractionStatusIcon_1 = require("./Extraction/ExtractionStatusIcon");
|
|
44
|
+
const MappingListItem_1 = require("./MappingListItem");
|
|
46
45
|
const ExtractionMessageModal_1 = require("./Extraction/ExtractionMessageModal");
|
|
46
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
47
|
+
const ExtractionStateJobContext_1 = require("../context/ExtractionStateJobContext");
|
|
48
|
+
const GroupingApiConfigContext_1 = require("../context/GroupingApiConfigContext");
|
|
49
|
+
const useRunExtraction_1 = require("./hooks/useRunExtraction");
|
|
47
50
|
exports.mappingViewDefaultDisplayStrings = {
|
|
48
51
|
mappings: "Mappings",
|
|
49
52
|
iTwins: "iTwins",
|
|
@@ -56,9 +59,28 @@ exports.mappingViewDefaultDisplayStrings = {
|
|
|
56
59
|
};
|
|
57
60
|
const MappingsView = ({ mappings, isLoading, extractionStatusData, showExtractionMessageModal, extractionMessageData, setShowExtractionMessageModal, isTogglingExtraction, onRefreshMappings, onRefreshExtractionStatus, onToggleExtraction, onDelete, showDeleteModal, setShowDeleteModal, displayStrings: userDisplayStrings, showImportModal, setShowImportModal, onClickAddMapping, onClickMappingTitle, onClickMappingModify, alert, }) => {
|
|
58
61
|
const displayStrings = react_1.default.useMemo(() => ({ ...exports.mappingViewDefaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
|
|
62
|
+
const [selectedMappings, setSelectedMappings] = (0, react_1.useState)([]);
|
|
63
|
+
const groupingMappingApiConfig = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
64
|
+
const { mappingIdJobInfo } = (0, ExtractionStateJobContext_1.useExtractionStateJobContext)();
|
|
65
|
+
const { runExtraction } = (0, useRunExtraction_1.useRunExtraction)(groupingMappingApiConfig);
|
|
66
|
+
const jobStartEvent = (0, react_1.useMemo)(() => new core_bentley_1.BeEvent(), []);
|
|
59
67
|
const refreshAll = (0, react_1.useCallback)(async () => {
|
|
60
68
|
await Promise.all([onRefreshMappings(), onRefreshExtractionStatus()]);
|
|
61
69
|
}, [onRefreshMappings, onRefreshExtractionStatus]);
|
|
70
|
+
const onSelectionChange = (mapping) => {
|
|
71
|
+
setSelectedMappings((mappingIdList) => {
|
|
72
|
+
return mappingIdList.some((eachId) => mapping.id === eachId.id)
|
|
73
|
+
? mappingIdList.filter((eachId) => mapping.id !== eachId.id)
|
|
74
|
+
: [...mappingIdList, mapping];
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
const onRunExtraction = (0, react_1.useCallback)(async () => {
|
|
78
|
+
await runExtraction(selectedMappings);
|
|
79
|
+
selectedMappings.map((mapping) => {
|
|
80
|
+
jobStartEvent.raiseEvent(mapping.id);
|
|
81
|
+
});
|
|
82
|
+
setSelectedMappings([]);
|
|
83
|
+
}, [selectedMappings, jobStartEvent, runExtraction]);
|
|
62
84
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
63
85
|
react_1.default.createElement(BlockingOverlay_1.BlockingOverlay, { isVisible: isTogglingExtraction }),
|
|
64
86
|
react_1.default.createElement("div", { className: "gmw-mappings-view-container" },
|
|
@@ -67,7 +89,9 @@ const MappingsView = ({ mappings, isLoading, extractionStatusData, showExtractio
|
|
|
67
89
|
onClickAddMapping &&
|
|
68
90
|
react_1.default.createElement(itwinui_react_1.Button, { startIcon: react_1.default.createElement(itwinui_icons_react_1.SvgAdd, null), onClick: onClickAddMapping, styleType: "high-visibility", title: "New Mapping" }, "New"),
|
|
69
91
|
showImportModal !== undefined && setShowImportModal && react_1.default.createElement(itwinui_react_1.IconButton, { title: `Import ${displayStrings.mappings}`, onClick: () => setShowImportModal(true) },
|
|
70
|
-
react_1.default.createElement(itwinui_icons_react_1.SvgImport, null))
|
|
92
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgImport, null)),
|
|
93
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { title: "Run extraction", onClick: onRunExtraction, disabled: selectedMappings.length === 0 },
|
|
94
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgPlay, null))),
|
|
71
95
|
react_1.default.createElement("div", { className: "gmw-button-spacing" },
|
|
72
96
|
react_1.default.createElement(ExtractionStatusIcon_1.ExtractionStatusIcon, { iconStatus: extractionStatusData.iconStatus, onClick: () => {
|
|
73
97
|
if (extractionStatusData.iconStatus === "negative") {
|
|
@@ -78,7 +102,7 @@ const MappingsView = ({ mappings, isLoading, extractionStatusData, showExtractio
|
|
|
78
102
|
react_1.default.createElement(itwinui_icons_react_1.SvgRefresh, null)))),
|
|
79
103
|
alert,
|
|
80
104
|
react_1.default.createElement("div", { className: 'gmw-mappings-border' }),
|
|
81
|
-
isLoading ? (react_1.default.createElement(LoadingOverlay_1.LoadingOverlay, null)) : mappings.length === 0 ? (react_1.default.createElement(EmptyMessage_1.EmptyMessage, { message: `No ${displayStrings.mappings} available.` })) : (react_1.default.createElement("div", { className: "gmw-mappings-list" }, mappings.map((mapping) => (react_1.default.createElement(
|
|
105
|
+
isLoading ? (react_1.default.createElement(LoadingOverlay_1.LoadingOverlay, null)) : mappings.length === 0 ? (react_1.default.createElement(EmptyMessage_1.EmptyMessage, { message: `No ${displayStrings.mappings} available.` })) : (react_1.default.createElement("div", { className: "gmw-mappings-list" }, mappings.map((mapping) => (react_1.default.createElement(MappingListItem_1.MappingListItem, { key: mapping.id, mapping: mapping, jobId: mappingIdJobInfo?.get(mapping.id) ?? "", jobStartEvent: jobStartEvent, onClickMappingTitle: onClickMappingTitle, onSelectionChange: onSelectionChange, selected: selectedMappings.some((eachMapping) => mapping.id === eachMapping.id), onToggleExtraction: onToggleExtraction, onRefreshMappings: onRefreshMappings, onClickMappingModify: onClickMappingModify, setShowDeleteModal: setShowDeleteModal })))))),
|
|
82
106
|
showExtractionMessageModal && react_1.default.createElement(ExtractionMessageModal_1.ExtractionMessageModal, { isOpen: showExtractionMessageModal, onClose: () => setShowExtractionMessageModal(false), extractionMessageData: extractionMessageData, timestamp: extractionMessageData.length === 0 ? "" : extractionMessageData[0].date }),
|
|
83
107
|
showDeleteModal &&
|
|
84
108
|
react_1.default.createElement(DeleteModal_1.default, { entityName: showDeleteModal?.mappingName, onClose: () => setShowDeleteModal(undefined), onDelete: async () => {
|