synapse-react-client 4.0.44 → 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 (415) hide show
  1. package/dist/SWC.index.d.ts +1 -1
  2. package/dist/SWC.index.js +2 -2
  3. package/dist/SWC.index.js.map +1 -1
  4. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +1 -0
  5. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -1
  6. package/dist/aridhia-queries/AridhiaKeyFactory.js +3 -0
  7. package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -1
  8. package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
  9. package/dist/aridhia-queries/index.d.ts +1 -0
  10. package/dist/aridhia-queries/index.d.ts.map +1 -1
  11. package/dist/aridhia-queries/index.js +11 -10
  12. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts +19 -0
  13. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts.map +1 -0
  14. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js +14 -0
  15. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js.map +1 -0
  16. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.d.ts.map +1 -1
  17. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js +6 -4
  18. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js.map +1 -1
  19. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +2 -1
  20. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
  21. package/dist/components/AccessRequirementList/AccessRequirementList.js +126 -125
  22. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  23. package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +1 -1
  24. package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
  25. package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
  26. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +1 -1
  27. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -1
  28. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
  29. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +28 -16
  30. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
  31. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
  32. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +99 -97
  33. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
  34. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +1 -1
  35. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
  36. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +1 -1
  37. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -1
  38. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
  39. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +11 -8
  40. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
  41. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +1 -1
  42. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -1
  43. package/dist/components/AccessRequirementList/RequestDataStep.d.ts +1 -4
  44. package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -1
  45. package/dist/components/AccessRequirementList/RequestDataStep.js +15 -18
  46. package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -1
  47. package/dist/components/AccessTokenPage/AccessTokenPage.js +1 -1
  48. package/dist/components/AccessTokenPage/AccessTokenPage.js.map +1 -1
  49. package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +1 -1
  50. package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
  51. package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -1
  52. package/dist/components/Aridhia/DarWizard/DarSectionForm.js +17 -13
  53. package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -1
  54. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +3 -3
  55. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -1
  56. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +33 -34
  57. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
  58. package/dist/components/Aridhia/fairFormToRjsf.js +1 -1
  59. package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -1
  60. package/dist/components/Authentication/LastLoginInfo.js +1 -1
  61. package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
  62. package/dist/components/CertificationQuiz/CertificationQuiz.js +1 -1
  63. package/dist/components/CertificationQuiz/CertificationQuiz.js.map +1 -1
  64. package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js +1 -1
  65. package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js.map +1 -1
  66. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js +1 -1
  67. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js.map +1 -1
  68. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +6 -6
  69. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  70. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.d.ts.map +1 -1
  71. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js +4 -4
  72. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js.map +1 -1
  73. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +4 -4
  74. package/dist/components/CitationPopover/CitationPopoverContent.js +4 -4
  75. package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
  76. package/dist/components/ComponentCollapse.d.ts.map +1 -1
  77. package/dist/components/ComponentCollapse.js +2 -1
  78. package/dist/components/ComponentCollapse.js.map +1 -1
  79. package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.d.ts.map +1 -1
  80. package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js +52 -49
  81. package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js.map +1 -1
  82. package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
  83. package/dist/components/DataGrid/SynapseGrid.js +231 -219
  84. package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
  85. package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
  86. package/dist/components/DataGrid/SyncGridWithSourceButton.js +5 -4
  87. package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
  88. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
  89. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +7 -5
  90. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
  91. package/dist/components/DataGrid/components/ExportCsvFromGridButton.js +4 -4
  92. package/dist/components/DataGrid/components/ExportCsvFromGridButton.js.map +1 -1
  93. package/dist/components/DataGrid/components/ReorderColumnsButton.js +4 -4
  94. package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
  95. package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
  96. package/dist/components/DataGrid/components/ReorderColumnsDialog.js +12 -8
  97. package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
  98. package/dist/components/DataGrid/components/UploadCsvToGridButton.js +1 -1
  99. package/dist/components/DataGrid/components/UploadCsvToGridButton.js.map +1 -1
  100. package/dist/components/DataGrid/hooks/useGridUndoRedo.js +5 -5
  101. package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
  102. package/dist/components/DataGrid/utils/applyModelChange.js +14 -14
  103. package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
  104. package/dist/components/DataGrid/utils/columnFactory.js +1 -1
  105. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  106. package/dist/components/DataGrid/utils/splitPatch.d.ts.map +1 -1
  107. package/dist/components/DataGrid/utils/splitPatch.js +22 -13
  108. package/dist/components/DataGrid/utils/splitPatch.js.map +1 -1
  109. package/dist/components/DownloadCart/DownloadCartPage.js +1 -1
  110. package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
  111. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
  112. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +2 -1
  113. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  114. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -1
  115. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +1 -3
  116. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
  117. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js +16 -10
  118. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
  119. package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -1
  120. package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
  121. package/dist/components/EntityFinder/EntityFinder.js +4 -4
  122. package/dist/components/EntityFinder/EntityIdTextField.js +1 -1
  123. package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -1
  124. package/dist/components/EntityFinder/tree/VirtualizedTree.d.ts.map +1 -1
  125. package/dist/components/EntityFinder/tree/VirtualizedTree.js +5 -4
  126. package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
  127. package/dist/components/EntityHeaderTable/EntityHeaderTable.js +1 -1
  128. package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
  129. package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
  130. package/dist/components/EntityTreeTable/components/EntityNameCell.js +2 -1
  131. package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
  132. package/dist/components/EntityUpload/FileUploadProgress.d.ts.map +1 -1
  133. package/dist/components/EntityUpload/FileUploadProgress.js +11 -7
  134. package/dist/components/EntityUpload/FileUploadProgress.js.map +1 -1
  135. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.d.ts.map +1 -1
  136. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js +4 -3
  137. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js.map +1 -1
  138. package/dist/components/ExperimentalMode/ExperimentalMode.js +1 -1
  139. package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
  140. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js +1 -1
  141. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js.map +1 -1
  142. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -1
  143. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +2 -1
  144. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -1
  145. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
  146. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +2 -1
  147. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
  148. package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -1
  149. package/dist/components/FormTemplateEditor/FieldLibrary.js +2 -1
  150. package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -1
  151. package/dist/components/FormTemplateEditor/FieldLibraryRow.js +4 -4
  152. package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -1
  153. package/dist/components/FormTemplateEditor/FormStructurePanel.js +1 -1
  154. package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -1
  155. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +1 -1
  156. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -1
  157. package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -1
  158. package/dist/components/FormTemplateEditor/StepCard.js +15 -10
  159. package/dist/components/FormTemplateEditor/StepCard.js.map +1 -1
  160. package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -1
  161. package/dist/components/FormTemplateEditor/StepFieldRow.js +11 -6
  162. package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -1
  163. package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -1
  164. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +2 -1
  165. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -1
  166. package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -1
  167. package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -1
  168. package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.d.ts +9 -0
  169. package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.d.ts.map +1 -0
  170. package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.js +45 -0
  171. package/dist/components/FormTemplateReferenceField/FormTemplatePreviewDialog.js.map +1 -0
  172. package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.d.ts +22 -0
  173. package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.d.ts.map +1 -0
  174. package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.js +139 -0
  175. package/dist/components/FormTemplateReferenceField/FormTemplateReferenceField.js.map +1 -0
  176. package/dist/components/Forum/ForumTable.d.ts +17 -5
  177. package/dist/components/Forum/ForumTable.d.ts.map +1 -1
  178. package/dist/components/Forum/ForumTable.js +94 -77
  179. package/dist/components/Forum/ForumTable.js.map +1 -1
  180. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +45 -45
  181. package/dist/components/GenericCard/PortalDOI/PortalDOI.js +5 -5
  182. package/dist/components/GenericCard/PortalDOI/PortalDOI.js.map +1 -1
  183. package/dist/components/GenericCard/TableRowGenericCard.js +1 -1
  184. package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
  185. package/dist/components/HelpPopover/HelpPopover.js +1 -1
  186. package/dist/components/HelpPopover/HelpPopover.js.map +1 -1
  187. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  188. package/dist/components/IconSvg/IconSvg.js +154 -47
  189. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  190. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.d.ts.map +1 -1
  191. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js +19 -16
  192. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js.map +1 -1
  193. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
  194. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +2 -1
  195. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
  196. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts +9 -0
  197. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts.map +1 -0
  198. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js +21 -0
  199. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js.map +1 -0
  200. package/dist/components/Markdown/MarkdownCollapse.d.ts.map +1 -1
  201. package/dist/components/Markdown/MarkdownCollapse.js +3 -1
  202. package/dist/components/Markdown/MarkdownCollapse.js.map +1 -1
  203. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js +1 -1
  204. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
  205. package/dist/components/OAuthClientManagement/OAuthManagement.js +14 -13
  206. package/dist/components/OAuthClientManagement/OAuthManagement.js.map +1 -1
  207. package/dist/components/PortalList/PortalCard.d.ts.map +1 -1
  208. package/dist/components/PortalList/PortalCard.js +6 -5
  209. package/dist/components/PortalList/PortalCard.js.map +1 -1
  210. package/dist/components/PortalList/PortalList.js +4 -4
  211. package/dist/components/PortalList/PortalList.js.map +1 -1
  212. package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +6 -6
  213. package/dist/components/QueryBuilder/FilterConditionRow.js +4 -4
  214. package/dist/components/QueryCountButton/QueryCountButton.js +5 -5
  215. package/dist/components/QueryCountButton/QueryCountButton.js.map +1 -1
  216. package/dist/components/ReleaseCard/ReleaseCardLarge.js +5 -5
  217. package/dist/components/ReleaseCard/ReleaseCardLarge.js.map +1 -1
  218. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.d.ts.map +1 -1
  219. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +142 -108
  220. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  221. package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.d.ts.map +1 -1
  222. package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.js +15 -15
  223. package/dist/components/SetBasicAccessRequirementFields/AccessorRequirements.js.map +1 -1
  224. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map +1 -1
  225. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js +57 -55
  226. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
  227. package/dist/components/ShareThisPage/ShareThisPage.js +4 -4
  228. package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
  229. package/dist/components/SustainabilityScorecard/DialLayout.js +1 -1
  230. package/dist/components/SustainabilityScorecard/DialLayout.js.map +1 -1
  231. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js +1 -1
  232. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js.map +1 -1
  233. package/dist/components/SynapseChat/SynapseChat.js +1 -1
  234. package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
  235. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
  236. package/dist/components/SynapseChat/SynapseChatInteraction.js +2 -1
  237. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  238. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +1 -1
  239. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -1
  240. package/dist/components/SynapseFooter/SynapseFooter.js +1 -1
  241. package/dist/components/SynapseFooter/SynapseFooter.js.map +1 -1
  242. package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js +1 -1
  243. package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js.map +1 -1
  244. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.d.ts.map +1 -1
  245. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js +2 -1
  246. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js.map +1 -1
  247. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js +4 -4
  248. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js.map +1 -1
  249. package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js +1 -1
  250. package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js.map +1 -1
  251. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
  252. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +4 -1
  253. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
  254. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +1 -1
  255. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
  256. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js +1 -1
  257. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js.map +1 -1
  258. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.d.ts.map +1 -1
  259. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +12 -9
  260. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js.map +1 -1
  261. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +4 -4
  262. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
  263. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +140 -140
  264. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  265. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
  266. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  267. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js +1 -1
  268. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js.map +1 -1
  269. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
  270. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
  271. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +9 -9
  272. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  273. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.d.ts.map +1 -1
  274. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js +6 -4
  275. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js.map +1 -1
  276. package/dist/components/TanStackTable/ColumnHeader.js +1 -1
  277. package/dist/components/TanStackTable/ColumnHeader.js.map +1 -1
  278. package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js +1 -1
  279. package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js.map +1 -1
  280. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.d.ts.map +1 -1
  281. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js +4 -3
  282. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js.map +1 -1
  283. package/dist/components/Webhook/WebhookDashboard.js +1 -1
  284. package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
  285. package/dist/components/dataaccess/AccessRequirementDashboard.js +4 -4
  286. package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
  287. package/dist/components/dataaccess/AccessRequirementTable.js +1 -1
  288. package/dist/components/dataaccess/AccessRequirementTable.js.map +1 -1
  289. package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -1
  290. package/dist/components/dataaccess/EDucTemplateTable.js +13 -11
  291. package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -1
  292. package/dist/components/dataaccess/FormTemplateTable.js +6 -6
  293. package/dist/components/dataaccess/FormTemplateTable.js.map +1 -1
  294. package/dist/components/dataaccess/ReviewerDashboard.js +17 -17
  295. package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
  296. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +4 -4
  297. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
  298. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +4 -1
  299. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
  300. package/dist/components/doi/CreateOrUpdateDoiModal.js +1 -1
  301. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  302. package/dist/components/download_list/DownloadDetails.d.ts.map +1 -1
  303. package/dist/components/download_list/DownloadDetails.js +12 -10
  304. package/dist/components/download_list/DownloadDetails.js.map +1 -1
  305. package/dist/components/entity/metadata/AnnotationsTable.js +1 -1
  306. package/dist/components/entity/metadata/AnnotationsTable.js.map +1 -1
  307. package/dist/components/entity/page/CreatedByModifiedBy.js +1 -1
  308. package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
  309. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
  310. package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
  311. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +1 -1
  312. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  313. package/dist/components/error/ErrorChip.d.ts.map +1 -1
  314. package/dist/components/error/ErrorChip.js +2 -1
  315. package/dist/components/error/ErrorChip.js.map +1 -1
  316. package/dist/components/table/CsvPreview/CreateTableFromCsvDialog.js +14 -14
  317. package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js +4 -4
  318. package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js.map +1 -1
  319. package/dist/components/widgets/facet-nav/FacetNavPanel.js +1 -1
  320. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  321. package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -1
  322. package/dist/features/curator/dashboard/components/NextStepButton.js +7 -6
  323. package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -1
  324. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +8 -8
  325. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
  326. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +4 -4
  327. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
  328. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +4 -4
  329. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
  330. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
  331. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
  332. package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js +4 -4
  333. package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js.map +1 -1
  334. package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js +1 -1
  335. package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js.map +1 -1
  336. package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js +1 -1
  337. package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js.map +1 -1
  338. package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js +10 -10
  339. package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js.map +1 -1
  340. package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js +1 -1
  341. package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js.map +1 -1
  342. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +5 -0
  343. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
  344. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +37 -26
  345. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -1
  346. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +8 -0
  347. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
  348. package/dist/mocks/msw/handlers/aridhiaHandlers.js +52 -41
  349. package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
  350. package/dist/mocks/msw/handlers/discussionHandlers.d.ts.map +1 -1
  351. package/dist/mocks/msw/handlers/discussionHandlers.js +40 -33
  352. package/dist/mocks/msw/handlers/discussionHandlers.js.map +1 -1
  353. package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
  354. package/dist/mocks/msw/handlers/entityHandlers.js +70 -67
  355. package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
  356. package/dist/mocks/msw/handlers/gridHandlers.js +2 -2
  357. package/dist/mocks/msw/handlers/gridHandlers.js.map +1 -1
  358. package/dist/mocks/msw/server.d.ts.map +1 -1
  359. package/dist/mocks/msw/server.js +4 -2
  360. package/dist/mocks/msw/server.js.map +1 -1
  361. package/dist/synapse-client/SynapseClient.d.ts +10 -0
  362. package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
  363. package/dist/synapse-client/SynapseClient.js +486 -482
  364. package/dist/synapse-client/SynapseClient.js.map +1 -1
  365. package/dist/synapse-client/index.js +3 -3
  366. package/dist/synapse-queries/KeyFactory.d.ts +13 -1
  367. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  368. package/dist/synapse-queries/KeyFactory.js +11 -1
  369. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  370. package/dist/synapse-queries/dataaccess/index.js +4 -4
  371. package/dist/synapse-queries/dataaccess/useAccessRequirements.d.ts.map +1 -1
  372. package/dist/synapse-queries/dataaccess/useAccessRequirements.js +4 -1
  373. package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
  374. package/dist/synapse-queries/dataaccess/useEDuc.d.ts +19 -5
  375. package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
  376. package/dist/synapse-queries/dataaccess/useEDuc.js +29 -21
  377. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  378. package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts +12 -0
  379. package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts.map +1 -1
  380. package/dist/synapse-queries/dataaccess/useFormTemplate.js +52 -30
  381. package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -1
  382. package/dist/synapse-queries/forum/useForum.d.ts +5 -1
  383. package/dist/synapse-queries/forum/useForum.d.ts.map +1 -1
  384. package/dist/synapse-queries/forum/useForum.js +23 -1
  385. package/dist/synapse-queries/forum/useForum.js.map +1 -1
  386. package/dist/synapse-queries/index.js +185 -184
  387. package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +5 -3
  388. package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -1
  389. package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +12 -15
  390. package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -1
  391. package/dist/synapse-queries/user/useGetUserChallenges.d.ts.map +1 -1
  392. package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
  393. package/dist/theme/DefaultTheme.d.ts.map +1 -1
  394. package/dist/theme/DefaultTheme.js +4 -1
  395. package/dist/theme/DefaultTheme.js.map +1 -1
  396. package/dist/tsconfig.build.tsbuildinfo +1 -1
  397. package/dist/utils/APIConstants.d.ts.map +1 -1
  398. package/dist/utils/APIConstants.js.map +1 -1
  399. package/dist/utils/AppUtils/AppUtils.js +1 -1
  400. package/dist/utils/AppUtils/AppUtils.js.map +1 -1
  401. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
  402. package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
  403. package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
  404. package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
  405. package/dist/utils/functions/getEndpoint.d.ts +1 -0
  406. package/dist/utils/functions/getEndpoint.d.ts.map +1 -1
  407. package/dist/utils/functions/getEndpoint.js +3 -3
  408. package/dist/utils/functions/getEndpoint.js.map +1 -1
  409. package/dist/utils/types/RequestableAccessRequirement.d.ts +8 -0
  410. package/dist/utils/types/RequestableAccessRequirement.d.ts.map +1 -0
  411. package/dist/utils/types/RequestableAccessRequirement.js +9 -0
  412. package/dist/utils/types/RequestableAccessRequirement.js.map +1 -0
  413. package/package.json +6 -5
  414. package/dist/testutils/ReactQueryMockUtils.js +0 -676
  415. package/dist/testutils/ReactQueryMockUtils.js.map +0 -1
@@ -1,161 +1,173 @@
1
1
  import { spreadSx as e } from "../../theme/spreadSx.js";
2
2
  import { SynapseErrorBoundary as t } from "../error/ErrorBanner.js";
3
- import { useCreateAccessRequirement as n, useGetAccessRequirements as r, useUpdateAccessRequirement as i } from "../../synapse-queries/dataaccess/useAccessRequirements.js";
3
+ import { useCreateAccessRequirement as n, useGetAccessRequirements as ee, useUpdateAccessRequirement as te } from "../../synapse-queries/dataaccess/useAccessRequirements.js";
4
+ import { useGetFeatureFlag as ne } from "../../synapse-queries/featureflags/useGetFeatureFlag.js";
4
5
  import "../../synapse-queries/index.js";
5
6
  import "../error/index.js";
6
- import a from "../TeamSubjectsSelector/index.js";
7
- import o from "../EntitySubjectsSelector/index.js";
8
- import { forwardRef as s, useEffect as ee, useImperativeHandle as c, useMemo as l, useState as u } from "react";
9
- import { Alert as d, Checkbox as te, FormControlLabel as f, Radio as p, RadioGroup as ne, Skeleton as m, Stack as h, TextField as g, Tooltip as _, Typography as v } from "@mui/material";
10
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
11
- import { ACCESS_TYPE as S, MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as C, RestrictableObjectType as w, SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as T } from "@sage-bionetworks/synapse-types";
12
- import { HelpOutlineTwoTone as re } from "@mui/icons-material";
13
- import E from "pluralize";
7
+ import { FeatureFlagEnum as re } from "../../utils/featureflag/FeatureFlags.js";
8
+ import ie from "../TeamSubjectsSelector/index.js";
9
+ import { FormTemplateReferenceField as ae, useFormTemplateReferenceError as oe } from "../FormTemplateReferenceField/FormTemplateReferenceField.js";
10
+ import se from "../EntitySubjectsSelector/index.js";
11
+ import { forwardRef as r, useEffect as ce, useImperativeHandle as le, useMemo as i, useState as a } from "react";
12
+ import { Alert as o, Box as ue, Checkbox as de, FormControlLabel as s, Radio as c, RadioGroup as fe, Skeleton as l, Stack as pe, TextField as u, Tooltip as me, Typography as d } from "@mui/material";
13
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
14
+ import { ACCESS_TYPE as h, JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as g, MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as _, RestrictableObjectType as v, SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as y } from "@sage-bionetworks/synapse-types";
15
+ import b from "@mui/icons-material/HelpOutlineTwoTone";
16
+ import x from "pluralize";
14
17
  //#region src/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.tsx
15
- var D = "Please select at least one resource for this Access Requirement to be associated with.", O = (e) => {
16
- let t = e === w.ENTITY ? "Synapse" : "Team";
17
- return `${t} IDs were specified but not added to the subjects list. Please either clear out the Add ${t} IDs textbox or click the Add ${E(e[0].toUpperCase() + e.slice(1).toLowerCase())} button.`;
18
- }, k = "Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'", A = {
18
+ var S = "Please select at least one resource for this Access Requirement to be associated with.", C = (e) => {
19
+ let t = e === v.ENTITY ? "Synapse" : "Team";
20
+ return `${t} IDs were specified but not added to the subjects list. Please either clear out the Add ${t} IDs textbox or click the Add ${x(e[0].toUpperCase() + e.slice(1).toLowerCase())} button.`;
21
+ }, he = "Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'", w = {
19
22
  variant: "body1",
20
23
  fontWeight: 700
21
24
  };
22
- function ie(e) {
25
+ function ge(e) {
23
26
  switch (e) {
24
- case w.ENTITY: return S.DOWNLOAD;
25
- case w.TEAM: return S.PARTICIPATE;
27
+ case v.ENTITY: return h.DOWNLOAD;
28
+ case v.TEAM: return h.PARTICIPATE;
26
29
  default: throw Error(`RestrictableObjectType ${e} does not have an access type specified.`);
27
30
  }
28
31
  }
29
- var j = s(function(s, S) {
30
- let { subject: E, accessRequirementId: j, onSave: ae, onError: M } = s, N = !E, [P, F] = u(E ? [E] : []), [I, oe] = u(!1), [L, R] = u(null), [z, B] = u(""), [V, H] = u(!1), [U, W] = u(E?.type === w.TEAM ? T : C), [G, K] = u(null), q = (e) => {
31
- K(null), ae(e.id.toString(), e.concreteType);
32
+ var T = r(function(r, h) {
33
+ let { subject: x, accessRequirementId: T, onSave: _e, onError: E } = r, D = !x, [O, k] = a(x ? [x] : []), [A, ve] = a(!1), [j, M] = a(null), [N, P] = a(""), [F, I] = a(!1), [L, R] = a(x?.type === v.TEAM ? y : _), [z, B] = a(null), V = ne(re.ACT_DASHBOARD_FORM_TEMPLATES), [H, U] = a(void 0), [ye, W] = a(!1), G = V && L === g, K = oe(G ? H : void 0), q = (e) => {
34
+ B(null), _e(e.id.toString(), e.concreteType);
32
35
  }, J = (e) => {
33
- K(e.reason), M();
36
+ B(e.reason), E();
34
37
  }, { mutate: Y } = n({
35
38
  onSuccess: (e) => q(e),
36
39
  onError: (e) => J(e)
37
- }), { mutate: X } = i({
40
+ }), { mutate: X } = te({
38
41
  onSuccess: (e) => q(e),
39
42
  onError: (e) => J(e)
40
- }), { data: Z, isLoading: se, error: Q } = r(j, { enabled: !!j });
41
- ee(() => {
42
- Z && (W(Z.concreteType), B(Z.name), F(Z.subjectIds), H(Z.subjectsDefinedByAnnotations));
43
+ }), { data: Z, isLoading: be, error: Q } = ee(T, { enabled: !!T });
44
+ ce(() => {
45
+ Z && (R(Z.concreteType), Z.concreteType === g && U(Z.formTemplateRef), P(Z.name), k(Z.subjectIds), I(Z.subjectsDefinedByAnnotations));
43
46
  }, [Z]);
44
- let $ = l(() => {
45
- if (E) return E.type;
47
+ let $ = i(() => {
48
+ if (x) return x.type;
46
49
  if (Z) {
47
50
  let e = Z.subjectIds;
48
51
  if (e.length > 0) return e[0].type;
49
52
  }
50
- return V ? w.ENTITY : null;
53
+ return F ? v.ENTITY : null;
51
54
  }, [
52
- E,
55
+ x,
53
56
  Z,
54
- V
55
- ]), ce = l(() => {
56
- if (!$) return /* @__PURE__ */ b(y, {});
57
+ F
58
+ ]), xe = i(() => {
59
+ if (!$) return /* @__PURE__ */ p(f, {});
57
60
  function e(e) {
58
- R(null), F(e);
61
+ M(null), k(e);
59
62
  }
60
63
  function t(e) {
61
- R(null), oe(e.trim() !== "");
64
+ M(null), ve(e.trim() !== "");
62
65
  }
63
- if (V) return /* @__PURE__ */ b(y, {});
66
+ if (F) return /* @__PURE__ */ p(f, {});
64
67
  switch ($) {
65
- case w.TEAM: return /* @__PURE__ */ b(a, {
66
- subjects: P,
68
+ case v.TEAM: return /* @__PURE__ */ p(ie, {
69
+ subjects: O,
67
70
  onUpdate: (t) => e(t),
68
71
  onUpdateTeamIDsTextbox: (e) => t(e)
69
72
  });
70
- case w.ENTITY: return /* @__PURE__ */ b(o, {
71
- subjects: P,
73
+ case v.ENTITY: return /* @__PURE__ */ p(se, {
74
+ subjects: O,
72
75
  onUpdate: (t) => e(t),
73
76
  onUpdateEntityIDsTextbox: (e) => t(e)
74
77
  });
75
- default: return console.error(`RestrictableObjectType ${$} does not have a selector implemented.`), /* @__PURE__ */ b(y, {});
78
+ default: return console.error(`RestrictableObjectType ${$} does not have a selector implemented.`), /* @__PURE__ */ p(f, {});
76
79
  }
77
80
  }, [
78
81
  $,
79
- P,
80
- V
82
+ O,
83
+ F
81
84
  ]);
82
- return c(S, () => ({ save() {
83
- let e = N && !Z || !$, t = !V && (I || P.length === 0);
85
+ return le(h, () => ({ save() {
86
+ let e = D && !Z || !$, t = !F && (A || O.length === 0);
84
87
  if (e || t) {
85
- t && !e && (I ? R(O($)) : P.length === 0 && R(D)), M();
88
+ t && !e && (A ? M(C($)) : O.length === 0 && M(S)), E();
89
+ return;
90
+ }
91
+ if (G && K) {
92
+ W(!0), E();
86
93
  return;
87
94
  }
88
- let n = ie($);
89
- N || Y({
90
- concreteType: U,
91
- subjectIds: P,
92
- name: z,
95
+ let n = ge($);
96
+ D || Y({
97
+ concreteType: L,
98
+ subjectIds: O,
99
+ name: N,
93
100
  accessType: n,
94
- subjectsDefinedByAnnotations: V
95
- }), N && Z && X({
101
+ subjectsDefinedByAnnotations: F,
102
+ ...G ? { formTemplateRef: H } : {}
103
+ }), D && Z && X({
96
104
  ...Z,
97
- subjectIds: P,
98
- name: z,
105
+ subjectIds: O,
106
+ name: N,
99
107
  accessType: n,
100
- subjectsDefinedByAnnotations: V
108
+ subjectsDefinedByAnnotations: F,
109
+ ...G ? { formTemplateRef: H } : {}
101
110
  });
102
111
  } }), [
103
- I,
112
+ A,
104
113
  $,
105
- P,
106
- z,
107
- U,
108
- Z,
114
+ O,
109
115
  N,
110
- M,
116
+ L,
117
+ Z,
118
+ D,
119
+ E,
111
120
  Y,
112
121
  X,
113
- V
114
- ]), se || !$ ? /* @__PURE__ */ x(y, { children: [
115
- /* @__PURE__ */ b(m, {
122
+ F,
123
+ G,
124
+ H,
125
+ K
126
+ ]), be || !$ ? /* @__PURE__ */ m(f, { children: [
127
+ /* @__PURE__ */ p(l, {
116
128
  width: 100,
117
129
  height: 30
118
130
  }),
119
- /* @__PURE__ */ b(m, {
131
+ /* @__PURE__ */ p(l, {
120
132
  width: 125,
121
133
  height: 30
122
134
  }),
123
- /* @__PURE__ */ b(m, {
135
+ /* @__PURE__ */ p(l, {
124
136
  width: "100%",
125
- children: /* @__PURE__ */ b(g, {})
137
+ children: /* @__PURE__ */ p(u, {})
126
138
  }),
127
- /* @__PURE__ */ b(m, {
139
+ /* @__PURE__ */ p(l, {
128
140
  width: 100,
129
141
  height: 30
130
142
  }),
131
- /* @__PURE__ */ b(m, {
143
+ /* @__PURE__ */ p(l, {
132
144
  width: "100%",
133
- children: /* @__PURE__ */ b(g, {})
145
+ children: /* @__PURE__ */ p(u, {})
134
146
  })
135
- ] }) : Q ? /* @__PURE__ */ b(d, {
147
+ ] }) : Q ? /* @__PURE__ */ p(o, {
136
148
  severity: "error",
137
149
  children: Q.reason
138
- }) : /* @__PURE__ */ x(y, { children: [
139
- /* @__PURE__ */ b(v, {
140
- ...A,
150
+ }) : /* @__PURE__ */ m(f, { children: [
151
+ /* @__PURE__ */ p(d, {
152
+ ...w,
141
153
  children: "Resources"
142
154
  }),
143
- $ !== w.TEAM && /* @__PURE__ */ b(f, {
144
- control: /* @__PURE__ */ b(te, {}),
155
+ $ !== v.TEAM && /* @__PURE__ */ p(s, {
156
+ control: /* @__PURE__ */ p(de, {}),
145
157
  label: "Associated entities should be defined by annotations (DUO)",
146
- checked: V,
158
+ checked: F,
147
159
  onChange: () => {
148
- R(null);
160
+ M(null);
149
161
  let e = [];
150
- V && (Z ? e = Z.subjectIds : E && (e = [E])), F(e), H(!V);
162
+ F && (Z ? e = Z.subjectIds : x && (e = [x])), k(e), I(!F);
151
163
  }
152
164
  }),
153
- /* @__PURE__ */ b(t, { children: ce }),
154
- L && /* @__PURE__ */ b(d, {
165
+ /* @__PURE__ */ p(t, { children: xe }),
166
+ j && /* @__PURE__ */ p(o, {
155
167
  severity: "error",
156
- children: L
168
+ children: j
157
169
  }),
158
- /* @__PURE__ */ x(h, {
170
+ /* @__PURE__ */ m(pe, {
159
171
  direction: "row",
160
172
  sx: {
161
173
  gap: 1,
@@ -163,50 +175,72 @@ var j = s(function(s, S) {
163
175
  mb: 1,
164
176
  mt: 2
165
177
  },
166
- children: [/* @__PURE__ */ b(v, {
178
+ children: [/* @__PURE__ */ p(d, {
167
179
  component: "label",
168
180
  htmlFor: "arName",
169
- ...A,
181
+ ...w,
170
182
  children: "Name"
171
- }), /* @__PURE__ */ b(_, {
172
- title: k,
183
+ }), /* @__PURE__ */ p(me, {
184
+ title: he,
173
185
  placement: "right",
174
- children: /* @__PURE__ */ b(re, { sx: { color: "grey.600" } })
186
+ children: /* @__PURE__ */ p(b, { sx: { color: "grey.600" } })
175
187
  })]
176
188
  }),
177
- /* @__PURE__ */ b(g, {
189
+ /* @__PURE__ */ p(u, {
178
190
  id: "arName",
179
191
  name: "arName",
180
- value: z,
192
+ value: N,
181
193
  placeholder: "Access requirement name",
182
194
  fullWidth: !0,
183
- onChange: (e) => B(e.target.value)
195
+ onChange: (e) => P(e.target.value)
184
196
  }),
185
- !N && $ !== w.TEAM && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(v, {
186
- ...A,
187
- sx: e({ mt: 2 }, A.sx),
197
+ !D && $ !== v.TEAM && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
198
+ ...w,
199
+ sx: e({ mt: 2 }, w.sx),
188
200
  children: "Access requirement type"
189
- }), /* @__PURE__ */ x(ne, {
190
- value: U,
191
- onChange: (e, t) => W(t),
192
- children: [/* @__PURE__ */ b(f, {
193
- value: C,
194
- control: /* @__PURE__ */ b(p, {}),
195
- label: "Controlled - requests are in Synapse"
196
- }), /* @__PURE__ */ b(f, {
197
- value: T,
198
- control: /* @__PURE__ */ b(p, {}),
199
- label: "Click wrap"
200
- })]
201
+ }), /* @__PURE__ */ m(fe, {
202
+ value: L,
203
+ onChange: (e, t) => R(t),
204
+ children: [
205
+ /* @__PURE__ */ p(s, {
206
+ value: _,
207
+ control: /* @__PURE__ */ p(c, {}),
208
+ label: "Controlled - requests are in Synapse"
209
+ }),
210
+ /* @__PURE__ */ p(s, {
211
+ value: y,
212
+ control: /* @__PURE__ */ p(c, {}),
213
+ label: "Click wrap"
214
+ }),
215
+ V && /* @__PURE__ */ p(s, {
216
+ value: g,
217
+ control: /* @__PURE__ */ p(c, {}),
218
+ label: "Schema-driven - requests are in Synapse, using a form template"
219
+ })
220
+ ]
201
221
  })] }),
202
- G && /* @__PURE__ */ b(d, {
222
+ G && /* @__PURE__ */ m(ue, {
223
+ sx: { mt: 2 },
224
+ children: [/* @__PURE__ */ p(d, {
225
+ ...w,
226
+ sx: e({ mb: 1 }, w.sx),
227
+ children: "Form presented to requesters"
228
+ }), /* @__PURE__ */ p(ae, {
229
+ value: H,
230
+ onChange: (e) => {
231
+ W(!1), U(e);
232
+ },
233
+ error: ye ? K : null
234
+ })]
235
+ }),
236
+ z && /* @__PURE__ */ p(o, {
203
237
  severity: "error",
204
238
  sx: { marginTop: 2 },
205
- children: G
239
+ children: z
206
240
  })
207
241
  ] });
208
242
  });
209
243
  //#endregion
210
- export { D as EMPTY_SUBJECT_LIST_ERROR_MESSAGE, j as SetAccessRequirementCommonFields, O as UNSAVED_SUBJECTS_ERROR_MESSAGE };
244
+ export { S as EMPTY_SUBJECT_LIST_ERROR_MESSAGE, T as SetAccessRequirementCommonFields, C as UNSAVED_SUBJECTS_ERROR_MESSAGE };
211
245
 
212
246
  //# sourceMappingURL=SetAccessRequirementCommonFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SetAccessRequirementCommonFields.js","names":[],"sources":["../../../src/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.tsx"],"sourcesContent":["import {\n useCreateAccessRequirement,\n useGetAccessRequirements,\n useUpdateAccessRequirement,\n} from '@/synapse-queries'\nimport { spreadSx } from '@/theme/spreadSx'\nimport { HelpOutlineTwoTone } from '@mui/icons-material'\nimport {\n Alert,\n Checkbox,\n FormControlLabel,\n Radio,\n RadioGroup,\n Skeleton,\n Stack,\n TextField,\n Tooltip,\n Typography,\n TypographyProps,\n} from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ACCESS_TYPE,\n AccessRequirement,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n RestrictableObjectDescriptor,\n RestrictableObjectType,\n SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport pluralize from 'pluralize'\nimport {\n ForwardedRef,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\nimport EntitySubjectsSelector from '../EntitySubjectsSelector'\nimport { SynapseErrorBoundary } from '../error'\nimport TeamSubjectsSelector from '../TeamSubjectsSelector'\n\nexport const EMPTY_SUBJECT_LIST_ERROR_MESSAGE =\n 'Please select at least one resource for this Access Requirement to be associated with.'\nexport const UNSAVED_SUBJECTS_ERROR_MESSAGE = (\n subjectsType: RestrictableObjectType,\n) => {\n const idsText =\n subjectsType === RestrictableObjectType.ENTITY ? 'Synapse' : 'Team'\n const typeText =\n subjectsType[0].toUpperCase() + subjectsType.slice(1).toLowerCase()\n return `${idsText} IDs were specified but not added to the subjects list. Please either clear out the Add ${idsText} IDs textbox or click the Add ${pluralize(\n typeText,\n )} button.`\n}\nconst NAME_HELP_TEXT =\n \"Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'\"\n\nconst headerProps: Partial<TypographyProps> = {\n variant: 'body1',\n fontWeight: 700,\n}\n\nfunction getAccessType(subjectType: RestrictableObjectType) {\n switch (subjectType) {\n case RestrictableObjectType.ENTITY:\n return ACCESS_TYPE.DOWNLOAD\n case RestrictableObjectType.TEAM:\n return ACCESS_TYPE.PARTICIPATE\n default:\n throw new Error(\n `RestrictableObjectType ${subjectType} does not have an access type specified.`,\n )\n }\n}\n\nexport type SetAccessRequirementCommonFieldsHandle = {\n /* Allow the parent component to trigger saving the AR, so this may be embedded in an arbitrary modal. */\n save: () => void\n}\n\nexport type SetAccessRequirementCommonFieldsProps = {\n /* Provided when creating a new AR */\n subject?: RestrictableObjectDescriptor\n /* Provided when editing an existing AR */\n accessRequirementId?: string\n /* Called when AR has been saved successfully */\n onSave: (\n accessRequirementId: string,\n accessRequirementConreteType: ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ) => void\n /* Called when error saving AR */\n onError: () => void\n}\n\nexport const SetAccessRequirementCommonFields = forwardRef(\n function SetAccessRequirementCommonFields(\n props: SetAccessRequirementCommonFieldsProps,\n ref: ForwardedRef<SetAccessRequirementCommonFieldsHandle>,\n ) {\n const { subject, accessRequirementId, onSave, onError } = props\n\n const isEditing = !subject\n\n const [subjects, setSubjects] = useState<RestrictableObjectDescriptor[]>(\n subject ? [subject] : [],\n )\n const [hasPendingSubjects, setHasPendingSubjects] = useState<boolean>(false)\n const [subjectsError, setSubjectsError] = useState<string | null>(null)\n const [name, setName] = useState<string>('')\n const [subjectsDefinedByAnnotations, setSubjectsDefinedByAnnotations] =\n useState<boolean>(false)\n const [arType, setArType] = useState<ACCESS_REQUIREMENT_CONCRETE_TYPE>(\n subject?.type === RestrictableObjectType.TEAM\n ? SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n : MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n )\n const [clientError, setClientError] = useState<string | null>(null)\n\n const onMutationSuccess = (ar: AccessRequirement) => {\n setClientError(null)\n onSave(ar.id.toString(), ar.concreteType)\n }\n\n const onMutationError = (error: SynapseClientError) => {\n setClientError(error.reason)\n onError()\n }\n\n const { mutate: createAccessRequirement } = useCreateAccessRequirement({\n onSuccess: newAr => onMutationSuccess(newAr),\n onError: error => onMutationError(error),\n })\n\n const { mutate: updateAccessRequirement } = useUpdateAccessRequirement({\n onSuccess: updatedAr => onMutationSuccess(updatedAr),\n onError: error => onMutationError(error),\n })\n\n const {\n data: accessRequirement,\n isLoading: isLoadingAr,\n error: getArError,\n } = useGetAccessRequirements(accessRequirementId!, {\n enabled: Boolean(accessRequirementId),\n })\n\n useEffect(() => {\n if (accessRequirement) {\n setArType(accessRequirement.concreteType)\n setName(accessRequirement.name)\n setSubjects(accessRequirement.subjectIds)\n setSubjectsDefinedByAnnotations(\n accessRequirement.subjectsDefinedByAnnotations,\n )\n }\n }, [accessRequirement])\n\n const subjectsType = useMemo(() => {\n if (subject) {\n return subject.type\n }\n if (accessRequirement) {\n const initialSubjects = accessRequirement.subjectIds\n if (initialSubjects.length > 0) {\n return initialSubjects[0].type\n }\n }\n if (subjectsDefinedByAnnotations) {\n return RestrictableObjectType.ENTITY\n }\n return null\n }, [subject, accessRequirement, subjectsDefinedByAnnotations])\n\n const selectorContent = useMemo(() => {\n if (!subjectsType) return <></>\n\n function onUpdate(subjects: RestrictableObjectDescriptor[]) {\n setSubjectsError(null)\n setSubjects(subjects)\n }\n\n function onUpdateIdsTextbox(value: string) {\n setSubjectsError(null)\n setHasPendingSubjects(value.trim() !== '')\n }\n\n if (subjectsDefinedByAnnotations) {\n return <></>\n }\n switch (subjectsType) {\n case RestrictableObjectType.TEAM:\n return (\n <TeamSubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateTeamIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n case RestrictableObjectType.ENTITY:\n return (\n <EntitySubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateEntityIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n default:\n console.error(\n `RestrictableObjectType ${subjectsType} does not have a selector implemented.`,\n )\n return <></>\n }\n }, [subjectsType, subjects, subjectsDefinedByAnnotations])\n\n useImperativeHandle(ref, () => {\n return {\n save() {\n const isStillLoading =\n (isEditing && !accessRequirement) || !subjectsType\n const hasSubjectsError =\n !subjectsDefinedByAnnotations &&\n (hasPendingSubjects || subjects.length === 0)\n if (isStillLoading || hasSubjectsError) {\n if (hasSubjectsError && !isStillLoading) {\n if (hasPendingSubjects) {\n setSubjectsError(UNSAVED_SUBJECTS_ERROR_MESSAGE(subjectsType))\n } else if (subjects.length === 0) {\n setSubjectsError(EMPTY_SUBJECT_LIST_ERROR_MESSAGE)\n }\n }\n\n onError()\n return\n }\n\n const newAccessType = getAccessType(subjectsType)\n if (!isEditing) {\n const newAr: Partial<AccessRequirement> = {\n concreteType: arType,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n }\n createAccessRequirement(newAr)\n }\n\n if (isEditing && accessRequirement) {\n updateAccessRequirement({\n ...accessRequirement,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n })\n }\n },\n }\n }, [\n hasPendingSubjects,\n subjectsType,\n subjects,\n name,\n arType,\n accessRequirement,\n isEditing,\n onError,\n createAccessRequirement,\n updateAccessRequirement,\n subjectsDefinedByAnnotations,\n ])\n\n if (isLoadingAr || !subjectsType) {\n return (\n <>\n <Skeleton width={100} height={30} />\n <Skeleton width={125} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n <Skeleton width={100} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n </>\n )\n }\n\n if (getArError) {\n return <Alert severity=\"error\">{getArError.reason}</Alert>\n }\n\n return (\n <>\n <Typography {...headerProps}>Resources</Typography>\n {subjectsType !== RestrictableObjectType.TEAM && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Associated entities should be defined by annotations (DUO)\"\n checked={subjectsDefinedByAnnotations}\n onChange={() => {\n setSubjectsError(null)\n // if we are switching from DUO to manually defining the subjects (and the AR has been retrieved), then\n // reset to the AR subject IDs or the original subject ID. Otherwise, clear out the subjects.\n let newSubjectIds: RestrictableObjectDescriptor[] = []\n if (subjectsDefinedByAnnotations) {\n if (accessRequirement) {\n newSubjectIds = accessRequirement.subjectIds\n } else if (subject) {\n newSubjectIds = [subject]\n }\n }\n setSubjects(newSubjectIds)\n setSubjectsDefinedByAnnotations(!subjectsDefinedByAnnotations)\n }}\n />\n )}\n <SynapseErrorBoundary>{selectorContent}</SynapseErrorBoundary>\n {subjectsError && <Alert severity=\"error\">{subjectsError}</Alert>}\n <Stack\n direction=\"row\"\n sx={{\n gap: 1,\n alignItems: 'center',\n mb: 1,\n mt: 2,\n }}\n >\n <Typography component=\"label\" htmlFor=\"arName\" {...headerProps}>\n Name\n </Typography>\n <Tooltip title={NAME_HELP_TEXT} placement=\"right\">\n <HelpOutlineTwoTone sx={{ color: 'grey.600' }} />\n </Tooltip>\n </Stack>\n <TextField\n id=\"arName\"\n name=\"arName\"\n value={name}\n placeholder=\"Access requirement name\"\n fullWidth\n onChange={event => setName(event.target.value)}\n />\n {!isEditing && subjectsType !== RestrictableObjectType.TEAM && (\n <>\n <Typography\n {...headerProps}\n sx={spreadSx(\n {\n mt: 2,\n },\n headerProps.sx,\n )}\n >\n Access requirement type\n </Typography>\n <RadioGroup\n value={arType}\n onChange={(_event, value) =>\n setArType(value as ACCESS_REQUIREMENT_CONCRETE_TYPE)\n }\n >\n <FormControlLabel\n value={MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Controlled - requests are in Synapse\"\n />\n <FormControlLabel\n value={SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Click wrap\"\n />\n </RadioGroup>\n </>\n )}\n {clientError && (\n <Alert severity=\"error\" sx={{ marginTop: 2 }}>\n {clientError}\n </Alert>\n )}\n </>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AA2CA,IAAa,IACX,0FACW,KACX,MACG;CACH,IAAM,IACJ,MAAiB,EAAuB,SAAS,YAAY;CAG/D,OAAO,GAAG,EAAQ,0FAA0F,EAAQ,gCAAgC,EADlJ,EAAa,GAAG,YAAY,IAAI,EAAa,MAAM,CAAC,EAAE,YAAY,CAGpE,EAAE;AACJ,GACM,IACJ,iMAEI,IAAwC;CAC5C,SAAS;CACT,YAAY;AACd;AAEA,SAAS,GAAc,GAAqC;CAC1D,QAAQ,GAAR;EACE,KAAK,EAAuB,QAC1B,OAAO,EAAY;EACrB,KAAK,EAAuB,MAC1B,OAAO,EAAY;EACrB,SACE,MAAU,MACR,0BAA0B,EAAY,yCACxC;CACJ;AACF;AAqBA,IAAa,IAAmC,EAC9C,SACE,GACA,GACA;CACA,IAAM,EAAE,YAAS,wBAAqB,YAAQ,eAAY,GAEpD,IAAY,CAAC,GAEb,CAAC,GAAU,KAAe,EAC9B,IAAU,CAAC,CAAO,IAAI,CAAC,CACzB,GACM,CAAC,GAAoB,MAAyB,EAAkB,EAAK,GACrE,CAAC,GAAe,KAAoB,EAAwB,IAAI,GAChE,CAAC,GAAM,KA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D;GACE,GAAI;GACJ,IAAI,EACF,EACE,IAAI,EACN,GACA,EAAY,EACd;aACD;EAEW,CAAA,GACZ,kBAAC,IAAD;GACE,OAAO;GACP,WAAW,GAAQ,MACjB,EAAU,CAAyC;aAHvD,CAME,kBAAC,GAAD;IACE,OAAO;IACP,SAAS,kBAAC,GAAD,CAAQ,CAAA;IACjB,OAAM;GACP,CAAA,GACD,kBAAC,GAAD;IACE,OAAO;IACP,SAAS,kBAAC,GAAD,CAAQ,CAAA;IACjB,OAAM;GACP,CAAA,CACS;IACZ,EAAA,CAAA;EAEH,KACC,kBAAC,GAAD;GAAO,UAAS;GAAQ,IAAI,EAAE,WAAW,EAAE;aACxC;EACI,CAAA;CAET,EAAA,CAAA;AAEN,CACF"}
1
+ {"version":3,"file":"SetAccessRequirementCommonFields.js","names":[],"sources":["../../../src/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.tsx"],"sourcesContent":["import {\n useCreateAccessRequirement,\n useGetAccessRequirements,\n useUpdateAccessRequirement,\n} from '@/synapse-queries'\nimport { spreadSx } from '@/theme/spreadSx'\nimport HelpOutlineTwoTone from '@mui/icons-material/HelpOutlineTwoTone'\nimport {\n Alert,\n Box,\n Checkbox,\n FormControlLabel,\n Radio,\n RadioGroup,\n Skeleton,\n Stack,\n TextField,\n Tooltip,\n Typography,\n TypographyProps,\n} from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ACCESS_TYPE,\n AccessRequirement,\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n RestrictableObjectDescriptor,\n RestrictableObjectType,\n SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport pluralize from 'pluralize'\nimport { FormTemplateReference } from '@sage-bionetworks/synapse-client'\nimport { useGetFeatureFlag } from '@/synapse-queries/featureflags/useGetFeatureFlag'\nimport { FeatureFlagEnum } from '@/utils/featureflag/FeatureFlags'\nimport {\n FormTemplateReferenceField,\n useFormTemplateReferenceError,\n} from '../FormTemplateReferenceField/FormTemplateReferenceField'\nimport {\n ForwardedRef,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\nimport EntitySubjectsSelector from '../EntitySubjectsSelector'\nimport { SynapseErrorBoundary } from '../error'\nimport TeamSubjectsSelector from '../TeamSubjectsSelector'\n\nexport const EMPTY_SUBJECT_LIST_ERROR_MESSAGE =\n 'Please select at least one resource for this Access Requirement to be associated with.'\nexport const UNSAVED_SUBJECTS_ERROR_MESSAGE = (\n subjectsType: RestrictableObjectType,\n) => {\n const idsText =\n subjectsType === RestrictableObjectType.ENTITY ? 'Synapse' : 'Team'\n const typeText =\n subjectsType[0].toUpperCase() + subjectsType.slice(1).toLowerCase()\n return `${idsText} IDs were specified but not added to the subjects list. Please either clear out the Add ${idsText} IDs textbox or click the Add ${pluralize(\n typeText,\n )} button.`\n}\nconst NAME_HELP_TEXT =\n \"Enter access requirement name. This will also be used when sending notifications for expiring or revoked approval. For example, 'The approval for the name access requirement was revoked...'\"\n\nconst headerProps: Partial<TypographyProps> = {\n variant: 'body1',\n fontWeight: 700,\n}\n\nfunction getAccessType(subjectType: RestrictableObjectType) {\n switch (subjectType) {\n case RestrictableObjectType.ENTITY:\n return ACCESS_TYPE.DOWNLOAD\n case RestrictableObjectType.TEAM:\n return ACCESS_TYPE.PARTICIPATE\n default:\n throw new Error(\n `RestrictableObjectType ${subjectType} does not have an access type specified.`,\n )\n }\n}\n\nexport type SetAccessRequirementCommonFieldsHandle = {\n /* Allow the parent component to trigger saving the AR, so this may be embedded in an arbitrary modal. */\n save: () => void\n}\n\nexport type SetAccessRequirementCommonFieldsProps = {\n /* Provided when creating a new AR */\n subject?: RestrictableObjectDescriptor\n /* Provided when editing an existing AR */\n accessRequirementId?: string\n /* Called when AR has been saved successfully */\n onSave: (\n accessRequirementId: string,\n accessRequirementConreteType: ACCESS_REQUIREMENT_CONCRETE_TYPE,\n ) => void\n /* Called when error saving AR */\n onError: () => void\n}\n\nexport const SetAccessRequirementCommonFields = forwardRef(\n function SetAccessRequirementCommonFields(\n props: SetAccessRequirementCommonFieldsProps,\n ref: ForwardedRef<SetAccessRequirementCommonFieldsHandle>,\n ) {\n const { subject, accessRequirementId, onSave, onError } = props\n\n const isEditing = !subject\n\n const [subjects, setSubjects] = useState<RestrictableObjectDescriptor[]>(\n subject ? [subject] : [],\n )\n const [hasPendingSubjects, setHasPendingSubjects] = useState<boolean>(false)\n const [subjectsError, setSubjectsError] = useState<string | null>(null)\n const [name, setName] = useState<string>('')\n const [subjectsDefinedByAnnotations, setSubjectsDefinedByAnnotations] =\n useState<boolean>(false)\n const [arType, setArType] = useState<ACCESS_REQUIREMENT_CONCRETE_TYPE>(\n subject?.type === RestrictableObjectType.TEAM\n ? SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n : MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n )\n const [clientError, setClientError] = useState<string | null>(null)\n const isSchemaDrivenEnabled = useGetFeatureFlag(\n FeatureFlagEnum.ACT_DASHBOARD_FORM_TEMPLATES,\n )\n const [formTemplateRef, setFormTemplateRef] = useState<\n FormTemplateReference | undefined\n >(undefined)\n const [showFormTemplateError, setShowFormTemplateError] =\n useState<boolean>(false)\n const isSchemaDrivenTypeSelected =\n isSchemaDrivenEnabled &&\n arType === JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n const formTemplateReferenceError = useFormTemplateReferenceError(\n isSchemaDrivenTypeSelected ? formTemplateRef : undefined,\n )\n\n const onMutationSuccess = (ar: AccessRequirement) => {\n setClientError(null)\n onSave(ar.id.toString(), ar.concreteType)\n }\n\n const onMutationError = (error: SynapseClientError) => {\n setClientError(error.reason)\n onError()\n }\n\n const { mutate: createAccessRequirement } = useCreateAccessRequirement({\n onSuccess: newAr => onMutationSuccess(newAr),\n onError: error => onMutationError(error),\n })\n\n const { mutate: updateAccessRequirement } = useUpdateAccessRequirement({\n onSuccess: updatedAr => onMutationSuccess(updatedAr),\n onError: error => onMutationError(error),\n })\n\n const {\n data: accessRequirement,\n isLoading: isLoadingAr,\n error: getArError,\n } = useGetAccessRequirements(accessRequirementId!, {\n enabled: Boolean(accessRequirementId),\n })\n\n useEffect(() => {\n if (accessRequirement) {\n setArType(accessRequirement.concreteType)\n if (\n accessRequirement.concreteType ===\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE\n ) {\n setFormTemplateRef(accessRequirement.formTemplateRef)\n }\n setName(accessRequirement.name)\n setSubjects(accessRequirement.subjectIds)\n setSubjectsDefinedByAnnotations(\n accessRequirement.subjectsDefinedByAnnotations,\n )\n }\n }, [accessRequirement])\n\n const subjectsType = useMemo(() => {\n if (subject) {\n return subject.type\n }\n if (accessRequirement) {\n const initialSubjects = accessRequirement.subjectIds\n if (initialSubjects.length > 0) {\n return initialSubjects[0].type\n }\n }\n if (subjectsDefinedByAnnotations) {\n return RestrictableObjectType.ENTITY\n }\n return null\n }, [subject, accessRequirement, subjectsDefinedByAnnotations])\n\n const selectorContent = useMemo(() => {\n if (!subjectsType) return <></>\n\n function onUpdate(subjects: RestrictableObjectDescriptor[]) {\n setSubjectsError(null)\n setSubjects(subjects)\n }\n\n function onUpdateIdsTextbox(value: string) {\n setSubjectsError(null)\n setHasPendingSubjects(value.trim() !== '')\n }\n\n if (subjectsDefinedByAnnotations) {\n return <></>\n }\n switch (subjectsType) {\n case RestrictableObjectType.TEAM:\n return (\n <TeamSubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateTeamIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n case RestrictableObjectType.ENTITY:\n return (\n <EntitySubjectsSelector\n subjects={subjects}\n onUpdate={subjects => onUpdate(subjects)}\n onUpdateEntityIDsTextbox={value => onUpdateIdsTextbox(value)}\n />\n )\n default:\n console.error(\n `RestrictableObjectType ${subjectsType} does not have a selector implemented.`,\n )\n return <></>\n }\n }, [subjectsType, subjects, subjectsDefinedByAnnotations])\n\n useImperativeHandle(ref, () => {\n return {\n save() {\n const isStillLoading =\n (isEditing && !accessRequirement) || !subjectsType\n const hasSubjectsError =\n !subjectsDefinedByAnnotations &&\n (hasPendingSubjects || subjects.length === 0)\n if (isStillLoading || hasSubjectsError) {\n if (hasSubjectsError && !isStillLoading) {\n if (hasPendingSubjects) {\n setSubjectsError(UNSAVED_SUBJECTS_ERROR_MESSAGE(subjectsType))\n } else if (subjects.length === 0) {\n setSubjectsError(EMPTY_SUBJECT_LIST_ERROR_MESSAGE)\n }\n }\n\n onError()\n return\n }\n\n if (isSchemaDrivenTypeSelected && formTemplateReferenceError) {\n setShowFormTemplateError(true)\n onError()\n return\n }\n\n const newAccessType = getAccessType(subjectsType)\n if (!isEditing) {\n const newAr: Partial<AccessRequirement> = {\n concreteType: arType,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n ...(isSchemaDrivenTypeSelected ? { formTemplateRef } : {}),\n }\n createAccessRequirement(newAr)\n }\n\n if (isEditing && accessRequirement) {\n updateAccessRequirement({\n ...accessRequirement,\n subjectIds: subjects,\n name: name,\n accessType: newAccessType,\n subjectsDefinedByAnnotations: subjectsDefinedByAnnotations,\n ...(isSchemaDrivenTypeSelected ? { formTemplateRef } : {}),\n })\n }\n },\n }\n }, [\n hasPendingSubjects,\n subjectsType,\n subjects,\n name,\n arType,\n accessRequirement,\n isEditing,\n onError,\n createAccessRequirement,\n updateAccessRequirement,\n subjectsDefinedByAnnotations,\n isSchemaDrivenTypeSelected,\n formTemplateRef,\n formTemplateReferenceError,\n ])\n\n if (isLoadingAr || !subjectsType) {\n return (\n <>\n <Skeleton width={100} height={30} />\n <Skeleton width={125} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n <Skeleton width={100} height={30} />\n <Skeleton width=\"100%\">\n <TextField />\n </Skeleton>\n </>\n )\n }\n\n if (getArError) {\n return <Alert severity=\"error\">{getArError.reason}</Alert>\n }\n\n return (\n <>\n <Typography {...headerProps}>Resources</Typography>\n {subjectsType !== RestrictableObjectType.TEAM && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Associated entities should be defined by annotations (DUO)\"\n checked={subjectsDefinedByAnnotations}\n onChange={() => {\n setSubjectsError(null)\n // if we are switching from DUO to manually defining the subjects (and the AR has been retrieved), then\n // reset to the AR subject IDs or the original subject ID. Otherwise, clear out the subjects.\n let newSubjectIds: RestrictableObjectDescriptor[] = []\n if (subjectsDefinedByAnnotations) {\n if (accessRequirement) {\n newSubjectIds = accessRequirement.subjectIds\n } else if (subject) {\n newSubjectIds = [subject]\n }\n }\n setSubjects(newSubjectIds)\n setSubjectsDefinedByAnnotations(!subjectsDefinedByAnnotations)\n }}\n />\n )}\n <SynapseErrorBoundary>{selectorContent}</SynapseErrorBoundary>\n {subjectsError && <Alert severity=\"error\">{subjectsError}</Alert>}\n <Stack\n direction=\"row\"\n sx={{\n gap: 1,\n alignItems: 'center',\n mb: 1,\n mt: 2,\n }}\n >\n <Typography component=\"label\" htmlFor=\"arName\" {...headerProps}>\n Name\n </Typography>\n <Tooltip title={NAME_HELP_TEXT} placement=\"right\">\n <HelpOutlineTwoTone sx={{ color: 'grey.600' }} />\n </Tooltip>\n </Stack>\n <TextField\n id=\"arName\"\n name=\"arName\"\n value={name}\n placeholder=\"Access requirement name\"\n fullWidth\n onChange={event => setName(event.target.value)}\n />\n {!isEditing && subjectsType !== RestrictableObjectType.TEAM && (\n <>\n <Typography\n {...headerProps}\n sx={spreadSx(\n {\n mt: 2,\n },\n headerProps.sx,\n )}\n >\n Access requirement type\n </Typography>\n <RadioGroup\n value={arType}\n onChange={(_event, value) =>\n setArType(value as ACCESS_REQUIREMENT_CONCRETE_TYPE)\n }\n >\n <FormControlLabel\n value={MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Controlled - requests are in Synapse\"\n />\n <FormControlLabel\n value={SELF_SIGN_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Click wrap\"\n />\n {isSchemaDrivenEnabled && (\n <FormControlLabel\n value={JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE}\n control={<Radio />}\n label=\"Schema-driven - requests are in Synapse, using a form template\"\n />\n )}\n </RadioGroup>\n </>\n )}\n {isSchemaDrivenTypeSelected && (\n <Box sx={{ mt: 2 }}>\n <Typography\n {...headerProps}\n sx={spreadSx({ mb: 1 }, headerProps.sx)}\n >\n Form presented to requesters\n </Typography>\n <FormTemplateReferenceField\n value={formTemplateRef}\n onChange={reference => {\n setShowFormTemplateError(false)\n setFormTemplateRef(reference)\n }}\n error={showFormTemplateError ? formTemplateReferenceError : null}\n />\n </Box>\n )}\n {clientError && (\n <Alert severity=\"error\" sx={{ marginTop: 2 }}>\n {clientError}\n </Alert>\n )}\n </>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;AAoDA,IAAa,IACX,0FACW,KACX,MACG;CACH,IAAM,IACJ,MAAiB,EAAuB,SAAS,YAAY;CAG/D,OAAO,GAAG,EAAQ,0FAA0F,EAAQ,gCAAgC,EADlJ,EAAa,GAAG,YAAY,IAAI,EAAa,MAAM,CAAC,EAAE,YAAY,CAGpE,EAAE;AACJ,GACM,KACJ,iMAEI,IAAwC;CAC5C,SAAS;CACT,YAAY;AACd;AAEA,SAAS,GAAc,GAAqC;CAC1D,QAAQ,GAAR;EACE,KAAK,EAAuB,QAC1B,OAAO,EAAY;EACrB,KAAK,EAAuB,MAC1B,OAAO,EAAY;EACrB,SACE,MAAU,MACR,0BAA0B,EAAY,yCACxC;CACJ;AACF;AAqBA,IAAa,IAA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AAE,IAAI,EAAE,GAAG,EAAY,EAAE;cACvC;GAEW,CAAA,GACZ,kBAAC,IAAD;IACE,OAAO;IACP,WAAU,MAAa;KAErB,AADA,EAAyB,EAAK,GAC9B,EAAmB,CAAS;IAC9B;IACA,OAAO,KAAwB,IAA6B;GAC7D,CAAA,CACE;;EAEN,KACC,kBAAC,GAAD;GAAO,UAAS;GAAQ,IAAI,EAAE,WAAW,EAAE;aACxC;EACI,CAAA;CAET,EAAA,CAAA;AAEN,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccessorRequirements.d.ts","sourceRoot":"","sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAElB,MAAM,iCAAiC,CAAA;AAIxC,KAAK,yBAAyB,GAAG;IAC/B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CA6DpE"}
1
+ {"version":3,"file":"AccessorRequirements.d.ts","sourceRoot":"","sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGlB,MAAM,iCAAiC,CAAA;AAIxC,KAAK,yBAAyB,GAAG;IAC/B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CA+DpE"}
@@ -1,11 +1,11 @@
1
1
  import { hasAccessorRequirement as e } from "./GovernanceUtils.js";
2
2
  import { Box as t, Checkbox as n, FormControlLabel as r, Typography as i } from "@mui/material";
3
3
  import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
4
- import { MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as c } from "@sage-bionetworks/synapse-types";
4
+ import { JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as c, MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as l } from "@sage-bionetworks/synapse-types";
5
5
  //#region src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx
6
- function l(l) {
7
- let { accessRequirement: u, onChange: d } = l;
8
- return /* @__PURE__ */ o(a, { children: e(u) && /* @__PURE__ */ o(a, { children: /* @__PURE__ */ s(t, {
6
+ function u(u) {
7
+ let { accessRequirement: d, onChange: f } = u;
8
+ return /* @__PURE__ */ o(a, { children: e(d) && /* @__PURE__ */ o(a, { children: /* @__PURE__ */ s(t, {
9
9
  sx: { mb: 2 },
10
10
  children: [
11
11
  /* @__PURE__ */ o(i, {
@@ -16,27 +16,27 @@ function l(l) {
16
16
  /* @__PURE__ */ o(r, {
17
17
  control: /* @__PURE__ */ o(n, {}),
18
18
  label: "Accessors must be certified.",
19
- checked: u.isCertifiedUserRequired,
20
- onChange: (e, t) => d({
21
- ...u,
19
+ checked: d.isCertifiedUserRequired,
20
+ onChange: (e, t) => f({
21
+ ...d,
22
22
  isCertifiedUserRequired: t
23
23
  })
24
24
  }),
25
25
  /* @__PURE__ */ o(r, {
26
26
  control: /* @__PURE__ */ o(n, {}),
27
27
  label: "Accessors must have a validated profile.",
28
- checked: u.isValidatedProfileRequired,
29
- onChange: (e, t) => d({
30
- ...u,
28
+ checked: d.isValidatedProfileRequired,
29
+ onChange: (e, t) => f({
30
+ ...d,
31
31
  isValidatedProfileRequired: t
32
32
  })
33
33
  }),
34
- u.concreteType === c && /* @__PURE__ */ o(r, {
34
+ (d.concreteType === l || d.concreteType === c) && /* @__PURE__ */ o(r, {
35
35
  control: /* @__PURE__ */ o(n, {}),
36
36
  label: "Accessors must use two-factor authentication (2FA).",
37
- checked: u.isTwoFaRequired,
38
- onChange: (e, t) => d({
39
- ...u,
37
+ checked: d.isTwoFaRequired,
38
+ onChange: (e, t) => f({
39
+ ...d,
40
40
  isTwoFaRequired: t
41
41
  })
42
42
  })
@@ -44,6 +44,6 @@ function l(l) {
44
44
  }) }) });
45
45
  }
46
46
  //#endregion
47
- export { l as AccessorRequirements };
47
+ export { u as AccessorRequirements };
48
48
 
49
49
  //# sourceMappingURL=AccessorRequirements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccessorRequirements.js","names":[],"sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"sourcesContent":["import {\n AccessRequirement,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport { hasAccessorRequirement } from './GovernanceUtils'\nimport { Box, Checkbox, FormControlLabel, Typography } from '@mui/material'\n\ntype AccessorRequirementsProps = {\n accessRequirement: AccessRequirement\n onChange: (updatedAr: AccessRequirement) => void\n}\n\nexport function AccessorRequirements(props: AccessorRequirementsProps) {\n const { accessRequirement, onChange } = props\n\n return (\n <>\n {hasAccessorRequirement(accessRequirement) && (\n <>\n <Box\n sx={{\n mb: 2,\n }}\n >\n <Typography\n variant=\"body1\"\n sx={{\n fontWeight: 700,\n }}\n >\n Accessor requirements\n </Typography>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must be certified.\"\n checked={accessRequirement.isCertifiedUserRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isCertifiedUserRequired: checked,\n })\n }\n />\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must have a validated profile.\"\n checked={accessRequirement.isValidatedProfileRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isValidatedProfileRequired: checked,\n })\n }\n />\n {accessRequirement.concreteType ===\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must use two-factor authentication (2FA).\"\n checked={accessRequirement.isTwoFaRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isTwoFaRequired: checked,\n })\n }\n />\n )}\n </Box>\n </>\n )}\n </>\n )\n}\n"],"mappings":";;;;;AAYA,SAAgB,EAAqB,GAAkC;CACrE,IAAM,EAAE,sBAAmB,gBAAa;CAExC,OACE,kBAAA,GAAA,EAAA,UACG,EAAuB,CAAiB,KACvC,kBAAA,GAAA,EAAA,UACE,kBAAC,GAAD;EACE,IAAI,EACF,IAAI,EACN;YAHF;GAKE,kBAAC,GAAD;IACE,SAAQ;IACR,IAAI,EACF,YAAY,IACd;cACD;GAEW,CAAA;GACZ,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,yBAAyB;IAC3B,CAAC;GAEJ,CAAA;GACD,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,4BAA4B;IAC9B,CAAC;GAEJ,CAAA;GACA,EAAkB,iBACjB,KACA,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,iBAAiB;IACnB,CAAC;GAEJ,CAAA;EAEA;IACL,CAAA,EAEJ,CAAA;AAEN"}
1
+ {"version":3,"file":"AccessorRequirements.js","names":[],"sources":["../../../src/components/SetBasicAccessRequirementFields/AccessorRequirements.tsx"],"sourcesContent":["import {\n AccessRequirement,\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE,\n} from '@sage-bionetworks/synapse-types'\nimport { hasAccessorRequirement } from './GovernanceUtils'\nimport { Box, Checkbox, FormControlLabel, Typography } from '@mui/material'\n\ntype AccessorRequirementsProps = {\n accessRequirement: AccessRequirement\n onChange: (updatedAr: AccessRequirement) => void\n}\n\nexport function AccessorRequirements(props: AccessorRequirementsProps) {\n const { accessRequirement, onChange } = props\n\n return (\n <>\n {hasAccessorRequirement(accessRequirement) && (\n <>\n <Box\n sx={{\n mb: 2,\n }}\n >\n <Typography\n variant=\"body1\"\n sx={{\n fontWeight: 700,\n }}\n >\n Accessor requirements\n </Typography>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must be certified.\"\n checked={accessRequirement.isCertifiedUserRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isCertifiedUserRequired: checked,\n })\n }\n />\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must have a validated profile.\"\n checked={accessRequirement.isValidatedProfileRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isValidatedProfileRequired: checked,\n })\n }\n />\n {(accessRequirement.concreteType ===\n MANAGED_ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE ||\n accessRequirement.concreteType ===\n JSON_SCHEMA_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE) && (\n <FormControlLabel\n control={<Checkbox />}\n label=\"Accessors must use two-factor authentication (2FA).\"\n checked={accessRequirement.isTwoFaRequired}\n onChange={(_event, checked: boolean) =>\n onChange({\n ...accessRequirement,\n isTwoFaRequired: checked,\n })\n }\n />\n )}\n </Box>\n </>\n )}\n </>\n )\n}\n"],"mappings":";;;;;AAaA,SAAgB,EAAqB,GAAkC;CACrE,IAAM,EAAE,sBAAmB,gBAAa;CAExC,OACE,kBAAA,GAAA,EAAA,UACG,EAAuB,CAAiB,KACvC,kBAAA,GAAA,EAAA,UACE,kBAAC,GAAD;EACE,IAAI,EACF,IAAI,EACN;YAHF;GAKE,kBAAC,GAAD;IACE,SAAQ;IACR,IAAI,EACF,YAAY,IACd;cACD;GAEW,CAAA;GACZ,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,yBAAyB;IAC3B,CAAC;GAEJ,CAAA;GACD,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,4BAA4B;IAC9B,CAAC;GAEJ,CAAA;IACC,EAAkB,iBAClB,KACA,EAAkB,iBAChB,MACF,kBAAC,GAAD;IACE,SAAS,kBAAC,GAAD,CAAW,CAAA;IACpB,OAAM;IACN,SAAS,EAAkB;IAC3B,WAAW,GAAQ,MACjB,EAAS;KACP,GAAG;KACH,iBAAiB;IACnB,CAAC;GAEJ,CAAA;EAEA;IACL,CAAA,EAEJ,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"SetManagedAccessRequirementFields.d.ts","sourceRoot":"","sources":["../../../src/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.tsx"],"names":[],"mappings":"AA+BA,MAAM,MAAM,uCAAuC,GAAG;IAEpD,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sCAAsC,GAAG;IACnD,mBAAmB,EAAE,MAAM,CAAA;IAE3B,MAAM,EAAE,MAAM,IAAI,CAAA;IAElB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iCAAiC,4JA6L7C,CAAA"}
1
+ {"version":3,"file":"SetManagedAccessRequirementFields.d.ts","sourceRoot":"","sources":["../../../src/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.tsx"],"names":[],"mappings":"AAgCA,MAAM,MAAM,uCAAuC,GAAG;IAEpD,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sCAAsC,GAAG;IACnD,mBAAmB,EAAE,MAAM,CAAA;IAE3B,MAAM,EAAE,MAAM,IAAI,CAAA;IAElB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iCAAiC,4JA2M7C,CAAA"}