@itwin/grouping-mapping-widget 0.5.8 → 0.6.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.
Files changed (93) hide show
  1. package/lib/cjs/grouping-mapping-widget.d.ts +0 -1
  2. package/lib/cjs/grouping-mapping-widget.js +0 -1
  3. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  4. package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +2 -2
  5. package/lib/cjs/widget/components/CalculatedPropertyAction.js +13 -13
  6. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  7. package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +5 -5
  8. package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
  9. package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +3 -3
  10. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  11. package/lib/cjs/widget/components/CustomCalculationAction.d.ts +2 -2
  12. package/lib/cjs/widget/components/CustomCalculationAction.js +5 -5
  13. package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
  14. package/lib/cjs/widget/components/CustomCalculationTable.d.ts +5 -5
  15. package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
  16. package/lib/cjs/widget/components/GroupAction.d.ts +2 -2
  17. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  18. package/lib/cjs/widget/components/GroupPropertyAction.d.ts +2 -1
  19. package/lib/cjs/widget/components/GroupPropertyAction.js +27 -26
  20. package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
  21. package/lib/cjs/widget/components/GroupPropertyTable.d.ts +5 -5
  22. package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
  23. package/lib/cjs/widget/components/Grouping.d.ts +1 -1
  24. package/lib/cjs/widget/components/Grouping.js +25 -26
  25. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  26. package/lib/cjs/widget/components/Grouping.scss +4 -0
  27. package/lib/cjs/widget/components/GroupingMapping.d.ts +2 -2
  28. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  29. package/lib/cjs/widget/components/Mapping.d.ts +1 -1
  30. package/lib/cjs/widget/components/Mapping.js +6 -7
  31. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  32. package/lib/cjs/widget/components/MappingAction.js +1 -2
  33. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  34. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  35. package/lib/cjs/widget/components/PropertyMenu.d.ts +2 -2
  36. package/lib/cjs/widget/components/PropertyMenu.js +7 -8
  37. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  38. package/lib/cjs/widget/components/SelectMappings.d.ts +2 -2
  39. package/lib/cjs/widget/components/SelectMappings.js +2 -2
  40. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  41. package/lib/cjs/widget/components/context/MappingClientContext.d.ts +5 -5
  42. package/lib/cjs/widget/components/context/MappingClientContext.js +1 -5
  43. package/lib/cjs/widget/components/context/MappingClientContext.js.map +1 -1
  44. package/lib/esm/grouping-mapping-widget.d.ts +0 -1
  45. package/lib/esm/grouping-mapping-widget.js +0 -1
  46. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  47. package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +2 -2
  48. package/lib/esm/widget/components/CalculatedPropertyAction.js +13 -13
  49. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
  50. package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +5 -5
  51. package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
  52. package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +3 -3
  53. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  54. package/lib/esm/widget/components/CustomCalculationAction.d.ts +2 -2
  55. package/lib/esm/widget/components/CustomCalculationAction.js +5 -5
  56. package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
  57. package/lib/esm/widget/components/CustomCalculationTable.d.ts +5 -5
  58. package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
  59. package/lib/esm/widget/components/GroupAction.d.ts +2 -2
  60. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  61. package/lib/esm/widget/components/GroupPropertyAction.d.ts +2 -1
  62. package/lib/esm/widget/components/GroupPropertyAction.js +27 -26
  63. package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
  64. package/lib/esm/widget/components/GroupPropertyTable.d.ts +5 -5
  65. package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
  66. package/lib/esm/widget/components/Grouping.d.ts +1 -1
  67. package/lib/esm/widget/components/Grouping.js +26 -27
  68. package/lib/esm/widget/components/Grouping.js.map +1 -1
  69. package/lib/esm/widget/components/Grouping.scss +4 -0
  70. package/lib/esm/widget/components/GroupingMapping.d.ts +2 -2
  71. package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
  72. package/lib/esm/widget/components/Mapping.d.ts +1 -1
  73. package/lib/esm/widget/components/Mapping.js +6 -7
  74. package/lib/esm/widget/components/Mapping.js.map +1 -1
  75. package/lib/esm/widget/components/MappingAction.js +1 -2
  76. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  77. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  78. package/lib/esm/widget/components/PropertyMenu.d.ts +2 -2
  79. package/lib/esm/widget/components/PropertyMenu.js +7 -8
  80. package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
  81. package/lib/esm/widget/components/SelectMappings.d.ts +2 -2
  82. package/lib/esm/widget/components/SelectMappings.js +2 -2
  83. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  84. package/lib/esm/widget/components/context/MappingClientContext.d.ts +5 -5
  85. package/lib/esm/widget/components/context/MappingClientContext.js +2 -6
  86. package/lib/esm/widget/components/context/MappingClientContext.js.map +1 -1
  87. package/package.json +2 -2
  88. package/lib/cjs/widget/IMappingClient.d.ts +0 -327
  89. package/lib/cjs/widget/IMappingClient.js +0 -7
  90. package/lib/cjs/widget/IMappingClient.js.map +0 -1
  91. package/lib/esm/widget/IMappingClient.d.ts +0 -327
  92. package/lib/esm/widget/IMappingClient.js +0 -6
  93. package/lib/esm/widget/IMappingClient.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GroupAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,wEAEsC;AACtC,oDAA+D;AAC/D,wDAAwI;AACxI,+CAAgE;AAChE,mCAAuF;AAEvF,8BAA4B;AAC5B,gEAAwC;AACxC,sEAAwE;AAExE,6EAA0E;AAC1E,iDAA8C;AAC9C,+CAIuB;AACvB,oEAAkE;AAClE,iFAA8E;AAC9E,iFAAiF;AACjF,yEAAkE;AAUlE,MAAM,WAAW,GAAG,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,GACQ,EAAE,EAAE;;IACrB,MAAM,gBAAgB,GAAG,uCAAyB,EAAsB,CAAC;IACzE,MAAM,EAAE,cAAc,EAAE,GAAG,sDAA2B,EAAE,CAAC;IACzD,MAAM,aAAa,GAAG,uCAAgB,EAAE,CAAC;IACzC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,gBAAQ,CAAC;QACrC,SAAS,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,mCAAI,EAAE;QACjC,WAAW,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,mCAAI,EAAE;KACtC,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAQ,CAAS,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,gBAAQ,CAAS,EAAE,CAAC,CAAC;IAC7E,MAAM,CAAC,SAAS,EAAE,qBAAqB,CAAC,GAAG,s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AC,gBAAgB,EACtB,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,SAAS,IAAI,WAAW,EAClC,WAAW,EAAE,kBAAkB,GAAI;wBACrC,uCAAK,SAAS,EAAC,oBAAoB;4BAChC,WAAW;gCACV,8BAAC,sBAAc,OAAG;4BAEpB,8BAAC,sBAAM,IAAC,QAAQ,EAAE,SAAS,IAAI,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,qBAAyB;4BACvL,8BAAC,sBAAM,IAAC,QAAQ,EAAE,SAAS,IAAI,WAAW,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;oCAC9D,QAAQ,CAAC,EAAE,CAAC,CAAC;oCACb,cAAc,CAAC,EAAE,CAAC,CAAC;oCACnB,MAAM,SAAS,EAAE,CAAC;gCACpB,CAAC,YAAgB,CACb,CACF,CAEC,CACP;QACN,8BAAC,qBAAW,IACV,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,IAAI,EAAE,CAAC;YACf,CAAC,EACD,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACnB,oCAAY,CAAC,SAAS,CAAC,cAAc,CACnC,uBAAuB,EACvB,gBAAgB,CACjB,CAAC;gBACF,MAAM,MAAM,EAAE,CAAC;YACjB,CAAC,EACD,gBAAgB,EACd,iBAAiB,EAEnB,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport {\n Presentation,\n} from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { Button, Fieldset, LabeledInput, LabeledTextarea, RadioTile, RadioTileGroup, Small, Text, toaster } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { handleError, handleInputChange, LoadingSpinner, WidgetHeader } from \"./utils\";\nimport type { GroupType } from \"./Grouping\";\nimport \"./GroupAction.scss\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { GroupQueryBuilderContainer } from \"./GroupQueryBuilderContainer\";\nimport { QueryBuilder } from \"./QueryBuilder\";\nimport {\n transparentOverriddenElements,\n visualizeElementsByQuery,\n zoomToElements,\n} from \"./viewerUtils\";\nimport { SvgCursor, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { GroupQueryBuilderContext } from \"./context/GroupQueryBuilderContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\n\ninterface GroupActionProps {\n iModelId: string;\n mappingId: string;\n group?: GroupType;\n goBack: () => Promise<void>;\n resetView: () => Promise<void>;\n}\n\nconst GroupAction = ({\n iModelId,\n mappingId,\n group,\n goBack,\n resetView,\n}: GroupActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [details, setDetails] = useState({\n groupName: group?.groupName ?? \"\",\n description: group?.description ?? \"\",\n });\n const [query, setQuery] = useState<string>(\"\");\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const [currentPropertyList, setCurrentPropertyList] = React.useState<PropertyRecord[]>([]);\n const [queryBuilder, setQueryBuilder] = React.useState<QueryBuilder>(\n new QueryBuilder(undefined),\n );\n const [queryGenerationType, setQueryGenerationType] = React.useState(\"Selection\");\n const [searchInput, setSearchInput] = React.useState(\"\");\n\n const changeGroupByType = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const {\n target: { value },\n } = event;\n setQueryGenerationType(value);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n setQuery(\"\");\n setSimpleSelectionQuery(\"\");\n await resetView();\n };\n\n useEffect(() => {\n const removeListener = Presentation.selection.selectionChange.addListener(\n async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n ) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const query = selection.instanceKeys.size > 0 ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}` : \"\";\n setSimpleSelectionQuery(query);\n }\n },\n );\n return () => {\n removeListener();\n };\n }, [iModelConnection, queryGenerationType]);\n\n useEffect(() => {\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n\n if (queryGenerationType === \"Selection\" && currentPropertyList.length === 0) {\n return;\n }\n\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(\n query,\n \"red\",\n iModelConnection,\n );\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(\"Sorry, we have failed to generate a valid query. 😔\");\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query, currentPropertyList, queryGenerationType]);\n\n useEffect(() => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n }, [iModelConnection]);\n\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (token: string, index: number, searchQuery: string[]) => isWrappedInQuotes(token) || (index === 1 && isWrappedInQuotes(searchQuery[0]));\n // Temporary until ECViews become available for use.\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n setQuery(\"\");\n return;\n }\n\n let generatedSearchQuery =\n `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")}) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})) OR ((${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")}) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} ecc.name LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")}) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})) `;\n\n setQuery(generatedSearchQuery);\n };\n\n const save = useCallback(async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n const currentQuery = query || simpleSelectionQuery;\n\n const accessToken = await getAccessToken();\n\n group\n ? await mappingClient.updateGroup(\n accessToken,\n iModelId,\n mappingId,\n group.id ?? \"\",\n { ...details, query: currentQuery },\n )\n : await mappingClient.createGroup(accessToken, iModelId, mappingId, {\n ...details,\n query: currentQuery,\n });\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await goBack();\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n }, [\n details,\n goBack,\n group,\n iModelConnection,\n iModelId,\n mappingId,\n query,\n showValidationMessage,\n simpleSelectionQuery,\n validator,\n getAccessToken,\n mappingClient,\n ]);\n\n const isBlockingActions = !(details.groupName && (query || simpleSelectionQuery) && !isRendering && !isLoading);\n\n return (\n <>\n <WidgetHeader\n title={group ? group.groupName ?? \"\" : \"Add Group\"}\n returnFn={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await goBack();\n }}\n />\n <div className='gmw-group-add-modify-container'>\n <Fieldset legend='Group Details' className='gmw-group-details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='groupName'\n name='groupName'\n label='Name'\n value={details.groupName}\n required\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n message={validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )}\n status={\n validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"groupName\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={details.description}\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n }}\n />\n </Fieldset>\n <Fieldset legend='Group By' className='gmw-query-builder-container'>\n <RadioTileGroup\n className=\"gmw-radio-group-tile\"\n required>\n <RadioTile\n name={\"groupby\"}\n icon={<SvgCursor />}\n onChange={changeGroupByType}\n defaultChecked\n value={\"Selection\"}\n label={\"Selection\"}\n disabled={isLoading || isRendering}\n />\n <RadioTile\n icon={<SvgSearch />}\n name={\"groupby\"}\n onChange={changeGroupByType}\n value={\"Query Keywords\"}\n label={\"Query Keywords\"}\n disabled={isLoading || isRendering}\n />\n </RadioTileGroup>\n {queryGenerationType === \"Selection\" ?\n <GroupQueryBuilderContext.Provider\n value={{\n currentPropertyList,\n setCurrentPropertyList,\n query,\n setQuery,\n queryBuilder,\n setQueryBuilder,\n isLoading,\n isRendering,\n resetView,\n }}\n >\n <GroupQueryBuilderContainer />\n </GroupQueryBuilderContext.Provider> :\n <div className=\"gmw-search-form\">\n <Text>Generate a query by keywords. Keywords wrapped in double quotes will be considered a required criteria.</Text>\n <LabeledTextarea\n label=\"Query Keywords\"\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isLoading || isRendering}\n placeholder={`E.g. \"red\" chair`} />\n <div className=\"gmw-search-actions\">\n {isRendering &&\n <LoadingSpinner />\n }\n <Button disabled={isLoading || isRendering} onClick={() => generateSearchQuery(searchInput ? searchInput.replace(/(\\r\\n|\\n|\\r)/gm, \"\").trim().split(\" \") : [])}>Generate Query</Button>\n <Button disabled={isLoading || isRendering} onClick={async () => {\n setQuery(\"\");\n setSearchInput(\"\");\n await resetView();\n }}>Clear</Button>\n </div>\n </div>\n }\n </Fieldset>\n </div>\n <ActionPanel\n onSave={async () => {\n await save();\n }}\n onCancel={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await goBack();\n }}\n isSavingDisabled={\n isBlockingActions\n }\n isLoading={isLoading}\n />\n </>\n );\n};\n\nexport default GroupAction;\n"]}
1
+ {"version":3,"file":"GroupAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,wEAEsC;AACtC,oDAA+D;AAC/D,wDAAwI;AACxI,+CAAgE;AAChE,mCAAuF;AAEvF,8BAA4B;AAC5B,gEAAwC;AACxC,sEAAwE;AAExE,6EAA0E;AAC1E,iDAA8C;AAC9C,+CAIuB;AACvB,oEAAkE;AAClE,iFAA8E;AAC9E,iFAAiF;AACjF,yEAAkE;AAUlE,MAAM,WAAW,GAAG,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,GACQ,EAAE,EAAE;;IACrB,MAAM,gBAAgB,GAAG,uCAAyB,EAAsB,CAAC;IACzE,MAAM,EAAE,cAAc,EAAE,GAAG,sDAA2B,EAAE,CAAC;IACzD,MAAM,aAAa,GAAG,uCAAgB,EAAE,CAAC;IACzC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,gBAAQ,CAAC;QACrC,SAAS,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,mCAAI,EAAE;QACjC,WAAW,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,mCAAI,EAAE;KACtC,CAAC,CA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B,CAAC;gBACF,MAAM,MAAM,EAAE,CAAC;YACjB,CAAC,EACD,gBAAgB,EACd,iBAAiB,EAEnB,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport {\n Presentation,\n} from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { Button, Fieldset, LabeledInput, LabeledTextarea, RadioTile, RadioTileGroup, Small, Text, toaster } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { handleError, handleInputChange, LoadingSpinner, WidgetHeader } from \"./utils\";\nimport type { IGroupTyped } from \"./Grouping\";\nimport \"./GroupAction.scss\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { GroupQueryBuilderContainer } from \"./GroupQueryBuilderContainer\";\nimport { QueryBuilder } from \"./QueryBuilder\";\nimport {\n transparentOverriddenElements,\n visualizeElementsByQuery,\n zoomToElements,\n} from \"./viewerUtils\";\nimport { SvgCursor, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { GroupQueryBuilderContext } from \"./context/GroupQueryBuilderContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\n\ninterface GroupActionProps {\n iModelId: string;\n mappingId: string;\n group?: IGroupTyped;\n goBack: () => Promise<void>;\n resetView: () => Promise<void>;\n}\n\nconst GroupAction = ({\n iModelId,\n mappingId,\n group,\n goBack,\n resetView,\n}: GroupActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [details, setDetails] = useState({\n groupName: group?.groupName ?? \"\",\n description: group?.description ?? \"\",\n });\n const [query, setQuery] = useState<string>(\"\");\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const [currentPropertyList, setCurrentPropertyList] = React.useState<PropertyRecord[]>([]);\n const [queryBuilder, setQueryBuilder] = React.useState<QueryBuilder>(\n new QueryBuilder(undefined),\n );\n const [queryGenerationType, setQueryGenerationType] = React.useState(\"Selection\");\n const [searchInput, setSearchInput] = React.useState(\"\");\n\n const changeGroupByType = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const {\n target: { value },\n } = event;\n setQueryGenerationType(value);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n setQuery(\"\");\n setSimpleSelectionQuery(\"\");\n await resetView();\n };\n\n useEffect(() => {\n const removeListener = Presentation.selection.selectionChange.addListener(\n async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n ) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const query = selection.instanceKeys.size > 0 ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}` : \"\";\n setSimpleSelectionQuery(query);\n }\n },\n );\n return () => {\n removeListener();\n };\n }, [iModelConnection, queryGenerationType]);\n\n useEffect(() => {\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n\n if (queryGenerationType === \"Selection\" && currentPropertyList.length === 0) {\n return;\n }\n\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(\n query,\n \"red\",\n iModelConnection,\n );\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(\"Sorry, we have failed to generate a valid query. 😔\");\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query, currentPropertyList, queryGenerationType]);\n\n useEffect(() => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n }, [iModelConnection]);\n\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (token: string, index: number, searchQuery: string[]) => isWrappedInQuotes(token) || (index === 1 && isWrappedInQuotes(searchQuery[0]));\n // Temporary until ECViews become available for use.\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n setQuery(\"\");\n return;\n }\n\n let generatedSearchQuery =\n `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")}) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} be.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})) OR ((${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")}) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} cat.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} ecc.name LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")}) OR (${searchQuery.map((token, index) =>\n `${index === 0 ? \"\" : needsAndOperator(token, index, searchQuery) ? \"AND\" : \"OR\"} pt.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token}%'`\n ).join(\" \")})) `;\n\n setQuery(generatedSearchQuery);\n };\n\n const save = useCallback(async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n const currentQuery = query || simpleSelectionQuery;\n\n const accessToken = await getAccessToken();\n\n group\n ? await mappingClient.updateGroup(\n accessToken,\n iModelId,\n mappingId,\n group.id ?? \"\",\n { ...details, query: currentQuery },\n )\n : await mappingClient.createGroup(accessToken, iModelId, mappingId, {\n ...details,\n query: currentQuery,\n });\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await goBack();\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n }, [\n details,\n goBack,\n group,\n iModelConnection,\n iModelId,\n mappingId,\n query,\n showValidationMessage,\n simpleSelectionQuery,\n validator,\n getAccessToken,\n mappingClient,\n ]);\n\n const isBlockingActions = !(details.groupName && (query || simpleSelectionQuery) && !isRendering && !isLoading);\n\n return (\n <>\n <WidgetHeader\n title={group ? group.groupName ?? \"\" : \"Add Group\"}\n returnFn={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await goBack();\n }}\n />\n <div className='gmw-group-add-modify-container'>\n <Fieldset legend='Group Details' className='gmw-group-details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='groupName'\n name='groupName'\n label='Name'\n value={details.groupName}\n required\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n message={validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )}\n status={\n validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"groupName\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={details.description}\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n }}\n />\n </Fieldset>\n <Fieldset legend='Group By' className='gmw-query-builder-container'>\n <RadioTileGroup\n className=\"gmw-radio-group-tile\"\n required>\n <RadioTile\n name={\"groupby\"}\n icon={<SvgCursor />}\n onChange={changeGroupByType}\n defaultChecked\n value={\"Selection\"}\n label={\"Selection\"}\n disabled={isLoading || isRendering}\n />\n <RadioTile\n icon={<SvgSearch />}\n name={\"groupby\"}\n onChange={changeGroupByType}\n value={\"Query Keywords\"}\n label={\"Query Keywords\"}\n disabled={isLoading || isRendering}\n />\n </RadioTileGroup>\n {queryGenerationType === \"Selection\" ?\n <GroupQueryBuilderContext.Provider\n value={{\n currentPropertyList,\n setCurrentPropertyList,\n query,\n setQuery,\n queryBuilder,\n setQueryBuilder,\n isLoading,\n isRendering,\n resetView,\n }}\n >\n <GroupQueryBuilderContainer />\n </GroupQueryBuilderContext.Provider> :\n <div className=\"gmw-search-form\">\n <Text>Generate a query by keywords. Keywords wrapped in double quotes will be considered a required criteria.</Text>\n <LabeledTextarea\n label=\"Query Keywords\"\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isLoading || isRendering}\n placeholder={`E.g. \"red\" chair`} />\n <div className=\"gmw-search-actions\">\n {isRendering &&\n <LoadingSpinner />\n }\n <Button disabled={isLoading || isRendering} onClick={() => generateSearchQuery(searchInput ? searchInput.replace(/(\\r\\n|\\n|\\r)/gm, \"\").trim().split(\" \") : [])}>Generate Query</Button>\n <Button disabled={isLoading || isRendering} onClick={async () => {\n setQuery(\"\");\n setSearchInput(\"\");\n await resetView();\n }}>Clear</Button>\n </div>\n </div>\n }\n </Fieldset>\n </div>\n <ActionPanel\n onSave={async () => {\n await save();\n }}\n onCancel={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await goBack();\n }}\n isSavingDisabled={\n isBlockingActions\n }\n isLoading={isLoading}\n />\n </>\n );\n};\n\nexport default GroupAction;\n"]}
@@ -2,6 +2,7 @@
2
2
  import type { KeySet } from "@itwin/presentation-common";
3
3
  import type { SelectOption } from "@itwin/itwinui-react";
4
4
  import "./GroupPropertyAction.scss";
5
+ import { QuantityType } from "@itwin/insights-client";
5
6
  interface GroupPropertyActionProps {
6
7
  iModelId: string;
7
8
  mappingId: string;
@@ -11,7 +12,7 @@ interface GroupPropertyActionProps {
11
12
  keySet: KeySet;
12
13
  returnFn: (modified: boolean) => Promise<void>;
13
14
  }
14
- export declare const quantityTypesSelectionOptions: SelectOption<string>[];
15
+ export declare const quantityTypesSelectionOptions: SelectOption<QuantityType>[];
15
16
  declare const GroupPropertyAction: ({ iModelId, mappingId, groupId, groupPropertyId, groupPropertyName, keySet, returnFn, }: GroupPropertyActionProps) => JSX.Element;
16
17
  export default GroupPropertyAction;
17
18
  //# sourceMappingURL=GroupPropertyAction.d.ts.map
@@ -33,17 +33,18 @@ const ActionPanel_1 = __importDefault(require("./ActionPanel"));
33
33
  const useValidator_1 = __importStar(require("../hooks/useValidator"));
34
34
  const utils_1 = require("./utils");
35
35
  require("./GroupPropertyAction.scss");
36
+ const insights_client_1 = require("@itwin/insights-client");
36
37
  const MappingClientContext_1 = require("./context/MappingClientContext");
37
38
  const GroupingApiConfigContext_1 = require("./context/GroupingApiConfigContext");
38
39
  exports.quantityTypesSelectionOptions = [
39
- { value: "Area", label: "Area" },
40
- { value: "Distance", label: "Distance" },
41
- { value: "Force", label: "Force" },
42
- { value: "Mass", label: "Mass" },
43
- { value: "Monetary", label: "Monetary" },
44
- { value: "Time", label: "Time" },
45
- { value: "Volume", label: "Volume" },
46
- { value: "Undefined", label: "No Quantity Type" },
40
+ { value: insights_client_1.QuantityType.Area, label: "Area" },
41
+ { value: insights_client_1.QuantityType.Distance, label: "Distance" },
42
+ { value: insights_client_1.QuantityType.Force, label: "Force" },
43
+ { value: insights_client_1.QuantityType.Mass, label: "Mass" },
44
+ { value: insights_client_1.QuantityType.Monetary, label: "Monetary" },
45
+ { value: insights_client_1.QuantityType.Time, label: "Time" },
46
+ { value: insights_client_1.QuantityType.Volume, label: "Volume" },
47
+ { value: insights_client_1.QuantityType.Undefined, label: "No Quantity Type" },
47
48
  ];
48
49
  const extractPrimitive = (propertiesField, classToPropertiesMapping, navigation) => {
49
50
  var _a, _b;
@@ -174,8 +175,8 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
174
175
  const { getAccessToken } = GroupingApiConfigContext_1.useGroupingMappingApiConfig();
175
176
  const mappingClient = MappingClientContext_1.useMappingClient();
176
177
  const [propertyName, setPropertyName] = react_1.useState("");
177
- const [dataType, setDataType] = react_1.useState();
178
- const [quantityType, setQuantityType] = react_1.useState("Undefined");
178
+ const [dataType, setDataType] = react_1.useState(insights_client_1.DataType.Undefined);
179
+ const [quantityType, setQuantityType] = react_1.useState(insights_client_1.QuantityType.Undefined);
179
180
  const [classToPropertiesMapping, setClassToPropertiesMapping] = react_1.useState();
180
181
  const [ecProperties, setEcProperties] = react_1.useState([]);
181
182
  const [validator, showValidationMessage] = useValidator_1.default();
@@ -183,7 +184,7 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
183
184
  const [isLoading, setIsLoading] = react_1.useState(false);
184
185
  react_1.useEffect(() => {
185
186
  const getContent = async () => {
186
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
187
+ var _a, _b, _c, _d, _e;
187
188
  setIsLoading(true);
188
189
  const ruleSet = {
189
190
  id: "element-properties",
@@ -248,7 +249,7 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
248
249
  if (!response) {
249
250
  return;
250
251
  }
251
- newEcProperties = (_g = (_f = response.property) === null || _f === void 0 ? void 0 : _f.ecProperties) !== null && _g !== void 0 ? _g : [];
252
+ newEcProperties = response.ecProperties;
252
253
  let keys = Array.from(classToPropertiesMapping.keys()).reverse();
253
254
  for (const ecProperty of newEcProperties) {
254
255
  keys = keys.filter((key) => `${ecProperty.ecSchemaName}:${ecProperty.ecClassName}` !== key);
@@ -258,11 +259,11 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
258
259
  ecClassName: key.split(":")[1],
259
260
  // Placeholders for properties
260
261
  ecPropertyName: "",
261
- ecPropertyType: "",
262
+ ecPropertyType: insights_client_1.DataType.Undefined,
262
263
  })));
263
- setPropertyName((_j = (_h = response.property) === null || _h === void 0 ? void 0 : _h.propertyName) !== null && _j !== void 0 ? _j : "");
264
- setDataType((_l = (_k = response.property) === null || _k === void 0 ? void 0 : _k.dataType) !== null && _l !== void 0 ? _l : "");
265
- setQuantityType((_o = (_m = response.property) === null || _m === void 0 ? void 0 : _m.quantityType) !== null && _o !== void 0 ? _o : "");
264
+ setPropertyName(response.propertyName);
265
+ setDataType(response.dataType);
266
+ setQuantityType(response.quantityType);
266
267
  }
267
268
  else {
268
269
  newEcProperties = Array.from(classToPropertiesMapping)
@@ -271,7 +272,7 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
271
272
  ecClassName: key.split(":")[1],
272
273
  // Placeholders for properties
273
274
  ecPropertyName: "",
274
- ecPropertyType: "",
275
+ ecPropertyType: insights_client_1.DataType.Undefined,
275
276
  }))
276
277
  .reverse();
277
278
  }
@@ -282,9 +283,9 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
282
283
  }, [getAccessToken, mappingClient, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);
283
284
  const onSave = async () => {
284
285
  const filteredEcProperties = ecProperties.filter((ecProperty) => ecProperty.ecPropertyName && ecProperty.ecPropertyType);
285
- if (!(filteredEcProperties === null || filteredEcProperties === void 0 ? void 0 : filteredEcProperties.length) || !validator.allValid()) {
286
+ if (!filteredEcProperties.length || !validator.allValid()) {
286
287
  showValidationMessage(true);
287
- if (!(filteredEcProperties === null || filteredEcProperties === void 0 ? void 0 : filteredEcProperties.length)) {
288
+ if (!filteredEcProperties.length) {
288
289
  setPropertyAlert(true);
289
290
  }
290
291
  return;
@@ -315,10 +316,10 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
315
316
  const updatedEcProperties = [...ecProperties];
316
317
  updatedEcProperties[index].ecPropertyName = property.name;
317
318
  // Unique types
318
- let type = "";
319
+ let type = insights_client_1.DataType.Undefined;
319
320
  switch (property.type) {
320
321
  case "long":
321
- type = "integer";
322
+ type = insights_client_1.DataType.Integer;
322
323
  break;
323
324
  default:
324
325
  type = property.type;
@@ -362,9 +363,9 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
362
363
  validator.showMessageFor("propertyName");
363
364
  } }),
364
365
  react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "Data Type", id: 'dataType', disabled: isLoading, options: [
365
- { value: "Boolean", label: "Boolean" },
366
- { value: "Number", label: "Number" },
367
- { value: "String", label: "String" },
366
+ { value: insights_client_1.DataType.Boolean, label: "Boolean" },
367
+ { value: insights_client_1.DataType.Number, label: "Number" },
368
+ { value: insights_client_1.DataType.String, label: "String" },
368
369
  ], required: true, value: dataType, onChange: (value) => {
369
370
  validator.showMessageFor("dataType");
370
371
  setDataType(value);
@@ -379,7 +380,7 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
379
380
  isLoading &&
380
381
  Array(3)
381
382
  .fill(null)
382
- .map((_, index) => (react_1.default.createElement(itwinui_react_1.Text, { key: index, variant: 'headline', isSkeleton: true }, "LOADING SKELETON"))), ecProperties === null || ecProperties === void 0 ? void 0 :
383
+ .map((_, index) => (react_1.default.createElement(itwinui_react_1.Text, { key: index, variant: 'headline', isSkeleton: true }, "LOADING SKELETON"))),
383
384
  ecProperties.map((ecProperty, index) => {
384
385
  return (react_1.default.createElement("div", { className: 'gmw-property-select-item', key: `${ecProperty.ecSchemaName}${ecProperty.ecClassName}` },
385
386
  react_1.default.createElement(itwinui_react_1.Text, { variant: 'leading' }, ecProperty.ecClassName),
@@ -391,7 +392,7 @@ const GroupPropertyAction = ({ iModelId, mappingId, groupId, groupPropertyId, gr
391
392
  updatedEcPropertyList[index] = {
392
393
  ...updatedEcPropertyList[index],
393
394
  ecPropertyName: "",
394
- ecPropertyType: "",
395
+ ecPropertyType: insights_client_1.DataType.Undefined,
395
396
  };
396
397
  setEcProperties(updatedEcPropertyList);
397
398
  }, disabled: !ecProperty.ecPropertyName && !ecProperty.ecPropertyType },
@@ -1 +1 @@
1
- {"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,oEAMoC;AACpC,wEAA4D;AAC5D,oDAA+D;AAC/D,oEAIoC;AAEpC,wDAS8B;AAC9B,+CAAyE;AACzE,gEAAwC;AACxC,sEAAwE;AACxE,mCAAoD;AACpD,sCAAoC;AAEpC,yEAAkE;AAClE,iFAAiF;AAYpE,QAAA,6BA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,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oCAClC,eAAe,CAAC,GAAG,CAAC,CAAC;gCACvB,CAAC,EACD,QAAQ,EAAE,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC;gCAE3C,8BAAC,oCAAc,OAAG,CACP,CACT,CACF,CACP,CAAC;gBACJ,CAAC,CAAC,CACO,CACP;QAEN,8BAAC,qBAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,CAC3F,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport {\n SvgChevronDown,\n SvgChevronUp,\n SvgRemove,\n} from \"@itwin/itwinui-icons-react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport {\n Alert,\n Fieldset,\n IconButton,\n LabeledInput,\n LabeledSelect,\n Select,\n Small,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, WidgetHeader } from \"./utils\";\nimport \"./GroupPropertyAction.scss\";\nimport type { ECProperty, GroupPropertyCreate, GroupPropertySingle } from \"@itwin/insights-client\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\ninterface GroupPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n groupPropertyId?: string;\n groupPropertyName?: string;\n keySet: KeySet;\n returnFn: (modified: boolean) => Promise<void>;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<string>[] = [\n { value: \"Area\", label: \"Area\" },\n { value: \"Distance\", label: \"Distance\" },\n { value: \"Force\", label: \"Force\" },\n { value: \"Mass\", label: \"Mass\" },\n { value: \"Monetary\", label: \"Monetary\" },\n { value: \"Time\", label: \"Time\" },\n { value: \"Volume\", label: \"Volume\" },\n { value: \"Undefined\", label: \"No Quantity Type\" },\n];\ninterface Property {\n name: string;\n label: string;\n type: string;\n}\n\ninterface NavigationProperty {\n navigationName: string;\n rootClassName: string;\n}\n\nconst extractPrimitive = (\n propertiesField: PropertiesField,\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n // There are rare cases which only happens in multiple selections where it returns more than one.\n // This also checks if this property comes from a navigation property\n const className =\n navigation?.rootClassName ??\n propertiesField.properties[0].property.classInfo.name;\n // Sometimes class names are not defined. Type error. Not guaranteed.\n if (!className) {\n return;\n }\n\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n // Gets property name. Appends path if from navigation.\n const propertyName = navigation\n ? `${navigation.navigationName}.${propertiesField.properties[0].property.name}`\n : propertiesField.properties[0].property.name;\n\n const label = navigation\n ? `${propertiesField.label} (${navigation?.navigationName})`\n : propertiesField.label;\n\n // Ignore hardcoded BisCore navigation properties\n if (propertiesField.type.typeName === \"navigation\") {\n return;\n } else {\n classToPropertiesMapping.get(className)?.push({\n name: propertyName,\n label,\n type: propertiesField.properties[0].property.type,\n });\n }\n};\n\nconst extractStructProperties = (\n name: string,\n className: string,\n classToPropertiesMapping: Map<string, Property[]>,\n members: StructFieldMemberDescription[]\n) => {\n for (const member of members) {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n classToPropertiesMapping.get(className)?.push({\n name: `${name}.${member.name}`,\n label: member.label,\n type: member.type.typeName,\n });\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n extractStructProperties(\n `${name}.${member.name}`,\n className,\n classToPropertiesMapping,\n member.type.members\n );\n }\n }\n};\n\nconst extractProperties = (\n properties: Field[],\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n for (const property of properties) {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n extractPrimitive(\n property as PropertiesField,\n classToPropertiesMapping,\n navigation\n );\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects. Ignore them if coming from navigation.\n if (\n !navigation &&\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const className = nestedContentField.contentClassInfo.name;\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n navigation\n );\n }\n\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const className =\n nestedContentField.pathToPrimaryClass[0].targetClassInfo.name;\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n {\n navigationName: \"TypeDefinition\",\n rootClassName: className,\n }\n );\n // Hardcoded BisCore navigation properties for the type definition.\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel (TypeDefinition)\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue (TypeDefinition)\",\n type: \"string\",\n });\n\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const className = (property as PropertiesField).properties[0]\n .property.classInfo.name;\n extractStructProperties(\n navigation\n ? `${navigation.navigationName}.${columnName}`\n : columnName,\n navigation ? navigation.rootClassName : className,\n classToPropertiesMapping,\n property.type.members\n );\n\n }\n }\n }\n }\n }\n }\n};\n\nconst GroupPropertyAction = ({\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupPropertyName,\n keySet,\n returnFn,\n}: GroupPropertyActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<string | undefined>();\n const [quantityType, setQuantityType] = useState<string>(\"Undefined\");\n const [classToPropertiesMapping, setClassToPropertiesMapping] =\n useState<Map<string, Property[]>>();\n const [ecProperties, setEcProperties] = useState<ECProperty[]>(\n []\n );\n const [validator, showValidationMessage] = useValidator();\n const [propertyAlert, setPropertyAlert] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n useEffect(() => {\n const getContent = async () => {\n setIsLoading(true);\n const ruleSet: Ruleset = {\n id: \"element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const content = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n\n // Only primitives and structs for now\n const properties =\n content?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n // Map properties to their classes\n const classToPropertiesMapping = new Map<string, Property[]>();\n\n extractProperties(properties, classToPropertiesMapping);\n\n const rootClassName = keySet.instanceKeys.keys().next().value;\n\n // Hardcoded BisCore navigation properties.\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.CodeValue\",\n label: \"Category CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.UserLabel\",\n label: \"Category UserLabel\",\n type: \"string\",\n });\n\n setClassToPropertiesMapping(classToPropertiesMapping);\n\n let newEcProperties: ECProperty[];\n // Fetch already existing ec properties then add all classes from presentation\n if (groupPropertyId) {\n const accessToken = await getAccessToken();\n let response: GroupPropertySingle | undefined;\n try {\n response = await mappingClient.getGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId\n );\n } catch (error: any) {\n handleError(error.status);\n }\n\n if (!response) {\n return;\n }\n newEcProperties = response.property?.ecProperties ?? [];\n\n let keys = Array.from(classToPropertiesMapping.keys()).reverse();\n for (const ecProperty of newEcProperties) {\n keys = keys.filter(\n (key) =>\n `${ecProperty.ecSchemaName}:${ecProperty.ecClassName}` !== key\n );\n }\n\n newEcProperties.push(\n ...keys.map((key) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n }))\n );\n\n setPropertyName(response.property?.propertyName ?? \"\");\n setDataType(response.property?.dataType ?? \"\");\n setQuantityType(response.property?.quantityType ?? \"\");\n } else {\n newEcProperties = Array.from(classToPropertiesMapping)\n .map(([key]) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n }))\n .reverse();\n }\n\n setEcProperties(newEcProperties);\n\n setIsLoading(false);\n };\n void getContent();\n }, [getAccessToken, mappingClient, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);\n\n const onSave = async () => {\n const filteredEcProperties = ecProperties.filter(\n (ecProperty) => ecProperty.ecPropertyName && ecProperty.ecPropertyType\n );\n if (!filteredEcProperties?.length || !validator.allValid()) {\n showValidationMessage(true);\n if (!filteredEcProperties?.length) {\n setPropertyAlert(true);\n }\n return;\n }\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const groupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: filteredEcProperties,\n };\n groupPropertyId\n ? await mappingClient.updateGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupProperty\n )\n : await mappingClient.createGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupProperty\n );\n await returnFn(true);\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n };\n\n const onChange = useCallback((value: string, index: number) => {\n setPropertyAlert(false);\n const property = JSON.parse(value);\n setEcProperties((ecProperties) => {\n const updatedEcProperties = [...ecProperties];\n updatedEcProperties[index].ecPropertyName = property.name;\n\n // Unique types\n let type = \"\";\n switch (property.type) {\n case \"long\":\n type = \"integer\";\n break;\n default:\n type = property.type;\n }\n\n updatedEcProperties[index].ecPropertyType = type;\n return updatedEcProperties;\n });\n }, []);\n\n const propertyOptions = useMemo(() => {\n return ecProperties.map(\n (ecProperty: ECProperty) =>\n classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.map((property) => ({\n value: JSON.stringify({\n name: property.name,\n type: property.type,\n }),\n label: property.label,\n })) ?? []\n );\n }, [classToPropertiesMapping, ecProperties]);\n\n const getValue = useCallback(\n (ecProperty: ECProperty, index: number) => {\n const property = classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.find(\n (property) => property.name === ecProperties[index].ecPropertyName\n );\n const result = JSON.stringify({\n name: property?.name,\n type: property?.type,\n });\n return result;\n },\n [classToPropertiesMapping, ecProperties]\n );\n\n return (\n <>\n <WidgetHeader\n title={groupPropertyName ?? \"Add Property\"}\n returnFn={async () => returnFn(false)}\n />\n <div className='gmw-group-property-action-container'>\n <Fieldset className='gmw-property-options' legend='Property Details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<string>\n label={\"Data Type\"}\n id='dataType'\n disabled={isLoading}\n options={[\n { value: \"Boolean\", label: \"Boolean\" },\n { value: \"Number\", label: \"Number\" },\n { value: \"String\", label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<string>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n <Fieldset className='gmw-property-selection-container' legend='Properties'>\n {propertyAlert && (\n <Alert type={\"negative\"}>\n Please select at least one property.\n </Alert>\n )}\n {isLoading &&\n Array(3)\n .fill(null)\n .map((_, index) => (\n <Text key={index} variant='headline' isSkeleton>\n LOADING SKELETON\n </Text>\n ))}\n {ecProperties?.map((ecProperty, index) => {\n return (\n <div\n className='gmw-property-select-item'\n key={`${ecProperty.ecSchemaName}${ecProperty.ecClassName}`}\n >\n <Text variant='leading'>{ecProperty.ecClassName}</Text>\n <Text isMuted variant='small'>\n {ecProperty.ecSchemaName}\n </Text>\n\n <div className='gmw-selection-and-reorder'>\n <Select<string>\n options={propertyOptions[index]}\n value={getValue(ecProperty, index)}\n onChange={(value) => { value && onChange(value, index); }}\n placeholder=\"<No Property Mapped>\"\n style={{ width: \"100%\" }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <IconButton\n onClick={() => {\n const updatedEcPropertyList = [...ecProperties];\n updatedEcPropertyList[index] = {\n ...updatedEcPropertyList[index],\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n };\n setEcProperties(updatedEcPropertyList);\n }}\n disabled={\n !ecProperty.ecPropertyName && !ecProperty.ecPropertyType\n }\n >\n <SvgRemove />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index - 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === 0}\n >\n <SvgChevronUp />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index + 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === ecProperties.length - 1}\n >\n <SvgChevronDown />\n </IconButton>\n </div>\n </div>\n );\n })}\n </Fieldset>\n </div>\n {/* TODO: Disable when no properties are selected. Will do when I rework property selection. */}\n <ActionPanel onSave={onSave} onCancel={async () => returnFn(false)} isLoading={isLoading} />\n </>\n );\n};\n\nexport default GroupPropertyAction;\n"]}
1
+ {"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,oEAMoC;AACpC,wEAA4D;AAC5D,oDAA+D;AAC/D,oEAIoC;AAEpC,wDAS8B;AAC9B,+CAAyE;AACzE,gEAAwC;AACxC,sEAAwE;AACxE,mCAAoD;AACpD,sCAAoC;AAEpC,4DAAgE;AAChE,yEAAkE;AAClE,iFAAiF;AAYpE,QAAA,6BAA6B,GAAiC;IACzE,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7C,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC/C,EAAE,KAAK,EAAE,8BAA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AG1D,8BAAC,+BAAS,OAAG,CACF;4BACb,8BAAC,0BAAU,IACT,OAAO,EAAE,GAAG,EAAE;oCACZ,MAAM,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;oCAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oCAClC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oCAClC,eAAe,CAAC,GAAG,CAAC,CAAC;gCACvB,CAAC,EACD,QAAQ,EAAE,KAAK,KAAK,CAAC;gCAErB,8BAAC,kCAAY,OAAG,CACL;4BACb,8BAAC,0BAAU,IACT,OAAO,EAAE,GAAG,EAAE;oCACZ,MAAM,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;oCAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oCAClC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oCAClC,eAAe,CAAC,GAAG,CAAC,CAAC;gCACvB,CAAC,EACD,QAAQ,EAAE,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC;gCAE3C,8BAAC,oCAAc,OAAG,CACP,CACT,CACF,CACP,CAAC;gBACJ,CAAC,CAAC,CACO,CACP;QAEN,8BAAC,qBAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,CAC3F,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport {\n SvgChevronDown,\n SvgChevronUp,\n SvgRemove,\n} from \"@itwin/itwinui-icons-react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport {\n Alert,\n Fieldset,\n IconButton,\n LabeledInput,\n LabeledSelect,\n Select,\n Small,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, WidgetHeader } from \"./utils\";\nimport \"./GroupPropertyAction.scss\";\nimport type { ECProperty, GroupProperty, GroupPropertyCreate} from \"@itwin/insights-client\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\ninterface GroupPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n groupPropertyId?: string;\n groupPropertyName?: string;\n keySet: KeySet;\n returnFn: (modified: boolean) => Promise<void>;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<QuantityType>[] = [\n { value: QuantityType.Area, label: \"Area\" },\n { value: QuantityType.Distance, label: \"Distance\" },\n { value: QuantityType.Force, label: \"Force\" },\n { value: QuantityType.Mass, label: \"Mass\" },\n { value: QuantityType.Monetary, label: \"Monetary\" },\n { value: QuantityType.Time, label: \"Time\" },\n { value: QuantityType.Volume, label: \"Volume\" },\n { value: QuantityType.Undefined, label: \"No Quantity Type\" },\n];\ninterface Property {\n name: string;\n label: string;\n type: string;\n}\n\ninterface NavigationProperty {\n navigationName: string;\n rootClassName: string;\n}\n\nconst extractPrimitive = (\n propertiesField: PropertiesField,\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n // There are rare cases which only happens in multiple selections where it returns more than one.\n // This also checks if this property comes from a navigation property\n const className =\n navigation?.rootClassName ??\n propertiesField.properties[0].property.classInfo.name;\n // Sometimes class names are not defined. Type error. Not guaranteed.\n if (!className) {\n return;\n }\n\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n // Gets property name. Appends path if from navigation.\n const propertyName = navigation\n ? `${navigation.navigationName}.${propertiesField.properties[0].property.name}`\n : propertiesField.properties[0].property.name;\n\n const label = navigation\n ? `${propertiesField.label} (${navigation?.navigationName})`\n : propertiesField.label;\n\n // Ignore hardcoded BisCore navigation properties\n if (propertiesField.type.typeName === \"navigation\") {\n return;\n } else {\n classToPropertiesMapping.get(className)?.push({\n name: propertyName,\n label,\n type: propertiesField.properties[0].property.type,\n });\n }\n};\n\nconst extractStructProperties = (\n name: string,\n className: string,\n classToPropertiesMapping: Map<string, Property[]>,\n members: StructFieldMemberDescription[]\n) => {\n for (const member of members) {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n classToPropertiesMapping.get(className)?.push({\n name: `${name}.${member.name}`,\n label: member.label,\n type: member.type.typeName,\n });\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n extractStructProperties(\n `${name}.${member.name}`,\n className,\n classToPropertiesMapping,\n member.type.members\n );\n }\n }\n};\n\nconst extractProperties = (\n properties: Field[],\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n for (const property of properties) {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n extractPrimitive(\n property as PropertiesField,\n classToPropertiesMapping,\n navigation\n );\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects. Ignore them if coming from navigation.\n if (\n !navigation &&\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const className = nestedContentField.contentClassInfo.name;\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n navigation\n );\n }\n\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const className =\n nestedContentField.pathToPrimaryClass[0].targetClassInfo.name;\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n {\n navigationName: \"TypeDefinition\",\n rootClassName: className,\n }\n );\n // Hardcoded BisCore navigation properties for the type definition.\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel (TypeDefinition)\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue (TypeDefinition)\",\n type: \"string\",\n });\n\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const className = (property as PropertiesField).properties[0]\n .property.classInfo.name;\n extractStructProperties(\n navigation\n ? `${navigation.navigationName}.${columnName}`\n : columnName,\n navigation ? navigation.rootClassName : className,\n classToPropertiesMapping,\n property.type.members\n );\n\n }\n }\n }\n }\n }\n }\n};\n\nconst GroupPropertyAction = ({\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupPropertyName,\n keySet,\n returnFn,\n}: GroupPropertyActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(DataType.Undefined);\n const [quantityType, setQuantityType] = useState<QuantityType>(QuantityType.Undefined);\n const [classToPropertiesMapping, setClassToPropertiesMapping] =\n useState<Map<string, Property[]>>();\n const [ecProperties, setEcProperties] = useState<ECProperty[]>(\n []\n );\n const [validator, showValidationMessage] = useValidator();\n const [propertyAlert, setPropertyAlert] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n useEffect(() => {\n const getContent = async () => {\n setIsLoading(true);\n const ruleSet: Ruleset = {\n id: \"element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const content = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n\n // Only primitives and structs for now\n const properties =\n content?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n // Map properties to their classes\n const classToPropertiesMapping = new Map<string, Property[]>();\n\n extractProperties(properties, classToPropertiesMapping);\n\n const rootClassName = keySet.instanceKeys.keys().next().value;\n\n // Hardcoded BisCore navigation properties.\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.CodeValue\",\n label: \"Category CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.UserLabel\",\n label: \"Category UserLabel\",\n type: \"string\",\n });\n\n setClassToPropertiesMapping(classToPropertiesMapping);\n\n let newEcProperties: ECProperty[];\n // Fetch already existing ec properties then add all classes from presentation\n if (groupPropertyId) {\n const accessToken = await getAccessToken();\n let response: GroupProperty | undefined;\n try {\n response = await mappingClient.getGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId\n );\n } catch (error: any) {\n handleError(error.status);\n }\n\n if (!response) {\n return;\n }\n newEcProperties = response.ecProperties;\n\n let keys = Array.from(classToPropertiesMapping.keys()).reverse();\n for (const ecProperty of newEcProperties) {\n keys = keys.filter(\n (key) =>\n `${ecProperty.ecSchemaName}:${ecProperty.ecClassName}` !== key\n );\n }\n\n newEcProperties.push(\n ...keys.map((key) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: DataType.Undefined,\n }))\n );\n\n setPropertyName(response.propertyName);\n setDataType(response.dataType);\n setQuantityType(response.quantityType);\n } else {\n newEcProperties = Array.from(classToPropertiesMapping)\n .map(([key]) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: DataType.Undefined,\n }))\n .reverse();\n }\n\n setEcProperties(newEcProperties);\n\n setIsLoading(false);\n };\n void getContent();\n }, [getAccessToken, mappingClient, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);\n\n const onSave = async () => {\n const filteredEcProperties = ecProperties.filter(\n (ecProperty) => ecProperty.ecPropertyName && ecProperty.ecPropertyType\n );\n if (!filteredEcProperties.length || !validator.allValid()) {\n showValidationMessage(true);\n if (!filteredEcProperties.length) {\n setPropertyAlert(true);\n }\n return;\n }\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const groupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: filteredEcProperties,\n };\n groupPropertyId\n ? await mappingClient.updateGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupProperty\n )\n : await mappingClient.createGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupProperty\n );\n await returnFn(true);\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n };\n\n const onChange = useCallback((value: string, index: number) => {\n setPropertyAlert(false);\n const property = JSON.parse(value);\n setEcProperties((ecProperties) => {\n const updatedEcProperties = [...ecProperties];\n updatedEcProperties[index].ecPropertyName = property.name;\n\n // Unique types\n let type = DataType.Undefined;\n switch (property.type) {\n case \"long\":\n type = DataType.Integer;\n break;\n default:\n type = property.type;\n }\n\n updatedEcProperties[index].ecPropertyType = type;\n return updatedEcProperties;\n });\n }, []);\n\n const propertyOptions = useMemo(() => {\n return ecProperties.map(\n (ecProperty: ECProperty) =>\n classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.map((property) => ({\n value: JSON.stringify({\n name: property.name,\n type: property.type,\n }),\n label: property.label,\n })) ?? []\n );\n }, [classToPropertiesMapping, ecProperties]);\n\n const getValue = useCallback(\n (ecProperty: ECProperty, index: number) => {\n const property = classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.find(\n (property) => property.name === ecProperties[index].ecPropertyName\n );\n const result = JSON.stringify({\n name: property?.name,\n type: property?.type,\n });\n return result;\n },\n [classToPropertiesMapping, ecProperties]\n );\n\n return (\n <>\n <WidgetHeader\n title={groupPropertyName ?? \"Add Property\"}\n returnFn={async () => returnFn(false)}\n />\n <div className='gmw-group-property-action-container'>\n <Fieldset className='gmw-property-options' legend='Property Details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={\"Data Type\"}\n id='dataType'\n disabled={isLoading}\n options={[\n { value: DataType.Boolean, label: \"Boolean\" },\n { value: DataType.Number, label: \"Number\" },\n { value: DataType.String, label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n <Fieldset className='gmw-property-selection-container' legend='Properties'>\n {propertyAlert && (\n <Alert type={\"negative\"}>\n Please select at least one property.\n </Alert>\n )}\n {isLoading &&\n Array(3)\n .fill(null)\n .map((_, index) => (\n <Text key={index} variant='headline' isSkeleton>\n LOADING SKELETON\n </Text>\n ))}\n {ecProperties.map((ecProperty, index) => {\n return (\n <div\n className='gmw-property-select-item'\n key={`${ecProperty.ecSchemaName}${ecProperty.ecClassName}`}\n >\n <Text variant='leading'>{ecProperty.ecClassName}</Text>\n <Text isMuted variant='small'>\n {ecProperty.ecSchemaName}\n </Text>\n\n <div className='gmw-selection-and-reorder'>\n <Select<string>\n options={propertyOptions[index]}\n value={getValue(ecProperty, index)}\n onChange={(value) => { value && onChange(value, index); }}\n placeholder=\"<No Property Mapped>\"\n style={{ width: \"100%\" }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <IconButton\n onClick={() => {\n const updatedEcPropertyList = [...ecProperties];\n updatedEcPropertyList[index] = {\n ...updatedEcPropertyList[index],\n ecPropertyName: \"\",\n ecPropertyType: DataType.Undefined,\n };\n setEcProperties(updatedEcPropertyList);\n }}\n disabled={\n !ecProperty.ecPropertyName && !ecProperty.ecPropertyType\n }\n >\n <SvgRemove />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index - 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === 0}\n >\n <SvgChevronUp />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index + 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === ecProperties.length - 1}\n >\n <SvgChevronDown />\n </IconButton>\n </div>\n </div>\n );\n })}\n </Fieldset>\n </div>\n {/* TODO: Disable when no properties are selected. Will do when I rework property selection. */}\n <ActionPanel onSave={onSave} onCancel={async () => returnFn(false)} isLoading={isLoading} />\n </>\n );\n};\n\nexport default GroupPropertyAction;\n"]}
@@ -3,18 +3,18 @@ import type { CreateTypeFromInterface } from "../utils";
3
3
  import type { CellProps } from "react-table";
4
4
  import { PropertyMenuView } from "./PropertyMenu";
5
5
  import type { GroupProperty } from "@itwin/insights-client";
6
- export declare type GroupPropertyType = CreateTypeFromInterface<GroupProperty>;
6
+ export declare type IGroupPropertyTyped = CreateTypeFromInterface<GroupProperty>;
7
7
  interface GroupPropertyTableProps {
8
8
  iModelId: string;
9
9
  mappingId: string;
10
10
  groupId: string;
11
- setSelectedGroupProperty: React.Dispatch<React.SetStateAction<CreateTypeFromInterface<GroupPropertyType> | undefined>>;
11
+ setSelectedGroupProperty: React.Dispatch<React.SetStateAction<IGroupPropertyTyped | undefined>>;
12
12
  setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;
13
- onGroupPropertyModify: (value: CellProps<GroupPropertyType>) => void;
13
+ onGroupPropertyModify: (value: CellProps<IGroupPropertyTyped>) => void;
14
14
  isLoadingGroupProperties: boolean;
15
- groupProperties: GroupPropertyType[];
15
+ groupProperties: IGroupPropertyTyped[];
16
16
  refreshGroupProperties: () => Promise<void>;
17
- selectedGroupProperty?: GroupPropertyType;
17
+ selectedGroupProperty?: IGroupPropertyTyped;
18
18
  }
19
19
  declare const GroupPropertyTable: ({ iModelId, mappingId, groupId, selectedGroupProperty, onGroupPropertyModify, setSelectedGroupProperty, isLoadingGroupProperties, groupProperties, refreshGroupProperties, setGroupModifyView, }: GroupPropertyTableProps) => JSX.Element;
20
20
  export default GroupPropertyTable;
@@ -1 +1 @@
1
- {"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAKoC;AACpC,wDAM8B;AAC9B,+CAAiD;AAGjD,gEAAwC;AACxC,iDAAkD;AAElD,iFAAiF;AACjF,yEAAkE;AAiBlE,MAAM,kBAAkB,GAAG,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACM,EAAE,EAAE;;IAC5B,MAAM,E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,YAAY;gCAChC,8BAAC,6BAAO,IACN,KAAK,EAAE;wCACL,KAAK,EAAE,MAAM;wCACb,MAAM,EAAE,MAAM;qCACf,GACD,CACS,CACA,CAChB,CAAC;oBACJ,CAAC;iBACF;aACF;SACF;KACF,EACD,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAClD,CAAC;IAEF,OAAO,CACL;QACE,8BAAC,sBAAM,IACL,SAAS,EAAE,8BAAC,4BAAM,OAAG,EACrB,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE;gBACZ,kBAAkB,CAAC,+BAAgB,CAAC,kBAAkB,CAAC,CAAC;YAC1D,CAAC,mBAGM;QACT,8BAAC,qBAAK,IACJ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAC,iBAAiB,EACzB,OAAO,EAAE,sBAAsB,EAC/B,iBAAiB,EAAC,qBAAqB,EACvC,UAAU,QACV,SAAS,EAAE,wBAAwB,GACnC;QACF,8BAAC,qBAAW,IACV,UAAU,EAAE,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,YAAY,mCAAI,EAAE,EACrD,IAAI,EAAE,4BAA4B,EAClC,OAAO,EAAE,+BAA+B,EACxC,QAAQ,EAAE,KAAK,IAAI,EAAE;;gBACnB,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;gBAC3C,MAAM,aAAa,CAAC,mBAAmB,CACrC,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,EAAE,mCAAI,EAAE,CAChC,CAAC;YACJ,CAAC,EACD,OAAO,EAAE,sBAAsB,GAC/B,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport {\n SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n Table,\n} from \"@itwin/itwinui-react\";\nimport React, { useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport type { CellProps } from \"react-table\";\nimport DeleteModal from \"./DeleteModal\";\nimport { PropertyMenuView } from \"./PropertyMenu\";\nimport type { GroupProperty } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\n\nexport type GroupPropertyType = CreateTypeFromInterface<GroupProperty>;\n\ninterface GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n setSelectedGroupProperty: React.Dispatch<React.SetStateAction<CreateTypeFromInterface<GroupPropertyType> | undefined>>;\n setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;\n onGroupPropertyModify: (value: CellProps<GroupPropertyType>) => void;\n isLoadingGroupProperties: boolean;\n groupProperties: GroupPropertyType[];\n refreshGroupProperties: () => Promise<void>;\n selectedGroupProperty?: GroupPropertyType;\n}\n\nconst GroupPropertyTable = ({\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty,\n onGroupPropertyModify,\n setSelectedGroupProperty,\n isLoadingGroupProperties,\n groupProperties,\n refreshGroupProperties,\n setGroupModifyView,\n}: GroupPropertyTableProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [showGroupPropertyDeleteModal, setShowGroupPropertyDeleteModal] =\n useState<boolean>(false);\n\n const groupPropertiesColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"propertyName\",\n Header: \"Property\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<GroupPropertyType>) => (\n <div\n className='iui-anchor'\n onClick={() => onGroupPropertyModify(value)}\n >\n {value.row.original.propertyName}\n </div>\n ),\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<GroupPropertyType>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onGroupPropertyModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => {\n setSelectedGroupProperty(value.row.original);\n setShowGroupPropertyDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton styleType='borderless'>\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n },\n ],\n [onGroupPropertyModify, setSelectedGroupProperty],\n );\n\n return (\n <>\n <Button\n startIcon={<SvgAdd />}\n styleType='high-visibility'\n onClick={() => {\n setGroupModifyView(PropertyMenuView.ADD_GROUP_PROPERTY);\n }}\n >\n Add Property\n </Button>\n <Table<GroupPropertyType>\n data={groupProperties}\n density='extra-condensed'\n columns={groupPropertiesColumns}\n emptyTableContent='No Group Properties'\n isSortable\n isLoading={isLoadingGroupProperties}\n />\n <DeleteModal\n entityName={selectedGroupProperty?.propertyName ?? \"\"}\n show={showGroupPropertyDeleteModal}\n setShow={setShowGroupPropertyDeleteModal}\n onDelete={async () => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty?.id ?? \"\",\n );\n }}\n refresh={refreshGroupProperties}\n />\n </>\n );\n};\n\nexport default GroupPropertyTable;\n"]}
1
+ {"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAKoC;AACpC,wDAM8B;AAC9B,+CAAiD;AAGjD,gEAAwC;AACxC,iDAAkD;AAElD,iFA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C,EACD,OAAO,EAAE,sBAAsB,GAC/B,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport {\n SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n Table,\n} from \"@itwin/itwinui-react\";\nimport React, { useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport type { CellProps } from \"react-table\";\nimport DeleteModal from \"./DeleteModal\";\nimport { PropertyMenuView } from \"./PropertyMenu\";\nimport type { GroupProperty } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\n\nexport type IGroupPropertyTyped = CreateTypeFromInterface<GroupProperty>;\n\ninterface GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n setSelectedGroupProperty: React.Dispatch<React.SetStateAction<IGroupPropertyTyped | undefined>>;\n setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;\n onGroupPropertyModify: (value: CellProps<IGroupPropertyTyped>) => void;\n isLoadingGroupProperties: boolean;\n groupProperties: IGroupPropertyTyped[];\n refreshGroupProperties: () => Promise<void>;\n selectedGroupProperty?: IGroupPropertyTyped;\n}\n\nconst GroupPropertyTable = ({\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty,\n onGroupPropertyModify,\n setSelectedGroupProperty,\n isLoadingGroupProperties,\n groupProperties,\n refreshGroupProperties,\n setGroupModifyView,\n}: GroupPropertyTableProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [showGroupPropertyDeleteModal, setShowGroupPropertyDeleteModal] =\n useState<boolean>(false);\n\n const groupPropertiesColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"propertyName\",\n Header: \"Property\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<IGroupPropertyTyped>) => (\n <div\n className='iui-anchor'\n onClick={() => onGroupPropertyModify(value)}\n >\n {value.row.original.propertyName}\n </div>\n ),\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<IGroupPropertyTyped>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onGroupPropertyModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => {\n setSelectedGroupProperty(value.row.original);\n setShowGroupPropertyDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton styleType='borderless'>\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n },\n ],\n [onGroupPropertyModify, setSelectedGroupProperty],\n );\n\n return (\n <>\n <Button\n startIcon={<SvgAdd />}\n styleType='high-visibility'\n onClick={() => {\n setGroupModifyView(PropertyMenuView.ADD_GROUP_PROPERTY);\n }}\n >\n Add Property\n </Button>\n <Table<IGroupPropertyTyped>\n data={groupProperties}\n density='extra-condensed'\n columns={groupPropertiesColumns}\n emptyTableContent='No Group Properties'\n isSortable\n isLoading={isLoadingGroupProperties}\n />\n <DeleteModal\n entityName={selectedGroupProperty?.propertyName ?? \"\"}\n show={showGroupPropertyDeleteModal}\n setShow={setShowGroupPropertyDeleteModal}\n onDelete={async () => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty?.id ?? \"\",\n );\n }}\n refresh={refreshGroupProperties}\n />\n </>\n );\n};\n\nexport default GroupPropertyTable;\n"]}
@@ -2,7 +2,7 @@
2
2
  import type { CreateTypeFromInterface } from "../utils";
3
3
  import "./Grouping.scss";
4
4
  import type { Group, Mapping } from "@itwin/insights-client";
5
- export declare type GroupType = CreateTypeFromInterface<Group>;
5
+ export declare type IGroupTyped = CreateTypeFromInterface<Group>;
6
6
  interface GroupsTreeProps {
7
7
  mapping: Mapping;
8
8
  goBack: () => Promise<void>;