synapse-react-client 4.0.33 → 4.0.35
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.
- package/dist/SWC.index.js +1 -1
- package/dist/assets/icons/curie-head.svg +21 -0
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +29 -3
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +153 -84
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.d.ts +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js +49 -42
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts +6 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +161 -155
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts +21 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +164 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts +22 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +264 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +105 -96
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.d.ts +13 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +122 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +17 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +112 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +27 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +194 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.d.ts +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.js +7 -7
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.js.map +1 -1
- package/dist/components/DraggableDialog/DraggableDialog.d.ts +2 -1
- package/dist/components/DraggableDialog/DraggableDialog.d.ts.map +1 -1
- package/dist/components/DraggableDialog/DraggableDialog.js +42 -33
- package/dist/components/DraggableDialog/DraggableDialog.js.map +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.js +12 -6
- package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js +2 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts.map +1 -1
- package/dist/components/FilePreview/PdfPreview.js +23 -20
- package/dist/components/FilePreview/PdfPreview.js.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +100 -99
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +64 -55
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map +1 -1
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js +4 -1
- package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
- package/dist/components/StorybookComponentWrapper.d.ts.map +1 -1
- package/dist/components/StorybookComponentWrapper.js +16 -13
- package/dist/components/StorybookComponentWrapper.js.map +1 -1
- package/dist/components/SynapseChat/GridAgentChat.js +6 -6
- package/dist/components/SynapseChat/SynapseChat.d.ts +2 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +118 -74
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +3 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js +21 -21
- package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.d.ts +1 -0
- package/dist/components/SynapseChat/SynapseChatMessage.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.js +9 -8
- package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js +2 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
- package/dist/components/TanStackTable/TanStackTableUtils.d.ts.map +1 -1
- package/dist/components/TanStackTable/TanStackTableUtils.js +6 -6
- package/dist/components/TanStackTable/TanStackTableUtils.js.map +1 -1
- package/dist/components/dataaccess/AccessRequirementDashboard.d.ts.map +1 -1
- package/dist/components/dataaccess/AccessRequirementDashboard.js +55 -55
- package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
- package/dist/components/dataaccess/EDucTemplateTable.d.ts +3 -0
- package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -0
- package/dist/components/dataaccess/EDucTemplateTable.js +213 -0
- package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -0
- package/dist/components/dataaccess/ReviewerDashboard.d.ts.map +1 -1
- package/dist/components/dataaccess/ReviewerDashboard.js +44 -34
- package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +12 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +84 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +20 -18
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.d.ts.map +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.js +43 -61
- package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
- package/dist/components/entity/page/createdByModifiedByTooltips.d.ts +7 -0
- package/dist/components/entity/page/createdByModifiedByTooltips.d.ts.map +1 -0
- package/dist/components/entity/page/createdByModifiedByTooltips.js +36 -0
- package/dist/components/entity/page/createdByModifiedByTooltips.js.map +1 -0
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +130 -65
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/widgets/Range.js +8 -2
- package/dist/components/widgets/Range.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts +2 -0
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +35 -40
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.js +2 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilterUI.js +19 -19
- package/dist/components/widgets/query-filter/RangeFacetFilterUI.js.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +48 -23
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/eDucTemplateHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/eDucTemplateHandlers.js +9 -9
- package/dist/mocks/msw/handlers/eDucTemplateHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.js +22 -22
- package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.js +36 -36
- package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
- package/dist/mocks/user/mock_user_profile.d.ts +1 -0
- package/dist/mocks/user/mock_user_profile.d.ts.map +1 -1
- package/dist/mocks/user/mock_user_profile.js +45 -45
- package/dist/mocks/user/mock_user_profile.js.map +1 -1
- package/dist/style/components/facet_nav/_facet-nav-panel.scss +0 -6
- package/dist/synapse-queries/KeyFactory.d.ts +1 -0
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +3 -0
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -4
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +13 -1
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +67 -49
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/index.js +185 -184
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +6 -0
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js +2 -2
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/ApplicationSessionManager.js +20 -19
- package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/RegularExpressions.d.ts +7 -0
- package/dist/utils/functions/RegularExpressions.d.ts.map +1 -1
- package/dist/utils/functions/RegularExpressions.js +5 -4
- package/dist/utils/functions/RegularExpressions.js.map +1 -1
- package/dist/utils/hooks/useFetchBlobUrl.d.ts +9 -0
- package/dist/utils/hooks/useFetchBlobUrl.d.ts.map +1 -0
- package/dist/utils/hooks/useFetchBlobUrl.js +19 -0
- package/dist/utils/hooks/useFetchBlobUrl.js.map +1 -0
- package/dist/utils/hooks/useIsHydrated.d.ts +9 -0
- package/dist/utils/hooks/useIsHydrated.d.ts.map +1 -0
- package/dist/utils/hooks/useIsHydrated.js +10 -0
- package/dist/utils/hooks/useIsHydrated.js.map +1 -0
- package/package.json +2 -2
|
@@ -20,27 +20,28 @@ function s(t, n) {
|
|
|
20
20
|
}, [c, u]), { traceEvents: o };
|
|
21
21
|
}
|
|
22
22
|
function c(e) {
|
|
23
|
-
let { userMessage: r, chatJobId: i, onSendChat: a, agentAvatar: c, userAvatar: l, scrollIntoView: u, animateEntry: d, isAwaitingResponse: f,
|
|
24
|
-
let t = e.fileHandleId, n =
|
|
23
|
+
let { userMessage: r, chatJobId: i, onSendChat: a, agentAvatar: c, userAvatar: l, scrollIntoView: u, animateEntry: d, isAwaitingResponse: f, showLoadingIcon: p, pendingAttachments: m } = e, { data: h } = n(i), g = h?.requestBody, _ = h?.responseBody, v = h?.errorMessage, { traceEvents: y } = s(i, !!i && (!h?.jobState || h.jobState == "PROCESSING")), b = g?.attachments?.map((e) => {
|
|
24
|
+
let t = e.fileHandleId, n = _?.attachmentStatuses?.find((e) => e.fileHandleId === t), r = m?.find((e) => e.fileHandleId === t);
|
|
25
25
|
return {
|
|
26
26
|
fileHandleId: t,
|
|
27
27
|
fileName: n?.fileName ?? r?.fileName,
|
|
28
28
|
contentType: n?.contentType ?? r?.contentType
|
|
29
29
|
};
|
|
30
|
-
}) ??
|
|
30
|
+
}) ?? m;
|
|
31
31
|
return /* @__PURE__ */ o(t, {
|
|
32
32
|
agentAvatar: c,
|
|
33
33
|
userAvatar: l,
|
|
34
34
|
userMessage: r,
|
|
35
|
-
chatResponseText:
|
|
36
|
-
chatResponseTrace:
|
|
37
|
-
chatErrorReason:
|
|
35
|
+
chatResponseText: _?.responseText,
|
|
36
|
+
chatResponseTrace: y,
|
|
37
|
+
chatErrorReason: v,
|
|
38
38
|
onSendChat: a,
|
|
39
39
|
scrollIntoView: u,
|
|
40
40
|
animateEntry: d,
|
|
41
41
|
isAwaitingResponse: f,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
showLoadingIcon: p,
|
|
43
|
+
attachments: b,
|
|
44
|
+
attachmentStatuses: _?.attachmentStatuses
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynapseChatMessage.js","names":[],"sources":["../../../src/components/SynapseChat/SynapseChatMessage.tsx"],"sourcesContent":["import SynapseChatInteraction from '@/components/SynapseChat/SynapseChatInteraction'\nimport usePollAsynchronousJob from '@/synapse-queries/asynchronous/usePollAsynchronousJob'\nimport { useGetChatAgentTraceEvents } from '@/synapse-queries/chat/useChat'\nimport {\n AgentChatRequest,\n AgentChatResponse,\n} from '@sage-bionetworks/synapse-client'\nimport { TraceEvent } from '@sage-bionetworks/synapse-types'\nimport { useCallback, useEffect, useState } from 'react'\nimport { ChatAttachment } from './utils/types'\n\nfunction useTraceEvent(chatJobId: string | undefined, enabled: boolean) {\n const [traceEvents, setTraceEvents] = useState<TraceEvent[]>([])\n\n const appendTraceEvents = useCallback((newEvents: TraceEvent[]) => {\n setTraceEvents(prev => {\n return [...prev, ...newEvents]\n })\n }, [])\n\n const latestTraceEvent = traceEvents.at(traceEvents.length - 1)\n const { data: newTraceEvents } = useGetChatAgentTraceEvents(\n {\n jobId: chatJobId ?? '',\n newerThanTimestamp: latestTraceEvent?.timestamp,\n },\n {\n enabled: enabled,\n refetchInterval: 1000, // Re-fetch every second if enabled\n refetchIntervalInBackground: true, // Continue polling even when the tab is not active\n },\n )\n useEffect(() => {\n if (newTraceEvents && newTraceEvents.page.length > 0) {\n appendTraceEvents(newTraceEvents.page)\n\n // send trace events to the console to ease agent debugging\n // if the trace events do not contain the latest event, add the events to the array\n console.debug(newTraceEvents.page)\n }\n }, [appendTraceEvents, newTraceEvents])\n\n return {\n traceEvents,\n }\n}\n\ntype SynapseChatMessageProps = {\n agentAvatar: React.ReactNode\n userAvatar: React.ReactNode\n /** Known at send time; never re-derived from the polled job so the bubble never renders empty. */\n userMessage: string\n /** Undefined until the async job has been registered for this interaction. */\n chatJobId?: string\n onSendChat?: (message: string) => void\n scrollIntoView?: boolean\n animateEntry?: boolean\n isAwaitingResponse?: boolean\n /**\n * Attachments sent with this message. This information is not available in any API request/response\n * until the job has finished processing, so this prop is used to optimistically render the attachment\n * chips in the message bubble until the response arrives.\n */\n pendingAttachments?: ChatAttachment[]\n}\n\nexport default function SynapseChatMessage(props: SynapseChatMessageProps) {\n const {\n userMessage,\n chatJobId,\n onSendChat,\n agentAvatar,\n userAvatar,\n scrollIntoView,\n animateEntry,\n isAwaitingResponse,\n pendingAttachments,\n } = props\n const { data: asyncJobStatus } = usePollAsynchronousJob(chatJobId)\n\n const chatRequest = asyncJobStatus?.requestBody as AgentChatRequest\n const chatResponse = asyncJobStatus?.responseBody as\n | AgentChatResponse\n | undefined\n const chatError = asyncJobStatus?.errorMessage\n\n // enabled if the job has been registered and has not finished processing\n const enableTrace =\n !!chatJobId &&\n (!asyncJobStatus?.jobState || asyncJobStatus.jobState == 'PROCESSING')\n const { traceEvents } = useTraceEvent(chatJobId, enableTrace)\n\n const attachments =\n chatRequest?.attachments?.map(attachment => {\n const fileHandleId = attachment.fileHandleId!\n const status = chatResponse?.attachmentStatuses?.find(\n s => s.fileHandleId === fileHandleId,\n )\n const pending = pendingAttachments?.find(\n a => a.fileHandleId === fileHandleId,\n )\n // Prefer the server-resolved metadata once the job's response arrives. Fall back to what\n // was optimistically sent (`pending`) so the chip doesn't lose its filename between the\n // job being registered and its response arriving.\n return {\n fileHandleId,\n fileName: status?.fileName ?? pending?.fileName,\n contentType: status?.contentType ?? pending?.contentType,\n }\n }) ?? pendingAttachments\n\n return (\n <SynapseChatInteraction\n agentAvatar={agentAvatar}\n userAvatar={userAvatar}\n userMessage={userMessage}\n chatResponseText={chatResponse?.responseText}\n chatResponseTrace={traceEvents}\n chatErrorReason={chatError}\n onSendChat={onSendChat}\n scrollIntoView={scrollIntoView}\n animateEntry={animateEntry}\n isAwaitingResponse={isAwaitingResponse}\n attachments={attachments}\n attachmentStatuses={chatResponse?.attachmentStatuses}\n />\n )\n}\n"],"mappings":";;;;;;AAWA,SAAS,EAAc,GAA+B,GAAkB;CACtE,IAAM,CAAC,GAAa,KAAkB,EAAuB,CAAC,CAAC,GAEzD,IAAoB,GAAa,MAA4B;EACjE,GAAe,MACN,CAAC,GAAG,GAAM,GAAG,CAAS,CAC9B;CACH,GAAG,CAAC,CAAC,GAEC,IAAmB,EAAY,GAAG,EAAY,SAAS,CAAC,GACxD,EAAE,MAAM,MAAmB,EAC/B;EACE,OAAO,KAAa;EACpB,oBAAoB,GAAkB;CACxC,GACA;EACW;EACT,iBAAiB;EACjB,6BAA6B;CAC/B,CACF;CAWA,OAVA,QAAgB;EACd,AAAI,KAAkB,EAAe,KAAK,SAAS,MACjD,EAAkB,EAAe,IAAI,GAIrC,QAAQ,MAAM,EAAe,IAAI;CAErC,GAAG,CAAC,GAAmB,CAAc,CAAC,GAE/B,EACL,eACF;AACF;
|
|
1
|
+
{"version":3,"file":"SynapseChatMessage.js","names":[],"sources":["../../../src/components/SynapseChat/SynapseChatMessage.tsx"],"sourcesContent":["import SynapseChatInteraction from '@/components/SynapseChat/SynapseChatInteraction'\nimport usePollAsynchronousJob from '@/synapse-queries/asynchronous/usePollAsynchronousJob'\nimport { useGetChatAgentTraceEvents } from '@/synapse-queries/chat/useChat'\nimport {\n AgentChatRequest,\n AgentChatResponse,\n} from '@sage-bionetworks/synapse-client'\nimport { TraceEvent } from '@sage-bionetworks/synapse-types'\nimport { useCallback, useEffect, useState } from 'react'\nimport { ChatAttachment } from './utils/types'\n\nfunction useTraceEvent(chatJobId: string | undefined, enabled: boolean) {\n const [traceEvents, setTraceEvents] = useState<TraceEvent[]>([])\n\n const appendTraceEvents = useCallback((newEvents: TraceEvent[]) => {\n setTraceEvents(prev => {\n return [...prev, ...newEvents]\n })\n }, [])\n\n const latestTraceEvent = traceEvents.at(traceEvents.length - 1)\n const { data: newTraceEvents } = useGetChatAgentTraceEvents(\n {\n jobId: chatJobId ?? '',\n newerThanTimestamp: latestTraceEvent?.timestamp,\n },\n {\n enabled: enabled,\n refetchInterval: 1000, // Re-fetch every second if enabled\n refetchIntervalInBackground: true, // Continue polling even when the tab is not active\n },\n )\n useEffect(() => {\n if (newTraceEvents && newTraceEvents.page.length > 0) {\n appendTraceEvents(newTraceEvents.page)\n\n // send trace events to the console to ease agent debugging\n // if the trace events do not contain the latest event, add the events to the array\n console.debug(newTraceEvents.page)\n }\n }, [appendTraceEvents, newTraceEvents])\n\n return {\n traceEvents,\n }\n}\n\ntype SynapseChatMessageProps = {\n agentAvatar: React.ReactNode\n userAvatar: React.ReactNode\n /** Known at send time; never re-derived from the polled job so the bubble never renders empty. */\n userMessage: string\n /** Undefined until the async job has been registered for this interaction. */\n chatJobId?: string\n onSendChat?: (message: string) => void\n scrollIntoView?: boolean\n animateEntry?: boolean\n isAwaitingResponse?: boolean\n showLoadingIcon?: boolean\n /**\n * Attachments sent with this message. This information is not available in any API request/response\n * until the job has finished processing, so this prop is used to optimistically render the attachment\n * chips in the message bubble until the response arrives.\n */\n pendingAttachments?: ChatAttachment[]\n}\n\nexport default function SynapseChatMessage(props: SynapseChatMessageProps) {\n const {\n userMessage,\n chatJobId,\n onSendChat,\n agentAvatar,\n userAvatar,\n scrollIntoView,\n animateEntry,\n isAwaitingResponse,\n showLoadingIcon,\n pendingAttachments,\n } = props\n const { data: asyncJobStatus } = usePollAsynchronousJob(chatJobId)\n\n const chatRequest = asyncJobStatus?.requestBody as AgentChatRequest\n const chatResponse = asyncJobStatus?.responseBody as\n | AgentChatResponse\n | undefined\n const chatError = asyncJobStatus?.errorMessage\n\n // enabled if the job has been registered and has not finished processing\n const enableTrace =\n !!chatJobId &&\n (!asyncJobStatus?.jobState || asyncJobStatus.jobState == 'PROCESSING')\n const { traceEvents } = useTraceEvent(chatJobId, enableTrace)\n\n const attachments =\n chatRequest?.attachments?.map(attachment => {\n const fileHandleId = attachment.fileHandleId!\n const status = chatResponse?.attachmentStatuses?.find(\n s => s.fileHandleId === fileHandleId,\n )\n const pending = pendingAttachments?.find(\n a => a.fileHandleId === fileHandleId,\n )\n // Prefer the server-resolved metadata once the job's response arrives. Fall back to what\n // was optimistically sent (`pending`) so the chip doesn't lose its filename between the\n // job being registered and its response arriving.\n return {\n fileHandleId,\n fileName: status?.fileName ?? pending?.fileName,\n contentType: status?.contentType ?? pending?.contentType,\n }\n }) ?? pendingAttachments\n\n return (\n <SynapseChatInteraction\n agentAvatar={agentAvatar}\n userAvatar={userAvatar}\n userMessage={userMessage}\n chatResponseText={chatResponse?.responseText}\n chatResponseTrace={traceEvents}\n chatErrorReason={chatError}\n onSendChat={onSendChat}\n scrollIntoView={scrollIntoView}\n animateEntry={animateEntry}\n isAwaitingResponse={isAwaitingResponse}\n showLoadingIcon={showLoadingIcon}\n attachments={attachments}\n attachmentStatuses={chatResponse?.attachmentStatuses}\n />\n )\n}\n"],"mappings":";;;;;;AAWA,SAAS,EAAc,GAA+B,GAAkB;CACtE,IAAM,CAAC,GAAa,KAAkB,EAAuB,CAAC,CAAC,GAEzD,IAAoB,GAAa,MAA4B;EACjE,GAAe,MACN,CAAC,GAAG,GAAM,GAAG,CAAS,CAC9B;CACH,GAAG,CAAC,CAAC,GAEC,IAAmB,EAAY,GAAG,EAAY,SAAS,CAAC,GACxD,EAAE,MAAM,MAAmB,EAC/B;EACE,OAAO,KAAa;EACpB,oBAAoB,GAAkB;CACxC,GACA;EACW;EACT,iBAAiB;EACjB,6BAA6B;CAC/B,CACF;CAWA,OAVA,QAAgB;EACd,AAAI,KAAkB,EAAe,KAAK,SAAS,MACjD,EAAkB,EAAe,IAAI,GAIrC,QAAQ,MAAM,EAAe,IAAI;CAErC,GAAG,CAAC,GAAmB,CAAc,CAAC,GAE/B,EACL,eACF;AACF;AAsBA,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EACJ,gBACA,cACA,eACA,gBACA,eACA,mBACA,iBACA,uBACA,oBACA,0BACE,GACE,EAAE,MAAM,MAAmB,EAAuB,CAAS,GAE3D,IAAc,GAAgB,aAC9B,IAAe,GAAgB,cAG/B,IAAY,GAAgB,cAM5B,EAAE,mBAAgB,EAAc,GAFpC,CAAC,CAAC,MACD,CAAC,GAAgB,YAAY,EAAe,YAAY,aACC,GAEtD,IACJ,GAAa,aAAa,KAAI,MAAc;EAC1C,IAAM,IAAe,EAAW,cAC1B,IAAS,GAAc,oBAAoB,MAC/C,MAAK,EAAE,iBAAiB,CAC1B,GACM,IAAU,GAAoB,MAClC,MAAK,EAAE,iBAAiB,CAC1B;EAIA,OAAO;GACL;GACA,UAAU,GAAQ,YAAY,GAAS;GACvC,aAAa,GAAQ,eAAe,GAAS;EAC/C;CACF,CAAC,KAAK;CAER,OACE,kBAAC,GAAD;EACe;EACD;EACC;EACb,kBAAkB,GAAc;EAChC,mBAAmB;EACnB,iBAAiB;EACL;EACI;EACF;EACM;EACH;EACJ;EACb,oBAAoB,GAAc;CACnC,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynapsePortalChatDialog.d.ts","sourceRoot":"","sources":["../../../src/components/SynapseChat/SynapsePortalChatDialog.tsx"],"names":[],"mappings":"AACA,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,GAAG;IAC5D,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,OAAO,EACP,GAAG,eAAe,EACnB,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"SynapsePortalChatDialog.d.ts","sourceRoot":"","sources":["../../../src/components/SynapseChat/SynapsePortalChatDialog.tsx"],"names":[],"mappings":"AACA,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,GAAG;IAC5D,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,OAAO,EACP,GAAG,eAAe,EACnB,EAAE,4BAA4B,2CAgB9B;AAED,eAAe,uBAAuB,CAAA"}
|
|
@@ -7,12 +7,13 @@ function r({ open: r, onClose: i, ...a }) {
|
|
|
7
7
|
open: r,
|
|
8
8
|
onClose: i,
|
|
9
9
|
title: a.chatbotName || "SynapseChat",
|
|
10
|
+
variant: a.variant,
|
|
10
11
|
children: /* @__PURE__ */ n(e, {
|
|
11
12
|
hideTitle: !0,
|
|
12
13
|
textboxPositionOffset: "16px",
|
|
13
14
|
...a
|
|
14
15
|
})
|
|
15
|
-
});
|
|
16
|
+
}, a.variant);
|
|
16
17
|
}
|
|
17
18
|
//#endregion
|
|
18
19
|
export { r as SynapsePortalChatDialog, r as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynapsePortalChatDialog.js","names":[],"sources":["../../../src/components/SynapseChat/SynapsePortalChatDialog.tsx"],"sourcesContent":["import DraggableDialog from '../DraggableDialog/DraggableDialog'\nimport SynapseChat, { SynapseChatProps } from './SynapseChat'\n\nexport type SynapsePortalChatDialogProps = SynapseChatProps & {\n open: boolean\n onClose: () => void\n}\n\n/**\n * A dialog that wraps SynapseChat with externally-controlled open/close state.\n * Only shown when the user is logged in and the PORTAL_CHAT feature flag is enabled.\n */\nexport function SynapsePortalChatDialog({\n open,\n onClose,\n ...chatDialogProps\n}: SynapsePortalChatDialogProps) {\n return (\n <DraggableDialog\n open={open}\n onClose={onClose}\n title={chatDialogProps.chatbotName || 'SynapseChat'}\n >\n <SynapseChat\n hideTitle={true}\n textboxPositionOffset=\"16px\"\n {...chatDialogProps}\n />\n </DraggableDialog>\n )\n}\n\nexport default SynapsePortalChatDialog\n"],"mappings":";;;;AAYA,SAAgB,EAAwB,EACtC,SACA,YACA,GAAG,KAC4B;CAC/B,OACE,kBAAC,GAAD;
|
|
1
|
+
{"version":3,"file":"SynapsePortalChatDialog.js","names":[],"sources":["../../../src/components/SynapseChat/SynapsePortalChatDialog.tsx"],"sourcesContent":["import DraggableDialog from '../DraggableDialog/DraggableDialog'\nimport SynapseChat, { SynapseChatProps } from './SynapseChat'\n\nexport type SynapsePortalChatDialogProps = SynapseChatProps & {\n open: boolean\n onClose: () => void\n}\n\n/**\n * A dialog that wraps SynapseChat with externally-controlled open/close state.\n * Only shown when the user is logged in and the PORTAL_CHAT feature flag is enabled.\n */\nexport function SynapsePortalChatDialog({\n open,\n onClose,\n ...chatDialogProps\n}: SynapsePortalChatDialogProps) {\n return (\n <DraggableDialog\n key={chatDialogProps.variant}\n open={open}\n onClose={onClose}\n title={chatDialogProps.chatbotName || 'SynapseChat'}\n variant={chatDialogProps.variant}\n >\n <SynapseChat\n hideTitle={true}\n textboxPositionOffset=\"16px\"\n {...chatDialogProps}\n />\n </DraggableDialog>\n )\n}\n\nexport default SynapsePortalChatDialog\n"],"mappings":";;;;AAYA,SAAgB,EAAwB,EACtC,SACA,YACA,GAAG,KAC4B;CAC/B,OACE,kBAAC,GAAD;EAEQ;EACG;EACT,OAAO,EAAgB,eAAe;EACtC,SAAS,EAAgB;YAEzB,kBAAC,GAAD;GACE,WAAW;GACX,uBAAsB;GACtB,GAAI;EACL,CAAA;CACc,GAXV,EAAgB,OAWN;AAErB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TanStackTableUtils.d.ts","sourceRoot":"","sources":["../../../src/components/TanStackTable/TanStackTableUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,UAExD;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,UAExD;AAID,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"TanStackTableUtils.d.ts","sourceRoot":"","sources":["../../../src/components/TanStackTable/TanStackTableUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,UAExD;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,UAExD;AAID,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAsBzE"}
|
|
@@ -7,16 +7,16 @@ function t(e) {
|
|
|
7
7
|
}
|
|
8
8
|
function n(e) {
|
|
9
9
|
let t = e.getIsPinned(), n = t === "left" && e.getIsLastColumn("left"), r = t === "right" && e.getIsFirstColumn("right");
|
|
10
|
-
return {
|
|
11
|
-
background:
|
|
10
|
+
return t ? {
|
|
11
|
+
background: "inherit",
|
|
12
12
|
boxShadow: n ? "-4px 0 4px -4px gray inset" : r ? "4px 0 4px -4px gray inset" : void 0,
|
|
13
13
|
left: t === "left" ? `${e.getStart("left")}px` : void 0,
|
|
14
14
|
right: t === "right" ? `${e.getAfter("right")}px` : void 0,
|
|
15
|
-
opacity:
|
|
16
|
-
position:
|
|
15
|
+
opacity: .95,
|
|
16
|
+
position: "sticky",
|
|
17
17
|
width: e.getSize(),
|
|
18
|
-
zIndex:
|
|
19
|
-
};
|
|
18
|
+
zIndex: 1
|
|
19
|
+
} : {};
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
export { e as getColumnSizeCssVariable, n as getCommonPinningStyles, t as getHeaderSizeCssVariable };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TanStackTableUtils.js","names":[],"sources":["../../../src/components/TanStackTable/TanStackTableUtils.ts"],"sourcesContent":["import { Column } from '@tanstack/react-table'\nimport { CSSProperties } from 'react'\n\nexport function getColumnSizeCssVariable(columnId: string) {\n return `--col-${columnId}-size`\n}\n\nexport function getHeaderSizeCssVariable(headerId: string) {\n return `--header-${headerId}-size`\n}\n\n// Styles for column pinning, retrieved from TanStack docs examples with very minor modifications\n// See https://tanstack.com/table/v8/docs/framework/react/examples/column-pinning-sticky\nexport function getCommonPinningStyles(column: Column<any>): CSSProperties {\n const isPinned = column.getIsPinned()\n const isLastLeftPinnedColumn =\n isPinned === 'left' && column.getIsLastColumn('left')\n const isFirstRightPinnedColumn =\n isPinned === 'right' && column.getIsFirstColumn('right')\n\n return {\n background:
|
|
1
|
+
{"version":3,"file":"TanStackTableUtils.js","names":[],"sources":["../../../src/components/TanStackTable/TanStackTableUtils.ts"],"sourcesContent":["import { Column } from '@tanstack/react-table'\nimport { CSSProperties } from 'react'\n\nexport function getColumnSizeCssVariable(columnId: string) {\n return `--col-${columnId}-size`\n}\n\nexport function getHeaderSizeCssVariable(headerId: string) {\n return `--header-${headerId}-size`\n}\n\n// Styles for column pinning, retrieved from TanStack docs examples with very minor modifications\n// See https://tanstack.com/table/v8/docs/framework/react/examples/column-pinning-sticky\nexport function getCommonPinningStyles(column: Column<any>): CSSProperties {\n const isPinned = column.getIsPinned()\n const isLastLeftPinnedColumn =\n isPinned === 'left' && column.getIsLastColumn('left')\n const isFirstRightPinnedColumn =\n isPinned === 'right' && column.getIsFirstColumn('right')\n\n if (!isPinned) return {}\n return {\n background: 'inherit',\n boxShadow: isLastLeftPinnedColumn\n ? '-4px 0 4px -4px gray inset'\n : isFirstRightPinnedColumn\n ? '4px 0 4px -4px gray inset'\n : undefined,\n left: isPinned === 'left' ? `${column.getStart('left')}px` : undefined,\n right: isPinned === 'right' ? `${column.getAfter('right')}px` : undefined,\n opacity: 0.95,\n position: 'sticky',\n width: column.getSize(),\n zIndex: 1,\n }\n}\n"],"mappings":";AAGA,SAAgB,EAAyB,GAAkB;CACzD,OAAO,SAAS,EAAS;AAC3B;AAEA,SAAgB,EAAyB,GAAkB;CACzD,OAAO,YAAY,EAAS;AAC9B;AAIA,SAAgB,EAAuB,GAAoC;CACzE,IAAM,IAAW,EAAO,YAAY,GAC9B,IACJ,MAAa,UAAU,EAAO,gBAAgB,MAAM,GAChD,IACJ,MAAa,WAAW,EAAO,iBAAiB,OAAO;CAGzD,OADK,IACE;EACL,YAAY;EACZ,WAAW,IACP,+BACA,IACE,8BACA,KAAA;EACN,MAAM,MAAa,SAAS,GAAG,EAAO,SAAS,MAAM,EAAE,MAAM,KAAA;EAC7D,OAAO,MAAa,UAAU,GAAG,EAAO,SAAS,OAAO,EAAE,MAAM,KAAA;EAChE,SAAS;EACT,UAAU;EACV,OAAO,EAAO,QAAQ;EACtB,QAAQ;CACV,IAdsB,CAAC;AAezB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessRequirementDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/dataaccess/AccessRequirementDashboard.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,8BAA8B,aAAa,CAAA;AACxD,eAAO,MAAM,mCAAmC,qBAAqB,CAAA;AACrE,eAAO,MAAM,4BAA4B,eAAe,CAAA;AACxD,eAAO,MAAM,wBAAwB,SAAS,CAAA;AAE9C,MAAM,MAAM,+BAA+B,GAAG;IAC5C,mCAAmC,CAAC,EAAE,MAAM,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,
|
|
1
|
+
{"version":3,"file":"AccessRequirementDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/dataaccess/AccessRequirementDashboard.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,8BAA8B,aAAa,CAAA;AACxD,eAAO,MAAM,mCAAmC,qBAAqB,CAAA;AACrE,eAAO,MAAM,4BAA4B,eAAe,CAAA;AACxD,eAAO,MAAM,wBAAwB,SAAS,CAAA;AAE9C,MAAM,MAAM,+BAA+B,GAAG;IAC5C,mCAAmC,CAAC,EAAE,MAAM,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,2CA8MvC;AAED,eAAe,0BAA0B,CAAA"}
|
|
@@ -7,86 +7,86 @@ import { AccessRequirementTable as a } from "./AccessRequirementTable.js";
|
|
|
7
7
|
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
8
8
|
import { omitBy as u } from "lodash-es";
|
|
9
9
|
import { Grid as d, InputAdornment as f, TextField as p, Typography as m } from "@mui/material";
|
|
10
|
-
import {
|
|
11
|
-
import { EntityType as
|
|
12
|
-
import { SearchOutlined as
|
|
13
|
-
import { useLocation as
|
|
14
|
-
import { useDebouncedState as
|
|
10
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
|
+
import { EntityType as v } from "@sage-bionetworks/synapse-client";
|
|
12
|
+
import { SearchOutlined as y } from "@mui/icons-material";
|
|
13
|
+
import { useLocation as b, useNavigate as x } from "react-router";
|
|
14
|
+
import { useDebouncedState as S } from "@react-hookz/web";
|
|
15
15
|
//#region src/components/dataaccess/AccessRequirementDashboard.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let { onCreateNewAccessRequirementClicked:
|
|
16
|
+
var C = "nameOrID", w = "relatedProjectId", T = "reviewerId", E = "type";
|
|
17
|
+
function D(D) {
|
|
18
|
+
let { onCreateNewAccessRequirementClicked: O } = D, k = b(), A = c(() => new URLSearchParams(k.search), [k.search]), j = x(), [M, N] = S(A.get("nameOrID") ?? "", 500), [P, F] = S(A.get("relatedProjectId") ?? void 0, 500), [I, L] = S(A.get("reviewerId") ?? void 0, 500), [R, z] = l(A.get("type") ?? void 0), B = c(() => !!(P && !e.exec(P)), [P]), [V, H] = l(!1);
|
|
19
19
|
s(() => {
|
|
20
20
|
let e = u({
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
21
|
+
[C]: M,
|
|
22
|
+
[w]: P,
|
|
23
|
+
[T]: I,
|
|
24
|
+
[E]: R
|
|
25
25
|
}, (e) => e === void 0 || e === ""), t = new URLSearchParams(e);
|
|
26
|
-
|
|
27
|
-
pathname:
|
|
26
|
+
j({
|
|
27
|
+
pathname: k.pathname,
|
|
28
28
|
search: t.toString()
|
|
29
29
|
}, { replace: !0 });
|
|
30
30
|
}, [
|
|
31
|
+
M,
|
|
32
|
+
P,
|
|
33
|
+
I,
|
|
34
|
+
R,
|
|
31
35
|
j,
|
|
32
|
-
|
|
33
|
-
F,
|
|
34
|
-
L,
|
|
35
|
-
A,
|
|
36
|
-
O.pathname
|
|
36
|
+
k.pathname
|
|
37
37
|
]);
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
}, [
|
|
38
|
+
let U = o((e) => {
|
|
39
|
+
L(e || void 0);
|
|
40
|
+
}, [L]);
|
|
41
41
|
return /* @__PURE__ */ g("div", {
|
|
42
42
|
className: "AccessRequirementDashboard",
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ _(h, { children: [
|
|
44
|
+
/* @__PURE__ */ g(i, {
|
|
45
45
|
configuration: {
|
|
46
46
|
initialScope: n.ALL_PROJECTS,
|
|
47
47
|
initialContainer: null,
|
|
48
48
|
selectMultiple: !1,
|
|
49
|
-
selectableTypes: [
|
|
49
|
+
selectableTypes: [v.project],
|
|
50
50
|
treeOnly: !0
|
|
51
51
|
},
|
|
52
|
-
show:
|
|
52
|
+
show: V,
|
|
53
53
|
onCancel: () => {
|
|
54
|
-
|
|
54
|
+
H(!1);
|
|
55
55
|
},
|
|
56
56
|
title: "Select Project to Filter Access Requirements",
|
|
57
57
|
promptCopy: "Select a project to find Access Requirements that are associated with that project. Access Requirements will be found if the Access Requirement is applied to the project, or if it is applied to any item inside the project.",
|
|
58
58
|
onConfirm: (e) => {
|
|
59
|
-
|
|
59
|
+
F(e[0].targetId), H(!1);
|
|
60
60
|
},
|
|
61
61
|
confirmButtonCopy: "Select"
|
|
62
62
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ _(d, {
|
|
64
64
|
component: "form",
|
|
65
65
|
container: !0,
|
|
66
66
|
spacing: 2,
|
|
67
67
|
className: "InputPanel",
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ g(d, {
|
|
70
70
|
size: {
|
|
71
71
|
xs: 12,
|
|
72
72
|
md: 4
|
|
73
73
|
},
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ g(p, {
|
|
75
75
|
label: "Filter by Access Requirement Name or ID",
|
|
76
76
|
id: "ar-name-filter",
|
|
77
77
|
type: "text",
|
|
78
78
|
fullWidth: !0,
|
|
79
79
|
placeholder: "Search for an Access Requirement Name or ID",
|
|
80
80
|
onChange: (e) => {
|
|
81
|
-
|
|
81
|
+
N(e.target.value);
|
|
82
82
|
},
|
|
83
|
-
slotProps: { input: { endAdornment: /* @__PURE__ */
|
|
83
|
+
slotProps: { input: { endAdornment: /* @__PURE__ */ g(f, {
|
|
84
84
|
position: "end",
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ g(y, {})
|
|
86
86
|
}) } }
|
|
87
87
|
})
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ _(d, {
|
|
90
90
|
size: {
|
|
91
91
|
xs: 12,
|
|
92
92
|
md: 4
|
|
@@ -96,58 +96,58 @@ function E(E) {
|
|
|
96
96
|
gap: "5px",
|
|
97
97
|
alignItems: "stretch"
|
|
98
98
|
},
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ g(p, {
|
|
100
100
|
label: "Filter by Project",
|
|
101
101
|
id: "project-id-filter",
|
|
102
102
|
type: "text",
|
|
103
103
|
fullWidth: !0,
|
|
104
104
|
placeholder: "Enter a project SynID",
|
|
105
|
-
error:
|
|
106
|
-
helperText:
|
|
105
|
+
error: B,
|
|
106
|
+
helperText: B ? "Value must be a Synapse ID, e.g. \"syn1234\"" : void 0,
|
|
107
107
|
onChange: (e) => {
|
|
108
108
|
let t = e.target.value;
|
|
109
|
-
|
|
109
|
+
F(t === "" ? void 0 : t);
|
|
110
110
|
}
|
|
111
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ g(r, {
|
|
112
112
|
variant: "outlined",
|
|
113
113
|
color: "primary",
|
|
114
114
|
onClick: () => {
|
|
115
|
-
|
|
115
|
+
H(!0);
|
|
116
116
|
},
|
|
117
117
|
children: "Browse"
|
|
118
118
|
})]
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ _(d, {
|
|
121
121
|
size: {
|
|
122
122
|
xs: 12,
|
|
123
123
|
md: 4
|
|
124
124
|
},
|
|
125
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ g(m, {
|
|
126
126
|
component: "label",
|
|
127
127
|
variant: "smallText2",
|
|
128
128
|
htmlFor: "reviewer-filter",
|
|
129
129
|
children: "Filter by Reviewer"
|
|
130
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ g(t, {
|
|
131
131
|
inputId: "reviewer-filter",
|
|
132
132
|
placeholder: "Search for a username or team name",
|
|
133
|
-
defaultValue:
|
|
134
|
-
onChange:
|
|
133
|
+
defaultValue: I,
|
|
134
|
+
onChange: U
|
|
135
135
|
})]
|
|
136
136
|
})
|
|
137
137
|
]
|
|
138
138
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
nameOrID:
|
|
141
|
-
relatedProjectId:
|
|
142
|
-
reviewerId:
|
|
143
|
-
onCreateNewAccessRequirementClicked:
|
|
144
|
-
typeFilter:
|
|
145
|
-
onTypeFilterChange:
|
|
139
|
+
/* @__PURE__ */ g(a, {
|
|
140
|
+
nameOrID: M,
|
|
141
|
+
relatedProjectId: P,
|
|
142
|
+
reviewerId: I,
|
|
143
|
+
onCreateNewAccessRequirementClicked: O,
|
|
144
|
+
typeFilter: R,
|
|
145
|
+
onTypeFilterChange: z
|
|
146
146
|
})
|
|
147
|
-
]
|
|
147
|
+
] })
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
|
-
export {
|
|
151
|
+
export { C as AR_NAME_OR_ID_SEARCH_PARAM_KEY, E as AR_TYPE_SEARCH_PARAM_KEY, D as AccessRequirementDashboard, D as default, w as RELATED_PROJECT_ID_SEARCH_PARAM_KEY, T as REVIEWER_ID_SEARCH_PARAM_KEY };
|
|
152
152
|
|
|
153
153
|
//# sourceMappingURL=AccessRequirementDashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessRequirementDashboard.js","names":[],"sources":["../../../src/components/dataaccess/AccessRequirementDashboard.tsx"],"sourcesContent":["import { InputSizedButton } from '@/components/styled/InputSizedButton'\nimport { SYNAPSE_ENTITY_ID_REGEX } from '@/utils/functions/RegularExpressions'\nimport { SearchOutlined } from '@mui/icons-material'\nimport { Grid, InputAdornment, TextField, Typography } from '@mui/material'\nimport { useDebouncedState } from '@react-hookz/web'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\nimport { omitBy } from 'lodash-es'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router'\nimport { EntityFinderModal } from '../EntityFinder/EntityFinderModal'\nimport { FinderScope } from '../EntityFinder/tree/EntityTree'\nimport UserSearchBox from '../UserSearchBox/UserSearchBox'\nimport { AccessRequirementTable } from './AccessRequirementTable'\n\nexport const AR_NAME_OR_ID_SEARCH_PARAM_KEY = 'nameOrID'\nexport const RELATED_PROJECT_ID_SEARCH_PARAM_KEY = 'relatedProjectId'\nexport const REVIEWER_ID_SEARCH_PARAM_KEY = 'reviewerId'\nexport const AR_TYPE_SEARCH_PARAM_KEY = 'type'\n\nexport type AccessRequirementDashboardProps = {\n onCreateNewAccessRequirementClicked?: () => void\n}\n\nexport function AccessRequirementDashboard(\n props: AccessRequirementDashboardProps,\n) {\n // Amount of time to wait after an input value changes before sending a new request\n const INPUT_CHANGE_DEBOUNCE_DELAY_MS = 500\n\n const { onCreateNewAccessRequirementClicked } = props\n\n const location = useLocation()\n const urlSearchParams = useMemo(\n () => new URLSearchParams(location.search),\n [location.search],\n )\n const navigate = useNavigate()\n\n /**\n * When an input changes, update the props passed to the table and update the search params.\n *\n * Debounced to prevent firing many queries while the user is entering text.\n */\n const [nameOrID, setNameOrID] = useDebouncedState<string>(\n urlSearchParams.get(AR_NAME_OR_ID_SEARCH_PARAM_KEY) ?? '',\n INPUT_CHANGE_DEBOUNCE_DELAY_MS,\n )\n const [relatedProjectId, setRelatedProjectId] = useDebouncedState<\n string | undefined\n >(\n urlSearchParams.get(RELATED_PROJECT_ID_SEARCH_PARAM_KEY) ?? undefined,\n INPUT_CHANGE_DEBOUNCE_DELAY_MS,\n )\n const [reviewerId, setReviewerId] = useDebouncedState<string | undefined>(\n urlSearchParams.get(REVIEWER_ID_SEARCH_PARAM_KEY) ?? undefined,\n INPUT_CHANGE_DEBOUNCE_DELAY_MS,\n )\n const [typeFilter, setTypeFilter] = useState<string | undefined>(\n urlSearchParams.get(AR_TYPE_SEARCH_PARAM_KEY) ?? undefined,\n )\n\n const projectFilterFieldIsError: boolean = useMemo(\n () =>\n !!(relatedProjectId && !SYNAPSE_ENTITY_ID_REGEX.exec(relatedProjectId)),\n [relatedProjectId],\n )\n\n const [showEntityFinder, setShowEntityFinder] = useState(false)\n\n // Update the QueryParams when the filter state changes\n useEffect(() => {\n // Don't include undefined/empty parameters\n const params = omitBy(\n {\n // Sync the search params state with the debounced props\n [AR_NAME_OR_ID_SEARCH_PARAM_KEY]: nameOrID,\n [RELATED_PROJECT_ID_SEARCH_PARAM_KEY]: relatedProjectId,\n [REVIEWER_ID_SEARCH_PARAM_KEY]: reviewerId,\n [AR_TYPE_SEARCH_PARAM_KEY]: typeFilter, // typeFilter state is not debounced\n },\n item => item === undefined || item === '',\n ) as Record<string, string>\n\n // Add the new params to the URL\n // Replace history because intuitively, the user has not navigated to a new page\n const paramsObject = new URLSearchParams(params)\n navigate(\n {\n pathname: location.pathname,\n search: paramsObject.toString(),\n },\n { replace: true },\n )\n }, [\n nameOrID,\n relatedProjectId,\n reviewerId,\n typeFilter,\n navigate,\n location.pathname,\n ])\n\n const onReviewerChange = useCallback(\n (selected: string | null) => {\n if (selected) {\n setReviewerId(selected)\n } else {\n setReviewerId(undefined)\n }\n },\n [setReviewerId],\n )\n\n return (\n <div className=\"AccessRequirementDashboard\">\n <EntityFinderModal\n configuration={{\n initialScope: FinderScope.ALL_PROJECTS,\n initialContainer: null,\n selectMultiple: false,\n selectableTypes: [EntityType.project],\n treeOnly: true,\n }}\n show={showEntityFinder}\n onCancel={() => {\n setShowEntityFinder(false)\n }}\n title={'Select Project to Filter Access Requirements'}\n promptCopy={\n 'Select a project to find Access Requirements that are associated with that project. Access Requirements will be found if the Access Requirement is applied to the project, or if it is applied to any item inside the project.'\n }\n onConfirm={selected => {\n setRelatedProjectId(selected[0].targetId)\n setShowEntityFinder(false)\n }}\n confirmButtonCopy={'Select'}\n />\n <Grid component={'form'} container spacing={2} className=\"InputPanel\">\n <Grid size={{ xs: 12, md: 4 }}>\n <TextField\n label=\"Filter by Access Requirement Name or ID\"\n id=\"ar-name-filter\"\n type=\"text\"\n fullWidth\n placeholder=\"Search for an Access Requirement Name or ID\"\n onChange={e => {\n setNameOrID(e.target.value)\n }}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\">\n <SearchOutlined />\n </InputAdornment>\n ),\n },\n }}\n />\n </Grid>\n <Grid\n size={{ xs: 12, md: 4 }}\n sx={{\n display: 'flex',\n gap: '5px',\n alignItems: 'stretch',\n }}\n >\n <TextField\n label=\"Filter by Project\"\n id=\"project-id-filter\"\n type=\"text\"\n fullWidth\n placeholder=\"Enter a project SynID\"\n error={projectFilterFieldIsError}\n helperText={\n projectFilterFieldIsError\n ? 'Value must be a Synapse ID, e.g. \"syn1234\"'\n : undefined\n }\n onChange={e => {\n const newValue = e.target.value\n if (newValue === '') {\n setRelatedProjectId(undefined)\n } else {\n setRelatedProjectId(newValue)\n }\n }}\n />\n <InputSizedButton\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n setShowEntityFinder(true)\n }}\n >\n Browse\n </InputSizedButton>\n </Grid>\n <Grid size={{ xs: 12, md: 4 }}>\n <Typography\n component=\"label\"\n variant=\"smallText2\"\n htmlFor=\"reviewer-filter\"\n >\n Filter by Reviewer\n </Typography>\n <UserSearchBox\n inputId=\"reviewer-filter\"\n placeholder=\"Search for a username or team name\"\n defaultValue={reviewerId}\n onChange={onReviewerChange}\n />\n </Grid>\n </Grid>\n <AccessRequirementTable\n nameOrID={nameOrID}\n relatedProjectId={relatedProjectId}\n reviewerId={reviewerId}\n onCreateNewAccessRequirementClicked={\n onCreateNewAccessRequirementClicked\n }\n typeFilter={typeFilter}\n onTypeFilterChange={setTypeFilter}\n />\n </div>\n )\n}\n\nexport default AccessRequirementDashboard\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"AccessRequirementDashboard.js","names":[],"sources":["../../../src/components/dataaccess/AccessRequirementDashboard.tsx"],"sourcesContent":["import { InputSizedButton } from '@/components/styled/InputSizedButton'\nimport { SYNAPSE_ENTITY_ID_REGEX } from '@/utils/functions/RegularExpressions'\nimport { SearchOutlined } from '@mui/icons-material'\nimport { Grid, InputAdornment, TextField, Typography } from '@mui/material'\nimport { useDebouncedState } from '@react-hookz/web'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\nimport { omitBy } from 'lodash-es'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router'\nimport { EntityFinderModal } from '../EntityFinder/EntityFinderModal'\nimport { FinderScope } from '../EntityFinder/tree/EntityTree'\nimport UserSearchBox from '../UserSearchBox/UserSearchBox'\nimport { AccessRequirementTable } from './AccessRequirementTable'\n\nexport const AR_NAME_OR_ID_SEARCH_PARAM_KEY = 'nameOrID'\nexport const RELATED_PROJECT_ID_SEARCH_PARAM_KEY = 'relatedProjectId'\nexport const REVIEWER_ID_SEARCH_PARAM_KEY = 'reviewerId'\nexport const AR_TYPE_SEARCH_PARAM_KEY = 'type'\n\nexport type AccessRequirementDashboardProps = {\n onCreateNewAccessRequirementClicked?: () => void\n}\n\nexport function AccessRequirementDashboard(\n props: AccessRequirementDashboardProps,\n) {\n // Amount of time to wait after an input value changes before sending a new request\n const INPUT_CHANGE_DEBOUNCE_DELAY_MS = 500\n\n const { onCreateNewAccessRequirementClicked } = props\n\n const location = useLocation()\n const urlSearchParams = useMemo(\n () => new URLSearchParams(location.search),\n [location.search],\n )\n const navigate = useNavigate()\n\n /**\n * When an input changes, update the props passed to the table and update the search params.\n *\n * Debounced to prevent firing many queries while the user is entering text.\n */\n const [nameOrID, setNameOrID] = useDebouncedState<string>(\n urlSearchParams.get(AR_NAME_OR_ID_SEARCH_PARAM_KEY) ?? '',\n INPUT_CHANGE_DEBOUNCE_DELAY_MS,\n )\n const [relatedProjectId, setRelatedProjectId] = useDebouncedState<\n string | undefined\n >(\n urlSearchParams.get(RELATED_PROJECT_ID_SEARCH_PARAM_KEY) ?? undefined,\n INPUT_CHANGE_DEBOUNCE_DELAY_MS,\n )\n const [reviewerId, setReviewerId] = useDebouncedState<string | undefined>(\n urlSearchParams.get(REVIEWER_ID_SEARCH_PARAM_KEY) ?? undefined,\n INPUT_CHANGE_DEBOUNCE_DELAY_MS,\n )\n const [typeFilter, setTypeFilter] = useState<string | undefined>(\n urlSearchParams.get(AR_TYPE_SEARCH_PARAM_KEY) ?? undefined,\n )\n\n const projectFilterFieldIsError: boolean = useMemo(\n () =>\n !!(relatedProjectId && !SYNAPSE_ENTITY_ID_REGEX.exec(relatedProjectId)),\n [relatedProjectId],\n )\n\n const [showEntityFinder, setShowEntityFinder] = useState(false)\n\n // Update the QueryParams when the filter state changes\n useEffect(() => {\n // Don't include undefined/empty parameters\n const params = omitBy(\n {\n // Sync the search params state with the debounced props\n [AR_NAME_OR_ID_SEARCH_PARAM_KEY]: nameOrID,\n [RELATED_PROJECT_ID_SEARCH_PARAM_KEY]: relatedProjectId,\n [REVIEWER_ID_SEARCH_PARAM_KEY]: reviewerId,\n [AR_TYPE_SEARCH_PARAM_KEY]: typeFilter, // typeFilter state is not debounced\n },\n item => item === undefined || item === '',\n ) as Record<string, string>\n\n // Add the new params to the URL\n // Replace history because intuitively, the user has not navigated to a new page\n const paramsObject = new URLSearchParams(params)\n navigate(\n {\n pathname: location.pathname,\n search: paramsObject.toString(),\n },\n { replace: true },\n )\n }, [\n nameOrID,\n relatedProjectId,\n reviewerId,\n typeFilter,\n navigate,\n location.pathname,\n ])\n\n const onReviewerChange = useCallback(\n (selected: string | null) => {\n if (selected) {\n setReviewerId(selected)\n } else {\n setReviewerId(undefined)\n }\n },\n [setReviewerId],\n )\n\n const accessRequirementsPanel = (\n <>\n <EntityFinderModal\n configuration={{\n initialScope: FinderScope.ALL_PROJECTS,\n initialContainer: null,\n selectMultiple: false,\n selectableTypes: [EntityType.project],\n treeOnly: true,\n }}\n show={showEntityFinder}\n onCancel={() => {\n setShowEntityFinder(false)\n }}\n title={'Select Project to Filter Access Requirements'}\n promptCopy={\n 'Select a project to find Access Requirements that are associated with that project. Access Requirements will be found if the Access Requirement is applied to the project, or if it is applied to any item inside the project.'\n }\n onConfirm={selected => {\n setRelatedProjectId(selected[0].targetId)\n setShowEntityFinder(false)\n }}\n confirmButtonCopy={'Select'}\n />\n <Grid component={'form'} container spacing={2} className=\"InputPanel\">\n <Grid size={{ xs: 12, md: 4 }}>\n <TextField\n label=\"Filter by Access Requirement Name or ID\"\n id=\"ar-name-filter\"\n type=\"text\"\n fullWidth\n placeholder=\"Search for an Access Requirement Name or ID\"\n onChange={e => {\n setNameOrID(e.target.value)\n }}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\">\n <SearchOutlined />\n </InputAdornment>\n ),\n },\n }}\n />\n </Grid>\n <Grid\n size={{ xs: 12, md: 4 }}\n sx={{\n display: 'flex',\n gap: '5px',\n alignItems: 'stretch',\n }}\n >\n <TextField\n label=\"Filter by Project\"\n id=\"project-id-filter\"\n type=\"text\"\n fullWidth\n placeholder=\"Enter a project SynID\"\n error={projectFilterFieldIsError}\n helperText={\n projectFilterFieldIsError\n ? 'Value must be a Synapse ID, e.g. \"syn1234\"'\n : undefined\n }\n onChange={e => {\n const newValue = e.target.value\n if (newValue === '') {\n setRelatedProjectId(undefined)\n } else {\n setRelatedProjectId(newValue)\n }\n }}\n />\n <InputSizedButton\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n setShowEntityFinder(true)\n }}\n >\n Browse\n </InputSizedButton>\n </Grid>\n <Grid size={{ xs: 12, md: 4 }}>\n <Typography\n component=\"label\"\n variant=\"smallText2\"\n htmlFor=\"reviewer-filter\"\n >\n Filter by Reviewer\n </Typography>\n <UserSearchBox\n inputId=\"reviewer-filter\"\n placeholder=\"Search for a username or team name\"\n defaultValue={reviewerId}\n onChange={onReviewerChange}\n />\n </Grid>\n </Grid>\n <AccessRequirementTable\n nameOrID={nameOrID}\n relatedProjectId={relatedProjectId}\n reviewerId={reviewerId}\n onCreateNewAccessRequirementClicked={\n onCreateNewAccessRequirementClicked\n }\n typeFilter={typeFilter}\n onTypeFilterChange={setTypeFilter}\n />\n </>\n )\n\n return (\n <div className=\"AccessRequirementDashboard\">{accessRequirementsPanel}</div>\n )\n}\n\nexport default AccessRequirementDashboard\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EDucTemplateTable.d.ts","sourceRoot":"","sources":["../../../src/components/dataaccess/EDucTemplateTable.tsx"],"names":[],"mappings":"AAiKA,wBAAgB,iBAAiB,4CAuEhC;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { SynapseSpinner as e } from "../LoadingScreen/LoadingScreen.js";
|
|
2
|
+
import { useGetEDucTemplateValidation as t, useListEDucTemplates as n } from "../../synapse-queries/dataaccess/useEDuc.js";
|
|
3
|
+
import "../../synapse-queries/index.js";
|
|
4
|
+
import { formatDate as r } from "../../utils/functions/DateFormatter.js";
|
|
5
|
+
import i from "../TanStackTable/StyledTanStackTable.js";
|
|
6
|
+
import a from "../TanStackTable/ColumnHeader.js";
|
|
7
|
+
import { useEffect as o, useMemo as s, useState as c } from "react";
|
|
8
|
+
import { Alert as l, Box as u, Button as d, IconButton as f, Skeleton as p, Tooltip as m, Typography as h } from "@mui/material";
|
|
9
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
|
+
import { CheckCircleTwoTone as v, ErrorTwoTone as y, Replay as b } from "@mui/icons-material";
|
|
11
|
+
import x from "dayjs";
|
|
12
|
+
import { createColumnHelper as S, getCoreRowModel as C, useReactTable as w } from "@tanstack/react-table";
|
|
13
|
+
//#region src/components/dataaccess/EDucTemplateTable.tsx
|
|
14
|
+
var T = S(), E = [
|
|
15
|
+
T.accessor("name", {
|
|
16
|
+
header: (e) => /* @__PURE__ */ g(a, {
|
|
17
|
+
...e,
|
|
18
|
+
title: "Name"
|
|
19
|
+
}),
|
|
20
|
+
cell: ({ getValue: e }) => e() ?? "",
|
|
21
|
+
enableSorting: !1,
|
|
22
|
+
enableColumnFilter: !1
|
|
23
|
+
}),
|
|
24
|
+
T.accessor("description", {
|
|
25
|
+
header: (e) => /* @__PURE__ */ g(a, {
|
|
26
|
+
...e,
|
|
27
|
+
title: "Description"
|
|
28
|
+
}),
|
|
29
|
+
cell: ({ getValue: e }) => e() ?? "",
|
|
30
|
+
enableSorting: !1,
|
|
31
|
+
enableColumnFilter: !1
|
|
32
|
+
}),
|
|
33
|
+
T.accessor("createdOn", {
|
|
34
|
+
header: (e) => /* @__PURE__ */ g(a, {
|
|
35
|
+
...e,
|
|
36
|
+
title: "Created on"
|
|
37
|
+
}),
|
|
38
|
+
cell: ({ getValue: e }) => {
|
|
39
|
+
let t = e();
|
|
40
|
+
return t ? r(x(t)) : "";
|
|
41
|
+
},
|
|
42
|
+
enableSorting: !1,
|
|
43
|
+
enableColumnFilter: !1
|
|
44
|
+
}),
|
|
45
|
+
T.accessor("modifiedOn", {
|
|
46
|
+
header: (e) => /* @__PURE__ */ g(a, {
|
|
47
|
+
...e,
|
|
48
|
+
title: "Modified on"
|
|
49
|
+
}),
|
|
50
|
+
cell: ({ getValue: e }) => {
|
|
51
|
+
let t = e();
|
|
52
|
+
return t ? r(x(t)) : "";
|
|
53
|
+
},
|
|
54
|
+
enableSorting: !1,
|
|
55
|
+
enableColumnFilter: !1
|
|
56
|
+
}),
|
|
57
|
+
T.display({
|
|
58
|
+
id: "validation",
|
|
59
|
+
header: (e) => /* @__PURE__ */ g(a, {
|
|
60
|
+
...e,
|
|
61
|
+
title: "Validation status"
|
|
62
|
+
}),
|
|
63
|
+
cell: ({ row: e }) => /* @__PURE__ */ g(D, { templateId: e.original.templateId })
|
|
64
|
+
})
|
|
65
|
+
];
|
|
66
|
+
function D(n) {
|
|
67
|
+
let { templateId: r } = n, [i, a] = c(!1), { data: o, error: s, isFetching: l, refetch: p } = t(r ?? "", { enabled: i && !!r });
|
|
68
|
+
return r ? i ? l ? /* @__PURE__ */ g(u, {
|
|
69
|
+
sx: {
|
|
70
|
+
display: "inline-flex",
|
|
71
|
+
alignItems: "center"
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ g(e, { size: 16 })
|
|
74
|
+
}) : s ? /* @__PURE__ */ _(u, {
|
|
75
|
+
sx: {
|
|
76
|
+
display: "inline-flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
gap: .5
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ g(y, {
|
|
82
|
+
color: "error",
|
|
83
|
+
fontSize: "small"
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ g(h, {
|
|
86
|
+
variant: "smallText1",
|
|
87
|
+
sx: { color: "error.main" },
|
|
88
|
+
children: s.reason
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ g(m, {
|
|
91
|
+
title: "Re-validate",
|
|
92
|
+
children: /* @__PURE__ */ g(f, {
|
|
93
|
+
size: "small",
|
|
94
|
+
onClick: () => {
|
|
95
|
+
p();
|
|
96
|
+
},
|
|
97
|
+
"aria-label": "Re-validate",
|
|
98
|
+
children: /* @__PURE__ */ g(b, { fontSize: "small" })
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
}) : o?.isValid ? /* @__PURE__ */ _(u, {
|
|
103
|
+
sx: {
|
|
104
|
+
display: "inline-flex",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
gap: .5
|
|
107
|
+
},
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ g(v, {
|
|
110
|
+
color: "success",
|
|
111
|
+
fontSize: "small"
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ g(h, {
|
|
114
|
+
variant: "smallText1",
|
|
115
|
+
children: "Valid"
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ g(m, {
|
|
118
|
+
title: "Re-validate",
|
|
119
|
+
children: /* @__PURE__ */ g(f, {
|
|
120
|
+
size: "small",
|
|
121
|
+
onClick: () => {
|
|
122
|
+
p();
|
|
123
|
+
},
|
|
124
|
+
"aria-label": "Re-validate",
|
|
125
|
+
children: /* @__PURE__ */ g(b, { fontSize: "small" })
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}) : /* @__PURE__ */ _(u, {
|
|
130
|
+
sx: {
|
|
131
|
+
display: "inline-flex",
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
gap: .5
|
|
134
|
+
},
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ g(y, {
|
|
137
|
+
color: "error",
|
|
138
|
+
fontSize: "small"
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ g(h, {
|
|
141
|
+
variant: "smallText1",
|
|
142
|
+
sx: { color: "error.main" },
|
|
143
|
+
children: o?.reason ?? "Invalid"
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ g(m, {
|
|
146
|
+
title: "Re-validate",
|
|
147
|
+
children: /* @__PURE__ */ g(f, {
|
|
148
|
+
size: "small",
|
|
149
|
+
onClick: () => {
|
|
150
|
+
p();
|
|
151
|
+
},
|
|
152
|
+
"aria-label": "Re-validate",
|
|
153
|
+
children: /* @__PURE__ */ g(b, { fontSize: "small" })
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}) : /* @__PURE__ */ g(d, {
|
|
158
|
+
variant: "outlined",
|
|
159
|
+
size: "small",
|
|
160
|
+
onClick: () => a(!0),
|
|
161
|
+
children: "Validate"
|
|
162
|
+
}) : null;
|
|
163
|
+
}
|
|
164
|
+
function O() {
|
|
165
|
+
let { data: e, isLoading: t, error: r, hasNextPage: a, fetchNextPage: c, isFetchingNextPage: d } = n();
|
|
166
|
+
o(() => {
|
|
167
|
+
a && !d && c();
|
|
168
|
+
}, [
|
|
169
|
+
a,
|
|
170
|
+
d,
|
|
171
|
+
c
|
|
172
|
+
]);
|
|
173
|
+
let f = s(() => e?.pages.flatMap((e) => e.results ?? []) ?? [], [e]), m = w({
|
|
174
|
+
data: f,
|
|
175
|
+
columns: E,
|
|
176
|
+
getCoreRowModel: C(),
|
|
177
|
+
getRowId: (e) => e.templateId ?? ""
|
|
178
|
+
});
|
|
179
|
+
return t || a && f.length === 0 ? /* @__PURE__ */ g(u, { children: /* @__PURE__ */ g(p, {
|
|
180
|
+
variant: "rectangular",
|
|
181
|
+
height: 200,
|
|
182
|
+
"data-testid": "EDucTemplateTable-loading"
|
|
183
|
+
}) }) : r ? /* @__PURE__ */ _(l, {
|
|
184
|
+
severity: "error",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ g("strong", { children: "Sorry, we couldn't load the eDUC templates." }),
|
|
187
|
+
/* @__PURE__ */ g("br", {}),
|
|
188
|
+
r.reason
|
|
189
|
+
]
|
|
190
|
+
}) : f.length === 0 ? /* @__PURE__ */ g(l, {
|
|
191
|
+
severity: "info",
|
|
192
|
+
children: "No eDUC templates are registered in DocuSign."
|
|
193
|
+
}) : /* @__PURE__ */ _(u, { children: [/* @__PURE__ */ _(h, {
|
|
194
|
+
variant: "body1",
|
|
195
|
+
sx: {
|
|
196
|
+
mb: 2,
|
|
197
|
+
color: "grey.700"
|
|
198
|
+
},
|
|
199
|
+
children: [
|
|
200
|
+
"Templates are managed in DocuSign. Use the ",
|
|
201
|
+
/* @__PURE__ */ g("strong", { children: "Validate" }),
|
|
202
|
+
" ",
|
|
203
|
+
"action to check whether a template meets Synapse's eDUC requirements."
|
|
204
|
+
]
|
|
205
|
+
}), /* @__PURE__ */ g(i, {
|
|
206
|
+
table: m,
|
|
207
|
+
styledTableContainerProps: { sx: { my: 2 } }
|
|
208
|
+
})] });
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
export { O as EDucTemplateTable, O as default };
|
|
212
|
+
|
|
213
|
+
//# sourceMappingURL=EDucTemplateTable.js.map
|