synapse-react-client 4.0.45 → 4.0.46

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 (319) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +1 -0
  3. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -1
  4. package/dist/aridhia-queries/AridhiaKeyFactory.js +3 -0
  5. package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -1
  6. package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
  7. package/dist/aridhia-queries/index.d.ts +1 -0
  8. package/dist/aridhia-queries/index.d.ts.map +1 -1
  9. package/dist/aridhia-queries/index.js +11 -10
  10. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts +19 -0
  11. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts.map +1 -0
  12. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js +14 -0
  13. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js.map +1 -0
  14. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.d.ts.map +1 -1
  15. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js +6 -4
  16. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js.map +1 -1
  17. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  18. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +1 -1
  19. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -1
  20. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +1 -1
  21. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
  22. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +1 -1
  23. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -1
  24. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
  25. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +11 -8
  26. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
  27. package/dist/components/AccessTokenPage/AccessTokenPage.js +1 -1
  28. package/dist/components/AccessTokenPage/AccessTokenPage.js.map +1 -1
  29. package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +1 -1
  30. package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
  31. package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -1
  32. package/dist/components/Aridhia/DarWizard/DarSectionForm.js +17 -13
  33. package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -1
  34. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +3 -3
  35. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -1
  36. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +33 -34
  37. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
  38. package/dist/components/Aridhia/fairFormToRjsf.js +1 -1
  39. package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -1
  40. package/dist/components/Authentication/LastLoginInfo.js +1 -1
  41. package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
  42. package/dist/components/CertificationQuiz/CertificationQuiz.js +1 -1
  43. package/dist/components/CertificationQuiz/CertificationQuiz.js.map +1 -1
  44. package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js +1 -1
  45. package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js.map +1 -1
  46. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js +1 -1
  47. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js.map +1 -1
  48. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +6 -6
  49. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  50. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.d.ts.map +1 -1
  51. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js +4 -4
  52. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js.map +1 -1
  53. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +4 -4
  54. package/dist/components/CitationPopover/CitationPopoverContent.js +4 -4
  55. package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
  56. package/dist/components/ComponentCollapse.d.ts.map +1 -1
  57. package/dist/components/ComponentCollapse.js +2 -1
  58. package/dist/components/ComponentCollapse.js.map +1 -1
  59. package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
  60. package/dist/components/DataGrid/SynapseGrid.js +231 -219
  61. package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
  62. package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
  63. package/dist/components/DataGrid/SyncGridWithSourceButton.js +5 -4
  64. package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
  65. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
  66. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +7 -5
  67. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
  68. package/dist/components/DataGrid/components/ExportCsvFromGridButton.js +4 -4
  69. package/dist/components/DataGrid/components/ExportCsvFromGridButton.js.map +1 -1
  70. package/dist/components/DataGrid/components/ReorderColumnsButton.js +4 -4
  71. package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
  72. package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
  73. package/dist/components/DataGrid/components/ReorderColumnsDialog.js +12 -8
  74. package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
  75. package/dist/components/DataGrid/components/UploadCsvToGridButton.js +1 -1
  76. package/dist/components/DataGrid/components/UploadCsvToGridButton.js.map +1 -1
  77. package/dist/components/DataGrid/hooks/useGridUndoRedo.js +5 -5
  78. package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
  79. package/dist/components/DataGrid/utils/applyModelChange.js +14 -14
  80. package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
  81. package/dist/components/DataGrid/utils/columnFactory.js +1 -1
  82. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  83. package/dist/components/DataGrid/utils/splitPatch.d.ts.map +1 -1
  84. package/dist/components/DataGrid/utils/splitPatch.js +22 -13
  85. package/dist/components/DataGrid/utils/splitPatch.js.map +1 -1
  86. package/dist/components/DownloadCart/DownloadCartPage.js +1 -1
  87. package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
  88. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
  89. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +2 -1
  90. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  91. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -1
  92. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +1 -3
  93. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
  94. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js +16 -10
  95. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
  96. package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -1
  97. package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
  98. package/dist/components/EntityFinder/EntityFinder.js +4 -4
  99. package/dist/components/EntityFinder/EntityIdTextField.js +1 -1
  100. package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -1
  101. package/dist/components/EntityFinder/tree/VirtualizedTree.d.ts.map +1 -1
  102. package/dist/components/EntityFinder/tree/VirtualizedTree.js +5 -4
  103. package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
  104. package/dist/components/EntityHeaderTable/EntityHeaderTable.js +1 -1
  105. package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
  106. package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
  107. package/dist/components/EntityTreeTable/components/EntityNameCell.js +2 -1
  108. package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
  109. package/dist/components/EntityUpload/FileUploadProgress.d.ts.map +1 -1
  110. package/dist/components/EntityUpload/FileUploadProgress.js +11 -7
  111. package/dist/components/EntityUpload/FileUploadProgress.js.map +1 -1
  112. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.d.ts.map +1 -1
  113. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js +4 -3
  114. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js.map +1 -1
  115. package/dist/components/ExperimentalMode/ExperimentalMode.js +1 -1
  116. package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
  117. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js +1 -1
  118. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js.map +1 -1
  119. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -1
  120. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +2 -1
  121. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -1
  122. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
  123. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +2 -1
  124. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
  125. package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -1
  126. package/dist/components/FormTemplateEditor/FieldLibrary.js +2 -1
  127. package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -1
  128. package/dist/components/FormTemplateEditor/FieldLibraryRow.js +4 -4
  129. package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -1
  130. package/dist/components/FormTemplateEditor/FormStructurePanel.js +1 -1
  131. package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -1
  132. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +1 -1
  133. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -1
  134. package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -1
  135. package/dist/components/FormTemplateEditor/StepCard.js +15 -10
  136. package/dist/components/FormTemplateEditor/StepCard.js.map +1 -1
  137. package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -1
  138. package/dist/components/FormTemplateEditor/StepFieldRow.js +11 -6
  139. package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -1
  140. package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -1
  141. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +2 -1
  142. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -1
  143. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +45 -45
  144. package/dist/components/GenericCard/PortalDOI/PortalDOI.js +5 -5
  145. package/dist/components/GenericCard/PortalDOI/PortalDOI.js.map +1 -1
  146. package/dist/components/GenericCard/TableRowGenericCard.js +1 -1
  147. package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
  148. package/dist/components/HelpPopover/HelpPopover.js +1 -1
  149. package/dist/components/HelpPopover/HelpPopover.js.map +1 -1
  150. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  151. package/dist/components/IconSvg/IconSvg.js +154 -47
  152. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  153. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.d.ts.map +1 -1
  154. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js +19 -16
  155. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js.map +1 -1
  156. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
  157. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +2 -1
  158. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
  159. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts +9 -0
  160. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts.map +1 -0
  161. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js +21 -0
  162. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js.map +1 -0
  163. package/dist/components/Markdown/MarkdownCollapse.d.ts.map +1 -1
  164. package/dist/components/Markdown/MarkdownCollapse.js +3 -1
  165. package/dist/components/Markdown/MarkdownCollapse.js.map +1 -1
  166. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js +1 -1
  167. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
  168. package/dist/components/OAuthClientManagement/OAuthManagement.js +14 -13
  169. package/dist/components/OAuthClientManagement/OAuthManagement.js.map +1 -1
  170. package/dist/components/PortalList/PortalCard.d.ts.map +1 -1
  171. package/dist/components/PortalList/PortalCard.js +6 -5
  172. package/dist/components/PortalList/PortalCard.js.map +1 -1
  173. package/dist/components/PortalList/PortalList.js +4 -4
  174. package/dist/components/PortalList/PortalList.js.map +1 -1
  175. package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +6 -6
  176. package/dist/components/QueryBuilder/FilterConditionRow.js +4 -4
  177. package/dist/components/QueryCountButton/QueryCountButton.js +5 -5
  178. package/dist/components/QueryCountButton/QueryCountButton.js.map +1 -1
  179. package/dist/components/ReleaseCard/ReleaseCardLarge.js +5 -5
  180. package/dist/components/ReleaseCard/ReleaseCardLarge.js.map +1 -1
  181. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +1 -1
  182. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  183. package/dist/components/ShareThisPage/ShareThisPage.js +4 -4
  184. package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
  185. package/dist/components/SustainabilityScorecard/DialLayout.js +1 -1
  186. package/dist/components/SustainabilityScorecard/DialLayout.js.map +1 -1
  187. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js +1 -1
  188. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js.map +1 -1
  189. package/dist/components/SynapseChat/SynapseChat.js +1 -1
  190. package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
  191. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
  192. package/dist/components/SynapseChat/SynapseChatInteraction.js +2 -1
  193. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  194. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +1 -1
  195. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -1
  196. package/dist/components/SynapseFooter/SynapseFooter.js +1 -1
  197. package/dist/components/SynapseFooter/SynapseFooter.js.map +1 -1
  198. package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js +1 -1
  199. package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js.map +1 -1
  200. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.d.ts.map +1 -1
  201. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js +2 -1
  202. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js.map +1 -1
  203. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js +4 -4
  204. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js.map +1 -1
  205. package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js +1 -1
  206. package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js.map +1 -1
  207. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
  208. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +4 -1
  209. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
  210. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +1 -1
  211. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
  212. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js +1 -1
  213. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js.map +1 -1
  214. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.d.ts.map +1 -1
  215. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +12 -9
  216. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js.map +1 -1
  217. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +4 -4
  218. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
  219. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +140 -140
  220. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  221. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
  222. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  223. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js +1 -1
  224. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js.map +1 -1
  225. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
  226. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
  227. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +9 -9
  228. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  229. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.d.ts.map +1 -1
  230. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js +6 -4
  231. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js.map +1 -1
  232. package/dist/components/TanStackTable/ColumnHeader.js +1 -1
  233. package/dist/components/TanStackTable/ColumnHeader.js.map +1 -1
  234. package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js +1 -1
  235. package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js.map +1 -1
  236. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.d.ts.map +1 -1
  237. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js +4 -3
  238. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js.map +1 -1
  239. package/dist/components/Webhook/WebhookDashboard.js +1 -1
  240. package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
  241. package/dist/components/dataaccess/AccessRequirementDashboard.js +4 -4
  242. package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
  243. package/dist/components/dataaccess/AccessRequirementTable.js +1 -1
  244. package/dist/components/dataaccess/AccessRequirementTable.js.map +1 -1
  245. package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -1
  246. package/dist/components/dataaccess/EDucTemplateTable.js +13 -11
  247. package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -1
  248. package/dist/components/dataaccess/FormTemplateTable.js +6 -6
  249. package/dist/components/dataaccess/FormTemplateTable.js.map +1 -1
  250. package/dist/components/dataaccess/ReviewerDashboard.js +17 -17
  251. package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
  252. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +4 -4
  253. package/dist/components/doi/CreateOrUpdateDoiModal.js +1 -1
  254. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  255. package/dist/components/download_list/DownloadDetails.d.ts.map +1 -1
  256. package/dist/components/download_list/DownloadDetails.js +12 -10
  257. package/dist/components/download_list/DownloadDetails.js.map +1 -1
  258. package/dist/components/entity/metadata/AnnotationsTable.js +1 -1
  259. package/dist/components/entity/metadata/AnnotationsTable.js.map +1 -1
  260. package/dist/components/entity/page/CreatedByModifiedBy.js +1 -1
  261. package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
  262. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
  263. package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
  264. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +1 -1
  265. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  266. package/dist/components/error/ErrorChip.d.ts.map +1 -1
  267. package/dist/components/error/ErrorChip.js +2 -1
  268. package/dist/components/error/ErrorChip.js.map +1 -1
  269. package/dist/components/table/CsvPreview/CreateTableFromCsvDialog.js +14 -14
  270. package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js +4 -4
  271. package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js.map +1 -1
  272. package/dist/components/widgets/facet-nav/FacetNavPanel.js +1 -1
  273. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  274. package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -1
  275. package/dist/features/curator/dashboard/components/NextStepButton.js +7 -6
  276. package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -1
  277. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +8 -8
  278. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
  279. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +4 -4
  280. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
  281. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +4 -4
  282. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
  283. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
  284. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
  285. package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js +4 -4
  286. package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js.map +1 -1
  287. package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js +1 -1
  288. package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js.map +1 -1
  289. package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js +1 -1
  290. package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js.map +1 -1
  291. package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js +10 -10
  292. package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js.map +1 -1
  293. package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js +1 -1
  294. package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js.map +1 -1
  295. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +8 -0
  296. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
  297. package/dist/mocks/msw/handlers/aridhiaHandlers.js +52 -41
  298. package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
  299. package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
  300. package/dist/mocks/msw/handlers/entityHandlers.js +70 -67
  301. package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
  302. package/dist/mocks/msw/handlers/gridHandlers.js +2 -2
  303. package/dist/mocks/msw/handlers/gridHandlers.js.map +1 -1
  304. package/dist/mocks/msw/server.d.ts.map +1 -1
  305. package/dist/mocks/msw/server.js +4 -2
  306. package/dist/mocks/msw/server.js.map +1 -1
  307. package/dist/synapse-queries/user/useGetUserChallenges.d.ts.map +1 -1
  308. package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
  309. package/dist/theme/DefaultTheme.d.ts.map +1 -1
  310. package/dist/theme/DefaultTheme.js +4 -1
  311. package/dist/theme/DefaultTheme.js.map +1 -1
  312. package/dist/tsconfig.build.tsbuildinfo +1 -1
  313. package/dist/utils/APIConstants.d.ts.map +1 -1
  314. package/dist/utils/APIConstants.js.map +1 -1
  315. package/dist/utils/AppUtils/AppUtils.js +1 -1
  316. package/dist/utils/AppUtils/AppUtils.js.map +1 -1
  317. package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
  318. package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
  319. package/package.json +7 -6
@@ -21,7 +21,7 @@ function C(e) {
21
21
  function w(u) {
22
22
  let { entityId: f, versionNumber: w } = u, [T, E] = _(!1), { data: D, isLoading: O, refetch: k } = a(f, w, !0), A = D?.entityMetadata, j = D?.annotations, { data: M, isLoading: N } = o(f), { data: P, isLoading: F } = c(M?.jsonSchemaVersionInfo.$id, { enabled: !!M }), { data: I, isLoading: L } = h(D?.entity, P), { data: R, refetch: z } = s(f, { enabled: !!M }), B = !!M, V = !!A && !!R && S(A.modifiedOn).diff(S(R.validatedOn)) > 0, H = g(async () => {
23
23
  E(!0);
24
- let e = [void k(), void z()];
24
+ let e = [k(), z()];
25
25
  await Promise.allSettled(e), E(!1);
26
26
  }, [k, z]);
27
27
  return O || N || F || L || T ? /* @__PURE__ */ b(l, {
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationsTable.js","names":[],"sources":["../../../../src/components/entity/metadata/AnnotationsTable.tsx"],"sourcesContent":["import { EntityAnnotationKey } from '@/components/entity/metadata/EntityAnnotationKey'\nimport { useGetJson } from '@/synapse-queries/entity/useEntity'\nimport { useGetSchema } from '@/synapse-queries/jsonschema/useSchema'\nimport {\n useGetSchemaBinding,\n useGetValidationResults,\n} from '@/synapse-queries/jsonschema/useEntityBoundSchema'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { isISOTimestamp } from '@/utils/functions/DateTimeUtils'\nimport {\n convertToEntityType,\n entityTypeToFriendlyName,\n} from '@/utils/functions/EntityTypeUtils'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {\n getDisplayedAnnotationDescription,\n getDisplayedAnnotationTitle,\n useGetAnnotatedJsonInstance,\n} from '@/utils/jsonschema/SchemaAnnotationUtils'\nimport { Json } from '@sage-bionetworks/synapse-client'\nimport dayjs from 'dayjs'\nimport { isEmpty } from 'lodash-es'\nimport { useCallback, useState } from 'react'\nimport FullWidthAlert from '../../FullWidthAlert'\nimport { SkeletonTable } from '../../Skeleton'\n\nexport type AnnotationsTableProps = {\n readonly entityId: string\n readonly versionNumber?: number\n}\n\nexport function getDisplayedAnnotation(\n value: string | number | boolean,\n): string {\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString()\n } else if (isISOTimestamp(value)) {\n return formatDate(dayjs(value))\n }\n return value\n}\n\nexport function AnnotationsTable(props: AnnotationsTableProps) {\n const { entityId, versionNumber } = props\n const [isManuallyRefetching, setIsManuallyRefetching] = useState(false)\n\n const {\n data: entityData,\n isLoading: isLoadingEntityData,\n refetch: refetchEntityData,\n } = useGetJson(entityId, versionNumber, true)\n const entityMetadata = entityData?.entityMetadata\n const annotations = entityData?.annotations\n\n const { data: boundSchema, isLoading: isLoadingSchemaBinding } =\n useGetSchemaBinding(entityId)\n const { data: validationSchema, isLoading: isLoadingValidationSchema } =\n useGetSchema(boundSchema?.jsonSchemaVersionInfo.$id!, {\n enabled: Boolean(boundSchema),\n })\n\n const { data: annotatedInstance, isLoading: isLoadingSchemaAnnotations } =\n useGetAnnotatedJsonInstance(entityData?.entity as Json, validationSchema)\n\n const { data: validationResults, refetch: refetchValidationInformation } =\n useGetValidationResults(entityId, {\n enabled: Boolean(boundSchema),\n })\n\n const showSchemaInformation = Boolean(boundSchema)\n\n // If the entity has not yet been validated since the last fetch, then derived annotations may not have been calculated.\n const recentChangesHaveNotBeenValidated =\n !!entityMetadata &&\n !!validationResults &&\n dayjs(entityMetadata.modifiedOn).diff(\n dayjs(validationResults.validatedOn),\n ) > 0\n\n const onRefetch = useCallback(async () => {\n setIsManuallyRefetching(true)\n const promises = [\n // Refetch the annotations, which may have changed if new derived annotations have been calculated\n void refetchEntityData(),\n // Refetch the validation information, which we use to determine if derived annotations may still be pending\n void refetchValidationInformation(),\n ]\n await Promise.allSettled(promises)\n setIsManuallyRefetching(false)\n }, [refetchEntityData, refetchValidationInformation])\n\n const isLoading =\n isLoadingEntityData ||\n isLoadingSchemaBinding ||\n isLoadingValidationSchema ||\n isLoadingSchemaAnnotations\n\n return isLoading || isManuallyRefetching ? (\n <SkeletonTable numRows={3} numCols={2} />\n ) : (\n <>\n {entityMetadata && annotations && isEmpty(annotations) ? (\n <div className=\"placeholder\">\n This{' '}\n {entityTypeToFriendlyName(\n convertToEntityType(entityMetadata.concreteType),\n )}{' '}\n has no annotations.\n </div>\n ) : null}\n <table className=\"AnnotationsTable\">\n <tbody>\n {annotations &&\n Object.keys(annotations).map((annotationKey: string) => {\n return (\n <tr key={annotationKey} className=\"AnnotationsTable__Row\">\n <td className=\"AnnotationsTable__Row__Key\">\n <EntityAnnotationKey\n annotationKey={annotationKey}\n title={getDisplayedAnnotationTitle(\n annotationKey,\n annotatedInstance,\n )}\n description={getDisplayedAnnotationDescription(\n annotationKey,\n annotatedInstance,\n )}\n />\n </td>\n <td className=\"AnnotationsTable__Row__Value\">\n {Array.isArray(annotations[annotationKey])\n ? annotations[annotationKey]\n .map(getDisplayedAnnotation)\n .join(', ')\n : getDisplayedAnnotation(\n annotations[annotationKey] as\n | string\n | number\n | boolean,\n )}\n </td>\n </tr>\n )\n })}\n {showSchemaInformation ? (\n <tr className=\"AnnotationsTable__Row\">\n <td className=\"AnnotationsTable__Row__Key Schema\">\n Validation Schema\n </td>\n <td className=\"AnnotationsTable__Row__Value\">\n <a\n href={`${getEndpoint(\n BackendDestinationEnum.REPO_ENDPOINT,\n )}/repo/v1/schema/type/registered/${\n boundSchema!.jsonSchemaVersionInfo.$id\n }`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {boundSchema!.jsonSchemaVersionInfo.schemaName}\n </a>\n </td>\n </tr>\n ) : null}\n </tbody>\n </table>\n {entityMetadata &&\n showSchemaInformation &&\n recentChangesHaveNotBeenValidated && (\n <FullWidthAlert\n variant=\"warning\"\n description={`This ${entityTypeToFriendlyName(\n convertToEntityType(entityMetadata.concreteType),\n )} has changed since it has been last validated. If this ${entityTypeToFriendlyName(\n convertToEntityType(entityMetadata.concreteType),\n )} is expected to have annotations derived from the Validation Schema, they may not yet be visible.`}\n primaryButtonConfig={{\n text: 'Reload Annotations',\n onClick: () => {\n onRefetch()\n },\n }}\n isGlobal={false}\n />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAgB,EACd,GACQ;CAMR,OALI,OAAO,KAAU,YAAY,OAAO,KAAU,YACzC,EAAM,SAAS,IACb,EAAe,CAAK,IACtB,EAAW,EAAM,CAAK,CAAC,IAEzB;AACT;AAEA,SAAgB,EAAiB,GAA8B;CAC7D,IAAM,EAAE,aAAU,qBAAkB,GAC9B,CAAC,GAAsB,KAA2B,EAAS,EAAK,GAEhE,EACJ,MAAM,GACN,WAAW,GACX,SAAS,MACP,EAAW,GAAU,GAAe,EAAI,GACtC,IAAiB,GAAY,gBAC7B,IAAc,GAAY,aAE1B,EAAE,MAAM,GAAa,WAAW,MACpC,EAAoB,CAAQ,GACxB,EAAE,MAAM,GAAkB,WAAW,MACzC,EAAa,GAAa,sBAAsB,KAAM,EACpD,SAAS,EAAQ,EACnB,CAAC,GAEG,EAAE,MAAM,GAAmB,WAAW,MAC1C,EAA4B,GAAY,QAAgB,CAAgB,GAEpE,EAAE,MAAM,GAAmB,SAAS,MACxC,EAAwB,GAAU,EAChC,SAAS,EAAQ,EACnB,CAAC,GAEG,IAAwB,EAAQ,GAGhC,IACJ,CAAC,CAAC,KACF,CAAC,CAAC,KACF,EAAM,EAAe,UAAU,EAAE,KAC/B,EAAM,EAAkB,WAAW,CACrC,IAAI,GAEA,IAAY,EAAY,YAAY;EACxC,EAAwB,EAAI;EAC5B,IAAM,IAAW,CAEf,KAAK,EAAkB,GAEvB,KAAK,EAA6B,CACpC;EAEA,A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ACjD,EAAE;GACF,qBAAqB;IACnB,MAAM;IACN,eAAe;KACb,EAAU;IACZ;GACF;GACA,UAAU;EACX,CAAA;CAEL,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"AnnotationsTable.js","names":[],"sources":["../../../../src/components/entity/metadata/AnnotationsTable.tsx"],"sourcesContent":["import { EntityAnnotationKey } from '@/components/entity/metadata/EntityAnnotationKey'\nimport { useGetJson } from '@/synapse-queries/entity/useEntity'\nimport { useGetSchema } from '@/synapse-queries/jsonschema/useSchema'\nimport {\n useGetSchemaBinding,\n useGetValidationResults,\n} from '@/synapse-queries/jsonschema/useEntityBoundSchema'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { isISOTimestamp } from '@/utils/functions/DateTimeUtils'\nimport {\n convertToEntityType,\n entityTypeToFriendlyName,\n} from '@/utils/functions/EntityTypeUtils'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {\n getDisplayedAnnotationDescription,\n getDisplayedAnnotationTitle,\n useGetAnnotatedJsonInstance,\n} from '@/utils/jsonschema/SchemaAnnotationUtils'\nimport { Json } from '@sage-bionetworks/synapse-client'\nimport dayjs from 'dayjs'\nimport { isEmpty } from 'lodash-es'\nimport { useCallback, useState } from 'react'\nimport FullWidthAlert from '../../FullWidthAlert'\nimport { SkeletonTable } from '../../Skeleton'\n\nexport type AnnotationsTableProps = {\n readonly entityId: string\n readonly versionNumber?: number\n}\n\nexport function getDisplayedAnnotation(\n value: string | number | boolean,\n): string {\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString()\n } else if (isISOTimestamp(value)) {\n return formatDate(dayjs(value))\n }\n return value\n}\n\nexport function AnnotationsTable(props: AnnotationsTableProps) {\n const { entityId, versionNumber } = props\n const [isManuallyRefetching, setIsManuallyRefetching] = useState(false)\n\n const {\n data: entityData,\n isLoading: isLoadingEntityData,\n refetch: refetchEntityData,\n } = useGetJson(entityId, versionNumber, true)\n const entityMetadata = entityData?.entityMetadata\n const annotations = entityData?.annotations\n\n const { data: boundSchema, isLoading: isLoadingSchemaBinding } =\n useGetSchemaBinding(entityId)\n const { data: validationSchema, isLoading: isLoadingValidationSchema } =\n useGetSchema(boundSchema?.jsonSchemaVersionInfo.$id!, {\n enabled: Boolean(boundSchema),\n })\n\n const { data: annotatedInstance, isLoading: isLoadingSchemaAnnotations } =\n useGetAnnotatedJsonInstance(entityData?.entity as Json, validationSchema)\n\n const { data: validationResults, refetch: refetchValidationInformation } =\n useGetValidationResults(entityId, {\n enabled: Boolean(boundSchema),\n })\n\n const showSchemaInformation = Boolean(boundSchema)\n\n // If the entity has not yet been validated since the last fetch, then derived annotations may not have been calculated.\n const recentChangesHaveNotBeenValidated =\n !!entityMetadata &&\n !!validationResults &&\n dayjs(entityMetadata.modifiedOn).diff(\n dayjs(validationResults.validatedOn),\n ) > 0\n\n const onRefetch = useCallback(async () => {\n setIsManuallyRefetching(true)\n const promises = [\n // Refetch the annotations, which may have changed if new derived annotations have been calculated\n refetchEntityData(),\n // Refetch the validation information, which we use to determine if derived annotations may still be pending\n refetchValidationInformation(),\n ]\n await Promise.allSettled(promises)\n setIsManuallyRefetching(false)\n }, [refetchEntityData, refetchValidationInformation])\n\n const isLoading =\n isLoadingEntityData ||\n isLoadingSchemaBinding ||\n isLoadingValidationSchema ||\n isLoadingSchemaAnnotations\n\n return isLoading || isManuallyRefetching ? (\n <SkeletonTable numRows={3} numCols={2} />\n ) : (\n <>\n {entityMetadata && annotations && isEmpty(annotations) ? (\n <div className=\"placeholder\">\n This{' '}\n {entityTypeToFriendlyName(\n convertToEntityType(entityMetadata.concreteType),\n )}{' '}\n has no annotations.\n </div>\n ) : null}\n <table className=\"AnnotationsTable\">\n <tbody>\n {annotations &&\n Object.keys(annotations).map((annotationKey: string) => {\n return (\n <tr key={annotationKey} className=\"AnnotationsTable__Row\">\n <td className=\"AnnotationsTable__Row__Key\">\n <EntityAnnotationKey\n annotationKey={annotationKey}\n title={getDisplayedAnnotationTitle(\n annotationKey,\n annotatedInstance,\n )}\n description={getDisplayedAnnotationDescription(\n annotationKey,\n annotatedInstance,\n )}\n />\n </td>\n <td className=\"AnnotationsTable__Row__Value\">\n {Array.isArray(annotations[annotationKey])\n ? annotations[annotationKey]\n .map(getDisplayedAnnotation)\n .join(', ')\n : getDisplayedAnnotation(\n annotations[annotationKey] as\n | string\n | number\n | boolean,\n )}\n </td>\n </tr>\n )\n })}\n {showSchemaInformation ? (\n <tr className=\"AnnotationsTable__Row\">\n <td className=\"AnnotationsTable__Row__Key Schema\">\n Validation Schema\n </td>\n <td className=\"AnnotationsTable__Row__Value\">\n <a\n href={`${getEndpoint(\n BackendDestinationEnum.REPO_ENDPOINT,\n )}/repo/v1/schema/type/registered/${\n boundSchema!.jsonSchemaVersionInfo.$id\n }`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {boundSchema!.jsonSchemaVersionInfo.schemaName}\n </a>\n </td>\n </tr>\n ) : null}\n </tbody>\n </table>\n {entityMetadata &&\n showSchemaInformation &&\n recentChangesHaveNotBeenValidated && (\n <FullWidthAlert\n variant=\"warning\"\n description={`This ${entityTypeToFriendlyName(\n convertToEntityType(entityMetadata.concreteType),\n )} has changed since it has been last validated. If this ${entityTypeToFriendlyName(\n convertToEntityType(entityMetadata.concreteType),\n )} is expected to have annotations derived from the Validation Schema, they may not yet be visible.`}\n primaryButtonConfig={{\n text: 'Reload Annotations',\n onClick: () => {\n onRefetch()\n },\n }}\n isGlobal={false}\n />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAgB,EACd,GACQ;CAMR,OALI,OAAO,KAAU,YAAY,OAAO,KAAU,YACzC,EAAM,SAAS,IACb,EAAe,CAAK,IACtB,EAAW,EAAM,CAAK,CAAC,IAEzB;AACT;AAEA,SAAgB,EAAiB,GAA8B;CAC7D,IAAM,EAAE,aAAU,qBAAkB,GAC9B,CAAC,GAAsB,KAA2B,EAAS,EAAK,GAEhE,EACJ,M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A;IACC,CAAA,GACJ,kBAAC,MAAD;KAAI,WAAU;eACX,MAAM,QAAQ,EAAY,EAAc,IACrC,EAAY,GACT,IAAI,CAAsB,EAC1B,KAAK,IAAI,IACZ,EACE,EAAY,EAId;IACF,CAAA,CACF;MA1BK,CA0BL,CAEP,GACF,IACC,kBAAC,MAAD;IAAI,WAAU;cAAd,CACE,kBAAC,MAAD;KAAI,WAAU;eAAoC;IAE9C,CAAA,GACJ,kBAAC,MAAD;KAAI,WAAU;eACZ,kBAAC,KAAD;MACE,MAAM,GAAG,EACP,EAAuB,aACzB,EAAE,kCACA,EAAa,sBAAsB;MAErC,QAAO;MACP,KAAI;gBAEH,EAAa,sBAAsB;KACnC,CAAA;IACD,CAAA,CACF;QACF,IACC,EAAA,CAAA;EACF,CAAA;EACN,KACC,KACA,KACE,kBAAC,GAAD;GACE,SAAQ;GACR,aAAa,QAAQ,EACnB,EAAoB,EAAe,YAAY,CACjD,EAAE,yDAAyD,EACzD,EAAoB,EAAe,YAAY,CACjD,EAAE;GACF,qBAAqB;IACnB,MAAM;IACN,eAAe;KACb,EAAU;IACZ;GACF;GACA,UAAU;EACX,CAAA;CAEL,EAAA,CAAA;AAEN"}
@@ -9,7 +9,7 @@ import { UserBadge as c } from "../../UserCard/UserBadge.js";
9
9
  import { INFO_ICON_SX as l, getTableLastRebuiltTooltip as u, getTableModifiedOnAccessibleLabel as d, getTableModifiedOnTooltip as f } from "./createdByModifiedByTooltips.js";
10
10
  import { Box as p, Breadcrumbs as m, Skeleton as h, Tooltip as g, Typography as _, useMediaQuery as v, useTheme as y } from "@mui/material";
11
11
  import { jsx as b, jsxs as x } from "react/jsx-runtime";
12
- import { InfoTwoTone as S } from "@mui/icons-material";
12
+ import S from "@mui/icons-material/InfoTwoTone";
13
13
  import C from "dayjs";
14
14
  //#region src/components/entity/page/CreatedByModifiedBy.tsx
15
15
  function w() {
@@ -1 +1 @@
1
- {"version":3,"file":"CreatedByModifiedBy.js","names":[],"sources":["../../../../src/components/entity/page/CreatedByModifiedBy.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport {\n useGetEntity,\n useGetQueryResultBundleWithAsyncStatus,\n} from '@/synapse-queries'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport {\n convertToEntityType,\n entityTypeToFriendlyName,\n isDataset,\n isTable,\n} from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport {\n Box,\n Breadcrumbs,\n Skeleton,\n Tooltip,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport dayjs from 'dayjs'\nimport { UserBadge } from '../../UserCard/UserBadge'\nimport {\n DATASET_CREATED_BY_TOOLTIP,\n INFO_ICON_SX,\n getTableLastRebuiltTooltip,\n getTableModifiedOnAccessibleLabel,\n getTableModifiedOnTooltip,\n} from './createdByModifiedByTooltips'\n\nexport type CreatedByModifiedByProps = {\n entityId: string\n versionNumber?: number\n}\n\nfunction Separator() {\n const theme = useTheme()\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'))\n if (isSmallScreen) {\n return null\n }\n return (\n <Typography variant={'breadcrumb1'} sx={{ color: 'grey.700' }}>\n /\n </Typography>\n )\n}\n\nexport function CreatedByModifiedBy(props: CreatedByModifiedByProps) {\n const { entityId, versionNumber } = props\n const entityIdWithVersion = `${entityId}${\n versionNumber ? `.${versionNumber}` : ''\n }`\n\n const { data: entity } = useGetEntity(entityId, versionNumber)\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityIdWithVersion} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n const friendlyName = entity\n ? entityTypeToFriendlyName(convertToEntityType(entity.concreteType))\n : ''\n\n const createdByTooltipId = `${entityIdWithVersion}-createdByTooltip`\n const modifiedByTooltipId = `${entityIdWithVersion}-modifiedByTooltip`\n const lastUpdatedTooltipId = `${entityIdWithVersion}-lastUpdatedTooltip`\n\n return (\n <Box\n sx={theme => ({\n bgcolor: 'grey.100',\n p: '10px',\n [theme.breakpoints.down('sm')]: {\n p: '24px 40px',\n },\n })}\n >\n <Breadcrumbs\n separator={<Separator />}\n sx={theme => ({\n '& .MuiBreadcrumbs-ol': {\n justifyContent: 'center',\n [theme.breakpoints.down('sm')]: {\n gap: '4px',\n },\n },\n })}\n >\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={createdByTooltipId}\n >\n {friendlyName} created by <UserBadge userId={entity?.createdBy} />{' '}\n on {formatDate(dayjs(entity?.createdOn))}\n {entity && isDataset(entity) && (\n <Tooltip\n id={createdByTooltipId}\n title={DATASET_CREATED_BY_TOOLTIP}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={modifiedByTooltipId}\n >\n {entity && isTable(entity) ? 'Configuration' : friendlyName} last\n modified by <UserBadge userId={entity?.modifiedBy} /> on{' '}\n {formatDate(dayjs(entity?.modifiedOn))}\n {entity && isTable(entity) && (\n <Tooltip\n id={modifiedByTooltipId}\n title={getTableModifiedOnTooltip(friendlyName)}\n aria-label={getTableModifiedOnAccessibleLabel(friendlyName)}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n {tableLastRebuilt && (\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={lastUpdatedTooltipId}\n >\n {friendlyName} last rebuilt on {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip\n title={getTableLastRebuiltTooltip(friendlyName)}\n id={lastUpdatedTooltipId}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n </Typography>\n )}\n </Breadcrumbs>\n </Box>\n )\n}\n\nexport default CreatedByModifiedBy\n"],"mappings":";;;;;;;;;;;;;;AAsCA,SAAS,IAAY;CAMnB,OAJsB,EADR,EACsB,EAAM,YAAY,KAAK,IAAI,CAC3D,IACK,OAGP,kBAAC,GAAD;EAAY,SAAS;EAAe,IAAI,EAAE,OAAO,WAAW;YAAG;CAEnD,CAAA;AAEhB;AAEA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,EAAE,aAAU,qBAAkB,GAC9B,IAAsB,GAAG,IAC7B,IAAgB,IAAI,MAAkB,MAGlC,EAAE,MAAM,MAAW,EAAa,GAAU,CAAa,GAEvD,EAAE,MAAM,MAAqB,EACjC;EACE;EACA,OAAO,EACL,KAAK,iBAAiB,EAAoB,UAC5C;EACA,UAAA;EACA,cAAc;CAChB,GACA,EAAE,SAAS,CAAC,EAAE,KAAU,EAAQ,CAAM,GAAG,CAC3C,GAEM,IAAmB,GAAkB,cAAc,eACnD,IAAe,IACjB,EAAyB,EAAoB,EAAO,YAAY,CAAC,IACjE,IAEE,IAAqB,GAAG,EAAoB,oBAC5C,IAAsB,GAAG,EAAoB,qBAC7C,IAAuB,GAAG,EAAoB;CAEpD,OACE,kBAAC,GAAD;EACE,KAAI,OAAU;GACZ,SAAS;GACT,GAAG;IACF,EAAM,YAAY,KAAK,IAAI,IAAI,EAC9B,GAAG,YACL;EACF;YAEA,kBAAC,GAAD;GACE,WAAW,kBAAC,GAAD,CAAY,CAAA;GACvB,KAAI,OAAU,EACZ,wBAAwB;IACtB,gBAAgB;KACf,EAAM,YAAY,KAAK,IAAI,IAAI,EAC9B,KAAK,MACP;GACF,EACF;aATF;IAWE,kBAAC,GAAD;KAAoB,WAAW,CAAC;KAAQ,SAAS;eAC/C,kBAAC,GAAD;MACE,IAAI,EAAE,OAAO,WAAW;MACxB,SAAS;MACT,oBAAkB;gBAHpB;OAKG;OAAa;OAAY,kBAAC,GAAD,EAAW,QAAQ,GAAQ,UAAY,CAAA;OAAE;OAAI;OACnE,EAAW,EAAM,GAAQ,SAAS,CAAC;OACtC,KAAU,EAAU,CAAM,KACzB,kBAAC,GAAD;QACE,IAAI;QACJ,OAAA;kBAEA,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;OACzB,CAAA;MAED;;IACM,CAAA;IACpB,kBAAC,GAAD;KAAoB,WAAW,CAAC;KAAQ,SAAS;eAC/C,kBAAC,GAAD;MACE,IAAI,EAAE,OAAO,WAAW;MACxB,SAAS;MACT,oBAAkB;gBAHpB;OAKG,KAAU,EAAQ,CAAM,IAAI,kBAAkB;OAAa;OAChD,kBAAC,GAAD,EAAW,QAAQ,GAAQ,WAAa,CAAA;OAAC;OAAI;OACxD,EAAW,EAAM,GAAQ,UAAU,CAAC;OACpC,KAAU,EAAQ,CAAM,KACvB,kBAAC,GAAD;QACE,IAAI;QACJ,OAAO,EAA0B,CAAY;QAC7C,cAAY,EAAkC,CAAY;kBAE1D,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;OACzB,CAAA;MAED;;IACM,CAAA;IACnB,KACC,kBAAC,GAAD;KACE,IAAI,EAAE,OAAO,WAAW;KACxB,SAAS;KACT,oBAAkB;eAHpB;MAKG;MAAa;MAAkB,EAAW,EAAM,CAAgB,CAAC;MAClE,kBAAC,GAAD;OACE,OAAO,EAA2B,CAAY;OAC9C,IAAI;iBAEJ,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;MACzB,CAAA;KACC;;GAEH;;CACV,CAAA;AAET"}
1
+ {"version":3,"file":"CreatedByModifiedBy.js","names":[],"sources":["../../../../src/components/entity/page/CreatedByModifiedBy.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport {\n useGetEntity,\n useGetQueryResultBundleWithAsyncStatus,\n} from '@/synapse-queries'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport {\n convertToEntityType,\n entityTypeToFriendlyName,\n isDataset,\n isTable,\n} from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport InfoTwoTone from '@mui/icons-material/InfoTwoTone'\nimport {\n Box,\n Breadcrumbs,\n Skeleton,\n Tooltip,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport dayjs from 'dayjs'\nimport { UserBadge } from '../../UserCard/UserBadge'\nimport {\n DATASET_CREATED_BY_TOOLTIP,\n INFO_ICON_SX,\n getTableLastRebuiltTooltip,\n getTableModifiedOnAccessibleLabel,\n getTableModifiedOnTooltip,\n} from './createdByModifiedByTooltips'\n\nexport type CreatedByModifiedByProps = {\n entityId: string\n versionNumber?: number\n}\n\nfunction Separator() {\n const theme = useTheme()\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'))\n if (isSmallScreen) {\n return null\n }\n return (\n <Typography variant={'breadcrumb1'} sx={{ color: 'grey.700' }}>\n /\n </Typography>\n )\n}\n\nexport function CreatedByModifiedBy(props: CreatedByModifiedByProps) {\n const { entityId, versionNumber } = props\n const entityIdWithVersion = `${entityId}${\n versionNumber ? `.${versionNumber}` : ''\n }`\n\n const { data: entity } = useGetEntity(entityId, versionNumber)\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityIdWithVersion} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n const friendlyName = entity\n ? entityTypeToFriendlyName(convertToEntityType(entity.concreteType))\n : ''\n\n const createdByTooltipId = `${entityIdWithVersion}-createdByTooltip`\n const modifiedByTooltipId = `${entityIdWithVersion}-modifiedByTooltip`\n const lastUpdatedTooltipId = `${entityIdWithVersion}-lastUpdatedTooltip`\n\n return (\n <Box\n sx={theme => ({\n bgcolor: 'grey.100',\n p: '10px',\n [theme.breakpoints.down('sm')]: {\n p: '24px 40px',\n },\n })}\n >\n <Breadcrumbs\n separator={<Separator />}\n sx={theme => ({\n '& .MuiBreadcrumbs-ol': {\n justifyContent: 'center',\n [theme.breakpoints.down('sm')]: {\n gap: '4px',\n },\n },\n })}\n >\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={createdByTooltipId}\n >\n {friendlyName} created by <UserBadge userId={entity?.createdBy} />{' '}\n on {formatDate(dayjs(entity?.createdOn))}\n {entity && isDataset(entity) && (\n <Tooltip\n id={createdByTooltipId}\n title={DATASET_CREATED_BY_TOOLTIP}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={modifiedByTooltipId}\n >\n {entity && isTable(entity) ? 'Configuration' : friendlyName} last\n modified by <UserBadge userId={entity?.modifiedBy} /> on{' '}\n {formatDate(dayjs(entity?.modifiedOn))}\n {entity && isTable(entity) && (\n <Tooltip\n id={modifiedByTooltipId}\n title={getTableModifiedOnTooltip(friendlyName)}\n aria-label={getTableModifiedOnAccessibleLabel(friendlyName)}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n {tableLastRebuilt && (\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={lastUpdatedTooltipId}\n >\n {friendlyName} last rebuilt on {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip\n title={getTableLastRebuiltTooltip(friendlyName)}\n id={lastUpdatedTooltipId}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n </Typography>\n )}\n </Breadcrumbs>\n </Box>\n )\n}\n\nexport default CreatedByModifiedBy\n"],"mappings":";;;;;;;;;;;;;;AAsCA,SAAS,IAAY;CAMnB,OAJsB,EADR,EACsB,EAAM,YAAY,KAAK,IAAI,CAC3D,IACK,OAGP,kBAAC,GAAD;EAAY,SAAS;EAAe,IAAI,EAAE,OAAO,WAAW;YAAG;CAEnD,CAAA;AAEhB;AAEA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,EAAE,aAAU,qBAAkB,GAC9B,IAAsB,GAAG,IAC7B,IAAgB,IAAI,MAAkB,MAGlC,EAAE,MAAM,MAAW,EAAa,GAAU,CAAa,GAEvD,EAAE,MAAM,MAAqB,EACjC;EACE;EACA,OAAO,EACL,KAAK,iBAAiB,EAAoB,UAC5C;EACA,UAAA;EACA,cAAc;CAChB,GACA,EAAE,SAAS,CAAC,EAAE,KAAU,EAAQ,CAAM,GAAG,CAC3C,GAEM,IAAmB,GAAkB,cAAc,eACnD,IAAe,IACjB,EAAyB,EAAoB,EAAO,YAAY,CAAC,IACjE,IAEE,IAAqB,GAAG,EAAoB,oBAC5C,IAAsB,GAAG,EAAoB,qBAC7C,IAAuB,GAAG,EAAoB;CAEpD,OACE,kBAAC,GAAD;EACE,KAAI,OAAU;GACZ,SAAS;GACT,GAAG;IACF,EAAM,YAAY,KAAK,IAAI,IAAI,EAC9B,GAAG,YACL;EACF;YAEA,kBAAC,GAAD;GACE,WAAW,kBAAC,GAAD,CAAY,CAAA;GACvB,KAAI,OAAU,EACZ,wBAAwB;IACtB,gBAAgB;KACf,EAAM,YAAY,KAAK,IAAI,IAAI,EAC9B,KAAK,MACP;GACF,EACF;aATF;IAWE,kBAAC,GAAD;KAAoB,WAAW,CAAC;KAAQ,SAAS;eAC/C,kBAAC,GAAD;MACE,IAAI,EAAE,OAAO,WAAW;MACxB,SAAS;MACT,oBAAkB;gBAHpB;OAKG;OAAa;OAAY,kBAAC,GAAD,EAAW,QAAQ,GAAQ,UAAY,CAAA;OAAE;OAAI;OACnE,EAAW,EAAM,GAAQ,SAAS,CAAC;OACtC,KAAU,EAAU,CAAM,KACzB,kBAAC,GAAD;QACE,IAAI;QACJ,OAAA;kBAEA,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;OACzB,CAAA;MAED;;IACM,CAAA;IACpB,kBAAC,GAAD;KAAoB,WAAW,CAAC;KAAQ,SAAS;eAC/C,kBAAC,GAAD;MACE,IAAI,EAAE,OAAO,WAAW;MACxB,SAAS;MACT,oBAAkB;gBAHpB;OAKG,KAAU,EAAQ,CAAM,IAAI,kBAAkB;OAAa;OAChD,kBAAC,GAAD,EAAW,QAAQ,GAAQ,WAAa,CAAA;OAAC;OAAI;OACxD,EAAW,EAAM,GAAQ,UAAU,CAAC;OACpC,KAAU,EAAQ,CAAM,KACvB,kBAAC,GAAD;QACE,IAAI;QACJ,OAAO,EAA0B,CAAY;QAC7C,cAAY,EAAkC,CAAY;kBAE1D,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;OACzB,CAAA;MAED;;IACM,CAAA;IACnB,KACC,kBAAC,GAAD;KACE,IAAI,EAAE,OAAO,WAAW;KACxB,SAAS;KACT,oBAAkB;eAHpB;MAKG;MAAa;MAAkB,EAAW,EAAM,CAAgB,CAAC;MAClE,kBAAC,GAAD;OACE,OAAO,EAA2B,CAAY;OAC9C,IAAI;iBAEJ,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;MACzB,CAAA;KACC;;GAEH;;CACV,CAAA;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityActionMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/action_menu/EntityActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA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AAkB,EAAE,eAAe,EAAE,EAAE,CAAA;IACvC,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,QAAQ,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,YAAY,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACvC,mBAAmB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC5C,kBAAkB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;CAC5C,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAElC,mBAAmB,EAAE,sBAAsB,CAAA;IAE3C,iBAAiB,EAAE,oBAAoB,CAAA;IAEvC,MAAM,EAAE,sBAAsB,CAAA;CAC/B,CAAA;AAMD,iBAAS,kBAAkB,CACzB,mBAAmB,EAAE,sBAAsB,EAC3C,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAmBxB;AAED;;;;;GAKG;AACH,iBAAS,4BAA4B,CACnC,KAAK,EAAE,eAAe,EAAE,EACxB,mBAAmB,EAAE,sBAAsB,GAC1C,gBAAgB,EAAE,CAqBpB;AAED;;;;;;GAMG;AACH,iBAAS,sBAAsB,CAC7B,WAAW,EAAE,eAAe,EAAE,EAAE,EAChC,mBAAmB,EAAE,sBAAsB,GAC1C,gBAAgB,EAAE,EAAE,CAYtB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAqJpE;AAED,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAA"}
1
+ {"version":3,"file":"EntityActionMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/action_menu/EntityActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAqB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AQ,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,YAAY,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACvC,mBAAmB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC5C,kBAAkB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;CAC5C,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAElC,mBAAmB,EAAE,sBAAsB,CAAA;IAE3C,iBAAiB,EAAE,oBAAoB,CAAA;IAEvC,MAAM,EAAE,sBAAsB,CAAA;CAC/B,CAAA;AAMD,iBAAS,kBAAkB,CACzB,mBAAmB,EAAE,sBAAsB,EAC3C,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAmBxB;AAED;;;;;GAKG;AACH,iBAAS,4BAA4B,CACnC,KAAK,EAAE,eAAe,EAAE,EACxB,mBAAmB,EAAE,sBAAsB,GAC1C,gBAAgB,EAAE,CAqBpB;AAED;;;;;;GAMG;AACH,iBAAS,sBAAsB,CAC7B,WAAW,EAAE,eAAe,EAAE,EAAE,EAChC,mBAAmB,EAAE,sBAAsB,GAC1C,gBAAgB,EAAE,EAAE,CAYtB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAmJpE;AAED,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityActionMenu.js","names":[],"sources":["../../../../../src/components/entity/page/action_menu/EntityActionMenu.tsx"],"sourcesContent":["import { Box, ButtonProps, SxProps, Theme } from '@mui/material'\nimport { ComplexMenu, ComplexMenuButtonProps } from '../../../menu/ComplexMenu'\nimport IconSvg, { IconName } from '../../../IconSvg/IconSvg'\nimport { DropdownMenuItem, DropdownMenuProps } from '../../../menu/DropdownMenu'\nimport { MouseEvent } from 'react'\nimport { SystemStyleObject } from '@mui/system'\n\nconst outlinedButtonHoverBackgroundColor = 'rgba(0, 0, 0, 0.01)'\n\n// Represents the two types of dropdown menus that will be displayed on the entity page\ntype EntityActionMenuDropdownMenuType = 'DOWNLOAD' | 'PRIMARY'\n\ntype EntityActionMenuDropdownMenuConfiguration = {\n visible: boolean\n tooltipText?: string\n disabled?: boolean\n showFileAccessRequestNotice?: boolean\n}\n\nexport type ActionConfiguration = {\n visible: boolean\n text: string\n disabled?: boolean\n tooltipText?: string\n onClick?: (e: MouseEvent) => void\n href?: string\n}\n\nexport type ActionConfigurationMap = Record<string, ActionConfiguration>\n\nexport type MenuConfigurationMap = Record<\n EntityActionMenuDropdownMenuType,\n EntityActionMenuDropdownMenuConfiguration\n>\n\nexport type ActionViewProps = {\n action: string\n icon?: IconName\n textSx?: SxProps\n iconSx?: SxProps\n variant?: ButtonProps['variant']\n}\n\nexport type EntityActionMenuLayout = {\n buttonActions: ActionViewProps[]\n downloadMenuActions: ActionViewProps[][]\n primaryMenuActions: ActionViewProps[][]\n primaryMenuText: string\n primaryMenuEndIcon: IconName\n primaryMenuEndIconSx?: SxProps\n menuButtonSx?: SystemStyleObject<Theme>\n downloadMenuVariant?: ButtonProps['variant']\n primaryMenuVariant?: ButtonProps['variant']\n}\n\nexport type EntityActionMenuProps = {\n /* Maps a unique action string to a dynamic configuration for that particular action */\n actionConfiguration: ActionConfigurationMap\n /* Maps each dropdown menu to a dynamic configuration for that particular menu */\n menuConfiguration: MenuConfigurationMap\n /* Defines the layout of the actions. Typically depends on just the entity type and area. */\n layout: EntityActionMenuLayout\n}\n\n/*\n * All visible actions should be specified in the layout, but this is not guaranteed at compile time.\n * Find all visible actions in the action configuration that are not in the layout.\n */\nfunction getUnmappedActions(\n actionConfiguration: ActionConfigurationMap,\n layout: EntityActionMenuLayout,\n): ActionConfigurationMap {\n return Object.fromEntries(\n Object.entries(actionConfiguration).filter(([action, config]) => {\n // We don't care about actions that are not configured or should not be visible\n if (!config || !config.visible) {\n return false\n }\n\n const allLayoutActions: ActionViewProps[] = [\n ...layout.buttonActions,\n ...layout.primaryMenuActions.flat(),\n ...layout.downloadMenuActions.flat(),\n ]\n // Action is unmapped if it's visible and the layout doesn't have it\n return !allLayoutActions.some(\n layoutAction => layoutAction.action === action,\n )\n }),\n )\n}\n\n/**\n * Given a group of dropdown menu items and an action configuration,\n * return a list of dropdown menu items with non-visible and non-configured actions removed.\n * @param group\n * @param actionConfiguration\n */\nfunction mapAndFilterItemsInMenuGroup(\n group: ActionViewProps[],\n actionConfiguration: ActionConfigurationMap,\n): DropdownMenuItem[] {\n return group.reduce(\n (itemAcc: DropdownMenuItem[], actionViewProps: ActionViewProps) => {\n const configForAction = actionConfiguration[actionViewProps.action]\n // Only show the item if it's configured + visible\n if (configForAction?.visible) {\n itemAcc.push({\n text: configForAction.text ?? actionViewProps.action,\n onClick: configForAction.onClick,\n href: configForAction.href,\n tooltipText: configForAction.tooltipText,\n disabled: configForAction.disabled,\n icon: actionViewProps.icon,\n textSx: actionViewProps.textSx,\n iconSx: actionViewProps.iconSx,\n })\n }\n return itemAcc\n },\n [],\n )\n}\n\n/**\n * Given a list of groups of dropdown menu actions, returns a list of dropdown menu item\n * groups where non-visible actions have been removed, and groups with no visible actions\n * have been removed.\n * @param menuActions\n * @param actionConfiguration\n */\nfunction mapAndFilterMenuGroups(\n menuActions: ActionViewProps[][],\n actionConfiguration: ActionConfigurationMap,\n): DropdownMenuItem[][] {\n return menuActions.reduce(\n (groupAcc: DropdownMenuItem[][], group: ActionViewProps[]) => {\n const itemGroup = mapAndFilterItemsInMenuGroup(group, actionConfiguration)\n // Only show the group if it contains visible items\n if (itemGroup.length > 0) {\n groupAcc.push(itemGroup)\n }\n return groupAcc\n },\n [],\n )\n}\n\n/**\n * The EntityActionMenu renders a menu that displays the actions that can be invoked on an Entity page.\n */\nexport default function EntityActionMenu(props: EntityActionMenuProps) {\n const { actionConfiguration, menuConfiguration, layout } = props\n\n /*\n * All actions should be specified in the layout, but this is not guaranteed at compile time.\n * Find all visible actions in the action configuration that are not in the layout.\n */\n const unmappedActions = getUnmappedActions(actionConfiguration, layout)\n // Warn if unmapped actions were found and push them on to the layout.\n if (Object.entries(unmappedActions).length > 0) {\n console.warn(\n 'Actions are visible but have not been configured in the layout:',\n Object.entries(unmappedActions).map(entry => entry[0]),\n )\n // Modify the layout: put the unmapped actions in their own group at the top of the menu\n layout.primaryMenuActions.unshift(\n Object.entries(unmappedActions).map(\n (entry): ActionViewProps => ({\n action: entry[0],\n }),\n ),\n )\n }\n\n // Map button actions to a button configuration and omit non-visible actions\n const iconButtonConfigs: ComplexMenuButtonProps[] =\n layout.buttonActions.reduce(\n (acc: ComplexMenuButtonProps[], buttonViewProps: ActionViewProps) => {\n const configForAction = actionConfiguration[buttonViewProps.action]\n if (configForAction?.visible) {\n let onClick = configForAction.onClick\n if (onClick == null && !configForAction.href) {\n console.warn(`No handler registered for ${buttonViewProps.action}`)\n onClick = () => {\n console.warn(\n `No handler registered for ${buttonViewProps.action}`,\n )\n }\n }\n acc.push({\n icon: buttonViewProps.icon as IconName,\n onClick: onClick,\n tooltipText: configForAction.text,\n text: configForAction.text,\n variant: buttonViewProps.variant,\n iconSx: buttonViewProps.iconSx,\n disabled: configForAction.disabled,\n href: configForAction.href,\n })\n }\n return acc\n },\n [],\n )\n\n const downloadMenuConfig: DropdownMenuProps = {\n dropdownButtonText: 'Download Options',\n convertSingleItemToButton: true,\n renderMenuIfNoItems: false,\n variant: layout.downloadMenuVariant,\n showFileAccessRequestNotice:\n menuConfiguration.DOWNLOAD.showFileAccessRequestNotice ?? false,\n paperSx: {\n borderRadius: '5px',\n border: '1px solid #E2E4EA',\n width: '279px',\n padding: '12px 16px',\n },\n elevation: 3,\n buttonTooltip: menuConfiguration.DOWNLOAD.tooltipText,\n buttonProps: {\n disabled: menuConfiguration.DOWNLOAD.disabled,\n endIcon: <IconSvg icon={'expandMore'} wrap={false} />,\n },\n items: mapAndFilterMenuGroups(\n layout.downloadMenuActions,\n actionConfiguration,\n ),\n }\n\n const primaryMenuConfig: DropdownMenuProps = {\n dropdownButtonText: layout.primaryMenuText,\n convertSingleItemToButton: true,\n renderMenuIfNoItems: false,\n variant: layout.primaryMenuVariant,\n buttonProps: {\n endIcon: (\n <IconSvg\n icon={layout.primaryMenuEndIcon}\n wrap={false}\n sx={layout.primaryMenuEndIconSx}\n />\n ),\n },\n items: mapAndFilterMenuGroups(\n layout.primaryMenuActions,\n actionConfiguration,\n ),\n }\n\n const menuButtonSx = layout.menuButtonSx ?? {}\n\n return (\n <Box\n sx={{\n '& .MuiButton-root': {\n borderRadius: '6px',\n fontWeight: 540,\n padding: '8px',\n height: '28px',\n\n '& svg': {\n fontSize: '16px',\n },\n },\n // Optional per-layout overrides (e.g. background/border color for entity\n // menu buttons).\n '& .MuiButton-outlined': {\n ...menuButtonSx,\n\n '&:hover': {\n ...menuButtonSx,\n backgroundColor: outlinedButtonHoverBackgroundColor,\n },\n },\n '& .MuiButton-text': {\n ...menuButtonSx,\n backgroundColor: 'transparent',\n\n '&:hover': {\n ...menuButtonSx,\n backgroundColor: outlinedButtonHoverBackgroundColor,\n textDecoration: 'none',\n },\n },\n '& .MuiButton-root .MuiTypography-root': {\n fontWeight: 540,\n fontSize: '12px',\n lineHeight: '12px',\n letterSpacing: '-0.24px',\n },\n }}\n >\n <ComplexMenu\n iconButtons={iconButtonConfigs}\n dropdownMenus={[primaryMenuConfig, downloadMenuConfig]}\n />\n </Box>\n )\n}\n\nexport const EXPORTED_FOR_UNIT_TESTING = {\n getUnmappedActions,\n mapAndFilterItemsInMenuGroup,\n mapAndFilterMenuGroups,\n}\n"],"mappings":";;;;;AAOA,IAAM,IAAqC;AA6D3C,SAAS,EACP,GACA,GACwB;CACxB,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAmB,EAAE,QAAQ,CAAC,GAAQ,OAE/C,CAAC,KAAU,CAAC,EAAO,UACd,KASF,CAAC;EALN,GAAG,EAAO;EACV,GAAG,EAAO,mBAAmB,KAAK;EAClC,GAAG,EAAO,oBAAoB,KAAK;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A;CACE,CAAA;AAET;AAEA,IAAa,IAA4B;CACvC;CACA;CACA;AACF"}
1
+ {"version":3,"file":"EntityActionMenu.js","names":[],"sources":["../../../../../src/components/entity/page/action_menu/EntityActionMenu.tsx"],"sourcesContent":["import { Box, ButtonProps, SxProps, Theme } from '@mui/material'\nimport { ComplexMenu, ComplexMenuButtonProps } from '../../../menu/ComplexMenu'\nimport IconSvg, { IconName } from '../../../IconSvg/IconSvg'\nimport { DropdownMenuItem, DropdownMenuProps } from '../../../menu/DropdownMenu'\nimport { MouseEvent } from 'react'\nimport { SystemStyleObject } from '@mui/system'\n\nconst outlinedButtonHoverBackgroundColor = 'rgba(0, 0, 0, 0.01)'\n\n// Represents the two types of dropdown menus that will be displayed on the entity page\ntype EntityActionMenuDropdownMenuType = 'DOWNLOAD' | 'PRIMARY'\n\ntype EntityActionMenuDropdownMenuConfiguration = {\n visible: boolean\n tooltipText?: string\n disabled?: boolean\n showFileAccessRequestNotice?: boolean\n}\n\nexport type ActionConfiguration = {\n visible: boolean\n text: string\n disabled?: boolean\n tooltipText?: string\n onClick?: (e: MouseEvent) => void\n href?: string\n}\n\nexport type ActionConfigurationMap = Record<string, ActionConfiguration>\n\nexport type MenuConfigurationMap = Record<\n EntityActionMenuDropdownMenuType,\n EntityActionMenuDropdownMenuConfiguration\n>\n\nexport type ActionViewProps = {\n action: string\n icon?: IconName\n textSx?: SxProps\n iconSx?: SxProps\n variant?: ButtonProps['variant']\n}\n\nexport type EntityActionMenuLayout = {\n buttonActions: ActionViewProps[]\n downloadMenuActions: ActionViewProps[][]\n primaryMenuActions: ActionViewProps[][]\n primaryMenuText: string\n primaryMenuEndIcon: IconName\n primaryMenuEndIconSx?: SxProps\n menuButtonSx?: SystemStyleObject<Theme>\n downloadMenuVariant?: ButtonProps['variant']\n primaryMenuVariant?: ButtonProps['variant']\n}\n\nexport type EntityActionMenuProps = {\n /* Maps a unique action string to a dynamic configuration for that particular action */\n actionConfiguration: ActionConfigurationMap\n /* Maps each dropdown menu to a dynamic configuration for that particular menu */\n menuConfiguration: MenuConfigurationMap\n /* Defines the layout of the actions. Typically depends on just the entity type and area. */\n layout: EntityActionMenuLayout\n}\n\n/*\n * All visible actions should be specified in the layout, but this is not guaranteed at compile time.\n * Find all visible actions in the action configuration that are not in the layout.\n */\nfunction getUnmappedActions(\n actionConfiguration: ActionConfigurationMap,\n layout: EntityActionMenuLayout,\n): ActionConfigurationMap {\n return Object.fromEntries(\n Object.entries(actionConfiguration).filter(([action, config]) => {\n // We don't care about actions that are not configured or should not be visible\n if (!config || !config.visible) {\n return false\n }\n\n const allLayoutActions: ActionViewProps[] = [\n ...layout.buttonActions,\n ...layout.primaryMenuActions.flat(),\n ...layout.downloadMenuActions.flat(),\n ]\n // Action is unmapped if it's visible and the layout doesn't have it\n return !allLayoutActions.some(\n layoutAction => layoutAction.action === action,\n )\n }),\n )\n}\n\n/**\n * Given a group of dropdown menu items and an action configuration,\n * return a list of dropdown menu items with non-visible and non-configured actions removed.\n * @param group\n * @param actionConfiguration\n */\nfunction mapAndFilterItemsInMenuGroup(\n group: ActionViewProps[],\n actionConfiguration: ActionConfigurationMap,\n): DropdownMenuItem[] {\n return group.reduce(\n (itemAcc: DropdownMenuItem[], actionViewProps: ActionViewProps) => {\n const configForAction = actionConfiguration[actionViewProps.action]\n // Only show the item if it's configured + visible\n if (configForAction?.visible) {\n itemAcc.push({\n text: configForAction.text ?? actionViewProps.action,\n onClick: configForAction.onClick,\n href: configForAction.href,\n tooltipText: configForAction.tooltipText,\n disabled: configForAction.disabled,\n icon: actionViewProps.icon,\n textSx: actionViewProps.textSx,\n iconSx: actionViewProps.iconSx,\n })\n }\n return itemAcc\n },\n [],\n )\n}\n\n/**\n * Given a list of groups of dropdown menu actions, returns a list of dropdown menu item\n * groups where non-visible actions have been removed, and groups with no visible actions\n * have been removed.\n * @param menuActions\n * @param actionConfiguration\n */\nfunction mapAndFilterMenuGroups(\n menuActions: ActionViewProps[][],\n actionConfiguration: ActionConfigurationMap,\n): DropdownMenuItem[][] {\n return menuActions.reduce(\n (groupAcc: DropdownMenuItem[][], group: ActionViewProps[]) => {\n const itemGroup = mapAndFilterItemsInMenuGroup(group, actionConfiguration)\n // Only show the group if it contains visible items\n if (itemGroup.length > 0) {\n groupAcc.push(itemGroup)\n }\n return groupAcc\n },\n [],\n )\n}\n\n/**\n * The EntityActionMenu renders a menu that displays the actions that can be invoked on an Entity page.\n */\nexport default function EntityActionMenu(props: EntityActionMenuProps) {\n const { actionConfiguration, menuConfiguration, layout } = props\n\n /*\n * All actions should be specified in the layout, but this is not guaranteed at compile time.\n * Find all visible actions in the action configuration that are not in the layout.\n */\n const unmappedActions = getUnmappedActions(actionConfiguration, layout)\n // Warn if unmapped actions were found and push them on to the layout.\n if (Object.entries(unmappedActions).length > 0) {\n console.warn(\n 'Actions are visible but have not been configured in the layout:',\n Object.entries(unmappedActions).map(entry => entry[0]),\n )\n // Modify the layout: put the unmapped actions in their own group at the top of the menu\n layout.primaryMenuActions.unshift(\n Object.entries(unmappedActions).map((entry): ActionViewProps => ({\n action: entry[0],\n })),\n )\n }\n\n // Map button actions to a button configuration and omit non-visible actions\n const iconButtonConfigs: ComplexMenuButtonProps[] =\n layout.buttonActions.reduce(\n (acc: ComplexMenuButtonProps[], buttonViewProps: ActionViewProps) => {\n const configForAction = actionConfiguration[buttonViewProps.action]\n if (configForAction?.visible) {\n let onClick = configForAction.onClick\n if (onClick == null && !configForAction.href) {\n console.warn(`No handler registered for ${buttonViewProps.action}`)\n onClick = () => {\n console.warn(\n `No handler registered for ${buttonViewProps.action}`,\n )\n }\n }\n acc.push({\n icon: buttonViewProps.icon as IconName,\n onClick: onClick,\n tooltipText: configForAction.text,\n text: configForAction.text,\n variant: buttonViewProps.variant,\n iconSx: buttonViewProps.iconSx,\n disabled: configForAction.disabled,\n href: configForAction.href,\n })\n }\n return acc\n },\n [],\n )\n\n const downloadMenuConfig: DropdownMenuProps = {\n dropdownButtonText: 'Download Options',\n convertSingleItemToButton: true,\n renderMenuIfNoItems: false,\n variant: layout.downloadMenuVariant,\n showFileAccessRequestNotice:\n menuConfiguration.DOWNLOAD.showFileAccessRequestNotice ?? false,\n paperSx: {\n borderRadius: '5px',\n border: '1px solid #E2E4EA',\n width: '279px',\n padding: '12px 16px',\n },\n elevation: 3,\n buttonTooltip: menuConfiguration.DOWNLOAD.tooltipText,\n buttonProps: {\n disabled: menuConfiguration.DOWNLOAD.disabled,\n endIcon: <IconSvg icon={'expandMore'} wrap={false} />,\n },\n items: mapAndFilterMenuGroups(\n layout.downloadMenuActions,\n actionConfiguration,\n ),\n }\n\n const primaryMenuConfig: DropdownMenuProps = {\n dropdownButtonText: layout.primaryMenuText,\n convertSingleItemToButton: true,\n renderMenuIfNoItems: false,\n variant: layout.primaryMenuVariant,\n buttonProps: {\n endIcon: (\n <IconSvg\n icon={layout.primaryMenuEndIcon}\n wrap={false}\n sx={layout.primaryMenuEndIconSx}\n />\n ),\n },\n items: mapAndFilterMenuGroups(\n layout.primaryMenuActions,\n actionConfiguration,\n ),\n }\n\n const menuButtonSx = layout.menuButtonSx ?? {}\n\n return (\n <Box\n sx={{\n '& .MuiButton-root': {\n borderRadius: '6px',\n fontWeight: 540,\n padding: '8px',\n height: '28px',\n\n '& svg': {\n fontSize: '16px',\n },\n },\n // Optional per-layout overrides (e.g. background/border color for entity\n // menu buttons).\n '& .MuiButton-outlined': {\n ...menuButtonSx,\n\n '&:hover': {\n ...menuButtonSx,\n backgroundColor: outlinedButtonHoverBackgroundColor,\n },\n },\n '& .MuiButton-text': {\n ...menuButtonSx,\n backgroundColor: 'transparent',\n\n '&:hover': {\n ...menuButtonSx,\n backgroundColor: outlinedButtonHoverBackgroundColor,\n textDecoration: 'none',\n },\n },\n '& .MuiButton-root .MuiTypography-root': {\n fontWeight: 540,\n fontSize: '12px',\n lineHeight: '12px',\n letterSpacing: '-0.24px',\n },\n }}\n >\n <ComplexMenu\n iconButtons={iconButtonConfigs}\n dropdownMenus={[primaryMenuConfig, downloadMenuConfig]}\n />\n </Box>\n )\n}\n\nexport const EXPORTED_FOR_UNIT_TESTING = {\n getUnmappedActions,\n mapAndFilterItemsInMenuGroup,\n mapAndFilterMenuGroups,\n}\n"],"mappings":";;;;;AAOA,IAAM,IAAqC;AA6D3C,SAAS,EACP,GACA,GACwB;CACxB,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAmB,EAAE,QAAQ,CAAC,GAAQ,OAE/C,CAAC,KAAU,CAAC,EAAO,UACd,KASF,CAAC;EALN,GAAG,EAAO;EACV,GAAG,EAAO,mBAAmB,KAAK;EAClC,GAAG,EAAO,oBAAoB,KAAK;CAG7B,EAAiB,MACvB,MAAgB,EAAa,WAAW,CAC1C,CACD,CACH;AACF;AAQA,SAAS,EACP,GACA,GACoB;CACpB,OAAO,EAAM,QACV,GAA6B,MAAqC;EACjE,IAAM,IAAkB,EAAoB,EAAgB;EAc5D,OAZI,GAAiB,WACnB,EAAQ,KAAK;GACX,MAAM,EAAgB,QAAQ,EAAgB;GAC9C,SAAS,EAAgB;GACzB,MAAM,EAAgB;GACtB,aAAa,EAAgB;GAC7B,UAAU,EAAgB;GAC1B,MAAM,EAAgB;GACtB,QAAQ,EAAgB;GACxB,QAAQ,EAAgB;EAC1B,CAAC,GAEI;CACT,GACA,CAAC,CACH;AACF;AASA,SAAS,EACP,GACA,GACsB;CACtB,OAAO,EAAY,QAChB,GAAgC,MAA6B;EAC5D,IAAM,IAAY,EAA6B,GAAO,CAAmB;EAKzE,OAHI,EAAU,SAAS,KACrB,EAAS,KAAK,CAAS,GAElB;CACT,GACA,CAAC,CACH;AACF;AAKA,SAAwB,EAAiB,GAA8B;CACrE,IAAM,EAAE,wBAAqB,sBAAmB,cAAW,GAMrD,IAAkB,EAAmB,GAAqB,CAAM;CAEtE,AAAI,OAAO,QAAQ,CAAe,EAAE,SAAS,MAC3C,QAAQ,KACN,mEACA,OAAO,QAAQ,CAAe,EAAE,KAAI,MAAS,EAAM,EAAE,CACvD,GAEA,EAAO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,cAAc;IACd,YAAY;IACZ,SAAS;IACT,QAAQ;IAER,SAAS,EACP,UAAU,OACZ;GACF;GAGA,yBAAyB;IACvB,GAAG;IAEH,WAAW;KACT,GAAG;KACH,iBAAiB;IACnB;GACF;GACA,qBAAqB;IACnB,GAAG;IACH,iBAAiB;IAEjB,WAAW;KACT,GAAG;KACH,iBAAiB;KACjB,gBAAgB;IAClB;GACF;GACA,yCAAyC;IACvC,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,eAAe;GACjB;EACF;YAEA,kBAAC,GAAD;GACE,aAAa;GACb,eAAe,CAAC,GAAmB,CAAkB;EACtD,CAAA;CACE,CAAA;AAET;AAEA,IAAa,IAA4B;CACvC;CACA;CACA;AACF"}
@@ -18,7 +18,7 @@ import { useState as m } from "react";
18
18
  import { Box as h, Link as g, Tooltip as _ } from "@mui/material";
19
19
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
20
20
  import { DoiObjectType as se, EntityType as x } from "@sage-bionetworks/synapse-client";
21
- import { InfoTwoTone as S } from "@mui/icons-material";
21
+ import S from "@mui/icons-material/InfoTwoTone";
22
22
  import C from "dayjs";
23
23
  //#region src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx
24
24
  function w(w, T) {
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDataset,\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link, Tooltip } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\nimport { isTable } from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport { useGetQueryResultBundleWithAsyncStatus } from '@/synapse-queries'\nimport { entityTypeToFriendlyName } from '@/utils/functions/EntityTypeUtils'\nimport { UserBadge } from '@/components/UserCard/UserBadge'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport dayjs from 'dayjs'\nimport {\n DATASET_CREATED_BY_TOOLTIP,\n INFO_ICON_SX,\n getTableModifiedOnTooltip,\n getTableModifiedOnAccessibleLabel,\n getTableLastRebuiltTooltip,\n} from '../createdByModifiedByTooltips'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n const entity = bundle?.entity\n const isTableLike = !!entity && isTable(entity)\n const friendlyName = bundle ? entityTypeToFriendlyName(bundle.entityType) : ''\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityId}${versionNumber ? `.${versionNumber}` : ''} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value: <CopyToClipboardString value={doi} href={doi} icon=\"rounded\" />,\n },\n isDoiUsage && {\n key: 'citations',\n title: 'Citations',\n value: (\n <>\n <Link onClick={() => setDataCiteCitationsDialogOpen(true)}>\n {dataCiteUsage.citationCount.toLocaleString()}\n {dataCiteUsage.citationCount == maxCitationCount && '+'}\n </Link>\n <CitationsDialog\n open={dataCiteCitationsDialogOpen}\n onClose={() => setDataCiteCitationsDialogOpen(false)}\n citations={dataCiteUsage.citations}\n />\n </>\n ),\n },\n isMentions && {\n key: 'mentions',\n title: 'Mentions',\n value: (\n <>\n <Link onClick={() => setMentionsDialogOpen(true)}>\n {mentions.length.toLocaleString()}\n </Link>\n <CitationsDialog\n open={mentionsDialogOpen}\n onClose={() => setMentionsDialogOpen(false)}\n citations={mentions}\n title=\"Mentioned in\"\n />\n </>\n ),\n },\n md5 && {\n key: 'fileMd5',\n title: 'MD5',\n value: <CopyToClipboardString value={md5} />,\n },\n !isContainer &&\n storageLocation && {\n key: 'fileStorageLocation',\n title: 'Storage Location',\n value: storageLocation,\n },\n isContainer &&\n uploadDestinationString && {\n key: 'uploadDestination',\n title: 'Upload Destination',\n value: uploadDestinationString,\n },\n endpoint && {\n key: 'externalFileEndpoint',\n title: 'Endpoint',\n value: endpoint,\n },\n externalUrl && {\n key: 'externalUrl',\n title: 'URL',\n value: <Linkify text={externalUrl} />,\n },\n bucket && { key: 'externalFileBucket', title: 'Bucket', value: bucket },\n fileKey && { key: 'externalFileKey', title: 'File Key', value: fileKey },\n downloadAlias && {\n key: 'fileAlias',\n title: 'Alias',\n value: (\n <>\n {'Name when downloaded will be: '}\n <Box sx={{ display: 'inline', fontFamily: 'monospace' }}>\n {downloadAlias}\n </Box>\n </>\n ),\n },\n entity && {\n key: 'createdBy',\n title: 'Created By',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n <UserBadge userId={entity.createdBy} />\n <span>on {formatDate(dayjs(entity.createdOn))}</span>\n {isDataset(entity) && (\n <Tooltip title={DATASET_CREATED_BY_TOOLTIP}>\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Box>\n ),\n },\n entity && {\n key: 'modifiedBy',\n title: isTableLike ? 'Configuration Last Modified' : 'Modified By',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n <UserBadge userId={entity.modifiedBy} />\n <span>on {formatDate(dayjs(entity.modifiedOn))}</span>\n {isTableLike && (\n <Tooltip\n title={getTableModifiedOnTooltip(friendlyName)}\n aria-label={getTableModifiedOnAccessibleLabel(friendlyName)}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Box>\n ),\n },\n tableLastRebuilt && {\n key: 'lastRebuilt',\n title: 'Last Rebuilt On',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip title={getTableLastRebuiltTooltip(friendlyName)}>\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n </Box>\n ),\n },\n ].filter(item => !!item) as EntityProperty[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kBACA,gBACA,0BACA,+BACE,E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,KAAoB;GAClB,KAAK;GACL,OAAO;GACP,OACE,kBAAC,GAAD;IAAK,IAAI;KAAE,SAAS;KAAQ,YAAY;IAAS;cAAjD,CACG,EAAW,EAAM,CAAgB,CAAC,GACnC,kBAAC,GAAD;KAAS,OAAO,EAA2B,CAAY;eACrD,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;IACzB,CAAA,CACN;;EAET;CACF,EAAE,QAAO,MAAQ,CAAC,CAAC,CAAI;AACzB"}
1
+ {"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDataset,\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link, Tooltip } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\nimport { isTable } from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport { useGetQueryResultBundleWithAsyncStatus } from '@/synapse-queries'\nimport { entityTypeToFriendlyName } from '@/utils/functions/EntityTypeUtils'\nimport { UserBadge } from '@/components/UserCard/UserBadge'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport InfoTwoTone from '@mui/icons-material/InfoTwoTone'\nimport dayjs from 'dayjs'\nimport {\n DATASET_CREATED_BY_TOOLTIP,\n INFO_ICON_SX,\n getTableModifiedOnTooltip,\n getTableModifiedOnAccessibleLabel,\n getTableLastRebuiltTooltip,\n} from '../createdByModifiedByTooltips'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n const entity = bundle?.entity\n const isTableLike = !!entity && isTable(entity)\n const friendlyName = bundle ? entityTypeToFriendlyName(bundle.entityType) : ''\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityId}${versionNumber ? `.${versionNumber}` : ''} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value: <CopyToClipboardString value={doi} href={doi} icon=\"rounded\" />,\n },\n isDoiUsage && {\n key: 'citations',\n title: 'Citations',\n value: (\n <>\n <Link onClick={() => setDataCiteCitationsDialogOpen(true)}>\n {dataCiteUsage.citationCount.toLocaleString()}\n {dataCiteUsage.citationCount == maxCitationCount && '+'}\n </Link>\n <CitationsDialog\n open={dataCiteCitationsDialogOpen}\n onClose={() => setDataCiteCitationsDialogOpen(false)}\n citations={dataCiteUsage.citations}\n />\n </>\n ),\n },\n isMentions && {\n key: 'mentions',\n title: 'Mentions',\n value: (\n <>\n <Link onClick={() => setMentionsDialogOpen(true)}>\n {mentions.length.toLocaleString()}\n </Link>\n <CitationsDialog\n open={mentionsDialogOpen}\n onClose={() => setMentionsDialogOpen(false)}\n citations={mentions}\n title=\"Mentioned in\"\n />\n </>\n ),\n },\n md5 && {\n key: 'fileMd5',\n title: 'MD5',\n value: <CopyToClipboardString value={md5} />,\n },\n !isContainer &&\n storageLocation && {\n key: 'fileStorageLocation',\n title: 'Storage Location',\n value: storageLocation,\n },\n isContainer &&\n uploadDestinationString && {\n key: 'uploadDestination',\n title: 'Upload Destination',\n value: uploadDestinationString,\n },\n endpoint && {\n key: 'externalFileEndpoint',\n title: 'Endpoint',\n value: endpoint,\n },\n externalUrl && {\n key: 'externalUrl',\n title: 'URL',\n value: <Linkify text={externalUrl} />,\n },\n bucket && { key: 'externalFileBucket', title: 'Bucket', value: bucket },\n fileKey && { key: 'externalFileKey', title: 'File Key', value: fileKey },\n downloadAlias && {\n key: 'fileAlias',\n title: 'Alias',\n value: (\n <>\n {'Name when downloaded will be: '}\n <Box sx={{ display: 'inline', fontFamily: 'monospace' }}>\n {downloadAlias}\n </Box>\n </>\n ),\n },\n entity && {\n key: 'createdBy',\n title: 'Created By',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n <UserBadge userId={entity.createdBy} />\n <span>on {formatDate(dayjs(entity.createdOn))}</span>\n {isDataset(entity) && (\n <Tooltip title={DATASET_CREATED_BY_TOOLTIP}>\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Box>\n ),\n },\n entity && {\n key: 'modifiedBy',\n title: isTableLike ? 'Configuration Last Modified' : 'Modified By',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n <UserBadge userId={entity.modifiedBy} />\n <span>on {formatDate(dayjs(entity.modifiedOn))}</span>\n {isTableLike && (\n <Tooltip\n title={getTableModifiedOnTooltip(friendlyName)}\n aria-label={getTableModifiedOnAccessibleLabel(friendlyName)}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Box>\n ),\n },\n tableLastRebuilt && {\n key: 'lastRebuilt',\n title: 'Last Rebuilt On',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip title={getTableLastRebuiltTooltip(friendlyName)}>\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n </Box>\n ),\n },\n ].filter(item => !!item) as EntityProperty[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kBACA,gBACA,0BACA,+BACE,EAAqB,GAAU,CAAa,GAC1C,CAAC,IAA6B,KAClC,EAAS,EAAK,GACV,CAAC,IAAoB,KAAyB,EAAS,EAAK,GAC5D,EAAE,MAAM,OAA2B,EACvC;EACE,UAAU;EACV,cAAc,OAAO,OAAO,CAAU;EACtC,wBAAwB;CAC1B,GACA,EAAE,SAAS,EAAY,CACzB,GAEM,IAAS,GAAQ,QACjB,IAAc,CAAC,CAAC,KAAU,EAAQ,CAAM,GACxC,IAAe,IAAS,GAAyB,EAAO,UAAU,IAAI,IAEtE,EAAE,MAAM,MAAqB,EACjC;EACE;EACA,OAAO,EACL,KAAK,iBAAiB,IAAW,IAAgB,IAAI,MAAkB,GAAG,UAC5E;EACA,UAAA;EACA,cAAc;CAChB,GACA,EAAE,SAAS,CAAC,EAAE,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QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,kBAAkB,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,2CAwCtD"}
1
+ {"version":3,"file":"ErrorChip.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorChip.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAA;AAG7F,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,kBAAkB,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,2CAwCtD"}
@@ -2,7 +2,8 @@ import { SignInPrompt as e, YOU_ARE_NOT_AUTHORIZED_MESSAGE as t } from "./ErrorB
2
2
  import { useSynapseContext as n } from "../../utils/context/SynapseContext.js";
3
3
  import { Avatar as r, Chip as i, Tooltip as a } from "@mui/material";
4
4
  import { jsx as o } from "react/jsx-runtime";
5
- import { ErrorOutlined as s, LockOutlined as c } from "@mui/icons-material";
5
+ import s from "@mui/icons-material/ErrorOutlined";
6
+ import c from "@mui/icons-material/LockOutlined";
6
7
  //#region src/components/error/ErrorChip.tsx
7
8
  function l(l) {
8
9
  let { chipText: u, error: d } = l, { isAuthenticated: f } = n(), p = (d.status === 403 || d.status === 401) && !f, m = d.status === 403 && f, h = p ? "warning" : "error", g, _;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorChip.js","names":[],"sources":["../../../src/components/error/ErrorChip.tsx"],"sourcesContent":["import { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { ErrorOutlined, LockOutlined } from '@mui/icons-material'\nimport { Avatar, Chip, Tooltip } from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { SignInPrompt, YOU_ARE_NOT_AUTHORIZED_MESSAGE } from './ErrorBanner'\n\nexport type ErrorChipProps = {\n chipText: string\n error: SynapseClientError\n}\n\n/**\n * A chip component for handling inline errors, where some information can be shown (e.g. an ID) without breaking an entire component.\n * @constructor\n */\nexport default function ErrorChip(props: ErrorChipProps) {\n const { chipText, error } = props\n const { isAuthenticated } = useSynapseContext()\n\n const loginError =\n (error.status === 403 || error.status === 401) && !isAuthenticated\n const accessDenied = error.status === 403 && isAuthenticated\n\n const variant = loginError ? 'warning' : 'error'\n let avatar\n let icon\n if (loginError || accessDenied) {\n avatar = (\n <Avatar sx={{ bgcolor: `${variant}.main` }}>\n <LockOutlined sx={{ color: 'white', width: '18px' }} />\n </Avatar>\n )\n } else {\n icon = loginError || accessDenied ? undefined : <ErrorOutlined />\n }\n let tooltipText\n if (loginError) {\n tooltipText = <SignInPrompt />\n } else if (accessDenied) {\n tooltipText = YOU_ARE_NOT_AUTHORIZED_MESSAGE\n } else {\n tooltipText = error.reason\n }\n\n return (\n <Tooltip title={tooltipText}>\n <Chip\n avatar={avatar}\n color={variant}\n variant=\"outlined\"\n icon={icon}\n label={chipText}\n />\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;AAeA,SAAwB,EAAU,GAAuB;CACvD,IAAM,EAAE,aAAU,aAAU,GACtB,EAAE,uBAAoB,EAAkB,GAExC,KACH,EAAM,WAAW,OAAO,EAAM,WAAW,QAAQ,CAAC,GAC/C,IAAe,EAAM,WAAW,OAAO,GAEvC,IAAU,IAAa,YAAY,SACrC,GACA;CACJ,AAAI,KAAc,IAChB,IACE,kBAAC,GAAD;EAAQ,IAAI,EAAE,SAAS,GAAG,EAAQ,OAAO;YACvC,kBAAC,GAAD,EAAc,IAAI;GAAE,OAAO;GAAS,OAAO;EAAO,EAAI,CAAA;CAChD,CAAA,IAGV,IAAO,KAAc,IAAe,KAAA,IAAY,kBAAC,GAAD,CAAgB,CAAA;CAElE,IAAI;CASJ,OARA,AAKE,IALE,IACY,kBAAC,GAAD,CAAe,CAAA,IACpB,IACK,IAEA,EAAM,QAIpB,kBAAC,GAAD;EAAS,OAAO;YACd,kBAAC,GAAD;GACU;GACR,OAAO;GACP,SAAQ;GACF;GACN,OAAO;EACR,CAAA;CACM,CAAA;AAEb"}
1
+ {"version":3,"file":"ErrorChip.js","names":[],"sources":["../../../src/components/error/ErrorChip.tsx"],"sourcesContent":["import { useSynapseContext } from '@/utils/context/SynapseContext'\nimport ErrorOutlined from '@mui/icons-material/ErrorOutlined'\nimport LockOutlined from '@mui/icons-material/LockOutlined'\nimport { Avatar, Chip, Tooltip } from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { SignInPrompt, YOU_ARE_NOT_AUTHORIZED_MESSAGE } from './ErrorBanner'\n\nexport type ErrorChipProps = {\n chipText: string\n error: SynapseClientError\n}\n\n/**\n * A chip component for handling inline errors, where some information can be shown (e.g. an ID) without breaking an entire component.\n * @constructor\n */\nexport default function ErrorChip(props: ErrorChipProps) {\n const { chipText, error } = props\n const { isAuthenticated } = useSynapseContext()\n\n const loginError =\n (error.status === 403 || error.status === 401) && !isAuthenticated\n const accessDenied = error.status === 403 && isAuthenticated\n\n const variant = loginError ? 'warning' : 'error'\n let avatar\n let icon\n if (loginError || accessDenied) {\n avatar = (\n <Avatar sx={{ bgcolor: `${variant}.main` }}>\n <LockOutlined sx={{ color: 'white', width: '18px' }} />\n </Avatar>\n )\n } else {\n icon = loginError || accessDenied ? undefined : <ErrorOutlined />\n }\n let tooltipText\n if (loginError) {\n tooltipText = <SignInPrompt />\n } else if (accessDenied) {\n tooltipText = YOU_ARE_NOT_AUTHORIZED_MESSAGE\n } else {\n tooltipText = error.reason\n }\n\n return (\n <Tooltip title={tooltipText}>\n <Chip\n avatar={avatar}\n color={variant}\n variant=\"outlined\"\n icon={icon}\n label={chipText}\n />\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;;AAgBA,SAAwB,EAAU,GAAuB;CACvD,IAAM,EAAE,aAAU,aAAU,GACtB,EAAE,uBAAoB,EAAkB,GAExC,KACH,EAAM,WAAW,OAAO,EAAM,WAAW,QAAQ,CAAC,GAC/C,IAAe,EAAM,WAAW,OAAO,GAEvC,IAAU,IAAa,YAAY,SACrC,GACA;CACJ,AAAI,KAAc,IAChB,IACE,kBAAC,GAAD;EAAQ,IAAI,EAAE,SAAS,GAAG,EAAQ,OAAO;YACvC,kBAAC,GAAD,EAAc,IAAI;GAAE,OAAO;GAAS,OAAO;EAAO,EAAI,CAAA;CAChD,CAAA,IAGV,IAAO,KAAc,IAAe,KAAA,IAAY,kBAAC,GAAD,CAAgB,CAAA;CAElE,IAAI;CASJ,OARA,AAKE,IALE,IACY,kBAAC,GAAD,CAAe,CAAA,IACpB,IACK,IAEA,EAAM,QAIpB,kBAAC,GAAD;EAAS,OAAO;YACd,kBAAC,GAAD;GACU;GACR,OAAO;GACP,SAAQ;GACF;GACN,OAAO;EACR,CAAA;CACM,CAAA;AAEb"}
@@ -8,11 +8,11 @@ import { useCallback as s, useRef as c, useState as l } from "react";
8
8
  import { isUndefined as u, omitBy as d } from "lodash-es";
9
9
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
10
10
  import { EntityType as h } from "@sage-bionetworks/synapse-client";
11
- import g from "@mui/material/Typography";
12
- import _ from "@mui/material/TextField";
13
- import v from "@mui/material/Stack";
14
- import y from "@mui/material/Button";
15
- import b from "@mui/icons-material/ExpandMore";
11
+ import g from "@mui/icons-material/ExpandMore";
12
+ import _ from "@mui/material/Typography";
13
+ import v from "@mui/material/TextField";
14
+ import y from "@mui/material/Stack";
15
+ import b from "@mui/material/Button";
16
16
  import x from "@mui/material/Accordion";
17
17
  import S from "@mui/material/AccordionDetails";
18
18
  import C from "@mui/material/AccordionSummary";
@@ -44,23 +44,23 @@ function w(w) {
44
44
  }, [z]), V = s(() => {
45
45
  let e = k.csvPreviewData?.suggestedColumns;
46
46
  e && (F(e.map((e) => d(e, u))), j(1));
47
- }, [k.csvPreviewData, j]), H = /* @__PURE__ */ m(v, {
47
+ }, [k.csvPreviewData, j]), H = /* @__PURE__ */ m(y, {
48
48
  spacing: 2,
49
49
  children: [
50
- /* @__PURE__ */ p(_, {
50
+ /* @__PURE__ */ p(v, {
51
51
  required: !0,
52
52
  label: "Table Name",
53
53
  value: M,
54
54
  onChange: (e) => N(e.target.value),
55
55
  fullWidth: !0
56
56
  }),
57
- /* @__PURE__ */ p(g, {
57
+ /* @__PURE__ */ p(_, {
58
58
  variant: "body1",
59
59
  children: "Use the schema options button to make changes to the columns of the table. Use the create button to finish building the table."
60
60
  }),
61
61
  /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(C, {
62
- expandIcon: /* @__PURE__ */ p(b, {}),
63
- children: /* @__PURE__ */ p(g, {
62
+ expandIcon: /* @__PURE__ */ p(g, {}),
63
+ children: /* @__PURE__ */ p(_, {
64
64
  variant: "headline3",
65
65
  children: "Schema Options"
66
66
  })
@@ -79,7 +79,7 @@ function w(w) {
79
79
  open: T,
80
80
  content: /* @__PURE__ */ m(f, { children: [A === 0 && /* @__PURE__ */ p(i, { workflow: k }), A === 1 && H] }),
81
81
  actions: /* @__PURE__ */ m(f, { children: [
82
- /* @__PURE__ */ p(y, {
82
+ /* @__PURE__ */ p(b, {
83
83
  variant: "outlined",
84
84
  disabled: k.isLoadingPreview,
85
85
  onClick: () => {
@@ -87,17 +87,17 @@ function w(w) {
87
87
  },
88
88
  children: "Cancel"
89
89
  }),
90
- A === 0 && k.step === r.COLUMN_PREVIEW && /* @__PURE__ */ p(y, {
90
+ A === 0 && k.step === r.COLUMN_PREVIEW && /* @__PURE__ */ p(b, {
91
91
  disabled: k.isLoadingPreview,
92
92
  variant: "contained",
93
93
  onClick: V,
94
94
  children: "Next"
95
95
  }),
96
- A === 1 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(y, {
96
+ A === 1 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(b, {
97
97
  variant: "outlined",
98
98
  onClick: () => j(0),
99
99
  children: "Back"
100
- }), /* @__PURE__ */ p(y, {
100
+ }), /* @__PURE__ */ p(b, {
101
101
  variant: "contained",
102
102
  onClick: () => I.current?.submit(),
103
103
  loading: R,
@@ -3,8 +3,8 @@ import t from "./CsvPreview.js";
3
3
  import { useRef as n } from "react";
4
4
  import { Accordion as r, AccordionDetails as i, AccordionSummary as a, Button as o, Stack as s, Typography as c } from "@mui/material";
5
5
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
- import { RefreshTwoTone as d } from "@mui/icons-material";
7
- import f from "@mui/icons-material/ExpandMore";
6
+ import d from "@mui/icons-material/ExpandMore";
7
+ import f from "@mui/icons-material/RefreshTwoTone";
8
8
  //#region src/components/table/CsvPreview/CsvPreviewWithOptions.tsx
9
9
  function p({ fileHandleId: p, csvTableDescriptor: m, onCsvTableDescriptorChange: h, onCsvPreviewDataChange: g, onIsLoadingChange: _ }) {
10
10
  let v = n(null);
@@ -16,7 +16,7 @@ function p({ fileHandleId: p, csvTableDescriptor: m, onCsvTableDescriptorChange:
16
16
  onCsvPreviewDataChange: g,
17
17
  onIsLoadingChange: _
18
18
  }), /* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(a, {
19
- expandIcon: /* @__PURE__ */ l(f, {}),
19
+ expandIcon: /* @__PURE__ */ l(d, {}),
20
20
  children: /* @__PURE__ */ l(c, {
21
21
  variant: "headline3",
22
22
  children: "Show Options"
@@ -26,7 +26,7 @@ function p({ fileHandleId: p, csvTableDescriptor: m, onCsvTableDescriptorChange:
26
26
  ref: v
27
27
  }), /* @__PURE__ */ l(o, {
28
28
  variant: "outlined",
29
- startIcon: /* @__PURE__ */ l(d, {}),
29
+ startIcon: /* @__PURE__ */ l(f, {}),
30
30
  sx: { mt: 2 },
31
31
  onClick: () => {
32
32
  v.current && h(v.current.getFormData());
@@ -1 +1 @@
1
- {"version":3,"file":"CsvPreviewWithOptions.js","names":[],"sources":["../../../../src/components/table/CsvPreview/CsvPreviewWithOptions.tsx"],"sourcesContent":["import { RefreshTwoTone } from '@mui/icons-material'\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore'\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n CsvTableDescriptor,\n UploadToTablePreviewResult,\n} from '@sage-bionetworks/synapse-client'\nimport CsvTableDescriptorForm, {\n CsvTableDescriptorFormHandle,\n} from '@/components/table/CsvTableDescriptorForm/CsvTableDescriptorForm'\nimport { useRef } from 'react'\nimport CsvPreview from '@/components/table/CsvPreview/CsvPreview'\n\nexport type CsvPreviewWithOptionsProps = {\n /** File handle ID of the uploaded CSV, or null if not yet uploaded */\n fileHandleId: string | null\n /** Current CSV parsing configuration */\n csvTableDescriptor: CsvTableDescriptor\n /** Called when the user clicks \"Refresh Preview\" with the form's current values */\n onCsvTableDescriptorChange: (descriptor: CsvTableDescriptor) => void\n /** Called when the CSV preview data is fetched */\n onCsvPreviewDataChange?: (data: UploadToTablePreviewResult) => void\n /** Called when the preview load state changes */\n onIsLoadingChange?: (isLoading: boolean) => void\n}\n\n/**\n * Displays a CSV preview table with expandable parsing options.\n * For upload/preview flows, prefer useCsvUploadPreview with CsvUploadPreviewContent.\n */\nexport default function CsvPreviewWithOptions({\n fileHandleId,\n csvTableDescriptor,\n onCsvTableDescriptorChange,\n onCsvPreviewDataChange,\n onIsLoadingChange,\n}: CsvPreviewWithOptionsProps) {\n const csvDescriptorFormRef = useRef<CsvTableDescriptorFormHandle | null>(null)\n\n return (\n <Stack spacing={2}>\n {fileHandleId && (\n <CsvPreview\n fileHandleId={fileHandleId}\n csvTableDescriptor={csvTableDescriptor}\n onCsvPreviewDataChange={onCsvPreviewDataChange}\n onIsLoadingChange={onIsLoadingChange}\n />\n )}\n <Accordion>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant={'headline3'}>Show Options</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <CsvTableDescriptorForm\n defaultValue={csvTableDescriptor}\n ref={csvDescriptorFormRef}\n />\n <Button\n variant={'outlined'}\n startIcon={<RefreshTwoTone />}\n sx={{ mt: 2 }}\n onClick={() => {\n if (csvDescriptorFormRef.current) {\n onCsvTableDescriptorChange(\n csvDescriptorFormRef.current.getFormData(),\n )\n }\n }}\n >\n Refresh Preview\n </Button>\n </AccordionDetails>\n </Accordion>\n </Stack>\n )\n}\n"],"mappings":";;;;;;;;AAqCA,SAAwB,EAAsB,EAC5C,iBACA,uBACA,+BACA,2BACA,wBAC6B;CAC7B,IAAM,IAAuB,EAA4C,IAAI;CAE7E,OACE,kBAAC,GAAD;EAAO,SAAS;YAAhB,CACG,KACC,kBAAC,GAAD;GACgB;GACM;GACI;GACL;EACpB,CAAA,GAEH,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GAAkB,YAAY,kBAAC,GAAD,CAAiB,CAAA;aAC7C,kBAAC,GAAD;IAAY,SAAS;cAAa;GAAwB,CAAA;EAC1C,CAAA,GAClB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GACE,cAAc;GACd,KAAK;EACN,CAAA,GACD,kBAAC,GAAD;GACE,SAAS;GACT,WAAW,kBAAC,GAAD,CAAiB,CAAA;GAC5B,IAAI,EAAE,IAAI,EAAE;GACZ,eAAe;IACb,AAAI,EAAqB,WACvB,EACE,EAAqB,QAAQ,YAAY,CAC3C;GAEJ;aACD;EAEO,CAAA,CACQ,EAAA,CAAA,CACT,EAAA,CAAA,CACN;;AAEX"}
1
+ {"version":3,"file":"CsvPreviewWithOptions.js","names":[],"sources":["../../../../src/components/table/CsvPreview/CsvPreviewWithOptions.tsx"],"sourcesContent":["import RefreshTwoTone from '@mui/icons-material/RefreshTwoTone'\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore'\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n CsvTableDescriptor,\n UploadToTablePreviewResult,\n} from '@sage-bionetworks/synapse-client'\nimport CsvTableDescriptorForm, {\n CsvTableDescriptorFormHandle,\n} from '@/components/table/CsvTableDescriptorForm/CsvTableDescriptorForm'\nimport { useRef } from 'react'\nimport CsvPreview from '@/components/table/CsvPreview/CsvPreview'\n\nexport type CsvPreviewWithOptionsProps = {\n /** File handle ID of the uploaded CSV, or null if not yet uploaded */\n fileHandleId: string | null\n /** Current CSV parsing configuration */\n csvTableDescriptor: CsvTableDescriptor\n /** Called when the user clicks \"Refresh Preview\" with the form's current values */\n onCsvTableDescriptorChange: (descriptor: CsvTableDescriptor) => void\n /** Called when the CSV preview data is fetched */\n onCsvPreviewDataChange?: (data: UploadToTablePreviewResult) => void\n /** Called when the preview load state changes */\n onIsLoadingChange?: (isLoading: boolean) => void\n}\n\n/**\n * Displays a CSV preview table with expandable parsing options.\n * For upload/preview flows, prefer useCsvUploadPreview with CsvUploadPreviewContent.\n */\nexport default function CsvPreviewWithOptions({\n fileHandleId,\n csvTableDescriptor,\n onCsvTableDescriptorChange,\n onCsvPreviewDataChange,\n onIsLoadingChange,\n}: CsvPreviewWithOptionsProps) {\n const csvDescriptorFormRef = useRef<CsvTableDescriptorFormHandle | null>(null)\n\n return (\n <Stack spacing={2}>\n {fileHandleId && (\n <CsvPreview\n fileHandleId={fileHandleId}\n csvTableDescriptor={csvTableDescriptor}\n onCsvPreviewDataChange={onCsvPreviewDataChange}\n onIsLoadingChange={onIsLoadingChange}\n />\n )}\n <Accordion>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant={'headline3'}>Show Options</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <CsvTableDescriptorForm\n defaultValue={csvTableDescriptor}\n ref={csvDescriptorFormRef}\n />\n <Button\n variant={'outlined'}\n startIcon={<RefreshTwoTone />}\n sx={{ mt: 2 }}\n onClick={() => {\n if (csvDescriptorFormRef.current) {\n onCsvTableDescriptorChange(\n csvDescriptorFormRef.current.getFormData(),\n )\n }\n }}\n >\n Refresh Preview\n </Button>\n </AccordionDetails>\n </Accordion>\n </Stack>\n )\n}\n"],"mappings":";;;;;;;;AAqCA,SAAwB,EAAsB,EAC5C,iBACA,uBACA,+BACA,2BACA,wBAC6B;CAC7B,IAAM,IAAuB,EAA4C,IAAI;CAE7E,OACE,kBAAC,GAAD;EAAO,SAAS;YAAhB,CACG,KACC,kBAAC,GAAD;GACgB;GACM;GACI;GACL;EACpB,CAAA,GAEH,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GAAkB,YAAY,kBAAC,GAAD,CAAiB,CAAA;aAC7C,kBAAC,GAAD;IAAY,SAAS;cAAa;GAAwB,CAAA;EAC1C,CAAA,GAClB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GACE,cAAc;GACd,KAAK;EACN,CAAA,GACD,kBAAC,GAAD;GACE,SAAS;GACT,WAAW,kBAAC,GAAD,CAAiB,CAAA;GAC5B,IAAI,EAAE,IAAI,EAAE;GACZ,eAAe;IACb,AAAI,EAAqB,WACvB,EACE,EAAqB,QAAQ,YAAY,CAC3C;GAEJ;aACD;EAEO,CAAA,CACQ,EAAA,CAAA,CACT,EAAA,CAAA,CACN;;AAEX"}
@@ -20,7 +20,7 @@ import { Box as y, InputLabel as b, MenuItem as x, Select as S, Stack as C, Tool
20
20
  import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
21
21
  import { ColumnTypeEnum as O } from "@sage-bionetworks/synapse-types";
22
22
  import { useQuery as k } from "@tanstack/react-query";
23
- import { InfoOutlined as A } from "@mui/icons-material";
23
+ import A from "@mui/icons-material/InfoOutlined";
24
24
  import { useMeasure as j } from "@react-hookz/web";
25
25
  //#region src/components/widgets/facet-nav/FacetNavPanel.tsx
26
26
  var M = 19, N = 150, P = 300;
@@ -1 +1 @@
1
- {"version":3,"file":"FacetNavPanel.js","names":[],"sources":["../../../../src/components/widgets/facet-nav/FacetNavPanel.tsx"],"sourcesContent":["import StyledFormControl from '@/components/styled/StyledFormControl'\nimport SynapseClient from '@/synapse-client'\nimport { SynapseConstants } from '@/utils'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { getCorrespondingColumnForFacet } from '@/utils/functions/queryUtils'\nimport { InfoOutlined } from '@mui/icons-material'\nimport {\n Box,\n InputLabel,\n MenuItem,\n Select,\n Stack,\n Tooltip,\n} from '@mui/material'\nimport {\n ColumnTypeEnum,\n FacetColumnRequest,\n FacetColumnResultValueCount,\n FacetColumnResultValues,\n} from '@sage-bionetworks/synapse-types'\nimport { useQuery } from '@tanstack/react-query'\nimport type Plotly from 'plotly.js-basic-dist'\nimport { useId, useMemo, useState } from 'react'\nimport { getContrastColorPalette } from '../../ColorGradient/ColorGradient'\nimport { ConfirmationDialog } from '../../ConfirmationDialog/ConfirmationDialog'\nimport loadingScreen from '../../LoadingScreen/LoadingScreen'\nimport Plot from '../../Plot/Plot'\nimport PlotPanelHeader from '../../Plot/PlotPanelHeader'\nimport { useQueryVisualizationContext } from '../../QueryVisualizationWrapper'\nimport { useGetQueryMetadata } from '../../QueryWrapper/useGetQueryMetadata'\nimport { EnumFacetFilter } from '../query-filter/EnumFacetFilter/EnumFacetFilter'\nimport { FacetPlotLegendList } from './FacetPlotLegendList'\nimport { FacetWithLabel, truncate } from './FacetPlotLegendUtils'\nimport { useMeasure } from '@react-hookz/web'\n\nexport type FacetNavPanelProps = {\n applyChangesToGraphSlice: (\n facet: FacetColumnResultValues,\n value: FacetColumnResultValueCount | undefined,\n isSelected: boolean,\n ) => void\n applyChangesToFacetFilter: (facets: FacetColumnRequest[]) => void\n index: number\n facetToPlot: FacetColumnResultValues\n plotType: PlotType\n onSetPlotType: (plotType: PlotType) => void\n onHide: () => void\n isModalView: boolean\n onCloseModal?: () => void\n}\n\nconst maxLabelLength: number = 19\nexport const MAX_PLOT_HEIGHT_PX = 150\nexport const MAX_EXPANDED_PLOT_HEIGHT_PX = 300\n\n// STACKED_HORIZONTAL_BAR corresponds to a bar chart where we just want to show the proportion (like a pie chart)\nexport type PlotType = 'PIE' | 'BAR' | 'STACKED_HORIZONTAL_BAR'\n\nexport type GraphData = {\n data: Plotly.Data[]\n labels: FacetWithLabel[]\n colors: string[]\n}\n\nexport async function extractPlotDataArray(\n facetToPlot: FacetColumnResultValues,\n columnType: ColumnTypeEnum | undefined,\n index: number,\n plotType: PlotType,\n accessToken?: string,\n) {\n const colorPalette = getContrastColorPalette(\n // Use only the odd palette, using the same offset for all plots until palettes are improved.\n // See PORTALS-2916\n 'odd', // index % 2 === 0 ? 'even' : 'odd',\n 0, // Math.floor(index / 2),\n facetToPlot.facetValues.length,\n )\n\n const getLabels = async (\n facetValues: FacetColumnResultValueCount[],\n columnType?: ColumnTypeEnum,\n accessToken?: string,\n ) => {\n const map = new Map<string, string>()\n map.set(\n SynapseConstants.VALUE_NOT_SET,\n SynapseConstants.FRIENDLY_VALUE_NOT_SET,\n )\n // Filter out empties\n const filteredValues = facetValues\n .map(value => value.value)\n .filter(val => val !== SynapseConstants.VALUE_NOT_SET)\n if (\n columnType === ColumnTypeEnum.ENTITYID ||\n columnType === ColumnTypeEnum.ENTITYID_LIST\n ) {\n // TODO: Pagination\n const response = await SynapseClient.getEntityHeadersByIds(\n filteredValues,\n accessToken,\n )\n for (const header of response.results) {\n map.set(header.id, header.name)\n }\n } else if (\n columnType === ColumnTypeEnum.USERID ||\n columnType === ColumnTypeEnum.USERID_LIST\n ) {\n const response = await SynapseClient.getGroupHeadersBatch(\n filteredValues,\n accessToken,\n )\n for (const header of response.children) {\n map.set(header.ownerId, header.userName)\n }\n }\n\n return facetValues.map(facetValue => ({\n facet: facetValue,\n label: getLabel(facetValue, false, map),\n truncatedLabel: getLabel(facetValue, true, map),\n count: facetValue.count,\n }))\n }\n\n const getLabel = (\n facetValue: FacetColumnResultValueCount,\n truncateFlag: boolean,\n labelMap: Map<string, string>,\n ): string => {\n let label = labelMap.get(facetValue.value) ?? facetValue.value\n if (truncateFlag) {\n label = truncate(label, maxLabelLength)!\n }\n return label\n }\n\n const labels = await getLabels(\n facetToPlot.facetValues,\n columnType,\n accessToken,\n )\n const text = labels.map(el => el.truncatedLabel)\n\n const anyFacetsSelected = facetToPlot.facetValues.some(\n value => value.isSelected,\n )\n const selectionAwareColorPalette = anyFacetsSelected\n ? facetToPlot.facetValues.map((facetValue, index) =>\n facetValue.isSelected\n ? colorPalette[index]\n : colorPalette[index]\n .replace('rgb(', 'rgba(')\n .replace(')', ', 0.25)'),\n )\n : colorPalette\n const counts: Plotly.Datum[] = facetToPlot.facetValues.map(\n facet => facet.count,\n )\n let x: Plotly.Datum[] | Plotly.Datum[][] | Plotly.TypedArray | undefined\n\n if (plotType === 'BAR') {\n x = facetToPlot.facetValues.map(\n facet =>\n labels.find(label => label.facet === facet)?.label ?? facet.value,\n )\n } else if (plotType === 'STACKED_HORIZONTAL_BAR') {\n x = counts\n }\n\n let y: Plotly.Datum[] | Plotly.Datum[][] | Plotly.TypedArray | undefined\n if (plotType === 'BAR') {\n y = facetToPlot.facetValues.map(facet => facet.count)\n } else if (plotType === 'STACKED_HORIZONTAL_BAR') {\n y = Array(x?.length).fill('Proportional') // single value for every x value\n }\n\n const singleChartData: Plotly.Data = {\n values: plotType === 'PIE' ? counts : undefined,\n labels: labels.map(el => el.label),\n text,\n x,\n y,\n orientation: plotType === 'STACKED_HORIZONTAL_BAR' ? 'h' : 'v',\n // @ts-expect-error\n facetEnumerationValues: facetToPlot.facetValues.map(\n facetValue => facetValue.value,\n ),\n name: facetToPlot.columnName,\n textposition:\n plotType === 'STACKED_HORIZONTAL_BAR' || plotType === 'BAR'\n ? 'none'\n : 'inside',\n hovertemplate:\n plotType === 'PIE'\n ? '<b>%{text}</b><br>%{value} (%{percent})<br><extra></extra>'\n : '<b>%{text}: </b><br>%{value} <br><extra></extra>',\n textinfo: 'none',\n type: plotType === 'PIE' ? 'pie' : 'bar',\n pull:\n plotType === 'PIE'\n ? facetToPlot.facetValues.map(facetValue =>\n facetValue.isSelected ? 0.1 : 0,\n )\n : undefined,\n selectedpoints: anyFacetsSelected\n ? facetToPlot.facetValues\n .map((facetValue, index) => (facetValue.isSelected ? index : -1))\n .filter(index => index !== -1)\n : undefined,\n selected: { marker: { opacity: 1 } },\n unselected: { marker: { opacity: 0.25 } },\n\n marker: {\n colors: plotType === 'PIE' ? selectionAwareColorPalette : undefined,\n color: plotType === 'PIE' ? undefined : selectionAwareColorPalette,\n },\n }\n const result = {\n data: [singleChartData],\n labels,\n colors:\n plotType === 'PIE'\n ? ((singleChartData as any).marker?.colors as string[])\n : ((singleChartData as any).marker?.color as string[]),\n }\n return result\n}\n\nconst applyFacetFilter = (\n event: Plotly.PlotMouseEvent,\n allFacetValues: FacetColumnResultValues,\n callbackApplyFn: FacetNavPanelProps['applyChangesToGraphSlice'],\n) => {\n if (event.points?.[0]) {\n const plotPointData: any = event.points[0]\n const facetValueClickedValue =\n plotPointData.data.facetEnumerationValues[plotPointData.pointNumber]\n const facetValueClicked = allFacetValues.facetValues.find(\n facet => facet.value === facetValueClickedValue,\n )\n callbackApplyFn(\n allFacetValues,\n facetValueClicked,\n !facetValueClicked!.isSelected,\n )\n }\n}\n\nexport function getPlotStyle(\n parentWidth: number | null | undefined,\n plotType: PlotType,\n maxHeight: number,\n): { width: string; height: string } {\n if (parentWidth != undefined) {\n let quotient = 1\n switch (plotType) {\n case 'BAR':\n quotient = 0.8\n break\n case 'PIE':\n quotient = 0.6\n break\n case 'STACKED_HORIZONTAL_BAR':\n quotient = 1\n break\n }\n const width = parentWidth ? parentWidth * quotient : 200\n let height = plotType === 'PIE' ? width : width / 3\n // max height of .PlotsContainer row col* is 200px, so the effective plot height max is around 150 unless it's expanded\n if (height > maxHeight) {\n height = maxHeight\n }\n return {\n width: `${width}px`,\n height: `${height}px`,\n }\n }\n //else parent width is undefined\n return {\n width: '100%',\n height: `${maxHeight}px`,\n }\n}\n\nfunction FacetNavPanel(props: FacetNavPanelProps) {\n const {\n onHide,\n isModalView,\n applyChangesToGraphSlice,\n index,\n facetToPlot,\n plotType,\n onSetPlotType,\n } = props\n const { accessToken } = useSynapseContext()\n const { data: queryMetadata, isLoading: isLoadingQueryMetadata } =\n useGetQueryMetadata()\n\n const [plotContainerMeasurements, plotContainerRef] =\n useMeasure<HTMLDivElement>()\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n // Wait for a non-zero measured width before rendering the plot.\n // Round width to avoid rebuilds from small pixel fluctuations.\n const plotWidth = plotContainerMeasurements?.width\n ? Math.round(plotContainerMeasurements.width)\n : undefined\n\n const [showModal, setShowModal] = useState(false)\n\n const plotTitle = getColumnDisplayName(\n facetToPlot.columnName,\n facetToPlot.jsonPath,\n )\n\n const columnModel = useMemo(\n () =>\n getCorrespondingColumnForFacet(\n facetToPlot,\n queryMetadata?.columnModels ?? [],\n ),\n [queryMetadata?.columnModels, facetToPlot],\n )\n const columnType = columnModel?.columnType as ColumnTypeEnum\n\n // Plotly.js mutates the layout object it receives, so each component instance\n // must have its own layout object. Sharing a single object across instances\n // (e.g. when the expand modal mounts a second FacetNavPanel) causes Plotly's\n // mutations on one chart to silently corrupt the other. Use useMemo to\n // produce a fresh layout object per instance — do NOT hoist this to module scope.\n const plotLayout = useMemo<Partial<Plotly.Layout>>(\n () => ({\n showlegend: false,\n annotations: [],\n margin: { l: 0, r: 0, b: 0, t: 0, pad: 0 },\n yaxis: {\n visible: plotType === 'BAR',\n showgrid: false,\n automargin: true,\n },\n xaxis: {\n // Show category labels on the x-axis for vertical bar charts in modal view\n visible: isModalView && plotType === 'BAR',\n showgrid: false,\n automargin: true,\n },\n }),\n [isModalView, plotType],\n )\n\n const { data: plotData } = useQuery({\n queryKey: [\n 'extractPlotDataArray',\n facetToPlot,\n columnType,\n index,\n plotType,\n accessToken,\n ],\n\n queryFn: () =>\n extractPlotDataArray(\n facetToPlot,\n columnType,\n index,\n plotType,\n accessToken,\n ),\n\n enabled: !!facetToPlot,\n })\n\n const chartSelectionInputLabelId = useId()\n const filterByInputLabelId = useId()\n\n /* rendering functions */\n const chartSelectionToggle = (\n <StyledFormControl fullWidth>\n <InputLabel id={chartSelectionInputLabelId}>Chart Type</InputLabel>\n <Select\n labelId={chartSelectionInputLabelId}\n label=\"Chart Type\"\n value={plotType}\n onChange={e => {\n onSetPlotType(e.target.value as PlotType)\n }}\n >\n <MenuItem value={'BAR'}>Bar Chart</MenuItem>\n <MenuItem value={'PIE'}>Pie Chart</MenuItem>\n </Select>\n </StyledFormControl>\n )\n\n if (\n (!queryMetadata && isLoadingQueryMetadata) ||\n !facetToPlot ||\n !columnModel\n ) {\n return (\n <div className=\"SRC-loadingContainer SRC-centerContentColumn\">\n {loadingScreen}\n </div>\n )\n } else {\n return (\n <>\n <ConfirmationDialog\n open={showModal}\n onCancel={() => setShowModal(false)}\n title={plotTitle ?? ''}\n content={<FacetNavPanel {...props} isModalView={true} />}\n hasCancelButton={false}\n confirmButtonProps={{ children: 'Apply Filters' }}\n onConfirm={() => setShowModal(false)}\n maxWidth={'md'}\n />\n <div\n role=\"figure\"\n className={`FacetNavPanel${isModalView ? '--expanded' : ''}`}\n >\n {!isModalView && (\n <PlotPanelHeader\n data={queryMetadata}\n isLoading={isLoadingQueryMetadata}\n title={plotTitle}\n facetToPlot={facetToPlot}\n onHide={onHide}\n setShowModal={setShowModal}\n />\n )}\n {isModalView && (\n <Stack\n sx={{\n gap: 2,\n }}\n >\n <StyledFormControl>\n <InputLabel\n id={filterByInputLabelId}\n sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}\n >\n <span>Filter All Data By</span>\n <Tooltip title=\"Selecting items in this dropdown will affect all facets on the Explore page.\">\n <InfoOutlined className=\"SRC-hand-cursor SRC-secondary-text-color\" />\n </Tooltip>\n </InputLabel>\n <EnumFacetFilter\n labelId={filterByInputLabelId}\n facet={facetToPlot}\n containerAs=\"Dropdown\"\n dropdownType=\"SelectBox\"\n />\n </StyledFormControl>\n {chartSelectionToggle}\n </Stack>\n )}\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: '50% 50%',\n alignItems: 'center',\n }}\n role=\"graphics-object\"\n className=\"FacetNavPanel__body\"\n >\n <div ref={plotContainerRef}>\n {plotWidth !== undefined && (\n <Plot\n key={`${facetToPlot.columnName}-${facetToPlot.jsonPath}-${plotType}-${plotWidth}`}\n layout={plotLayout}\n data={plotData?.data ?? []}\n style={getPlotStyle(\n plotWidth,\n plotType,\n isModalView\n ? MAX_EXPANDED_PLOT_HEIGHT_PX\n : MAX_PLOT_HEIGHT_PX,\n )}\n config={{ displayModeBar: false }}\n onClick={evt =>\n applyFacetFilter(evt, facetToPlot, applyChangesToGraphSlice)\n }\n />\n )}\n </div>\n <Box sx={{ alignSelf: 'center' }}>\n <FacetPlotLegendList\n labels={plotData?.labels}\n colors={plotData?.colors}\n isExpanded={isModalView}\n />\n </Box>\n </Box>\n </div>\n </>\n )\n }\n}\n\nexport default FacetNavPanel\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,IAAyB,IAClB,IAAqB,KACrB,IAA8B;AAW3C,eAAsB,EACpB,GACA,GACA,GACA,GACA,GACA;CACA,IAAM,IAAe,EAGnB,OACA,GACA,EAAY,YAAY,MAC1B,GAEM,IAAY,OAChB,GACA,GACA,MACG;EACH,IAAM,oBAAM,IAAI,IAAoB;EACpC,EAAI,IACF,GACA,CACF;EAEA,IAAM,IAAiB,EACpB,KAAI,MAAS,EAAM,KAAK,EACxB,QAAO,MAAO,MAAQ,CAA8B;EACvD,IACE,MAAe,EAAe,YAC9B,MAAe,EAAe,eAC9B;GAEA,IAAM,IAAW,MAAM,EAAc,sBACnC,GACA,CACF;GACA,KAAK,IAAM,KAAU,EAAS,SAC5B,EAAI,IAAI,EAAO,IAAI,EAAO,IAAI;EAElC,OAAO,IACL,MAAe,EAAe,UAC9B,MAAe,EAAe,aAC9B;GACA,IAAM,IAAW,MAAM,EAAc,qBACnC,GACA,CACF;GACA,KAAK,IAAM,KAAU,EAAS,UAC5B,EAAI,IAAI,EAAO,SAAS,EAAO,QAAQ;EAE3C;EAEA,OAAO,EAAY,KAAI,OAAe;GACpC,O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AS,GAAG,GAcvE;IAEA,CAAA,GACL,kBAAC,GAAD;KAAK,IAAI,EAAE,WAAW,SAAS;eAC7B,kBAAC,GAAD;MACE,QAAQ,GAAU;MAClB,QAAQ,GAAU;MAClB,YAAY;KACb,CAAA;IACE,CAAA,CACF;;EACF;GACL,EAAA,CAAA;AAGR"}
1
+ {"version":3,"file":"FacetNavPanel.js","names":[],"sources":["../../../../src/components/widgets/facet-nav/FacetNavPanel.tsx"],"sourcesContent":["import StyledFormControl from '@/components/styled/StyledFormControl'\nimport SynapseClient from '@/synapse-client'\nimport { SynapseConstants } from '@/utils'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { getCorrespondingColumnForFacet } from '@/utils/functions/queryUtils'\nimport InfoOutlined from '@mui/icons-material/InfoOutlined'\nimport {\n Box,\n InputLabel,\n MenuItem,\n Select,\n Stack,\n Tooltip,\n} from '@mui/material'\nimport {\n ColumnTypeEnum,\n FacetColumnRequest,\n FacetColumnResultValueCount,\n FacetColumnResultValues,\n} from '@sage-bionetworks/synapse-types'\nimport { useQuery } from '@tanstack/react-query'\nimport type Plotly from 'plotly.js-basic-dist'\nimport { useId, useMemo, useState } from 'react'\nimport { getContrastColorPalette } from '../../ColorGradient/ColorGradient'\nimport { ConfirmationDialog } from '../../ConfirmationDialog/ConfirmationDialog'\nimport loadingScreen from '../../LoadingScreen/LoadingScreen'\nimport Plot from '../../Plot/Plot'\nimport PlotPanelHeader from '../../Plot/PlotPanelHeader'\nimport { useQueryVisualizationContext } from '../../QueryVisualizationWrapper'\nimport { useGetQueryMetadata } from '../../QueryWrapper/useGetQueryMetadata'\nimport { EnumFacetFilter } from '../query-filter/EnumFacetFilter/EnumFacetFilter'\nimport { FacetPlotLegendList } from './FacetPlotLegendList'\nimport { FacetWithLabel, truncate } from './FacetPlotLegendUtils'\nimport { useMeasure } from '@react-hookz/web'\n\nexport type FacetNavPanelProps = {\n applyChangesToGraphSlice: (\n facet: FacetColumnResultValues,\n value: FacetColumnResultValueCount | undefined,\n isSelected: boolean,\n ) => void\n applyChangesToFacetFilter: (facets: FacetColumnRequest[]) => void\n index: number\n facetToPlot: FacetColumnResultValues\n plotType: PlotType\n onSetPlotType: (plotType: PlotType) => void\n onHide: () => void\n isModalView: boolean\n onCloseModal?: () => void\n}\n\nconst maxLabelLength: number = 19\nexport const MAX_PLOT_HEIGHT_PX = 150\nexport const MAX_EXPANDED_PLOT_HEIGHT_PX = 300\n\n// STACKED_HORIZONTAL_BAR corresponds to a bar chart where we just want to show the proportion (like a pie chart)\nexport type PlotType = 'PIE' | 'BAR' | 'STACKED_HORIZONTAL_BAR'\n\nexport type GraphData = {\n data: Plotly.Data[]\n labels: FacetWithLabel[]\n colors: string[]\n}\n\nexport async function extractPlotDataArray(\n facetToPlot: FacetColumnResultValues,\n columnType: ColumnTypeEnum | undefined,\n index: number,\n plotType: PlotType,\n accessToken?: string,\n) {\n const colorPalette = getContrastColorPalette(\n // Use only the odd palette, using the same offset for all plots until palettes are improved.\n // See PORTALS-2916\n 'odd', // index % 2 === 0 ? 'even' : 'odd',\n 0, // Math.floor(index / 2),\n facetToPlot.facetValues.length,\n )\n\n const getLabels = async (\n facetValues: FacetColumnResultValueCount[],\n columnType?: ColumnTypeEnum,\n accessToken?: string,\n ) => {\n const map = new Map<string, string>()\n map.set(\n SynapseConstants.VALUE_NOT_SET,\n SynapseConstants.FRIENDLY_VALUE_NOT_SET,\n )\n // Filter out empties\n const filteredValues = facetValues\n .map(value => value.value)\n .filter(val => val !== SynapseConstants.VALUE_NOT_SET)\n if (\n columnType === ColumnTypeEnum.ENTITYID ||\n columnType === ColumnTypeEnum.ENTITYID_LIST\n ) {\n // TODO: Pagination\n const response = await SynapseClient.getEntityHeadersByIds(\n filteredValues,\n accessToken,\n )\n for (const header of response.results) {\n map.set(header.id, header.name)\n }\n } else if (\n columnType === ColumnTypeEnum.USERID ||\n columnType === ColumnTypeEnum.USERID_LIST\n ) {\n const response = await SynapseClient.getGroupHeadersBatch(\n filteredValues,\n accessToken,\n )\n for (const header of response.children) {\n map.set(header.ownerId, header.userName)\n }\n }\n\n return facetValues.map(facetValue => ({\n facet: facetValue,\n label: getLabel(facetValue, false, map),\n truncatedLabel: getLabel(facetValue, true, map),\n count: facetValue.count,\n }))\n }\n\n const getLabel = (\n facetValue: FacetColumnResultValueCount,\n truncateFlag: boolean,\n labelMap: Map<string, string>,\n ): string => {\n let label = labelMap.get(facetValue.value) ?? facetValue.value\n if (truncateFlag) {\n label = truncate(label, maxLabelLength)!\n }\n return label\n }\n\n const labels = await getLabels(\n facetToPlot.facetValues,\n columnType,\n accessToken,\n )\n const text = labels.map(el => el.truncatedLabel)\n\n const anyFacetsSelected = facetToPlot.facetValues.some(\n value => value.isSelected,\n )\n const selectionAwareColorPalette = anyFacetsSelected\n ? facetToPlot.facetValues.map((facetValue, index) =>\n facetValue.isSelected\n ? colorPalette[index]\n : colorPalette[index]\n .replace('rgb(', 'rgba(')\n .replace(')', ', 0.25)'),\n )\n : colorPalette\n const counts: Plotly.Datum[] = facetToPlot.facetValues.map(\n facet => facet.count,\n )\n let x: Plotly.Datum[] | Plotly.Datum[][] | Plotly.TypedArray | undefined\n\n if (plotType === 'BAR') {\n x = facetToPlot.facetValues.map(\n facet =>\n labels.find(label => label.facet === facet)?.label ?? facet.value,\n )\n } else if (plotType === 'STACKED_HORIZONTAL_BAR') {\n x = counts\n }\n\n let y: Plotly.Datum[] | Plotly.Datum[][] | Plotly.TypedArray | undefined\n if (plotType === 'BAR') {\n y = facetToPlot.facetValues.map(facet => facet.count)\n } else if (plotType === 'STACKED_HORIZONTAL_BAR') {\n y = Array(x?.length).fill('Proportional') // single value for every x value\n }\n\n const singleChartData: Plotly.Data = {\n values: plotType === 'PIE' ? counts : undefined,\n labels: labels.map(el => el.label),\n text,\n x,\n y,\n orientation: plotType === 'STACKED_HORIZONTAL_BAR' ? 'h' : 'v',\n // @ts-expect-error\n facetEnumerationValues: facetToPlot.facetValues.map(\n facetValue => facetValue.value,\n ),\n name: facetToPlot.columnName,\n textposition:\n plotType === 'STACKED_HORIZONTAL_BAR' || plotType === 'BAR'\n ? 'none'\n : 'inside',\n hovertemplate:\n plotType === 'PIE'\n ? '<b>%{text}</b><br>%{value} (%{percent})<br><extra></extra>'\n : '<b>%{text}: </b><br>%{value} <br><extra></extra>',\n textinfo: 'none',\n type: plotType === 'PIE' ? 'pie' : 'bar',\n pull:\n plotType === 'PIE'\n ? facetToPlot.facetValues.map(facetValue =>\n facetValue.isSelected ? 0.1 : 0,\n )\n : undefined,\n selectedpoints: anyFacetsSelected\n ? facetToPlot.facetValues\n .map((facetValue, index) => (facetValue.isSelected ? index : -1))\n .filter(index => index !== -1)\n : undefined,\n selected: { marker: { opacity: 1 } },\n unselected: { marker: { opacity: 0.25 } },\n\n marker: {\n colors: plotType === 'PIE' ? selectionAwareColorPalette : undefined,\n color: plotType === 'PIE' ? undefined : selectionAwareColorPalette,\n },\n }\n const result = {\n data: [singleChartData],\n labels,\n colors:\n plotType === 'PIE'\n ? ((singleChartData as any).marker?.colors as string[])\n : ((singleChartData as any).marker?.color as string[]),\n }\n return result\n}\n\nconst applyFacetFilter = (\n event: Plotly.PlotMouseEvent,\n allFacetValues: FacetColumnResultValues,\n callbackApplyFn: FacetNavPanelProps['applyChangesToGraphSlice'],\n) => {\n if (event.points?.[0]) {\n const plotPointData: any = event.points[0]\n const facetValueClickedValue =\n plotPointData.data.facetEnumerationValues[plotPointData.pointNumber]\n const facetValueClicked = allFacetValues.facetValues.find(\n facet => facet.value === facetValueClickedValue,\n )\n callbackApplyFn(\n allFacetValues,\n facetValueClicked,\n !facetValueClicked!.isSelected,\n )\n }\n}\n\nexport function getPlotStyle(\n parentWidth: number | null | undefined,\n plotType: PlotType,\n maxHeight: number,\n): { width: string; height: string } {\n if (parentWidth != undefined) {\n let quotient = 1\n switch (plotType) {\n case 'BAR':\n quotient = 0.8\n break\n case 'PIE':\n quotient = 0.6\n break\n case 'STACKED_HORIZONTAL_BAR':\n quotient = 1\n break\n }\n const width = parentWidth ? parentWidth * quotient : 200\n let height = plotType === 'PIE' ? width : width / 3\n // max height of .PlotsContainer row col* is 200px, so the effective plot height max is around 150 unless it's expanded\n if (height > maxHeight) {\n height = maxHeight\n }\n return {\n width: `${width}px`,\n height: `${height}px`,\n }\n }\n //else parent width is undefined\n return {\n width: '100%',\n height: `${maxHeight}px`,\n }\n}\n\nfunction FacetNavPanel(props: FacetNavPanelProps) {\n const {\n onHide,\n isModalView,\n applyChangesToGraphSlice,\n index,\n facetToPlot,\n plotType,\n onSetPlotType,\n } = props\n const { accessToken } = useSynapseContext()\n const { data: queryMetadata, isLoading: isLoadingQueryMetadata } =\n useGetQueryMetadata()\n\n const [plotContainerMeasurements, plotContainerRef] =\n useMeasure<HTMLDivElement>()\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n // Wait for a non-zero measured width before rendering the plot.\n // Round width to avoid rebuilds from small pixel fluctuations.\n const plotWidth = plotContainerMeasurements?.width\n ? Math.round(plotContainerMeasurements.width)\n : undefined\n\n const [showModal, setShowModal] = useState(false)\n\n const plotTitle = getColumnDisplayName(\n facetToPlot.columnName,\n facetToPlot.jsonPath,\n )\n\n const columnModel = useMemo(\n () =>\n getCorrespondingColumnForFacet(\n facetToPlot,\n queryMetadata?.columnModels ?? [],\n ),\n [queryMetadata?.columnModels, facetToPlot],\n )\n const columnType = columnModel?.columnType as ColumnTypeEnum\n\n // Plotly.js mutates the layout object it receives, so each component instance\n // must have its own layout object. Sharing a single object across instances\n // (e.g. when the expand modal mounts a second FacetNavPanel) causes Plotly's\n // mutations on one chart to silently corrupt the other. Use useMemo to\n // produce a fresh layout object per instance — do NOT hoist this to module scope.\n const plotLayout = useMemo<Partial<Plotly.Layout>>(\n () => ({\n showlegend: false,\n annotations: [],\n margin: { l: 0, r: 0, b: 0, t: 0, pad: 0 },\n yaxis: {\n visible: plotType === 'BAR',\n showgrid: false,\n automargin: true,\n },\n xaxis: {\n // Show category labels on the x-axis for vertical bar charts in modal view\n visible: isModalView && plotType === 'BAR',\n showgrid: false,\n automargin: true,\n },\n }),\n [isModalView, plotType],\n )\n\n const { data: plotData } = useQuery({\n queryKey: [\n 'extractPlotDataArray',\n facetToPlot,\n columnType,\n index,\n plotType,\n accessToken,\n ],\n\n queryFn: () =>\n extractPlotDataArray(\n facetToPlot,\n columnType,\n index,\n plotType,\n accessToken,\n ),\n\n enabled: !!facetToPlot,\n })\n\n const chartSelectionInputLabelId = useId()\n const filterByInputLabelId = useId()\n\n /* rendering functions */\n const chartSelectionToggle = (\n <StyledFormControl fullWidth>\n <InputLabel id={chartSelectionInputLabelId}>Chart Type</InputLabel>\n <Select\n labelId={chartSelectionInputLabelId}\n label=\"Chart Type\"\n value={plotType}\n onChange={e => {\n onSetPlotType(e.target.value as PlotType)\n }}\n >\n <MenuItem value={'BAR'}>Bar Chart</MenuItem>\n <MenuItem value={'PIE'}>Pie Chart</MenuItem>\n </Select>\n </StyledFormControl>\n )\n\n if (\n (!queryMetadata && isLoadingQueryMetadata) ||\n !facetToPlot ||\n !columnModel\n ) {\n return (\n <div className=\"SRC-loadingContainer SRC-centerContentColumn\">\n {loadingScreen}\n </div>\n )\n } else {\n return (\n <>\n <ConfirmationDialog\n open={showModal}\n onCancel={() => setShowModal(false)}\n title={plotTitle ?? ''}\n content={<FacetNavPanel {...props} isModalView={true} />}\n hasCancelButton={false}\n confirmButtonProps={{ children: 'Apply Filters' }}\n onConfirm={() => setShowModal(false)}\n maxWidth={'md'}\n />\n <div\n role=\"figure\"\n className={`FacetNavPanel${isModalView ? '--expanded' : ''}`}\n >\n {!isModalView && (\n <PlotPanelHeader\n data={queryMetadata}\n isLoading={isLoadingQueryMetadata}\n title={plotTitle}\n facetToPlot={facetToPlot}\n onHide={onHide}\n setShowModal={setShowModal}\n />\n )}\n {isModalView && (\n <Stack\n sx={{\n gap: 2,\n }}\n >\n <StyledFormControl>\n <InputLabel\n id={filterByInputLabelId}\n sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}\n >\n <span>Filter All Data By</span>\n <Tooltip title=\"Selecting items in this dropdown will affect all facets on the Explore page.\">\n <InfoOutlined className=\"SRC-hand-cursor SRC-secondary-text-color\" />\n </Tooltip>\n </InputLabel>\n <EnumFacetFilter\n labelId={filterByInputLabelId}\n facet={facetToPlot}\n containerAs=\"Dropdown\"\n dropdownType=\"SelectBox\"\n />\n </StyledFormControl>\n {chartSelectionToggle}\n </Stack>\n )}\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: '50% 50%',\n alignItems: 'center',\n }}\n role=\"graphics-object\"\n className=\"FacetNavPanel__body\"\n >\n <div ref={plotContainerRef}>\n {plotWidth !== undefined && (\n <Plot\n key={`${facetToPlot.columnName}-${facetToPlot.jsonPath}-${plotType}-${plotWidth}`}\n layout={plotLayout}\n data={plotData?.data ?? []}\n style={getPlotStyle(\n plotWidth,\n plotType,\n isModalView\n ? MAX_EXPANDED_PLOT_HEIGHT_PX\n : MAX_PLOT_HEIGHT_PX,\n )}\n config={{ displayModeBar: false }}\n onClick={evt =>\n applyFacetFilter(evt, facetToPlot, applyChangesToGraphSlice)\n }\n />\n )}\n </div>\n <Box sx={{ alignSelf: 'center' }}>\n <FacetPlotLegendList\n labels={plotData?.labels}\n colors={plotData?.colors}\n isExpanded={isModalView}\n />\n </Box>\n </Box>\n </div>\n </>\n )\n }\n}\n\nexport default FacetNavPanel\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,IAAyB,IAClB,IAAqB,KACrB,IAA8B;AAW3C,eAAsB,EACpB,GACA,GACA,GACA,GACA,GACA;CACA,IAAM,IAAe,EAGnB,OACA,GACA,EAAY,YAAY,MAC1B,GAEM,IAAY,OAChB,GACA,GACA,MACG;EACH,IAAM,oBAAM,IAAI,IAAoB;EACpC,EAAI,IACF,GACA,CACF;EAEA,IAAM,IAAiB,EACpB,KAAI,MAAS,EAAM,KAAK,EACxB,QAAO,MAAO,MAAQ,CAA8B;EACvD,IACE,MAAe,EAAe,Y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,IAAI;KACF,SAAS;KACT,qBAAqB;KACrB,YAAY;IACd;IACA,MAAK;IACL,WAAU;cAPZ,CASE,kBAAC,OAAD;KAAK,KAAK;eACP,MAAc,KAAA,KACb,kBAAC,GAAD;MAEE,QAAQ;MACR,MAAM,GAAU,QAAQ,CAAC;MACzB,OAAO,EACL,GACA,GACA,IAAA,MAAA,GAGF;MACA,QAAQ,EAAE,gBAAgB,GAAM;MAChC,UAAS,MACP,EAAiB,GAAK,GAAa,CAAwB;KAE9D,GAdM,GAAG,EAAY,WAAW,GAAG,EAAY,SAAS,GAAG,EAAS,GAAG,GAcvE;IAEA,CAAA,GACL,kBAAC,GAAD;KAAK,IAAI,EAAE,WAAW,SAAS;eAC7B,kBAAC,GAAD;MACE,QAAQ,GAAU;MAClB,QAAQ,GAAU;MAClB,YAAY;KACb,CAAA;IACE,CAAA,CACF;;EACF;GACL,EAAA,CAAA;AAGR"}
@@ -1 +1 @@
1
- {"version":3,"file":"NextStepButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/curator/dashboard/components/NextStepButton.tsx"],"names":[],"mappings":"AAOA,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAoBD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CA8DhE"}
1
+ {"version":3,"file":"NextStepButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/curator/dashboard/components/NextStepButton.tsx"],"names":[],"mappings":"AAQA,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAoBD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CA8DhE"}