synapse-react-client 3.1.41 → 3.1.42
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/index.d.ts +7 -1
- package/dist/index.js +51 -17
- package/dist/index.mjs +204 -170
- package/dist/umd/synapse-react-client.development.js +56 -22
- package/dist/umd/synapse-react-client.development.js.map +2 -2
- package/dist/umd/synapse-react-client.production.min.js +61 -61
- package/package.json +1 -1
|
@@ -34258,7 +34258,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
34258
34258
|
return x3 === y2 && (x3 !== 0 || 1 / x3 === 1 / y2) || x3 !== x3 && y2 !== y2;
|
|
34259
34259
|
}
|
|
34260
34260
|
var objectIs = typeof Object.is === "function" ? Object.is : is2;
|
|
34261
|
-
var useState157 = React665.useState,
|
|
34261
|
+
var useState157 = React665.useState, useEffect122 = React665.useEffect, useLayoutEffect4 = React665.useLayoutEffect, useDebugValue5 = React665.useDebugValue;
|
|
34262
34262
|
var didWarnOld18Alpha = false;
|
|
34263
34263
|
var didWarnUncachedGetSnapshot = false;
|
|
34264
34264
|
function useSyncExternalStore2(subscribe, getSnapshot, getServerSnapshot) {
|
|
@@ -34295,7 +34295,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
34295
34295
|
});
|
|
34296
34296
|
}
|
|
34297
34297
|
}, [subscribe, value, getSnapshot]);
|
|
34298
|
-
|
|
34298
|
+
useEffect122(function() {
|
|
34299
34299
|
if (checkIfSnapshotChanged(inst)) {
|
|
34300
34300
|
forceUpdate({
|
|
34301
34301
|
inst
|
|
@@ -34368,7 +34368,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
34368
34368
|
}
|
|
34369
34369
|
var objectIs = typeof Object.is === "function" ? Object.is : is2;
|
|
34370
34370
|
var useSyncExternalStore2 = shim.useSyncExternalStore;
|
|
34371
|
-
var useRef70 = React665.useRef,
|
|
34371
|
+
var useRef70 = React665.useRef, useEffect122 = React665.useEffect, useMemo72 = React665.useMemo, useDebugValue5 = React665.useDebugValue;
|
|
34372
34372
|
function useSyncExternalStoreWithSelector2(subscribe, getSnapshot, getServerSnapshot, selector, isEqual4) {
|
|
34373
34373
|
var instRef = useRef70(null);
|
|
34374
34374
|
var inst;
|
|
@@ -34425,7 +34425,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
34425
34425
|
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
34426
34426
|
}, [getSnapshot, getServerSnapshot, selector, isEqual4]), getSelection2 = _useMemo[0], getServerSelection = _useMemo[1];
|
|
34427
34427
|
var value = useSyncExternalStore2(subscribe, getSelection2, getServerSelection);
|
|
34428
|
-
|
|
34428
|
+
useEffect122(function() {
|
|
34429
34429
|
inst.hasValue = true;
|
|
34430
34430
|
inst.value = value;
|
|
34431
34431
|
}, [value]);
|
|
@@ -59546,7 +59546,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
59546
59546
|
"package.json"(exports2, module2) {
|
|
59547
59547
|
module2.exports = {
|
|
59548
59548
|
name: "synapse-react-client",
|
|
59549
|
-
version: "3.1.
|
|
59549
|
+
version: "3.1.42",
|
|
59550
59550
|
private: false,
|
|
59551
59551
|
main: "./dist/index.js",
|
|
59552
59552
|
module: "./dist/index.mjs",
|
|
@@ -95464,6 +95464,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
95464
95464
|
getSchema: () => getSchema,
|
|
95465
95465
|
getSchemaBinding: () => getSchemaBinding,
|
|
95466
95466
|
getSchemaValidationResults: () => getSchemaValidationResults,
|
|
95467
|
+
getSubjects: () => getSubjects,
|
|
95467
95468
|
getSubmissionById: () => getSubmissionById,
|
|
95468
95469
|
getSubmissionEligibility: () => getSubmissionEligibility,
|
|
95469
95470
|
getSubmissionTeams: () => getSubmissionTeams,
|
|
@@ -98416,6 +98417,17 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
98416
98417
|
0 /* REPO_ENDPOINT */
|
|
98417
98418
|
);
|
|
98418
98419
|
};
|
|
98420
|
+
function getSubjects(accessToken, requirementId, nextPageToken) {
|
|
98421
|
+
const params = new URLSearchParams();
|
|
98422
|
+
if (nextPageToken) {
|
|
98423
|
+
params.set("nextPageToken", nextPageToken);
|
|
98424
|
+
}
|
|
98425
|
+
return doGet(
|
|
98426
|
+
`/repo/v1/accessRequirement/${requirementId}/subjects?${params.toString()}`,
|
|
98427
|
+
accessToken,
|
|
98428
|
+
0 /* REPO_ENDPOINT */
|
|
98429
|
+
);
|
|
98430
|
+
}
|
|
98419
98431
|
|
|
98420
98432
|
// src/utils/hooks/useDetectSSOCode.ts
|
|
98421
98433
|
var import_react30 = __toESM(require_react());
|
|
@@ -111166,7 +111178,17 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
111166
111178
|
const queryClient = useQueryClient();
|
|
111167
111179
|
const { accessToken, keyFactory } = useSynapseContext();
|
|
111168
111180
|
return useMutation(
|
|
111169
|
-
(
|
|
111181
|
+
(_0) => __async(this, [_0], function* ({ request, accessRequirementId }) {
|
|
111182
|
+
if (request.subjectId == null || request.subjectType == null) {
|
|
111183
|
+
const { subjects } = yield synapse_client_default.getSubjects(
|
|
111184
|
+
accessToken,
|
|
111185
|
+
accessRequirementId
|
|
111186
|
+
);
|
|
111187
|
+
request.subjectId = subjects[0].id;
|
|
111188
|
+
request.subjectType = subjects[0].type;
|
|
111189
|
+
}
|
|
111190
|
+
return synapse_client_default.submitDataAccessRequest(request, accessToken);
|
|
111191
|
+
}),
|
|
111170
111192
|
__spreadProps(__spreadValues({}, options2), {
|
|
111171
111193
|
onSuccess: (data, variables, ctx) => __async(this, null, function* () {
|
|
111172
111194
|
yield queryClient.invalidateQueries(
|
|
@@ -116920,7 +116942,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
116920
116942
|
input: {
|
|
116921
116943
|
gridArea: "1 / 2 / 4 / 4 !important"
|
|
116922
116944
|
}
|
|
116923
|
-
})
|
|
116945
|
+
}),
|
|
116946
|
+
menu: (base) => __spreadProps(__spreadValues({}, base), { zIndex: 2 })
|
|
116924
116947
|
},
|
|
116925
116948
|
components: customSelectComponents,
|
|
116926
116949
|
onChange: (option) => {
|
|
@@ -133864,24 +133887,13 @@ ${e3.message}`);
|
|
|
133864
133887
|
// src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm.tsx
|
|
133865
133888
|
function ResearchProjectForm(props) {
|
|
133866
133889
|
const { onSave, managedACTAccessRequirement, onHide } = props;
|
|
133867
|
-
const [projectLead, setProjectLead] = (0, import_react172.useState)(
|
|
133868
|
-
const [institution, setInstitution] = (0, import_react172.useState)(
|
|
133869
|
-
const [intendedDataUseStatement, setIntendedDataUseStatement] = (0, import_react172.useState)(
|
|
133890
|
+
const [projectLead, setProjectLead] = (0, import_react172.useState)(void 0);
|
|
133891
|
+
const [institution, setInstitution] = (0, import_react172.useState)(void 0);
|
|
133892
|
+
const [intendedDataUseStatement, setIntendedDataUseStatement] = (0, import_react172.useState)(void 0);
|
|
133870
133893
|
const [alert, setAlert] = (0, import_react172.useState)();
|
|
133871
133894
|
const { data: existingResearchProject, isLoading: isLoadingInitialData } = useGetResearchProject(String(managedACTAccessRequirement.id), {
|
|
133872
133895
|
// Infinite staleTime ensures this won't be refetched unless explicitly invalidated by the mutation
|
|
133873
133896
|
staleTime: Infinity,
|
|
133874
|
-
onSuccess: (data) => {
|
|
133875
|
-
if (data == null ? void 0 : data.projectLead) {
|
|
133876
|
-
setProjectLead(data == null ? void 0 : data.projectLead);
|
|
133877
|
-
}
|
|
133878
|
-
if (data == null ? void 0 : data.institution) {
|
|
133879
|
-
setInstitution(data == null ? void 0 : data.institution);
|
|
133880
|
-
}
|
|
133881
|
-
if (data == null ? void 0 : data.intendedDataUseStatement) {
|
|
133882
|
-
setIntendedDataUseStatement(data == null ? void 0 : data.intendedDataUseStatement);
|
|
133883
|
-
}
|
|
133884
|
-
},
|
|
133885
133897
|
onError: (e3) => {
|
|
133886
133898
|
console.log(
|
|
133887
133899
|
"RequestDataAccessStep1: Error getting research project data: ",
|
|
@@ -133889,6 +133901,26 @@ ${e3.message}`);
|
|
|
133889
133901
|
);
|
|
133890
133902
|
}
|
|
133891
133903
|
});
|
|
133904
|
+
(0, import_react172.useEffect)(() => {
|
|
133905
|
+
if (projectLead == void 0 && (existingResearchProject == null ? void 0 : existingResearchProject.projectLead)) {
|
|
133906
|
+
setProjectLead(existingResearchProject == null ? void 0 : existingResearchProject.projectLead);
|
|
133907
|
+
}
|
|
133908
|
+
if (institution == void 0 && (existingResearchProject == null ? void 0 : existingResearchProject.institution)) {
|
|
133909
|
+
setInstitution(existingResearchProject == null ? void 0 : existingResearchProject.institution);
|
|
133910
|
+
}
|
|
133911
|
+
if (intendedDataUseStatement == void 0 && (existingResearchProject == null ? void 0 : existingResearchProject.intendedDataUseStatement)) {
|
|
133912
|
+
setIntendedDataUseStatement(
|
|
133913
|
+
existingResearchProject == null ? void 0 : existingResearchProject.intendedDataUseStatement
|
|
133914
|
+
);
|
|
133915
|
+
}
|
|
133916
|
+
}, [
|
|
133917
|
+
existingResearchProject == null ? void 0 : existingResearchProject.institution,
|
|
133918
|
+
existingResearchProject == null ? void 0 : existingResearchProject.intendedDataUseStatement,
|
|
133919
|
+
existingResearchProject == null ? void 0 : existingResearchProject.projectLead,
|
|
133920
|
+
institution,
|
|
133921
|
+
intendedDataUseStatement,
|
|
133922
|
+
projectLead
|
|
133923
|
+
]);
|
|
133892
133924
|
const { mutate, isLoading: isLoadingUpdate } = useUpdateResearchProject({
|
|
133893
133925
|
onSuccess: (data) => {
|
|
133894
133926
|
if (onSave) {
|
|
@@ -138058,7 +138090,9 @@ ${e3.message}`);
|
|
|
138058
138090
|
const queryRequestCopy = (0, import_react255.useMemo)(() => {
|
|
138059
138091
|
const request = cloneDeep_default(queryBundleRequest);
|
|
138060
138092
|
const fileColumnId = fileColumnModelId || getFileColumnModelId(columnModels);
|
|
138061
|
-
|
|
138093
|
+
if (fileColumnId) {
|
|
138094
|
+
request.query.selectFileColumn = Number(fileColumnId);
|
|
138095
|
+
}
|
|
138062
138096
|
request.partMask = SynapseConstants_exports.BUNDLE_MASK_ACTIONS_REQUIRED;
|
|
138063
138097
|
return request;
|
|
138064
138098
|
}, [columnModels, fileColumnModelId, queryBundleRequest]);
|