@itwin/grouping-mapping-widget 0.17.4 → 0.18.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/formula/FormulaDataTypeResolver.js +4 -4
- package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/FormulaFunctionProvider.js +4 -4
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaSplitter.js +12 -12
- package/lib/cjs/formula/FormulaSplitter.js.map +1 -1
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +6 -6
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
- package/lib/cjs/formula/InfixToPostfixConverter.js +11 -11
- package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +3 -1
- package/lib/cjs/grouping-mapping-widget.js +7 -3
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupPropertyUtils.test.js +74 -74
- package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +9 -9
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/PropertyFieldsHelpers.js +8 -8
- package/lib/cjs/test/PropertyFieldsHelpers.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +2 -2
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.js +1 -1
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/widget/components/BlockingOverlay.js +1 -1
- package/lib/cjs/widget/components/BlockingOverlay.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -7
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +21 -21
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +4 -4
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +8 -8
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationAction.js +20 -18
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationTable.js +4 -4
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +2 -2
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.js +16 -16
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupColorLegend.js +1 -1
- package/lib/cjs/widget/components/GroupColorLegend.js.map +1 -1
- package/lib/cjs/widget/components/GroupColorToggle.js +9 -9
- package/lib/cjs/widget/components/GroupColorToggle.js.map +1 -1
- package/lib/cjs/widget/components/GroupDetails.js +3 -3
- package/lib/cjs/widget/components/GroupDetails.js.map +1 -1
- package/lib/cjs/widget/components/GroupMenuActions.js +2 -2
- package/lib/cjs/widget/components/GroupMenuActions.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js +35 -35
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyTable.js +4 -4
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyUtils.js +2 -2
- package/lib/cjs/widget/components/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.d.ts +2 -1
- package/lib/cjs/widget/components/Grouping.js +16 -13
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +8 -0
- package/lib/cjs/widget/components/GroupingMapping.js +5 -5
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js +4 -4
- package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContext.js +24 -21
- package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingRouter.js +3 -3
- package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/widget/components/GroupsShowHideButtons.js +3 -3
- package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +1 -1
- package/lib/cjs/widget/components/GroupsVisualization.js +38 -28
- package/lib/cjs/widget/components/GroupsVisualization.js.map +1 -1
- package/lib/cjs/widget/components/GroupsVisualizationActions.js +1 -1
- package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.js +9 -9
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.d.ts +2 -2
- package/lib/cjs/widget/components/MappingImportWizardModal.js +13 -13
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/widget/components/MappingViewActionGroup.d.ts +12 -0
- package/lib/cjs/widget/components/MappingViewActionGroup.js +34 -0
- package/lib/cjs/widget/components/MappingViewActionGroup.js.map +1 -0
- package/lib/cjs/widget/components/Mappings.d.ts +13 -0
- package/lib/cjs/widget/components/Mappings.js +45 -0
- package/lib/cjs/widget/components/Mappings.js.map +1 -0
- package/lib/cjs/widget/components/MappingsView.d.ts +33 -0
- package/lib/cjs/widget/components/MappingsView.js +54 -0
- package/lib/cjs/widget/components/MappingsView.js.map +1 -0
- package/lib/{esm/widget/components/Mapping.scss → cjs/widget/components/MappingsView.scss} +6 -2
- package/lib/cjs/widget/components/PropertyAction.js +7 -7
- package/lib/cjs/widget/components/PropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenu.js +9 -9
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js +1 -1
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/cjs/widget/components/PropertyTable.js +4 -4
- package/lib/cjs/widget/components/PropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +9 -9
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectITwin.js +10 -10
- package/lib/cjs/widget/components/SelectITwin.js.map +1 -1
- package/lib/cjs/widget/components/SelectMappings.d.ts +1 -1
- package/lib/cjs/widget/components/SelectMappings.js +10 -10
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js +1 -1
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +1 -1
- package/lib/cjs/widget/components/SortableHorizontalTile.js +2 -2
- package/lib/cjs/widget/components/SortableHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/StatusIcon.js +1 -1
- package/lib/cjs/widget/components/StatusIcon.js.map +1 -1
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +2 -0
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +2 -0
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js +1 -1
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js +2 -2
- package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/cjs/widget/components/context/IModelsClientContext.js +2 -2
- package/lib/cjs/widget/components/context/IModelsClientContext.js.map +1 -1
- package/lib/cjs/widget/components/context/ITwinsClientContext.js +2 -2
- package/lib/cjs/widget/components/context/ITwinsClientContext.js.map +1 -1
- package/lib/cjs/widget/components/context/MappingClientContext.js +3 -3
- package/lib/cjs/widget/components/context/MappingClientContext.js.map +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +10 -10
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/groupsHelpers.d.ts +1 -1
- package/lib/cjs/widget/components/groupsHelpers.js +14 -13
- package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
- package/lib/cjs/widget/components/hooks/useMappingsOperations.d.ts +19 -0
- package/lib/cjs/widget/components/hooks/useMappingsOperations.js +61 -0
- package/lib/cjs/widget/components/hooks/useMappingsOperations.js.map +1 -0
- package/lib/cjs/widget/components/utils.d.ts +1 -0
- package/lib/cjs/widget/components/utils.js +19 -23
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/viewerUtils.js +12 -12
- package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
- package/lib/cjs/widget/hooks/useFetchData.js +6 -6
- package/lib/cjs/widget/hooks/useFetchData.js.map +1 -1
- package/lib/cjs/widget/hooks/useFormulaValidation.js +4 -4
- package/lib/cjs/widget/hooks/useFormulaValidation.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +1 -1
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/cjs/widget/hooks/useVisualization.js +15 -15
- package/lib/cjs/widget/hooks/useVisualization.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +3 -1
- package/lib/esm/grouping-mapping-widget.js +3 -1
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationAction.js +3 -1
- package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/esm/widget/components/Grouping.d.ts +2 -1
- package/lib/esm/widget/components/Grouping.js +7 -4
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +8 -0
- package/lib/esm/widget/components/GroupingMappingContext.js +4 -1
- package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingRouter.js +1 -1
- package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/widget/components/GroupsVisualization.js +14 -4
- package/lib/esm/widget/components/GroupsVisualization.js.map +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.d.ts +2 -2
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/widget/components/MappingViewActionGroup.d.ts +12 -0
- package/lib/esm/widget/components/MappingViewActionGroup.js +27 -0
- package/lib/esm/widget/components/MappingViewActionGroup.js.map +1 -0
- package/lib/esm/widget/components/Mappings.d.ts +13 -0
- package/lib/esm/widget/components/Mappings.js +22 -0
- package/lib/esm/widget/components/Mappings.js.map +1 -0
- package/lib/esm/widget/components/MappingsView.d.ts +33 -0
- package/lib/esm/widget/components/MappingsView.js +47 -0
- package/lib/esm/widget/components/MappingsView.js.map +1 -0
- package/lib/{cjs/widget/components/Mapping.scss → esm/widget/components/MappingsView.scss} +6 -2
- package/lib/esm/widget/components/SelectMappings.d.ts +1 -1
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +2 -0
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +2 -0
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/esm/widget/components/groupsHelpers.d.ts +1 -1
- package/lib/esm/widget/components/groupsHelpers.js +4 -3
- package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
- package/lib/esm/widget/components/hooks/useMappingsOperations.d.ts +19 -0
- package/lib/esm/widget/components/hooks/useMappingsOperations.js +57 -0
- package/lib/esm/widget/components/hooks/useMappingsOperations.js.map +1 -0
- package/lib/esm/widget/components/utils.d.ts +1 -0
- package/lib/esm/widget/components/utils.js +17 -22
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/hooks/useFormulaValidation.js +1 -1
- package/lib/esm/widget/hooks/useFormulaValidation.js.map +1 -1
- package/lib/esm/widget/hooks/useVisualization.js +3 -3
- package/lib/esm/widget/hooks/useVisualization.js.map +1 -1
- package/package.json +2 -2
- package/lib/cjs/widget/components/Mapping.d.ts +0 -24
- package/lib/cjs/widget/components/Mapping.js +0 -136
- package/lib/cjs/widget/components/Mapping.js.map +0 -1
- package/lib/esm/widget/components/Mapping.d.ts +0 -24
- package/lib/esm/widget/components/Mapping.js +0 -110
- package/lib/esm/widget/components/Mapping.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MappingAction.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAAkF;AAClF,+CAAwC;AACxC,gEAAwC;AACxC,sEAAwE;AACxE,mCAAyD;AACzD,gCAA8B;AAC9B,yEAAkE;AAElE,iFAAiF;AAEjF,MAAM,qBAAqB,GAAG;IAC5B,cAAc,EAAE,iBAAiB;CAClC,CAAC;AASK,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAsB,EAAE,EAAE;IACjI,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,sDAA2B,
|
|
1
|
+
{"version":3,"file":"MappingAction.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAAkF;AAClF,+CAAwC;AACxC,gEAAwC;AACxC,sEAAwE;AACxE,mCAAyD;AACzD,gCAA8B;AAC9B,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EAAE,CAAC,MAAM,CAAC,IAAI,EAC9B,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AA5GW,QAAA,aAAa,iBA4GxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Fieldset, LabeledInput, Text, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, handleInputChange } from \"./utils\";\nimport \"./MappingAction.scss\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappingDetails: \"Mapping Details\",\n};\n\nexport interface MappingActionProps {\n mapping?: Mapping;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displayStrings: userDisplayStrings }: MappingActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [values, setValues] = useState({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const onSave = async () => {\n try {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n setIsLoading(true);\n const accessToken = await getAccessToken();\n mapping\n ? await mappingClient.updateMapping(accessToken, iModelId, mapping.id, {\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n })\n : await mappingClient.createMapping(accessToken, iModelId, {\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n });\n setValues({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n onSaveSuccess();\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <div className='gmw-details-form-container'>\n <Fieldset legend={displayStrings.mappingDetails} className='gmw-details-form'>\n <Text variant='small' as='small' className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n id='name'\n name='name'\n label='Name'\n value={values.name}\n required\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", values.name, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", values.name, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={values.description}\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n }}\n />\n <ToggleSwitch\n id='extractionEnabled'\n name='extractionEnabled'\n label='Extract data from iModel'\n labelPosition=\"right\"\n checked={values.extractionEnabled}\n onChange={(event) => {\n setValues({ ...values, extractionEnabled: event.currentTarget.checked });\n }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={onClickCancel}\n isSavingDisabled={!values.name}\n isLoading={isLoading}\n />\n </>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import "./MappingImportWizardModal.scss";
|
|
3
3
|
declare const defaultDisplayStrings: {
|
|
4
4
|
mappings: string;
|
|
@@ -12,7 +12,7 @@ declare const defaultDisplayStrings: {
|
|
|
12
12
|
};
|
|
13
13
|
interface MappingImportWizardModalProps {
|
|
14
14
|
show: boolean;
|
|
15
|
-
setShow:
|
|
15
|
+
setShow: (show: boolean) => void;
|
|
16
16
|
onFinish: () => Promise<void>;
|
|
17
17
|
displayStrings?: Partial<typeof defaultDisplayStrings>;
|
|
18
18
|
}
|
|
@@ -45,21 +45,21 @@ const defaultDisplayStrings = {
|
|
|
45
45
|
iModelDescription: "Description",
|
|
46
46
|
};
|
|
47
47
|
const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrings: userDisplayStrings, }) => {
|
|
48
|
-
const { prefix } = GroupingApiConfigContext_1.useGroupingMappingApiConfig();
|
|
49
|
-
const [currentStep, setCurrentStep] = react_1.useState(0);
|
|
50
|
-
const [iTwinType, setITwinType] = react_1.useState(0);
|
|
51
|
-
const [selectedITwinId, setSelectedITwinId] = react_1.useState("");
|
|
52
|
-
const [selectedIModelId, setSelectedIModelId] = react_1.useState("");
|
|
53
|
-
const [selectedMappings, setSelectedMappings] = react_1.useState([]);
|
|
54
|
-
const [importing, setImporting] = react_1.useState(false);
|
|
55
|
-
const [iTwinsClient, setITwinsClient] = react_1.useState(ITwinsClientContext_1.createITwinsClient(prefix));
|
|
56
|
-
const [iModelsClient, setIModelsClient] = react_1.useState(IModelsClientContext_1.createIModelsClient(prefix));
|
|
57
|
-
react_1.useEffect(() => {
|
|
58
|
-
setITwinsClient(ITwinsClientContext_1.createITwinsClient(prefix));
|
|
59
|
-
setIModelsClient(IModelsClientContext_1.createIModelsClient(prefix));
|
|
48
|
+
const { prefix } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
49
|
+
const [currentStep, setCurrentStep] = (0, react_1.useState)(0);
|
|
50
|
+
const [iTwinType, setITwinType] = (0, react_1.useState)(0);
|
|
51
|
+
const [selectedITwinId, setSelectedITwinId] = (0, react_1.useState)("");
|
|
52
|
+
const [selectedIModelId, setSelectedIModelId] = (0, react_1.useState)("");
|
|
53
|
+
const [selectedMappings, setSelectedMappings] = (0, react_1.useState)([]);
|
|
54
|
+
const [importing, setImporting] = (0, react_1.useState)(false);
|
|
55
|
+
const [iTwinsClient, setITwinsClient] = (0, react_1.useState)((0, ITwinsClientContext_1.createITwinsClient)(prefix));
|
|
56
|
+
const [iModelsClient, setIModelsClient] = (0, react_1.useState)((0, IModelsClientContext_1.createIModelsClient)(prefix));
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
setITwinsClient((0, ITwinsClientContext_1.createITwinsClient)(prefix));
|
|
59
|
+
setIModelsClient((0, IModelsClientContext_1.createIModelsClient)(prefix));
|
|
60
60
|
}, [prefix]);
|
|
61
61
|
const displayStrings = react_1.default.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
|
|
62
|
-
const steps = react_1.useRef([
|
|
62
|
+
const steps = (0, react_1.useRef)([
|
|
63
63
|
{
|
|
64
64
|
name: "Select iTwin",
|
|
65
65
|
description: `Select the source iTwin to bring your ${displayStrings.mappings} from.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingImportWizardModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wDAA+C;AAC/C,wDAA6C;AAC7C,+CAA2D;AAC3D,oFAA2D;AAE3D,2CAAyC;AACzC,kEAA0C;AAC1C,gEAAwC;AACxC,sEAA8C;AAC9C,iFAAiF;AACjF,yEAA2F;AAC3F,uEAAwF;AAExF,MAAM,qBAAqB,GAAG;IAC5B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,MAAM;IAClB,iBAAiB,EAAE,aAAa;CACjC,CAAC;AAQK,MAAM,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AW,GAAG,CAAC,CAAC,EAC7C,cAAc,EAAE,cAAc,GAC9B,CACE;4BACL,WAAW,KAAK,CAAC,IAAI,CACpB,8BAAC,+BAAoB,IACnB,cAAc,EAAE,gBAAgB,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,KAAK,IAAI,EAAE;oCACnB,MAAM,OAAO,EAAE,CAAC;oCAChB,YAAY,CAAC,KAAK,CAAC,CAAC;gCACtB,CAAC,EACD,cAAc,EAAE,cAAc,GAC9B,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;iBACf;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,CAAC;AACJ,CAAC,CAAC;AA1JW,QAAA,wBAAwB,4BA0JnC","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 { IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { ITwinsAccessClient } from \"@itwin/itwins-client\";\nimport type { StepProperties } from \"@itwin/itwinui-react\";\nimport { Stepper } from \"@itwin/itwinui-react\";\nimport { Modal } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\nimport type { IMappingTyped } from \"./Mapping\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectITwin from \"./SelectITwin\";\nimport SelectMappings from \"./SelectMappings\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { createIModelsClient, IModelsClientContext } from \"./context/IModelsClientContext\";\nimport { createITwinsClient, ITwinsClientContext } from \"./context/ITwinsClientContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n iTwins: \"iTwins\",\n iTwinNumber: \"Number\",\n iTwinName: \"Name\",\n iTwinStatus: \"Status\",\n iModels: \"iModels\",\n iModelName: \"Name\",\n iModelDescription: \"Description\",\n};\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: React.Dispatch<React.SetStateAction<boolean>>;\n onFinish: () => Promise<void>;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingImportWizardModal = ({\n show,\n setShow,\n onFinish,\n displayStrings: userDisplayStrings,\n}: MappingImportWizardModalProps) => {\n const { prefix } = useGroupingMappingApiConfig();\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [iTwinType, setITwinType] = useState<number>(0);\n const [selectedITwinId, setSelectedITwinId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n const [iTwinsClient, setITwinsClient] = useState<ITwinsAccessClient>(createITwinsClient(prefix));\n const [iModelsClient, setIModelsClient] = useState<IModelsClient>(createIModelsClient(prefix));\n\n useEffect(() => {\n setITwinsClient(createITwinsClient(prefix));\n setIModelsClient(createIModelsClient(prefix));\n }, [prefix]);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const steps = useRef<StepProperties[]>([\n {\n name: \"Select iTwin\",\n description: `Select the source iTwin to bring your ${displayStrings.mappings} from.`,\n },\n {\n name: \"Select iModel\",\n description: \"Select an iModel within the iTwin you have selected.\",\n },\n {\n name: `Select ${displayStrings.mappings}`,\n description: `Select one or more ${displayStrings.mappings} to import.`,\n },\n {\n name: \"Rename & Confirm\",\n description:\n \"Rename and confirm your selections. Click import when finished.\",\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n setCurrentStep(0);\n await onFinish();\n };\n\n return (\n <Modal\n title={`Import ${displayStrings.mappings}`}\n modalRootId='grouping-mapping-widget'\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n styleType='fullPage'\n onClose={async () => {\n await onClose();\n }}\n >\n <div className='gmw-import-wizard-body-container'>\n <Stepper\n currentStep={currentStep}\n steps={steps.current}\n onStepClick={\n importing ? undefined : (index: number) => setCurrentStep(index)\n }\n />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <ITwinsClientContext.Provider value={iTwinsClient}>\n <div className=\"gmw-table-container\">\n <SelectITwin\n onSelect={(iTwinId) => {\n setSelectedITwinId(iTwinId);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n onChangeITwinType={setITwinType}\n displayStrings={displayStrings}\n defaultITwinType={iTwinType}\n />\n </div>\n </ITwinsClientContext.Provider>\n );\n case 1:\n return (\n <IModelsClientContext.Provider value={iModelsClient}>\n <div className=\"gmw-table-container\">\n <SelectIModel\n iTwinId={selectedITwinId}\n onSelect={(iModelId) => {\n setSelectedIModelId(iModelId);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n </div>\n </IModelsClientContext.Provider>\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div\n style={{ display: currentStep === 2 ? \"flex\" : \"none\" }}\n className=\"gmw-mapping-container\"\n >\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n displayStrings={displayStrings}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n sourceiModelId={selectedIModelId}\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={async () => {\n await onClose();\n setImporting(false);\n }}\n displayStrings={displayStrings}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingImportWizardModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wDAA+C;AAC/C,wDAA6C;AAC7C,+CAA2D;AAC3D,oFAA2D;AAE3D,2CAAyC;AACzC,kEAA0C;AAC1C,gEAAwC;AACxC,sEAA8C;AAC9C,iFAAiF;AACjF,yEAA2F;AAC3F,uEAAwF;AAExF,MAAM,qBAAqB,GAAG;IAC5B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,MAAM;IAClB,iBAAiB,EAAE,aAAa;CACjC,CAAC;AAQK,MAAM,wBAAwB,GAAG,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,cAAc,EAAE,kBAAkB,GACJ,EAAE,EAAE;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACnE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA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GAC9B,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;iBACf;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,CAAC;AACJ,CAAC,CAAC;AA1JW,QAAA,wBAAwB,4BA0JnC","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 { IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { ITwinsAccessClient } from \"@itwin/itwins-client\";\nimport type { StepProperties } from \"@itwin/itwinui-react\";\nimport { Stepper } from \"@itwin/itwinui-react\";\nimport { Modal } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\nimport type { IMappingTyped } from \"./Mappings\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectITwin from \"./SelectITwin\";\nimport SelectMappings from \"./SelectMappings\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { createIModelsClient, IModelsClientContext } from \"./context/IModelsClientContext\";\nimport { createITwinsClient, ITwinsClientContext } from \"./context/ITwinsClientContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n iTwins: \"iTwins\",\n iTwinNumber: \"Number\",\n iTwinName: \"Name\",\n iTwinStatus: \"Status\",\n iModels: \"iModels\",\n iModelName: \"Name\",\n iModelDescription: \"Description\",\n};\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: (show: boolean) => void;\n onFinish: () => Promise<void>;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingImportWizardModal = ({\n show,\n setShow,\n onFinish,\n displayStrings: userDisplayStrings,\n}: MappingImportWizardModalProps) => {\n const { prefix } = useGroupingMappingApiConfig();\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [iTwinType, setITwinType] = useState<number>(0);\n const [selectedITwinId, setSelectedITwinId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n const [iTwinsClient, setITwinsClient] = useState<ITwinsAccessClient>(createITwinsClient(prefix));\n const [iModelsClient, setIModelsClient] = useState<IModelsClient>(createIModelsClient(prefix));\n\n useEffect(() => {\n setITwinsClient(createITwinsClient(prefix));\n setIModelsClient(createIModelsClient(prefix));\n }, [prefix]);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const steps = useRef<StepProperties[]>([\n {\n name: \"Select iTwin\",\n description: `Select the source iTwin to bring your ${displayStrings.mappings} from.`,\n },\n {\n name: \"Select iModel\",\n description: \"Select an iModel within the iTwin you have selected.\",\n },\n {\n name: `Select ${displayStrings.mappings}`,\n description: `Select one or more ${displayStrings.mappings} to import.`,\n },\n {\n name: \"Rename & Confirm\",\n description:\n \"Rename and confirm your selections. Click import when finished.\",\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n setCurrentStep(0);\n await onFinish();\n };\n\n return (\n <Modal\n title={`Import ${displayStrings.mappings}`}\n modalRootId='grouping-mapping-widget'\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n styleType='fullPage'\n onClose={async () => {\n await onClose();\n }}\n >\n <div className='gmw-import-wizard-body-container'>\n <Stepper\n currentStep={currentStep}\n steps={steps.current}\n onStepClick={\n importing ? undefined : (index: number) => setCurrentStep(index)\n }\n />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <ITwinsClientContext.Provider value={iTwinsClient}>\n <div className=\"gmw-table-container\">\n <SelectITwin\n onSelect={(iTwinId) => {\n setSelectedITwinId(iTwinId);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n onChangeITwinType={setITwinType}\n displayStrings={displayStrings}\n defaultITwinType={iTwinType}\n />\n </div>\n </ITwinsClientContext.Provider>\n );\n case 1:\n return (\n <IModelsClientContext.Provider value={iModelsClient}>\n <div className=\"gmw-table-container\">\n <SelectIModel\n iTwinId={selectedITwinId}\n onSelect={(iModelId) => {\n setSelectedIModelId(iModelId);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n </div>\n </IModelsClientContext.Provider>\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div\n style={{ display: currentStep === 2 ? \"flex\" : \"none\" }}\n className=\"gmw-mapping-container\"\n >\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n displayStrings={displayStrings}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n sourceiModelId={selectedIModelId}\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={async () => {\n await onClose();\n setImporting(false);\n }}\n displayStrings={displayStrings}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Mapping } from "@itwin/insights-client";
|
|
3
|
+
interface MappingUIActionGroupProps {
|
|
4
|
+
mapping: Mapping;
|
|
5
|
+
onToggleExtraction: (mapping: Mapping) => Promise<void>;
|
|
6
|
+
onRefresh: () => Promise<void>;
|
|
7
|
+
onClickMappingModify?: (mapping: Mapping) => void;
|
|
8
|
+
setShowDeleteModal: (mapping?: Mapping) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const MappingUIActionGroup: ({ mapping, onToggleExtraction, onRefresh, onClickMappingModify, setShowDeleteModal, }: MappingUIActionGroupProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=MappingViewActionGroup.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
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.MappingUIActionGroup = 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 itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
14
|
+
const MappingUIActionGroup = ({ mapping, onToggleExtraction, onRefresh, onClickMappingModify, setShowDeleteModal, }) => {
|
|
15
|
+
return (react_1.default.createElement(itwinui_react_1.DropdownMenu, { menuItems: (close) => [
|
|
16
|
+
onClickMappingModify ? (react_1.default.createElement(itwinui_react_1.MenuItem, { key: 0, onClick: () => {
|
|
17
|
+
onClickMappingModify(mapping);
|
|
18
|
+
close();
|
|
19
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgEdit, null) }, "Modify")) : [],
|
|
20
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 1, onClick: async () => {
|
|
21
|
+
close();
|
|
22
|
+
await onToggleExtraction(mapping);
|
|
23
|
+
await onRefresh();
|
|
24
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgProcess, null) }, mapping.extractionEnabled ? "Disable extraction" : "Enable extraction"),
|
|
25
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 2, onClick: () => {
|
|
26
|
+
setShowDeleteModal(mapping);
|
|
27
|
+
close();
|
|
28
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgDelete, null) }, "Remove"),
|
|
29
|
+
].flat() },
|
|
30
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless", title: 'Mapping Options' },
|
|
31
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgMore, null))));
|
|
32
|
+
};
|
|
33
|
+
exports.MappingUIActionGroup = MappingUIActionGroup;
|
|
34
|
+
//# sourceMappingURL=MappingViewActionGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MappingViewActionGroup.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingViewActionGroup.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,wDAI8B;AAC9B,oEAKoC;AAW7B,MAAM,oBAAoB,GAAG,CAAC,EACnC,OAAO,EACP,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,GACQ,EAAE,EAAE;IAC9B,OAAO,CACL,8BAAC,4BAAY,IACX,SAAS,EAAE,CAAC,KAAiB,EAAE,EAAE,CAAC;YAChC,oBAAoB,CAAC,CAAC,CAAC,CACrB,8BAAC,wBAAQ,IACP,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,GAAG,EAAE;oBACZ,oBAAoB,CAAC,OAAO,CAAC,CAAC;oBAC9B,KAAK,EAAE,CAAC;gBACV,CAAC,EACD,IAAI,EAAE,8BAAC,6BAAO,OAAG,aAGR,CACZ,CAAC,CAAC,CAAC,EAAE;YACN,8BAAC,wBAAQ,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,8BAAC,gCAAU,OAAG,IAEnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,CAC9D;YACX,8BAAC,wBAAQ,IACP,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,GAAG,EAAE;oBACZ,kBAAkB,CAAC,OAAO,CAAC,CAAC;oBAC5B,KAAK,EAAE,CAAC;gBACV,CAAC,EACD,IAAI,EAAE,8BAAC,+BAAS,OAAG,aAGV;SACZ,CAAC,IAAI,EAAE;QAER,8BAAC,0BAAU,IAAC,SAAS,EAAC,YAAY,EAAC,KAAK,EAAC,iBAAiB;YACxD,8BAAC,6BAAO,OACN,CACS,CACA,CAChB,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,oBAAoB,wBAmD/B","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 MappingUIActionGroup = ({\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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Mapping } from "@itwin/insights-client";
|
|
3
|
+
import type { CreateTypeFromInterface } from "../utils";
|
|
4
|
+
import type { mappingViewDefaultDisplayStrings } from "./MappingsView";
|
|
5
|
+
export declare type IMappingTyped = CreateTypeFromInterface<Mapping>;
|
|
6
|
+
export interface MappingsProps {
|
|
7
|
+
onClickAddMapping?: () => void;
|
|
8
|
+
onClickMappingTitle?: (mapping: Mapping) => void;
|
|
9
|
+
onClickMappingModify?: (mapping: Mapping) => void;
|
|
10
|
+
displayStrings?: Partial<typeof mappingViewDefaultDisplayStrings>;
|
|
11
|
+
}
|
|
12
|
+
export declare const Mappings: (props: MappingsProps) => JSX.Element;
|
|
13
|
+
//# sourceMappingURL=Mappings.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.Mappings = void 0;
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const MappingClientContext_1 = require("./context/MappingClientContext");
|
|
29
|
+
const GroupingApiConfigContext_1 = require("./context/GroupingApiConfigContext");
|
|
30
|
+
const MappingsView_1 = require("./MappingsView");
|
|
31
|
+
const useMappingsOperations_1 = require("./hooks/useMappingsOperations");
|
|
32
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
33
|
+
const Mappings = (props) => {
|
|
34
|
+
const groupingMappingApiConfig = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
35
|
+
const mappingClient = (0, MappingClientContext_1.useMappingClient)();
|
|
36
|
+
const { mappings, isLoading, refresh, toggleExtraction, onDelete, setShowDeleteModal, showDeleteModal, isTogglingExtraction, errorMessage, setErrorMessage, } = (0, useMappingsOperations_1.useMappingsOperations)({ ...groupingMappingApiConfig, mappingClient });
|
|
37
|
+
const renderAlert = (0, react_1.useCallback)(() => {
|
|
38
|
+
if (!errorMessage)
|
|
39
|
+
return;
|
|
40
|
+
return (react_1.default.createElement(itwinui_react_1.Alert, { type: "negative", onClose: () => setErrorMessage(undefined) }, errorMessage));
|
|
41
|
+
}, [errorMessage, setErrorMessage]);
|
|
42
|
+
return (react_1.default.createElement(MappingsView_1.MappingsView, { mappings: mappings, isLoading: isLoading, onRefresh: refresh, onToggleExtraction: toggleExtraction, onDelete: onDelete, showDeleteModal: showDeleteModal, setShowDeleteModal: setShowDeleteModal, isTogglingExtraction: isTogglingExtraction, alert: renderAlert(), ...props }));
|
|
43
|
+
};
|
|
44
|
+
exports.Mappings = Mappings;
|
|
45
|
+
//# sourceMappingURL=Mappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mappings.js","sourceRoot":"","sources":["../../../../src/widget/components/Mappings.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAA2C;AAC3C,yEAAkE;AAElE,iFAAiF;AAGjF,iDAA8C;AAC9C,yEAAsE;AACtE,wDAA6C;AAWtC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC/C,MAAM,wBAAwB,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC/D,MAAM,aAAa,GAAG,IAAA,uCAAgB,GAAE,CAAC;IACzC,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,eAAe,GAChB,GAAG,IAAA,6CAAqB,EAAC,EAAE,GAAG,wBAAwB,EAAE,aAAa,EAAE,CAAC,CAAC;IAE1E,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACnC,IAAI,CAAC,YAAY;YAAE,OAAO;QAC1B,OAAO,CACL,8BAAC,qBAAK,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,IAC7D,YAAY,CACP,CACT,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAEpC,OAAO,CACL,8BAAC,2BAAY,IACX,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,OAAO,EAClB,kBAAkB,EAAE,gBAAgB,EACpC,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,KAAK,EAAE,WAAW,EAAE,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,QAAQ,YAuCnB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback } from \"react\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport type { mappingViewDefaultDisplayStrings } from \"./MappingsView\";\nimport { MappingsView } from \"./MappingsView\";\nimport { useMappingsOperations } from \"./hooks/useMappingsOperations\";\nimport { Alert } from \"@itwin/itwinui-react\";\n\nexport type IMappingTyped = CreateTypeFromInterface<Mapping>;\n\nexport interface MappingsProps {\n onClickAddMapping?: () => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n displayStrings?: Partial<typeof mappingViewDefaultDisplayStrings>;\n}\n\nexport const Mappings = (props: MappingsProps) => {\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const {\n mappings,\n isLoading,\n refresh,\n toggleExtraction,\n onDelete,\n setShowDeleteModal,\n showDeleteModal,\n isTogglingExtraction,\n errorMessage,\n setErrorMessage,\n } = useMappingsOperations({ ...groupingMappingApiConfig, mappingClient });\n\n const renderAlert = useCallback(() => {\n if (!errorMessage) return;\n return (\n <Alert type=\"negative\" onClose={() => setErrorMessage(undefined)}>\n {errorMessage}\n </Alert>\n );\n }, [errorMessage, setErrorMessage]);\n\n return (\n <MappingsView\n mappings={mappings}\n isLoading={isLoading}\n onRefresh={refresh}\n onToggleExtraction={toggleExtraction}\n onDelete={onDelete}\n showDeleteModal={showDeleteModal}\n setShowDeleteModal={setShowDeleteModal}\n isTogglingExtraction={isTogglingExtraction}\n alert={renderAlert()}\n {...props}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Alert } from "@itwin/itwinui-react";
|
|
3
|
+
import "./MappingsView.scss";
|
|
4
|
+
import type { Mapping } from "@itwin/insights-client";
|
|
5
|
+
export declare const mappingViewDefaultDisplayStrings: {
|
|
6
|
+
mappings: string;
|
|
7
|
+
iTwins: string;
|
|
8
|
+
iTwinNumber: string;
|
|
9
|
+
iTwinName: string;
|
|
10
|
+
iTwinStatus: string;
|
|
11
|
+
iModels: string;
|
|
12
|
+
iModelName: string;
|
|
13
|
+
iModelDescription: string;
|
|
14
|
+
};
|
|
15
|
+
export interface MappingsViewProps {
|
|
16
|
+
mappings: Mapping[];
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
isTogglingExtraction: boolean;
|
|
19
|
+
onRefresh: () => Promise<void>;
|
|
20
|
+
onToggleExtraction: (mapping: Mapping) => Promise<void>;
|
|
21
|
+
onDelete: (mapping: Mapping) => Promise<void>;
|
|
22
|
+
showDeleteModal: Mapping | undefined;
|
|
23
|
+
setShowDeleteModal: (mapping?: Mapping) => void;
|
|
24
|
+
displayStrings?: Partial<typeof mappingViewDefaultDisplayStrings>;
|
|
25
|
+
showImportModal?: boolean;
|
|
26
|
+
setShowImportModal?: (show: boolean) => void;
|
|
27
|
+
onClickAddMapping?: () => void;
|
|
28
|
+
onClickMappingTitle?: (mapping: Mapping) => void;
|
|
29
|
+
onClickMappingModify?: (mapping: Mapping) => void;
|
|
30
|
+
alert?: React.ReactElement<typeof Alert>;
|
|
31
|
+
}
|
|
32
|
+
export declare const MappingsView: ({ mappings, isLoading, isTogglingExtraction, onRefresh, onToggleExtraction, onDelete, showDeleteModal, setShowDeleteModal, displayStrings: userDisplayStrings, showImportModal, setShowImportModal, onClickAddMapping, onClickMappingTitle, onClickMappingModify, alert, }: MappingsViewProps) => JSX.Element;
|
|
33
|
+
//# sourceMappingURL=MappingsView.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
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.MappingsView = exports.mappingViewDefaultDisplayStrings = 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 itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
14
|
+
const utils_1 = require("./utils");
|
|
15
|
+
require("./MappingsView.scss");
|
|
16
|
+
const DeleteModal_1 = __importDefault(require("./DeleteModal"));
|
|
17
|
+
const MappingImportWizardModal_1 = require("./MappingImportWizardModal");
|
|
18
|
+
const HorizontalTile_1 = require("./HorizontalTile");
|
|
19
|
+
const BlockingOverlay_1 = require("./BlockingOverlay");
|
|
20
|
+
const MappingViewActionGroup_1 = require("./MappingViewActionGroup");
|
|
21
|
+
exports.mappingViewDefaultDisplayStrings = {
|
|
22
|
+
mappings: "Mappings",
|
|
23
|
+
iTwins: "iTwins",
|
|
24
|
+
iTwinNumber: "Number",
|
|
25
|
+
iTwinName: "Name",
|
|
26
|
+
iTwinStatus: "Status",
|
|
27
|
+
iModels: "iModels",
|
|
28
|
+
iModelName: "Name",
|
|
29
|
+
iModelDescription: "Description",
|
|
30
|
+
};
|
|
31
|
+
const MappingsView = ({ mappings, isLoading, isTogglingExtraction, onRefresh, onToggleExtraction, onDelete, showDeleteModal, setShowDeleteModal, displayStrings: userDisplayStrings, showImportModal, setShowImportModal, onClickAddMapping, onClickMappingTitle, onClickMappingModify, alert, }) => {
|
|
32
|
+
const displayStrings = react_1.default.useMemo(() => ({ ...exports.mappingViewDefaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
|
|
33
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
34
|
+
react_1.default.createElement(BlockingOverlay_1.BlockingOverlay, { isVisible: isTogglingExtraction }),
|
|
35
|
+
react_1.default.createElement("div", { className: "gmw-mappings-view-container" },
|
|
36
|
+
react_1.default.createElement("div", { className: "gmw-table-toolbar" },
|
|
37
|
+
react_1.default.createElement("div", { className: "gmw-button-spacing" },
|
|
38
|
+
onClickAddMapping &&
|
|
39
|
+
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"),
|
|
40
|
+
showImportModal && setShowImportModal && react_1.default.createElement(itwinui_react_1.IconButton, { title: `Import ${displayStrings.mappings}`, onClick: () => setShowImportModal(true) },
|
|
41
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgImport, null))),
|
|
42
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { title: "Refresh", onClick: onRefresh, disabled: isLoading, styleType: 'borderless' },
|
|
43
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgRefresh, null))),
|
|
44
|
+
alert,
|
|
45
|
+
react_1.default.createElement("div", { className: 'gmw-mappings-border' }),
|
|
46
|
+
isLoading ? (react_1.default.createElement(utils_1.LoadingOverlay, null)) : mappings.length === 0 ? (react_1.default.createElement(utils_1.EmptyMessage, { message: `No ${displayStrings.mappings} available.` })) : (react_1.default.createElement("div", { className: "gmw-mappings-list" }, mappings.map((mapping) => (react_1.default.createElement(HorizontalTile_1.HorizontalTile, { key: mapping.id, title: mapping.mappingName ? mapping.mappingName : "Untitled", subText: mapping.description ?? "", subtextToolTip: mapping.description ?? "", titleTooltip: mapping.mappingName, onClickTitle: onClickMappingTitle ? () => onClickMappingTitle(mapping) : undefined, actionGroup: react_1.default.createElement(MappingViewActionGroup_1.MappingUIActionGroup, { mapping: mapping, onToggleExtraction: onToggleExtraction, onRefresh: onRefresh, onClickMappingModify: onClickMappingModify, setShowDeleteModal: setShowDeleteModal }) })))))),
|
|
47
|
+
showDeleteModal &&
|
|
48
|
+
react_1.default.createElement(DeleteModal_1.default, { entityName: showDeleteModal?.mappingName, onClose: () => setShowDeleteModal(undefined), onDelete: async () => {
|
|
49
|
+
await onDelete(showDeleteModal);
|
|
50
|
+
}, refresh: onRefresh }),
|
|
51
|
+
showImportModal && setShowImportModal && react_1.default.createElement(MappingImportWizardModal_1.MappingImportWizardModal, { show: showImportModal, setShow: setShowImportModal, onFinish: onRefresh, displayStrings: displayStrings })));
|
|
52
|
+
};
|
|
53
|
+
exports.MappingsView = MappingsView;
|
|
54
|
+
//# sourceMappingURL=MappingsView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MappingsView.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingsView.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAI1B,wDAG8B;AAC9B,oEAIoC;AACpC,mCAGiB;AACjB,+BAA6B;AAC7B,gEAAwC;AACxC,yEAAsE;AACtE,qDAAkD;AAElD,uDAAoD;AACpD,qEAAgE;AAEnD,QAAA,gCAAgC,GAAG;IAC9C,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,QAAQ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C,mDAAwB,IACjE,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,SAAS,EACnB,cAAc,EAAE,cAAc,GAC9B,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvGW,QAAA,YAAY,gBAuGvB","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 type {\n Alert,\n} from \"@itwin/itwinui-react\";\nimport {\n Button,\n IconButton,\n} from \"@itwin/itwinui-react\";\nimport {\n SvgAdd,\n SvgImport,\n SvgRefresh,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n EmptyMessage,\n LoadingOverlay,\n} from \"./utils\";\nimport \"./MappingsView.scss\";\nimport DeleteModal from \"./DeleteModal\";\nimport { MappingImportWizardModal } from \"./MappingImportWizardModal\";\nimport { HorizontalTile } from \"./HorizontalTile\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { BlockingOverlay } from \"./BlockingOverlay\";\nimport { MappingUIActionGroup } from \"./MappingViewActionGroup\";\n\nexport const mappingViewDefaultDisplayStrings = {\n mappings: \"Mappings\",\n iTwins: \"iTwins\",\n iTwinNumber: \"Number\",\n iTwinName: \"Name\",\n iTwinStatus: \"Status\",\n iModels: \"iModels\",\n iModelName: \"Name\",\n iModelDescription: \"Description\",\n};\n\nexport interface MappingsViewProps {\n mappings: Mapping[];\n isLoading: boolean;\n isTogglingExtraction: boolean;\n onRefresh: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n onDelete: (mapping: Mapping) => Promise<void>;\n showDeleteModal: Mapping | undefined;\n setShowDeleteModal: (mapping?: Mapping) => void;\n displayStrings?: Partial<typeof mappingViewDefaultDisplayStrings>;\n showImportModal?: boolean;\n setShowImportModal?: (show: boolean) => void;\n onClickAddMapping?: () => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n alert?: React.ReactElement<typeof Alert>;\n}\n\nexport const MappingsView = ({\n mappings,\n isLoading,\n isTogglingExtraction,\n onRefresh,\n onToggleExtraction,\n onDelete,\n showDeleteModal,\n setShowDeleteModal,\n displayStrings: userDisplayStrings,\n showImportModal,\n setShowImportModal,\n onClickAddMapping,\n onClickMappingTitle,\n onClickMappingModify,\n alert,\n}: MappingsViewProps) => {\n const displayStrings = React.useMemo(\n () => ({ ...mappingViewDefaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n return (\n <>\n <BlockingOverlay isVisible={isTogglingExtraction} />\n <div className=\"gmw-mappings-view-container\">\n <div className=\"gmw-table-toolbar\">\n <div className=\"gmw-button-spacing\">\n {onClickAddMapping &&\n <Button\n startIcon={<SvgAdd />}\n onClick={onClickAddMapping}\n styleType=\"high-visibility\"\n title=\"New Mapping\"\n >\n New\n </Button>\n }\n {showImportModal && setShowImportModal && <IconButton\n title={`Import ${displayStrings.mappings}`}\n onClick={() => setShowImportModal(true)}\n >\n <SvgImport />\n </IconButton>\n }\n </div>\n <IconButton\n title=\"Refresh\"\n onClick={onRefresh}\n disabled={isLoading}\n styleType='borderless'\n >\n <SvgRefresh />\n </IconButton>\n </div>\n {alert}\n <div className='gmw-mappings-border' />\n {isLoading ? (\n <LoadingOverlay />\n ) : mappings.length === 0 ? (\n <EmptyMessage message={`No ${displayStrings.mappings} available.`} />\n ) : (\n <div className=\"gmw-mappings-list\">\n {mappings.map((mapping) => (\n <HorizontalTile\n key={mapping.id}\n title={mapping.mappingName ? mapping.mappingName : \"Untitled\"}\n subText={mapping.description ?? \"\"}\n subtextToolTip={mapping.description ?? \"\"}\n titleTooltip={mapping.mappingName}\n onClickTitle={onClickMappingTitle ? () => onClickMappingTitle(mapping) : undefined}\n actionGroup={\n <MappingUIActionGroup\n mapping={mapping}\n onToggleExtraction={onToggleExtraction}\n onRefresh={onRefresh}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n }\n />\n ))}\n </div>\n )}\n </div>\n {showDeleteModal &&\n <DeleteModal\n entityName={showDeleteModal?.mappingName}\n onClose={() => setShowDeleteModal(undefined)}\n onDelete={async () => {\n await onDelete(showDeleteModal);\n }}\n refresh={onRefresh}\n />\n }\n {showImportModal && setShowImportModal && <MappingImportWizardModal\n show={showImportModal}\n setShow={setShowImportModal}\n onFinish={onRefresh}\n displayStrings={displayStrings}\n />}\n </>\n );\n};\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
|
-
.gmw-mappings-container {
|
|
6
|
+
.gmw-mappings-view-container {
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
flex-grow: 1;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: space-between;
|
|
15
15
|
gap: var(--iui-size-xs);
|
|
16
|
-
border-bottom: 1px solid var(--iui-color-border-subtle);
|
|
17
16
|
padding-bottom: var(--iui-size-s);
|
|
18
17
|
flex-wrap: wrap;
|
|
19
18
|
|
|
@@ -23,6 +22,11 @@
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
|
|
25
|
+
.gmw-mappings-border {
|
|
26
|
+
padding-top: var(--iui-size-s);
|
|
27
|
+
border-bottom: 1px solid var(--iui-color-border-subtle);
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
.gmw-mappings-list {
|
|
27
31
|
display: flex;
|
|
28
32
|
flex-direction: column;
|
|
@@ -30,8 +30,8 @@ const PropertyGridWrapperContext_1 = require("./context/PropertyGridWrapperConte
|
|
|
30
30
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
31
31
|
require("./PropertyAction.scss");
|
|
32
32
|
const usePropertySelection = (property, currentPropertyList, queryBuilder) => {
|
|
33
|
-
const [isCheckboxLoading, setIsCheckboxLoading] = react_1.useState(false);
|
|
34
|
-
const checkIfPropertyIsSelected = react_1.useCallback((property) => {
|
|
33
|
+
const [isCheckboxLoading, setIsCheckboxLoading] = (0, react_1.useState)(false);
|
|
34
|
+
const checkIfPropertyIsSelected = (0, react_1.useCallback)((property) => {
|
|
35
35
|
if (property.value.valueFormat === appui_abstract_1.PropertyValueFormat.Primitive) {
|
|
36
36
|
return currentPropertyList.includes(property);
|
|
37
37
|
}
|
|
@@ -42,7 +42,7 @@ const usePropertySelection = (property, currentPropertyList, queryBuilder) => {
|
|
|
42
42
|
return Object.values(property.value.members).every((subProp) => checkIfPropertyIsSelected(subProp));
|
|
43
43
|
}, [currentPropertyList]);
|
|
44
44
|
const isPropertySelected = checkIfPropertyIsSelected(property);
|
|
45
|
-
const addProperty = react_1.useCallback(async (prop) => {
|
|
45
|
+
const addProperty = (0, react_1.useCallback)(async (prop) => {
|
|
46
46
|
if (prop.value.valueFormat === appui_abstract_1.PropertyValueFormat.Primitive &&
|
|
47
47
|
!currentPropertyList.includes(prop) &&
|
|
48
48
|
(await queryBuilder?.addProperty(prop))) {
|
|
@@ -51,7 +51,7 @@ const usePropertySelection = (property, currentPropertyList, queryBuilder) => {
|
|
|
51
51
|
}
|
|
52
52
|
return false;
|
|
53
53
|
}, [currentPropertyList, queryBuilder]);
|
|
54
|
-
const removeProperty = react_1.useCallback(async (prop) => {
|
|
54
|
+
const removeProperty = (0, react_1.useCallback)(async (prop) => {
|
|
55
55
|
if (currentPropertyList.includes(prop)) {
|
|
56
56
|
await queryBuilder?.removeProperty(prop);
|
|
57
57
|
setIsCheckboxLoading(false);
|
|
@@ -66,12 +66,12 @@ const usePropertySelection = (property, currentPropertyList, queryBuilder) => {
|
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
const PropertyAction = ({ property }) => {
|
|
69
|
-
const { currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery, isUpdating, } = PropertyGridWrapperContext_1.usePropertyGridWrapper();
|
|
69
|
+
const { currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery, isUpdating, } = (0, PropertyGridWrapperContext_1.usePropertyGridWrapper)();
|
|
70
70
|
const { isPropertySelected, addProperty, removeProperty, isCheckboxLoading, setIsCheckboxLoading, } = usePropertySelection(property, currentPropertyList, queryBuilder);
|
|
71
|
-
react_1.useEffect(() => {
|
|
71
|
+
(0, react_1.useEffect)(() => {
|
|
72
72
|
setIsCheckboxLoading(isPropertySelected && isUpdating);
|
|
73
73
|
}, [isPropertySelected, isUpdating, setIsCheckboxLoading]);
|
|
74
|
-
const onPropertySelectionChanged = react_1.useCallback(async () => {
|
|
74
|
+
const onPropertySelectionChanged = (0, react_1.useCallback)(async () => {
|
|
75
75
|
if (isPropertySelected) {
|
|
76
76
|
await removeProperty(property);
|
|
77
77
|
setCurrentPropertyList((prevList) => prevList.filter((x) => x !== property));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAgE;AAEhE,0DAA4D;AAC5D,qFAA8E;AAC9E,wDAAgD;AAChD,iCAA+B;AAO/B,MAAM,oBAAoB,GAAG,CAC3B,QAAwB,EACxB,mBAAqC,EACrC,YAAsC,EACtC,EAAE;IACF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,gBAAQ,
|
|
1
|
+
{"version":3,"file":"PropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAgE;AAEhE,0DAA4D;AAC5D,qFAA8E;AAC9E,wDAAgD;AAChD,iCAA+B;AAO/B,MAAM,oBAAoB,GAAG,CAC3B,QAAwB,EACxB,mBAAqC,EACrC,YAAsC,EACtC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ACL,IAAI,MAAM,WAAW,CAAC,QAAQ,CAAC,EAAE;gBAC/B,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAChE,QAAQ,CAAC,YAAY,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;aAClD;SACF;IACH,CAAC,EAAE;QACD,WAAW;QACX,kBAAkB;QAClB,QAAQ;QACR,cAAc;QACd,YAAY;QACZ,sBAAsB;QACtB,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO,CACL,uCAAK,SAAS,EAAC,iCAAiC,IAC7C,QAAQ,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,SAAS;QAC3D,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,CACtC,8BAAC,wBAAQ,IACP,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,iBAAiB,GAC5B,CACH,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAzDW,QAAA,cAAc,kBAyDzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { usePropertyGridWrapper } from \"./context/PropertyGridWrapperContext\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\nimport \"./PropertyAction.scss\";\nimport type { QueryBuilder } from \"./QueryBuilder\";\n\nexport interface PropertyActionProps {\n property: PropertyRecord;\n}\n\nconst usePropertySelection = (\n property: PropertyRecord,\n currentPropertyList: PropertyRecord[],\n queryBuilder: QueryBuilder | undefined\n) => {\n const [isCheckboxLoading, setIsCheckboxLoading] = useState(false);\n\n const checkIfPropertyIsSelected = useCallback(\n (property: PropertyRecord): boolean => {\n if (property.value.valueFormat === PropertyValueFormat.Primitive) {\n return currentPropertyList.includes(property);\n }\n\n if (property.value.valueFormat === PropertyValueFormat.Array) {\n return (\n property.value.items.length === 0 &&\n currentPropertyList.includes(property)\n );\n }\n return Object.values(property.value.members).every(\n (subProp: PropertyRecord) => checkIfPropertyIsSelected(subProp)\n );\n },\n [currentPropertyList]\n );\n\n const isPropertySelected = checkIfPropertyIsSelected(property);\n\n const addProperty = useCallback(\n async (prop: PropertyRecord) => {\n if (\n prop.value.valueFormat === PropertyValueFormat.Primitive &&\n !currentPropertyList.includes(prop) &&\n (await queryBuilder?.addProperty(prop))\n ) {\n setIsCheckboxLoading(false);\n return true;\n }\n return false;\n },\n [currentPropertyList, queryBuilder]\n );\n\n const removeProperty = useCallback(\n async (prop: PropertyRecord) => {\n if (currentPropertyList.includes(prop)) {\n await queryBuilder?.removeProperty(prop);\n setIsCheckboxLoading(false);\n }\n },\n [currentPropertyList, queryBuilder]\n );\n\n return {\n isPropertySelected,\n addProperty,\n removeProperty,\n isCheckboxLoading,\n setIsCheckboxLoading,\n };\n};\n\nexport const PropertyAction = ({ property }: PropertyActionProps) => {\n const {\n currentPropertyList,\n queryBuilder,\n setCurrentPropertyList,\n setQuery,\n isUpdating,\n } = usePropertyGridWrapper();\n\n const {\n isPropertySelected,\n addProperty,\n removeProperty,\n isCheckboxLoading,\n setIsCheckboxLoading,\n } = usePropertySelection(property, currentPropertyList, queryBuilder);\n\n useEffect(() => {\n setIsCheckboxLoading(isPropertySelected && isUpdating);\n }, [isPropertySelected, isUpdating, setIsCheckboxLoading]);\n\n const onPropertySelectionChanged = useCallback(async () => {\n if (isPropertySelected) {\n await removeProperty(property);\n setCurrentPropertyList((prevList) =>\n prevList.filter((x) => x !== property)\n );\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n } else {\n if (await addProperty(property)) {\n setCurrentPropertyList((prevList) => prevList.concat(property));\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n }\n }\n }, [\n addProperty,\n isPropertySelected,\n property,\n removeProperty,\n queryBuilder,\n setCurrentPropertyList,\n setQuery,\n ]);\n\n return (\n <div className=\"gmw-property-selection-checkbox\">\n {property.value.valueFormat === PropertyValueFormat.Primitive &&\n property.value.value !== undefined && (\n <Checkbox\n checked={isPropertySelected}\n onChange={onPropertySelectionChanged}\n disabled={isUpdating}\n isLoading={isCheckboxLoading}\n />\n )}\n </div>\n );\n};\n"]}
|
|
@@ -36,21 +36,21 @@ const CustomCalculationTable_1 = require("./CustomCalculationTable");
|
|
|
36
36
|
const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
|
|
37
37
|
const groupId = group.id;
|
|
38
38
|
const mappingId = mapping.id;
|
|
39
|
-
const { getAccessToken, iModelId } = GroupingApiConfigContext_1.useGroupingMappingApiConfig();
|
|
40
|
-
const mappingClient = MappingClientContext_1.useMappingClient();
|
|
41
|
-
const { groupProperties, setGroupProperties, calculatedProperties, setCalculatedProperties, customCalculationProperties, setCustomCalculationProperties, } = PropertiesContext_1.usePropertiesContext();
|
|
42
|
-
const fetchGroupProperties = react_1.useMemo(() => {
|
|
39
|
+
const { getAccessToken, iModelId } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
40
|
+
const mappingClient = (0, MappingClientContext_1.useMappingClient)();
|
|
41
|
+
const { groupProperties, setGroupProperties, calculatedProperties, setCalculatedProperties, customCalculationProperties, setCustomCalculationProperties, } = (0, PropertiesContext_1.usePropertiesContext)();
|
|
42
|
+
const fetchGroupProperties = (0, react_1.useMemo)(() => {
|
|
43
43
|
return async () => mappingClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId);
|
|
44
44
|
}, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
|
|
45
|
-
const { isLoading: isLoadingGroupProperties, refreshData: refreshGroupProperties } = useFetchData_1.useCombinedFetchRefresh(fetchGroupProperties, setGroupProperties);
|
|
46
|
-
const fetchCalculatedProperties = react_1.useMemo(() => {
|
|
45
|
+
const { isLoading: isLoadingGroupProperties, refreshData: refreshGroupProperties } = (0, useFetchData_1.useCombinedFetchRefresh)(fetchGroupProperties, setGroupProperties);
|
|
46
|
+
const fetchCalculatedProperties = (0, react_1.useMemo)(() => {
|
|
47
47
|
return async () => mappingClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId);
|
|
48
48
|
}, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
|
|
49
|
-
const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } = useFetchData_1.useCombinedFetchRefresh(fetchCalculatedProperties, setCalculatedProperties);
|
|
50
|
-
const fetchCustomCalculations = react_1.useMemo(() => {
|
|
49
|
+
const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } = (0, useFetchData_1.useCombinedFetchRefresh)(fetchCalculatedProperties, setCalculatedProperties);
|
|
50
|
+
const fetchCustomCalculations = (0, react_1.useMemo)(() => {
|
|
51
51
|
return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);
|
|
52
52
|
}, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
|
|
53
|
-
const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } = useFetchData_1.useCombinedFetchRefresh(fetchCustomCalculations, setCustomCalculationProperties);
|
|
53
|
+
const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } = (0, useFetchData_1.useCombinedFetchRefresh)(fetchCustomCalculations, setCustomCalculationProperties);
|
|
54
54
|
return (react_1.default.createElement("div", { className: 'gmw-property-menu-wrapper' },
|
|
55
55
|
!hideGroupProps && (react_1.default.createElement(GroupPropertyTable_1.GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties ?? [], refresh: refreshGroupProperties })),
|
|
56
56
|
!hideCalculatedProps && (react_1.default.createElement(CalculatedPropertyTable_1.CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading: isLoadingCalculatedProperties, calculatedProperties: calculatedProperties ?? [], refresh: refreshCalculatedProperties })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAuC;AACvC,+BAA6B;AAC7B,6DAA0D;AAC1D,wDAAgE;AAChE,yEAAkE;AAClE,iFAAiF;AAEjF,mEAAmE;AACnE,uEAAoE;AACpE,qEAAkE;AAgB3D,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,cAAc,GAAG,KAAK,EACtB,mBAAmB,GAAG,KAAK,EAC3B,0BAA0B,GAAG,KAAK,GAChB,EAAE,EAAE;IACtB,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,sDAA2B,
|
|
1
|
+
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAuC;AACvC,+BAA6B;AAC7B,6DAA0D;AAC1D,wDAAgE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,EAChD,OAAO,EAAE,2BAA2B,GACpC,CACH;QACA,CAAC,0BAA0B,IAAI,CAC9B,8BAAC,+CAAsB,IACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,mCAAmC,EAC/C,aAAa,EAAE,8BAA8B,EAC7C,SAAS,EAAE,2BAA2B,EACtC,kBAAkB,EAAE,2BAA2B,IAAI,EAAE,EACrD,OAAO,EAAE,yBAAyB,GAClC,CACH,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AA3FW,QAAA,YAAY,gBA2FvB","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, { useMemo } from \"react\";\nimport \"./PropertyMenu.scss\";\nimport { GroupPropertyTable } from \"./GroupPropertyTable\";\nimport { useCombinedFetchRefresh } from \"../hooks/useFetchData\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport type { CalculatedProperty, CustomCalculation, Group, GroupProperty, Mapping } from \"@itwin/insights-client\";\nimport { usePropertiesContext } from \"./context/PropertiesContext\";\nimport { CalculatedPropertyTable } from \"./CalculatedPropertyTable\";\nimport { CustomCalculationTable } from \"./CustomCalculationTable\";\n\nexport interface PropertyMenuProps {\n mapping: Mapping;\n group: Group;\n onClickAddGroupProperty?: () => void;\n onClickModifyGroupProperty?: (groupProperty: GroupProperty) => void;\n onClickAddCalculatedProperty?: () => void;\n onClickModifyCalculatedProperty?: (calculatedProperty: CalculatedProperty) => void;\n onClickAddCustomCalculationProperty?: () => void;\n onClickModifyCustomCalculation?: (customCalculation: CustomCalculation) => void;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport const PropertyMenu = ({\n mapping,\n group,\n onClickAddGroupProperty,\n onClickModifyGroupProperty,\n onClickAddCalculatedProperty,\n onClickModifyCalculatedProperty,\n onClickAddCustomCalculationProperty,\n onClickModifyCustomCalculation,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyMenuProps) => {\n const groupId = group.id;\n const mappingId = mapping.id;\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const {\n groupProperties,\n setGroupProperties,\n calculatedProperties,\n setCalculatedProperties,\n customCalculationProperties,\n setCustomCalculationProperties,\n } = usePropertiesContext();\n\n const fetchGroupProperties = useMemo(\n () => {\n return async () => mappingClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingGroupProperties, refreshData: refreshGroupProperties } =\n useCombinedFetchRefresh<GroupProperty>(fetchGroupProperties, setGroupProperties);\n\n const fetchCalculatedProperties = useMemo(\n () => {\n return async () => mappingClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } =\n useCombinedFetchRefresh<CalculatedProperty>(fetchCalculatedProperties, setCalculatedProperties);\n\n const fetchCustomCalculations = useMemo(\n () => {\n return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } =\n useCombinedFetchRefresh<CustomCalculation>(fetchCustomCalculations, setCustomCalculationProperties);\n\n return (\n <div className='gmw-property-menu-wrapper'>\n {!hideGroupProps && (\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddGroupProperty}\n onClickModify={onClickModifyGroupProperty}\n isLoading={isLoadingGroupProperties}\n groupProperties={groupProperties ?? []}\n refresh={refreshGroupProperties}\n />\n )}\n {!hideCalculatedProps && (\n <CalculatedPropertyTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCalculatedProperty}\n onClickModify={onClickModifyCalculatedProperty}\n isLoading={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties ?? []}\n refresh={refreshCalculatedProperties}\n />\n )}\n {!hideCustomCalculationProps && (\n <CustomCalculationTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCustomCalculationProperty}\n onClickModify={onClickModifyCustomCalculation}\n isLoading={isLoadingCustomCalculations}\n customCalculations={customCalculationProperties ?? []}\n refresh={refreshCustomCalculations}\n />\n )}\n </div>\n );\n};\n"]}
|
|
@@ -32,7 +32,7 @@ const GroupInformationPanel_1 = require("./GroupInformationPanel");
|
|
|
32
32
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
33
33
|
require("./PropertyMenuWithVisualization.scss");
|
|
34
34
|
const PropertyMenuWithVisualization = ({ group, color, ...rest }) => {
|
|
35
|
-
const [isInformationPanelOpen, setIsInformationPanelOpen] = react_1.useState(false);
|
|
35
|
+
const [isInformationPanelOpen, setIsInformationPanelOpen] = (0, react_1.useState)(false);
|
|
36
36
|
return (react_1.default.createElement(itwinui_react_1.InformationPanelWrapper, { className: 'gmw-property-menu-vis-wrapper' },
|
|
37
37
|
react_1.default.createElement("div", { className: "gmw-property-menu-vis-toolbar" },
|
|
38
38
|
react_1.default.createElement(GroupColorToggle_1.GroupColorToggle, { group: group, color: color, labelPosition: "left" }),
|