synapse-react-client 3.1.40 → 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 +8 -2
- package/dist/index.js +72 -27
- package/dist/index.mjs +225 -180
- package/dist/umd/synapse-react-client.development.js +77 -32
- 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());
|
|
@@ -104821,8 +104833,12 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
104821
104833
|
getPresignedUrlContentQueryKey(fileHandle, request, maxSizeBytes) {
|
|
104822
104834
|
return this.getKey("presignedUrlContent", fileHandle, request, maxSizeBytes);
|
|
104823
104835
|
}
|
|
104824
|
-
getPresignedUrlFromFHAContentQueryKey(fileHandleAssociation) {
|
|
104825
|
-
return this.getKey(
|
|
104836
|
+
getPresignedUrlFromFHAContentQueryKey(fileHandleAssociation, forceAnonymous) {
|
|
104837
|
+
return this.getKey(
|
|
104838
|
+
"presignedUrlContentFromFHA",
|
|
104839
|
+
fileHandleAssociation,
|
|
104840
|
+
forceAnonymous
|
|
104841
|
+
);
|
|
104826
104842
|
}
|
|
104827
104843
|
getProfileImageQueryKey(userId) {
|
|
104828
104844
|
return this.getKey("profileImageData", userId);
|
|
@@ -110242,7 +110258,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
110242
110258
|
}, options2)
|
|
110243
110259
|
);
|
|
110244
110260
|
}
|
|
110245
|
-
function useGetPresignedUrlContentFromFHA(fileHandleAssociation, options2) {
|
|
110261
|
+
function useGetPresignedUrlContentFromFHA(fileHandleAssociation, forceAnonymous = false, options2) {
|
|
110246
110262
|
const { accessToken, keyFactory } = useSynapseContext();
|
|
110247
110263
|
const queryFn = () => __async(this, null, function* () {
|
|
110248
110264
|
const batchFileResult = yield synapse_client_default.getFiles(
|
|
@@ -110252,7 +110268,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
110252
110268
|
includePreSignedURLs: true,
|
|
110253
110269
|
includePreviewPreSignedURLs: false
|
|
110254
110270
|
},
|
|
110255
|
-
accessToken
|
|
110271
|
+
forceAnonymous ? void 0 : accessToken
|
|
110256
110272
|
);
|
|
110257
110273
|
const data = yield synapse_client_default.getFileHandleContent(
|
|
110258
110274
|
batchFileResult.requestedFiles[0].fileHandle,
|
|
@@ -110261,7 +110277,10 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
110261
110277
|
return data;
|
|
110262
110278
|
});
|
|
110263
110279
|
return useQuery(
|
|
110264
|
-
keyFactory.getPresignedUrlFromFHAContentQueryKey(
|
|
110280
|
+
keyFactory.getPresignedUrlFromFHAContentQueryKey(
|
|
110281
|
+
fileHandleAssociation,
|
|
110282
|
+
forceAnonymous
|
|
110283
|
+
),
|
|
110265
110284
|
queryFn,
|
|
110266
110285
|
__spreadValues({
|
|
110267
110286
|
staleTime: Infinity
|
|
@@ -111159,7 +111178,17 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
111159
111178
|
const queryClient = useQueryClient();
|
|
111160
111179
|
const { accessToken, keyFactory } = useSynapseContext();
|
|
111161
111180
|
return useMutation(
|
|
111162
|
-
(
|
|
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
|
+
}),
|
|
111163
111192
|
__spreadProps(__spreadValues({}, options2), {
|
|
111164
111193
|
onSuccess: (data, variables, ctx) => __async(this, null, function* () {
|
|
111165
111194
|
yield queryClient.invalidateQueries(
|
|
@@ -116913,7 +116942,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
116913
116942
|
input: {
|
|
116914
116943
|
gridArea: "1 / 2 / 4 / 4 !important"
|
|
116915
116944
|
}
|
|
116916
|
-
})
|
|
116945
|
+
}),
|
|
116946
|
+
menu: (base) => __spreadProps(__spreadValues({}, base), { zIndex: 2 })
|
|
116917
116947
|
},
|
|
116918
116948
|
components: customSelectComponents,
|
|
116919
116949
|
onChange: (option) => {
|
|
@@ -133857,24 +133887,13 @@ ${e3.message}`);
|
|
|
133857
133887
|
// src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm.tsx
|
|
133858
133888
|
function ResearchProjectForm(props) {
|
|
133859
133889
|
const { onSave, managedACTAccessRequirement, onHide } = props;
|
|
133860
|
-
const [projectLead, setProjectLead] = (0, import_react172.useState)(
|
|
133861
|
-
const [institution, setInstitution] = (0, import_react172.useState)(
|
|
133862
|
-
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);
|
|
133863
133893
|
const [alert, setAlert] = (0, import_react172.useState)();
|
|
133864
133894
|
const { data: existingResearchProject, isLoading: isLoadingInitialData } = useGetResearchProject(String(managedACTAccessRequirement.id), {
|
|
133865
133895
|
// Infinite staleTime ensures this won't be refetched unless explicitly invalidated by the mutation
|
|
133866
133896
|
staleTime: Infinity,
|
|
133867
|
-
onSuccess: (data) => {
|
|
133868
|
-
if (data == null ? void 0 : data.projectLead) {
|
|
133869
|
-
setProjectLead(data == null ? void 0 : data.projectLead);
|
|
133870
|
-
}
|
|
133871
|
-
if (data == null ? void 0 : data.institution) {
|
|
133872
|
-
setInstitution(data == null ? void 0 : data.institution);
|
|
133873
|
-
}
|
|
133874
|
-
if (data == null ? void 0 : data.intendedDataUseStatement) {
|
|
133875
|
-
setIntendedDataUseStatement(data == null ? void 0 : data.intendedDataUseStatement);
|
|
133876
|
-
}
|
|
133877
|
-
},
|
|
133878
133897
|
onError: (e3) => {
|
|
133879
133898
|
console.log(
|
|
133880
133899
|
"RequestDataAccessStep1: Error getting research project data: ",
|
|
@@ -133882,6 +133901,26 @@ ${e3.message}`);
|
|
|
133882
133901
|
);
|
|
133883
133902
|
}
|
|
133884
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
|
+
]);
|
|
133885
133924
|
const { mutate, isLoading: isLoadingUpdate } = useUpdateResearchProject({
|
|
133886
133925
|
onSuccess: (data) => {
|
|
133887
133926
|
if (onSave) {
|
|
@@ -138051,7 +138090,9 @@ ${e3.message}`);
|
|
|
138051
138090
|
const queryRequestCopy = (0, import_react255.useMemo)(() => {
|
|
138052
138091
|
const request = cloneDeep_default(queryBundleRequest);
|
|
138053
138092
|
const fileColumnId = fileColumnModelId || getFileColumnModelId(columnModels);
|
|
138054
|
-
|
|
138093
|
+
if (fileColumnId) {
|
|
138094
|
+
request.query.selectFileColumn = Number(fileColumnId);
|
|
138095
|
+
}
|
|
138055
138096
|
request.partMask = SynapseConstants_exports.BUNDLE_MASK_ACTIONS_REQUIRED;
|
|
138056
138097
|
return request;
|
|
138057
138098
|
}, [columnModels, fileColumnModelId, queryBundleRequest]);
|
|
@@ -173726,11 +173767,15 @@ dl_list_file_entities = syn.get_download_list()`;
|
|
|
173726
173767
|
var TermsAndConditionsItem = (props) => {
|
|
173727
173768
|
const { id: id2, item, enabled, checked, onChange: onChange2, termsAndConditionsTableID } = props;
|
|
173728
173769
|
const { iconFileHandleId, label, description } = item;
|
|
173729
|
-
const { data: iconFileContent } = useGetPresignedUrlContentFromFHA(
|
|
173730
|
-
|
|
173731
|
-
|
|
173732
|
-
|
|
173733
|
-
|
|
173770
|
+
const { data: iconFileContent } = useGetPresignedUrlContentFromFHA(
|
|
173771
|
+
{
|
|
173772
|
+
associateObjectId: termsAndConditionsTableID,
|
|
173773
|
+
associateObjectType: FileHandleAssociateType.TableEntity,
|
|
173774
|
+
fileHandleId: iconFileHandleId
|
|
173775
|
+
},
|
|
173776
|
+
true
|
|
173777
|
+
// force this query to be run as the anonymous user (without an access token)
|
|
173778
|
+
);
|
|
173734
173779
|
const [showDesc, setShowDes] = (0, import_react449.useState)(false);
|
|
173735
173780
|
const [isChecked, setIsChecked] = (0, import_react449.useState)(false);
|
|
173736
173781
|
let mounted = true;
|