synapse-react-client 4.0.9 → 4.0.11

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 (613) hide show
  1. package/dist/SWC.index.d.ts +1 -0
  2. package/dist/SWC.index.d.ts.map +1 -1
  3. package/dist/SWC.index.js +2 -1
  4. package/dist/SWC.index.js.map +1 -1
  5. package/dist/aridhia-queries/aridhiaTokenExchange.js.map +1 -1
  6. package/dist/aridhia-queries/useGetAridhiaRequests.js.map +1 -1
  7. package/dist/assets/icons/CloudWarning.d.ts +5 -0
  8. package/dist/assets/icons/CloudWarning.d.ts.map +1 -0
  9. package/dist/assets/icons/CloudWarning.js +47 -0
  10. package/dist/assets/icons/CloudWarning.js.map +1 -0
  11. package/dist/assets/icons/TasksIcon.d.ts.map +1 -1
  12. package/dist/assets/icons/TasksIcon.js +6 -10
  13. package/dist/assets/icons/TasksIcon.js.map +1 -1
  14. package/dist/components/AccessRequirementAclEditor/AccessRequirementAclEditor.d.ts.map +1 -1
  15. package/dist/components/AccessRequirementAclEditor/AccessRequirementAclEditor.js +69 -63
  16. package/dist/components/AccessRequirementAclEditor/AccessRequirementAclEditor.js.map +1 -1
  17. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js.map +1 -1
  18. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  19. package/dist/components/AccessRequirementList/AccessRequirementListUtils.js.map +1 -1
  20. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js.map +1 -1
  21. package/dist/components/AccessRequirementList/RequirementItem/SelfSignAccessRequirementItem.js.map +1 -1
  22. package/dist/components/AccessRequirementRelatedProjectsList/AccessRequirementRelatedProjectsList.js.map +1 -1
  23. package/dist/components/AccessTokenPage/AccessTokenCard/AccessTokenCard.js.map +1 -1
  24. package/dist/components/AcknowledgementsPage/StudyAcknowledgements.js.map +1 -1
  25. package/dist/components/AclEditor/PermissionLevelMenu.js.map +1 -1
  26. package/dist/components/AclEditor/ResourceAccessAndUserGroupHeader.js.map +1 -1
  27. package/dist/components/AclEditor/useSortResourceAccessList.js.map +1 -1
  28. package/dist/components/AclEditor/useUpdateAcl.js.map +1 -1
  29. package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
  30. package/dist/components/Authentication/AuthenticationMethodSelection.d.ts.map +1 -1
  31. package/dist/components/Authentication/AuthenticationMethodSelection.js +38 -37
  32. package/dist/components/Authentication/AuthenticationMethodSelection.js.map +1 -1
  33. package/dist/components/Authentication/Constants.d.ts +1 -0
  34. package/dist/components/Authentication/Constants.d.ts.map +1 -1
  35. package/dist/components/Authentication/Constants.js +2 -2
  36. package/dist/components/Authentication/Constants.js.map +1 -1
  37. package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
  38. package/dist/components/Authentication/RecoveryCodeForm.js.map +1 -1
  39. package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
  40. package/dist/components/Authentication/RegenerateBackupCodesWarning.js.map +1 -1
  41. package/dist/components/Authentication/Reset2FAWarning.js.map +1 -1
  42. package/dist/components/Authentication/StandaloneLoginForm.js +1 -1
  43. package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
  44. package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
  45. package/dist/components/Authentication/TwoFactorEnrollmentForm.js +2 -1
  46. package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
  47. package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.js.map +1 -1
  48. package/dist/components/CardContainer/CardContainer.js.map +1 -1
  49. package/dist/components/CardDeck/CardDeck.Mobile.js.map +1 -1
  50. package/dist/components/CardDeck/TableQueryCardDeck.js.map +1 -1
  51. package/dist/components/CertificationQuiz/CertificationQuiz.js.map +1 -1
  52. package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js.map +1 -1
  53. package/dist/components/ChallengeSubmission/ChallengeSubmission.js.map +1 -1
  54. package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js.map +1 -1
  55. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js.map +1 -1
  56. package/dist/components/ChallengeSubmission/EvaluationQueueList.js.map +1 -1
  57. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.d.ts.map +1 -1
  58. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +143 -140
  59. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  60. package/dist/components/ChallengeTeamWizard/ChallengeTeamWizard.js.map +1 -1
  61. package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js.map +1 -1
  62. package/dist/components/ChangePassword/ChangePassword.js.map +1 -1
  63. package/dist/components/ChangePassword/ChangePasswordWithToken.js.map +1 -1
  64. package/dist/components/ChangePassword/useChangePasswordFormState.js +1 -1
  65. package/dist/components/ChangePassword/useChangePasswordFormState.js.map +1 -1
  66. package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
  67. package/dist/components/ColumnFilter/ColumnFilter.js.map +1 -1
  68. package/dist/components/ComponentCollapse.js.map +1 -1
  69. package/dist/components/CookiesNotification/CookiesNotification.js.map +1 -1
  70. package/dist/components/CreateProjectModal/CreateProjectModal.js.map +1 -1
  71. package/dist/components/CreateTableViewWizard/CreateTableViewWizardUtils.js.map +1 -1
  72. package/dist/components/DataGrid/DataGrid.d.ts +0 -1
  73. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  74. package/dist/components/DataGrid/DataGrid.js +72 -72
  75. package/dist/components/DataGrid/DataGrid.js.map +1 -1
  76. package/dist/components/DataGrid/DataGridWebSocket.d.ts +4 -0
  77. package/dist/components/DataGrid/DataGridWebSocket.d.ts.map +1 -1
  78. package/dist/components/DataGrid/DataGridWebSocket.js +9 -8
  79. package/dist/components/DataGrid/DataGridWebSocket.js.map +1 -1
  80. package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
  81. package/dist/components/DataGrid/SynapseGrid.js +326 -268
  82. package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
  83. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts +2 -0
  84. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts.map +1 -1
  85. package/dist/components/DataGrid/columns/AutocompleteColumn.js +124 -67
  86. package/dist/components/DataGrid/columns/AutocompleteColumn.js.map +1 -1
  87. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.d.ts +2 -1
  88. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.d.ts.map +1 -1
  89. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.js +126 -122
  90. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.js.map +1 -1
  91. package/dist/components/DataGrid/columns/useGridAutocompleteState.d.ts +58 -0
  92. package/dist/components/DataGrid/columns/useGridAutocompleteState.d.ts.map +1 -0
  93. package/dist/components/DataGrid/columns/useGridAutocompleteState.js +52 -0
  94. package/dist/components/DataGrid/columns/useGridAutocompleteState.js.map +1 -0
  95. package/dist/components/DataGrid/components/ValidationAlert.d.ts +5 -2
  96. package/dist/components/DataGrid/components/ValidationAlert.d.ts.map +1 -1
  97. package/dist/components/DataGrid/components/ValidationAlert.js +429 -24
  98. package/dist/components/DataGrid/components/ValidationAlert.js.map +1 -1
  99. package/dist/components/DataGrid/hooks/useColumnResizeHandles.js.map +1 -1
  100. package/dist/components/DataGrid/hooks/useGetSchemaForGrid.js.map +1 -1
  101. package/dist/components/DataGrid/hooks/useGridUndoRedo.js.map +1 -1
  102. package/dist/components/DataGrid/hooks/useStack.js.map +1 -1
  103. package/dist/components/DataGrid/useCRDTModelView.js.map +1 -1
  104. package/dist/components/DataGrid/useDataGridWebsocket.d.ts +7 -0
  105. package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
  106. package/dist/components/DataGrid/useDataGridWebsocket.js +16 -2
  107. package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
  108. package/dist/components/DataGrid/useInitializeGridConnection.js.map +1 -1
  109. package/dist/components/DataGrid/useMergeGridWithRecordSet.js.map +1 -1
  110. package/dist/components/DataGrid/useMergeGridWithSource.js.map +1 -1
  111. package/dist/components/DataGrid/useMergeGridWithTable.js.map +1 -1
  112. package/dist/components/DataGrid/utils/DataGridUtils.js.map +1 -1
  113. package/dist/components/DataGrid/utils/applyModelChange.d.ts +1 -1
  114. package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
  115. package/dist/components/DataGrid/utils/applyModelChange.js +27 -24
  116. package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
  117. package/dist/components/DataGrid/utils/columnFactory.d.ts +8 -0
  118. package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
  119. package/dist/components/DataGrid/utils/columnFactory.js +47 -44
  120. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  121. package/dist/components/DataGrid/utils/computeReplicaSelectionModel.js.map +1 -1
  122. package/dist/components/DataGrid/utils/extractColumnValidationMessages.js.map +1 -1
  123. package/dist/components/DataGrid/utils/getCellClassName.d.ts.map +1 -1
  124. package/dist/components/DataGrid/utils/getCellClassName.js +8 -8
  125. package/dist/components/DataGrid/utils/getCellClassName.js.map +1 -1
  126. package/dist/components/DataGrid/utils/getEmptyValue.d.ts +2 -0
  127. package/dist/components/DataGrid/utils/getEmptyValue.d.ts.map +1 -0
  128. package/dist/components/DataGrid/utils/getEmptyValue.js +8 -0
  129. package/dist/components/DataGrid/utils/getEmptyValue.js.map +1 -0
  130. package/dist/components/DataGrid/utils/json-rx/JsonRx.js.map +1 -1
  131. package/dist/components/DataGrid/utils/modelColsToGrid.d.ts.map +1 -1
  132. package/dist/components/DataGrid/utils/modelColsToGrid.js +2 -1
  133. package/dist/components/DataGrid/utils/modelColsToGrid.js.map +1 -1
  134. package/dist/components/DataGrid/utils/modelRowsToGrid.js.map +1 -1
  135. package/dist/components/DataGrid/utils/parseFreeTextUsingJsonSchemaType.js.map +1 -1
  136. package/dist/components/DataGrid/utils/schemaAwarePasteValue.d.ts +32 -0
  137. package/dist/components/DataGrid/utils/schemaAwarePasteValue.d.ts.map +1 -0
  138. package/dist/components/DataGrid/utils/schemaAwarePasteValue.js +22 -0
  139. package/dist/components/DataGrid/utils/schemaAwarePasteValue.js.map +1 -0
  140. package/dist/components/DataGrid/utils/splitPatch.js.map +1 -1
  141. package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
  142. package/dist/components/DirectDownload/DirectDownload.js.map +1 -1
  143. package/dist/components/DirectDownloadButton.js.map +1 -1
  144. package/dist/components/DownloadCart/CreatePackageV2.js.map +1 -1
  145. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.css +1 -0
  146. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
  147. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +199 -132
  148. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  149. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js +22 -0
  150. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -0
  151. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +170 -0
  152. package/dist/components/DownloadCart/DownloadListActionsRequired.js.map +1 -1
  153. package/dist/components/DownloadCart/DownloadListTable.js.map +1 -1
  154. package/dist/components/DownloadCart/fileNameUtils.js.map +1 -1
  155. package/dist/components/DraggableDialog/DraggableDialog.js.map +1 -1
  156. package/dist/components/DynamicForm/DynamicFormModal.js.map +1 -1
  157. package/dist/components/Ecosystem/TableQueryEcosystem.js.map +1 -1
  158. package/dist/components/EntityAclEditor/EntityAclEditor.d.ts.map +1 -1
  159. package/dist/components/EntityAclEditor/EntityAclEditor.js +103 -103
  160. package/dist/components/EntityAclEditor/EntityAclEditor.js.map +1 -1
  161. package/dist/components/EntityAclEditor/useNotifyNewACLUsers.js.map +1 -1
  162. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
  163. package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
  164. package/dist/components/EntityDownloadButton/EntityDownloadButton.d.ts.map +1 -1
  165. package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -0
  166. package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
  167. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.d.ts.map +1 -1
  168. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js +36 -30
  169. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js.map +1 -1
  170. package/dist/components/EntityFinder/EntityFinder.js.map +1 -1
  171. package/dist/components/EntityFinder/VersionSelectionType.js.map +1 -1
  172. package/dist/components/EntityFinder/details/configurations/EntityChildrenDetails.js.map +1 -1
  173. package/dist/components/EntityFinder/details/configurations/FavoritesDetails.js.map +1 -1
  174. package/dist/components/EntityFinder/details/configurations/ProjectListDetails.js.map +1 -1
  175. package/dist/components/EntityFinder/details/view/DetailsView.js.map +1 -1
  176. package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
  177. package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
  178. package/dist/components/EntityFinder/useEntitySelection.js.map +1 -1
  179. package/dist/components/EntityForm/EntityForm.js.map +1 -1
  180. package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
  181. package/dist/components/EntityHeaderTable/Filter.js.map +1 -1
  182. package/dist/components/EntityHeaderTable/useEntityHeaderTableState.js.map +1 -1
  183. package/dist/components/EntitySubjectsSelector/EntitySubjectsSelector.js.map +1 -1
  184. package/dist/components/EntityTreeTable/components/IdColumnHeader.js.map +1 -1
  185. package/dist/components/EntityTreeTable/hooks/useEntityTreeState.js.map +1 -1
  186. package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
  187. package/dist/components/EntityTreeTable/hooks/useTableData.js.map +1 -1
  188. package/dist/components/EntityTreeTable/hooks/useTreeOperationsWithDirectFetch.js.map +1 -1
  189. package/dist/components/EntityUpload/EntityUpload.js.map +1 -1
  190. package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.d.ts.map +1 -1
  191. package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.js +15 -14
  192. package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.js.map +1 -1
  193. package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
  194. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js.map +1 -1
  195. package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
  196. package/dist/components/FeaturedDataTabs/QueryPerFacetPlotsCard.js.map +1 -1
  197. package/dist/components/FeaturedDataTabs/SingleQueryFacetPlotsCards.js.map +1 -1
  198. package/dist/components/FeaturedResearch/FeaturedResearch.js.map +1 -1
  199. package/dist/components/FeaturedToolsList/FeaturedToolsList.js.map +1 -1
  200. package/dist/components/FilePreview/FileHandleContentRenderer.js.map +1 -1
  201. package/dist/components/FilePreview/HtmlPreview/HtmlPreview.js.map +1 -1
  202. package/dist/components/FilePreview/PreviewRendererType.js.map +1 -1
  203. package/dist/components/Forum/DiscussionReply.d.ts +1 -0
  204. package/dist/components/Forum/DiscussionReply.d.ts.map +1 -1
  205. package/dist/components/Forum/DiscussionReply.js +19 -19
  206. package/dist/components/Forum/DiscussionReply.js.map +1 -1
  207. package/dist/components/Forum/DiscussionSearchResult.js.map +1 -1
  208. package/dist/components/Forum/DiscussionThread.d.ts +1 -0
  209. package/dist/components/Forum/DiscussionThread.d.ts.map +1 -1
  210. package/dist/components/Forum/DiscussionThread.js +73 -72
  211. package/dist/components/Forum/DiscussionThread.js.map +1 -1
  212. package/dist/components/Forum/ForumTable.js.map +1 -1
  213. package/dist/components/Forum/ForumThreadEditor.js.map +1 -1
  214. package/dist/components/FullTextSearch/FullTextSearchUtils.js.map +1 -1
  215. package/dist/components/GenericCard/BioregistryRules.d.ts.map +1 -1
  216. package/dist/components/GenericCard/BioregistryRules.js +7 -3
  217. package/dist/components/GenericCard/BioregistryRules.js.map +1 -1
  218. package/dist/components/GenericCard/GenericCard.d.ts.map +1 -1
  219. package/dist/components/GenericCard/GenericCard.js +12 -7
  220. package/dist/components/GenericCard/GenericCard.js.map +1 -1
  221. package/dist/components/GenericCard/Linkify.js.map +1 -1
  222. package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
  223. package/dist/components/GenericCard/TableRowGenericCard.js +105 -105
  224. package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
  225. package/dist/components/Goals/Goals.Mobile.js.map +1 -1
  226. package/dist/components/Goals/Goals.js.map +1 -1
  227. package/dist/components/GoalsV2/GoalsV2.Mobile.js.map +1 -1
  228. package/dist/components/GoalsV2/GoalsV2.js.map +1 -1
  229. package/dist/components/GoalsV3/GoalsV3.Mobile.js.map +1 -1
  230. package/dist/components/GoalsV3/GoalsV3.js.map +1 -1
  231. package/dist/components/GoogleMap/SynapseUserMarker.js.map +1 -1
  232. package/dist/components/HasAccess/AccessIcon.js.map +1 -1
  233. package/dist/components/HasAccess/useHasAccess.js.map +1 -1
  234. package/dist/components/HeaderCard/HeaderCardV2.js.map +1 -1
  235. package/dist/components/HeaderCard.d.ts +6 -1
  236. package/dist/components/HeaderCard.d.ts.map +1 -1
  237. package/dist/components/HeaderCard.js +107 -76
  238. package/dist/components/HeaderCard.js.map +1 -1
  239. package/dist/components/HexGrid/HexGrid.js.map +1 -1
  240. package/dist/components/IconList.js.map +1 -1
  241. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  242. package/dist/components/IconSvg/IconSvg.js +2 -1
  243. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  244. package/dist/components/ImageCardGridWithLinks/ImageCardGridWithLinks.js.map +1 -1
  245. package/dist/components/ImageFromSynapseTable.js.map +1 -1
  246. package/dist/components/JSONArrayEditor/useParseCsv.js.map +1 -1
  247. package/dist/components/JsonSchemaForm/templates/ArrayFieldDescriptionTemplate.js.map +1 -1
  248. package/dist/components/JsonSchemaForm/templates/ArrayFieldItemTemplate.js.map +1 -1
  249. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js.map +1 -1
  250. package/dist/components/JsonSchemaForm/templates/FieldTemplate.js.map +1 -1
  251. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
  252. package/dist/components/Markdown/MarkdownGithub.js.map +1 -1
  253. package/dist/components/Markdown/MarkdownSynapse.js.map +1 -1
  254. package/dist/components/Markdown/MarkdownUtils.js.map +1 -1
  255. package/dist/components/Markdown/SynapseWikiContext.js.map +1 -1
  256. package/dist/components/Markdown/UserMentionModal.js.map +1 -1
  257. package/dist/components/Markdown/widget/MarkdownProvenanceGraph.js.map +1 -1
  258. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
  259. package/dist/components/ModalDownload/ModalDownload.js.map +1 -1
  260. package/dist/components/OAuthClientAclEditor/OAuthClientAclEditor.d.ts.map +1 -1
  261. package/dist/components/OAuthClientAclEditor/OAuthClientAclEditor.js +45 -39
  262. package/dist/components/OAuthClientAclEditor/OAuthClientAclEditor.js.map +1 -1
  263. package/dist/components/OAuthClientManagement/OAuthManagement.js.map +1 -1
  264. package/dist/components/PageProgress/PageProgress.js.map +1 -1
  265. package/dist/components/Plot/DotPlot.js.map +1 -1
  266. package/dist/components/Plot/Plot.js.map +1 -1
  267. package/dist/components/Plot/SynapsePlot.js.map +1 -1
  268. package/dist/components/Plot/ThemesPlot.js.map +1 -1
  269. package/dist/components/Plot/UpsetPlot.js.map +1 -1
  270. package/dist/components/PortalAclEditor/PortalAclEditor.d.ts.map +1 -1
  271. package/dist/components/PortalAclEditor/PortalAclEditor.js +43 -41
  272. package/dist/components/PortalAclEditor/PortalAclEditor.js.map +1 -1
  273. package/dist/components/PortalFeaturedPartners/PortalFeaturedPartners.js.map +1 -1
  274. package/dist/components/PortalList/CreatePortalModal.js.map +1 -1
  275. package/dist/components/ProgrammaticInstructionsModal/ProgrammaticInstructionsModal.js.map +1 -1
  276. package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js.map +1 -1
  277. package/dist/components/Programs/Programs.Mobile.js.map +1 -1
  278. package/dist/components/Programs/Programs.js.map +1 -1
  279. package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js.map +1 -1
  280. package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
  281. package/dist/components/ProvenanceGraph/ProvenanceGraphUtils.js.map +1 -1
  282. package/dist/components/ProvenanceGraph/ProvenanceUtils.js.map +1 -1
  283. package/dist/components/QueryCount/QueryCount.js.map +1 -1
  284. package/dist/components/QueryCountButton/QueryCountButton.js.map +1 -1
  285. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
  286. package/dist/components/QueryWrapper/QueryWrapper.js.map +1 -1
  287. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js.map +1 -1
  288. package/dist/components/QueryWrapper/TableRowSelectionState.js.map +1 -1
  289. package/dist/components/QueryWrapper/generateEncodedPathAndQueryForSelectedFacetURL.js.map +1 -1
  290. package/dist/components/QueryWrapper/useGetQueryMetadata.js.map +1 -1
  291. package/dist/components/QueryWrapperErrorBoundary.js.map +1 -1
  292. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
  293. package/dist/components/QueryWrapperPlotNav/UseRowSet.js.map +1 -1
  294. package/dist/components/RecentPublicationsGrid/RecentPublicationsGrid.js.map +1 -1
  295. package/dist/components/ReleaseCard/ReleaseCardUtils.js.map +1 -1
  296. package/dist/components/ResizableContainer/hooks/useResizable.js.map +1 -1
  297. package/dist/components/Resources/Resources.Mobile.js.map +1 -1
  298. package/dist/components/Resources/Resources.js.map +1 -1
  299. package/dist/components/RowDataTable/RowDataTableWithQuery.js.map +1 -1
  300. package/dist/components/SageResourcesPopover/SageResourcesPopover.js.map +1 -1
  301. package/dist/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.js.map +1 -1
  302. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  303. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
  304. package/dist/components/SmartLink/SmartButton.js.map +1 -1
  305. package/dist/components/SmartLink/SmartLink.js.map +1 -1
  306. package/dist/components/SourceAppImage.js.map +1 -1
  307. package/dist/components/StandaloneQueryWrapper/StandaloneQueryWrapper.js.map +1 -1
  308. package/dist/components/StatisticsPlot.js.map +1 -1
  309. package/dist/components/StorybookComponentWrapper.js.map +1 -1
  310. package/dist/components/SubsectionRowRenderer/SubsectionRowRenderer.js.map +1 -1
  311. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js.map +1 -1
  312. package/dist/components/SynapseChat/GridAgentChat.js.map +1 -1
  313. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  314. package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
  315. package/dist/components/SynapseChat/extractMessageFromTraceEvent.js.map +1 -1
  316. package/dist/components/SynapseForm/StepsSideNav.js.map +1 -1
  317. package/dist/components/SynapseForm/SummaryTable.js.map +1 -1
  318. package/dist/components/SynapseForm/SynapseForm.js +4 -2
  319. package/dist/components/SynapseForm/SynapseForm.js.map +1 -1
  320. package/dist/components/SynapseForm/SynapseFormWrapper.js.map +1 -1
  321. package/dist/components/SynapseHomepageV2/SynapseByTheNumbersItem.js.map +1 -1
  322. package/dist/components/SynapseHomepageV2/SynapseFeatureItem.js.map +1 -1
  323. package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js.map +1 -1
  324. package/dist/components/SynapseHomepageV2/SynapseHomepageSearch.js.map +1 -1
  325. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js.map +1 -1
  326. package/dist/components/SynapseHomepageV2/SynapsePlans.js.map +1 -1
  327. package/dist/components/SynapseHomepageV2/SynapseTrendingProjects.js.map +1 -1
  328. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts +8 -7
  329. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
  330. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +173 -164
  331. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
  332. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
  333. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanel.js.map +1 -1
  334. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js.map +1 -1
  335. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js.map +1 -1
  336. package/dist/components/SynapseTable/EntityIDColumnCopyIcon.js.map +1 -1
  337. package/dist/components/SynapseTable/NoContentPlaceholderType.js.map +1 -1
  338. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
  339. package/dist/components/SynapseTable/SynapseTableCell/SynapseTableCell.js.map +1 -1
  340. package/dist/components/SynapseTable/SynapseTableRenderers.js.map +1 -1
  341. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  342. package/dist/components/SynapseTable/table-top/ColumnSelection.js.map +1 -1
  343. package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
  344. package/dist/components/SynapseTable/usePrefetchTableData.js.map +1 -1
  345. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  346. package/dist/components/TableColumnSchemaEditor/ColumnModelFormFields/DefaultValueField.js.map +1 -1
  347. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js.map +1 -1
  348. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts +1 -1
  349. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
  350. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
  351. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  352. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormReducer.js.map +1 -1
  353. package/dist/components/TableColumnSchemaEditor/Validators/ColumnModelValidator.js.map +1 -1
  354. package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js.map +1 -1
  355. package/dist/components/TanStackTable/ColumnHeader.d.ts +1 -0
  356. package/dist/components/TanStackTable/ColumnHeader.d.ts.map +1 -1
  357. package/dist/components/TanStackTable/ColumnHeader.js +8 -8
  358. package/dist/components/TanStackTable/ColumnHeader.js.map +1 -1
  359. package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js.map +1 -1
  360. package/dist/components/TanStackTable/TableBody.js.map +1 -1
  361. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js.map +1 -1
  362. package/dist/components/TextField/TextField.js.map +1 -1
  363. package/dist/components/TimelinePlot/TimelinePhase.js.map +1 -1
  364. package/dist/components/TimelinePlot/TimelinePlot.js.map +1 -1
  365. package/dist/components/TimelinePlot/TimelinePlotSpeciesSelector.js.map +1 -1
  366. package/dist/components/UserCard/Avatar.js.map +1 -1
  367. package/dist/components/UserCardList/UserCardList.js.map +1 -1
  368. package/dist/components/UserCardList/UserCardListGroups/UserCardListGroups.Mobile.js.map +1 -1
  369. package/dist/components/UserCardList/UserCardListRotate.js.map +1 -1
  370. package/dist/components/UserOrTeamBadge/useUserOrTeam.js.map +1 -1
  371. package/dist/components/UserProfileLinks/UserProjects.js.map +1 -1
  372. package/dist/components/UserSearchBox/UserSearchBox.js.map +1 -1
  373. package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
  374. package/dist/components/WikiMarkdownEditor/WikiMarkdownEditor.js.map +1 -1
  375. package/dist/components/WikiMarkdownEditorButton/WikiMarkdownEditorButton.js.map +1 -1
  376. package/dist/components/dataaccess/AccessApprovalsTable.js.map +1 -1
  377. package/dist/components/dataaccess/AccessRequestSubmissionTable.js.map +1 -1
  378. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.d.ts.map +1 -1
  379. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +157 -148
  380. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js.map +1 -1
  381. package/dist/components/dataaccess/UseAccessRequirementTable.js.map +1 -1
  382. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryTable.js.map +1 -1
  383. package/dist/components/doi/CreateOrUpdateDoiModal.d.ts.map +1 -1
  384. package/dist/components/doi/CreateOrUpdateDoiModal.js +20 -19
  385. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  386. package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
  387. package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
  388. package/dist/components/entity/page/title_bar/useDataCiteUsage.js.map +1 -1
  389. package/dist/components/entity/page/title_bar/useGetMentions.js.map +1 -1
  390. package/dist/components/error/ErrorPage.js.map +1 -1
  391. package/dist/components/favorites/FavoritesPage.js.map +1 -1
  392. package/dist/components/file/upload/BasicFileHandleUpload.js.map +1 -1
  393. package/dist/components/layout/SWCHeader.d.ts +9 -0
  394. package/dist/components/layout/SWCHeader.d.ts.map +1 -0
  395. package/dist/components/layout/SWCHeader.js +19 -0
  396. package/dist/components/layout/SWCHeader.js.map +1 -0
  397. package/dist/components/layout/SWCPageLayout.d.ts +9 -0
  398. package/dist/components/layout/SWCPageLayout.d.ts.map +1 -0
  399. package/dist/components/layout/SWCPageLayout.js +14 -0
  400. package/dist/components/layout/SWCPageLayout.js.map +1 -0
  401. package/dist/components/menu/ComplexMenu.js.map +1 -1
  402. package/dist/components/row_renderers/utils/ChipContainer.js.map +1 -1
  403. package/dist/components/styled/StyledPopover.js.map +1 -1
  404. package/dist/components/table/CsvPreview/CsvPreview.js +2 -1
  405. package/dist/components/table/CsvPreview/CsvPreview.js.map +1 -1
  406. package/dist/components/table/CsvPreview/CsvPreviewDialog.js.map +1 -1
  407. package/dist/components/trash/TrashCanList.js.map +1 -1
  408. package/dist/components/widgets/FileHandleLink.js.map +1 -1
  409. package/dist/components/widgets/RangeSlider/RangeSlider.js.map +1 -1
  410. package/dist/components/widgets/SynapseVideo.js.map +1 -1
  411. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  412. package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
  413. package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js.map +1 -1
  414. package/dist/components/widgets/facet-nav/useFacetPlots.js.map +1 -1
  415. package/dist/components/widgets/query-filter/CombinedRangeFacetFilter.js.map +1 -1
  416. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
  417. package/dist/components/widgets/query-filter/FacetFilterControls.js.map +1 -1
  418. package/dist/components/widgets/query-filter/RangeFacetFilter.js.map +1 -1
  419. package/dist/components/widgets/query-filter/RangeFacetFilterUI.js.map +1 -1
  420. package/dist/features/curator/GridPage/components/GridPageTitle.d.ts.map +1 -1
  421. package/dist/features/curator/GridPage/components/GridPageTitle.js +23 -30
  422. package/dist/features/curator/GridPage/components/GridPageTitle.js.map +1 -1
  423. package/dist/features/curator/dashboard/CuratorDashboard.d.ts +2 -0
  424. package/dist/features/curator/dashboard/CuratorDashboard.d.ts.map +1 -0
  425. package/dist/features/curator/dashboard/CuratorDashboard.js +45 -0
  426. package/dist/features/curator/dashboard/CuratorDashboard.js.map +1 -0
  427. package/dist/features/curator/dashboard/components/CurationTaskCard.css +1 -0
  428. package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts +9 -0
  429. package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts.map +1 -0
  430. package/dist/features/curator/dashboard/components/CurationTaskCard.js +106 -0
  431. package/dist/features/curator/dashboard/components/CurationTaskCard.js.map +1 -0
  432. package/dist/features/curator/dashboard/components/CurationTaskCard.module.js +12 -0
  433. package/dist/features/curator/dashboard/components/CurationTaskCard.module.js.map +1 -0
  434. package/dist/features/curator/dashboard/components/CurationTaskCard.module.scss +52 -0
  435. package/dist/features/curator/dashboard/components/NextStepButton.css +1 -0
  436. package/dist/features/curator/dashboard/components/NextStepButton.d.ts +14 -0
  437. package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -0
  438. package/dist/features/curator/dashboard/components/NextStepButton.js +35 -0
  439. package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -0
  440. package/dist/features/curator/dashboard/components/NextStepButton.module.js +11 -0
  441. package/dist/features/curator/dashboard/components/NextStepButton.module.js.map +1 -0
  442. package/dist/features/curator/dashboard/components/NextStepButton.module.scss +57 -0
  443. package/dist/features/curator/dashboard/components/UserOrTeamChip.css +1 -1
  444. package/dist/features/curator/dashboard/components/UserOrTeamChip.module.js +1 -1
  445. package/dist/features/curator/dashboard/components/UserOrTeamChip.module.js.map +1 -1
  446. package/dist/features/curator/dashboard/components/UserOrTeamChip.module.scss +5 -5
  447. package/dist/features/curator/dashboard/components/shared.css +1 -0
  448. package/dist/features/curator/dashboard/components/shared.module.js +5 -0
  449. package/dist/features/curator/dashboard/components/shared.module.js.map +1 -0
  450. package/dist/features/curator/dashboard/components/shared.module.scss +8 -0
  451. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.d.ts +0 -2
  452. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.d.ts.map +1 -1
  453. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +16 -34
  454. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
  455. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.d.ts.map +1 -1
  456. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
  457. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
  458. package/dist/features/entity/metadata-task/hooks/useGetOrCreateGridSessionForSource.js.map +1 -1
  459. package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.js.map +1 -1
  460. package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.js.map +1 -1
  461. package/dist/features/entity/metadata-task/hooks/useMetadataTaskTable.js +1 -1
  462. package/dist/features/entity/metadata-task/hooks/useMetadataTaskTable.js.map +1 -1
  463. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts +10 -0
  464. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts.map +1 -0
  465. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js +37 -0
  466. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js.map +1 -0
  467. package/dist/features/entity/metadata-task/utils/constants.d.ts +5 -0
  468. package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -0
  469. package/dist/features/entity/metadata-task/utils/constants.js +6 -0
  470. package/dist/features/entity/metadata-task/utils/constants.js.map +1 -0
  471. package/dist/mocks/challenge/mockChallenge.js.map +1 -1
  472. package/dist/mocks/entity/mockDataset.js.map +1 -1
  473. package/dist/mocks/entity/mockDatasetCollection.js.map +1 -1
  474. package/dist/mocks/entity/mockFileEntity.js.map +1 -1
  475. package/dist/mocks/entity/mockFileView.js.map +1 -1
  476. package/dist/mocks/entity/mockGeneratedEntityData.js.map +1 -1
  477. package/dist/mocks/entity/mockProject.js.map +1 -1
  478. package/dist/mocks/entity/mockProjectView.js.map +1 -1
  479. package/dist/mocks/entity/mockRootEntity.js.map +1 -1
  480. package/dist/mocks/entity/mockTableEntity.js.map +1 -1
  481. package/dist/mocks/mockWiki.js.map +1 -1
  482. package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
  483. package/dist/mocks/msw/handlers/challengeHandlers.js.map +1 -1
  484. package/dist/mocks/msw/handlers/changePasswordHandlers.js.map +1 -1
  485. package/dist/mocks/msw/handlers/discussionHandlers.js.map +1 -1
  486. package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
  487. package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
  488. package/dist/mocks/msw/handlers/gridHandlers.js.map +1 -1
  489. package/dist/mocks/msw/handlers/personalAccessTokenHandlers.js.map +1 -1
  490. package/dist/mocks/msw/handlers/subscriptionHandlers.js.map +1 -1
  491. package/dist/mocks/msw/handlers/teamHandlers.js.map +1 -1
  492. package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
  493. package/dist/mocks/msw/handlers/wikiHandlers.js.map +1 -1
  494. package/dist/mocks/provenance/mockActivity.js.map +1 -1
  495. package/dist/mocks/query/mockReleaseCardsTableQueryResultBundle.js.map +1 -1
  496. package/dist/ror-client/index.js.map +1 -1
  497. package/dist/style/components/_cards.scss +4 -0
  498. package/dist/style/components/_data-grid-extra.css +1 -1
  499. package/dist/style/components/_data-grid-extra.scss +2 -0
  500. package/dist/style/main.css +1 -1
  501. package/dist/synapse-client/HttpClient.js.map +1 -1
  502. package/dist/synapse-client/SynapseClient.js.map +1 -1
  503. package/dist/synapse-queries/KeyFactory.d.ts +1 -0
  504. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  505. package/dist/synapse-queries/KeyFactory.js +3 -0
  506. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  507. package/dist/synapse-queries/QueryMatching.test-utils.js.map +1 -1
  508. package/dist/synapse-queries/auth/useTwoFactorEnrollment.js.map +1 -1
  509. package/dist/synapse-queries/curation/task/useCurationTask.d.ts +1 -1
  510. package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
  511. package/dist/synapse-queries/curation/task/useCurationTask.js +1 -1
  512. package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
  513. package/dist/synapse-queries/dataaccess/useRestrictionInformation.js.map +1 -1
  514. package/dist/synapse-queries/doi/useDOI.js.map +1 -1
  515. package/dist/synapse-queries/download/useDownloadList.js.map +1 -1
  516. package/dist/synapse-queries/entity/useEntity.js.map +1 -1
  517. package/dist/synapse-queries/entity/useEntityBundle.js.map +1 -1
  518. package/dist/synapse-queries/entity/useExportTableQueryToAnalysisPlatform.js.map +1 -1
  519. package/dist/synapse-queries/entity/useExportToTerra.js.map +1 -1
  520. package/dist/synapse-queries/entity/useGetQueryResultBundle.js.map +1 -1
  521. package/dist/synapse-queries/entity/useSchema.js.map +1 -1
  522. package/dist/synapse-queries/file/UploadToS3.js.map +1 -1
  523. package/dist/synapse-queries/file/useDirectUploadToS3.js.map +1 -1
  524. package/dist/synapse-queries/file/useFiles.js.map +1 -1
  525. package/dist/synapse-queries/forum/useReply.js.map +1 -1
  526. package/dist/synapse-queries/forum/useThread.d.ts +1 -0
  527. package/dist/synapse-queries/forum/useThread.d.ts.map +1 -1
  528. package/dist/synapse-queries/forum/useThread.js +19 -12
  529. package/dist/synapse-queries/forum/useThread.js.map +1 -1
  530. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.d.ts +2 -0
  531. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.d.ts.map +1 -1
  532. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js.map +1 -1
  533. package/dist/synapse-queries/grid/useExportGrid.js.map +1 -1
  534. package/dist/synapse-queries/grid/useGridSession.js.map +1 -1
  535. package/dist/synapse-queries/grid/useImportCsvIntoGrid.js.map +1 -1
  536. package/dist/synapse-queries/subscription/useSubscription.js.map +1 -1
  537. package/dist/synapse-queries/table/useGetCsvPreview.js.map +1 -1
  538. package/dist/synapse-queries/table/useTableUpdateTransaction.js.map +1 -1
  539. package/dist/synapse-queries/team/useTeamMembers.js.map +1 -1
  540. package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
  541. package/dist/synapse-queries/user/useUserBundle.js.map +1 -1
  542. package/dist/synapse-queries/user/useUserGroupHeader.js.map +1 -1
  543. package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
  544. package/dist/theme/ThemeProvider.js.map +1 -1
  545. package/dist/tsconfig.build.tsbuildinfo +1 -1
  546. package/dist/utils/APIConstants.d.ts +1 -0
  547. package/dist/utils/APIConstants.d.ts.map +1 -1
  548. package/dist/utils/APIConstants.js +2 -2
  549. package/dist/utils/APIConstants.js.map +1 -1
  550. package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
  551. package/dist/utils/AppUtils/session/ApplicationSessionManager.js +7 -4
  552. package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
  553. package/dist/utils/AppUtils/session/SynapseSessionManager.js.map +1 -1
  554. package/dist/utils/AppUtils/session/useSessionManager.js.map +1 -1
  555. package/dist/utils/PermissionLevelToAccessType.js.map +1 -1
  556. package/dist/utils/challenge/evaluation/EvaluationUtils.js.map +1 -1
  557. package/dist/utils/context/SynapseContext.js.map +1 -1
  558. package/dist/utils/functions/AccessControlListUtils.d.ts +4 -0
  559. package/dist/utils/functions/AccessControlListUtils.d.ts.map +1 -1
  560. package/dist/utils/functions/AccessControlListUtils.js +12 -1
  561. package/dist/utils/functions/AccessControlListUtils.js.map +1 -1
  562. package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
  563. package/dist/utils/functions/EntityTypeUtils.js +15 -4
  564. package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
  565. package/dist/utils/functions/GridApiUtils.js.map +1 -1
  566. package/dist/utils/functions/QueryFilterUtils.js.map +1 -1
  567. package/dist/utils/functions/RealmUtils.d.ts +4 -0
  568. package/dist/utils/functions/RealmUtils.d.ts.map +1 -1
  569. package/dist/utils/functions/RealmUtils.js +9 -3
  570. package/dist/utils/functions/RealmUtils.js.map +1 -1
  571. package/dist/utils/functions/SanitizeHtmlUtils.js.map +1 -1
  572. package/dist/utils/functions/SanitizeHtmlUtils.test-utils.js.map +1 -1
  573. package/dist/utils/functions/SqlFunctions.js.map +1 -1
  574. package/dist/utils/functions/StringUtils.js.map +1 -1
  575. package/dist/utils/functions/deepLinkingUtils.js.map +1 -1
  576. package/dist/utils/functions/getDataFromFromStorage.js.map +1 -1
  577. package/dist/utils/functions/getEndpoint.js.map +1 -1
  578. package/dist/utils/functions/getUserData.js.map +1 -1
  579. package/dist/utils/functions/queryUtils.js.map +1 -1
  580. package/dist/utils/functions/testDownloadSpeed.js.map +1 -1
  581. package/dist/utils/hooks/useConfirmItems.js.map +1 -1
  582. package/dist/utils/hooks/useCookiePreferences.js.map +1 -1
  583. package/dist/utils/hooks/useCreateShortUrl.js.map +1 -1
  584. package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
  585. package/dist/utils/hooks/useDirectDownloadHandler.js.map +1 -1
  586. package/dist/utils/hooks/useGetGoalData.js.map +1 -1
  587. package/dist/utils/hooks/useGetInfoFromIds.js.map +1 -1
  588. package/dist/utils/hooks/useImageUrlUtils.js.map +1 -1
  589. package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
  590. package/dist/utils/hooks/useImmutableTableQuery/useTableQueryReducer.js.map +1 -1
  591. package/dist/utils/hooks/useIsBot.js.map +1 -1
  592. package/dist/utils/hooks/useListState.js.map +1 -1
  593. package/dist/utils/hooks/useLogin.d.ts.map +1 -1
  594. package/dist/utils/hooks/useLogin.js +53 -52
  595. package/dist/utils/hooks/useLogin.js.map +1 -1
  596. package/dist/utils/hooks/useMutuallyExclusiveState.js.map +1 -1
  597. package/dist/utils/hooks/useOverlay.js.map +1 -1
  598. package/dist/utils/hooks/usePreFetchResource.js.map +1 -1
  599. package/dist/utils/hooks/useQuerySearchParam.js.map +1 -1
  600. package/dist/utils/hooks/useScrollFadeTransition.js.map +1 -1
  601. package/dist/utils/hooks/useSet.js.map +1 -1
  602. package/dist/utils/hooks/useSourceAppConfigs.js.map +1 -1
  603. package/dist/utils/hooks/useTableImageUrl.js.map +1 -1
  604. package/dist/utils/hooks/useUploadFileEntity/useCreatePathsAndGetParentId.js.map +1 -1
  605. package/dist/utils/hooks/useUploadFileEntity/useLinkFileEntityToURL.js.map +1 -1
  606. package/dist/utils/hooks/useUploadFileEntity/usePrepareFileEntityUpload.js.map +1 -1
  607. package/dist/utils/hooks/useUploadFileEntity/useTrackFileUploads.js.map +1 -1
  608. package/dist/utils/hooks/useUploadFileEntity/useUploadFileEntities.js.map +1 -1
  609. package/dist/utils/hooks/useUploadFileEntity/useUploadFiles.js.map +1 -1
  610. package/dist/utils/hooks/useUploadFileEntity/willUploadsExceedStorageLimit.js.map +1 -1
  611. package/dist/utils/html/TargetEnum.js.map +1 -1
  612. package/dist/utils/jsonschema/SchemaAnnotationUtils.js.map +1 -1
  613. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"PortalAclEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PortalAclEditor/PortalAclEditor.tsx"],"names":[],"mappings":"AAyBA,MAAM,MAAM,qBAAqB,GAAG;IAElC,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAA;CAClD,CAAA;AAED,eAAO,MAAM,eAAe,wHAuG1B,CAAA"}
1
+ {"version":3,"file":"PortalAclEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PortalAclEditor/PortalAclEditor.tsx"],"names":[],"mappings":"AA2BA,MAAM,MAAM,qBAAqB,GAAG;IAElC,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAA;CAClD,CAAA;AAED,eAAO,MAAM,eAAe,wHAyH1B,CAAA"}
@@ -1,65 +1,67 @@
1
1
  import { getAccessTypeFromPermissionLevel as e } from "../../utils/PermissionLevelToAccessType.js";
2
2
  import { useGetPortalACL as t, useUpdatePortalACL as n } from "../../synapse-queries/portal/usePortal.js";
3
3
  import "../../synapse-queries/index.js";
4
- import { convertResourceAccessSetToSRC as r, updateACLWithSRCResourceAccessList as i } from "../../utils/functions/AccessControlListUtils.js";
5
- import { AclEditor as a } from "../AclEditor/AclEditor.js";
6
- import o from "../AclEditor/useUpdateAcl.js";
7
- import { forwardRef as s, useEffect as c, useImperativeHandle as l, useState as u } from "react";
8
- import { isEqual as d } from "lodash-es";
9
- import { Alert as f, Stack as p } from "@mui/material";
10
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
4
+ import { consolidateResourceAccessList as r, convertResourceAccessSetToSRC as i, updateACLWithSRCResourceAccessList as a } from "../../utils/functions/AccessControlListUtils.js";
5
+ import { AclEditor as o } from "../AclEditor/AclEditor.js";
6
+ import s from "../AclEditor/useUpdateAcl.js";
7
+ import { forwardRef as c, useEffect as l, useImperativeHandle as u, useMemo as d, useState as f } from "react";
8
+ import { isEqual as p } from "lodash-es";
9
+ import { Alert as m, Stack as h } from "@mui/material";
10
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
11
11
  //#region src/components/PortalAclEditor/PortalAclEditor.tsx
12
- var g = ["CAN_ADMINISTER_PORTAL"], _ = s(function(s, _) {
13
- let { portalId: v, onSaveComplete: y } = s, [b, x] = u(null), S = () => {
14
- x(null), y(!0);
15
- }, C = (e) => {
16
- x(e.reason), y(!1);
17
- }, { data: w, isLoading: T } = t(v, { staleTime: Infinity }), { resourceAccessList: E, setResourceAccessList: D, addResourceAccessItem: O, updateResourceAccessItem: k, removeResourceAccessItem: A, resetDirtyState: j } = o({
18
- onChange: () => x(null),
19
- onError: x
12
+ var v = ["CAN_ADMINISTER_PORTAL"], y = c(function(c, y) {
13
+ let { portalId: b, onSaveComplete: x } = c, [S, C] = f(null), w = () => {
14
+ C(null), x(!0);
15
+ }, T = (e) => {
16
+ C(e.reason), x(!1);
17
+ }, { data: E, isLoading: D } = t(b, { staleTime: Infinity }), O = d(() => r(i(E?.resourceAccess)), [E]), { resourceAccessList: k, setResourceAccessList: A, addResourceAccessItem: j, updateResourceAccessItem: M, removeResourceAccessItem: N, resetDirtyState: P } = s({
18
+ onChange: () => C(null),
19
+ onError: C
20
20
  });
21
- c(() => {
22
- w && (j(), D(r(w.resourceAccess)));
21
+ l(() => {
22
+ E && (P(), A(O));
23
23
  }, [
24
- w,
25
- D,
26
- j
24
+ E,
25
+ O,
26
+ P,
27
+ A
27
28
  ]);
28
- let { mutate: M } = n({
29
- onSuccess: () => S(),
30
- onError: (e) => C(e)
29
+ let { mutate: F } = n({
30
+ onSuccess: () => w(),
31
+ onError: (e) => T(e)
31
32
  });
32
- return l(_, () => ({ save() {
33
- let e = i(w, E);
34
- w === null && e == null || d(w?.resourceAccess, E) && w?.id === e?.id ? y(!0) : M(e);
33
+ return u(y, () => ({ save() {
34
+ let e = a(E, k);
35
+ E === null && e == null || p(O, k) && E?.id === e?.id ? x(!0) : F(e);
35
36
  } }), [
36
- v,
37
- w,
37
+ b,
38
38
  E,
39
- y,
40
- M
41
- ]), /* @__PURE__ */ h(p, {
39
+ O,
40
+ k,
41
+ x,
42
+ F
43
+ ]), /* @__PURE__ */ _(h, {
42
44
  direction: "column",
43
45
  sx: { gap: "20px" },
44
- children: [/* @__PURE__ */ m(a, {
45
- resourceAccessList: E,
46
- availablePermissionLevels: g,
47
- isLoading: T,
46
+ children: [/* @__PURE__ */ g(o, {
47
+ resourceAccessList: k,
48
+ availablePermissionLevels: v,
49
+ isLoading: D,
48
50
  canEdit: !0,
49
51
  emptyText: "",
50
- onAddPrincipalToAcl: (t) => O(t, e("CAN_ADMINISTER_PORTAL")),
51
- updateResourceAccessItem: k,
52
- removeResourceAccessItem: A,
52
+ onAddPrincipalToAcl: (t) => j(t, e("CAN_ADMINISTER_PORTAL")),
53
+ updateResourceAccessItem: M,
54
+ removeResourceAccessItem: N,
53
55
  showAddRemovePublicButton: !1,
54
56
  showNotifyCheckbox: !1,
55
57
  isInherited: !1
56
- }), b && /* @__PURE__ */ m(f, {
58
+ }), S && /* @__PURE__ */ g(m, {
57
59
  severity: "error",
58
- children: b
60
+ children: S
59
61
  })]
60
62
  });
61
63
  });
62
64
  //#endregion
63
- export { _ as PortalAclEditor };
65
+ export { y as PortalAclEditor };
64
66
 
65
67
  //# sourceMappingURL=PortalAclEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PortalAclEditor.js","names":[],"sources":["../../../src/components/PortalAclEditor/PortalAclEditor.tsx"],"sourcesContent":["import { useGetPortalACL, useUpdatePortalACL } from '@/synapse-queries'\nimport {\n getAccessTypeFromPermissionLevel,\n PermissionLevel,\n} from '@/utils/PermissionLevelToAccessType'\nimport { Alert, Stack } from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { isEqual } from 'lodash-es'\nimport {\n ForwardedRef,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react'\nimport { AclEditor } from '../AclEditor/AclEditor'\nimport useUpdateAcl from '../AclEditor/useUpdateAcl'\nimport { AccessControlList } from '@sage-bionetworks/synapse-client'\nimport {\n convertResourceAccessSetToSRC,\n updateACLWithSRCResourceAccessList,\n} from '@/utils/functions/AccessControlListUtils'\n\nconst availablePermissionLevels: PermissionLevel[] = ['CAN_ADMINISTER_PORTAL']\n\nexport type PortalAclEditorHandle = {\n /* Allow the parent component to trigger saving the ACL, so this may be embedded in an arbitrary modal. */\n save: () => void\n}\n\nexport type PortalAclEditorProps = {\n portalId: string\n onSaveComplete: (saveSuccessful: boolean) => void\n}\n\nexport const PortalAclEditor = forwardRef(function PortalAclEditor(\n props: PortalAclEditorProps,\n ref: ForwardedRef<PortalAclEditorHandle>,\n) {\n const { portalId, onSaveComplete } = props\n const [error, setError] = useState<string | null>(null)\n\n const onMutationSuccess = () => {\n setError(null)\n onSaveComplete(true)\n }\n\n const onMutationError = (error: SynapseClientError) => {\n setError(error.reason)\n onSaveComplete(false)\n }\n\n const { data: originalAcl, isLoading: isLoadingOriginalAcl } =\n useGetPortalACL(portalId, {\n // Infinite staleTime ensures this won't get re-fetched unless explicitly invalidated by the mutation\n staleTime: Infinity,\n })\n\n const {\n resourceAccessList,\n setResourceAccessList,\n addResourceAccessItem,\n updateResourceAccessItem,\n removeResourceAccessItem,\n resetDirtyState,\n } = useUpdateAcl({\n onChange: () => setError(null),\n onError: setError,\n })\n\n // set resourceAccessList when the fetched acl changes\n useEffect(() => {\n if (originalAcl) {\n resetDirtyState()\n setResourceAccessList(\n convertResourceAccessSetToSRC(originalAcl.resourceAccess),\n )\n }\n }, [originalAcl, setResourceAccessList, resetDirtyState])\n\n const { mutate: updateAcl } = useUpdatePortalACL({\n onSuccess: () => onMutationSuccess(),\n onError: (error: SynapseClientError) => onMutationError(error),\n })\n\n useImperativeHandle(\n ref,\n () => {\n return {\n save() {\n const updatedAcl: AccessControlList =\n updateACLWithSRCResourceAccessList(originalAcl, resourceAccessList)\n const aclIsUnchanged =\n (originalAcl === null && updatedAcl == null) ||\n // ignore properties that will change when the ACL is saved (etag, modifiedOn)\n (isEqual(originalAcl?.resourceAccess, resourceAccessList) &&\n originalAcl?.id === updatedAcl?.id)\n\n if (aclIsUnchanged) {\n // noop\n onSaveComplete(true)\n } else {\n updateAcl(updatedAcl)\n }\n },\n }\n },\n [portalId, originalAcl, resourceAccessList, onSaveComplete, updateAcl],\n )\n\n return (\n <Stack\n direction=\"column\"\n sx={{\n gap: '20px',\n }}\n >\n <AclEditor\n resourceAccessList={resourceAccessList}\n availablePermissionLevels={availablePermissionLevels}\n isLoading={isLoadingOriginalAcl}\n canEdit={true}\n emptyText={/* This should never happen */ ''}\n onAddPrincipalToAcl={id =>\n addResourceAccessItem(\n id,\n getAccessTypeFromPermissionLevel('CAN_ADMINISTER_PORTAL'),\n )\n }\n updateResourceAccessItem={updateResourceAccessItem}\n removeResourceAccessItem={removeResourceAccessItem}\n showAddRemovePublicButton={false}\n showNotifyCheckbox={false}\n isInherited={false}\n />\n {error && <Alert severity=\"error\">{error}</Alert>}\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;AAuBA,IAAM,IAA+C,CAAC,wBAAwB,EAYjE,IAAkB,EAAW,SACxC,GACA,GACA;CACA,IAAM,EAAE,aAAU,sBAAmB,GAC/B,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,UAA0B;AAE9B,EADA,EAAS,KAAK,EACd,EAAe,GAAK;IAGhB,KAAmB,MAA8B;AAErD,EADA,EAAS,EAAM,OAAO,EACtB,EAAe,GAAM;IAGjB,EAAE,MAAM,GAAa,WAAW,MACpC,EAAgB,GAAU,EAExB,WAAW,UACZ,CAAC,EAEE,EACJ,uBACA,0BACA,0BACA,6BACA,6BACA,uBACE,EAAa;EACf,gBAAgB,EAAS,KAAK;EAC9B,SAAS;EACV,CAAC;AAGF,SAAgB;AACd,EAAI,MACF,GAAiB,EACjB,EACE,EAA8B,EAAY,eAAe,CAC1D;IAEF;EAAC;EAAa;EAAuB;EAAgB,CAAC;CAEzD,IAAM,EAAE,QAAQ,MAAc,EAAmB;EAC/C,iBAAiB,GAAmB;EACpC,UAAU,MAA8B,EAAgB,EAAM;EAC/D,CAAC;AA2BF,QAzBA,EACE,UAES,EACL,OAAO;EACL,IAAM,IACJ,EAAmC,GAAa,EAAmB;AAOrE,EALG,MAAgB,QAAQ,KAAc,QAEtC,EAAQ,GAAa,gBAAgB,EAAmB,IACvD,GAAa,OAAO,GAAY,KAIlC,EAAe,GAAK,GAEpB,EAAU,EAAW;IAG1B,GAEH;EAAC;EAAU;EAAa;EAAoB;EAAgB;EAAU,CACvE,EAGC,kBAAC,GAAD;EACE,WAAU;EACV,IAAI,EACF,KAAK,QACN;YAJH,CAME,kBAAC,GAAD;GACsB;GACO;GAC3B,WAAW;GACX,SAAS;GACT,WAA0C;GAC1C,sBAAqB,MACnB,EACE,GACA,EAAiC,wBAAwB,CAC1D;GAEuB;GACA;GAC1B,2BAA2B;GAC3B,oBAAoB;GACpB,aAAa;GACb,CAAA,EACD,KAAS,kBAAC,GAAD;GAAO,UAAS;aAAS;GAAc,CAAA,CAC3C;;EAEV"}
1
+ {"version":3,"file":"PortalAclEditor.js","names":[],"sources":["../../../src/components/PortalAclEditor/PortalAclEditor.tsx"],"sourcesContent":["import { useGetPortalACL, useUpdatePortalACL } from '@/synapse-queries'\nimport {\n getAccessTypeFromPermissionLevel,\n PermissionLevel,\n} from '@/utils/PermissionLevelToAccessType'\nimport { Alert, Stack } from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n consolidateResourceAccessList,\n convertResourceAccessSetToSRC,\n updateACLWithSRCResourceAccessList,\n} from '@/utils/functions/AccessControlListUtils'\nimport { isEqual } from 'lodash-es'\nimport {\n ForwardedRef,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\nimport { AclEditor } from '../AclEditor/AclEditor'\nimport useUpdateAcl from '../AclEditor/useUpdateAcl'\nimport { AccessControlList } from '@sage-bionetworks/synapse-client'\n\nconst availablePermissionLevels: PermissionLevel[] = ['CAN_ADMINISTER_PORTAL']\n\nexport type PortalAclEditorHandle = {\n /* Allow the parent component to trigger saving the ACL, so this may be embedded in an arbitrary modal. */\n save: () => void\n}\n\nexport type PortalAclEditorProps = {\n portalId: string\n onSaveComplete: (saveSuccessful: boolean) => void\n}\n\nexport const PortalAclEditor = forwardRef(function PortalAclEditor(\n props: PortalAclEditorProps,\n ref: ForwardedRef<PortalAclEditorHandle>,\n) {\n const { portalId, onSaveComplete } = props\n const [error, setError] = useState<string | null>(null)\n\n const onMutationSuccess = () => {\n setError(null)\n onSaveComplete(true)\n }\n\n const onMutationError = (error: SynapseClientError) => {\n setError(error.reason)\n onSaveComplete(false)\n }\n\n const { data: originalAcl, isLoading: isLoadingOriginalAcl } =\n useGetPortalACL(portalId, {\n // Infinite staleTime ensures this won't get re-fetched unless explicitly invalidated by the mutation\n staleTime: Infinity,\n })\n\n const consolidatedOriginalResourceAccess = useMemo(\n () =>\n consolidateResourceAccessList(\n convertResourceAccessSetToSRC(originalAcl?.resourceAccess),\n ),\n [originalAcl],\n )\n\n const {\n resourceAccessList,\n setResourceAccessList,\n addResourceAccessItem,\n updateResourceAccessItem,\n removeResourceAccessItem,\n resetDirtyState,\n } = useUpdateAcl({\n onChange: () => setError(null),\n onError: setError,\n })\n\n // set resourceAccessList when the fetched acl changes\n useEffect(() => {\n if (originalAcl) {\n resetDirtyState()\n setResourceAccessList(consolidatedOriginalResourceAccess)\n }\n }, [\n originalAcl,\n consolidatedOriginalResourceAccess,\n resetDirtyState,\n setResourceAccessList,\n ])\n\n const { mutate: updateAcl } = useUpdatePortalACL({\n onSuccess: () => onMutationSuccess(),\n onError: (error: SynapseClientError) => onMutationError(error),\n })\n\n useImperativeHandle(\n ref,\n () => {\n return {\n save() {\n const updatedAcl: AccessControlList =\n updateACLWithSRCResourceAccessList(originalAcl, resourceAccessList)\n const aclIsUnchanged =\n (originalAcl === null && updatedAcl == null) ||\n // ignore properties that will change when the ACL is saved (etag, modifiedOn)\n (isEqual(consolidatedOriginalResourceAccess, resourceAccessList) &&\n originalAcl?.id === updatedAcl?.id)\n\n if (aclIsUnchanged) {\n // noop\n onSaveComplete(true)\n } else {\n updateAcl(updatedAcl)\n }\n },\n }\n },\n [\n portalId,\n originalAcl,\n consolidatedOriginalResourceAccess,\n resourceAccessList,\n onSaveComplete,\n updateAcl,\n ],\n )\n\n return (\n <Stack\n direction=\"column\"\n sx={{\n gap: '20px',\n }}\n >\n <AclEditor\n resourceAccessList={resourceAccessList}\n availablePermissionLevels={availablePermissionLevels}\n isLoading={isLoadingOriginalAcl}\n canEdit={true}\n emptyText={/* This should never happen */ ''}\n onAddPrincipalToAcl={id =>\n addResourceAccessItem(\n id,\n getAccessTypeFromPermissionLevel('CAN_ADMINISTER_PORTAL'),\n )\n }\n updateResourceAccessItem={updateResourceAccessItem}\n removeResourceAccessItem={removeResourceAccessItem}\n showAddRemovePublicButton={false}\n showNotifyCheckbox={false}\n isInherited={false}\n />\n {error && <Alert severity=\"error\">{error}</Alert>}\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,IAA+C,CAAC,wBAAwB,EAYjE,IAAkB,EAAW,SACxC,GACA,GACA;CACA,IAAM,EAAE,aAAU,sBAAmB,GAC/B,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,UAA0B;AAE9B,EADA,EAAS,KAAK,EACd,EAAe,GAAK;IAGhB,KAAmB,MAA8B;AAErD,EADA,EAAS,EAAM,OAAO,EACtB,EAAe,GAAM;IAGjB,EAAE,MAAM,GAAa,WAAW,MACpC,EAAgB,GAAU,EAExB,WAAW,UACZ,CAAC,EAEE,IAAqC,QAEvC,EACE,EAA8B,GAAa,eAAe,CAC3D,EACH,CAAC,EAAY,CACd,EAEK,EACJ,uBACA,0BACA,0BACA,6BACA,6BACA,uBACE,EAAa;EACf,gBAAgB,EAAS,KAAK;EAC9B,SAAS;EACV,CAAC;AAGF,SAAgB;AACd,EAAI,MACF,GAAiB,EACjB,EAAsB,EAAmC;IAE1D;EACD;EACA;EACA;EACA;EACD,CAAC;CAEF,IAAM,EAAE,QAAQ,MAAc,EAAmB;EAC/C,iBAAiB,GAAmB;EACpC,UAAU,MAA8B,EAAgB,EAAM;EAC/D,CAAC;AAkCF,QAhCA,EACE,UAES,EACL,OAAO;EACL,IAAM,IACJ,EAAmC,GAAa,EAAmB;AAOrE,EALG,MAAgB,QAAQ,KAAc,QAEtC,EAAQ,GAAoC,EAAmB,IAC9D,GAAa,OAAO,GAAY,KAIlC,EAAe,GAAK,GAEpB,EAAU,EAAW;IAG1B,GAEH;EACE;EACA;EACA;EACA;EACA;EACA;EACD,CACF,EAGC,kBAAC,GAAD;EACE,WAAU;EACV,IAAI,EACF,KAAK,QACN;YAJH,CAME,kBAAC,GAAD;GACsB;GACO;GAC3B,WAAW;GACX,SAAS;GACT,WAA0C;GAC1C,sBAAqB,MACnB,EACE,GACA,EAAiC,wBAAwB,CAC1D;GAEuB;GACA;GAC1B,2BAA2B;GAC3B,oBAAoB;GACpB,aAAa;GACb,CAAA,EACD,KAAS,kBAAC,GAAD;GAAO,UAAS;aAAS;GAAc,CAAA,CAC3C;;EAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"PortalFeaturedPartners.js","names":[],"sources":["../../../src/components/PortalFeaturedPartners/PortalFeaturedPartners.tsx"],"sourcesContent":["import React from 'react'\nimport useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { SynapseConstants } from '@/utils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions'\nimport { getFieldIndex } from '@/utils/functions/queryUtils'\nimport { useImageUrl } from '@/utils/hooks/useImageUrlUtils'\nimport {\n Box,\n CardMedia,\n Link,\n Skeleton,\n SxProps,\n Typography,\n} from '@mui/material'\nimport { QueryBundleRequest, Row } from '@sage-bionetworks/synapse-types'\nimport PortalSectionHeader from '../PortalSectionHeader'\n\nconst partnerIconHeight = 101\nconst partnerIconWidth = 156\n\nexport type PortalFeaturedPartnersProps = {\n variation?: 'default' | 'centered'\n sql: string\n titleText?: string\n sx?: SxProps\n}\n\ntype PartnerIcons = {\n partner: Row\n imageColIndex: number\n organizationNameColIndex: number\n websiteColIndex: number\n entityId: string\n isLoading?: boolean\n}\n\ntype PartnerWrapperProps = {\n website?: string | null\n children: React.ReactNode\n}\n\nconst PartnerWrapper = ({\n website,\n children,\n}: PartnerWrapperProps): React.ReactNode => {\n const commonSx = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return website ? (\n <Link\n href={website}\n target=\"_blank\"\n sx={{\n ...commonSx,\n textDecoration: 'none !important',\n }}\n >\n {children}\n </Link>\n ) : (\n <Box sx={commonSx}>{children}</Box>\n )\n}\n\nconst PartnerIcon = ({\n partner,\n imageColIndex,\n organizationNameColIndex,\n websiteColIndex,\n entityId,\n isLoading,\n}: PartnerIcons): React.ReactNode => {\n const fileId = partner.values[imageColIndex] ?? ''\n const organizationName = partner.values[organizationNameColIndex]\n const website = partner.values[websiteColIndex]\n const imageUrl = useImageUrl(fileId, entityId)\n\n if (!imageUrl && !organizationName) return null\n\n if (isLoading)\n return (\n <Skeleton\n variant=\"rectangular\"\n height={partnerIconHeight}\n width={partnerIconWidth}\n />\n )\n\n const PartnerContent = imageUrl ? (\n <CardMedia\n component=\"img\"\n image={imageUrl}\n aria-hidden=\"true\"\n sx={{\n width: `${partnerIconWidth}px`,\n height: `${partnerIconHeight}px`,\n objectFit: 'contain',\n borderRadius: '10px',\n }}\n />\n ) : (\n <Box\n sx={{\n display: 'flex',\n width: '165px',\n padding: '3px',\n flexDirection: 'column',\n gap: '10px',\n border: '2px solid',\n borderColor: 'grey.900',\n backgroundColor: '#FFF',\n textAlign: 'center',\n }}\n >\n <Box\n sx={{\n display: 'flex',\n padding: '10px',\n justifyContent: 'center',\n alignItems: 'center',\n gap: '10px',\n border: '1px solid',\n borderColor: 'grey.900',\n }}\n >\n <Typography\n variant=\"headline3\"\n sx={{\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '130%',\n color: 'grey.900',\n }}\n >\n {organizationName}\n </Typography>\n </Box>\n </Box>\n )\n\n return <PartnerWrapper website={website}>{PartnerContent}</PartnerWrapper>\n}\n\nconst PortalFeaturedPartners = ({\n sql,\n titleText = 'Our Partners',\n variation = 'default',\n sx,\n}: PortalFeaturedPartnersProps): React.ReactNode => {\n const entityId = parseEntityIdFromSqlStatement(sql)\n\n const queryBundleRequest: QueryBundleRequest = {\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId,\n query: {\n sql,\n },\n }\n const { data: queryResultBundle, isLoading } =\n useGetQueryResultBundle(queryBundleRequest)\n\n const dataRows = queryResultBundle?.queryResult!.queryResults.rows ?? []\n\n enum ExpectedColumns {\n CARDLOGO = 'cardLogo',\n ORGANIZATION_NAME = 'organizationName',\n WEBSITE = 'website',\n }\n\n const imageColIndex = getFieldIndex(\n ExpectedColumns.CARDLOGO,\n queryResultBundle,\n )\n\n const organizationNameColIndex = getFieldIndex(\n ExpectedColumns.ORGANIZATION_NAME,\n queryResultBundle,\n )\n\n const websiteColIndex = getFieldIndex(\n ExpectedColumns.WEBSITE,\n queryResultBundle,\n )\n\n return (\n <Box\n sx={{\n display: 'grid',\n padding: { xs: '40px', lg: '20px 80px' },\n gridTemplateColumns:\n variation === 'centered'\n ? { xs: '1fr' }\n : { xs: '1fr', md: '1fr 3fr' },\n gap: '50px',\n textAlign: variation === 'centered' ? 'center' : 'left',\n ...sx,\n }}\n >\n {variation === 'default' ? (\n <PortalSectionHeader\n title={titleText}\n sx={{ h2: { fontSize: '24px', paddingTop: '26px', width: '100%' } }}\n />\n ) : (\n <Typography\n variant=\"headline1\"\n sx={{ fontSize: '48px', color: 'grey.900' }}\n >\n {titleText}\n </Typography>\n )}\n <Box\n sx={theme => ({\n display: 'flex',\n flexWrap: 'wrap',\n gap: '64px',\n flex: '1 1 0',\n justifyContent: variation === 'centered' ? 'center' : 'flex-start',\n [theme.breakpoints.down('sm')]: {\n justifyContent: 'center',\n },\n })}\n >\n {dataRows?.map((partner, index) => (\n <PartnerIcon\n key={`partner-${index}`}\n partner={partner}\n imageColIndex={imageColIndex}\n organizationNameColIndex={organizationNameColIndex}\n websiteColIndex={websiteColIndex}\n entityId={entityId}\n isLoading={isLoading}\n />\n ))}\n </Box>\n </Box>\n )\n}\n\nexport default PortalFeaturedPartners\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAM,IAAoB,KACpB,IAAmB,KAuBnB,KAAkB,EACtB,YACA,kBAC0C;CAC1C,IAAM,IAAW;EACf,SAAS;EACT,YAAY;EACZ,gBAAgB;EACjB;AAED,QAAO,IACL,kBAAC,GAAD;EACE,MAAM;EACN,QAAO;EACP,IAAI;GACF,GAAG;GACH,gBAAgB;GACjB;EAEA;EACI,CAAA,GAEP,kBAAC,GAAD;EAAK,IAAI;EAAW;EAAe,CAAA;GAIjC,KAAe,EACnB,YACA,kBACA,6BACA,oBACA,aACA,mBACmC;CACnC,IAAM,IAAS,EAAQ,OAAO,MAAkB,IAC1C,IAAmB,EAAQ,OAAO,IAClC,IAAU,EAAQ,OAAO,IACzB,IAAW,EAAY,GAAQ,EAAS;AAiE9C,QA/DI,CAAC,KAAY,CAAC,IAAyB,OAEvC,IAEA,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IAAI;IAAW;GAClC,KAAK;GACL,WAAW,MAAc,aAAa,WAAW;GACjD,GAAG;GACJ;YAXH,CAaG,MAAc,YACb,kBAAC,GAAD;GACE,OAAO;GACP,IAAI,EAAE,IAAI;IAAE,UAAU;IAAQ,YAAY;IAAQ,OAAO;IAAQ,EAAE;GACnE,CAAA,GAEF,kBAAC,GAAD;GACE,SAAQ;GACR,IAAI;IAAE,UAAU;IAAQ,OAAO;IAAY;aAE1C;GACU,CAAA,EAEf,kBAAC,GAAD;GACE,KAAI,OAAU;IACZ,SAAS;IACT,UAAU;IACV,KAAK;IACL,MAAM;IACN,gBAAgB,MAAc,aAAa,WAAW;KACrD,EAAM,YAAY,KAAK,KAAK,GAAG,EAC9B,gBAAgB,UACjB;IACF;aAEA,GAAU,KAAK,GAAS,MACvB,kBAAC,GAAD;IAEW;IACM;IACW;IACT;IACP;IACC;IACX,EAPK,WAAW,IAOhB,CACF;GACE,CAAA,CACF"}
1
+ {"version":3,"file":"PortalFeaturedPartners.js","names":[],"sources":["../../../src/components/PortalFeaturedPartners/PortalFeaturedPartners.tsx"],"sourcesContent":["import React from 'react'\nimport useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { SynapseConstants } from '@/utils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions'\nimport { getFieldIndex } from '@/utils/functions/queryUtils'\nimport { useImageUrl } from '@/utils/hooks/useImageUrlUtils'\nimport {\n Box,\n CardMedia,\n Link,\n Skeleton,\n SxProps,\n Typography,\n} from '@mui/material'\nimport { QueryBundleRequest, Row } from '@sage-bionetworks/synapse-types'\nimport PortalSectionHeader from '../PortalSectionHeader'\n\nconst partnerIconHeight = 101\nconst partnerIconWidth = 156\n\nexport type PortalFeaturedPartnersProps = {\n variation?: 'default' | 'centered'\n sql: string\n titleText?: string\n sx?: SxProps\n}\n\ntype PartnerIcons = {\n partner: Row\n imageColIndex: number\n organizationNameColIndex: number\n websiteColIndex: number\n entityId: string\n isLoading?: boolean\n}\n\ntype PartnerWrapperProps = {\n website?: string | null\n children: React.ReactNode\n}\n\nconst PartnerWrapper = ({\n website,\n children,\n}: PartnerWrapperProps): React.ReactNode => {\n const commonSx = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return website ? (\n <Link\n href={website}\n target=\"_blank\"\n sx={{\n ...commonSx,\n textDecoration: 'none !important',\n }}\n >\n {children}\n </Link>\n ) : (\n <Box sx={commonSx}>{children}</Box>\n )\n}\n\nconst PartnerIcon = ({\n partner,\n imageColIndex,\n organizationNameColIndex,\n websiteColIndex,\n entityId,\n isLoading,\n}: PartnerIcons): React.ReactNode => {\n const fileId = partner.values[imageColIndex] ?? ''\n const organizationName = partner.values[organizationNameColIndex]\n const website = partner.values[websiteColIndex]\n const imageUrl = useImageUrl(fileId, entityId)\n\n if (!imageUrl && !organizationName) return null\n\n if (isLoading)\n return (\n <Skeleton\n variant=\"rectangular\"\n height={partnerIconHeight}\n width={partnerIconWidth}\n />\n )\n\n const PartnerContent = imageUrl ? (\n <CardMedia\n component=\"img\"\n image={imageUrl}\n aria-hidden=\"true\"\n sx={{\n width: `${partnerIconWidth}px`,\n height: `${partnerIconHeight}px`,\n objectFit: 'contain',\n borderRadius: '10px',\n }}\n />\n ) : (\n <Box\n sx={{\n display: 'flex',\n width: '165px',\n padding: '3px',\n flexDirection: 'column',\n gap: '10px',\n border: '2px solid',\n borderColor: 'grey.900',\n backgroundColor: '#FFF',\n textAlign: 'center',\n }}\n >\n <Box\n sx={{\n display: 'flex',\n padding: '10px',\n justifyContent: 'center',\n alignItems: 'center',\n gap: '10px',\n border: '1px solid',\n borderColor: 'grey.900',\n }}\n >\n <Typography\n variant=\"headline3\"\n sx={{\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '130%',\n color: 'grey.900',\n }}\n >\n {organizationName}\n </Typography>\n </Box>\n </Box>\n )\n\n return <PartnerWrapper website={website}>{PartnerContent}</PartnerWrapper>\n}\n\nconst PortalFeaturedPartners = ({\n sql,\n titleText = 'Our Partners',\n variation = 'default',\n sx,\n}: PortalFeaturedPartnersProps): React.ReactNode => {\n const entityId = parseEntityIdFromSqlStatement(sql)\n\n const queryBundleRequest: QueryBundleRequest = {\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId,\n query: {\n sql,\n },\n }\n const { data: queryResultBundle, isLoading } =\n useGetQueryResultBundle(queryBundleRequest)\n\n const dataRows = queryResultBundle?.queryResult!.queryResults.rows ?? []\n\n enum ExpectedColumns {\n CARDLOGO = 'cardLogo',\n ORGANIZATION_NAME = 'organizationName',\n WEBSITE = 'website',\n }\n\n const imageColIndex = getFieldIndex(\n ExpectedColumns.CARDLOGO,\n queryResultBundle,\n )\n\n const organizationNameColIndex = getFieldIndex(\n ExpectedColumns.ORGANIZATION_NAME,\n queryResultBundle,\n )\n\n const websiteColIndex = getFieldIndex(\n ExpectedColumns.WEBSITE,\n queryResultBundle,\n )\n\n return (\n <Box\n sx={{\n display: 'grid',\n padding: { xs: '40px', lg: '20px 80px' },\n gridTemplateColumns:\n variation === 'centered'\n ? { xs: '1fr' }\n : { xs: '1fr', md: '1fr 3fr' },\n gap: '50px',\n textAlign: variation === 'centered' ? 'center' : 'left',\n ...sx,\n }}\n >\n {variation === 'default' ? (\n <PortalSectionHeader\n title={titleText}\n sx={{ h2: { fontSize: '24px', paddingTop: '26px', width: '100%' } }}\n />\n ) : (\n <Typography\n variant=\"headline1\"\n sx={{ fontSize: '48px', color: 'grey.900' }}\n >\n {titleText}\n </Typography>\n )}\n <Box\n sx={theme => ({\n display: 'flex',\n flexWrap: 'wrap',\n gap: '64px',\n flex: '1 1 0',\n justifyContent: variation === 'centered' ? 'center' : 'flex-start',\n [theme.breakpoints.down('sm')]: {\n justifyContent: 'center',\n },\n })}\n >\n {dataRows?.map((partner, index) => (\n <PartnerIcon\n key={`partner-${index}`}\n partner={partner}\n imageColIndex={imageColIndex}\n organizationNameColIndex={organizationNameColIndex}\n websiteColIndex={websiteColIndex}\n entityId={entityId}\n isLoading={isLoading}\n />\n ))}\n </Box>\n </Box>\n )\n}\n\nexport default PortalFeaturedPartners\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAM,IAAoB,KACpB,IAAmB,KAuBnB,KAAkB,EACtB,YACA,kBAC0C;CAC1C,IAAM,IAAW;EACf,SAAS;EACT,YAAY;EACZ,gBAAgB;EACjB;AAED,QAAO,IACL,kBAAC,GAAD;EACE,MAAM;EACN,QAAO;EACP,IAAI;GACF,GAAG;GACH,gBAAgB;GACjB;EAEA;EACI,CAAA,GAEP,kBAAC,GAAD;EAAK,IAAI;EAAW;EAAe,CAAA;GAIjC,KAAe,EACnB,YACA,kBACA,6BACA,oBACA,aACA,mBACmC;CACnC,IAAM,IAAS,EAAQ,OAAO,MAAkB,IAC1C,IAAmB,EAAQ,OAAO,IAClC,IAAU,EAAQ,OAAO,IACzB,IAAW,EAAY,GAAQ,EAAS;AAiE9C,QA/DI,CAAC,KAAY,CAAC,IAAyB,OAEvC,IAEA,kBAAC,GAAD;EACE,SAAQ;EACR,QAAQ;EACR,OAAO;EACP,CAAA,GAuDC,kBAAC,GAAD;EAAyB;YApDT,IACrB,kBAAC,GAAD;GACE,WAAU;GACV,OAAO;GACP,eAAY;GACZ,IAAI;IACF,OAAO,GAAG,EAAiB;IAC3B,QAAQ,GAAG,EAAkB;IAC7B,WAAW;IACX,cAAc;IACf;GACD,CAAA,GAEF,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,OAAO;IACP,SAAS;IACT,eAAe;IACf,KAAK;IACL,QAAQ;IACR,aAAa;IACb,iBAAiB;IACjB,WAAW;IACZ;aAED,kBAAC,GAAD;IACE,IAAI;KACF,SAAS;KACT,SAAS;KACT,gBAAgB;KAChB,YAAY;KACZ,KAAK;KACL,QAAQ;KACR,aAAa;KACd;cAED,kBAAC,GA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D;IAEW;IACM;IACW;IACT;IACP;IACC;IACX,EAPK,WAAW,IAOhB,CACF;GACE,CAAA,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreatePortalModal.js","names":[],"sources":["../../../src/components/PortalList/CreatePortalModal.tsx"],"sourcesContent":["import { useCreatePortal } from '@/synapse-queries/portal/usePortal'\nimport { Alert } from '@mui/material'\nimport { Portal } from '@sage-bionetworks/synapse-client'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { KeyboardEvent, useState } from 'react'\nimport { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog'\nimport { displayToast } from '../ToastMessage'\nimport TextField from '../TextField/TextField'\n\nexport type CreatePortalModalProps = {\n open: boolean\n onClose: () => void\n onSuccess?: (portal: Portal) => void\n}\n\nexport function CreatePortalModal({\n open,\n onClose,\n onSuccess,\n}: CreatePortalModalProps): React.ReactNode {\n const [portalName, setPortalName] = useState<string>('')\n const [portalUrl, setPortalUrl] = useState<string>('')\n const [errorMessage, setErrorMessage] = useState<string>()\n\n const { mutate: createPortal, isPending } = useCreatePortal({\n onSuccess: portal => {\n displayToast('Portal created successfully', 'success')\n handleClose()\n onSuccess?.(portal)\n },\n onError: (error: SynapseClientError) => {\n setErrorMessage(error.reason || error.message)\n },\n })\n\n const handleClose = () => {\n setPortalName('')\n setPortalUrl('')\n setErrorMessage(undefined)\n onClose()\n }\n\n const handleCreate = () => {\n if (!portalName.trim()) {\n setErrorMessage('Portal name is required')\n return\n }\n if (!portalUrl.trim()) {\n setErrorMessage('Portal URL is required')\n return\n }\n\n const newPortal: Portal = {\n name: portalName.trim(),\n url: portalUrl.trim(),\n }\n\n createPortal(newPortal)\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' && portalName.trim() && portalUrl.trim()) {\n handleCreate()\n }\n }\n\n const dialogContent = (\n <>\n <TextField\n id=\"portalNameInput\"\n label=\"Portal Name\"\n value={portalName}\n fullWidth\n required\n onChange={event => {\n setPortalName(event.target.value)\n setErrorMessage(undefined)\n }}\n inputProps={{\n onKeyDown: handleKeyDown,\n }}\n sx={{ mb: 2 }}\n />\n <TextField\n id=\"portalUrlInput\"\n label=\"Portal URL\"\n value={portalUrl}\n fullWidth\n required\n placeholder=\"https://example.synapse.org\"\n onChange={event => {\n setPortalUrl(event.target.value)\n setErrorMessage(undefined)\n }}\n inputProps={{\n onKeyDown: handleKeyDown,\n }}\n />\n {errorMessage && (\n <Alert severity=\"error\" sx={{ mt: 2 }}>\n {errorMessage}\n </Alert>\n )}\n </>\n )\n\n return (\n <ConfirmationDialog\n open={open}\n title=\"Create a New Portal\"\n content={dialogContent}\n confirmButtonProps={{\n children: 'Create',\n disabled: isPending || !portalName.trim() || !portalUrl.trim(),\n }}\n onConfirm={handleCreate}\n onCancel={handleClose}\n maxWidth=\"sm\"\n />\n )\n}\n\nexport default CreatePortalModal\n"],"mappings":";;;;;;;;;AAeA,SAAgB,EAAkB,EAChC,SACA,YACA,gBAC0C;CAC1C,IAAM,CAAC,GAAY,KAAiB,EAAiB,GAAG,EAClD,CAAC,GAAW,KAAgB,EAAiB,GAAG,EAChD,CAAC,GAAc,KAAmB,GAAkB,EAEpD,EAAE,QAAQ,GAAc,iBAAc,EAAgB;EAC1D,YAAW,MAAU;AAGnB,GAFA,EAAa,+BAA+B,UAAU,EACtD,GAAa,EACb,IAAY,EAAO;;EAErB,UAAU,MAA8B;AACtC,KAAgB,EAAM,UAAU,EAAM,QAAQ;;EAEjD,CAAC,EAEI,UAAoB;AAIxB,EAHA,EAAc,GAAG,EACjB,EAAa,GAAG,EAChB,EAAgB,KAAA,EAAU,EAC1B,GAAS;IAGL,UAAqB;AACzB,MAAI,CAAC,EAAW,MAAM,EAAE;AACtB,KAAgB,0BAA0B;AAC1C;;AAEF,MAAI,CAAC,EAAU,MAAM,EAAE;AACrB,KAAgB,yBAAyB;AACzC;;AAQF,IAL0B;GACxB,MAAM,EAAW,MAAM;GACvB,KAAK,EAAU,MAAM;GACtB,CAEsB;IAGnB,KAAiB,MAA2C;AAChE,EAAI,EAAM,QAAQ,WAAW,EAAW,MAAM,IAAI,EAAU,MAAM,IAChE,GAAc;;AA4ClB,QACE,kBAAC,GAAD;EACQ;EACN,OAAM;EACN,SA3CF,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD;IACE,IAAG;IACH,OAAM;IACN,OAAO;IACP,WAAA;IACA,UAAA;IACA,WAAU,MAAS;AAEjB,KADA,EAAc,EAAM,OAAO,MAAM,EACjC,EAAgB,KAAA,EAAU;;IAE5B,YAAY,EACV,WAAW,GACZ;IACD,IAAI,EAAE,IAAI,GAAG;IACb,CAAA;GACF,kBAAC,GAAD;IACE,IAAG;IACH,OAAM;IACN,OAAO;IACP,WAAA;IACA,UAAA;IACA,aAAY;IACZ,WAAU,MAAS;AAEjB,KADA,EAAa,EAAM,OAAO,MAAM,EAChC,EAAgB,KAAA,EAAU;;IAE5B,YAAY,EACV,WAAW,GACZ;IACD,CAAA;GACD,KACC,kBAAC,GAAD;IAAO,UAAS;IAAQ,IAAI,EAAE,IAAI,GAAG;cAClC;IACK,CAAA;GAET,EAAA,CAAA;EAQD,oBAAoB;GAClB,UAAU;GACV,UAAU,KAAa,CAAC,EAAW,MAAM,IAAI,CAAC,EAAU,MAAM;GAC/D;EACD,WAAW;EACX,UAAU;EACV,UAAS;EACT,CAAA"}
1
+ {"version":3,"file":"CreatePortalModal.js","names":[],"sources":["../../../src/components/PortalList/CreatePortalModal.tsx"],"sourcesContent":["import { useCreatePortal } from '@/synapse-queries/portal/usePortal'\nimport { Alert } from '@mui/material'\nimport { Portal } from '@sage-bionetworks/synapse-client'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { KeyboardEvent, useState } from 'react'\nimport { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog'\nimport { displayToast } from '../ToastMessage'\nimport TextField from '../TextField/TextField'\n\nexport type CreatePortalModalProps = {\n open: boolean\n onClose: () => void\n onSuccess?: (portal: Portal) => void\n}\n\nexport function CreatePortalModal({\n open,\n onClose,\n onSuccess,\n}: CreatePortalModalProps): React.ReactNode {\n const [portalName, setPortalName] = useState<string>('')\n const [portalUrl, setPortalUrl] = useState<string>('')\n const [errorMessage, setErrorMessage] = useState<string>()\n\n const { mutate: createPortal, isPending } = useCreatePortal({\n onSuccess: portal => {\n displayToast('Portal created successfully', 'success')\n handleClose()\n onSuccess?.(portal)\n },\n onError: (error: SynapseClientError) => {\n setErrorMessage(error.reason || error.message)\n },\n })\n\n const handleClose = () => {\n setPortalName('')\n setPortalUrl('')\n setErrorMessage(undefined)\n onClose()\n }\n\n const handleCreate = () => {\n if (!portalName.trim()) {\n setErrorMessage('Portal name is required')\n return\n }\n if (!portalUrl.trim()) {\n setErrorMessage('Portal URL is required')\n return\n }\n\n const newPortal: Portal = {\n name: portalName.trim(),\n url: portalUrl.trim(),\n }\n\n createPortal(newPortal)\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' && portalName.trim() && portalUrl.trim()) {\n handleCreate()\n }\n }\n\n const dialogContent = (\n <>\n <TextField\n id=\"portalNameInput\"\n label=\"Portal Name\"\n value={portalName}\n fullWidth\n required\n onChange={event => {\n setPortalName(event.target.value)\n setErrorMessage(undefined)\n }}\n inputProps={{\n onKeyDown: handleKeyDown,\n }}\n sx={{ mb: 2 }}\n />\n <TextField\n id=\"portalUrlInput\"\n label=\"Portal URL\"\n value={portalUrl}\n fullWidth\n required\n placeholder=\"https://example.synapse.org\"\n onChange={event => {\n setPortalUrl(event.target.value)\n setErrorMessage(undefined)\n }}\n inputProps={{\n onKeyDown: handleKeyDown,\n }}\n />\n {errorMessage && (\n <Alert severity=\"error\" sx={{ mt: 2 }}>\n {errorMessage}\n </Alert>\n )}\n </>\n )\n\n return (\n <ConfirmationDialog\n open={open}\n title=\"Create a New Portal\"\n content={dialogContent}\n confirmButtonProps={{\n children: 'Create',\n disabled: isPending || !portalName.trim() || !portalUrl.trim(),\n }}\n onConfirm={handleCreate}\n onCancel={handleClose}\n maxWidth=\"sm\"\n />\n )\n}\n\nexport default CreatePortalModal\n"],"mappings":";;;;;;;;;AAeA,SAAgB,EAAkB,EAChC,SACA,YACA,gBAC0C;CAC1C,IAAM,CAAC,GAAY,KAAiB,EAAiB,GAAG,EAClD,CAAC,GAAW,KAAgB,EAAiB,GAAG,EAChD,CAAC,GAAc,KAAmB,GAAkB,EAEpD,EAAE,QAAQ,GAAc,iBAAc,EAAgB;EAC1D,YAAW,MAAU;AAGnB,GAFA,EAAa,+BAA+B,UAAU,EACtD,GAAa,EACb,IAAY,EAAO;;EAErB,UAAU,MAA8B;AACtC,KAAgB,EAAM,UAAU,EAAM,QAAQ;;EAEjD,CAAC,EAEI,UAAoB;AAIxB,EAHA,EAAc,GAAG,EACjB,EAAa,GAAG,EAChB,EAAgB,KAAA,EAAU,EAC1B,GAAS;IAGL,UAAqB;AACzB,MAAI,CAAC,EAAW,MAAM,EAAE;AACtB,KAAgB,0BAA0B;AAC1C;;AAEF,MAAI,CAAC,EAAU,MAAM,EAAE;AACrB,KAAgB,yBAAyB;AACzC;;AAQF,IAAa;GAJX,MAAM,EAAW,MAAM;GACvB,KAAK,EAAU,MAAM;GAGV,CAAU;IAGnB,KAAiB,MAA2C;AAChE,EAAI,EAAM,QAAQ,WAAW,EAAW,MAAM,IAAI,EAAU,MAAM,IAChE,GAAc;;AA4ClB,QACE,kBAAC,GAAD;EACQ;EACN,OAAM;EACN,SA3CF,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD;IACE,IAAG;IACH,OAAM;IACN,OAAO;IACP,WAAA;IACA,UAAA;IACA,WAAU,MAAS;AAEjB,KADA,EAAc,EAAM,OAAO,MAAM,EACjC,EAAgB,KAAA,EAAU;;IAE5B,YAAY,EACV,WAAW,GACZ;IACD,IAAI,EAAE,IAAI,GAAG;IACb,CAAA;GACF,kBAAC,GAAD;IACE,IAAG;IACH,OAAM;IACN,OAAO;IACP,WAAA;IACA,UAAA;IACA,aAAY;IACZ,WAAU,MAAS;AAEjB,KADA,EAAa,EAAM,OAAO,MAAM,EAChC,EAAgB,KAAA,EAAU;;IAE5B,YAAY,EACV,WAAW,GACZ;IACD,CAAA;GACD,KACC,kBAAC,GAAD;IAAO,UAAS;IAAQ,IAAI,EAAE,IAAI,GAAG;cAClC;IACK,CAAA;GAET,EAAA,CAOQ;EACT,oBAAoB;GAClB,UAAU;GACV,UAAU,KAAa,CAAC,EAAW,MAAM,IAAI,CAAC,EAAU,MAAM;GAC/D;EACD,WAAW;EACX,UAAU;EACV,UAAS;EACT,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProgrammaticInstructionsModal.js","names":[],"sources":["../../../src/components/ProgrammaticInstructionsModal/ProgrammaticInstructionsModal.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, Link, Tab, Tabs, Typography } from '@mui/material'\nimport { ReactElement, SyntheticEvent, useState } from 'react'\nimport { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog'\n\nexport enum ProgrammaticOptionsTabs {\n COMMAND_LINE = 'Command Line',\n R = 'R',\n PYTHON = 'Python',\n}\n\nexport type ProgrammaticInstructionsModalProps = {\n show: boolean\n title: string\n onClose: () => void\n pythonNotes?: ReactElement\n pythonCode?: string\n rNotes?: ReactElement\n rCode?: string\n cliNotes?: ReactElement\n cliCode?: string\n helpMarkdown?: string\n helpUrl?: string\n}\n\n/**\n * Modal used to show programmatic instructions\n * @param props\n * @returns\n */\n\nexport const ProgrammaticInstructionsModal = ({\n show,\n title,\n onClose,\n pythonNotes,\n pythonCode,\n rNotes,\n rCode,\n cliNotes,\n cliCode,\n helpMarkdown,\n helpUrl,\n}: ProgrammaticInstructionsModalProps): React.ReactNode => {\n let defaultTab\n if (cliCode) {\n defaultTab = ProgrammaticOptionsTabs.COMMAND_LINE\n } else if (pythonCode) {\n defaultTab = ProgrammaticOptionsTabs.PYTHON\n } else {\n defaultTab = ProgrammaticOptionsTabs.R\n }\n const [currentTab, setCurrentTab] =\n useState<ProgrammaticOptionsTabs>(defaultTab)\n\n const installationInstructions = (\n <Typography variant=\"body1\">\n Installation instructions are available at our{' '}\n <Link\n href={\n 'https://help.synapse.org/docs/Installing-Synapse-API-Clients.1985249668.html'\n }\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Synapse API Documentation Site\n </Link>\n .\n </Typography>\n )\n\n const dialogContent = (\n <>\n <Box\n sx={{\n borderBottom: 1,\n borderColor: 'divider',\n marginBottom: 4,\n }}\n >\n <Tabs\n value={currentTab}\n onChange={(\n event: SyntheticEvent,\n newValue: ProgrammaticOptionsTabs,\n ) => {\n event.stopPropagation()\n setCurrentTab(newValue)\n }}\n textColor=\"secondary\"\n indicatorColor=\"secondary\"\n >\n {cliCode && (\n <Tab\n value={ProgrammaticOptionsTabs.COMMAND_LINE}\n label={ProgrammaticOptionsTabs.COMMAND_LINE}\n />\n )}\n {rCode && (\n <Tab\n value={ProgrammaticOptionsTabs.R}\n label={ProgrammaticOptionsTabs.R}\n />\n )}\n {pythonCode && (\n <Tab\n value={ProgrammaticOptionsTabs.PYTHON}\n label={ProgrammaticOptionsTabs.PYTHON}\n />\n )}\n </Tabs>\n </Box>\n <Box sx={{ '& > p': { marginBottom: 3 } }}>\n {currentTab === ProgrammaticOptionsTabs.COMMAND_LINE && (\n <>\n <Typography variant=\"body1\">{cliNotes}</Typography>\n {installationInstructions}\n <pre>{cliCode}</pre>\n </>\n )}\n {currentTab === ProgrammaticOptionsTabs.R && (\n <>\n <Typography variant=\"body1\">{rNotes}</Typography>\n {installationInstructions}\n <pre>{rCode}</pre>\n </>\n )}\n {currentTab === ProgrammaticOptionsTabs.PYTHON && (\n <>\n <Typography variant=\"body1\">{pythonNotes}</Typography>\n {installationInstructions}\n <pre>{pythonCode}</pre>\n </>\n )}\n </Box>\n </>\n )\n\n const titleHelpPopoverProps = helpMarkdown\n ? {\n markdownText: helpMarkdown,\n helpUrl: helpUrl,\n }\n : undefined\n\n return (\n <ConfirmationDialog\n open={show}\n title={title}\n onCancel={onClose}\n onConfirm={onClose}\n maxWidth=\"md\"\n titleHelpPopoverProps={titleHelpPopoverProps}\n content={dialogContent}\n hasCancelButton={false}\n />\n )\n}\n\nexport default ProgrammaticInstructionsModal\n"],"mappings":";;;;;AAKA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,eAAA,gBACA,EAAA,IAAA,KACA,EAAA,SAAA;KACD,EAsBY,KAAiC,EAC5C,SACA,UACA,YACA,gBACA,eACA,WACA,UACA,aACA,YACA,iBACA,iBACyD;CACzD,IAAI;AACJ,CAKE,IALE,IACW,EAAwB,eAC5B,IACI,EAAwB,SAExB,EAAwB;CAEvC,IAAM,CAAC,GAAY,KACjB,EAAkC,EAAW,EAEzC,IACJ,kBAAC,GAAD;EAAY,SAAQ;YAApB;GAA4B;GACqB;GAC/C,kBAAC,GAAD;IACE,MACE;IAEF,QAAO;IACP,KAAI;cACL;IAEM,CAAA;;GAEI;KAGT,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,IAAI;GACF,cAAc;GACd,aAAa;GACb,cAAc;GACf;YAED,kBAAC,GAAD;GACE,OAAO;GACP,WACE,GACA,MACG;AAEH,IADA,EAAM,iBAAiB,EACvB,EAAc,EAAS;;GAEzB,WAAU;GACV,gBAAe;aAVjB;IAYG,KACC,kBAAC,GAAD;KACE,OAAO,EAAwB;KAC/B,OAAO,EAAwB;KAC/B,CAAA;IAEH,KACC,kBAAC,GAAD;KACE,OAAO,EAAwB;KAC/B,OAAO,EAAwB;KAC/B,CAAA;IAEH,KACC,kBAAC,GAAD;KACE,OAAO,EAAwB;KAC/B,OAAO,EAAwB;KAC/B,CAAA;IAEC;;EACH,CAAA,EACN,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,EAAE,cAAc,GAAG,EAAE;YAAzC;GACG,MAAe,EAAwB,gBACtC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,GAAD;KAAY,SAAQ;eAAS;KAAsB,CAAA;IAClD;IACD,kBAAC,OAAD,EAAA,UAAM,GAAc,CAAA;IACnB,EAAA,CAAA;GAEJ,MAAe,EAAwB,KACtC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,GAAD;KAAY,SAAQ;eAAS;KAAoB,CAAA;IAChD;IACD,kBAAC,OAAD,EAAA,UAAM,GAAY,CAAA;IACjB,EAAA,CAAA;GAEJ,MAAe,EAAwB,UACtC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,GAAD;KAAY,SAAQ;eAAS;KAAyB,CAAA;IACrD;IACD,kBAAC,OAAD,EAAA,UAAM,GAAiB,CAAA;IACtB,EAAA,CAAA;GAED;IACL,EAAA,CAAA;AAUL,QACE,kBAAC,GAAD;EACE,MAAM;EACC;EACP,UAAU;EACV,WAAW;EACX,UAAS;EACc,uBAdG,IAC1B;GACE,cAAc;GACL;GACV,GACD,KAAA;EAUA,SAAS;EACT,iBAAiB;EACjB,CAAA"}
1
+ {"version":3,"file":"ProgrammaticInstructionsModal.js","names":[],"sources":["../../../src/components/ProgrammaticInstructionsModal/ProgrammaticInstructionsModal.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, Link, Tab, Tabs, Typography } from '@mui/material'\nimport { ReactElement, SyntheticEvent, useState } from 'react'\nimport { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog'\n\nexport enum ProgrammaticOptionsTabs {\n COMMAND_LINE = 'Command Line',\n R = 'R',\n PYTHON = 'Python',\n}\n\nexport type ProgrammaticInstructionsModalProps = {\n show: boolean\n title: string\n onClose: () => void\n pythonNotes?: ReactElement\n pythonCode?: string\n rNotes?: ReactElement\n rCode?: string\n cliNotes?: ReactElement\n cliCode?: string\n helpMarkdown?: string\n helpUrl?: string\n}\n\n/**\n * Modal used to show programmatic instructions\n * @param props\n * @returns\n */\n\nexport const ProgrammaticInstructionsModal = ({\n show,\n title,\n onClose,\n pythonNotes,\n pythonCode,\n rNotes,\n rCode,\n cliNotes,\n cliCode,\n helpMarkdown,\n helpUrl,\n}: ProgrammaticInstructionsModalProps): React.ReactNode => {\n let defaultTab\n if (cliCode) {\n defaultTab = ProgrammaticOptionsTabs.COMMAND_LINE\n } else if (pythonCode) {\n defaultTab = ProgrammaticOptionsTabs.PYTHON\n } else {\n defaultTab = ProgrammaticOptionsTabs.R\n }\n const [currentTab, setCurrentTab] =\n useState<ProgrammaticOptionsTabs>(defaultTab)\n\n const installationInstructions = (\n <Typography variant=\"body1\">\n Installation instructions are available at our{' '}\n <Link\n href={\n 'https://help.synapse.org/docs/Installing-Synapse-API-Clients.1985249668.html'\n }\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Synapse API Documentation Site\n </Link>\n .\n </Typography>\n )\n\n const dialogContent = (\n <>\n <Box\n sx={{\n borderBottom: 1,\n borderColor: 'divider',\n marginBottom: 4,\n }}\n >\n <Tabs\n value={currentTab}\n onChange={(\n event: SyntheticEvent,\n newValue: ProgrammaticOptionsTabs,\n ) => {\n event.stopPropagation()\n setCurrentTab(newValue)\n }}\n textColor=\"secondary\"\n indicatorColor=\"secondary\"\n >\n {cliCode && (\n <Tab\n value={ProgrammaticOptionsTabs.COMMAND_LINE}\n label={ProgrammaticOptionsTabs.COMMAND_LINE}\n />\n )}\n {rCode && (\n <Tab\n value={ProgrammaticOptionsTabs.R}\n label={ProgrammaticOptionsTabs.R}\n />\n )}\n {pythonCode && (\n <Tab\n value={ProgrammaticOptionsTabs.PYTHON}\n label={ProgrammaticOptionsTabs.PYTHON}\n />\n )}\n </Tabs>\n </Box>\n <Box sx={{ '& > p': { marginBottom: 3 } }}>\n {currentTab === ProgrammaticOptionsTabs.COMMAND_LINE && (\n <>\n <Typography variant=\"body1\">{cliNotes}</Typography>\n {installationInstructions}\n <pre>{cliCode}</pre>\n </>\n )}\n {currentTab === ProgrammaticOptionsTabs.R && (\n <>\n <Typography variant=\"body1\">{rNotes}</Typography>\n {installationInstructions}\n <pre>{rCode}</pre>\n </>\n )}\n {currentTab === ProgrammaticOptionsTabs.PYTHON && (\n <>\n <Typography variant=\"body1\">{pythonNotes}</Typography>\n {installationInstructions}\n <pre>{pythonCode}</pre>\n </>\n )}\n </Box>\n </>\n )\n\n const titleHelpPopoverProps = helpMarkdown\n ? {\n markdownText: helpMarkdown,\n helpUrl: helpUrl,\n }\n : undefined\n\n return (\n <ConfirmationDialog\n open={show}\n title={title}\n onCancel={onClose}\n onConfirm={onClose}\n maxWidth=\"md\"\n titleHelpPopoverProps={titleHelpPopoverProps}\n content={dialogContent}\n hasCancelButton={false}\n />\n )\n}\n\nexport default ProgrammaticInstructionsModal\n"],"mappings":";;;;;AAKA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,eAAe,gBACf,EAAA,IAAI,KACJ,EAAA,SAAS;KACV,EAsBY,KAAiC,EAC5C,SACA,UACA,YACA,gBACA,eACA,WACA,UACA,aACA,YACA,iBACA,iBACyD;CACzD,IAAI;AACJ,CAKE,IALE,IACW,EAAwB,eAC5B,IACI,EAAwB,SAExB,EAAwB;CAEvC,IAAM,CAAC,GAAY,KACjB,EAAkC,EAAW,EAEzC,IACJ,kBAAC,GAAD;EAAY,SAAQ;YAApB;GAA4B;GACqB;GAC/C,kBAAC,GAAD;IACE,MACE;IAEF,QAAO;IACP,KAAI;cACL;IAEM,CAAA;;GAEI;KAGT,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,IAAI;GACF,cAAc;GACd,aAAa;GACb,cAAc;GACf;YAED,kBAAC,GAAD;GACE,OAAO;GACP,WACE,GACA,MACG;AAEH,IADA,EAAM,iBAAiB,EACvB,EAAc,EAAS;;GAEzB,WAAU;GACV,gBAAe;aAVjB;IAYG,KACC,kBAAC,GAAD;KACE,OAAO,EAAwB;KAC/B,OAAO,EAAwB;KAC/B,CAAA;IAEH,KACC,kBAAC,GAAD;KACE,OAAO,EAAwB;KAC/B,OAAO,EAAwB;KAC/B,CAAA;IAEH,KACC,kBAAC,GAAD;KACE,OAAO,EAAwB;KAC/B,OAAO,EAAwB;KAC/B,CAAA;IAEC;;EACH,CAAA,EACN,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,EAAE,cAAc,GAAG,EAAE;YAAzC;GACG,MAAe,EAAwB,gBACtC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,GAAD;KAAY,SAAQ;eAAS;KAAsB,CAAA;IAClD;IACD,kBAAC,OAAD,EAAA,UAAM,GAAc,CAAA;IACnB,EAAA,CAAA;GAEJ,MAAe,EAAwB,KACtC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,GAAD;KAAY,SAAQ;eAAS;KAAoB,CAAA;IAChD;IACD,kBAAC,OAAD,EAAA,UAAM,GAAY,CAAA;IACjB,EAAA,CAAA;GAEJ,MAAe,EAAwB,UACtC,kBAAA,GAAA,EAAA,UAAA;IACE,kBAAC,GAAD;KAAY,SAAQ;eAAS;KAAyB,CAAA;IACrD;IACD,kBAAC,OAAD,EAAA,UAAM,GAAiB,CAAA;IACtB,EAAA,CAAA;GAED;IACL,EAAA,CAAA;AAUL,QACE,kBAAC,GAAD;EACE,MAAM;EACC;EACP,UAAU;EACV,WAAW;EACX,UAAS;EACc,uBAdG,IAC1B;GACE,cAAc;GACL;GACV,GACD,KAAA;EAUA,SAAS;EACT,iBAAiB;EACjB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProgrammaticTableDownload.js","names":[],"sources":["../../../src/components/ProgrammaticTableDownload/ProgrammaticTableDownload.tsx"],"sourcesContent":["import { useGetQueryResultBundleWithAsyncStatus } from '@/synapse-queries'\nimport { SynapseConstants } from '@/utils'\nimport { Link } from '@mui/material'\nimport { QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n PYTHON_CLIENT_IMPORT_AND_LOGIN,\n R_CLIENT_IMPORT_AND_LOGIN,\n} from '../DownloadCart/DirectProgrammaticDownload'\nimport { ProgrammaticInstructionsModal } from '../ProgrammaticInstructionsModal/ProgrammaticInstructionsModal'\n\nexport type ProgrammaticTableDownloadProps = {\n queryBundleRequest: QueryBundleRequest\n onHide: () => void\n}\n\nexport function ProgrammaticTableDownload({\n queryBundleRequest,\n onHide,\n}: ProgrammaticTableDownloadProps) {\n const [generatedSql, setGeneratedSql] = useState('...')\n\n const {\n data: asyncJobStatus,\n isLoading: queryIsLoading,\n isPlaceholderData: newQueryIsFetching,\n } = useGetQueryResultBundleWithAsyncStatus(\n {\n ...queryBundleRequest,\n partMask: SynapseConstants.BUNDLE_MASK_COMBINED_SQL,\n },\n {\n placeholderData: previousData => previousData,\n throwOnError: true,\n },\n )\n\n const combinedSql = asyncJobStatus?.responseBody?.combinedSql\n const isLoadingNewBundle = queryIsLoading || newQueryIsFetching\n\n useEffect(() => {\n if (combinedSql && !isLoadingNewBundle) {\n // SWC-5686: The ID column is required by the client, and this column may not have been selected!\n // Change the SQL to \"SELECT * ...\"\n const indexOfFrom = combinedSql.toUpperCase().indexOf('FROM SYN')\n const selectStarTransformedSql = `SELECT * ${combinedSql.substring(\n indexOfFrom,\n )}`\n setGeneratedSql(selectStarTransformedSql)\n }\n }, [combinedSql, isLoadingNewBundle])\n\n // Replace quotation marks with escaped quotations. For CLI, also escape backticks.\n const commandLineSql = useMemo(\n () => generatedSql.replace(/([\"`])/g, '\\\\$1'),\n [generatedSql],\n )\n\n const clientSql = useMemo(\n () => generatedSql.replace(/\"/g, '\\\\\"'),\n [generatedSql],\n )\n\n return (\n <ProgrammaticInstructionsModal\n show={true}\n onClose={onHide}\n title=\"Download Programmatically\"\n cliNotes={\n <>\n This command line code will download Synapse files AND file\n annotations to your working directory.\n </>\n }\n cliCode={`synapse get -q \"${commandLineSql}\"`}\n rNotes={\n <>\n This R code will download file annotations only. Use{' '}\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href=\"https://help.synapse.org/docs/Get-Started-with-Downloading-Data.2004254837.html#GetStartedwithDownloadingData-DownloadingFiles\"\n >\n synGet{'()'}\n </Link>{' '}\n to loop over the list of Synapse IDs from the file annotations to\n download files.\n </>\n }\n rCode={`${R_CLIENT_IMPORT_AND_LOGIN}\nquery ${'<-'} synTableQuery(\"${clientSql}\")${'\\n'}read.table(query$filepath, sep = \",\")`}\n pythonNotes={\n <>\n This Python code will download file annotations only. Use{' '}\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href=\"https://help.synapse.org/docs/Get-Started-with-Downloading-Data.2004254837.html#GetStartedwithDownloadingData-DownloadingFiles\"\n >\n syn.get\n </Link>{' '}\n to loop over the list of Synapse IDs from the file annotations to\n download files.\n </>\n }\n pythonCode={`${PYTHON_CLIENT_IMPORT_AND_LOGIN}\nquery = syn.tableQuery(\"${clientSql}\")${'\\n'}query.asDataFrame()`}\n />\n )\n}\n\nexport default ProgrammaticTableDownload\n"],"mappings":";;;;;;;;;;AAgBA,SAAgB,EAA0B,EACxC,uBACA,aACiC;CACjC,IAAM,CAAC,GAAc,KAAmB,EAAS,MAAM,EAEjD,EACJ,MAAM,GACN,WAAW,GACX,mBAAmB,MACjB,EACF;EACE,GAAG;EACH,UAAU;EACX,EACD;EACE,kBAAiB,MAAgB;EACjC,cAAc;EACf,CACF,EAEK,IAAc,GAAgB,cAAc,aAC5C,IAAqB,KAAkB;AAE7C,SAAgB;AACd,MAAI,KAAe,CAAC,GAAoB;GAGtC,IAAM,IAAc,EAAY,aAAa,CAAC,QAAQ,WAAW;AAIjE,KAHiC,YAAY,EAAY,UACvD,EACD,GACwC;;IAE1C,CAAC,GAAa,EAAmB,CAAC;CAGrC,IAAM,IAAiB,QACf,EAAa,QAAQ,WAAW,OAAO,EAC7C,CAAC,EAAa,CACf,EAEK,IAAY,QACV,EAAa,QAAQ,MAAM,OAAM,EACvC,CAAC,EAAa,CACf;AAED,QACE,kBAAC,GAAD;EACE,MAAM;EACN,SAAS;EACT,OAAM;EACN,UACE,kBAAA,GAAA,EAAA,UAAE,sGAGC,CAAA;EAEL,SAAS,mBAAmB,EAAe;EAC3C,QACE,kBAAA,GAAA,EAAA,UAAA;GAAE;GACqD;GACrD,kBAAC,GAAD;IACE,QAAO;IACP,KAAI;IACJ,MAAK;cAHP,CAIC,UACQ,KACF;;GAAC;GAAI;GAGX,EAAA,CAAA;EAEL,OAAO,GAAG,EAA0B;0BACX,EAAU;;EACnC,aACE,kBAAA,GAAA,EAAA,UAAA;GAAE;GAC0D;GAC1D,kBAAC,GAAD;IACE,QAAO;IACP,KAAI;IACJ,MAAK;cACN;IAEM,CAAA;GAAC;GAAI;GAGX,EAAA,CAAA;EAEL,YAAY,GAAG,EAA+B;0BAC1B,EAAU;;EAC9B,CAAA"}
1
+ {"version":3,"file":"ProgrammaticTableDownload.js","names":[],"sources":["../../../src/components/ProgrammaticTableDownload/ProgrammaticTableDownload.tsx"],"sourcesContent":["import { useGetQueryResultBundleWithAsyncStatus } from '@/synapse-queries'\nimport { SynapseConstants } from '@/utils'\nimport { Link } from '@mui/material'\nimport { QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n PYTHON_CLIENT_IMPORT_AND_LOGIN,\n R_CLIENT_IMPORT_AND_LOGIN,\n} from '../DownloadCart/DirectProgrammaticDownload'\nimport { ProgrammaticInstructionsModal } from '../ProgrammaticInstructionsModal/ProgrammaticInstructionsModal'\n\nexport type ProgrammaticTableDownloadProps = {\n queryBundleRequest: QueryBundleRequest\n onHide: () => void\n}\n\nexport function ProgrammaticTableDownload({\n queryBundleRequest,\n onHide,\n}: ProgrammaticTableDownloadProps) {\n const [generatedSql, setGeneratedSql] = useState('...')\n\n const {\n data: asyncJobStatus,\n isLoading: queryIsLoading,\n isPlaceholderData: newQueryIsFetching,\n } = useGetQueryResultBundleWithAsyncStatus(\n {\n ...queryBundleRequest,\n partMask: SynapseConstants.BUNDLE_MASK_COMBINED_SQL,\n },\n {\n placeholderData: previousData => previousData,\n throwOnError: true,\n },\n )\n\n const combinedSql = asyncJobStatus?.responseBody?.combinedSql\n const isLoadingNewBundle = queryIsLoading || newQueryIsFetching\n\n useEffect(() => {\n if (combinedSql && !isLoadingNewBundle) {\n // SWC-5686: The ID column is required by the client, and this column may not have been selected!\n // Change the SQL to \"SELECT * ...\"\n const indexOfFrom = combinedSql.toUpperCase().indexOf('FROM SYN')\n const selectStarTransformedSql = `SELECT * ${combinedSql.substring(\n indexOfFrom,\n )}`\n setGeneratedSql(selectStarTransformedSql)\n }\n }, [combinedSql, isLoadingNewBundle])\n\n // Replace quotation marks with escaped quotations. For CLI, also escape backticks.\n const commandLineSql = useMemo(\n () => generatedSql.replace(/([\"`])/g, '\\\\$1'),\n [generatedSql],\n )\n\n const clientSql = useMemo(\n () => generatedSql.replace(/\"/g, '\\\\\"'),\n [generatedSql],\n )\n\n return (\n <ProgrammaticInstructionsModal\n show={true}\n onClose={onHide}\n title=\"Download Programmatically\"\n cliNotes={\n <>\n This command line code will download Synapse files AND file\n annotations to your working directory.\n </>\n }\n cliCode={`synapse get -q \"${commandLineSql}\"`}\n rNotes={\n <>\n This R code will download file annotations only. Use{' '}\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href=\"https://help.synapse.org/docs/Get-Started-with-Downloading-Data.2004254837.html#GetStartedwithDownloadingData-DownloadingFiles\"\n >\n synGet{'()'}\n </Link>{' '}\n to loop over the list of Synapse IDs from the file annotations to\n download files.\n </>\n }\n rCode={`${R_CLIENT_IMPORT_AND_LOGIN}\nquery ${'<-'} synTableQuery(\"${clientSql}\")${'\\n'}read.table(query$filepath, sep = \",\")`}\n pythonNotes={\n <>\n This Python code will download file annotations only. Use{' '}\n <Link\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href=\"https://help.synapse.org/docs/Get-Started-with-Downloading-Data.2004254837.html#GetStartedwithDownloadingData-DownloadingFiles\"\n >\n syn.get\n </Link>{' '}\n to loop over the list of Synapse IDs from the file annotations to\n download files.\n </>\n }\n pythonCode={`${PYTHON_CLIENT_IMPORT_AND_LOGIN}\nquery = syn.tableQuery(\"${clientSql}\")${'\\n'}query.asDataFrame()`}\n />\n )\n}\n\nexport default ProgrammaticTableDownload\n"],"mappings":";;;;;;;;;;AAgBA,SAAgB,EAA0B,EACxC,uBACA,aACiC;CACjC,IAAM,CAAC,GAAc,KAAmB,EAAS,MAAM,EAEjD,EACJ,MAAM,GACN,WAAW,GACX,mBAAmB,MACjB,EACF;EACE,GAAG;EACH,UAAU;EACX,EACD;EACE,kBAAiB,MAAgB;EACjC,cAAc;EACf,CACF,EAEK,IAAc,GAAgB,cAAc,aAC5C,IAAqB,KAAkB;AAE7C,SAAgB;AACd,MAAI,KAAe,CAAC,GAAoB;GAGtC,IAAM,IAAc,EAAY,aAAa,CAAC,QAAQ,WAAW;AAIjE,KAAgB,YAH6B,EAAY,UACvD,EACD,GACwC;;IAE1C,CAAC,GAAa,EAAmB,CAAC;CAGrC,IAAM,IAAiB,QACf,EAAa,QAAQ,WAAW,OAAO,EAC7C,CAAC,EAAa,CACf,EAEK,IAAY,QACV,EAAa,QAAQ,MAAM,OAAM,EACvC,CAAC,EAAa,CACf;AAED,QACE,kBAAC,GAAD;EACE,MAAM;EACN,SAAS;EACT,OAAM;EACN,UACE,kBAAA,GAAA,EAAA,UAAE,sGAGC,CAAA;EAEL,SAAS,mBAAmB,EAAe;EAC3C,QACE,kBAAA,GAAA,EAAA,UAAA;GAAE;GACqD;GACrD,kBAAC,GAAD;IACE,QAAO;IACP,KAAI;IACJ,MAAK;cAHP,CAIC,UACQ,KACF;;GAAC;GAAI;GAGX,EAAA,CAAA;EAEL,OAAO,GAAG,EAA0B;0BACX,EAAU;;EACnC,aACE,kBAAA,GAAA,EAAA,UAAA;GAAE;GAC0D;GAC1D,kBAAC,GAAD;IACE,QAAO;IACP,KAAI;IACJ,MAAK;cACN;IAEM,CAAA;GAAC;GAAI;GAGX,EAAA,CAAA;EAEL,YAAY,GAAG,EAA+B;0BAC1B,EAAU;;EAC9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Programs.Mobile.js","names":[],"sources":["../../../src/components/Programs/Programs.Mobile.tsx"],"sourcesContent":["import LargeButton from '@/components/styled/LargeButton'\nimport ExpandableContent from '../home_page/ExpandableContent'\nimport { ImageFileHandle } from '../widgets/ImageFileHandle'\nimport { ProgramsDataProps } from './Programs'\n\nexport default function ProgramsMobile({\n link,\n summary,\n title,\n color,\n fileHandleAssociation,\n exploreLink,\n}: ProgramsDataProps) {\n const titleElement = (\n <div className=\"Programs__Mobile__Header\">\n <span className=\"Programs__Card__header__icon\">\n {fileHandleAssociation && (\n <ImageFileHandle fileHandleAssociation={fileHandleAssociation} />\n )}\n </span>\n <span className=\"Programs__Mobile__Header__Title\"> {title} </span>\n </div>\n )\n const content = (\n <div className=\"Programs__Mobile__Content\">\n {link && (\n <p className=\"Programs__Card__header__info__link\">\n <a\n className=\"highlight-link\"\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n Visit website\n </a>\n </p>\n )}\n <p>{summary}</p>\n <LargeButton\n color=\"secondary\"\n variant=\"contained\"\n href={exploreLink}\n sx={{ marginLeft: 0 }}\n >\n Explore\n </LargeButton>\n </div>\n )\n return <ExpandableContent title={titleElement} content={content} />\n}\n"],"mappings":";;;;;AAKA,SAAwB,EAAe,EACrC,SACA,YACA,UACA,UACA,0BACA,kBACoB;AAoCpB,QAAO,kBAAC,GAAD;EAAmB,OAlCxB,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACb,KACC,kBAAC,GAAD,EAAwC,0BAAyB,CAAA;IAE9D,CAAA,EACP,kBAAC,QAAD;IAAM,WAAU;cAAhB;KAAkD;KAAE;KAAM;KAAQ;MAC9D;;EA2BgD,SAxBtD,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,KACC,kBAAC,KAAD;KAAG,WAAU;eACX,kBAAC,KAAD;MACE,WAAU;MACV,MAAM;MACN,QAAO;MACP,KAAI;gBACL;MAEG,CAAA;KACF,CAAA;IAEN,kBAAC,KAAD,EAAA,UAAI,GAAY,CAAA;IAChB,kBAAC,GAAD;KACE,OAAM;KACN,SAAQ;KACR,MAAM;KACN,IAAI,EAAE,YAAY,GAAG;eACtB;KAEa,CAAA;IACV;;EAE2D,CAAA"}
1
+ {"version":3,"file":"Programs.Mobile.js","names":[],"sources":["../../../src/components/Programs/Programs.Mobile.tsx"],"sourcesContent":["import LargeButton from '@/components/styled/LargeButton'\nimport ExpandableContent from '../home_page/ExpandableContent'\nimport { ImageFileHandle } from '../widgets/ImageFileHandle'\nimport { ProgramsDataProps } from './Programs'\n\nexport default function ProgramsMobile({\n link,\n summary,\n title,\n color,\n fileHandleAssociation,\n exploreLink,\n}: ProgramsDataProps) {\n const titleElement = (\n <div className=\"Programs__Mobile__Header\">\n <span className=\"Programs__Card__header__icon\">\n {fileHandleAssociation && (\n <ImageFileHandle fileHandleAssociation={fileHandleAssociation} />\n )}\n </span>\n <span className=\"Programs__Mobile__Header__Title\"> {title} </span>\n </div>\n )\n const content = (\n <div className=\"Programs__Mobile__Content\">\n {link && (\n <p className=\"Programs__Card__header__info__link\">\n <a\n className=\"highlight-link\"\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n Visit website\n </a>\n </p>\n )}\n <p>{summary}</p>\n <LargeButton\n color=\"secondary\"\n variant=\"contained\"\n href={exploreLink}\n sx={{ marginLeft: 0 }}\n >\n Explore\n </LargeButton>\n </div>\n )\n return <ExpandableContent title={titleElement} content={content} />\n}\n"],"mappings":";;;;;AAKA,SAAwB,EAAe,EACrC,SACA,YACA,UACA,UACA,0BACA,kBACoB;AAoCpB,QAAO,kBAAC,GAAD;EAAmB,OAlCxB,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACb,KACC,kBAAC,GAAD,EAAwC,0BAAyB,CAAA;IAE9D,CAAA,EACP,kBAAC,QAAD;IAAM,WAAU;cAAhB;KAAkD;KAAE;KAAM;KAAQ;MAC9D;IA2ByB;EAAuB,SAxBtD,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,KACC,kBAAC,KAAD;KAAG,WAAU;eACX,kBAAC,KAAD;MACE,WAAU;MACV,MAAM;MACN,QAAO;MACP,KAAI;gBACL;MAEG,CAAA;KACF,CAAA;IAEN,kBAAC,KAAD,EAAA,UAAI,GAAY,CAAA;IAChB,kBAAC,GAAD;KACE,OAAM;KACN,SAAQ;KACR,MAAM;KACN,IAAI,EAAE,YAAY,GAAG;eACtB;KAEa,CAAA;IACV;IAEgD;EAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Programs.js","names":[],"sources":["../../../src/components/Programs/Programs.tsx"],"sourcesContent":["import { useGetEntity } from '@/synapse-queries/entity/useEntity'\nimport useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { SynapseConstants } from '@/utils'\nimport { getFieldIndex } from '@/utils/functions/queryUtils'\nimport useShowDesktop from '@/utils/hooks/useShowDesktop'\nimport {\n FileHandleAssociation,\n QueryBundleRequest,\n} from '@sage-bionetworks/synapse-types'\nimport { CardLink } from '../CardContainer/CardLink'\nimport { getColorPalette } from '../ColorGradient/ColorGradient'\nimport {\n getFileHandleAssociation,\n getLinkParams,\n} from '../GenericCard/CardUtils'\nimport ProgramsDesktop from './Programs.Desktop'\nimport ProgramsMobile from './Programs.Mobile'\n\nexport type ProgramsProps = {\n entityId: string\n rgbIndex: number\n titleColumnName: string\n linkColumnName: string\n summaryColumnName: string\n imageFileHandleColumnName: string\n linkConfig: CardLink\n}\n\nexport type ProgramsDataProps = {\n title: string\n summary: string\n link: string\n exploreLink: string\n color: string\n fileHandleAssociation?: FileHandleAssociation\n}\n\nexport function Programs(props: ProgramsProps) {\n const {\n entityId,\n titleColumnName,\n linkColumnName,\n summaryColumnName,\n imageFileHandleColumnName,\n linkConfig,\n rgbIndex,\n } = props\n const showDesktop = useShowDesktop()\n const entity = useGetEntity(entityId)\n const color: string = getColorPalette(rgbIndex ?? 0, 2).colorPalette[0]\n const queryBundleRequest: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId,\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n query: {\n sql: `select * from ${entityId}`,\n },\n }\n const { data: queryResultBundle } =\n useGetQueryResultBundle(queryBundleRequest)\n\n const titleColumnIndex = getFieldIndex(titleColumnName, queryResultBundle)\n const summaryColumnIndex = getFieldIndex(summaryColumnName, queryResultBundle)\n const linkColumnIndex = getFieldIndex(linkColumnName, queryResultBundle)\n const iconColumnIndex = getFieldIndex(\n imageFileHandleColumnName,\n queryResultBundle,\n )\n return (\n <div className={`Programs${showDesktop ? '__Desktop' : ''}`}>\n {queryResultBundle?.queryResult!.queryResults.rows.map(el => {\n const values = el.values as string[]\n if (values.some(value => value === null)) {\n // We cast values above assuming there are no null values, emit a warning just in case.\n console.warn('Row has null value(s) when no nulls expected')\n }\n\n const title = values[titleColumnIndex]\n const summary = values[summaryColumnIndex]\n const link = values[linkColumnIndex] ?? ''\n const iconFileHandleIdValue = values[iconColumnIndex]\n\n const schema: Record<string, number> = {}\n queryResultBundle?.queryResult!.queryResults.headers.forEach(\n (header, colIndex) => {\n schema[header.name] = colIndex\n },\n )\n const { href } = getLinkParams(link, linkConfig, values, schema)\n\n const fileHandleAssociation = getFileHandleAssociation(\n entity.data,\n iconFileHandleIdValue,\n `syn${el.rowId}`,\n )\n const ProgramsDataProps: ProgramsDataProps = {\n title,\n summary,\n link,\n color,\n exploreLink: href,\n fileHandleAssociation,\n }\n return showDesktop ? (\n <ProgramsDesktop {...ProgramsDataProps} />\n ) : (\n <ProgramsMobile {...ProgramsDataProps} />\n )\n })}\n </div>\n )\n}\n\nexport default Programs\n"],"mappings":";;;;;;;;;;;;AAqCA,SAAgB,EAAS,GAAsB;CAC7C,IAAM,EACJ,aACA,oBACA,mBACA,sBACA,8BACA,eACA,gBACE,GACE,IAAc,GAAgB,EAC9B,IAAS,EAAa,EAAS,EAC/B,IAAgB,EAAgB,KAAY,GAAG,EAAE,CAAC,aAAa,IAW/D,EAAE,MAAM,MACZ,EAX6C;EAC7C,cAAc;EACd;EACA,UACE;EAEF,OAAO,EACL,KAAK,iBAAiB,KACvB;EACF,CAE4C,EAEvC,IAAmB,EAAc,GAAiB,EAAkB,EACpE,IAAqB,EAAc,GAAmB,EAAkB,EACxE,IAAkB,EAAc,GAAgB,EAAkB,EAClE,IAAkB,EACtB,GACA,EACD;AACD,QACE,kBAAC,OAAD;EAAK,WAAW,WAAW,IAAc,cAAc;YACpD,GAAmB,YAAa,aAAa,KAAK,KAAI,MAAM;GAC3D,IAAM,IAAS,EAAG;AAClB,GAAI,EAAO,MAAK,MAAS,MAAU,KAAK,IAEtC,QAAQ,KAAK,+CAA+C;GAG9D,IAAM,IAAQ,EAAO,IACf,IAAU,EAAO,IACjB,IAAO,EAAO,MAAoB,IAClC,IAAwB,EAAO,IAE/B,IAAiC,EAAE;AACzC,MAAmB,YAAa,aAAa,QAAQ,SAClD,GAAQ,MAAa;AACpB,MAAO,EAAO,QAAQ;KAEzB;GACD,IAAM,EAAE,YAAS,EAAc,GAAM,GAAY,GAAQ,EAAO,EAO1D,IAAuC;IAC3C;IACA;IACA;IACA;IACA,aAAa;IACb,uBAX4B,EAC5B,EAAO,MACP,GACA,MAAM,EAAG,QACV;IAQA;AACD,UACE,EADK,IACJ,IAEA,GAFD,EAAiB,GAAI,GAAqB,CAED;IAE3C;EACE,CAAA"}
1
+ {"version":3,"file":"Programs.js","names":[],"sources":["../../../src/components/Programs/Programs.tsx"],"sourcesContent":["import { useGetEntity } from '@/synapse-queries/entity/useEntity'\nimport useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { SynapseConstants } from '@/utils'\nimport { getFieldIndex } from '@/utils/functions/queryUtils'\nimport useShowDesktop from '@/utils/hooks/useShowDesktop'\nimport {\n FileHandleAssociation,\n QueryBundleRequest,\n} from '@sage-bionetworks/synapse-types'\nimport { CardLink } from '../CardContainer/CardLink'\nimport { getColorPalette } from '../ColorGradient/ColorGradient'\nimport {\n getFileHandleAssociation,\n getLinkParams,\n} from '../GenericCard/CardUtils'\nimport ProgramsDesktop from './Programs.Desktop'\nimport ProgramsMobile from './Programs.Mobile'\n\nexport type ProgramsProps = {\n entityId: string\n rgbIndex: number\n titleColumnName: string\n linkColumnName: string\n summaryColumnName: string\n imageFileHandleColumnName: string\n linkConfig: CardLink\n}\n\nexport type ProgramsDataProps = {\n title: string\n summary: string\n link: string\n exploreLink: string\n color: string\n fileHandleAssociation?: FileHandleAssociation\n}\n\nexport function Programs(props: ProgramsProps) {\n const {\n entityId,\n titleColumnName,\n linkColumnName,\n summaryColumnName,\n imageFileHandleColumnName,\n linkConfig,\n rgbIndex,\n } = props\n const showDesktop = useShowDesktop()\n const entity = useGetEntity(entityId)\n const color: string = getColorPalette(rgbIndex ?? 0, 2).colorPalette[0]\n const queryBundleRequest: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId,\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n query: {\n sql: `select * from ${entityId}`,\n },\n }\n const { data: queryResultBundle } =\n useGetQueryResultBundle(queryBundleRequest)\n\n const titleColumnIndex = getFieldIndex(titleColumnName, queryResultBundle)\n const summaryColumnIndex = getFieldIndex(summaryColumnName, queryResultBundle)\n const linkColumnIndex = getFieldIndex(linkColumnName, queryResultBundle)\n const iconColumnIndex = getFieldIndex(\n imageFileHandleColumnName,\n queryResultBundle,\n )\n return (\n <div className={`Programs${showDesktop ? '__Desktop' : ''}`}>\n {queryResultBundle?.queryResult!.queryResults.rows.map(el => {\n const values = el.values as string[]\n if (values.some(value => value === null)) {\n // We cast values above assuming there are no null values, emit a warning just in case.\n console.warn('Row has null value(s) when no nulls expected')\n }\n\n const title = values[titleColumnIndex]\n const summary = values[summaryColumnIndex]\n const link = values[linkColumnIndex] ?? ''\n const iconFileHandleIdValue = values[iconColumnIndex]\n\n const schema: Record<string, number> = {}\n queryResultBundle?.queryResult!.queryResults.headers.forEach(\n (header, colIndex) => {\n schema[header.name] = colIndex\n },\n )\n const { href } = getLinkParams(link, linkConfig, values, schema)\n\n const fileHandleAssociation = getFileHandleAssociation(\n entity.data,\n iconFileHandleIdValue,\n `syn${el.rowId}`,\n )\n const ProgramsDataProps: ProgramsDataProps = {\n title,\n summary,\n link,\n color,\n exploreLink: href,\n fileHandleAssociation,\n }\n return showDesktop ? (\n <ProgramsDesktop {...ProgramsDataProps} />\n ) : (\n <ProgramsMobile {...ProgramsDataProps} />\n )\n })}\n </div>\n )\n}\n\nexport default Programs\n"],"mappings":";;;;;;;;;;;;AAqCA,SAAgB,EAAS,GAAsB;CAC7C,IAAM,EACJ,aACA,oBACA,mBACA,sBACA,8BACA,eACA,gBACE,GACE,IAAc,GAAgB,EAC9B,IAAS,EAAa,EAAS,EAC/B,IAAgB,EAAgB,KAAY,GAAG,EAAE,CAAC,aAAa,IAW/D,EAAE,MAAM,MACZ,EAAwB;EAVxB,cAAc;EACd;EACA,UACE;EAEF,OAAO,EACL,KAAK,iBAAiB,KACvB;EAGuB,CAAmB,EAEvC,IAAmB,EAAc,GAAiB,EAAkB,EACpE,IAAqB,EAAc,GAAmB,EAAkB,EACxE,IAAkB,EAAc,GAAgB,EAAkB,EAClE,IAAkB,EACtB,GACA,EACD;AACD,QACE,kBAAC,OAAD;EAAK,WAAW,WAAW,IAAc,cAAc;YACpD,GAAmB,YAAa,aAAa,KAAK,KAAI,MAAM;GAC3D,IAAM,IAAS,EAAG;AAClB,GAAI,EAAO,MAAK,MAAS,MAAU,KAAK,IAEtC,QAAQ,KAAK,+CAA+C;GAG9D,IAAM,IAAQ,EAAO,IACf,IAAU,EAAO,IACjB,IAAO,EAAO,MAAoB,IAClC,IAAwB,EAAO,IAE/B,IAAiC,EAAE;AACzC,MAAmB,YAAa,aAAa,QAAQ,SAClD,GAAQ,MAAa;AACpB,MAAO,EAAO,QAAQ;KAEzB;GACD,IAAM,EAAE,YAAS,EAAc,GAAM,GAAY,GAAQ,EAAO,EAO1D,IAAuC;IAC3C;IACA;IACA;IACA;IACA,aAAa;IACb,uBAX4B,EAC5B,EAAO,MACP,GACA,MAAM,EAAG,QAQT;IACD;AACD,UACE,EADK,IACJ,IAEA,GAFD,EAAiB,GAAI,GAAqB,CAED;IAE3C;EACE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProvenanceExternalIcon.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceExternalIcon.tsx"],"sourcesContent":["import React from 'react'\nimport IconSvg, { IconName } from '../IconSvg/IconSvg'\n\nexport type ProvenanceExternalIconProps = {\n url: string\n}\nconst githubRegex = /^(.+?\\.)?github\\.com$/\nconst githubusercontentRegex = /^(.+?\\.)?githubusercontent\\.com$/\n\nexport const ProvenanceExternalIcon = (\n props: ProvenanceExternalIconProps,\n): React.ReactNode => {\n const { url } = props\n let icon: IconName = 'link'\n const parsedUrl = new URL(url)\n const { hostname } = parsedUrl\n\n if (hostname.match(githubRegex) || hostname.match(githubusercontentRegex)) {\n icon = 'github'\n }\n // else if (url.includes(\"genomespace.org\")) {\n // icon = 'genomespace'\n // }\n\n // return the default (File icon)\n return <IconSvg icon={icon} />\n}\n"],"mappings":";;;;AAMA,IAAM,IAAc,yBACd,IAAyB,oCAElB,KACX,MACoB;CACpB,IAAM,EAAE,WAAQ,GACZ,IAAiB,QAEf,EAAE,gBADU,IAAI,IAAI,EAAI;AAW9B,SARI,EAAS,MAAM,EAAY,IAAI,EAAS,MAAM,EAAuB,MACvE,IAAO,WAOF,kBAAC,GAAD,EAAe,SAAQ,CAAA"}
1
+ {"version":3,"file":"ProvenanceExternalIcon.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceExternalIcon.tsx"],"sourcesContent":["import React from 'react'\nimport IconSvg, { IconName } from '../IconSvg/IconSvg'\n\nexport type ProvenanceExternalIconProps = {\n url: string\n}\nconst githubRegex = /^(.+?\\.)?github\\.com$/\nconst githubusercontentRegex = /^(.+?\\.)?githubusercontent\\.com$/\n\nexport const ProvenanceExternalIcon = (\n props: ProvenanceExternalIconProps,\n): React.ReactNode => {\n const { url } = props\n let icon: IconName = 'link'\n const parsedUrl = new URL(url)\n const { hostname } = parsedUrl\n\n if (hostname.match(githubRegex) || hostname.match(githubusercontentRegex)) {\n icon = 'github'\n }\n // else if (url.includes(\"genomespace.org\")) {\n // icon = 'genomespace'\n // }\n\n // return the default (File icon)\n return <IconSvg icon={icon} />\n}\n"],"mappings":";;;;AAMA,IAAM,IAAc,yBACd,IAAyB,oCAElB,KACX,MACoB;CACpB,IAAM,EAAE,WAAQ,GACZ,IAAiB,QAEf,EAAE,gBAAa,IADC,IAAI,EACL;AAUrB,SARI,EAAS,MAAM,EAAY,IAAI,EAAS,MAAM,EAAuB,MACvE,IAAO,WAOF,kBAAC,GAAD,EAAe,SAAQ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProvenanceGraph.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceGraph.tsx"],"sourcesContent":["import SynapseClient from '@/synapse-client'\nimport { useGetEntityHeaders } from '@/synapse-queries'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { CircularProgress } from '@mui/material'\nimport {\n Activity,\n EntityHeader,\n ReferenceList,\n Used,\n USED_ENTITY_CONCRETE_TYPE_VALUE,\n UsedEntity,\n UsedURL,\n} from '@sage-bionetworks/synapse-types'\nimport { MouseEvent, useCallback, useEffect, useState, WheelEvent } from 'react'\nimport { useErrorHandler } from 'react-error-boundary'\nimport ReactFlow, {\n Controls,\n Edge,\n getConnectedEdges,\n Node,\n ReactFlowProvider,\n useEdgesState,\n useNodesState,\n useReactFlow,\n} from 'reactflow'\nimport { SynapseErrorBoundary } from '../error/ErrorBanner'\nimport { displayToast } from '../ToastMessage/ToastMessage'\nimport { ExpandGraphNodeDataProps } from './ExpandGraphNodeLabel'\nimport {\n addActivityNode,\n addEntityNode,\n addEntityPlaceholderNode,\n addExpandNode,\n addExternalNode,\n addUndefinedNode,\n findEntityNode,\n isRootEntity,\n} from './ProvenanceGraphUtils'\nimport {\n getLayoutedElements,\n isArrayEqual,\n NodeType,\n ProvenanceNodeData,\n} from './ProvenanceUtils'\nimport 'reactflow/dist/style.css'\n\nexport type ProvenanceProps = {\n // what entity nodes should we start with?\n entityRefs: ReferenceList\n containerHeight?: string\n initialNodes?: Node[]\n initialEdges?: Edge[]\n onNodesChangedListener?: (nodes: Node[]) => void\n onEdgesChangedListener?: (edges: Edge[]) => void\n}\n\nconst MAX_ACTIVITY_EXPAND_NODES = 400\nconst DEFAULT_ZOOM = 0.85\n\n/**\n * Renders a Provenance Graph for a set of entities.\n * New Nodes are added to tempNodes, and new Edges are added to tempEdges.\n * On change, these are fed into the dagre js graph library to figure out the node positions,\n * and the output stored in 'nodes' and 'edges'. The 'nodes' and 'edges' arrays are used by the\n * ReactFlow component.\n */\nconst ProvenanceReactFlow = (props: ProvenanceProps): React.ReactNode => {\n const {\n entityRefs: rootEntityRefs,\n containerHeight = '200px',\n initialNodes = [],\n initialEdges = [],\n onNodesChangedListener,\n onEdgesChangedListener,\n } = props\n const { accessToken } = useSynapseContext()\n const [tempNodes, setTempNodes] = useState<Node[]>(initialNodes)\n const [tempEdges, setTempEdges] = useState<Edge[]>(initialEdges)\n const [nodes, setNodes] = useNodesState([])\n const [edges, setEdges] = useEdgesState([])\n const [clickedNode, setClickedNode] = useState<Node>()\n const handleError = useErrorHandler()\n\n const { data: rootEntityHeadersPage, isSuccess } = useGetEntityHeaders(\n rootEntityRefs,\n { throwOnError: true },\n )\n if (\n isSuccess &&\n rootEntityHeadersPage &&\n rootEntityHeadersPage.totalNumberOfResults == 0\n ) {\n const synapseIds = rootEntityRefs.map(ref => ref.targetId).join(',')\n handleError(\n `Unable to load provenance for the given Synapse IDs: ${synapseIds}`,\n )\n }\n const rootEntityHeaders = rootEntityHeadersPage?.results\n const [initializedPosition, setInitializedPosition] = useState<boolean>(false)\n\n // Get the react flow instance so we attempt to properly center the view.\n const reactFlowInstance = useReactFlow()\n\n const onClickNode = useCallback((_event: MouseEvent, node: Node) => {\n setClickedNode(node)\n }, [])\n\n /**\n * Called when we have a new entity to add to the graph. This will result in adding\n * a new Entity Node to the nodesCopy, a link from the usedInActivity to the new Entity Node,\n * AND it will look for an Activity associated with the new entity. If an Activity is found,\n * it will add an Expand Node for the user to click (to expand to see this Activity!).\n * If this is a root node (starting entity node), then we automatically add the Activity Node\n * and process it.\n */\n const addEntity = useCallback(\n async (params: {\n entityHeader: EntityHeader\n usedInActivity?: Activity\n nodesCopy: Node[]\n edgesCopy: Edge[]\n }) => {\n const { entityHeader, nodesCopy, edgesCopy, usedInActivity } = params\n addEntityNode({\n entityHeader,\n activity: usedInActivity,\n nodesCopy,\n edgesCopy,\n })\n //look for Activity\n try {\n const activity = await SynapseClient.getActivityForEntity(\n entityHeader.id,\n entityHeader.versionNumber,\n accessToken,\n )\n // if this is not a root node (or there are too many items to show), add an expand node\n if (\n !isRootEntity({ entityHeader, rootEntityHeaders }) ||\n (activity.used && activity.used.length >= MAX_ACTIVITY_EXPAND_NODES)\n ) {\n addExpandNode({\n entityHeader,\n itemCount: activity.used?.length,\n nodesCopy,\n edgesCopy,\n })\n }\n } catch (e) {\n // Activity is not accessible\n console.error(e)\n if (\n isRootEntity({\n entityHeader,\n rootEntityHeaders,\n })\n ) {\n // add provenance undefined node\n addUndefinedNode({\n entityHeader,\n nodesCopy,\n edgesCopy,\n })\n }\n }\n },\n [accessToken, rootEntityHeaders],\n )\n\n /**\n * This effect attempts to center the graph on one of the root nodes.\n * Only initializes after after a root node has been added to the graph.\n */\n useEffect(() => {\n if (!initializedPosition && nodes.length > 0) {\n setTimeout(() => {\n if (rootEntityHeaders) {\n const rootEntityNode = findEntityNode(rootEntityHeaders[0], nodes)\n if (rootEntityNode) {\n const currentZoom = reactFlowInstance.getZoom()\n const zoom = currentZoom > DEFAULT_ZOOM ? DEFAULT_ZOOM : currentZoom\n reactFlowInstance?.setCenter(\n rootEntityNode.position.x + 150,\n rootEntityNode.position.y - 30,\n { zoom, duration: 0 },\n )\n }\n setInitializedPosition(true)\n }\n })\n }\n }, [initializedPosition, nodes, reactFlowInstance, rootEntityHeaders])\n\n /**\n * This is called when the user clicks on an Expand Node. It will add the associated Activity\n * and all \"used\" items (entities and urls) to the graph by adding items to the nodesCopy and edgesCopy arrays.\n */\n const onExpandEntity = useCallback(\n async (params: {\n entityHeader: EntityHeader\n nodesCopy: Node[]\n edgesCopy: Edge[]\n }) => {\n const { entityHeader, nodesCopy, edgesCopy } = params\n try {\n const activity = await SynapseClient.getActivityForEntity(\n entityHeader.id,\n entityHeader.versionNumber,\n accessToken,\n )\n addActivityNode({\n activity,\n entityHeader,\n nodesCopy,\n edgesCopy,\n })\n // go through Activity.used array to add these nodes/edges\n if (activity.used && activity.used.length < MAX_ACTIVITY_EXPAND_NODES) {\n const usedEntityReferences: ReferenceList = []\n activity.used.forEach((usedItem: Used) => {\n if (usedItem.concreteType == USED_ENTITY_CONCRETE_TYPE_VALUE) {\n usedEntityReferences.push((usedItem as UsedEntity).reference)\n } else {\n // UsedURL\n const usedURL = usedItem as UsedURL\n addExternalNode({ usedURL, activity, nodesCopy, edgesCopy })\n }\n })\n const usedEntityHeadersPage = await SynapseClient.getEntityHeaders(\n usedEntityReferences,\n accessToken,\n )\n const { results: usedEntityHeaderPageResults } = usedEntityHeadersPage\n // find refs that were not returned by the entity header call\n const refsMissingEntityHeaders = usedEntityReferences.filter(ref => {\n return (\n usedEntityHeaderPageResults.find(header => {\n return header.id == ref.targetId\n }) == undefined\n )\n })\n refsMissingEntityHeaders.forEach(ref => {\n addEntityPlaceholderNode({ ref, activity, nodesCopy, edgesCopy })\n })\n const addEntityPromises: Promise<void>[] = []\n usedEntityHeaderPageResults.forEach(header => {\n addEntityPromises.push(\n addEntity({\n entityHeader: header,\n nodesCopy,\n edgesCopy,\n usedInActivity: activity,\n }),\n )\n })\n await Promise.allSettled(addEntityPromises)\n }\n } catch (e) {\n // Activity is not accessible\n console.error(e)\n }\n },\n [accessToken, addEntity],\n )\n\n /**\n * This effect code executes when no nodes have been added.\n * It will add the root nodes, and attempt to expand the root nodes.\n */\n useEffect(() => {\n if (rootEntityHeaders && tempNodes.length == 0) {\n const nodesCopy = [...tempNodes]\n const edgesCopy = [...tempEdges]\n const addAndExpandPromises: Promise<void>[] = []\n rootEntityHeaders.forEach(header => {\n const addEntityPromise = addEntity({\n entityHeader: header,\n nodesCopy,\n edgesCopy,\n })\n addAndExpandPromises.push(addEntityPromise)\n\n const expandEntityPromise = onExpandEntity({\n entityHeader: header,\n nodesCopy,\n edgesCopy,\n })\n addAndExpandPromises.push(expandEntityPromise)\n })\n Promise.allSettled(addAndExpandPromises).finally(() => {\n setTempNodes(nodesCopy)\n setTempEdges(edgesCopy)\n })\n }\n }, [\n addEntity,\n handleError,\n onExpandEntity,\n rootEntityHeaders,\n rootEntityRefs,\n tempEdges,\n tempNodes,\n ])\n\n /**\n * This effect code executes when a node is clicked.\n * We check to see if it is an expand node. If it is, then we remove the expand node (and associated edge)\n * and ask for the Activity and associated \"used\" nodes (entities and URLs)\n */\n useEffect(() => {\n const nodeData: ProvenanceNodeData = clickedNode?.data as ProvenanceNodeData\n if (clickedNode && nodeData?.type == NodeType.EXPAND) {\n const expandNodeDataProps = nodeData.props as ExpandGraphNodeDataProps\n if (expandNodeDataProps.itemCount > MAX_ACTIVITY_EXPAND_NODES) {\n displayToast(\n 'Web visualization does not support expanding this many items at this time.',\n 'danger',\n )\n return\n } else {\n // graph will be used outside of synapse, so show a non-branded spinner\n nodeData.label = <CircularProgress size={30} />\n // remove clicked node\n const nodesWithoutExpandNode = tempNodes.filter(\n node => node.id != clickedNode.id,\n )\n const edgeToRemove = getConnectedEdges([clickedNode], tempEdges)[0]\n const edgesWithoutExpandEdge = tempEdges.filter(\n edge => edge != edgeToRemove,\n )\n onExpandEntity({\n entityHeader: expandNodeDataProps.entityHeader,\n nodesCopy: nodesWithoutExpandNode,\n edgesCopy: edgesWithoutExpandEdge,\n }).finally(() => {\n setTempNodes(nodesWithoutExpandNode)\n setTempEdges(edgesWithoutExpandEdge)\n })\n }\n setClickedNode(undefined)\n }\n }, [clickedNode, tempNodes, tempEdges, onExpandEntity])\n\n /**\n * This effect code is run when the graph nodes or edges change.\n * It feeds the nodes and edges into our layout library to figure out where they should be positioned.\n * The result is saved in the state variable \"nodes\" and \"edges\".\n */\n useEffect(() => {\n const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(\n tempNodes,\n tempEdges,\n 'TB',\n )\n // hack: ProvenanceUtils.getProvenanceNode() returns a new object every time, so check to see if\n // there were any real changes\n if (!isArrayEqual(layoutedNodes, nodes)) {\n setNodes(layoutedNodes)\n if (onNodesChangedListener) {\n onNodesChangedListener(layoutedNodes)\n }\n }\n if (!isArrayEqual(layoutedEdges, edges)) {\n setEdges(layoutedEdges)\n if (onEdgesChangedListener) {\n onEdgesChangedListener(layoutedEdges)\n }\n }\n }, [\n tempNodes,\n tempEdges,\n nodes,\n edges,\n setNodes,\n setEdges,\n initializedPosition,\n reactFlowInstance,\n rootEntityRefs,\n onNodesChangedListener,\n onEdgesChangedListener,\n ])\n\n const onPaneScrollFunction: (event?: WheelEvent) => void = useCallback(\n event => {\n // Cannot simply check the truthy value of event.deltaX (or Y) because the value might be 0 (or -0), which is falsy\n if (\n event &&\n typeof event.deltaX !== 'undefined' &&\n typeof event.deltaY !== 'undefined'\n ) {\n window.scrollTo(\n window.scrollX + event.deltaX,\n window.scrollY + event.deltaY,\n )\n }\n },\n [],\n )\n return (\n <div\n className=\"ProvenanceWidget\"\n role=\"graphics-doc\" //https://www.w3.org/wiki/SVG_Accessibility/ARIA_roles_for_charts#Document_Roles\n style={{ width: '100%', height: containerHeight }}\n >\n <ReactFlow\n defaultViewport={{ x: 0, y: 0, zoom: DEFAULT_ZOOM }}\n nodes={nodes}\n edges={edges}\n onNodeClick={onClickNode}\n // onNodesChange={onNodesChange} // SWC-6804: When the nodes/edges are updated (expanded) the graph is already re-rendered.\n // onEdgesChange={onEdgesChange} // Specifying these callbacks causes an infinite re-rendering loop.\n attributionPosition=\"bottom-right\"\n onConnect={undefined}\n zoomOnScroll={false}\n onPaneScroll={onPaneScrollFunction}\n >\n <Controls />\n </ReactFlow>\n </div>\n )\n}\n\nconst ProvenanceGraph = (props: ProvenanceProps): React.ReactNode => {\n return (\n <SynapseErrorBoundary>\n <ReactFlowProvider>\n <ProvenanceReactFlow {...props} />\n </ReactFlowProvider>\n </SynapseErrorBoundary>\n )\n}\n\nexport default ProvenanceGraph\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,IAAM,IAA4B,KAC5B,IAAe,KASf,KAAuB,MAA4C;CACvE,IAAM,EACJ,YAAY,GACZ,qBAAkB,SAClB,kBAAe,EAAE,EACjB,kBAAe,EAAE,EACjB,2BACA,8BACE,GACE,EAAE,mBAAgB,GAAmB,EACrC,CAAC,GAAW,KAAgB,EAAiB,EAAa,EAC1D,CAAC,GAAW,KAAgB,EAAiB,EAAa,EAC1D,CAAC,GAAO,KAAY,EAAc,EAAE,CAAC,EACrC,CAAC,GAAO,KAAY,EAAc,EAAE,CAAC,EACrC,CAAC,GAAa,KAAkB,GAAgB,EAChD,IAAc,GAAiB,EAE/B,EAAE,MAAM,GAAuB,iBAAc,EACjD,GACA,EAAE,cAAc,IAAM,CACvB;AACD,CACE,KACA,KACA,EAAsB,wBAAwB,KAG9C,EACE,wDAFiB,EAAe,KAAI,MAAO,EAAI,SAAS,CAAC,KAAK,IAAI,GAGnE;CAEH,IAAM,IAAoB,GAAuB,SAC3C,CAAC,GAAqB,KAA0B,EAAkB,GAAM,EAGxE,IAAoB,GAAc,EAElC,KAAc,GAAa,GAAoB,MAAe;AAClE,IAAe,EAAK;IACn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,EAChB,CAAA,EACC,CAAA"}
1
+ {"version":3,"file":"ProvenanceGraph.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceGraph.tsx"],"sourcesContent":["import SynapseClient from '@/synapse-client'\nimport { useGetEntityHeaders } from '@/synapse-queries'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { CircularProgress } from '@mui/material'\nimport {\n Activity,\n EntityHeader,\n ReferenceList,\n Used,\n USED_ENTITY_CONCRETE_TYPE_VALUE,\n UsedEntity,\n UsedURL,\n} from '@sage-bionetworks/synapse-types'\nimport { MouseEvent, useCallback, useEffect, useState, WheelEvent } from 'react'\nimport { useErrorHandler } from 'react-error-boundary'\nimport ReactFlow, {\n Controls,\n Edge,\n getConnectedEdges,\n Node,\n ReactFlowProvider,\n useEdgesState,\n useNodesState,\n useReactFlow,\n} from 'reactflow'\nimport { SynapseErrorBoundary } from '../error/ErrorBanner'\nimport { displayToast } from '../ToastMessage/ToastMessage'\nimport { ExpandGraphNodeDataProps } from './ExpandGraphNodeLabel'\nimport {\n addActivityNode,\n addEntityNode,\n addEntityPlaceholderNode,\n addExpandNode,\n addExternalNode,\n addUndefinedNode,\n findEntityNode,\n isRootEntity,\n} from './ProvenanceGraphUtils'\nimport {\n getLayoutedElements,\n isArrayEqual,\n NodeType,\n ProvenanceNodeData,\n} from './ProvenanceUtils'\nimport 'reactflow/dist/style.css'\n\nexport type ProvenanceProps = {\n // what entity nodes should we start with?\n entityRefs: ReferenceList\n containerHeight?: string\n initialNodes?: Node[]\n initialEdges?: Edge[]\n onNodesChangedListener?: (nodes: Node[]) => void\n onEdgesChangedListener?: (edges: Edge[]) => void\n}\n\nconst MAX_ACTIVITY_EXPAND_NODES = 400\nconst DEFAULT_ZOOM = 0.85\n\n/**\n * Renders a Provenance Graph for a set of entities.\n * New Nodes are added to tempNodes, and new Edges are added to tempEdges.\n * On change, these are fed into the dagre js graph library to figure out the node positions,\n * and the output stored in 'nodes' and 'edges'. The 'nodes' and 'edges' arrays are used by the\n * ReactFlow component.\n */\nconst ProvenanceReactFlow = (props: ProvenanceProps): React.ReactNode => {\n const {\n entityRefs: rootEntityRefs,\n containerHeight = '200px',\n initialNodes = [],\n initialEdges = [],\n onNodesChangedListener,\n onEdgesChangedListener,\n } = props\n const { accessToken } = useSynapseContext()\n const [tempNodes, setTempNodes] = useState<Node[]>(initialNodes)\n const [tempEdges, setTempEdges] = useState<Edge[]>(initialEdges)\n const [nodes, setNodes] = useNodesState([])\n const [edges, setEdges] = useEdgesState([])\n const [clickedNode, setClickedNode] = useState<Node>()\n const handleError = useErrorHandler()\n\n const { data: rootEntityHeadersPage, isSuccess } = useGetEntityHeaders(\n rootEntityRefs,\n { throwOnError: true },\n )\n if (\n isSuccess &&\n rootEntityHeadersPage &&\n rootEntityHeadersPage.totalNumberOfResults == 0\n ) {\n const synapseIds = rootEntityRefs.map(ref => ref.targetId).join(',')\n handleError(\n `Unable to load provenance for the given Synapse IDs: ${synapseIds}`,\n )\n }\n const rootEntityHeaders = rootEntityHeadersPage?.results\n const [initializedPosition, setInitializedPosition] = useState<boolean>(false)\n\n // Get the react flow instance so we attempt to properly center the view.\n const reactFlowInstance = useReactFlow()\n\n const onClickNode = useCallback((_event: MouseEvent, node: Node) => {\n setClickedNode(node)\n }, [])\n\n /**\n * Called when we have a new entity to add to the graph. This will result in adding\n * a new Entity Node to the nodesCopy, a link from the usedInActivity to the new Entity Node,\n * AND it will look for an Activity associated with the new entity. If an Activity is found,\n * it will add an Expand Node for the user to click (to expand to see this Activity!).\n * If this is a root node (starting entity node), then we automatically add the Activity Node\n * and process it.\n */\n const addEntity = useCallback(\n async (params: {\n entityHeader: EntityHeader\n usedInActivity?: Activity\n nodesCopy: Node[]\n edgesCopy: Edge[]\n }) => {\n const { entityHeader, nodesCopy, edgesCopy, usedInActivity } = params\n addEntityNode({\n entityHeader,\n activity: usedInActivity,\n nodesCopy,\n edgesCopy,\n })\n //look for Activity\n try {\n const activity = await SynapseClient.getActivityForEntity(\n entityHeader.id,\n entityHeader.versionNumber,\n accessToken,\n )\n // if this is not a root node (or there are too many items to show), add an expand node\n if (\n !isRootEntity({ entityHeader, rootEntityHeaders }) ||\n (activity.used && activity.used.length >= MAX_ACTIVITY_EXPAND_NODES)\n ) {\n addExpandNode({\n entityHeader,\n itemCount: activity.used?.length,\n nodesCopy,\n edgesCopy,\n })\n }\n } catch (e) {\n // Activity is not accessible\n console.error(e)\n if (\n isRootEntity({\n entityHeader,\n rootEntityHeaders,\n })\n ) {\n // add provenance undefined node\n addUndefinedNode({\n entityHeader,\n nodesCopy,\n edgesCopy,\n })\n }\n }\n },\n [accessToken, rootEntityHeaders],\n )\n\n /**\n * This effect attempts to center the graph on one of the root nodes.\n * Only initializes after after a root node has been added to the graph.\n */\n useEffect(() => {\n if (!initializedPosition && nodes.length > 0) {\n setTimeout(() => {\n if (rootEntityHeaders) {\n const rootEntityNode = findEntityNode(rootEntityHeaders[0], nodes)\n if (rootEntityNode) {\n const currentZoom = reactFlowInstance.getZoom()\n const zoom = currentZoom > DEFAULT_ZOOM ? DEFAULT_ZOOM : currentZoom\n reactFlowInstance?.setCenter(\n rootEntityNode.position.x + 150,\n rootEntityNode.position.y - 30,\n { zoom, duration: 0 },\n )\n }\n setInitializedPosition(true)\n }\n })\n }\n }, [initializedPosition, nodes, reactFlowInstance, rootEntityHeaders])\n\n /**\n * This is called when the user clicks on an Expand Node. It will add the associated Activity\n * and all \"used\" items (entities and urls) to the graph by adding items to the nodesCopy and edgesCopy arrays.\n */\n const onExpandEntity = useCallback(\n async (params: {\n entityHeader: EntityHeader\n nodesCopy: Node[]\n edgesCopy: Edge[]\n }) => {\n const { entityHeader, nodesCopy, edgesCopy } = params\n try {\n const activity = await SynapseClient.getActivityForEntity(\n entityHeader.id,\n entityHeader.versionNumber,\n accessToken,\n )\n addActivityNode({\n activity,\n entityHeader,\n nodesCopy,\n edgesCopy,\n })\n // go through Activity.used array to add these nodes/edges\n if (activity.used && activity.used.length < MAX_ACTIVITY_EXPAND_NODES) {\n const usedEntityReferences: ReferenceList = []\n activity.used.forEach((usedItem: Used) => {\n if (usedItem.concreteType == USED_ENTITY_CONCRETE_TYPE_VALUE) {\n usedEntityReferences.push((usedItem as UsedEntity).reference)\n } else {\n // UsedURL\n const usedURL = usedItem as UsedURL\n addExternalNode({ usedURL, activity, nodesCopy, edgesCopy })\n }\n })\n const usedEntityHeadersPage = await SynapseClient.getEntityHeaders(\n usedEntityReferences,\n accessToken,\n )\n const { results: usedEntityHeaderPageResults } = usedEntityHeadersPage\n // find refs that were not returned by the entity header call\n const refsMissingEntityHeaders = usedEntityReferences.filter(ref => {\n return (\n usedEntityHeaderPageResults.find(header => {\n return header.id == ref.targetId\n }) == undefined\n )\n })\n refsMissingEntityHeaders.forEach(ref => {\n addEntityPlaceholderNode({ ref, activity, nodesCopy, edgesCopy })\n })\n const addEntityPromises: Promise<void>[] = []\n usedEntityHeaderPageResults.forEach(header => {\n addEntityPromises.push(\n addEntity({\n entityHeader: header,\n nodesCopy,\n edgesCopy,\n usedInActivity: activity,\n }),\n )\n })\n await Promise.allSettled(addEntityPromises)\n }\n } catch (e) {\n // Activity is not accessible\n console.error(e)\n }\n },\n [accessToken, addEntity],\n )\n\n /**\n * This effect code executes when no nodes have been added.\n * It will add the root nodes, and attempt to expand the root nodes.\n */\n useEffect(() => {\n if (rootEntityHeaders && tempNodes.length == 0) {\n const nodesCopy = [...tempNodes]\n const edgesCopy = [...tempEdges]\n const addAndExpandPromises: Promise<void>[] = []\n rootEntityHeaders.forEach(header => {\n const addEntityPromise = addEntity({\n entityHeader: header,\n nodesCopy,\n edgesCopy,\n })\n addAndExpandPromises.push(addEntityPromise)\n\n const expandEntityPromise = onExpandEntity({\n entityHeader: header,\n nodesCopy,\n edgesCopy,\n })\n addAndExpandPromises.push(expandEntityPromise)\n })\n Promise.allSettled(addAndExpandPromises).finally(() => {\n setTempNodes(nodesCopy)\n setTempEdges(edgesCopy)\n })\n }\n }, [\n addEntity,\n handleError,\n onExpandEntity,\n rootEntityHeaders,\n rootEntityRefs,\n tempEdges,\n tempNodes,\n ])\n\n /**\n * This effect code executes when a node is clicked.\n * We check to see if it is an expand node. If it is, then we remove the expand node (and associated edge)\n * and ask for the Activity and associated \"used\" nodes (entities and URLs)\n */\n useEffect(() => {\n const nodeData: ProvenanceNodeData = clickedNode?.data as ProvenanceNodeData\n if (clickedNode && nodeData?.type == NodeType.EXPAND) {\n const expandNodeDataProps = nodeData.props as ExpandGraphNodeDataProps\n if (expandNodeDataProps.itemCount > MAX_ACTIVITY_EXPAND_NODES) {\n displayToast(\n 'Web visualization does not support expanding this many items at this time.',\n 'danger',\n )\n return\n } else {\n // graph will be used outside of synapse, so show a non-branded spinner\n nodeData.label = <CircularProgress size={30} />\n // remove clicked node\n const nodesWithoutExpandNode = tempNodes.filter(\n node => node.id != clickedNode.id,\n )\n const edgeToRemove = getConnectedEdges([clickedNode], tempEdges)[0]\n const edgesWithoutExpandEdge = tempEdges.filter(\n edge => edge != edgeToRemove,\n )\n onExpandEntity({\n entityHeader: expandNodeDataProps.entityHeader,\n nodesCopy: nodesWithoutExpandNode,\n edgesCopy: edgesWithoutExpandEdge,\n }).finally(() => {\n setTempNodes(nodesWithoutExpandNode)\n setTempEdges(edgesWithoutExpandEdge)\n })\n }\n setClickedNode(undefined)\n }\n }, [clickedNode, tempNodes, tempEdges, onExpandEntity])\n\n /**\n * This effect code is run when the graph nodes or edges change.\n * It feeds the nodes and edges into our layout library to figure out where they should be positioned.\n * The result is saved in the state variable \"nodes\" and \"edges\".\n */\n useEffect(() => {\n const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(\n tempNodes,\n tempEdges,\n 'TB',\n )\n // hack: ProvenanceUtils.getProvenanceNode() returns a new object every time, so check to see if\n // there were any real changes\n if (!isArrayEqual(layoutedNodes, nodes)) {\n setNodes(layoutedNodes)\n if (onNodesChangedListener) {\n onNodesChangedListener(layoutedNodes)\n }\n }\n if (!isArrayEqual(layoutedEdges, edges)) {\n setEdges(layoutedEdges)\n if (onEdgesChangedListener) {\n onEdgesChangedListener(layoutedEdges)\n }\n }\n }, [\n tempNodes,\n tempEdges,\n nodes,\n edges,\n setNodes,\n setEdges,\n initializedPosition,\n reactFlowInstance,\n rootEntityRefs,\n onNodesChangedListener,\n onEdgesChangedListener,\n ])\n\n const onPaneScrollFunction: (event?: WheelEvent) => void = useCallback(\n event => {\n // Cannot simply check the truthy value of event.deltaX (or Y) because the value might be 0 (or -0), which is falsy\n if (\n event &&\n typeof event.deltaX !== 'undefined' &&\n typeof event.deltaY !== 'undefined'\n ) {\n window.scrollTo(\n window.scrollX + event.deltaX,\n window.scrollY + event.deltaY,\n )\n }\n },\n [],\n )\n return (\n <div\n className=\"ProvenanceWidget\"\n role=\"graphics-doc\" //https://www.w3.org/wiki/SVG_Accessibility/ARIA_roles_for_charts#Document_Roles\n style={{ width: '100%', height: containerHeight }}\n >\n <ReactFlow\n defaultViewport={{ x: 0, y: 0, zoom: DEFAULT_ZOOM }}\n nodes={nodes}\n edges={edges}\n onNodeClick={onClickNode}\n // onNodesChange={onNodesChange} // SWC-6804: When the nodes/edges are updated (expanded) the graph is already re-rendered.\n // onEdgesChange={onEdgesChange} // Specifying these callbacks causes an infinite re-rendering loop.\n attributionPosition=\"bottom-right\"\n onConnect={undefined}\n zoomOnScroll={false}\n onPaneScroll={onPaneScrollFunction}\n >\n <Controls />\n </ReactFlow>\n </div>\n )\n}\n\nconst ProvenanceGraph = (props: ProvenanceProps): React.ReactNode => {\n return (\n <SynapseErrorBoundary>\n <ReactFlowProvider>\n <ProvenanceReactFlow {...props} />\n </ReactFlowProvider>\n </SynapseErrorBoundary>\n )\n}\n\nexport default ProvenanceGraph\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,IAAM,IAA4B,KAC5B,IAAe,KASf,KAAuB,MAA4C;CACvE,IAAM,EACJ,YAAY,GACZ,qBAAkB,SAClB,kBAAe,EAAE,EACjB,kBAAe,EAAE,EACjB,2BACA,8BAC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ACD,CAAC;CAEF,IAAM,KAAqD,GACzD,MAAS;AAEP,EACE,KACO,EAAM,WAAW,UACjB,EAAM,WAAW,UAExB,OAAO,SACL,OAAO,UAAU,EAAM,QACvB,OAAO,UAAU,EAAM,OACxB;IAGL,EAAE,CACH;AACD,QACE,kBAAC,OAAD;EACE,WAAU;EACV,MAAK;EACL,OAAO;GAAE,OAAO;GAAQ,QAAQ;GAAiB;YAEjD,kBAAC,GAAD;GACE,iBAAiB;IAAE,GAAG;IAAG,GAAG;IAAG,MAAM;IAAc;GAC5C;GACA;GACP,aAAa;GAGb,qBAAoB;GACpB,WAAW,KAAA;GACX,cAAc;GACd,cAAc;aAEd,kBAAC,GAAD,EAAY,CAAA;GACF,CAAA;EACR,CAAA;GAIJ,KAAmB,MAErB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAqB,GAAI,GAAS,CAAA,EAChB,CAAA,EACC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProvenanceGraphUtils.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceGraphUtils.ts"],"sourcesContent":["import { Edge, Node } from 'reactflow'\nimport { EntityHeader, Reference } from '@sage-bionetworks/synapse-types'\nimport { Activity, UsedURL } from '@sage-bionetworks/synapse-types'\nimport {\n getNodeId,\n getProvenanceEdge,\n getProvenanceNode,\n NodeType,\n ProvenanceNodeProps,\n} from './ProvenanceUtils'\n\n/**\n * Is one of the root Entities given by the user\n */\nexport const isRootEntity = (params: {\n entityHeader: EntityHeader\n rootEntityHeaders?: EntityHeader[]\n}) => {\n const { entityHeader, rootEntityHeaders } = params\n const foundNode = rootEntityHeaders?.find(header => {\n return (\n entityHeader.id == header.id &&\n entityHeader.versionNumber == header.versionNumber\n )\n })\n return foundNode !== undefined\n}\n\n/**\n * Given the node properties, will return true if this node is already in the nodesCopy array.\n */\nexport const isNodeNotFound = (\n nodeProps: ProvenanceNodeProps,\n nodesCopy: Node[],\n) => {\n const foundNode = nodesCopy.find(node => {\n return node.id === getNodeId(nodeProps)\n })\n return foundNode === undefined\n}\n\nexport const findEntityNode = (\n entityHeader: EntityHeader,\n nodesCopy: Node[],\n) => {\n const nodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n return nodesCopy.find(node => {\n return node.id === getNodeId(nodeProps)\n })\n}\n\n/**\n * Given the node properties, will return true if this edge is already in the edgesCopy array.\n */\nexport const isEdgeNotFound = (\n nodeProps1: ProvenanceNodeProps,\n nodeProps2: ProvenanceNodeProps,\n edgesCopy: Edge[],\n) => {\n const foundEdge = edgesCopy.find(edge => {\n return (\n edge.source === getNodeId(nodeProps1) &&\n edge.target === getNodeId(nodeProps2)\n )\n })\n return foundEdge === undefined\n}\n\n/**\n * Given node properties of the new node and existing node, this function creates and adds a new node to\n * nodesCopy, and creates an edge from the new node to the existing node. Note, this will only create\n * a new node or edge if these items are not found in the input nodesCopy array and edgesCopy array.\n */\nexport const addNodeAndEdge = (params: {\n newNodeProps: ProvenanceNodeProps\n existingNodeProps: ProvenanceNodeProps\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { newNodeProps, existingNodeProps, nodesCopy, edgesCopy } = params\n if (isNodeNotFound(newNodeProps, nodesCopy)) {\n nodesCopy.push(getProvenanceNode(newNodeProps))\n }\n if (isEdgeNotFound(newNodeProps, existingNodeProps, edgesCopy)) {\n edgesCopy.push(getProvenanceEdge(newNodeProps, existingNodeProps))\n }\n}\n\nexport const addActivityNode = (params: {\n activity: Activity\n entityHeader: EntityHeader\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { activity, entityHeader, nodesCopy, edgesCopy } = params\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n addNodeAndEdge({\n newNodeProps: activityNodeProps,\n existingNodeProps: entityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addExpandNode = (params: {\n entityHeader: EntityHeader\n itemCount: number | undefined\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { entityHeader, itemCount = 0, nodesCopy, edgesCopy } = params\n const expandNodeProps = {\n type: NodeType.EXPAND,\n data: {\n itemCount,\n entityHeader,\n },\n }\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n addNodeAndEdge({\n newNodeProps: expandNodeProps,\n existingNodeProps: entityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addEntityPlaceholderNode = (params: {\n ref: Reference\n activity: Activity\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { ref, activity, nodesCopy, edgesCopy } = params\n const entityPlaceholderNodeProps = {\n type: NodeType.ENTITY_PLACEHOLDER,\n data: ref,\n }\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n addNodeAndEdge({\n newNodeProps: entityPlaceholderNodeProps,\n existingNodeProps: activityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addUndefinedNode = (params: {\n entityHeader: EntityHeader\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { entityHeader, nodesCopy, edgesCopy } = params\n const undefinedNodeProps = {\n type: NodeType.UNDEFINED,\n data: entityHeader,\n }\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n addNodeAndEdge({\n newNodeProps: undefinedNodeProps,\n existingNodeProps: entityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addExternalNode = (params: {\n usedURL: UsedURL\n activity: Activity\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { usedURL, activity, nodesCopy, edgesCopy } = params\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n const externalNodeProps = {\n type: NodeType.EXTERNAL,\n data: usedURL,\n }\n addNodeAndEdge({\n newNodeProps: externalNodeProps,\n existingNodeProps: activityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addEntityNode = (params: {\n entityHeader: EntityHeader\n activity: Activity | undefined\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { entityHeader, activity, nodesCopy, edgesCopy } = params\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n if (isNodeNotFound(entityNodeProps, nodesCopy)) {\n // add the new entity node\n nodesCopy.push(getProvenanceNode(entityNodeProps))\n if (activity) {\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n edgesCopy.push(getProvenanceEdge(entityNodeProps, activityNodeProps))\n }\n }\n}\n"],"mappings":";;AAcA,IAAa,KAAgB,MAGvB;CACJ,IAAM,EAAE,iBAAc,yBAAsB;AAO5C,QANkB,GAAmB,MAAK,MAEtC,EAAa,MAAM,EAAO,MAC1B,EAAa,iBAAiB,EAAO,cAEvC,KACmB,KAAA;GAMV,KACX,GACA,MAEkB,EAAU,MAAK,MACxB,EAAK,OAAO,EAAU,EAAU,CACvC,KACmB,KAAA,GAGV,KACX,GACA,MACG;CACH,IAAM,IAAY;EAChB,MAAM,EAAS;EACf,MAAM;EACP;AACD,QAAO,EAAU,MAAK,MACb,EAAK,OAAO,EAAU,EAAU,CACvC;GAMS,KACX,GACA,GACA,MAEkB,EAAU,MAAK,MAE7B,EAAK,WAAW,EAAU,EAAW,IACrC,EAAK,WAAW,EAAU,EAAW,CAEvC,KACmB,KAAA,GAQV,KAAkB,MAKzB;CACJ,IAAM,EAAE,iBAAc,sBAAmB,cAAW,iBAAc;AAIlE,CAHI,EAAe,GAAc,EAAU,IACzC,EAAU,KAAK,EAAkB,EAAa,CAAC,EAE7C,EAAe,GAAc,GAAmB,EAAU,IAC5D,EAAU,KAAK,EAAkB,GAAc,EAAkB,CAAC;GAIzD,KAAmB,MAK1B;CACJ,IAAM,EAAE,aAAU,iBAAc,cAAW,iBAAc;AASzD,GAAe;EACb,cATwB;GACxB,MAAM,EAAS;GACf,MAAM;GACP;EAOC,mBANsB;GACtB,MAAM,EAAS;GACf,MAAM;GACP;EAIC;EACA;EACD,CAAC;GAGS,KAAiB,MAKxB;CACJ,IAAM,EAAE,iBAAc,eAAY,GAAG,cAAW,iBAAc;AAY9D,GAAe;EACb,cAZsB;GACtB,MAAM,EAAS;GACf,MAAM;IACJ;IACA;IACD;GACF;EAOC,mBANsB;GACtB,MAAM,EAAS;GACf,MAAM;GACP;EAIC;EACA;EACD,CAAC;GAGS,KAA4B,MAKnC;CACJ,IAAM,EAAE,QAAK,aAAU,cAAW,iBAAc;AAShD,GAAe;EACb,cATiC;GACjC,MAAM,EAAS;GACf,MAAM;GACP;EAOC,mBANwB;GACxB,MAAM,EAAS;GACf,MAAM;GACP;EAIC;EACA;EACD,CAAC;GAGS,KAAoB,MAI3B;CACJ,IAAM,EAAE,iBAAc,cAAW,iBAAc;AAS/C,GAAe;EACb,cATyB;GACzB,MAAM,EAAS;GACf,MAAM;GACP;EAOC,mBANsB;GACtB,MAAM,EAAS;GACf,MAAM;GACP;EAIC;EACA;EACD,CAAC;GAGS,KAAmB,MAK1B;CACJ,IAAM,EAAE,YAAS,aAAU,cAAW,iBAAc,GAC9C,IAAoB;EACxB,MAAM,EAAS;EACf,MAAM;EACP;AAKD,GAAe;EACb,cALwB;GACxB,MAAM,EAAS;GACf,MAAM;GACP;EAGC,mBAAmB;EACnB;EACA;EACD,CAAC;GAGS,KAAiB,MAKxB;CACJ,IAAM,EAAE,iBAAc,aAAU,cAAW,iBAAc,GACnD,IAAkB;EACtB,MAAM,EAAS;EACf,MAAM;EACP;AACD,KAAI,EAAe,GAAiB,EAAU,KAE5C,EAAU,KAAK,EAAkB,EAAgB,CAAC,EAC9C,IAAU;EACZ,IAAM,IAAoB;GACxB,MAAM,EAAS;GACf,MAAM;GACP;AACD,IAAU,KAAK,EAAkB,GAAiB,EAAkB,CAAC"}
1
+ {"version":3,"file":"ProvenanceGraphUtils.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceGraphUtils.ts"],"sourcesContent":["import { Edge, Node } from 'reactflow'\nimport { EntityHeader, Reference } from '@sage-bionetworks/synapse-types'\nimport { Activity, UsedURL } from '@sage-bionetworks/synapse-types'\nimport {\n getNodeId,\n getProvenanceEdge,\n getProvenanceNode,\n NodeType,\n ProvenanceNodeProps,\n} from './ProvenanceUtils'\n\n/**\n * Is one of the root Entities given by the user\n */\nexport const isRootEntity = (params: {\n entityHeader: EntityHeader\n rootEntityHeaders?: EntityHeader[]\n}) => {\n const { entityHeader, rootEntityHeaders } = params\n const foundNode = rootEntityHeaders?.find(header => {\n return (\n entityHeader.id == header.id &&\n entityHeader.versionNumber == header.versionNumber\n )\n })\n return foundNode !== undefined\n}\n\n/**\n * Given the node properties, will return true if this node is already in the nodesCopy array.\n */\nexport const isNodeNotFound = (\n nodeProps: ProvenanceNodeProps,\n nodesCopy: Node[],\n) => {\n const foundNode = nodesCopy.find(node => {\n return node.id === getNodeId(nodeProps)\n })\n return foundNode === undefined\n}\n\nexport const findEntityNode = (\n entityHeader: EntityHeader,\n nodesCopy: Node[],\n) => {\n const nodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n return nodesCopy.find(node => {\n return node.id === getNodeId(nodeProps)\n })\n}\n\n/**\n * Given the node properties, will return true if this edge is already in the edgesCopy array.\n */\nexport const isEdgeNotFound = (\n nodeProps1: ProvenanceNodeProps,\n nodeProps2: ProvenanceNodeProps,\n edgesCopy: Edge[],\n) => {\n const foundEdge = edgesCopy.find(edge => {\n return (\n edge.source === getNodeId(nodeProps1) &&\n edge.target === getNodeId(nodeProps2)\n )\n })\n return foundEdge === undefined\n}\n\n/**\n * Given node properties of the new node and existing node, this function creates and adds a new node to\n * nodesCopy, and creates an edge from the new node to the existing node. Note, this will only create\n * a new node or edge if these items are not found in the input nodesCopy array and edgesCopy array.\n */\nexport const addNodeAndEdge = (params: {\n newNodeProps: ProvenanceNodeProps\n existingNodeProps: ProvenanceNodeProps\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { newNodeProps, existingNodeProps, nodesCopy, edgesCopy } = params\n if (isNodeNotFound(newNodeProps, nodesCopy)) {\n nodesCopy.push(getProvenanceNode(newNodeProps))\n }\n if (isEdgeNotFound(newNodeProps, existingNodeProps, edgesCopy)) {\n edgesCopy.push(getProvenanceEdge(newNodeProps, existingNodeProps))\n }\n}\n\nexport const addActivityNode = (params: {\n activity: Activity\n entityHeader: EntityHeader\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { activity, entityHeader, nodesCopy, edgesCopy } = params\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n addNodeAndEdge({\n newNodeProps: activityNodeProps,\n existingNodeProps: entityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addExpandNode = (params: {\n entityHeader: EntityHeader\n itemCount: number | undefined\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { entityHeader, itemCount = 0, nodesCopy, edgesCopy } = params\n const expandNodeProps = {\n type: NodeType.EXPAND,\n data: {\n itemCount,\n entityHeader,\n },\n }\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n addNodeAndEdge({\n newNodeProps: expandNodeProps,\n existingNodeProps: entityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addEntityPlaceholderNode = (params: {\n ref: Reference\n activity: Activity\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { ref, activity, nodesCopy, edgesCopy } = params\n const entityPlaceholderNodeProps = {\n type: NodeType.ENTITY_PLACEHOLDER,\n data: ref,\n }\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n addNodeAndEdge({\n newNodeProps: entityPlaceholderNodeProps,\n existingNodeProps: activityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addUndefinedNode = (params: {\n entityHeader: EntityHeader\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { entityHeader, nodesCopy, edgesCopy } = params\n const undefinedNodeProps = {\n type: NodeType.UNDEFINED,\n data: entityHeader,\n }\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n addNodeAndEdge({\n newNodeProps: undefinedNodeProps,\n existingNodeProps: entityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addExternalNode = (params: {\n usedURL: UsedURL\n activity: Activity\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { usedURL, activity, nodesCopy, edgesCopy } = params\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n const externalNodeProps = {\n type: NodeType.EXTERNAL,\n data: usedURL,\n }\n addNodeAndEdge({\n newNodeProps: externalNodeProps,\n existingNodeProps: activityNodeProps,\n nodesCopy,\n edgesCopy,\n })\n}\n\nexport const addEntityNode = (params: {\n entityHeader: EntityHeader\n activity: Activity | undefined\n nodesCopy: Node[]\n edgesCopy: Edge[]\n}) => {\n const { entityHeader, activity, nodesCopy, edgesCopy } = params\n const entityNodeProps = {\n type: NodeType.ENTITY,\n data: entityHeader,\n }\n if (isNodeNotFound(entityNodeProps, nodesCopy)) {\n // add the new entity node\n nodesCopy.push(getProvenanceNode(entityNodeProps))\n if (activity) {\n const activityNodeProps = {\n type: NodeType.ACTIVITY,\n data: activity,\n }\n edgesCopy.push(getProvenanceEdge(entityNodeProps, activityNodeProps))\n }\n }\n}\n"],"mappings":";;AAcA,IAAa,KAAgB,MAGvB;CACJ,IAAM,EAAE,iBAAc,yBAAsB;AAO5C,QANkB,GAAmB,MAAK,MAEtC,EAAa,MAAM,EAAO,MAC1B,EAAa,iBAAiB,EAAO,cAEvC,KACmB,KAAA;GAMV,KACX,GACA,MAEkB,EAAU,MAAK,MACxB,EAAK,OAAO,EAAU,EAAU,CAElC,KAAc,KAAA,GAGV,KACX,GACA,MACG;CACH,IAAM,IAAY;EAChB,MAAM,EAAS;EACf,MAAM;EACP;AACD,QAA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Ac,GAC9C,IAAoB;EACxB,MAAM,EAAS;EACf,MAAM;EACP;AAKD,GAAe;EACb,cAAc;GAJd,MAAM,EAAS;GACf,MAAM;GAGQ;EACd,mBAAmB;EACnB;EACA;EACD,CAAC;GAGS,KAAiB,MAKxB;CACJ,IAAM,EAAE,iBAAc,aAAU,cAAW,iBAAc,GACnD,IAAkB;EACtB,MAAM,EAAS;EACf,MAAM;EACP;AACD,KAAI,EAAe,GAAiB,EAAU,KAE5C,EAAU,KAAK,EAAkB,EAAgB,CAAC,EAC9C,IAAU;EACZ,IAAM,IAAoB;GACxB,MAAM,EAAS;GACf,MAAM;GACP;AACD,IAAU,KAAK,EAAkB,GAAiB,EAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProvenanceUtils.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceUtils.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { Node, Position, ConnectionLineType, Edge, MarkerType } from 'reactflow'\nimport { ActivityNodeLabel } from './ActivityNodeLabel'\nimport { EntityNodeLabel } from './EntityNodeLabel'\nimport {\n ExpandGraphNodeDataProps,\n ExpandGraphNodeLabel,\n} from './ExpandGraphNodeLabel'\nimport { ExternalGraphNodeLabel } from './ExternalGraphNodeLabel'\nimport dagre from 'dagre'\nimport { differenceWith, isEqual } from 'lodash-es'\nimport { UndefinedNodeLabel } from './UndefinedNodeLabel'\nimport { EntityHeader, Reference } from '@sage-bionetworks/synapse-types'\nimport { Activity, UsedURL } from '@sage-bionetworks/synapse-types'\nimport { EntityPlaceholderNodeLabel } from './EntityPlaceholderNodeLabel'\n\nexport enum NodeType {\n ENTITY = 'EntityNode',\n ENTITY_PLACEHOLDER = 'EntityPlaceholderNode',\n EXTERNAL = 'ExternalNode',\n ACTIVITY = 'ActivityNode',\n EXPAND = 'ExpandNode',\n UNDEFINED = 'UndefinedNode',\n}\n\ntype ProvenanceNodeLabelProps =\n | UsedURL\n | Activity\n | ExpandGraphNodeDataProps\n | EntityHeader\n | Reference\n\nexport type ProvenanceNodeProps = {\n type: NodeType\n data: ProvenanceNodeLabelProps\n}\n\nexport type ProvenanceNodeData = {\n label: ReactNode\n props: ProvenanceNodeLabelProps\n type: NodeType\n}\n\nexport const getProvenanceNode = (props: ProvenanceNodeProps): Node => {\n const { type, data } = props\n let nodeLabel: ReactNode\n switch (type) {\n case NodeType.ENTITY:\n nodeLabel = <EntityNodeLabel {...(data as EntityHeader)} />\n break\n case NodeType.ENTITY_PLACEHOLDER:\n nodeLabel = <EntityPlaceholderNodeLabel {...(data as Reference)} />\n break\n case NodeType.EXTERNAL:\n nodeLabel = <ExternalGraphNodeLabel {...(data as UsedURL)} />\n break\n case NodeType.ACTIVITY:\n nodeLabel = <ActivityNodeLabel {...(data as Activity)} />\n break\n case NodeType.EXPAND:\n nodeLabel = (\n <ExpandGraphNodeLabel {...(data as ExpandGraphNodeDataProps)} />\n )\n break\n case NodeType.UNDEFINED:\n nodeLabel = <UndefinedNodeLabel />\n break\n default:\n nodeLabel = <p>Unrecognized node type: {type}</p>\n break\n }\n const nodeData: ProvenanceNodeData = {\n label: nodeLabel,\n props: data,\n type: type,\n }\n return {\n id: getNodeId(props),\n position: { x: 100, y: 100 }, // hard coded, let graph layout library figure this out\n data: nodeData,\n connectable: false,\n draggable: false,\n // selectable: false, // like to make unselectable, but node contents become non-interactive\n className: `${type}`,\n }\n}\n\nexport const getProvenanceEdge = (\n node1Props: ProvenanceNodeProps,\n node2Props: ProvenanceNodeProps,\n): Edge => {\n const node1Id = getNodeId(node1Props)\n const node2Id = getNodeId(node2Props)\n return {\n id: `${node1Id}-${node2Id}`,\n source: node1Id,\n target: node2Id,\n animated: true,\n type: ConnectionLineType.SimpleBezier,\n markerEnd: {\n type: MarkerType.ArrowClosed,\n },\n }\n}\n\nexport const getNodeId = (props: ProvenanceNodeProps) => {\n const { type, data } = props\n switch (type) {\n case NodeType.ENTITY:\n return `${(data as EntityHeader).id}.${\n (data as EntityHeader).versionNumber ?? 'latest'\n }`\n case NodeType.ENTITY_PLACEHOLDER:\n return `${(data as Reference).targetId}.${\n (data as Reference).targetVersionNumber ?? 'latest'\n }`\n case NodeType.EXTERNAL:\n return `${(data as UsedURL).url}`\n case NodeType.ACTIVITY:\n return `${(data as Activity).id}`\n case NodeType.EXPAND:\n return `expand.node.${\n (data as ExpandGraphNodeDataProps).entityHeader.id\n }.${\n (data as ExpandGraphNodeDataProps).entityHeader.versionNumber ??\n 'latest'\n }`\n case NodeType.UNDEFINED:\n return `undefined.dummy.node.${(data as EntityHeader).id}.${\n (data as EntityHeader).versionNumber ?? 'latest'\n }`\n }\n}\n\n// layout\nconst dagreGraph = new dagre.graphlib.Graph()\ndagreGraph.setDefaultEdgeLabel(() => ({}))\n\nconst getNodeHeight = (node: Node) => {\n const nodeData: ProvenanceNodeData = node.data as ProvenanceNodeData\n return nodeData.type == NodeType.EXPAND ? 30 : 100\n}\nconst getNodeWidth = (node: Node) => {\n const nodeData: ProvenanceNodeData = node.data as ProvenanceNodeData\n return nodeData.type == NodeType.EXPAND ? 30 : 172\n}\n\nexport const getLayoutedElements = (\n nodes: Node[],\n edges: Edge[],\n direction: string,\n) => {\n const isHorizontal = direction === 'LR'\n dagreGraph.setGraph({ rankdir: direction })\n\n nodes.forEach(node => {\n dagreGraph.setNode(node.id, {\n width: getNodeWidth(node),\n height: getNodeHeight(node),\n })\n })\n\n edges.forEach(edge => {\n dagreGraph.setEdge(edge.source, edge.target)\n })\n\n dagre.layout(dagreGraph)\n\n nodes.forEach(node => {\n const nodeWithPosition = dagreGraph.node(node.id)\n node.targetPosition = isHorizontal ? Position.Left : Position.Top\n node.sourcePosition = isHorizontal ? Position.Right : Position.Bottom\n\n // We are shifting the dagre node position (anchor=center center) to the top left\n // so it matches the React Flow node anchor point (top left).\n node.position = {\n x: nodeWithPosition.x - getNodeWidth(node) / 2,\n y: nodeWithPosition.y - getNodeHeight(node) / 2,\n }\n\n return node\n })\n\n return { nodes, edges }\n}\n\nexport const isArrayEq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;GAC/C,EAEM;GACP,EAEK;EAAE;EAAO;EAAO;GAGZ,KAAgB,GAAU,MAC9B,EAAe,GAAG,GAAG,EAAQ,CAAC,UAAU"}
1
+ {"version":3,"file":"ProvenanceUtils.js","names":[],"sources":["../../../src/components/ProvenanceGraph/ProvenanceUtils.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { Node, Position, ConnectionLineType, Edge, MarkerType } from 'reactflow'\nimport { ActivityNodeLabel } from './ActivityNodeLabel'\nimport { EntityNodeLabel } from './EntityNodeLabel'\nimport {\n ExpandGraphNodeDataProps,\n ExpandGraphNodeLabel,\n} from './ExpandGraphNodeLabel'\nimport { ExternalGraphNodeLabel } from './ExternalGraphNodeLabel'\nimport dagre from 'dagre'\nimport { differenceWith, isEqual } from 'lodash-es'\nimport { UndefinedNodeLabel } from './UndefinedNodeLabel'\nimport { EntityHeader, Reference } from '@sage-bionetworks/synapse-types'\nimport { Activity, UsedURL } from '@sage-bionetworks/synapse-types'\nimport { EntityPlaceholderNodeLabel } from './EntityPlaceholderNodeLabel'\n\nexport enum NodeType {\n ENTITY = 'EntityNode',\n ENTITY_PLACEHOLDER = 'EntityPlaceholderNode',\n EXTERNAL = 'ExternalNode',\n ACTIVITY = 'ActivityNode',\n EXPAND = 'ExpandNode',\n UNDEFINED = 'UndefinedNode',\n}\n\ntype ProvenanceNodeLabelProps =\n | UsedURL\n | Activity\n | ExpandGraphNodeDataProps\n | EntityHeader\n | Reference\n\nexport type ProvenanceNodeProps = {\n type: NodeType\n data: ProvenanceNodeLabelProps\n}\n\nexport type ProvenanceNodeData = {\n label: ReactNode\n props: ProvenanceNodeLabelProps\n type: NodeType\n}\n\nexport const getProvenanceNode = (props: ProvenanceNodeProps): Node => {\n const { type, data } = props\n let nodeLabel: ReactNode\n switch (type) {\n case NodeType.ENTITY:\n nodeLabel = <EntityNodeLabel {...(data as EntityHeader)} />\n break\n case NodeType.ENTITY_PLACEHOLDER:\n nodeLabel = <EntityPlaceholderNodeLabel {...(data as Reference)} />\n break\n case NodeType.EXTERNAL:\n nodeLabel = <ExternalGraphNodeLabel {...(data as UsedURL)} />\n break\n case NodeType.ACTIVITY:\n nodeLabel = <ActivityNodeLabel {...(data as Activity)} />\n break\n case NodeType.EXPAND:\n nodeLabel = (\n <ExpandGraphNodeLabel {...(data as ExpandGraphNodeDataProps)} />\n )\n break\n case NodeType.UNDEFINED:\n nodeLabel = <UndefinedNodeLabel />\n break\n default:\n nodeLabel = <p>Unrecognized node type: {type}</p>\n break\n }\n const nodeData: ProvenanceNodeData = {\n label: nodeLabel,\n props: data,\n type: type,\n }\n return {\n id: getNodeId(props),\n position: { x: 100, y: 100 }, // hard coded, let graph layout library figure this out\n data: nodeData,\n connectable: false,\n draggable: false,\n // selectable: false, // like to make unselectable, but node contents become non-interactive\n className: `${type}`,\n }\n}\n\nexport const getProvenanceEdge = (\n node1Props: ProvenanceNodeProps,\n node2Props: ProvenanceNodeProps,\n): Edge => {\n const node1Id = getNodeId(node1Props)\n const node2Id = getNodeId(node2Props)\n return {\n id: `${node1Id}-${node2Id}`,\n source: node1Id,\n target: node2Id,\n animated: true,\n type: ConnectionLineType.SimpleBezier,\n markerEnd: {\n type: MarkerType.ArrowClosed,\n },\n }\n}\n\nexport const getNodeId = (props: ProvenanceNodeProps) => {\n const { type, data } = props\n switch (type) {\n case NodeType.ENTITY:\n return `${(data as EntityHeader).id}.${\n (data as EntityHeader).versionNumber ?? 'latest'\n }`\n case NodeType.ENTITY_PLACEHOLDER:\n return `${(data as Reference).targetId}.${\n (data as Reference).targetVersionNumber ?? 'latest'\n }`\n case NodeType.EXTERNAL:\n return `${(data as UsedURL).url}`\n case NodeType.ACTIVITY:\n return `${(data as Activity).id}`\n case NodeType.EXPAND:\n return `expand.node.${\n (data as ExpandGraphNodeDataProps).entityHeader.id\n }.${\n (data as ExpandGraphNodeDataProps).entityHeader.versionNumber ??\n 'latest'\n }`\n case NodeType.UNDEFINED:\n return `undefined.dummy.node.${(data as EntityHeader).id}.${\n (data as EntityHeader).versionNumber ?? 'latest'\n }`\n }\n}\n\n// layout\nconst dagreGraph = new dagre.graphlib.Graph()\ndagreGraph.setDefaultEdgeLabel(() => ({}))\n\nconst getNodeHeight = (node: Node) => {\n const nodeData: ProvenanceNodeData = node.data as ProvenanceNodeData\n return nodeData.type == NodeType.EXPAND ? 30 : 100\n}\nconst getNodeWidth = (node: Node) => {\n const nodeData: ProvenanceNodeData = node.data as ProvenanceNodeData\n return nodeData.type == NodeType.EXPAND ? 30 : 172\n}\n\nexport const getLayoutedElements = (\n nodes: Node[],\n edges: Edge[],\n direction: string,\n) => {\n const isHorizontal = direction === 'LR'\n dagreGraph.setGraph({ rankdir: direction })\n\n nodes.forEach(node => {\n dagreGraph.setNode(node.id, {\n width: getNodeWidth(node),\n height: getNodeHeight(node),\n })\n })\n\n edges.forEach(edge => {\n dagreGraph.setEdge(edge.source, edge.target)\n })\n\n dagre.layout(dagreGraph)\n\n nodes.forEach(node => {\n const nodeWithPosition = dagreGraph.node(node.id)\n node.targetPosition = isHorizontal ? Position.Left : Position.Top\n node.sourcePosition = isHorizontal ? Position.Right : Position.Bottom\n\n // We are shifting the dagre node position (anchor=center center) to the top left\n // so it matches the React Flow node anchor point (top left).\n node.position = {\n x: nodeWithPosition.x - getNodeWidth(node) / 2,\n y: nodeWithPosition.y - getNodeHeight(node) / 2,\n }\n\n return node\n })\n\n return { nodes, edges }\n}\n\nexport const isArrayEqual = (x: any[], y: any[]) => {\n return differenceWith(x, y, isEqual).length == 0\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,SAAS,cACT,EAAA,qBAAqB,yBACrB,EAAA,WAAW,gBACX,EAAA,WAAW,gBACX,EAAA,SAAS,cACT,EAAA,YAAY;KACb,EAoBY,KAAqB,MAAqC;CACrE,IAAM,EAAE,SAAM,YAAS,GACnB;AACJ,SAAQ,GAAR;EACE,KAAK,EAAS;AACZ,OAAY,kBAAC,GAAD,EAAi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kC,aAAa,iBAChD;EAEJ,KAAK,EAAS,UACZ,QAAO,wBAAyB,EAAsB,GAAG,GACtD,EAAsB,iBAAiB;;GAM1C,IAAa,IAAI,EAAM,SAAS,OAAO;AAC7C,EAAW,2BAA2B,EAAE,EAAE;AAE1C,IAAM,KAAiB,MACgB,EAAK,KAC1B,QAAQ,EAAS,SAAS,KAAK,KAE3C,KAAgB,MACiB,EAAK,KAC1B,QAAQ,EAAS,SAAS,KAAK,KAGpC,KACX,GACA,GACA,MACG;CACH,IAAM,IAAe,MAAc;AA+BnC,QA9BA,EAAW,SAAS,EAAE,SAAS,GAAW,CAAC,EAE3C,EAAM,SAAQ,MAAQ;AACpB,IAAW,QAAQ,EAAK,IAAI;GAC1B,OAAO,EAAa,EAAK;GACzB,QAAQ,EAAc,EAAK;GAC5B,CAAC;GACF,EAEF,EAAM,SAAQ,MAAQ;AACpB,IAAW,QAAQ,EAAK,QAAQ,EAAK,OAAO;GAC5C,EAEF,EAAM,OAAO,EAAW,EAExB,EAAM,SAAQ,MAAQ;EACpB,IAAM,IAAmB,EAAW,KAAK,EAAK,GAAG;AAWjD,SAVA,EAAK,iBAAiB,IAAe,EAAS,OAAO,EAAS,KAC9D,EAAK,iBAAiB,IAAe,EAAS,QAAQ,EAAS,QAI/D,EAAK,WAAW;GACd,GAAG,EAAiB,IAAI,EAAa,EAAK,GAAG;GAC7C,GAAG,EAAiB,IAAI,EAAc,EAAK,GAAG;GAC/C,EAEM;GACP,EAEK;EAAE;EAAO;EAAO;GAGZ,KAAgB,GAAU,MAC9B,EAAe,GAAG,GAAG,EAAQ,CAAC,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryCount.js","names":[],"sources":["../../../src/components/QueryCount/QueryCount.tsx"],"sourcesContent":["import useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { SynapseConstants } from '@/utils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport { Query, QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport React from 'react'\n\nexport type QueryCountProps = {\n query: Query\n parens?: boolean\n}\n\n/**\n * Shows the total count of results for a table query.\n */\nexport function QueryCount(props: QueryCountProps): React.ReactNode {\n const { query, parens } = props\n const entityId = parseEntityIdFromSqlStatement(query.sql)\n\n const request: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n query: query,\n entityId,\n partMask: SynapseConstants.BUNDLE_MASK_QUERY_COUNT,\n }\n\n const { data: queryResult } = useGetQueryResultBundle(request)\n\n const localCount = queryResult?.queryCount?.toLocaleString()\n /* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Using_toLocaleString */\n return <>{localCount && (parens ? `(${localCount})` : localCount)}</>\n}\nexport default QueryCount\n"],"mappings":";;;;;;;AAcA,SAAgB,EAAW,GAAyC;CAClE,IAAM,EAAE,UAAO,cAAW,GAUpB,EAAE,MAAM,MAAgB,EAPM;EAClC,cAAc;EACP;EACP,UALe,EAA8B,EAAM,IAAI;EAMvD,UAAU;EACX,CAE6D,EAExD,IAAa,GAAa,YAAY,gBAAgB;AAE5D,QAAO,kBAAA,GAAA,EAAA,UAAG,MAAe,IAAS,IAAI,EAAW,KAAK,IAAe,CAAA"}
1
+ {"version":3,"file":"QueryCount.js","names":[],"sources":["../../../src/components/QueryCount/QueryCount.tsx"],"sourcesContent":["import useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { SynapseConstants } from '@/utils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport { Query, QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport React from 'react'\n\nexport type QueryCountProps = {\n query: Query\n parens?: boolean\n}\n\n/**\n * Shows the total count of results for a table query.\n */\nexport function QueryCount(props: QueryCountProps): React.ReactNode {\n const { query, parens } = props\n const entityId = parseEntityIdFromSqlStatement(query.sql)\n\n const request: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n query: query,\n entityId,\n partMask: SynapseConstants.BUNDLE_MASK_QUERY_COUNT,\n }\n\n const { data: queryResult } = useGetQueryResultBundle(request)\n\n const localCount = queryResult?.queryCount?.toLocaleString()\n /* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Using_toLocaleString */\n return <>{localCount && (parens ? `(${localCount})` : localCount)}</>\n}\nexport default QueryCount\n"],"mappings":";;;;;;;AAcA,SAAgB,EAAW,GAAyC;CAClE,IAAM,EAAE,UAAO,cAAW,GAUpB,EAAE,MAAM,MAAgB,EAAwB;EANpD,cAAc;EACP;EACP,UALe,EAA8B,EAAM,IAKnD;EACA,UAAU;EAG0C,CAAQ,EAExD,IAAa,GAAa,YAAY,gBAAgB;AAE5D,QAAO,kBAAA,GAAA,EAAA,UAAG,MAAe,IAAS,IAAI,EAAW,KAAK,IAAe,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryCountButton.js","names":[],"sources":["../../../src/components/QueryCountButton/QueryCountButton.tsx"],"sourcesContent":["import useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { BUNDLE_MASK_QUERY_COUNT } from '@/utils/SynapseConstants'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport { QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport { Box, Button, ButtonProps } from '@mui/material'\nimport { NavigateNext } from '@mui/icons-material'\nimport React from 'react'\nimport { Link as RouterLink, useInRouterContext } from 'react-router'\n\nexport type QueryCountButtonProps = {\n /**\n * The SQL query to execute to get the count\n */\n sql: string\n /**\n * The target URL when the button is clicked\n */\n href: string\n /**\n * Text to display before the count (e.g., \"Explore\")\n */\n prefixText?: string\n /**\n * Text to display after the count (e.g., \"files\")\n */\n suffixText?: string\n /**\n * Additional MUI Button props\n */\n} & Omit<ButtonProps, 'children'>\n\n/**\n * A button component that displays text with an inline count.\n * The count is fetched by executing a SQL query against a Synapse table.\n * Example: \"Explore 42 files\"\n */\nexport function QueryCountButton(props: QueryCountButtonProps) {\n const { sql, href, prefixText = '', suffixText = '', ...buttonProps } = props\n const entityId = parseEntityIdFromSqlStatement(sql)\n const inRouterContext = useInRouterContext()\n\n const request: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n query: { sql },\n entityId,\n partMask: BUNDLE_MASK_QUERY_COUNT,\n }\n\n const { data: queryResult, isLoading } = useGetQueryResultBundle(request)\n\n const count = queryResult?.queryCount\n\n const isExternalLink =\n href?.startsWith('http://') || href?.startsWith('https://')\n\n // Determine the appropriate link props based on context\n let linkProps: Partial<ButtonProps> & { target?: string; to?: string } = {}\n\n if (isExternalLink) {\n linkProps = {\n href,\n target: '_blank',\n rel: 'noopener noreferrer',\n component: 'a',\n }\n } else if (inRouterContext) {\n // For internal links, if we are in a react-router context, use RouterLink\n linkProps = {\n to: href,\n component: RouterLink,\n }\n } else {\n linkProps = {\n href,\n component: 'a',\n }\n }\n\n // Build the button text: \"prefixText count suffixText\"\n const buttonText = React.useMemo(() => {\n const parts: string[] = []\n\n if (prefixText) {\n parts.push(prefixText)\n }\n\n if (!isLoading && count !== undefined) {\n parts.push(count.toLocaleString())\n }\n\n if (suffixText) {\n parts.push(suffixText)\n }\n\n return parts.join(' ')\n }, [prefixText, count, suffixText, isLoading])\n\n // Icon with theme-aware circular background\n const endIcon = (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'background.paper',\n borderRadius: '50%',\n width: 24,\n height: 24,\n }}\n >\n <NavigateNext sx={{ color: 'primary.main', fontSize: 20 }} />\n </Box>\n )\n\n return (\n <Button\n {...buttonProps}\n {...linkProps}\n endIcon={endIcon}\n loading={isLoading}\n >\n {buttonText}\n </Button>\n )\n}\n\nexport default QueryCountButton\n"],"mappings":";;;;;;;;;AAoCA,SAAgB,EAAiB,GAA8B;CAC7D,IAAM,EAAE,QAAK,SAAM,gBAAa,IAAI,gBAAa,IAAI,GAAG,MAAgB,GAClE,IAAW,EAA8B,EAAI,EAC7C,IAAkB,GAAoB,EAStC,EAAE,MAAM,GAAa,iBAAc,EAPL;EAClC,cAAc;EACd,OAAO,EAAE,QAAK;EACd;EACA,UAAA;EACD,CAEwE,EAEnE,IAAQ,GAAa,YAErB,IACJ,GAAM,WAAW,UAAU,IAAI,GAAM,WAAW,WAAW,EAGzD,IAAqE,EAAE;AAE3E,CAcE,IAdE,IACU;EACV;EACA,QAAQ;EACR,KAAK;EACL,WAAW;EACZ,GACQ,IAEG;EACV,IAAI;EACJ,WAAW;EACZ,GAEW;EACV;EACA,WAAW;EACZ;CAIH,IAAM,IAAa,EAAM,cAAc;EACrC,IAAM,IAAkB,EAAE;AAc1B,SAZI,KACF,EAAM,KAAK,EAAW,EAGpB,CAAC,KAAa,MAAU,KAAA,KAC1B,EAAM,KAAK,EAAM,gBAAgB,CAAC,EAGhC,KACF,EAAM,KAAK,EAAW,EAGjB,EAAM,KAAK,IAAI;IACrB;EAAC;EAAY;EAAO;EAAY;EAAU,CAAC,EAGxC,IACJ,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,iBAAiB;GACjB,cAAc;GACd,OAAO;GACP,QAAQ;GACT;YAED,kBAAC,GAAD,EAAc,IAAI;GAAE,OAAO;GAAgB,UAAU;GAAI,EAAI,CAAA;EACzD,CAAA;AAGR,QACE,kBAAC,GAAD;EACE,GAAI;EACJ,GAAI;EACK;EACT,SAAS;YAER;EACM,CAAA"}
1
+ {"version":3,"file":"QueryCountButton.js","names":[],"sources":["../../../src/components/QueryCountButton/QueryCountButton.tsx"],"sourcesContent":["import useGetQueryResultBundle from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { BUNDLE_MASK_QUERY_COUNT } from '@/utils/SynapseConstants'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport { QueryBundleRequest } from '@sage-bionetworks/synapse-types'\nimport { Box, Button, ButtonProps } from '@mui/material'\nimport { NavigateNext } from '@mui/icons-material'\nimport React from 'react'\nimport { Link as RouterLink, useInRouterContext } from 'react-router'\n\nexport type QueryCountButtonProps = {\n /**\n * The SQL query to execute to get the count\n */\n sql: string\n /**\n * The target URL when the button is clicked\n */\n href: string\n /**\n * Text to display before the count (e.g., \"Explore\")\n */\n prefixText?: string\n /**\n * Text to display after the count (e.g., \"files\")\n */\n suffixText?: string\n /**\n * Additional MUI Button props\n */\n} & Omit<ButtonProps, 'children'>\n\n/**\n * A button component that displays text with an inline count.\n * The count is fetched by executing a SQL query against a Synapse table.\n * Example: \"Explore 42 files\"\n */\nexport function QueryCountButton(props: QueryCountButtonProps) {\n const { sql, href, prefixText = '', suffixText = '', ...buttonProps } = props\n const entityId = parseEntityIdFromSqlStatement(sql)\n const inRouterContext = useInRouterContext()\n\n const request: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n query: { sql },\n entityId,\n partMask: BUNDLE_MASK_QUERY_COUNT,\n }\n\n const { data: queryResult, isLoading } = useGetQueryResultBundle(request)\n\n const count = queryResult?.queryCount\n\n const isExternalLink =\n href?.startsWith('http://') || href?.startsWith('https://')\n\n // Determine the appropriate link props based on context\n let linkProps: Partial<ButtonProps> & { target?: string; to?: string } = {}\n\n if (isExternalLink) {\n linkProps = {\n href,\n target: '_blank',\n rel: 'noopener noreferrer',\n component: 'a',\n }\n } else if (inRouterContext) {\n // For internal links, if we are in a react-router context, use RouterLink\n linkProps = {\n to: href,\n component: RouterLink,\n }\n } else {\n linkProps = {\n href,\n component: 'a',\n }\n }\n\n // Build the button text: \"prefixText count suffixText\"\n const buttonText = React.useMemo(() => {\n const parts: string[] = []\n\n if (prefixText) {\n parts.push(prefixText)\n }\n\n if (!isLoading && count !== undefined) {\n parts.push(count.toLocaleString())\n }\n\n if (suffixText) {\n parts.push(suffixText)\n }\n\n return parts.join(' ')\n }, [prefixText, count, suffixText, isLoading])\n\n // Icon with theme-aware circular background\n const endIcon = (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'background.paper',\n borderRadius: '50%',\n width: 24,\n height: 24,\n }}\n >\n <NavigateNext sx={{ color: 'primary.main', fontSize: 20 }} />\n </Box>\n )\n\n return (\n <Button\n {...buttonProps}\n {...linkProps}\n endIcon={endIcon}\n loading={isLoading}\n >\n {buttonText}\n </Button>\n )\n}\n\nexport default QueryCountButton\n"],"mappings":";;;;;;;;;AAoCA,SAAgB,EAAiB,GAA8B;CAC7D,IAAM,EAAE,QAAK,SAAM,gBAAa,IAAI,gBAAa,IAAI,GAAG,MAAgB,GAClE,IAAW,EAA8B,EAAI,EAC7C,IAAkB,GAAoB,EAStC,EAAE,MAAM,GAAa,iBAAc,EAAwB;EAN/D,cAAc;EACd,OAAO,EAAE,QAAK;EACd;EACA,UAAA;EAG+D,CAAQ,EAEnE,IAAQ,GAAa,YAErB,IACJ,GAAM,WAAW,UAAU,IAAI,GAAM,WAAW,WAAW,EAGzD,IAAqE,EAAE;AAE3E,CAcE,IAdE,IACU;EACV;EACA,QAAQ;EACR,KAAK;EACL,WAAW;EACZ,GACQ,IAEG;EACV,IAAI;EACJ,WAAW;EACZ,GAEW;EACV;EACA,WAAW;EACZ;CAIH,IAAM,IAAa,EAAM,cAAc;EACrC,IAAM,IAAkB,EAAE;AAc1B,SAZI,KACF,EAAM,KAAK,EAAW,EAGpB,CAAC,KAAa,MAAU,KAAA,KAC1B,EAAM,KAAK,EAAM,gBAAgB,CAAC,EAGhC,KACF,EAAM,KAAK,EAAW,EAGjB,EAAM,KAAK,IAAI;IACrB;EAAC;EAAY;EAAO;EAAY;EAAU,CAAC,EAGxC,IACJ,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,iBAAiB;GACjB,cAAc;GACd,OAAO;GACP,QAAQ;GACT;YAED,kBAAC,GAAD,EAAc,IAAI;GAAE,OAAO;GAAgB,UAAU;GAAI,EAAI,CAAA;EACzD,CAAA;AAGR,QACE,kBAAC,GAAD;EACE,GAAI;EACJ,GAAI;EACK;EACT,SAAS;YAER;EACM,CAAA"}