synapse-react-client 4.0.33 → 4.0.34
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/components/AccessRequirementList/AccessRequirementList.d.ts +5 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +152 -85
- 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 +163 -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 +22 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +193 -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/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/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 +1 -3
- package/dist/components/StorybookComponentWrapper.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/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/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/style/components/facet_nav/_facet-nav-panel.scss +0 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +5 -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/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/package.json +2 -2
|
@@ -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":";;;;;;;;;;;;;;;AAcA,IAAa,IAAiC,YACjC,IAAsC,oBACtC,IAA+B,cAC/B,IAA2B;AAMxC,SAAgB,EACd,GACA;CAEA,IAEM,EAAE,2CAAwC,GAE1C,IAAW,EAAY,GACvB,IAAkB,QAChB,IAAI,gBAAgB,EAAS,MAAM,GACzC,CAAC,EAAS,MAAM,CAClB,GACM,IAAW,EAAY,GAOvB,CAAC,GAAU,KAAe,EAC9B,EAAgB,IAAA,UAAkC,KAAK,IACvD,GACF,GACM,CAAC,GAAkB,KAAuB,EAG9C,EAAgB,IAAA,kBAAuC,KAAK,KAAA,GAC5D,GACF,GACM,CAAC,GAAY,KAAiB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MAAK;QACb,EAAY,EAAE,OAAO,KAAK;OAC5B;OACA,WAAW,EACT,OAAO,EACL,cACE,kBAAC,GAAD;QAAgB,UAAS;kBACvB,kBAAC,GAAD,CAAiB,CAAA;OACH,CAAA,EAEpB,EACF;MACD,CAAA;KACG,CAAA;KACN,kBAAC,GAAD;MACE,MAAM;OAAE,IAAI;OAAI,IAAI;MAAE;MACtB,IAAI;OACF,SAAS;OACT,KAAK;OACL,YAAY;MACd;gBANF,CAQE,kBAAC,GAAD;OACE,OAAM;OACN,IAAG;OACH,MAAK;OACL,WAAA;OACA,aAAY;OACZ,OAAO;OACP,YACE,IACI,iDACA,KAAA;OAEN,WAAU,MAAK;QACb,IAAM,IAAW,EAAE,OAAO;QAC1B,AACE,EADE,MAAa,KACK,KAAA,IAEA,CAAQ;OAEhC;MACD,CAAA,GACD,kBAAC,GAAD;OACE,SAAQ;OACR,OAAM;OACN,eAAe;QACb,EAAoB,EAAI;OAC1B;iBACD;MAEiB,CAAA,CACd;;KACN,kBAAC,GAAD;MAAM,MAAM;OAAE,IAAI;OAAI,IAAI;MAAE;gBAA5B,CACE,kBAAC,GAAD;OACE,WAAU;OACV,SAAQ;OACR,SAAQ;iBACT;MAEW,CAAA,GACZ,kBAAC,GAAD;OACE,SAAQ;OACR,aAAY;OACZ,cAAc;OACd,UAAU;MACX,CAAA,CACG;;IACF;;GACN,kBAAC,GAAD;IACY;IACQ;IACN;IAEV;IAEU;IACZ,oBAAoB;GACrB,CAAA;EACE;;AAET"}
|
|
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":";;;;;;;;;;;;;;;AAcA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d,UAAU;MACX,CAAA,CACG;;IACF;;GACN,kBAAC,GAAD;IACY;IACQ;IACN;IAEV;IAEU;IACZ,oBAAoB;GACrB,CAAA;EACD,EAAA,CAI2C;CAA6B,CAAA;AAE9E"}
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EDucTemplateTable.js","names":[],"sources":["../../../src/components/dataaccess/EDucTemplateTable.tsx"],"sourcesContent":["import {\n useGetEDucTemplateValidation,\n useListEDucTemplates,\n} from '@/synapse-queries'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { CheckCircleTwoTone, ErrorTwoTone, Replay } from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n IconButton,\n Skeleton,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { EDucTemplate } from '@sage-bionetworks/synapse-client'\nimport {\n createColumnHelper,\n getCoreRowModel,\n useReactTable,\n} from '@tanstack/react-table'\nimport dayjs from 'dayjs'\nimport { useEffect, useMemo, useState } from 'react'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport ColumnHeader from '../TanStackTable/ColumnHeader'\nimport StyledTanStackTable from '../TanStackTable/StyledTanStackTable'\n\nconst columnHelper = createColumnHelper<EDucTemplate>()\n\nconst columns = [\n columnHelper.accessor('name', {\n header: props => <ColumnHeader {...props} title={'Name'} />,\n cell: ({ getValue }) => getValue() ?? '',\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('description', {\n header: props => <ColumnHeader {...props} title={'Description'} />,\n cell: ({ getValue }) => getValue() ?? '',\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('createdOn', {\n header: props => <ColumnHeader {...props} title={'Created on'} />,\n cell: ({ getValue }) => {\n const value = getValue()\n return value ? formatDate(dayjs(value)) : ''\n },\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('modifiedOn', {\n header: props => <ColumnHeader {...props} title={'Modified on'} />,\n cell: ({ getValue }) => {\n const value = getValue()\n return value ? formatDate(dayjs(value)) : ''\n },\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.display({\n id: 'validation',\n header: props => <ColumnHeader {...props} title={'Validation status'} />,\n cell: ({ row }) => <ValidationCell templateId={row.original.templateId} />,\n }),\n]\n\nfunction ValidationCell(props: { templateId: string | undefined }) {\n const { templateId } = props\n const [hasRequestedValidation, setHasRequestedValidation] = useState(false)\n\n const { data, error, isFetching, refetch } = useGetEDucTemplateValidation(\n templateId ?? '',\n { enabled: hasRequestedValidation && Boolean(templateId) },\n )\n\n if (!templateId) return null\n\n if (!hasRequestedValidation) {\n return (\n <Button\n variant={'outlined'}\n size={'small'}\n onClick={() => setHasRequestedValidation(true)}\n >\n Validate\n </Button>\n )\n }\n\n if (isFetching) {\n return (\n <Box sx={{ display: 'inline-flex', alignItems: 'center' }}>\n <SynapseSpinner size={16} />\n </Box>\n )\n }\n\n if (error) {\n return (\n <Box sx={{ display: 'inline-flex', alignItems: 'center', gap: 0.5 }}>\n <ErrorTwoTone color={'error'} fontSize={'small'} />\n <Typography variant={'smallText1'} sx={{ color: 'error.main' }}>\n {error.reason}\n </Typography>\n <Tooltip title={'Re-validate'}>\n <IconButton\n size={'small'}\n onClick={() => {\n refetch()\n }}\n aria-label={'Re-validate'}\n >\n <Replay fontSize={'small'} />\n </IconButton>\n </Tooltip>\n </Box>\n )\n }\n\n if (data?.isValid) {\n return (\n <Box sx={{ display: 'inline-flex', alignItems: 'center', gap: 0.5 }}>\n <CheckCircleTwoTone color={'success'} fontSize={'small'} />\n <Typography variant={'smallText1'}>Valid</Typography>\n <Tooltip title={'Re-validate'}>\n <IconButton\n size={'small'}\n onClick={() => {\n refetch()\n }}\n aria-label={'Re-validate'}\n >\n <Replay fontSize={'small'} />\n </IconButton>\n </Tooltip>\n </Box>\n )\n }\n\n return (\n <Box sx={{ display: 'inline-flex', alignItems: 'center', gap: 0.5 }}>\n <ErrorTwoTone color={'error'} fontSize={'small'} />\n <Typography variant={'smallText1'} sx={{ color: 'error.main' }}>\n {data?.reason ?? 'Invalid'}\n </Typography>\n <Tooltip title={'Re-validate'}>\n <IconButton\n size={'small'}\n onClick={() => {\n refetch()\n }}\n aria-label={'Re-validate'}\n >\n <Replay fontSize={'small'} />\n </IconButton>\n </Tooltip>\n </Box>\n )\n}\n\nexport function EDucTemplateTable() {\n const {\n data,\n isLoading,\n error,\n hasNextPage,\n fetchNextPage,\n isFetchingNextPage,\n } = useListEDucTemplates()\n\n useEffect(() => {\n if (hasNextPage && !isFetchingNextPage) {\n void fetchNextPage()\n }\n }, [hasNextPage, isFetchingNextPage, fetchNextPage])\n\n const templates = useMemo(\n () => data?.pages.flatMap(page => page.results ?? []) ?? [],\n [data],\n )\n\n const table = useReactTable<EDucTemplate>({\n data: templates,\n columns,\n getCoreRowModel: getCoreRowModel(),\n getRowId: row => row.templateId ?? '',\n })\n\n if (isLoading || (hasNextPage && templates.length === 0)) {\n return (\n <Box>\n <Skeleton\n variant={'rectangular'}\n height={200}\n data-testid={'EDucTemplateTable-loading'}\n />\n </Box>\n )\n }\n\n if (error) {\n return (\n <Alert severity={'error'}>\n <strong>Sorry, we couldn't load the eDUC templates.</strong>\n <br />\n {error.reason}\n </Alert>\n )\n }\n\n if (templates.length === 0) {\n return (\n <Alert severity={'info'}>\n No eDUC templates are registered in DocuSign.\n </Alert>\n )\n }\n\n return (\n <Box>\n <Typography variant={'body1'} sx={{ mb: 2, color: 'grey.700' }}>\n Templates are managed in DocuSign. Use the <strong>Validate</strong>{' '}\n action to check whether a template meets Synapse's eDUC\n requirements.\n </Typography>\n <StyledTanStackTable\n table={table}\n styledTableContainerProps={{ sx: { my: 2 } }}\n />\n </Box>\n )\n}\n\nexport default EDucTemplateTable\n"],"mappings":";;;;;;;;;;;;;AA2BA,IAAM,IAAe,EAAiC,GAEhD,IAAU;CACd,EAAa,SAAS,QAAQ;EAC5B,SAAQ,MAAS,kBAAC,GAAD;GAAc,GAAI;GAAO,OAAO;EAAS,CAAA;EAC1D,OAAO,EAAE,kBAAe,EAAS,KAAK;EACtC,eAAe;EACf,oBAAoB;CACtB,CAAC;CACD,EAAa,SAAS,eAAe;EACnC,SAAQ,MAAS,kBAAC,GAAD;GAAc,GAAI;GAAO,OAAO;EAAgB,CAAA;EACjE,OAAO,EAAE,kBAAe,EAAS,KAAK;EACtC,eAAe;EACf,oBAAoB;CACtB,CAAC;CACD,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SAAQ,MAAQ,EAAK,WAAW,CAAC,CAAC,KAAK,CAAC,GAC1D,CAAC,CAAI,CACP,GAEM,IAAQ,EAA4B;EACxC,MAAM;EACN;EACA,iBAAiB,EAAgB;EACjC,WAAU,MAAO,EAAI,cAAc;CACrC,CAAC;CAgCD,OA9BI,KAAc,KAAe,EAAU,WAAW,IAElD,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EACE,SAAS;EACT,QAAQ;EACR,eAAa;CACd,CAAA,EACE,CAAA,IAIL,IAEA,kBAAC,GAAD;EAAO,UAAU;YAAjB;GACE,kBAAC,UAAD,EAAA,UAAQ,8CAAwD,CAAA;GAChE,kBAAC,MAAD,CAAK,CAAA;GACJ,EAAM;EACF;MAIP,EAAU,WAAW,IAErB,kBAAC,GAAD;EAAO,UAAU;YAAQ;CAElB,CAAA,IAKT,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;EAAY,SAAS;EAAS,IAAI;GAAE,IAAI;GAAG,OAAO;EAAW;YAA7D;GAAgE;GACnB,kBAAC,UAAD,EAAA,UAAQ,WAAgB,CAAA;GAAE;GAAI;EAG/D;KACZ,kBAAC,GAAD;EACS;EACP,2BAA2B,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;CAC5C,CAAA,CACE,EAAA,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewerDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/dataaccess/ReviewerDashboard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReviewerDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/dataaccess/ReviewerDashboard.tsx"],"names":[],"mappings":"AAuCA,KAAK,sBAAsB,GAAG;IAC5B,iGAAiG;IACjG,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,wGAAwG;IACxG,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAgH9D;AAUD,eAAe,iBAAiB,CAAA"}
|
|
@@ -6,66 +6,76 @@ import i from "../OrientationBanner/index.js";
|
|
|
6
6
|
import { UserHistoryDashboard as a } from "./AccessHistoryDashboard.js";
|
|
7
7
|
import { AccessRequirementDashboard as o } from "./AccessRequirementDashboard.js";
|
|
8
8
|
import { DataAccessSubmissionDashboard as s } from "./AccessSubmissionDashboard.js";
|
|
9
|
-
import c from "./
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { RouterProvider as x } from "react-router
|
|
9
|
+
import { EDucTemplateTable as c } from "./EDucTemplateTable.js";
|
|
10
|
+
import l from "./SubmissionPage/SubmissionPage.js";
|
|
11
|
+
import { useMemo as u } from "react";
|
|
12
|
+
import { Typography as d } from "@mui/material";
|
|
13
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
14
|
+
import { NavLink as h, Navigate as g, Outlet as _, RouterProvider as v, createBrowserRouter as y, createMemoryRouter as b, useParams as x } from "react-router";
|
|
15
|
+
import { RouterProvider as S } from "react-router/dom";
|
|
15
16
|
//#region src/components/dataaccess/ReviewerDashboard.tsx
|
|
16
|
-
function
|
|
17
|
+
function C(e) {
|
|
17
18
|
let { href: t, children: n, icon: i } = e;
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ m(h, {
|
|
19
20
|
className: "Tab",
|
|
20
21
|
role: "tab",
|
|
21
22
|
to: t,
|
|
22
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ p(r, {
|
|
23
24
|
icon: i,
|
|
24
25
|
sx: { paddingRight: "0.2rem" }
|
|
25
|
-
}), /* @__PURE__ */
|
|
26
|
+
}), /* @__PURE__ */ p(d, {
|
|
26
27
|
variant: "buttonLink",
|
|
27
28
|
children: n
|
|
28
29
|
})]
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
let { routerBaseName:
|
|
32
|
+
function w(r) {
|
|
33
|
+
let { routerBaseName: l = "/DataAccessManagement:default", useMemoryRouter: d = !1 } = r, { data: h, isLoading: g } = n(), x = h?.isACTMember, w = h?.isACTMember || h?.isARReviewer, E = u(() => [{
|
|
33
34
|
path: "/",
|
|
34
|
-
element: /* @__PURE__ */
|
|
35
|
+
element: /* @__PURE__ */ m("div", {
|
|
35
36
|
className: "ReviewerDashboard",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ m("div", {
|
|
37
38
|
className: "Tabs",
|
|
38
39
|
role: "tablist",
|
|
39
40
|
children: [
|
|
40
|
-
|
|
41
|
+
x && /* @__PURE__ */ p(C, {
|
|
41
42
|
href: "/AccessRequirements",
|
|
42
43
|
icon: "accessClosed",
|
|
43
44
|
children: "Access Requirements"
|
|
44
45
|
}),
|
|
45
|
-
|
|
46
|
+
x && /* @__PURE__ */ p(C, {
|
|
47
|
+
href: "/EDucTemplates",
|
|
48
|
+
icon: "fileOutlined",
|
|
49
|
+
children: "eDUC Templates"
|
|
50
|
+
}),
|
|
51
|
+
w && /* @__PURE__ */ p(C, {
|
|
46
52
|
href: "/Submissions",
|
|
47
53
|
icon: "discussion",
|
|
48
54
|
children: "Submissions"
|
|
49
55
|
}),
|
|
50
|
-
|
|
56
|
+
w && /* @__PURE__ */ p(C, {
|
|
51
57
|
href: "/UserAccessHistory",
|
|
52
58
|
icon: "history",
|
|
53
59
|
children: "User Access History"
|
|
54
60
|
})
|
|
55
61
|
]
|
|
56
|
-
}), /* @__PURE__ */
|
|
62
|
+
}), /* @__PURE__ */ p("div", {
|
|
57
63
|
className: "TabContentContainer",
|
|
58
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ p(e, { children: /* @__PURE__ */ p(_, {}) })
|
|
59
65
|
})]
|
|
60
66
|
}),
|
|
61
67
|
children: [
|
|
62
68
|
{
|
|
63
69
|
path: "AccessRequirements",
|
|
64
|
-
element:
|
|
70
|
+
element: x ? /* @__PURE__ */ p(o, {}) : null
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: "EDucTemplates",
|
|
74
|
+
element: x ? /* @__PURE__ */ p(c, {}) : null
|
|
65
75
|
},
|
|
66
76
|
{
|
|
67
77
|
path: "Submissions",
|
|
68
|
-
element:
|
|
78
|
+
element: w ? /* @__PURE__ */ m(f, { children: [!x && /* @__PURE__ */ p(i, {
|
|
69
79
|
name: "DataAccessManagement",
|
|
70
80
|
title: "Getting Started With Data Access Management",
|
|
71
81
|
text: "When someone requests access to data, that request will show up here. Clicking on the Request ID will take you to a page where you can review the request.",
|
|
@@ -73,32 +83,32 @@ function C(r) {
|
|
|
73
83
|
margin: "-20px -30px 20px -30px",
|
|
74
84
|
width: "auto"
|
|
75
85
|
}
|
|
76
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ p(s, {})] }) : null
|
|
77
87
|
},
|
|
78
88
|
{
|
|
79
89
|
path: "Submissions/:id",
|
|
80
|
-
element:
|
|
90
|
+
element: w ? /* @__PURE__ */ p(T, {}) : null
|
|
81
91
|
},
|
|
82
92
|
{
|
|
83
93
|
path: "UserAccessHistory",
|
|
84
|
-
element: /* @__PURE__ */
|
|
94
|
+
element: /* @__PURE__ */ p(a, {})
|
|
85
95
|
}
|
|
86
96
|
]
|
|
87
|
-
}], [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
}], [x, w]), D = u(() => d ? b(E, { basename: l }) : y(E, { basename: l }), [
|
|
98
|
+
d,
|
|
99
|
+
E,
|
|
100
|
+
l
|
|
91
101
|
]);
|
|
92
|
-
return
|
|
102
|
+
return g ? /* @__PURE__ */ p(t, { size: 50 }) : p(d ? v : S, { router: D });
|
|
93
103
|
}
|
|
94
|
-
function
|
|
95
|
-
let { id: e } =
|
|
96
|
-
return e ? /* @__PURE__ */
|
|
104
|
+
function T() {
|
|
105
|
+
let { id: e } = x();
|
|
106
|
+
return e ? /* @__PURE__ */ p(l, {
|
|
97
107
|
submissionId: e,
|
|
98
108
|
isReviewer: !0
|
|
99
|
-
}) : /* @__PURE__ */
|
|
109
|
+
}) : /* @__PURE__ */ p(g, { to: "Submissions/" });
|
|
100
110
|
}
|
|
101
111
|
//#endregion
|
|
102
|
-
export {
|
|
112
|
+
export { w as ReviewerDashboard, w as default };
|
|
103
113
|
|
|
104
114
|
//# sourceMappingURL=ReviewerDashboard.js.map
|