synapse-react-client 4.0.35 → 4.0.36

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 (260) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +24 -0
  3. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -0
  4. package/dist/aridhia-queries/AridhiaKeyFactory.js +49 -0
  5. package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -0
  6. package/dist/aridhia-queries/FairFormPayload.d.ts +45 -0
  7. package/dist/aridhia-queries/FairFormPayload.d.ts.map +1 -0
  8. package/dist/aridhia-queries/FairFormPayload.js +0 -0
  9. package/dist/aridhia-queries/TransferType.d.ts +10 -0
  10. package/dist/aridhia-queries/TransferType.d.ts.map +1 -0
  11. package/dist/aridhia-queries/TransferType.js +0 -0
  12. package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
  13. package/dist/aridhia-queries/index.d.ts +12 -0
  14. package/dist/aridhia-queries/index.d.ts.map +1 -1
  15. package/dist/aridhia-queries/index.js +12 -2
  16. package/dist/aridhia-queries/useAridhiaQuery.d.ts +37 -0
  17. package/dist/aridhia-queries/useAridhiaQuery.d.ts.map +1 -0
  18. package/dist/aridhia-queries/useAridhiaQuery.js +71 -0
  19. package/dist/aridhia-queries/useAridhiaQuery.js.map +1 -0
  20. package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.d.ts +6 -0
  21. package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.d.ts.map +1 -0
  22. package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.js +13 -0
  23. package/dist/aridhia-queries/useGetAridhiaDatasetCatalogue.js.map +1 -0
  24. package/dist/aridhia-queries/useGetAridhiaDatasetSettings.d.ts +6 -0
  25. package/dist/aridhia-queries/useGetAridhiaDatasetSettings.d.ts.map +1 -0
  26. package/dist/aridhia-queries/useGetAridhiaDatasetSettings.js +13 -0
  27. package/dist/aridhia-queries/useGetAridhiaDatasetSettings.js.map +1 -0
  28. package/dist/aridhia-queries/useGetAridhiaDictionaries.d.ts +6 -0
  29. package/dist/aridhia-queries/useGetAridhiaDictionaries.d.ts.map +1 -0
  30. package/dist/aridhia-queries/useGetAridhiaDictionaries.js +13 -0
  31. package/dist/aridhia-queries/useGetAridhiaDictionaries.js.map +1 -0
  32. package/dist/aridhia-queries/useGetAridhiaRequests.d.ts +5 -4
  33. package/dist/aridhia-queries/useGetAridhiaRequests.d.ts.map +1 -1
  34. package/dist/aridhia-queries/useGetAridhiaRequests.js +11 -18
  35. package/dist/aridhia-queries/useGetAridhiaRequests.js.map +1 -1
  36. package/dist/aridhia-queries/useGetAridhiaWorkflow.d.ts +13 -0
  37. package/dist/aridhia-queries/useGetAridhiaWorkflow.d.ts.map +1 -0
  38. package/dist/aridhia-queries/useGetAridhiaWorkflow.js +19 -0
  39. package/dist/aridhia-queries/useGetAridhiaWorkflow.js.map +1 -0
  40. package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.d.ts +6 -0
  41. package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.d.ts.map +1 -0
  42. package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.js +13 -0
  43. package/dist/aridhia-queries/useGetAridhiaWorkspaceLocations.js.map +1 -0
  44. package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.d.ts +19 -0
  45. package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.d.ts.map +1 -0
  46. package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.js +17 -0
  47. package/dist/aridhia-queries/useGetAridhiaWorkspaceRequestForm.js.map +1 -0
  48. package/dist/aridhia-queries/useGetAridhiaWorkspaces.d.ts +6 -0
  49. package/dist/aridhia-queries/useGetAridhiaWorkspaces.d.ts.map +1 -0
  50. package/dist/aridhia-queries/useGetAridhiaWorkspaces.js +19 -0
  51. package/dist/aridhia-queries/useGetAridhiaWorkspaces.js.map +1 -0
  52. package/dist/aridhia-queries/useSubmitAridhiaDar.d.ts +27 -0
  53. package/dist/aridhia-queries/useSubmitAridhiaDar.d.ts.map +1 -0
  54. package/dist/aridhia-queries/useSubmitAridhiaDar.js +38 -0
  55. package/dist/aridhia-queries/useSubmitAridhiaDar.js.map +1 -0
  56. package/dist/components/AccessRequirement/EntityActionsRequired.d.ts +0 -1
  57. package/dist/components/AccessRequirement/EntityActionsRequired.d.ts.map +1 -1
  58. package/dist/components/AccessRequirement/EntityActionsRequired.js +3 -6
  59. package/dist/components/AccessRequirement/EntityActionsRequired.js.map +1 -1
  60. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
  61. package/dist/components/AccessRequirementList/AccessRequirementList.js +116 -115
  62. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  63. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
  64. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +67 -57
  65. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
  66. package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts +3 -3
  67. package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts.map +1 -1
  68. package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +1 -1
  69. package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
  70. package/dist/components/CardContainer/CardConfiguration.d.ts +8 -0
  71. package/dist/components/CardContainer/CardConfiguration.d.ts.map +1 -1
  72. package/dist/components/ChangePassword/ChangePasswordWithToken.d.ts.map +1 -1
  73. package/dist/components/ChangePassword/ChangePasswordWithToken.js +58 -23
  74. package/dist/components/ChangePassword/ChangePasswordWithToken.js.map +1 -1
  75. package/dist/components/ChangePassword/useChangePasswordFormState.d.ts.map +1 -1
  76. package/dist/components/ChangePassword/useChangePasswordFormState.js +13 -3
  77. package/dist/components/ChangePassword/useChangePasswordFormState.js.map +1 -1
  78. package/dist/components/CreateTableViewWizard/TableNameForm.d.ts.map +1 -1
  79. package/dist/components/CreateTableViewWizard/TableNameForm.js +11 -14
  80. package/dist/components/CreateTableViewWizard/TableNameForm.js.map +1 -1
  81. package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts +1 -1
  82. package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
  83. package/dist/components/DataGrid/SyncGridWithSourceButton.js +55 -61
  84. package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
  85. package/dist/components/DataGrid/components/contextMenu.d.ts.map +1 -1
  86. package/dist/components/DataGrid/components/contextMenu.js +15 -15
  87. package/dist/components/DataGrid/components/contextMenu.js.map +1 -1
  88. package/dist/components/DataGrid/useMergeGridWithSource.d.ts +1 -5
  89. package/dist/components/DataGrid/useMergeGridWithSource.d.ts.map +1 -1
  90. package/dist/components/DataGrid/useMergeGridWithSource.js +21 -28
  91. package/dist/components/DataGrid/useMergeGridWithSource.js.map +1 -1
  92. package/dist/components/DatasetHosting/DatasetDownloadButton.d.ts +35 -0
  93. package/dist/components/DatasetHosting/DatasetDownloadButton.d.ts.map +1 -0
  94. package/dist/components/DatasetHosting/DatasetDownloadButton.js +132 -0
  95. package/dist/components/DatasetHosting/DatasetDownloadButton.js.map +1 -0
  96. package/dist/components/DatasetHosting/DatasetHosting.d.ts +91 -0
  97. package/dist/components/DatasetHosting/DatasetHosting.d.ts.map +1 -0
  98. package/dist/components/DatasetHosting/DatasetHosting.js +58 -0
  99. package/dist/components/DatasetHosting/DatasetHosting.js.map +1 -0
  100. package/dist/components/DatasetHosting/index.d.ts +5 -0
  101. package/dist/components/DatasetHosting/index.d.ts.map +1 -0
  102. package/dist/components/DatasetHosting/index.js +3 -0
  103. package/dist/components/DownloadCart/ActionRequiredListItem.d.ts +0 -2
  104. package/dist/components/DownloadCart/ActionRequiredListItem.d.ts.map +1 -1
  105. package/dist/components/DownloadCart/ActionRequiredListItem.js +2 -3
  106. package/dist/components/DownloadCart/ActionRequiredListItem.js.map +1 -1
  107. package/dist/components/DownloadCart/DownloadCartPage.d.ts +1 -2
  108. package/dist/components/DownloadCart/DownloadCartPage.d.ts.map +1 -1
  109. package/dist/components/DownloadCart/DownloadCartPage.js +49 -49
  110. package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
  111. package/dist/components/DownloadCart/DownloadListActionsRequired.d.ts +1 -5
  112. package/dist/components/DownloadCart/DownloadListActionsRequired.d.ts.map +1 -1
  113. package/dist/components/DownloadCart/DownloadListActionsRequired.js +5 -6
  114. package/dist/components/DownloadCart/DownloadListActionsRequired.js.map +1 -1
  115. package/dist/components/DownloadCart/RequestDownloadCard.d.ts +0 -2
  116. package/dist/components/DownloadCart/RequestDownloadCard.d.ts.map +1 -1
  117. package/dist/components/DownloadCart/RequestDownloadCard.js +28 -32
  118. package/dist/components/DownloadCart/RequestDownloadCard.js.map +1 -1
  119. package/dist/components/DownloadCart/TableQueryActionsRequired.d.ts +0 -2
  120. package/dist/components/DownloadCart/TableQueryActionsRequired.d.ts.map +1 -1
  121. package/dist/components/DownloadCart/TableQueryActionsRequired.js +7 -8
  122. package/dist/components/DownloadCart/TableQueryActionsRequired.js.map +1 -1
  123. package/dist/components/DownloadCart/index.d.ts +1 -2
  124. package/dist/components/DownloadCart/index.d.ts.map +1 -1
  125. package/dist/components/GenericCard/CardActionButtonStyleContext.d.ts +10 -0
  126. package/dist/components/GenericCard/CardActionButtonStyleContext.d.ts.map +1 -0
  127. package/dist/components/GenericCard/CardActionButtonStyleContext.js +10 -0
  128. package/dist/components/GenericCard/CardActionButtonStyleContext.js.map +1 -0
  129. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +41 -41
  130. package/dist/components/GenericCard/GenericCardActionButton.d.ts +5 -0
  131. package/dist/components/GenericCard/GenericCardActionButton.d.ts.map +1 -1
  132. package/dist/components/GenericCard/GenericCardActionButton.js +28 -11
  133. package/dist/components/GenericCard/GenericCardActionButton.js.map +1 -1
  134. package/dist/components/GenericCard/TableRowGenericCard.d.ts +24 -0
  135. package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
  136. package/dist/components/GenericCard/TableRowGenericCard.js +205 -190
  137. package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
  138. package/dist/components/JSONArrayEditor/JSONArrayEditor.d.ts.map +1 -1
  139. package/dist/components/JSONArrayEditor/JSONArrayEditor.js +42 -42
  140. package/dist/components/JSONArrayEditor/JSONArrayEditor.js.map +1 -1
  141. package/dist/components/JsonSchemaForm/JsonSchemaForm.css +1 -0
  142. package/dist/components/JsonSchemaForm/JsonSchemaForm.d.ts.map +1 -1
  143. package/dist/components/JsonSchemaForm/JsonSchemaForm.js +13 -12
  144. package/dist/components/JsonSchemaForm/JsonSchemaForm.js.map +1 -1
  145. package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js +5 -0
  146. package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js.map +1 -0
  147. package/dist/components/JsonSchemaForm/JsonSchemaForm.module.scss +109 -0
  148. package/dist/components/QueryBuilder/QueryBuilderTypes.d.ts +39 -0
  149. package/dist/components/QueryBuilder/QueryBuilderTypes.d.ts.map +1 -0
  150. package/dist/components/QueryBuilder/QueryBuilderTypes.js +11 -0
  151. package/dist/components/QueryBuilder/QueryBuilderTypes.js.map +1 -0
  152. package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +48 -0
  153. package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -0
  154. package/dist/components/QueryBuilder/queryBuilderTranslation.js +256 -0
  155. package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -0
  156. package/dist/components/QueryContext/QueryContext.d.ts +0 -1
  157. package/dist/components/QueryContext/QueryContext.d.ts.map +1 -1
  158. package/dist/components/QueryContext/QueryContext.js.map +1 -1
  159. package/dist/components/QueryWrapper/QueryWrapper.d.ts +0 -1
  160. package/dist/components/QueryWrapper/QueryWrapper.d.ts.map +1 -1
  161. package/dist/components/QueryWrapper/QueryWrapper.js +52 -53
  162. package/dist/components/QueryWrapper/QueryWrapper.js.map +1 -1
  163. package/dist/components/QueryWrapperErrorBoundary.d.ts.map +1 -1
  164. package/dist/components/QueryWrapperErrorBoundary.js +4 -11
  165. package/dist/components/QueryWrapperErrorBoundary.js.map +1 -1
  166. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +0 -1
  167. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
  168. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
  169. package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.js +123 -123
  170. package/dist/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.js.map +1 -1
  171. package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts.map +1 -1
  172. package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js +0 -1
  173. package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js.map +1 -1
  174. package/dist/components/ShareThisPage/ShareThisPage.js +30 -29
  175. package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
  176. package/dist/components/SynapseChat/GridAgentChat.d.ts.map +1 -1
  177. package/dist/components/SynapseChat/GridAgentChat.js +29 -31
  178. package/dist/components/SynapseChat/GridAgentChat.js.map +1 -1
  179. package/dist/components/SynapseTable/SynapseTable.d.ts.map +1 -1
  180. package/dist/components/SynapseTable/SynapseTable.js +2 -1
  181. package/dist/components/SynapseTable/SynapseTable.js.map +1 -1
  182. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.d.ts.map +1 -1
  183. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js +29 -30
  184. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js.map +1 -1
  185. package/dist/components/TanStackTable/StyledTanStackTable.d.ts +7 -0
  186. package/dist/components/TanStackTable/StyledTanStackTable.d.ts.map +1 -1
  187. package/dist/components/TanStackTable/StyledTanStackTable.js +68 -48
  188. package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
  189. package/dist/components/TanStackTable/useSyncedTopScrollbar.d.ts +13 -0
  190. package/dist/components/TanStackTable/useSyncedTopScrollbar.d.ts.map +1 -0
  191. package/dist/components/TanStackTable/useSyncedTopScrollbar.js +32 -0
  192. package/dist/components/TanStackTable/useSyncedTopScrollbar.js.map +1 -0
  193. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
  194. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +36 -34
  195. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
  196. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +1 -1
  197. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
  198. package/dist/components/doi/CreateOrUpdateDoiModal.d.ts.map +1 -1
  199. package/dist/components/doi/CreateOrUpdateDoiModal.js +10 -13
  200. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  201. package/dist/components/index.d.ts +1 -0
  202. package/dist/components/index.d.ts.map +1 -1
  203. package/dist/components/index.js +143 -140
  204. package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
  205. package/dist/components/menu/DropdownMenu.js +6 -6
  206. package/dist/components/menu/DropdownMenu.js.map +1 -1
  207. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +5 -5
  208. package/dist/index.js +161 -159
  209. package/dist/index.js.map +1 -1
  210. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
  211. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +30 -26
  212. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
  213. package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.d.ts +1 -0
  214. package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.d.ts.map +1 -1
  215. package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.js +7 -1
  216. package/dist/mocks/msw/handlers/resetTwoFactorAuthHandlers.js.map +1 -1
  217. package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
  218. package/dist/mocks/msw/handlers/userProfileHandlers.js +4 -0
  219. package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
  220. package/dist/style/components/_all.scss +0 -1
  221. package/dist/style/components/_cards.scss +4 -2
  222. package/dist/style/main.css +1 -1
  223. package/dist/synapse-queries/KeyFactory.d.ts +1 -0
  224. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  225. package/dist/synapse-queries/KeyFactory.js +3 -0
  226. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  227. package/dist/synapse-queries/dataaccess/index.js +4 -4
  228. package/dist/synapse-queries/dataaccess/useEDuc.d.ts +7 -0
  229. package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
  230. package/dist/synapse-queries/dataaccess/useEDuc.js +11 -3
  231. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  232. package/dist/synapse-queries/index.js +190 -189
  233. package/dist/tsconfig.build.tsbuildinfo +1 -1
  234. package/dist/utils/APIConstants.d.ts +1 -0
  235. package/dist/utils/APIConstants.d.ts.map +1 -1
  236. package/dist/utils/APIConstants.js +2 -2
  237. package/dist/utils/APIConstants.js.map +1 -1
  238. package/dist/utils/featureflag/FeatureFlags.d.ts +1 -4
  239. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
  240. package/dist/utils/featureflag/FeatureFlags.js +1 -1
  241. package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
  242. package/dist/utils/functions/RegularExpressions.d.ts +10 -0
  243. package/dist/utils/functions/RegularExpressions.d.ts.map +1 -1
  244. package/dist/utils/functions/RegularExpressions.js +7 -1
  245. package/dist/utils/functions/RegularExpressions.js.map +1 -1
  246. package/dist/utils/functions/SqlFunctions.d.ts.map +1 -1
  247. package/dist/utils/functions/SqlFunctions.js +19 -3
  248. package/dist/utils/functions/SqlFunctions.js.map +1 -1
  249. package/dist/utils/index.js +16 -16
  250. package/dist/utils/types/IsType.d.ts +4 -1
  251. package/dist/utils/types/IsType.d.ts.map +1 -1
  252. package/dist/utils/types/IsType.js +4 -4
  253. package/dist/utils/types/IsType.js.map +1 -1
  254. package/dist/utils/types/index.js +2 -2
  255. package/package.json +7 -7
  256. package/dist/components/DataGrid/useMergeGridWithRecordSet.d.ts +0 -12
  257. package/dist/components/DataGrid/useMergeGridWithRecordSet.d.ts.map +0 -1
  258. package/dist/components/DataGrid/useMergeGridWithRecordSet.js +0 -25
  259. package/dist/components/DataGrid/useMergeGridWithRecordSet.js.map +0 -1
  260. package/dist/style/components/_annotations.scss +0 -110
@@ -9,22 +9,15 @@ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
9
  import { ErrorBoundary as u } from "react-error-boundary";
10
10
  //#region src/components/QueryWrapperErrorBoundary.tsx
11
11
  function d({ children: d }) {
12
- let { getCurrentQueryRequest: f, onViewSharingSettingsClicked: p } = r(), { entityId: m } = s(() => f(), [f]), { isAuthenticated: h } = t();
12
+ let { getCurrentQueryRequest: f } = r(), { entityId: p } = s(() => f(), [f]), { isAuthenticated: m } = t();
13
13
  return /* @__PURE__ */ c(u, {
14
- FallbackComponent: o((t) => t.error instanceof n && t.error.status === 403 && h ? /* @__PURE__ */ c("div", {
14
+ FallbackComponent: o((t) => t.error instanceof n && t.error.status === 403 && m ? /* @__PURE__ */ c("div", {
15
15
  className: "ErrorBannerWrapper",
16
- children: /* @__PURE__ */ c(i, {
17
- entityId: m,
18
- onViewSharingSettingsClicked: p
19
- })
16
+ children: /* @__PURE__ */ c(i, { entityId: p })
20
17
  }) : /* @__PURE__ */ l("div", {
21
18
  className: "ErrorBannerWrapper",
22
19
  children: [/* @__PURE__ */ c(a, { resetErrorBoundary: t.resetErrorBoundary }), /* @__PURE__ */ c(e, { ...t })]
23
- }), [
24
- m,
25
- h,
26
- p
27
- ]),
20
+ }), [p, m]),
28
21
  children: d
29
22
  });
30
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryWrapperErrorBoundary.js","names":[],"sources":["../../src/components/QueryWrapperErrorBoundary.tsx"],"sourcesContent":["import { SynapseClientError, useSynapseContext } from '@/utils'\nimport { PropsWithChildren, useCallback, useMemo } from 'react'\nimport {\n ErrorBoundary,\n ErrorBoundaryPropsWithComponent,\n} from 'react-error-boundary'\nimport { EntityActionsRequired } from './AccessRequirement/EntityActionsRequired'\nimport { ErrorBanner } from './error/ErrorBanner'\nimport { useQueryContext } from './QueryContext/QueryContext'\nimport SqlEditor from './SynapseTable/SqlEditor'\n\n/**\n * Error boundary that automatically pulls the error from QueryContext. If 403, shows entity actions required\n */\nexport function QueryWrapperErrorBoundary({\n children,\n}: PropsWithChildren<Record<never, never>>) {\n const { getCurrentQueryRequest, onViewSharingSettingsClicked } =\n useQueryContext()\n const { entityId } = useMemo(\n () => getCurrentQueryRequest(),\n [getCurrentQueryRequest],\n )\n const { isAuthenticated } = useSynapseContext()\n\n const FallbackComponent: ErrorBoundaryPropsWithComponent['FallbackComponent'] =\n useCallback(\n props => {\n if (\n props.error instanceof SynapseClientError &&\n props.error.status === 403 &&\n isAuthenticated\n ) {\n return (\n <div className={`ErrorBannerWrapper`}>\n <EntityActionsRequired\n entityId={entityId}\n onViewSharingSettingsClicked={onViewSharingSettingsClicked}\n />\n </div>\n )\n }\n return (\n <div className={`ErrorBannerWrapper`}>\n <SqlEditor resetErrorBoundary={props.resetErrorBoundary} />\n <ErrorBanner {...props} />\n </div>\n )\n },\n [entityId, isAuthenticated, onViewSharingSettingsClicked],\n )\n\n return (\n <ErrorBoundary FallbackComponent={FallbackComponent}>\n {children}\n </ErrorBoundary>\n )\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,EAA0B,EACxC,eAC0C;CAC1C,IAAM,EAAE,2BAAwB,oCAC9B,EAAgB,GACZ,EAAE,gBAAa,QACb,EAAuB,GAC7B,CAAC,CAAsB,CACzB,GACM,EAAE,uBAAoB,EAAkB;CA6B9C,OACE,kBAAC,GAAD;EAAkC,mBA3BlC,GACE,MAEI,EAAM,iBAAiB,KACvB,EAAM,MAAM,WAAW,OACvB,IAGE,kBAAC,OAAD;GAAK,WAAW;aACd,kBAAC,GAAD;IACY;IACoB;GAC/B,CAAA;EACE,CAAA,IAIP,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACE,kBAAC,GAAD,EAAW,oBAAoB,EAAM,mBAAqB,CAAA,GAC1D,kBAAC,GAAD,EAAa,GAAI,EAAQ,CAAA,CACtB;MAGT;GAAC;GAAU;GAAiB;EAA4B,CAIxB;EAC/B;CACY,CAAA;AAEnB"}
1
+ {"version":3,"file":"QueryWrapperErrorBoundary.js","names":[],"sources":["../../src/components/QueryWrapperErrorBoundary.tsx"],"sourcesContent":["import { SynapseClientError, useSynapseContext } from '@/utils'\nimport { PropsWithChildren, useCallback, useMemo } from 'react'\nimport {\n ErrorBoundary,\n ErrorBoundaryPropsWithComponent,\n} from 'react-error-boundary'\nimport { EntityActionsRequired } from './AccessRequirement/EntityActionsRequired'\nimport { ErrorBanner } from './error/ErrorBanner'\nimport { useQueryContext } from './QueryContext/QueryContext'\nimport SqlEditor from './SynapseTable/SqlEditor'\n\n/**\n * Error boundary that automatically pulls the error from QueryContext. If 403, shows entity actions required\n */\nexport function QueryWrapperErrorBoundary({\n children,\n}: PropsWithChildren<Record<never, never>>) {\n const { getCurrentQueryRequest } = useQueryContext()\n const { entityId } = useMemo(\n () => getCurrentQueryRequest(),\n [getCurrentQueryRequest],\n )\n const { isAuthenticated } = useSynapseContext()\n\n const FallbackComponent: ErrorBoundaryPropsWithComponent['FallbackComponent'] =\n useCallback(\n props => {\n if (\n props.error instanceof SynapseClientError &&\n props.error.status === 403 &&\n isAuthenticated\n ) {\n return (\n <div className={`ErrorBannerWrapper`}>\n <EntityActionsRequired entityId={entityId} />\n </div>\n )\n }\n return (\n <div className={`ErrorBannerWrapper`}>\n <SqlEditor resetErrorBoundary={props.resetErrorBoundary} />\n <ErrorBanner {...props} />\n </div>\n )\n },\n [entityId, isAuthenticated],\n )\n\n return (\n <ErrorBoundary FallbackComponent={FallbackComponent}>\n {children}\n </ErrorBoundary>\n )\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,EAA0B,EACxC,eAC0C;CAC1C,IAAM,EAAE,8BAA2B,EAAgB,GAC7C,EAAE,gBAAa,QACb,EAAuB,GAC7B,CAAC,CAAsB,CACzB,GACM,EAAE,uBAAoB,EAAkB;CA0B9C,OACE,kBAAC,GAAD;EAAkC,mBAxBlC,GACE,MAEI,EAAM,iBAAiB,KACvB,EAAM,MAAM,WAAW,OACvB,IAGE,kBAAC,OAAD;GAAK,WAAW;aACd,kBAAC,GAAD,EAAiC,YAAW,CAAA;EACzC,CAAA,IAIP,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACE,kBAAC,GAAD,EAAW,oBAAoB,EAAM,mBAAqB,CAAA,GAC1D,kBAAC,GAAD,EAAa,GAAI,EAAQ,CAAA,CACtB;MAGT,CAAC,GAAU,CAAe,CAIM;EAC/B;CACY,CAAA;AAEnB"}
@@ -35,7 +35,6 @@ type QueryWrapperPlotNavOwnProps = {
35
35
  defaultColumn?: string;
36
36
  defaultShowSearchBox?: boolean;
37
37
  lockedColumn?: QueryWrapperProps['lockedColumn'];
38
- onViewSharingSettingsClicked?: (benefactorId: string) => void;
39
38
  initialLimit?: number;
40
39
  hideTopLevelControls?: boolean;
41
40
  } & Omit<TopLevelControlsProps, 'entityId'> & Pick<QueryWrapperPlotNavCustomPlotParams, 'onCustomPlotClick'> & Pick<QueryWrapperProps, 'isRowSelectionVisible' | 'rowSelectionPrimaryKey' | 'isRowSelectionUIFloating' | 'fileIdColumnName' | 'fileNameColumnName' | 'fileVersionColumnName'> & Pick<QueryVisualizationWrapperProps, 'defaultShowPlots' | 'visibleColumnCount' | 'hiddenColumns' | 'columnAliases' | 'renderFacetValue' | 'rgbIndex' | 'showLastUpdatedOn' | 'noContentPlaceholderType' | 'unitDescription' | 'additionalFiltersSessionStorageKey' | 'helpConfiguration' | 'hideCopyToClipboard' | 'hideSearchBarControl' | 'hideVisualizationsControl' | 'enabledExternalAnalysisPlatforms' | 'lockTextMatchesQueryFilterPill'> & Pick<QueryContextType, 'combineRangeFacetConfig'>;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryWrapperPlotNav.d.ts","sourceRoot":"","sources":["../../../src/components/QueryWrapperPlotNav/QueryWrapperPlotNav.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAiBlG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAItE,OAAO,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAGL,8BAA8B,EAC/B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAgB,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAyB,EACvB,qBAAqB,EACrB,aAAa,EACd,MAAM,mDAAmD,CAAA;AAG1D,OAAuB,EACrB,mBAAmB,EACpB,MAAM,qCAAqC,CAAA;AAC5C,OAA4B,EAC1B,wBAAwB,EACzB,MAAM,6CAA6C,CAAA;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAIxE,eAAO,MAAM,0BAA0B,EAAE,MAAgC,CAAA;AACzE,eAAO,MAAM,2BAA2B,EAAE,MAA+B,CAAA;AAEzE,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAA;A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BAAoB,GACpB,uBAAuB,CAC1B,GACD,IAAI,CACF,8BAA8B,EAC5B,kBAAkB,GAClB,oBAAoB,GACpB,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,UAAU,GACV,mBAAmB,GACnB,0BAA0B,GAC1B,iBAAiB,GACjB,oCAAoC,GACpC,mBAAmB,GACnB,qBAAqB,GACrB,sBAAsB,GACtB,2BAA2B,GAC3B,kCAAkC,GAClC,gCAAgC,CACnC,GACD,IAAI,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;AAEnD,MAAM,MAAM,wBAAwB,GAAG,6BAA6B,GAClE,mBAAmB,GACnB,2BAA2B,CAAA;AAE7B,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,wBAAwB,EACtB,oBAAoB,GACpB,MAAM,GACN,mBAAmB,GACnB,cAAc,GACd,iBAAiB,GACjB,8BAA8B,GAC9B,cAAc,GACd,gBAAgB,GAChB,sBAAsB,GACtB,2BAA2B,GAC3B,qBAAqB,GACrB,kCAAkC,GAClC,2BAA2B,GAC3B,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,GACd,kCAAkC,GAClC,sBAAsB,CACzB,GAAG;IACF,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,2CAsJxC;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA0H1E"}
1
+ {"version":3,"file":"QueryWrapperPlotNav.d.ts","sourceRoot":"","sources":["../../../src/components/QueryWrapperPlotNav/QueryWrapperPlotNav.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAiBlG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAItE,OAAO,EAAE,mCAAmC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C,2BAA2B,GAC3B,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,GACd,kCAAkC,GAClC,sBAAsB,CACzB,GAAG;IACF,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,2CAsJxC;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA0H1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryWrapperPlotNav.js","names":[],"sources":["../../../src/components/QueryWrapperPlotNav/QueryWrapperPlotNav.tsx"],"sourcesContent":["import { QueryOrDeprecatedSearchParams } from '@/components/CardContainerLogic/CardContainerLogic'\nimport AddToDownloadListConfirmationAlert from '@/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert'\nimport { useGetAddToDownloadListRequestForCurrentQuery } from '@/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery'\nimport { NoContentPlaceholderType } from '@/components/SynapseTable/NoContentPlaceholderType'\nimport { useGetEntity } from '@/synapse-queries'\nimport { SynapseConstants } from '@/utils'\nimport {\n getAdditionalFilters,\n parseEntityIdAndVersionFromSqlStatement,\n} from '@/utils/functions'\nimport { isTable } from '@/utils/functions/EntityTypeUtils'\nimport { DEFAULT_PAGE_SIZE } from '@/utils/SynapseConstants'\nimport { Box } from '@mui/material'\nimport { Query, QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport { useQuery } from '@tanstack/react-query'\nimport { useAtomValue } from 'jotai'\nimport { Suspense, useMemo, useState } from 'react'\nimport { CardConfiguration } from '../CardContainer/CardConfiguration'\nimport { SynapseErrorBoundary } from '../error'\nimport FullTextSearch from '../FullTextSearch/FullTextSearch'\nimport ModalDownload from '../ModalDownload/ModalDownload'\nimport { QueryWrapperPlotNavCustomPlotParams } from '../Plot/SynapsePlot'\nimport { QueryContextType, useQueryContext } from '../QueryContext'\nimport {\n QueryVisualizationContextConsumer,\n QueryVisualizationWrapper,\n QueryVisualizationWrapperProps,\n} from '../QueryVisualizationWrapper'\nimport { QueryWrapper, QueryWrapperProps } from '../QueryWrapper'\nimport { isRowSelectionVisibleAtom } from '../QueryWrapper/TableRowSelectionState'\nimport { QueryWrapperErrorBoundary } from '../QueryWrapperErrorBoundary'\nimport { SynapseTableConfiguration } from '../SynapseTable'\nimport SearchV2, { SearchV2Props } from '../SynapseTable/SearchV2'\nimport SqlEditor from '../SynapseTable/SqlEditor'\nimport TopLevelControls, {\n TopLevelControlsProps,\n CustomControl,\n} from '../SynapseTable/TopLevelControls/TopLevelControls'\nimport { CustomControls } from '../SynapseTable/CustomControls/CustomControls'\nimport TotalQueryResults from '../TotalQueryResults'\nimport PlotsContainer, {\n PlotsContainerProps,\n} from '../widgets/facet-nav/PlotsContainer'\nimport FacetFilterControls, {\n FacetFilterControlsProps,\n} from '../widgets/query-filter/FacetFilterControls'\nimport { QueryWrapperSynapsePlotProps } from './QueryWrapperSynapsePlot'\nimport { RowSetView } from './RowSetView'\nimport QueryWrapperLoadingScreen from '../QueryWrapper/QueryWrapperLoadingScreen'\n\nexport const QUERY_FILTERS_EXPANDED_CSS: string = 'isShowingFacetFilters'\nexport const QUERY_FILTERS_COLLAPSED_CSS: string = 'isHidingFacetFilters'\n\nexport const HAS_SELECTED_ROWS_CSS: string = 'hasSelectedRows'\n\ntype QueryWrapperPlotNavOwnProps = {\n /** Whether the displayed results should be paginated or infinite. Default for cards is true, default for table is false */\n isInfinite?: boolean\n /** Set to true when you want the query to be saved in the URL search parameters. If you are controlling the view (such as in PortalSearch), you'll want to set this to false */\n shouldDeepLink?: boolean\n /** If onQueryChange is set, the callback will be invoked when the Query changes */\n onQueryChange?: (newQueryJson: string) => void\n /** If onQueryResultBundleChange is set, the callback will be invoked when the QueryResultBundle changes */\n onQueryResultBundleChange?: (newQueryResultBundleJson: string) => void\n /** If initQueryJson is set, it will be the Query used in the initial QueryBundleRequest */\n initQueryJson?: string\n tableConfiguration?: SynapseTableConfiguration\n cardConfiguration?: CardConfiguration\n searchConfiguration?: Omit<\n SearchV2Props,\n 'queryContext' | 'queryVisualizationContext'\n >\n facetsToPlot?: string[]\n availableFacets?: FacetFilterControlsProps['availableFacets']\n initialExpandedFacetControls?: FacetFilterControlsProps['initialExpandedFacetControls']\n customPlots?: QueryWrapperSynapsePlotProps[]\n customControls?: CustomControl[]\n defaultColumn?: string\n defaultShowSearchBox?: boolean\n lockedColumn?: QueryWrapperProps['lockedColumn']\n onViewSharingSettingsClicked?: (benefactorId: string) => void\n initialLimit?: number\n hideTopLevelControls?: boolean\n} & Omit<TopLevelControlsProps, 'entityId'> &\n Pick<QueryWrapperPlotNavCustomPlotParams, 'onCustomPlotClick'> &\n Pick<\n QueryWrapperProps,\n | 'isRowSelectionVisible'\n | 'rowSelectionPrimaryKey'\n | 'isRowSelectionUIFloating'\n | 'fileIdColumnName'\n | 'fileNameColumnName'\n | 'fileVersionColumnName'\n > &\n Pick<\n QueryVisualizationWrapperProps,\n | 'defaultShowPlots'\n | 'visibleColumnCount'\n | 'hiddenColumns'\n | 'columnAliases'\n | 'renderFacetValue'\n | 'rgbIndex'\n | 'showLastUpdatedOn'\n | 'noContentPlaceholderType'\n | 'unitDescription'\n | 'additionalFiltersSessionStorageKey'\n | 'helpConfiguration'\n | 'hideCopyToClipboard'\n | 'hideSearchBarControl'\n | 'hideVisualizationsControl'\n | 'enabledExternalAnalysisPlatforms'\n | 'lockTextMatchesQueryFilterPill'\n > &\n Pick<QueryContextType, 'combineRangeFacetConfig'>\n\nexport type QueryWrapperPlotNavProps = QueryOrDeprecatedSearchParams &\n PlotsContainerProps &\n QueryWrapperPlotNavOwnProps\n\nexport type QueryWrapperPlotNavContentsProps = Pick<\n QueryWrapperPlotNavProps,\n | 'tableConfiguration'\n | 'name'\n | 'cardConfiguration'\n | 'facetsToPlot'\n | 'availableFacets'\n | 'initialExpandedFacetControls'\n | 'hideDownload'\n | 'hideQueryCount'\n | 'hideSqlEditorControl'\n | 'hideVisualizationsControl'\n | 'searchConfiguration'\n | 'enabledExternalAnalysisPlatforms'\n | 'cavaticaConnectAccountURL'\n | 'customControls'\n | 'customPlots'\n | 'fileIdColumnName'\n | 'fileNameColumnName'\n | 'fileVersionColumnName'\n | 'initialLimit'\n | 'initialPlotTypeByFacetColumnName'\n | 'hideTopLevelControls'\n> & {\n isFullTextSearchEnabled: boolean\n remount?: () => void\n}\n\nexport function QueryWrapperPlotNavContents(\n props: QueryWrapperPlotNavContentsProps,\n) {\n const {\n tableConfiguration,\n name,\n cardConfiguration,\n facetsToPlot,\n availableFacets,\n initialExpandedFacetControls,\n hideDownload,\n hideQueryCount,\n hideSqlEditorControl,\n hideVisualizationsControl,\n searchConfiguration,\n cavaticaConnectAccountURL,\n customControls,\n remount = () => {},\n isFullTextSearchEnabled,\n customPlots,\n initialLimit,\n initialPlotTypeByFacetColumnName,\n hideTopLevelControls,\n } = props\n const queryContext = useQueryContext()\n const [showExportMetadata, setShowExportMetadata] = useState(false)\n const { hasFacetedSelectColumn: isFaceted, queryMetadataQueryOptions } =\n queryContext\n const { isLoading: isLoadingQueryMetadata } = useQuery(\n queryMetadataQueryOptions,\n )\n\n const isRowSelectionVisible = useAtomValue(isRowSelectionVisibleAtom)\n\n const currentQueryRequest = queryContext.currentQueryRequest\n\n const hasFacetsOrFilters =\n (currentQueryRequest?.query.selectedFacets !== undefined &&\n currentQueryRequest.query.selectedFacets.length > 0) ||\n (currentQueryRequest?.query.additionalFilters !== undefined &&\n currentQueryRequest?.query.additionalFilters.length > 0)\n\n const addToDownloadListRequest =\n useGetAddToDownloadListRequestForCurrentQuery()\n\n return (\n <QueryVisualizationContextConsumer>\n {queryVisualizationContext => {\n if (queryVisualizationContext === undefined) {\n throw new Error(\n 'No queryVisualizationContext found when using QueryVisualizationContextConsumer',\n )\n }\n\n return (\n <Box\n className={`QueryWrapperPlotNav ${\n queryVisualizationContext.showFacetFilter\n ? QUERY_FILTERS_EXPANDED_CSS\n : QUERY_FILTERS_COLLAPSED_CSS\n } ${isRowSelectionVisible ? HAS_SELECTED_ROWS_CSS : ''} ${\n hideTopLevelControls ? 'isHidingTopLevelControls' : ''\n }`}\n sx={{\n '*': {\n cursor: isLoadingQueryMetadata ? 'wait' : undefined,\n },\n }}\n >\n <QueryWrapperErrorBoundary>\n {isFullTextSearchEnabled ? (\n <FullTextSearch ftsConfig={searchConfiguration?.ftsConfig} />\n ) : (\n <SearchV2\n {...searchConfiguration}\n queryContext={queryContext}\n queryVisualizationContext={queryVisualizationContext}\n />\n )}\n <SqlEditor />\n {queryVisualizationContext.showDownloadConfirmation && (\n <AddToDownloadListConfirmationAlert\n addToDownloadListRequest={addToDownloadListRequest}\n onClose={() =>\n queryVisualizationContext.setShowDownloadConfirmation(false)\n }\n />\n )}\n {!hideTopLevelControls && (\n <SynapseErrorBoundary>\n <TopLevelControls\n showColumnSelection={tableConfiguration !== undefined}\n name={name}\n hideDownload={hideDownload}\n hideQueryCount={hideQueryCount}\n hideFacetFilterControl={!isFaceted}\n hideVisualizationsControl={\n !isFaceted || hideVisualizationsControl\n }\n hideSqlEditorControl={hideSqlEditorControl}\n cavaticaConnectAccountURL={cavaticaConnectAccountURL}\n remount={remount}\n customControls={customControls}\n />\n </SynapseErrorBoundary>\n )}\n {isFaceted && (\n <>\n <FacetFilterControls\n availableFacets={availableFacets}\n initialExpandedFacetControls={initialExpandedFacetControls}\n />\n </>\n )}\n {/* Isolated Suspense so that metadata loading does not hide the table */}\n <Suspense fallback={null}>\n <TotalQueryResults\n frontText={''}\n endText={hasFacetsOrFilters ? 'filtered by' : ''}\n hideIfUnfiltered={true}\n />\n </Suspense>\n <CustomControls\n customControls={customControls}\n remount={remount}\n />\n <PlotsContainer\n facetsToPlot={facetsToPlot}\n customPlots={customPlots}\n initialPlotTypeByFacetColumnName={\n initialPlotTypeByFacetColumnName\n }\n />\n <RowSetView\n tableConfiguration={tableConfiguration}\n hideDownload={hideDownload}\n cardConfiguration={cardConfiguration}\n initialLimit={initialLimit}\n />\n {showExportMetadata && (\n <ModalDownload\n getLastQueryRequest={queryContext?.getCurrentQueryRequest}\n onClose={() => setShowExportMetadata(false)}\n />\n )}\n </QueryWrapperErrorBoundary>\n </Box>\n )\n }}\n </QueryVisualizationContextConsumer>\n )\n}\n\nexport default function QueryWrapperPlotNav(props: QueryWrapperPlotNavProps) {\n const {\n sql: deprecatedSql,\n tableConfiguration,\n isInfinite = !tableConfiguration,\n limit = DEFAULT_PAGE_SIZE,\n showLastUpdatedOn,\n unitDescription,\n additionalFiltersSessionStorageKey,\n helpConfiguration,\n customPlots,\n enabledExternalAnalysisPlatforms,\n } = props\n\n const sql = props.query?.sql ?? deprecatedSql ?? ''\n const { entityId, versionNumber } =\n parseEntityIdAndVersionFromSqlStatement(sql)\n\n const query: Query = useMemo(() => {\n if (props.query) {\n // use query if set\n return props.query\n } else if (props.initQueryJson) {\n // Otherwise use initQueryJson\n return JSON.parse(props.initQueryJson) as Query\n } else {\n // use the deprecated sql, searchParams, and sqlOperator\n const additionalFilters = getAdditionalFilters(\n props.searchParams,\n props.sqlOperator,\n additionalFiltersSessionStorageKey,\n )\n return {\n sql: deprecatedSql!,\n additionalFilters,\n limit: limit,\n offset: 0,\n }\n }\n }, [\n props.query,\n props.initQueryJson,\n props.searchParams,\n props.sqlOperator,\n additionalFiltersSessionStorageKey,\n deprecatedSql,\n limit,\n ])\n\n const [componentKey, setComponentKey] = useState(1)\n const remount = () => {\n setComponentKey(componentKey + 1)\n }\n\n const { data: entity } = useGetEntity(entityId, versionNumber)\n const initQueryRequest: QueryBundleRequest = {\n entityId: entityId ?? '',\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS |\n SynapseConstants.BUNDLE_MASK_QUERY_COUNT |\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_MAX_ROWS_PER_PAGE |\n SynapseConstants.BUNDLE_MASK_QUERY_COLUMN_MODELS |\n SynapseConstants.BUNDLE_MASK_QUERY_FACETS |\n SynapseConstants.BUNDLE_MASK_SUM_FILES_SIZE_BYTES |\n SynapseConstants.BUNDLE_MASK_LAST_UPDATED_ON,\n query,\n }\n const isFullTextSearchEnabled =\n (entity && isTable(entity) && entity.isSearchEnabled) ?? false\n\n /**\n * Fully re-render the uncontrolled QueryWrapper component when the initial query changes. This eliminates a class of\n * bugs where our 'derived' state (the current query), which should be reset, is out of sync with props.\n *\n * See https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-uncontrolled-component-with-a-key\n */\n const queryWrapperKey = `${JSON.stringify(initQueryRequest)}-${componentKey}`\n\n return (\n <QueryWrapper\n {...props}\n initQueryRequest={initQueryRequest}\n key={queryWrapperKey}\n isInfinite={isInfinite}\n >\n <Suspense fallback={<QueryWrapperLoadingScreen />}>\n <QueryVisualizationWrapper\n unitDescription={unitDescription}\n rgbIndex={props.rgbIndex}\n columnAliases={props.columnAliases}\n renderFacetValue={props.renderFacetValue}\n dataUseModifiersColumnName={\n props.cardConfiguration?.genericCardSchema\n ?.dataUseModifiersColumnName\n }\n helpConfiguration={helpConfiguration}\n visibleColumnCount={props.visibleColumnCount}\n hiddenColumns={props.hiddenColumns}\n defaultShowPlots={props.defaultShowPlots}\n hideCopyToClipboard={props.hideCopyToClipboard}\n defaultShowSearchBar={\n (props.defaultShowSearchBox || isFullTextSearchEnabled) &&\n !props.hideSearchBarControl\n }\n lockTextMatchesQueryFilterPill={props.lockTextMatchesQueryFilterPill}\n hideSearchBarControl={props.hideSearchBarControl}\n showLastUpdatedOn={showLastUpdatedOn}\n noContentPlaceholderType={NoContentPlaceholderType.INTERACTIVE}\n hasCustomPlots={Array.isArray(customPlots) && customPlots.length > 0}\n enabledExternalAnalysisPlatforms={enabledExternalAnalysisPlatforms}\n >\n <QueryWrapperPlotNavContents\n {...props}\n isFullTextSearchEnabled={isFullTextSearchEnabled}\n remount={remount}\n />\n </QueryVisualizationWrapper>\n </Suspense>\n </QueryWrapper>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAa,IAAqC,yBACrC,IAAsC,wBAEtC,IAAgC;AA8F7C,SAAgB,EACd,GACA;CACA,IAAM,EACJ,uBACA,SACA,sBACA,iBACA,oBACA,iCACA,iBACA,mBACA,yBACA,8BACA,wBACA,8BACA,mBACA,mBAAgB,CAAC,GACjB,4BACA,iBACA,iBACA,qCACA,4BACE,GACE,IAAe,EAAgB,GAC/B,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAC5D,EAAE,wBAAwB,GAAW,iCACzC,GACI,EAAE,WAAW,MAA2B,EAC5C,CACF,GAEM,KAAwB,EAAa,CAAyB,GAE9D,IAAsB,EAAa,qBAEnC,KACH,GAAqB,MAAM,mBAAmB,KAAA,KAC7C,EAAoB,MAAM,eAAe,SAAS,KACnD,GAAqB,MAAM,sBAAsB,KAAA,KAChD,GAAqB,MAAM,kBAAkB,SAAS,GAEpD,KACJ,EAA8C;CAEhD,OACE,kBAAC,GAAD,EAAA,WACG,MAA6B;EAC5B,IAAI,MAA8B,KAAA,GAChC,MAAU,MACR,iFACF;EAGF,OACE,kBAAC,GAAD;GACE,WAAW,uBACT,EAA0B,kBACtB,IACA,EACL,GAAG,KAAwB,IAAwB,GAAG,GACrD,IAAuB,6BAA6B;GAEtD,IAAI,EACF,KAAK,EACH,QAAQ,IAAyB,SAAS,KAAA,EAC5C,EACF;aAEA,kBAAC,GAAD,EAAA,UAAA;IACG,IACC,kBAAC,GAAD,EAAgB,WAAW,GAAqB,UAAY,CAAA,IAE5D,kBAAC,GAAD;KACE,GAAI;KACU;KACa;IAC5B,CAAA;IAEH,kBAAC,GAAD,CAAY,CAAA;IACX,EAA0B,4BACzB,kBAAC,GAAD;KAC4B;K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AEM,EAAE,MAAM,MAAW,EAAa,GAAU,CAAa,GACvD,IAAuC;EAC3C,UAAU,KAAY;EACtB,cAAc;EACd,UACE;EAQF;CACF,GACM,KACH,KAAU,EAAQ,CAAM,KAAK,EAAO,oBAAoB,IAQrD,IAAkB,GAAG,KAAK,UAAU,CAAgB,EAAE,GAAG;CAE/D,OACE,kBAAC,GAAD;EACE,GAAI;EACc;EAClB,KAAK;EACO;CAmCA,GAjCZ,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,CAA4B,CAAA;YAC9C,kBAAC,GAAD;GACmB;GACjB,UAAU,EAAM;GAChB,eAAe,EAAM;GACrB,kBAAkB,EAAM;GACxB,4BACE,EAAM,mBAAmB,mBACrB;GAEa;GACnB,oBAAoB,EAAM;GAC1B,eAAe,EAAM;GACrB,kBAAkB,EAAM;GACxB,qBAAqB,EAAM;GAC3B,uBACG,EAAM,wBAAwB,MAC/B,CAAC,EAAM;GAET,gCAAgC,EAAM;GACtC,sBAAsB,EAAM;GACT;GACnB,0BAA0B,EAAyB;GACnD,gBAAgB,MAAM,QAAQ,CAAW,KAAK,EAAY,SAAS;GACjC;aAElC,kBAAC,GAAD;IACE,GAAI;IACqB;IAChB;GACV,CAAA;EACwB,CAAA;CACnB,CAAA,CACE;AAElB"}
1
+ {"version":3,"file":"QueryWrapperPlotNav.js","names":[],"sources":["../../../src/components/QueryWrapperPlotNav/QueryWrapperPlotNav.tsx"],"sourcesContent":["import { QueryOrDeprecatedSearchParams } from '@/components/CardContainerLogic/CardContainerLogic'\nimport AddToDownloadListConfirmationAlert from '@/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert'\nimport { useGetAddToDownloadListRequestForCurrentQuery } from '@/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery'\nimport { NoContentPlaceholderType } from '@/components/SynapseTable/NoContentPlaceholderType'\nimport { useGetEntity } from '@/synapse-queries'\nimport { SynapseConstants } from '@/utils'\nimport {\n getAdditionalFilters,\n parseEntityIdAndVersionFromSqlStatement,\n} from '@/utils/functions'\nimport { isTable } from '@/utils/functions/EntityTypeUtils'\nimport { DEFAULT_PAGE_SIZE } from '@/utils/SynapseConstants'\nimport { Box } from '@mui/material'\nimport { Query, QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport { useQuery } from '@tanstack/react-query'\nimport { useAtomValue } from 'jotai'\nimport { Suspense, useMemo, useState } from 'react'\nimport { CardConfiguration } from '../CardContainer/CardConfiguration'\nimport { SynapseErrorBoundary } from '../error'\nimport FullTextSearch from '../FullTextSearch/FullTextSearch'\nimport ModalDownload from '../ModalDownload/ModalDownload'\nimport { QueryWrapperPlotNavCustomPlotParams } from '../Plot/SynapsePlot'\nimport { QueryContextType, useQueryContext } from '../QueryContext'\nimport {\n QueryVisualizationContextConsumer,\n QueryVisualizationWrapper,\n QueryVisualizationWrapperProps,\n} from '../QueryVisualizationWrapper'\nimport { QueryWrapper, QueryWrapperProps } from '../QueryWrapper'\nimport { isRowSelectionVisibleAtom } from '../QueryWrapper/TableRowSelectionState'\nimport { QueryWrapperErrorBoundary } from '../QueryWrapperErrorBoundary'\nimport { SynapseTableConfiguration } from '../SynapseTable'\nimport SearchV2, { SearchV2Props } from '../SynapseTable/SearchV2'\nimport SqlEditor from '../SynapseTable/SqlEditor'\nimport TopLevelControls, {\n TopLevelControlsProps,\n CustomControl,\n} from '../SynapseTable/TopLevelControls/TopLevelControls'\nimport { CustomControls } from '../SynapseTable/CustomControls/CustomControls'\nimport TotalQueryResults from '../TotalQueryResults'\nimport PlotsContainer, {\n PlotsContainerProps,\n} from '../widgets/facet-nav/PlotsContainer'\nimport FacetFilterControls, {\n FacetFilterControlsProps,\n} from '../widgets/query-filter/FacetFilterControls'\nimport { QueryWrapperSynapsePlotProps } from './QueryWrapperSynapsePlot'\nimport { RowSetView } from './RowSetView'\nimport QueryWrapperLoadingScreen from '../QueryWrapper/QueryWrapperLoadingScreen'\n\nexport const QUERY_FILTERS_EXPANDED_CSS: string = 'isShowingFacetFilters'\nexport const QUERY_FILTERS_COLLAPSED_CSS: string = 'isHidingFacetFilters'\n\nexport const HAS_SELECTED_ROWS_CSS: string = 'hasSelectedRows'\n\ntype QueryWrapperPlotNavOwnProps = {\n /** Whether the displayed results should be paginated or infinite. Default for cards is true, default for table is false */\n isInfinite?: boolean\n /** Set to true when you want the query to be saved in the URL search parameters. If you are controlling the view (such as in PortalSearch), you'll want to set this to false */\n shouldDeepLink?: boolean\n /** If onQueryChange is set, the callback will be invoked when the Query changes */\n onQueryChange?: (newQueryJson: string) => void\n /** If onQueryResultBundleChange is set, the callback will be invoked when the QueryResultBundle changes */\n onQueryResultBundleChange?: (newQueryResultBundleJson: string) => void\n /** If initQueryJson is set, it will be the Query used in the initial QueryBundleRequest */\n initQueryJson?: string\n tableConfiguration?: SynapseTableConfiguration\n cardConfiguration?: CardConfiguration\n searchConfiguration?: Omit<\n SearchV2Props,\n 'queryContext' | 'queryVisualizationContext'\n >\n facetsToPlot?: string[]\n availableFacets?: FacetFilterControlsProps['availableFacets']\n initialExpandedFacetControls?: FacetFilterControlsProps['initialExpandedFacetControls']\n customPlots?: QueryWrapperSynapsePlotProps[]\n customControls?: CustomControl[]\n defaultColumn?: string\n defaultShowSearchBox?: boolean\n lockedColumn?: QueryWrapperProps['lockedColumn']\n initialLimit?: number\n hideTopLevelControls?: boolean\n} & Omit<TopLevelControlsProps, 'entityId'> &\n Pick<QueryWrapperPlotNavCustomPlotParams, 'onCustomPlotClick'> &\n Pick<\n QueryWrapperProps,\n | 'isRowSelectionVisible'\n | 'rowSelectionPrimaryKey'\n | 'isRowSelectionUIFloating'\n | 'fileIdColumnName'\n | 'fileNameColumnName'\n | 'fileVersionColumnName'\n > &\n Pick<\n QueryVisualizationWrapperProps,\n | 'defaultShowPlots'\n | 'visibleColumnCount'\n | 'hiddenColumns'\n | 'columnAliases'\n | 'renderFacetValue'\n | 'rgbIndex'\n | 'showLastUpdatedOn'\n | 'noContentPlaceholderType'\n | 'unitDescription'\n | 'additionalFiltersSessionStorageKey'\n | 'helpConfiguration'\n | 'hideCopyToClipboard'\n | 'hideSearchBarControl'\n | 'hideVisualizationsControl'\n | 'enabledExternalAnalysisPlatforms'\n | 'lockTextMatchesQueryFilterPill'\n > &\n Pick<QueryContextType, 'combineRangeFacetConfig'>\n\nexport type QueryWrapperPlotNavProps = QueryOrDeprecatedSearchParams &\n PlotsContainerProps &\n QueryWrapperPlotNavOwnProps\n\nexport type QueryWrapperPlotNavContentsProps = Pick<\n QueryWrapperPlotNavProps,\n | 'tableConfiguration'\n | 'name'\n | 'cardConfiguration'\n | 'facetsToPlot'\n | 'availableFacets'\n | 'initialExpandedFacetControls'\n | 'hideDownload'\n | 'hideQueryCount'\n | 'hideSqlEditorControl'\n | 'hideVisualizationsControl'\n | 'searchConfiguration'\n | 'enabledExternalAnalysisPlatforms'\n | 'cavaticaConnectAccountURL'\n | 'customControls'\n | 'customPlots'\n | 'fileIdColumnName'\n | 'fileNameColumnName'\n | 'fileVersionColumnName'\n | 'initialLimit'\n | 'initialPlotTypeByFacetColumnName'\n | 'hideTopLevelControls'\n> & {\n isFullTextSearchEnabled: boolean\n remount?: () => void\n}\n\nexport function QueryWrapperPlotNavContents(\n props: QueryWrapperPlotNavContentsProps,\n) {\n const {\n tableConfiguration,\n name,\n cardConfiguration,\n facetsToPlot,\n availableFacets,\n initialExpandedFacetControls,\n hideDownload,\n hideQueryCount,\n hideSqlEditorControl,\n hideVisualizationsControl,\n searchConfiguration,\n cavaticaConnectAccountURL,\n customControls,\n remount = () => {},\n isFullTextSearchEnabled,\n customPlots,\n initialLimit,\n initialPlotTypeByFacetColumnName,\n hideTopLevelControls,\n } = props\n const queryContext = useQueryContext()\n const [showExportMetadata, setShowExportMetadata] = useState(false)\n const { hasFacetedSelectColumn: isFaceted, queryMetadataQueryOptions } =\n queryContext\n const { isLoading: isLoadingQueryMetadata } = useQuery(\n queryMetadataQueryOptions,\n )\n\n const isRowSelectionVisible = useAtomValue(isRowSelectionVisibleAtom)\n\n const currentQueryRequest = queryContext.currentQueryRequest\n\n const hasFacetsOrFilters =\n (currentQueryRequest?.query.selectedFacets !== undefined &&\n currentQueryRequest.query.selectedFacets.length > 0) ||\n (currentQueryRequest?.query.additionalFilters !== undefined &&\n currentQueryRequest?.query.additionalFilters.length > 0)\n\n const addToDownloadListRequest =\n useGetAddToDownloadListRequestForCurrentQuery()\n\n return (\n <QueryVisualizationContextConsumer>\n {queryVisualizationContext => {\n if (queryVisualizationContext === undefined) {\n throw new Error(\n 'No queryVisualizationContext found when using QueryVisualizationContextConsumer',\n )\n }\n\n return (\n <Box\n className={`QueryWrapperPlotNav ${\n queryVisualizationContext.showFacetFilter\n ? QUERY_FILTERS_EXPANDED_CSS\n : QUERY_FILTERS_COLLAPSED_CSS\n } ${isRowSelectionVisible ? HAS_SELECTED_ROWS_CSS : ''} ${\n hideTopLevelControls ? 'isHidingTopLevelControls' : ''\n }`}\n sx={{\n '*': {\n cursor: isLoadingQueryMetadata ? 'wait' : undefined,\n },\n }}\n >\n <QueryWrapperErrorBoundary>\n {isFullTextSearchEnabled ? (\n <FullTextSearch ftsConfig={searchConfiguration?.ftsConfig} />\n ) : (\n <SearchV2\n {...searchConfiguration}\n queryContext={queryContext}\n queryVisualizationContext={queryVisualizationContext}\n />\n )}\n <SqlEditor />\n {queryVisualizationContext.showDownloadConfirmation && (\n <AddToDownloadListConfirmationAlert\n addToDownloadListRequest={addToDownloadListRequest}\n onClose={() =>\n queryVisualizationContext.setShowDownloadConfirmation(false)\n }\n />\n )}\n {!hideTopLevelControls && (\n <SynapseErrorBoundary>\n <TopLevelControls\n showColumnSelection={tableConfiguration !== undefined}\n name={name}\n hideDownload={hideDownload}\n hideQueryCount={hideQueryCount}\n hideFacetFilterControl={!isFaceted}\n hideVisualizationsControl={\n !isFaceted || hideVisualizationsControl\n }\n hideSqlEditorControl={hideSqlEditorControl}\n cavaticaConnectAccountURL={cavaticaConnectAccountURL}\n remount={remount}\n customControls={customControls}\n />\n </SynapseErrorBoundary>\n )}\n {isFaceted && (\n <>\n <FacetFilterControls\n availableFacets={availableFacets}\n initialExpandedFacetControls={initialExpandedFacetControls}\n />\n </>\n )}\n {/* Isolated Suspense so that metadata loading does not hide the table */}\n <Suspense fallback={null}>\n <TotalQueryResults\n frontText={''}\n endText={hasFacetsOrFilters ? 'filtered by' : ''}\n hideIfUnfiltered={true}\n />\n </Suspense>\n <CustomControls\n customControls={customControls}\n remount={remount}\n />\n <PlotsContainer\n facetsToPlot={facetsToPlot}\n customPlots={customPlots}\n initialPlotTypeByFacetColumnName={\n initialPlotTypeByFacetColumnName\n }\n />\n <RowSetView\n tableConfiguration={tableConfiguration}\n hideDownload={hideDownload}\n cardConfiguration={cardConfiguration}\n initialLimit={initialLimit}\n />\n {showExportMetadata && (\n <ModalDownload\n getLastQueryRequest={queryContext?.getCurrentQueryRequest}\n onClose={() => setShowExportMetadata(false)}\n />\n )}\n </QueryWrapperErrorBoundary>\n </Box>\n )\n }}\n </QueryVisualizationContextConsumer>\n )\n}\n\nexport default function QueryWrapperPlotNav(props: QueryWrapperPlotNavProps) {\n const {\n sql: deprecatedSql,\n tableConfiguration,\n isInfinite = !tableConfiguration,\n limit = DEFAULT_PAGE_SIZE,\n showLastUpdatedOn,\n unitDescription,\n additionalFiltersSessionStorageKey,\n helpConfiguration,\n customPlots,\n enabledExternalAnalysisPlatforms,\n } = props\n\n const sql = props.query?.sql ?? deprecatedSql ?? ''\n const { entityId, versionNumber } =\n parseEntityIdAndVersionFromSqlStatement(sql)\n\n const query: Query = useMemo(() => {\n if (props.query) {\n // use query if set\n return props.query\n } else if (props.initQueryJson) {\n // Otherwise use initQueryJson\n return JSON.parse(props.initQueryJson) as Query\n } else {\n // use the deprecated sql, searchParams, and sqlOperator\n const additionalFilters = getAdditionalFilters(\n props.searchParams,\n props.sqlOperator,\n additionalFiltersSessionStorageKey,\n )\n return {\n sql: deprecatedSql!,\n additionalFilters,\n limit: limit,\n offset: 0,\n }\n }\n }, [\n props.query,\n props.initQueryJson,\n props.searchParams,\n props.sqlOperator,\n additionalFiltersSessionStorageKey,\n deprecatedSql,\n limit,\n ])\n\n const [componentKey, setComponentKey] = useState(1)\n const remount = () => {\n setComponentKey(componentKey + 1)\n }\n\n const { data: entity } = useGetEntity(entityId, versionNumber)\n const initQueryRequest: QueryBundleRequest = {\n entityId: entityId ?? '',\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS |\n SynapseConstants.BUNDLE_MASK_QUERY_COUNT |\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_MAX_ROWS_PER_PAGE |\n SynapseConstants.BUNDLE_MASK_QUERY_COLUMN_MODELS |\n SynapseConstants.BUNDLE_MASK_QUERY_FACETS |\n SynapseConstants.BUNDLE_MASK_SUM_FILES_SIZE_BYTES |\n SynapseConstants.BUNDLE_MASK_LAST_UPDATED_ON,\n query,\n }\n const isFullTextSearchEnabled =\n (entity && isTable(entity) && entity.isSearchEnabled) ?? false\n\n /**\n * Fully re-render the uncontrolled QueryWrapper component when the initial query changes. This eliminates a class of\n * bugs where our 'derived' state (the current query), which should be reset, is out of sync with props.\n *\n * See https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-uncontrolled-component-with-a-key\n */\n const queryWrapperKey = `${JSON.stringify(initQueryRequest)}-${componentKey}`\n\n return (\n <QueryWrapper\n {...props}\n initQueryRequest={initQueryRequest}\n key={queryWrapperKey}\n isInfinite={isInfinite}\n >\n <Suspense fallback={<QueryWrapperLoadingScreen />}>\n <QueryVisualizationWrapper\n unitDescription={unitDescription}\n rgbIndex={props.rgbIndex}\n columnAliases={props.columnAliases}\n renderFacetValue={props.renderFacetValue}\n dataUseModifiersColumnName={\n props.cardConfiguration?.genericCardSchema\n ?.dataUseModifiersColumnName\n }\n helpConfiguration={helpConfiguration}\n visibleColumnCount={props.visibleColumnCount}\n hiddenColumns={props.hiddenColumns}\n defaultShowPlots={props.defaultShowPlots}\n hideCopyToClipboard={props.hideCopyToClipboard}\n defaultShowSearchBar={\n (props.defaultShowSearchBox || isFullTextSearchEnabled) &&\n !props.hideSearchBarControl\n }\n lockTextMatchesQueryFilterPill={props.lockTextMatchesQueryFilterPill}\n hideSearchBarControl={props.hideSearchBarControl}\n showLastUpdatedOn={showLastUpdatedOn}\n noContentPlaceholderType={NoContentPlaceholderType.INTERACTIVE}\n hasCustomPlots={Array.isArray(customPlots) && customPlots.length > 0}\n enabledExternalAnalysisPlatforms={enabledExternalAnalysisPlatforms}\n >\n <QueryWrapperPlotNavContents\n {...props}\n isFullTextSearchEnabled={isFullTextSearchEnabled}\n remount={remount}\n />\n </QueryVisualizationWrapper>\n </Suspense>\n </QueryWrapper>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAa,IAAqC,yBACrC,IAAsC,wBAEtC,IAAgC;AA6F7C,SAAgB,EACd,GACA;CACA,IAAM,EACJ,uBACA,SACA,sBACA,iBACA,oBACA,iCACA,iBACA,mBACA,yBACA,8BACA,wBACA,8BACA,mBACA,mBAAgB,CAAC,GACjB,4BACA,iBACA,iBACA,qCACA,4BACE,GACE,IAAe,EAAgB,GAC/B,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAC5D,EAAE,wBAAwB,GAAW,iCACzC,GACI,EAAE,WAAW,MAA2B,EAC5C,CACF,GAEM,KAAwB,EAAa,CAAyB,GAE9D,IAAsB,EAAa,qBAEnC,KACH,GAAqB,MAAM,mBAAmB,KAAA,KAC7C,EAAoB,MAAM,eAAe,SAAS,KACnD,GAAqB,MAAM,sBAAsB,KAAA,KAChD,GAAqB,MAAM,kBAAkB,SAAS,GAEpD,KACJ,EAA8C;CAEhD,OACE,kBAAC,GAAD,EAAA,WACG,MAA6B;EAC5B,IAAI,MAA8B,KAAA,GAChC,MAAU,MACR,i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
65
  }
66
66
  let $ = k ?? u(W, J), De = U && C(fe(G, (e, t) => Object.keys(U).find((e) => e === t))), Oe = q === null && De;
67
- return /* @__PURE__ */ x("div", {
68
- className: "JsonSchemaFormContainer",
69
- children: we ? /* @__PURE__ */ x("div", {
70
- className: "LoadingPlaceholder",
71
- children: /* @__PURE__ */ x(n, { size: 30 })
72
- }) : /* @__PURE__ */ S(b, { children: [
73
- U && q && /* @__PURE__ */ S(_, {
74
- severity: "info",
75
- sx: { mb: 2 },
67
+ return /* @__PURE__ */ x(b, { children: we ? /* @__PURE__ */ x(v, {
68
+ sx: {
69
+ display: "flex",
70
+ margin: "60px auto"
71
+ },
72
+ children: /* @__PURE__ */ x(n, { size: 30 })
73
+ }) : /* @__PURE__ */ S(b, { children: [
74
+ U && q && /* @__PURE__ */ S(_, {
75
+ severity: "info",
76
+ sx: { mb: 2 },
77
+ children: [
78
+ /* @__PURE__ */ x("b", { children: U.name }),
79
+ " requires scientific annotations specified by ",
80
+ /* @__PURE__ */ x("b", { children: q.jsonSchemaVersionInfo.$id }),
81
+ ". ",
82
+ /* @__PURE__ */ x("b", { children: /* @__PURE__ */ x(me, {
83
+ href: `${t(e.REPO_ENDPOINT)}/repo/v1/schema/type/registered/${q.jsonSchemaVersionInfo.$id}`,
84
+ target: "_blank",
85
+ rel: "noopener noreferrer",
86
+ children: "View required schema (JSON)"
87
+ }) })
88
+ ]
89
+ }),
90
+ Oe && /* @__PURE__ */ x(_, {
91
+ severity: "info",
92
+ children: /* @__PURE__ */ S(v, {
93
+ sx: {
94
+ display: "flex",
95
+ alignItems: "center",
96
+ gap: .5
97
+ },
76
98
  children: [
77
- /* @__PURE__ */ x("b", { children: U.name }),
78
- " requires scientific annotations specified by ",
79
- /* @__PURE__ */ x("b", { children: q.jsonSchemaVersionInfo.$id }),
80
- ". ",
81
- /* @__PURE__ */ x("b", { children: /* @__PURE__ */ x(me, {
82
- href: `${t(e.REPO_ENDPOINT)}/repo/v1/schema/type/registered/${q.jsonSchemaVersionInfo.$id}`,
83
- target: "_blank",
84
- rel: "noopener noreferrer",
85
- children: "View required schema (JSON)"
86
- }) })
99
+ /* @__PURE__ */ S(y, {
100
+ variant: "smallText1",
101
+ children: [
102
+ /* @__PURE__ */ x("b", { children: U.name }),
103
+ " has no annotations. Click the",
104
+ " "
105
+ ]
106
+ }),
107
+ /* @__PURE__ */ x(p, {}),
108
+ /* @__PURE__ */ x(y, {
109
+ variant: "smallText1",
110
+ children: "button to annotate."
111
+ })
87
112
  ]
88
- }),
89
- Oe && /* @__PURE__ */ x(_, {
90
- severity: "info",
91
- children: /* @__PURE__ */ S(v, {
92
- sx: {
93
- display: "flex",
94
- alignItems: "center",
95
- gap: .5
96
- },
97
- children: [
98
- /* @__PURE__ */ S(y, {
99
- variant: "smallText1",
100
- children: [
101
- /* @__PURE__ */ x("b", { children: U.name }),
102
- " has no annotations. Click the",
103
- " "
104
- ]
105
- }),
106
- /* @__PURE__ */ x(p, {}),
107
- /* @__PURE__ */ x(y, {
108
- variant: "smallText1",
109
- children: "button to annotate."
110
- })
111
- ]
112
- })
113
- }),
114
- /* @__PURE__ */ S(f, {
115
- validator: T,
116
- liveValidate: $,
117
- noHtml5Validate: !0,
118
- formRef: I,
119
- disabled: Ee,
120
- translateString: ae,
121
- formContext: {
122
- showDerivedAnnotationPlaceholder: !0,
123
- descriptionVariant: "expand",
124
- descriptionFormat: "table",
125
- allowFreeSoloEnum: !0
126
- },
127
- experimental_defaultFormStateBehavior: { emptyObjectFields: "skipDefaults" },
128
- fields: { ObjectField: m },
129
- templates: {
130
- ObjectFieldTemplate: se,
131
- WrapIfAdditionalTemplate: ce
132
- },
133
- widgets: { TextWidget: le },
134
- schema: Se,
135
- uiSchema: Ce,
136
- transformErrors: d,
137
- formData: G,
138
- onChange: ({ formData: e }) => {
139
- N(e), K(e), R(void 0);
140
- },
141
- onBlur: () => {
142
- K(E(G, !1));
143
- },
144
- onSubmit: ({ formData: e, errors: t }, n) => {
145
- n.preventDefault(), t && t.length > 0 && R(t), B(!1), K(e), Q();
146
- },
147
- onError: (e) => {
148
- R(e), (L || $) && a && V(!0);
113
+ })
114
+ }),
115
+ /* @__PURE__ */ S(f, {
116
+ validator: T,
117
+ liveValidate: $,
118
+ noHtml5Validate: !0,
119
+ formRef: I,
120
+ disabled: Ee,
121
+ translateString: ae,
122
+ formContext: {
123
+ showDerivedAnnotationPlaceholder: !0,
124
+ descriptionVariant: "expand",
125
+ descriptionFormat: "table",
126
+ allowFreeSoloEnum: !0
127
+ },
128
+ experimental_defaultFormStateBehavior: { emptyObjectFields: "skipDefaults" },
129
+ fields: { ObjectField: m },
130
+ templates: {
131
+ ObjectFieldTemplate: se,
132
+ WrapIfAdditionalTemplate: ce
133
+ },
134
+ widgets: { TextWidget: le },
135
+ schema: Se,
136
+ uiSchema: Ce,
137
+ transformErrors: d,
138
+ formData: G,
139
+ onChange: ({ formData: e }) => {
140
+ N(e), K(e), R(void 0);
141
+ },
142
+ onBlur: () => {
143
+ K(E(G, !1));
144
+ },
145
+ onSubmit: ({ formData: e, errors: t }, n) => {
146
+ n.preventDefault(), t && t.length > 0 && R(t), B(!1), K(e), Q();
147
+ },
148
+ onError: (e) => {
149
+ R(e), (L || $) && a && V(!0);
150
+ },
151
+ children: [z && ge && /* @__PURE__ */ S(_, {
152
+ severity: "error",
153
+ sx: { my: 2 },
154
+ children: ["Annotations could not be updated: ", z.reason]
155
+ }), !P && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(pe, { sx: { my: 2 } }), /* @__PURE__ */ x(v, {
156
+ sx: {
157
+ display: "flex",
158
+ justifyContent: "space-between",
159
+ gridRowStart: 5
149
160
  },
150
- children: [z && ge && /* @__PURE__ */ S(_, {
151
- severity: "error",
152
- sx: { my: 2 },
153
- children: ["Annotations could not be updated: ", z.reason]
154
- }), !P && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(pe, { sx: { my: 2 } }), /* @__PURE__ */ x(v, {
155
- sx: {
156
- display: "flex",
157
- justifyContent: "space-between",
158
- gridRowStart: 5
161
+ children: /* @__PURE__ */ x(re, {
162
+ hasCancelButton: j !== void 0,
163
+ onCancel: () => {
164
+ j && j();
159
165
  },
160
- children: /* @__PURE__ */ x(re, {
161
- hasCancelButton: j !== void 0,
162
- onCancel: () => {
163
- j && j();
164
- },
165
- onConfirm: () => {
166
- I.current.formElement.current.requestSubmit();
167
- },
168
- confirmButtonProps: { children: a ? "Save" : "Validate" }
169
- })
170
- })] })]
171
- }),
172
- _e && /* @__PURE__ */ x(ie, {
173
- open: !0,
174
- onConfirm: () => {
175
- Q(), V(!1);
176
- },
177
- onCancel: () => {
178
- V(!1);
179
- },
180
- title: "Update Annotations",
181
- content: /* @__PURE__ */ S(b, { children: [
182
- /* @__PURE__ */ x("div", { children: "The following errors exist with the annotations you entered:" }),
183
- /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x("ul", { children: (L ?? []).map((e, t) => /* @__PURE__ */ S("li", { children: [
184
- /* @__PURE__ */ x("b", { children: `${oe(e)}: ` }),
185
- " ",
186
- `${e.message}`
187
- ] }, t)) }) }),
188
- /* @__PURE__ */ x("div", { children: "Are you sure you want to save the invalid annotations?" })
189
- ] }),
190
- confirmButtonProps: { children: "Save" }
191
- })
192
- ] })
193
- });
166
+ onConfirm: () => {
167
+ I.current.formElement.current.requestSubmit();
168
+ },
169
+ confirmButtonProps: { children: a ? "Save" : "Validate" }
170
+ })
171
+ })] })]
172
+ }),
173
+ _e && /* @__PURE__ */ x(ie, {
174
+ open: !0,
175
+ onConfirm: () => {
176
+ Q(), V(!1);
177
+ },
178
+ onCancel: () => {
179
+ V(!1);
180
+ },
181
+ title: "Update Annotations",
182
+ content: /* @__PURE__ */ S(b, { children: [
183
+ /* @__PURE__ */ x("div", { children: "The following errors exist with the annotations you entered:" }),
184
+ /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x("ul", { children: (L ?? []).map((e, t) => /* @__PURE__ */ S("li", { children: [
185
+ /* @__PURE__ */ x("b", { children: `${oe(e)}: ` }),
186
+ " ",
187
+ `${e.message}`
188
+ ] }, t)) }) }),
189
+ /* @__PURE__ */ x("div", { children: "Are you sure you want to save the invalid annotations?" })
190
+ ] }),
191
+ confirmButtonProps: { children: "Save" }
192
+ })
193
+ ] }) });
194
194
  }
195
195
  //#endregion
196
196
  export { D as SchemaDrivenAnnotationEditor };
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaDrivenAnnotationEditor.js","names":[],"sources":["../../../src/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.tsx"],"sourcesContent":["import AddToList from '@/assets/icons/AddToList'\nimport {\n useGetJson,\n useGetSchema,\n useGetSchemaBinding,\n useUpdateViaJson,\n} from '@/synapse-queries'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport { Alert, Box, Divider, Link, Typography } from '@mui/material'\nimport RJSF from '@rjsf/core'\nimport { RJSFValidationError } from '@rjsf/utils'\nimport validator from '@rjsf/validator-ajv8'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { EntityJson } from '@sage-bionetworks/synapse-types'\nimport { JSONSchema7 } from 'json-schema'\nimport { omitBy } from 'lodash-es'\nimport isEmpty from 'lodash-es/isEmpty'\nimport noop from 'lodash-es/noop'\nimport { RefObject, useEffect, useMemo, useRef, useState } from 'react'\nimport {\n ConfirmationButtons,\n ConfirmationDialog,\n} from '../ConfirmationDialog/ConfirmationDialog'\nimport { JsonSchemaForm } from '../JsonSchemaForm/JsonSchemaForm'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport {\n dropNullishArrayValues,\n dropNullValues,\n getPossibleTopLevelPropertiesInObjectSchema,\n getFriendlyPropertyName,\n getJsonSchemaForForm,\n getSchemaIdForConcreteType,\n transformErrors,\n getUiSchemaForForm,\n shouldLiveValidate,\n customTranslateString,\n} from './AnnotationEditorUtils'\nimport SynapseAnnotationsRJSFObjectField from './field/SynapseAnnotationsRJSFObjectField'\nimport { ObjectFieldTemplate } from './template/ObjectFieldTemplate'\nimport SynapseAnnotationsWrapIfAdditionalTemplate from './template/SynapseAnnotationsWrapIfAdditionalTemplate'\nimport TextWidget from './widget/TextWidget'\n\nexport type SchemaDrivenAnnotationEditorProps = {\n /** The entity whose annotations should be edited with the form */\n entityId?: string\n /** If no entity ID is supplied, the schema to use for the form */\n schemaId?: string\n /** May be used to directly provide a JSON Schema to use for the form */\n validationSchema?: JSONSchema7\n /** Optionally supply a ref to the form to handle submission externally with `formRef.current.submit()`. */\n formRef?: RefObject<RJSF | null>\n /** Provide live input validation. This can cause performance degradation. By default, liveValidate will be true if an entity with a schema and existing annotations is being edited */\n liveValidate?: boolean\n /** Invoked after a successful form submission */\n onSuccess?: () => void\n /** If defined and formRef is not supplied, shows a 'Cancel' button and runs this effect on click */\n onCancel?: () => void\n /** Passes new form data upon each change to the form */\n onChange?: (annotations: Record<string, unknown>) => void\n /** If true, the editor will not render its own submit UI. */\n hideActions?: boolean\n}\n\n/**\n * Cleans the formData to remove values that are invalid for Synapse Annotations\n * @param formData\n * @param dropNullishValuesInArrays\n */\nfunction cleanFormData(\n formData: Record<string, unknown> | undefined,\n dropNullishValuesInArrays: boolean,\n) {\n let cleanedFormData = dropNullValues(formData)\n if (dropNullishValuesInArrays) {\n cleanedFormData = dropNullishArrayValues(cleanedFormData)\n }\n return cleanedFormData\n}\n\n/**\n * Renders a form for editing an entity's annotations. The component also supports supplying just a schema ID,\n * but work to support annotation flows without an entity (i.e. before creating entities) is not yet complete.\n */\nexport function SchemaDrivenAnnotationEditor(\n props: SchemaDrivenAnnotationEditorProps,\n) {\n const {\n entityId,\n schemaId,\n validationSchema: validationSchemaFromProps,\n liveValidate: liveValidateFromProps,\n onSuccess = () => {\n /* no-op */\n },\n onCancel,\n formRef: formRefFromParent,\n onChange = noop,\n hideActions = false,\n } = props\n const localRef = useRef<RJSF>(null)\n const ref = formRefFromParent ?? localRef\n\n // Client-side validation errors\n const [validationError, setValidationError] = useState<\n RJSFValidationError[] | undefined\n >(undefined)\n\n // Errors from the backend response\n const [submissionError, setSubmissionError] = useState<\n SynapseClientError | undefined\n >(undefined)\n const [showSubmissionError, setShowSubmissionError] = useState(false)\n\n const [showConfirmation, setShowConfirmation] = useState(false)\n\n const { data } = useGetJson(\n entityId!,\n undefined,\n // Derived annotations will be precomputed and displayed as placeholders in the form\n false,\n {\n // Metadata is being edited, so don't refetch\n staleTime: Infinity,\n enabled: !!entityId,\n throwOnError: true,\n },\n )\n\n const entityJson = data?.entityMetadata\n const annotations = data?.annotations\n\n // Annotation fields fetched and modified via the form\n const [formData, setFormData] = useState<Record<string, unknown> | undefined>(\n undefined,\n )\n\n // Set initial form data when the entity or its annotations change\n useEffect(() => {\n if (data?.entity) {\n const formData = data.entity\n const hasAnnotations = annotations && Object.keys(annotations).length > 0\n\n const newFormData = !hasAnnotations\n ? { ...formData, newKey: [''] }\n : formData\n\n setFormData(newFormData)\n }\n }, [data?.entity, annotations])\n\n const { data: schema, isLoading: isLoadingBinding } = useGetSchemaBinding(\n entityId!,\n {\n enabled: !!entityId,\n refetchOnWindowFocus: false,\n throwOnError: true,\n },\n )\n\n // The full schema which is bound to the entity\n const { data: fetchedValidationSchema, isLoading: isLoadingSchema } =\n useGetSchema(schemaId ?? schema?.jsonSchemaVersionInfo.$id ?? '', {\n enabled: !!schemaId || !!schema,\n throwOnError: true,\n })\n const validationSchema = validationSchemaFromProps || fetchedValidationSchema\n\n const concreteTypeSchemaId = getSchemaIdForConcreteType(\n entityJson?.concreteType ?? '',\n )\n // The schema for the entity type (e.g. FileEntity, TableEntity, etc.)\n const { data: schemaForEntityType, isLoading: isLoadingEntityTypeSchema } =\n useGetSchema(concreteTypeSchemaId ?? '', {\n enabled: !!concreteTypeSchemaId,\n throwOnError: true,\n })\n\n const entitySchemaBaseProperties: JSONSchema7['properties'] = useMemo(\n () =>\n getPossibleTopLevelPropertiesInObjectSchema(schemaForEntityType ?? {}),\n [schemaForEntityType],\n )\n\n const formSchema = useMemo(\n () => getJsonSchemaForForm(validationSchema, schemaForEntityType),\n [validationSchema, schemaForEntityType],\n )\n\n const uiSchema = useMemo(\n () => getUiSchemaForForm(entitySchemaBaseProperties),\n [entitySchemaBaseProperties],\n )\n\n const isLoading =\n isLoadingBinding || isLoadingSchema || isLoadingEntityTypeSchema\n\n const { mutate, isPending: updateIsPending } = useUpdateViaJson({\n onSuccess: () => {\n onSuccess()\n },\n onError: error => {\n setSubmissionError(error)\n setShowSubmissionError(true)\n },\n })\n\n function submitChangedEntity() {\n mutate({\n ...cleanFormData(formData, true),\n ...entityJson,\n } as EntityJson)\n }\n\n const liveValidate =\n liveValidateFromProps ?? shouldLiveValidate(annotations, validationSchema)\n\n const formDataHasNoAnnotations =\n entityJson &&\n isEmpty(\n omitBy(formData, (_value, key) =>\n Object.keys(entityJson).find(k => k === key),\n ),\n )\n\n const showHasNoAnnotationsAlert = schema === null && formDataHasNoAnnotations\n\n return (\n <div className=\"JsonSchemaFormContainer\">\n {isLoading ? (\n <div className=\"LoadingPlaceholder\">\n <SynapseSpinner size={30} />\n </div>\n ) : (\n <>\n {entityJson && schema && (\n <Alert severity=\"info\" sx={{ mb: 2 }}>\n <b>{entityJson.name}</b> requires scientific annotations specified\n by <b>{schema.jsonSchemaVersionInfo.$id}</b>\n {'. '}\n <b>\n <Link\n href={`${getEndpoint(\n BackendDestinationEnum.REPO_ENDPOINT,\n )}/repo/v1/schema/type/registered/${\n schema.jsonSchemaVersionInfo.$id\n }`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n View required schema (JSON)\n </Link>\n </b>\n </Alert>\n )}\n {showHasNoAnnotationsAlert && (\n <Alert severity=\"info\">\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 0.5,\n }}\n >\n <Typography variant={'smallText1'}>\n <b>{entityJson.name}</b> has no annotations. Click the{' '}\n </Typography>\n <AddToList />\n <Typography variant={'smallText1'}>\n button to annotate.\n </Typography>\n </Box>\n </Alert>\n )}\n <JsonSchemaForm\n validator={validator}\n liveValidate={liveValidate}\n noHtml5Validate={true}\n formRef={ref}\n disabled={updateIsPending}\n translateString={customTranslateString}\n formContext={{\n showDerivedAnnotationPlaceholder: true,\n descriptionVariant: 'expand',\n descriptionFormat: 'table',\n allowFreeSoloEnum: true,\n }}\n experimental_defaultFormStateBehavior={{\n emptyObjectFields: 'skipDefaults',\n }}\n fields={{\n ObjectField: SynapseAnnotationsRJSFObjectField,\n }}\n templates={{\n ObjectFieldTemplate: ObjectFieldTemplate,\n WrapIfAdditionalTemplate:\n SynapseAnnotationsWrapIfAdditionalTemplate,\n }}\n widgets={{\n TextWidget: TextWidget,\n }}\n schema={formSchema}\n uiSchema={uiSchema}\n transformErrors={transformErrors}\n formData={formData}\n onChange={({ formData }) => {\n onChange(formData)\n setFormData(formData)\n setValidationError(undefined)\n }}\n onBlur={() => {\n setFormData(\n // Clean the formData onBlur to remove null values that we will need to strip before submission\n // This will ensure that the user gets accurate validation information since the data will match what the backend will receive\n cleanFormData(\n formData,\n // Don't remove null values in arrays--the fields will disappear, which the user probably does not want\n false,\n ),\n )\n }}\n onSubmit={({ formData, errors }, event) => {\n event.preventDefault()\n if (errors && errors.length > 0) {\n setValidationError(errors)\n }\n setShowSubmissionError(false)\n setFormData(formData)\n submitChangedEntity()\n }}\n onError={(errors: RJSFValidationError[]) => {\n // invoked when submit is clicked and there are client-side validation errors\n setValidationError(errors)\n if ((validationError || liveValidate) && entityId) {\n setShowConfirmation(true)\n }\n }}\n >\n {submissionError && showSubmissionError && (\n <Alert severity=\"error\" sx={{ my: 2 }}>\n Annotations could not be updated: {submissionError.reason}\n </Alert>\n )}\n {!hideActions && (\n <>\n <Divider sx={{ my: 2 }} />\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n gridRowStart: 5,\n }}\n >\n <ConfirmationButtons\n hasCancelButton={onCancel !== undefined}\n onCancel={() => {\n if (onCancel) {\n onCancel()\n }\n }}\n onConfirm={() => {\n ref.current!.formElement.current.requestSubmit()\n }}\n confirmButtonProps={{\n children: entityId ? 'Save' : 'Validate',\n }}\n />\n </Box>\n </>\n )}\n </JsonSchemaForm>\n {showConfirmation && (\n <ConfirmationDialog\n open={true}\n onConfirm={() => {\n submitChangedEntity()\n setShowConfirmation(false)\n }}\n onCancel={() => {\n setShowConfirmation(false)\n }}\n title=\"Update Annotations\"\n content={\n <>\n <div>\n The following errors exist with the annotations you entered:\n </div>\n <div>\n <ul>\n {(validationError ?? []).map(\n (e: RJSFValidationError, index: number) => (\n <li key={index}>\n <b>{`${getFriendlyPropertyName(e)}: `}</b>{' '}\n {`${e.message}`}\n </li>\n ),\n )}\n </ul>\n </div>\n <div>\n Are you sure you want to save the invalid annotations?\n </div>\n </>\n }\n confirmButtonProps={{\n children: 'Save',\n }}\n />\n )}\n </>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuEA,SAAS,EACP,GACA,GACA;CACA,IAAI,IAAkB,EAAe,CAAQ;CAI7C,OAHI,MACF,IAAkB,EAAuB,CAAe,IAEnD;AACT;AAMA,SAAgB,EACd,GACA;CACA,IAAM,EACJ,aACA,aACA,kBAAkB,GAClB,cAAc,GACd,qBAAkB,CAElB,GACA,aACA,SAAS,GACT,cAAW,GACX,iBAAc,OACZ,GACE,IAAW,GAAa,IAAI,GAC5B,IAAM,KAAqB,GAG3B,CAAC,GAAiB,KAAsB,EAE5C,KAAA,CAAS,GAGL,CAAC,GAAiB,MAAsB,EAE5C,KAAA,CAAS,GACL,CAAC,IAAqB,KAA0B,EAAS,EAAK,GAE9D,CAAC,IAAkB,KAAuB,EAAS,EAAK,GAExD,EAAE,YAAS,GACf,GACA,KAAA,GAEA,IACA;EAEE,WAAW;EACX,SAAS,CAAC,CAAC;EACX,cAAc;CAChB,CACF,GAEM,IAAa,GAAM,gBACnB,IAAc,GAAM,aAGpB,CAAC,GAAU,KAAe,EAC9B,KAAA,CACF;CAGA,SAAgB;EACd,IAAI,GAA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,GAAwB,CAAC,EAAE,IAAO,CAAA;MAAE;MAC1C,GAAG,EAAE;KACJ,EAAA,GAHK,CAGL,CAER,EACE,CAAA,EACD,CAAA;KACL,kBAAC,OAAD,EAAA,UAAK,yDAEA,CAAA;IACL,EAAA,CAAA;IAEJ,oBAAoB,EAClB,UAAU,OACZ;GACD,CAAA;EAEH,EAAA,CAAA;CAED,CAAA;AAET"}
1
+ {"version":3,"file":"SchemaDrivenAnnotationEditor.js","names":[],"sources":["../../../src/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.tsx"],"sourcesContent":["import AddToList from '@/assets/icons/AddToList'\nimport {\n useGetJson,\n useGetSchema,\n useGetSchemaBinding,\n useUpdateViaJson,\n} from '@/synapse-queries'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport { Alert, Box, Divider, Link, Typography } from '@mui/material'\nimport RJSF from '@rjsf/core'\nimport { RJSFValidationError } from '@rjsf/utils'\nimport validator from '@rjsf/validator-ajv8'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { EntityJson } from '@sage-bionetworks/synapse-types'\nimport { JSONSchema7 } from 'json-schema'\nimport { omitBy } from 'lodash-es'\nimport isEmpty from 'lodash-es/isEmpty'\nimport noop from 'lodash-es/noop'\nimport { RefObject, useEffect, useMemo, useRef, useState } from 'react'\nimport {\n ConfirmationButtons,\n ConfirmationDialog,\n} from '../ConfirmationDialog/ConfirmationDialog'\nimport { JsonSchemaForm } from '../JsonSchemaForm/JsonSchemaForm'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport {\n dropNullishArrayValues,\n dropNullValues,\n getPossibleTopLevelPropertiesInObjectSchema,\n getFriendlyPropertyName,\n getJsonSchemaForForm,\n getSchemaIdForConcreteType,\n transformErrors,\n getUiSchemaForForm,\n shouldLiveValidate,\n customTranslateString,\n} from './AnnotationEditorUtils'\nimport SynapseAnnotationsRJSFObjectField from './field/SynapseAnnotationsRJSFObjectField'\nimport { ObjectFieldTemplate } from './template/ObjectFieldTemplate'\nimport SynapseAnnotationsWrapIfAdditionalTemplate from './template/SynapseAnnotationsWrapIfAdditionalTemplate'\nimport TextWidget from './widget/TextWidget'\n\nexport type SchemaDrivenAnnotationEditorProps = {\n /** The entity whose annotations should be edited with the form */\n entityId?: string\n /** If no entity ID is supplied, the schema to use for the form */\n schemaId?: string\n /** May be used to directly provide a JSON Schema to use for the form */\n validationSchema?: JSONSchema7\n /** Optionally supply a ref to the form to handle submission externally with `formRef.current.submit()`. */\n formRef?: RefObject<RJSF | null>\n /** Provide live input validation. This can cause performance degradation. By default, liveValidate will be true if an entity with a schema and existing annotations is being edited */\n liveValidate?: boolean\n /** Invoked after a successful form submission */\n onSuccess?: () => void\n /** If defined and formRef is not supplied, shows a 'Cancel' button and runs this effect on click */\n onCancel?: () => void\n /** Passes new form data upon each change to the form */\n onChange?: (annotations: Record<string, unknown>) => void\n /** If true, the editor will not render its own submit UI. */\n hideActions?: boolean\n}\n\n/**\n * Cleans the formData to remove values that are invalid for Synapse Annotations\n * @param formData\n * @param dropNullishValuesInArrays\n */\nfunction cleanFormData(\n formData: Record<string, unknown> | undefined,\n dropNullishValuesInArrays: boolean,\n) {\n let cleanedFormData = dropNullValues(formData)\n if (dropNullishValuesInArrays) {\n cleanedFormData = dropNullishArrayValues(cleanedFormData)\n }\n return cleanedFormData\n}\n\n/**\n * Renders a form for editing an entity's annotations. The component also supports supplying just a schema ID,\n * but work to support annotation flows without an entity (i.e. before creating entities) is not yet complete.\n */\nexport function SchemaDrivenAnnotationEditor(\n props: SchemaDrivenAnnotationEditorProps,\n) {\n const {\n entityId,\n schemaId,\n validationSchema: validationSchemaFromProps,\n liveValidate: liveValidateFromProps,\n onSuccess = () => {\n /* no-op */\n },\n onCancel,\n formRef: formRefFromParent,\n onChange = noop,\n hideActions = false,\n } = props\n const localRef = useRef<RJSF>(null)\n const ref = formRefFromParent ?? localRef\n\n // Client-side validation errors\n const [validationError, setValidationError] = useState<\n RJSFValidationError[] | undefined\n >(undefined)\n\n // Errors from the backend response\n const [submissionError, setSubmissionError] = useState<\n SynapseClientError | undefined\n >(undefined)\n const [showSubmissionError, setShowSubmissionError] = useState(false)\n\n const [showConfirmation, setShowConfirmation] = useState(false)\n\n const { data } = useGetJson(\n entityId!,\n undefined,\n // Derived annotations will be precomputed and displayed as placeholders in the form\n false,\n {\n // Metadata is being edited, so don't refetch\n staleTime: Infinity,\n enabled: !!entityId,\n throwOnError: true,\n },\n )\n\n const entityJson = data?.entityMetadata\n const annotations = data?.annotations\n\n // Annotation fields fetched and modified via the form\n const [formData, setFormData] = useState<Record<string, unknown> | undefined>(\n undefined,\n )\n\n // Set initial form data when the entity or its annotations change\n useEffect(() => {\n if (data?.entity) {\n const formData = data.entity\n const hasAnnotations = annotations && Object.keys(annotations).length > 0\n\n const newFormData = !hasAnnotations\n ? { ...formData, newKey: [''] }\n : formData\n\n setFormData(newFormData)\n }\n }, [data?.entity, annotations])\n\n const { data: schema, isLoading: isLoadingBinding } = useGetSchemaBinding(\n entityId!,\n {\n enabled: !!entityId,\n refetchOnWindowFocus: false,\n throwOnError: true,\n },\n )\n\n // The full schema which is bound to the entity\n const { data: fetchedValidationSchema, isLoading: isLoadingSchema } =\n useGetSchema(schemaId ?? schema?.jsonSchemaVersionInfo.$id ?? '', {\n enabled: !!schemaId || !!schema,\n throwOnError: true,\n })\n const validationSchema = validationSchemaFromProps || fetchedValidationSchema\n\n const concreteTypeSchemaId = getSchemaIdForConcreteType(\n entityJson?.concreteType ?? '',\n )\n // The schema for the entity type (e.g. FileEntity, TableEntity, etc.)\n const { data: schemaForEntityType, isLoading: isLoadingEntityTypeSchema } =\n useGetSchema(concreteTypeSchemaId ?? '', {\n enabled: !!concreteTypeSchemaId,\n throwOnError: true,\n })\n\n const entitySchemaBaseProperties: JSONSchema7['properties'] = useMemo(\n () =>\n getPossibleTopLevelPropertiesInObjectSchema(schemaForEntityType ?? {}),\n [schemaForEntityType],\n )\n\n const formSchema = useMemo(\n () => getJsonSchemaForForm(validationSchema, schemaForEntityType),\n [validationSchema, schemaForEntityType],\n )\n\n const uiSchema = useMemo(\n () => getUiSchemaForForm(entitySchemaBaseProperties),\n [entitySchemaBaseProperties],\n )\n\n const isLoading =\n isLoadingBinding || isLoadingSchema || isLoadingEntityTypeSchema\n\n const { mutate, isPending: updateIsPending } = useUpdateViaJson({\n onSuccess: () => {\n onSuccess()\n },\n onError: error => {\n setSubmissionError(error)\n setShowSubmissionError(true)\n },\n })\n\n function submitChangedEntity() {\n mutate({\n ...cleanFormData(formData, true),\n ...entityJson,\n } as EntityJson)\n }\n\n const liveValidate =\n liveValidateFromProps ?? shouldLiveValidate(annotations, validationSchema)\n\n const formDataHasNoAnnotations =\n entityJson &&\n isEmpty(\n omitBy(formData, (_value, key) =>\n Object.keys(entityJson).find(k => k === key),\n ),\n )\n\n const showHasNoAnnotationsAlert = schema === null && formDataHasNoAnnotations\n\n return (\n <>\n {isLoading ? (\n <Box sx={{ display: 'flex', margin: '60px auto' }}>\n <SynapseSpinner size={30} />\n </Box>\n ) : (\n <>\n {entityJson && schema && (\n <Alert severity=\"info\" sx={{ mb: 2 }}>\n <b>{entityJson.name}</b> requires scientific annotations specified\n by <b>{schema.jsonSchemaVersionInfo.$id}</b>\n {'. '}\n <b>\n <Link\n href={`${getEndpoint(\n BackendDestinationEnum.REPO_ENDPOINT,\n )}/repo/v1/schema/type/registered/${\n schema.jsonSchemaVersionInfo.$id\n }`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n View required schema (JSON)\n </Link>\n </b>\n </Alert>\n )}\n {showHasNoAnnotationsAlert && (\n <Alert severity=\"info\">\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 0.5,\n }}\n >\n <Typography variant={'smallText1'}>\n <b>{entityJson.name}</b> has no annotations. Click the{' '}\n </Typography>\n <AddToList />\n <Typography variant={'smallText1'}>\n button to annotate.\n </Typography>\n </Box>\n </Alert>\n )}\n <JsonSchemaForm\n validator={validator}\n liveValidate={liveValidate}\n noHtml5Validate={true}\n formRef={ref}\n disabled={updateIsPending}\n translateString={customTranslateString}\n formContext={{\n showDerivedAnnotationPlaceholder: true,\n descriptionVariant: 'expand',\n descriptionFormat: 'table',\n allowFreeSoloEnum: true,\n }}\n experimental_defaultFormStateBehavior={{\n emptyObjectFields: 'skipDefaults',\n }}\n fields={{\n ObjectField: SynapseAnnotationsRJSFObjectField,\n }}\n templates={{\n ObjectFieldTemplate: ObjectFieldTemplate,\n WrapIfAdditionalTemplate:\n SynapseAnnotationsWrapIfAdditionalTemplate,\n }}\n widgets={{\n TextWidget: TextWidget,\n }}\n schema={formSchema}\n uiSchema={uiSchema}\n transformErrors={transformErrors}\n formData={formData}\n onChange={({ formData }) => {\n onChange(formData)\n setFormData(formData)\n setValidationError(undefined)\n }}\n onBlur={() => {\n setFormData(\n // Clean the formData onBlur to remove null values that we will need to strip before submission\n // This will ensure that the user gets accurate validation information since the data will match what the backend will receive\n cleanFormData(\n formData,\n // Don't remove null values in arrays--the fields will disappear, which the user probably does not want\n false,\n ),\n )\n }}\n onSubmit={({ formData, errors }, event) => {\n event.preventDefault()\n if (errors && errors.length > 0) {\n setValidationError(errors)\n }\n setShowSubmissionError(false)\n setFormData(formData)\n submitChangedEntity()\n }}\n onError={(errors: RJSFValidationError[]) => {\n // invoked when submit is clicked and there are client-side validation errors\n setValidationError(errors)\n if ((validationError || liveValidate) && entityId) {\n setShowConfirmation(true)\n }\n }}\n >\n {submissionError && showSubmissionError && (\n <Alert severity=\"error\" sx={{ my: 2 }}>\n Annotations could not be updated: {submissionError.reason}\n </Alert>\n )}\n {!hideActions && (\n <>\n <Divider sx={{ my: 2 }} />\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n gridRowStart: 5,\n }}\n >\n <ConfirmationButtons\n hasCancelButton={onCancel !== undefined}\n onCancel={() => {\n if (onCancel) {\n onCancel()\n }\n }}\n onConfirm={() => {\n ref.current!.formElement.current.requestSubmit()\n }}\n confirmButtonProps={{\n children: entityId ? 'Save' : 'Validate',\n }}\n />\n </Box>\n </>\n )}\n </JsonSchemaForm>\n {showConfirmation && (\n <ConfirmationDialog\n open={true}\n onConfirm={() => {\n submitChangedEntity()\n setShowConfirmation(false)\n }}\n onCancel={() => {\n setShowConfirmation(false)\n }}\n title=\"Update Annotations\"\n content={\n <>\n <div>\n The following errors exist with the annotations you entered:\n </div>\n <div>\n <ul>\n {(validationError ?? []).map(\n (e: RJSFValidationError, index: number) => (\n <li key={index}>\n <b>{`${getFriendlyPropertyName(e)}: `}</b>{' '}\n {`${e.message}`}\n </li>\n ),\n )}\n </ul>\n </div>\n <div>\n Are you sure you want to save the invalid annotations?\n </div>\n </>\n }\n confirmButtonProps={{\n children: 'Save',\n }}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuEA,SAAS,EACP,GACA,GACA;CACA,IAAI,IAAkB,EAAe,CAAQ;CAI7C,OAHI,MACF,IAAkB,EAAuB,CAAe,IAEnD;AACT;AAMA,SAAgB,EACd,GACA;CACA,IAAM,EACJ,aACA,aACA,kBAAkB,GAClB,cAAc,GACd,qBAAkB,CAElB,GACA,aACA,SAAS,GACT,cAAW,GACX,iBAAc,OACZ,GACE,IAAW,GAAa,IAAI,GAC5B,IAAM,KAAqB,GAG3B,CAAC,GAAiB,KAAsB,EAE5C,KAAA,CAAS,GAGL,CAAC,GAAiB,MAAsB,EAE5C,KAAA,CAAS,GACL,CAAC,IAAqB,KAA0B,EAAS,EAAK,GAE9D,CAAC,IAAkB,KAAuB,EAAS,EAAK,GAExD,EAAE,YAAS,GACf,GACA,KAAA,GAEA,IACA;EAEE,WAAW;EACX,SAAS,CAAC,CAAC;EACX,cAAc;CAChB,CACF,GAEM,IAAa,GAAM,gBACnB,IAAc,GAAM,aAGpB,CAAC,GAAU,KAAe,EAC9B,KAAA,CACF;CAGA,SAAgB;EACd,IAAI,G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BAAC,KAAD,EAAA,UAAI,GAAG,GAAwB,CAAC,EAAE,IAAO,CAAA;KAAE;KAC1C,GAAG,EAAE;IACJ,EAAA,GAHK,CAGL,CAER,EACE,CAAA,EACD,CAAA;IACL,kBAAC,OAAD,EAAA,UAAK,yDAEA,CAAA;GACL,EAAA,CAAA;GAEJ,oBAAoB,EAClB,UAAU,OACZ;EACD,CAAA;CAEH,EAAA,CAAA,EAEJ,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchQueryWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/SearchQueryWrapper/SearchQueryWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACL,iBAAiB,EAKlB,MAAM,OAAO,CAAA;AAOd,OAAO,EAGL,iBAAiB,EAClB,MAAM,8BAA8B,CAAA;AAcrC;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,WAAW,CAAA;AAChE,eAAO,MAAM,kCAAkC,yBAA8D,CAAA;AAE7G,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;OAKG;IACH,gBAAgB,EAAE;QAChB,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAA;QACjD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAA;QACzC,KAAK,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;KAC7C,CAAA;IACD,mFAAmF;IACnF,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,sGAAsG;IACtG,yBAAyB,CAAC,EAAE,CAAC,wBAAwB,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAC,CAAA;AAmOF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAMhE"}
1
+ {"version":3,"file":"SearchQueryWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/SearchQueryWrapper/SearchQueryWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACL,iBAAiB,EAKlB,MAAM,OAAO,CAAA;AAOd,OAAO,EAGL,iBAAiB,EAClB,MAAM,8BAA8B,CAAA;AAcrC;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,WAAW,CAAA;AAChE,eAAO,MAAM,kCAAkC,yBAA8D,CAAA;AAE7G,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;OAKG;IACH,gBAAgB,EAAE;QAChB,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAA;QACjD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAA;QACzC,KAAK,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;KAC7C,CAAA;IACD,mFAAmF;IACnF,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,sGAAsG;IACtG,yBAAyB,CAAC,EAAE,CAAC,wBAAwB,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAC,CAAA;AAkOF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAMhE"}
@@ -62,7 +62,6 @@ function E(n) {
62
62
  resetQuery: L,
63
63
  removeQueryFilter: B,
64
64
  removeValueFromQueryFilter: V,
65
- onViewSharingSettingsClicked: void 0,
66
65
  addValueToSelectedFacet: W,
67
66
  combineRangeFacetConfig: void 0,
68
67
  setRangeFacetValue: G,
@@ -1 +1 @@
1
- {"version":3,"file":"SearchQueryWrapper.js","names":[],"sources":["../../../src/components/SearchQueryWrapper/SearchQueryWrapper.tsx"],"sourcesContent":["import { hasResettableFilters as hasResettableFiltersUtil } from '@/utils/functions/queryUtils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport useImmutableTableQuery from '@/utils/hooks/useImmutableTableQuery/useImmutableTableQuery'\nimport { goToPage as transformQueryToGoToPage } from '@/utils/hooks/useImmutableTableQuery/TableQueryReducerActions'\nimport {\n AsynchronousJobStatus,\n QueryBundleRequest,\n QueryResultBundle,\n} from '@sage-bionetworks/synapse-types'\nimport { Provider } from 'jotai'\nimport {\n PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react'\nimport { useDeepCompareMemoize } from 'use-deep-compare-effect'\nimport {\n QueryContextProvider,\n QueryContextType,\n useQueryContext,\n} from '../QueryContext/QueryContext'\nimport {\n getSearchQueryUseQueryOptions,\n useSearchQueryUseQueryOptions,\n SearchQueryConfig,\n} from './SearchQueryUseQueryOptions'\nimport { TableQueryUseQueryOptions } from '../QueryWrapper/TableQueryUseQueryOptions'\nimport useHasFacetedSelectColumn from '../QueryWrapper/useHasFacetedSelectColumn'\nimport { SessionInitializedGuard } from '@/utils/AppUtils/session/SessionInitializedGuard'\nimport { useGetEntity, useGetEntityBundle } from '@/synapse-queries'\nimport type {\n SearchIndexQuery,\n SynapseClientError,\n} from '@sage-bionetworks/synapse-client'\nimport { SearchIndex } from '@sage-bionetworks/synapse-client'\nimport { useQuery, UseQueryOptions } from '@tanstack/react-query'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { cloneDeep } from 'lodash-es'\n\n/**\n * The initQueryRequest used internally within SearchQueryWrapper. It uses a synthetic entity ID\n * and SQL so we can reuse useImmutableTableQuery for facet/pagination state management, even though\n * the actual data is fetched from the SearchQueryServicesApi (not a table entity).\n */\nexport const SEARCH_QUERY_WRAPPER_SYNTHETIC_ENTITY_ID = 'search'\nexport const SEARCH_QUERY_WRAPPER_SYNTHETIC_SQL = `SELECT * FROM ${SEARCH_QUERY_WRAPPER_SYNTHETIC_ENTITY_ID}`\n\nexport type SearchQueryWrapperProps = PropsWithChildren<{\n /**\n * The ID of the SearchIndex entity to query.\n */\n searchIndexId: string\n /**\n * The initial query request. Only `query.selectedFacets`, `query.additionalFilters`,\n * `query.limit`, and `query.offset` are used; the `entityId` and `sql` fields are\n * overridden with synthetic values. The `partMask` controls which parts of the response\n * bundle to request.\n */\n initQueryRequest: {\n concreteType?: QueryBundleRequest['concreteType']\n partMask?: QueryBundleRequest['partMask']\n query?: Partial<QueryBundleRequest['query']>\n }\n /** If onQueryChange is set, the callback will be invoked when the Query changes */\n onQueryChange?: (newQueryJson: string) => void\n /** If onQueryResultBundleChange is set, it will be called whenever the query result bundle changes */\n onQueryResultBundleChange?: (newQueryResultBundleJson: string) => void\n isInfinite?: boolean\n /** Whether the URL should update when the query is modified (deep linking). */\n shouldDeepLink?: boolean\n /** OpenSearch query strategy and field-boost configuration. */\n searchQueryConfig?: SearchQueryConfig\n}>\n\n/**\n * Internal component that reads the current query metadata from QueryContext and fires\n * onQueryResultBundleChange whenever the data changes. Must be rendered as a child of\n * QueryContextProvider (i.e. inside SearchQueryWrapper).\n */\nfunction SearchQueryResultBundleChangeNotifier({\n onQueryResultBundleChange,\n}: {\n onQueryResultBundleChange: (json: string) => void\n}) {\n const { queryMetadataQueryOptions } = useQueryContext()\n // queryMetadataQueryOptions is UseSuspenseQueryOptions; cast to UseQueryOptions so we can use\n // regular (non-suspense) `useQuery` here — the same cache key is shared, so no extra request is made.\n const queryOpts = queryMetadataQueryOptions as UseQueryOptions<\n AsynchronousJobStatus<SearchIndexQuery, QueryResultBundle>,\n SynapseClientError,\n Omit<QueryResultBundle, 'queryResult'>\n >\n const { data } = useQuery(queryOpts)\n // Use a ref so we always call the latest callback without including it in the\n // effect dependency array. Including a frequently-recreated callback in deps\n // causes the effect to re-fire on every render, creating an infinite loop when\n // the parent updates state inside the callback.\n const onQueryResultBundleChangeRef = useRef(onQueryResultBundleChange)\n onQueryResultBundleChangeRef.current = onQueryResultBundleChange\n useEffect(() => {\n if (data) {\n onQueryResultBundleChangeRef.current(JSON.stringify(data))\n }\n }, [data])\n return null\n}\n\nfunction SearchQueryWrapperInternal(props: SearchQueryWrapperProps) {\n return (\n <SessionInitializedGuard>\n <SearchQueryWrapperInternalWithSession {...props} />\n </SessionInitializedGuard>\n )\n}\n\nfunction SearchQueryWrapperInternalWithSession(props: SearchQueryWrapperProps) {\n const {\n initQueryRequest: initQueryRequestFromProps,\n onQueryChange,\n onQueryResultBundleChange,\n isInfinite = false,\n searchIndexId,\n shouldDeepLink = false,\n searchQueryConfig,\n } = props\n\n const { keyFactory, accessToken } = useSynapseContext()\n\n const { data: searchIndexEntityData } = useGetEntity(\n searchIndexId,\n undefined,\n {\n throwOnError: true,\n },\n )\n const searchIndexEntity = searchIndexEntityData as SearchIndex | undefined\n\n const synapseId = searchIndexEntity?.definingSQL\n ? parseEntityIdFromSqlStatement(searchIndexEntity.definingSQL)\n : undefined\n\n const { data: entityBundle } = useGetEntityBundle(\n synapseId,\n undefined,\n { includeTableBundle: true },\n { throwOnError: true },\n )\n const columnModels = entityBundle?.tableBundle?.columnModels\n\n // Build a full synthetic QueryBundleRequest so we can reuse useImmutableTableQuery.\n // The entityId and sql are placeholders; only selectedFacets, limit, offset, and partMask\n // are passed through to the actual SearchQueryServicesApi call.\n const initQueryRequest = useDeepCompareMemoize({\n concreteType:\n 'org.sagebionetworks.repo.model.table.QueryBundleRequest' as const,\n entityId: SEARCH_QUERY_WRAPPER_SYNTHETIC_ENTITY_ID,\n partMask: initQueryRequestFromProps.partMask ?? 0,\n query: {\n sql: SEARCH_QUERY_WRAPPER_SYNTHETIC_SQL,\n selectedFacets: initQueryRequestFromProps.query?.selectedFacets,\n additionalFilters: initQueryRequestFromProps.query?.additionalFilters,\n sort: initQueryRequestFromProps.query?.sort,\n limit: initQueryRequestFromProps.query?.limit,\n offset: initQueryRequestFromProps.query?.offset,\n },\n }) as QueryBundleRequest\n\n const immutableTableQueryResult = useImmutableTableQuery({\n initQueryRequest,\n onQueryChange,\n shouldDeepLink,\n })\n\n const {\n getInitQueryRequest,\n getCurrentQueryRequest,\n setQuery,\n resetQuery,\n removeSelectedFacet,\n removeValueFromSelectedFacet,\n removeQueryFilter,\n removeValueFromQueryFilter,\n nextQueryRequest,\n currentQueryRequest,\n addValueToSelectedFacet,\n setRangeFacetValue,\n resetDebounceTimer,\n currentPage,\n goToPage,\n pageSize,\n setPageSize,\n } = immutableTableQueryResult\n\n // SearchTableQueryUseQueryOptions uses SearchIndexQuery generics rather than QueryBundleRequest.\n // QueryContextType (and all downstream consumers) expect TableQueryUseQueryOptions. The runtime\n // shapes are identical — only the TypeScript generics differ — so a single cast is made here at\n // the architectural boundary rather than scattering `as unknown as` across the implementation.\n const {\n rowDataQueryOptions,\n rowDataInfiniteQueryOptions,\n queryMetadataQueryOptions,\n } = useSearchQueryUseQueryOptions(\n currentQueryRequest as QueryBundleRequest,\n searchIndexId,\n synapseId,\n searchQueryConfig,\n ) as unknown as TableQueryUseQueryOptions\n\n const hasFacetedSelectColumn = useHasFacetedSelectColumn(\n queryMetadataQueryOptions,\n )\n\n const hasResettableFilters = useMemo(() => {\n const request = getCurrentQueryRequest()\n return hasResettableFiltersUtil(request.query, undefined)\n }, [getCurrentQueryRequest])\n\n // Provides page-specific row query options using the search API, so components like\n // usePrefetchTableRows don't accidentally call the standard table query API with the\n // synthetic entity ID.\n const getRowDataQueryOptionsForPage = useCallback(\n (pageNumber: number) => {\n const queryWithUpdatedPage = transformQueryToGoToPage(\n { type: 'goToPage', pageNumber },\n cloneDeep(getCurrentQueryRequest()),\n )\n return (\n getSearchQueryUseQueryOptions(\n queryWithUpdatedPage,\n keyFactory,\n accessToken,\n searchIndexId,\n columnModels,\n searchQueryConfig,\n ) as unknown as TableQueryUseQueryOptions\n ).rowDataQueryOptions\n },\n [\n getCurrentQueryRequest,\n keyFactory,\n accessToken,\n searchIndexId,\n columnModels,\n searchQueryConfig,\n ],\n )\n\n // TODO: useDeepCompareMemoize cannot meaningfully compare functions — it falls back to\n // reference equality for them. The callbacks below (getCurrentQueryRequest, removeSelectedFacet,\n // getRowDataQueryOptionsForPage, etc.) behave identically to a shallow useMemo dep.\n // The correct fix is to deep-compare only serializable data fields and use a plain useMemo for\n // the full context object. QueryWrapper.tsx has the same issue; fix both together in a follow-up.\n const context: QueryContextType = useDeepCompareMemoize({\n isInfinite,\n entityId: synapseId,\n versionNumber: undefined,\n nextQueryRequest,\n currentQueryRequest,\n getCurrentQueryRequest,\n getInitQueryRequest,\n executeQueryRequest: setQuery,\n hasFacetedSelectColumn,\n hasResettableFilters,\n removeSelectedFacet,\n removeValueFromSelectedFacet,\n resetQuery,\n removeQueryFilter,\n removeValueFromQueryFilter,\n onViewSharingSettingsClicked: undefined,\n addValueToSelectedFacet,\n combineRangeFacetConfig: undefined,\n setRangeFacetValue,\n resetDebounceTimer,\n rowDataQueryOptions,\n rowDataInfiniteQueryOptions,\n queryMetadataQueryOptions,\n currentPage,\n goToPage,\n pageSize,\n setPageSize,\n lockedColumn: undefined,\n fileIdColumnName: undefined,\n fileVersionColumnName: undefined,\n fileNameColumnName: undefined,\n getRowDataQueryOptionsForPage,\n })\n\n return (\n <QueryContextProvider queryContext={context}>\n {onQueryResultBundleChange && (\n <SearchQueryResultBundleChangeNotifier\n onQueryResultBundleChange={onQueryResultBundleChange}\n />\n )}\n {props.children}\n </QueryContextProvider>\n )\n}\n\n/**\n * Provides a QueryContext populated by results from the SearchQueryServicesApi rather than\n * the standard Table Query Services. All subcomponents that consume QueryContext can be\n * used unchanged within a SearchQueryWrapper tree.\n */\nexport function SearchQueryWrapper(props: SearchQueryWrapperProps) {\n return (\n <Provider>\n <SearchQueryWrapperInternal {...props} />\n </Provider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,IAAa,IAA2C,UAC3C,IAAqC,iBAAiB;AAkCnE,SAAS,EAAsC,EAC7C,gCAGC;CACD,IAAM,EAAE,iCAA8B,EAAgB,GAQhD,EAAE,YAAS,EAAS,CAAS,GAK7B,IAA+B,EAAO,CAAyB;CAOrE,OANA,EAA6B,UAAU,GACvC,QAAgB;EACd,AAAI,KACF,EAA6B,QAAQ,KAAK,UAAU,CAAI,CAAC;CAE7D,GAAG,CAAC,CAAI,CAAC,GACF;AACT;AAEA,SAAS,EAA2B,GAAgC;CAClE,OACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAuC,GAAI,EAAQ,CAAA,EAC5B,CAAA;AAE7B;AAEA,SAAS,EAAsC,GAAgC;CAC7E,IAAM,EACJ,kBAAkB,GAClB,kBACA,8BACA,gBAAa,IACb,kBACA,oBAAiB,IACjB,yBACE,GAEE,EAAE,eAAY,mBAAgB,EAAkB,GAEhD,EAAE,MAAM,MAA0B,EACtC,GACA,KAAA,GACA,EACE,cAAc,GAChB,CACF,GACM,IAAoB,GAEpB,IAAY,GAAmB,cACjC,EAA8B,EAAkB,WAAW,IAC3D,KAAA,GAEE,EAAE,MAAM,MAAiB,EAC7B,GACA,KAAA,GACA,EAAE,oBAAoB,GAAK,GAC3B,EAAE,cAAc,GAAK,CACvB,GACM,IAAe,GAAc,aAAa,cA0B1C,EACJ,wBACA,2BACA,aACA,eACA,wBACA,iCACA,sBACA,+BACA,qBACA,wBACA,4BACA,uBACA,uBACA,gBACA,UAAA,GACA,aACA,mBAvBgC,EAAuB;EACvD,kBAhBuB,EAAsB;GAC7C,cACE;GACF,UAAU;GACV,UAAU,EAA0B,YAAY;GAChD,OAAO;IACL,KAAK;IACL,gBAAgB,EAA0B,OAAO;IACjD,mBAAmB,EAA0B,OAAO;IACpD,MAAM,EAA0B,OAAO;IACvC,OAAO,EAA0B,OAAO;IACxC,QAAQ,EAA0B,OAAO;GAC3C;EACF,CAGE;EACA;EACA;CACF,CAoBI,GAME,EACJ,wBACA,gCACA,iCACE,EACF,GACA,GACA,GACA,CACF;CAiFA,OACE,kBAAC,GAAD;EAAsB,cApCU,EAAsB;GACtD;GACA,UAAU;GACV,eAAe,KAAA;GACf;GACA;GACA;GACA;GACA,qBAAqB;GACrB,wBArD6B,EAC7B,CAoDA;GACA,sBAlD2B,QAEpB,EADS,EACgB,EAAQ,OAAO,KAAA,CAAS,GACvD,CAAC,CAAsB,CA+CxB;GACA;GACA;GACA;GACA;GACA;GACA,8BAA8B,KAAA;GAC9B;GACA,yBAAyB,KAAA;GACzB;GACA;GACA;GACA;GACA;GACA;GACA,UAAA;GACA;GACA;GACA,cAAc,KAAA;GACd,kBAAkB,KAAA;GAClB,uBAAuB,KAAA;GACvB,oBAAoB,KAAA;GACpB,+BAhEoC,GACnC,MAMG,EAL2B,GAC3B;IAAE,MAAM;IAAY;GAAW,GAC/B,EAAU,EAAuB,CAAC,CAIhC,GACA,GACA,GACA,GACA,GACA,CACF,EACA,qBAEJ;IACE;IACA;IACA;IACA;IACA;IACA;GACF,CAwCA;EACF,CAGsC;YAApC,CACG,KACC,kBAAC,GAAD,EAC6B,6BAC5B,CAAA,GAEF,EAAM,QACa;;AAE1B;AAOA,SAAgB,EAAmB,GAAgC;CACjE,OACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAA4B,GAAI,EAAQ,CAAA,EAChC,CAAA;AAEd"}
1
+ {"version":3,"file":"SearchQueryWrapper.js","names":[],"sources":["../../../src/components/SearchQueryWrapper/SearchQueryWrapper.tsx"],"sourcesContent":["import { hasResettableFilters as hasResettableFiltersUtil } from '@/utils/functions/queryUtils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport useImmutableTableQuery from '@/utils/hooks/useImmutableTableQuery/useImmutableTableQuery'\nimport { goToPage as transformQueryToGoToPage } from '@/utils/hooks/useImmutableTableQuery/TableQueryReducerActions'\nimport {\n AsynchronousJobStatus,\n QueryBundleRequest,\n QueryResultBundle,\n} from '@sage-bionetworks/synapse-types'\nimport { Provider } from 'jotai'\nimport {\n PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react'\nimport { useDeepCompareMemoize } from 'use-deep-compare-effect'\nimport {\n QueryContextProvider,\n QueryContextType,\n useQueryContext,\n} from '../QueryContext/QueryContext'\nimport {\n getSearchQueryUseQueryOptions,\n useSearchQueryUseQueryOptions,\n SearchQueryConfig,\n} from './SearchQueryUseQueryOptions'\nimport { TableQueryUseQueryOptions } from '../QueryWrapper/TableQueryUseQueryOptions'\nimport useHasFacetedSelectColumn from '../QueryWrapper/useHasFacetedSelectColumn'\nimport { SessionInitializedGuard } from '@/utils/AppUtils/session/SessionInitializedGuard'\nimport { useGetEntity, useGetEntityBundle } from '@/synapse-queries'\nimport type {\n SearchIndexQuery,\n SynapseClientError,\n} from '@sage-bionetworks/synapse-client'\nimport { SearchIndex } from '@sage-bionetworks/synapse-client'\nimport { useQuery, UseQueryOptions } from '@tanstack/react-query'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { cloneDeep } from 'lodash-es'\n\n/**\n * The initQueryRequest used internally within SearchQueryWrapper. It uses a synthetic entity ID\n * and SQL so we can reuse useImmutableTableQuery for facet/pagination state management, even though\n * the actual data is fetched from the SearchQueryServicesApi (not a table entity).\n */\nexport const SEARCH_QUERY_WRAPPER_SYNTHETIC_ENTITY_ID = 'search'\nexport const SEARCH_QUERY_WRAPPER_SYNTHETIC_SQL = `SELECT * FROM ${SEARCH_QUERY_WRAPPER_SYNTHETIC_ENTITY_ID}`\n\nexport type SearchQueryWrapperProps = PropsWithChildren<{\n /**\n * The ID of the SearchIndex entity to query.\n */\n searchIndexId: string\n /**\n * The initial query request. Only `query.selectedFacets`, `query.additionalFilters`,\n * `query.limit`, and `query.offset` are used; the `entityId` and `sql` fields are\n * overridden with synthetic values. The `partMask` controls which parts of the response\n * bundle to request.\n */\n initQueryRequest: {\n concreteType?: QueryBundleRequest['concreteType']\n partMask?: QueryBundleRequest['partMask']\n query?: Partial<QueryBundleRequest['query']>\n }\n /** If onQueryChange is set, the callback will be invoked when the Query changes */\n onQueryChange?: (newQueryJson: string) => void\n /** If onQueryResultBundleChange is set, it will be called whenever the query result bundle changes */\n onQueryResultBundleChange?: (newQueryResultBundleJson: string) => void\n isInfinite?: boolean\n /** Whether the URL should update when the query is modified (deep linking). */\n shouldDeepLink?: boolean\n /** OpenSearch query strategy and field-boost configuration. */\n searchQueryConfig?: SearchQueryConfig\n}>\n\n/**\n * Internal component that reads the current query metadata from QueryContext and fires\n * onQueryResultBundleChange whenever the data changes. Must be rendered as a child of\n * QueryContextProvider (i.e. inside SearchQueryWrapper).\n */\nfunction SearchQueryResultBundleChangeNotifier({\n onQueryResultBundleChange,\n}: {\n onQueryResultBundleChange: (json: string) => void\n}) {\n const { queryMetadataQueryOptions } = useQueryContext()\n // queryMetadataQueryOptions is UseSuspenseQueryOptions; cast to UseQueryOptions so we can use\n // regular (non-suspense) `useQuery` here — the same cache key is shared, so no extra request is made.\n const queryOpts = queryMetadataQueryOptions as UseQueryOptions<\n AsynchronousJobStatus<SearchIndexQuery, QueryResultBundle>,\n SynapseClientError,\n Omit<QueryResultBundle, 'queryResult'>\n >\n const { data } = useQuery(queryOpts)\n // Use a ref so we always call the latest callback without including it in the\n // effect dependency array. Including a frequently-recreated callback in deps\n // causes the effect to re-fire on every render, creating an infinite loop when\n // the parent updates state inside the callback.\n const onQueryResultBundleChangeRef = useRef(onQueryResultBundleChange)\n onQueryResultBundleChangeRef.current = onQueryResultBundleChange\n useEffect(() => {\n if (data) {\n onQueryResultBundleChangeRef.current(JSON.stringify(data))\n }\n }, [data])\n return null\n}\n\nfunction SearchQueryWrapperInternal(props: SearchQueryWrapperProps) {\n return (\n <SessionInitializedGuard>\n <SearchQueryWrapperInternalWithSession {...props} />\n </SessionInitializedGuard>\n )\n}\n\nfunction SearchQueryWrapperInternalWithSession(props: SearchQueryWrapperProps) {\n const {\n initQueryRequest: initQueryRequestFromProps,\n onQueryChange,\n onQueryResultBundleChange,\n isInfinite = false,\n searchIndexId,\n shouldDeepLink = false,\n searchQueryConfig,\n } = props\n\n const { keyFactory, accessToken } = useSynapseContext()\n\n const { data: searchIndexEntityData } = useGetEntity(\n searchIndexId,\n undefined,\n {\n throwOnError: true,\n },\n )\n const searchIndexEntity = searchIndexEntityData as SearchIndex | undefined\n\n const synapseId = searchIndexEntity?.definingSQL\n ? parseEntityIdFromSqlStatement(searchIndexEntity.definingSQL)\n : undefined\n\n const { data: entityBundle } = useGetEntityBundle(\n synapseId,\n undefined,\n { includeTableBundle: true },\n { throwOnError: true },\n )\n const columnModels = entityBundle?.tableBundle?.columnModels\n\n // Build a full synthetic QueryBundleRequest so we can reuse useImmutableTableQuery.\n // The entityId and sql are placeholders; only selectedFacets, limit, offset, and partMask\n // are passed through to the actual SearchQueryServicesApi call.\n const initQueryRequest = useDeepCompareMemoize({\n concreteType:\n 'org.sagebionetworks.repo.model.table.QueryBundleRequest' as const,\n entityId: SEARCH_QUERY_WRAPPER_SYNTHETIC_ENTITY_ID,\n partMask: initQueryRequestFromProps.partMask ?? 0,\n query: {\n sql: SEARCH_QUERY_WRAPPER_SYNTHETIC_SQL,\n selectedFacets: initQueryRequestFromProps.query?.selectedFacets,\n additionalFilters: initQueryRequestFromProps.query?.additionalFilters,\n sort: initQueryRequestFromProps.query?.sort,\n limit: initQueryRequestFromProps.query?.limit,\n offset: initQueryRequestFromProps.query?.offset,\n },\n }) as QueryBundleRequest\n\n const immutableTableQueryResult = useImmutableTableQuery({\n initQueryRequest,\n onQueryChange,\n shouldDeepLink,\n })\n\n const {\n getInitQueryRequest,\n getCurrentQueryRequest,\n setQuery,\n resetQuery,\n removeSelectedFacet,\n removeValueFromSelectedFacet,\n removeQueryFilter,\n removeValueFromQueryFilter,\n nextQueryRequest,\n currentQueryRequest,\n addValueToSelectedFacet,\n setRangeFacetValue,\n resetDebounceTimer,\n currentPage,\n goToPage,\n pageSize,\n setPageSize,\n } = immutableTableQueryResult\n\n // SearchTableQueryUseQueryOptions uses SearchIndexQuery generics rather than QueryBundleRequest.\n // QueryContextType (and all downstream consumers) expect TableQueryUseQueryOptions. The runtime\n // shapes are identical — only the TypeScript generics differ — so a single cast is made here at\n // the architectural boundary rather than scattering `as unknown as` across the implementation.\n const {\n rowDataQueryOptions,\n rowDataInfiniteQueryOptions,\n queryMetadataQueryOptions,\n } = useSearchQueryUseQueryOptions(\n currentQueryRequest as QueryBundleRequest,\n searchIndexId,\n synapseId,\n searchQueryConfig,\n ) as unknown as TableQueryUseQueryOptions\n\n const hasFacetedSelectColumn = useHasFacetedSelectColumn(\n queryMetadataQueryOptions,\n )\n\n const hasResettableFilters = useMemo(() => {\n const request = getCurrentQueryRequest()\n return hasResettableFiltersUtil(request.query, undefined)\n }, [getCurrentQueryRequest])\n\n // Provides page-specific row query options using the search API, so components like\n // usePrefetchTableRows don't accidentally call the standard table query API with the\n // synthetic entity ID.\n const getRowDataQueryOptionsForPage = useCallback(\n (pageNumber: number) => {\n const queryWithUpdatedPage = transformQueryToGoToPage(\n { type: 'goToPage', pageNumber },\n cloneDeep(getCurrentQueryRequest()),\n )\n return (\n getSearchQueryUseQueryOptions(\n queryWithUpdatedPage,\n keyFactory,\n accessToken,\n searchIndexId,\n columnModels,\n searchQueryConfig,\n ) as unknown as TableQueryUseQueryOptions\n ).rowDataQueryOptions\n },\n [\n getCurrentQueryRequest,\n keyFactory,\n accessToken,\n searchIndexId,\n columnModels,\n searchQueryConfig,\n ],\n )\n\n // TODO: useDeepCompareMemoize cannot meaningfully compare functions — it falls back to\n // reference equality for them. The callbacks below (getCurrentQueryRequest, removeSelectedFacet,\n // getRowDataQueryOptionsForPage, etc.) behave identically to a shallow useMemo dep.\n // The correct fix is to deep-compare only serializable data fields and use a plain useMemo for\n // the full context object. QueryWrapper.tsx has the same issue; fix both together in a follow-up.\n const context: QueryContextType = useDeepCompareMemoize({\n isInfinite,\n entityId: synapseId,\n versionNumber: undefined,\n nextQueryRequest,\n currentQueryRequest,\n getCurrentQueryRequest,\n getInitQueryRequest,\n executeQueryRequest: setQuery,\n hasFacetedSelectColumn,\n hasResettableFilters,\n removeSelectedFacet,\n removeValueFromSelectedFacet,\n resetQuery,\n removeQueryFilter,\n removeValueFromQueryFilter,\n addValueToSelectedFacet,\n combineRangeFacetConfig: undefined,\n setRangeFacetValue,\n resetDebounceTimer,\n rowDataQueryOptions,\n rowDataInfiniteQueryOptions,\n queryMetadataQueryOptions,\n currentPage,\n goToPage,\n pageSize,\n setPageSize,\n lockedColumn: undefined,\n fileIdColumnName: undefined,\n fileVersionColumnName: undefined,\n fileNameColumnName: undefined,\n getRowDataQueryOptionsForPage,\n })\n\n return (\n <QueryContextProvider queryContext={context}>\n {onQueryResultBundleChange && (\n <SearchQueryResultBundleChangeNotifier\n onQueryResultBundleChange={onQueryResultBundleChange}\n />\n )}\n {props.children}\n </QueryContextProvider>\n )\n}\n\n/**\n * Provides a QueryContext populated by results from the SearchQueryServicesApi rather than\n * the standard Table Query Services. All subcomponents that consume QueryContext can be\n * used unchanged within a SearchQueryWrapper tree.\n */\nexport function SearchQueryWrapper(props: SearchQueryWrapperProps) {\n return (\n <Provider>\n <SearchQueryWrapperInternal {...props} />\n </Provider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,IAAa,IAA2C,UAC3C,IAAqC,iBAAiB;AAkCnE,SAAS,EAAsC,EAC7C,gCAGC;CACD,IAAM,EAAE,iCAA8B,EAAgB,GAQhD,EAAE,YAAS,EAAS,CAAS,GAK7B,IAA+B,EAAO,CAAyB;CAOrE,OANA,EAA6B,UAAU,GACvC,QAAgB;EACd,AAAI,KACF,EAA6B,QAAQ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