synapse-react-client 3.0.1 → 3.0.4
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/containers/EntityBadgeIcons.js +4 -4
- package/dist/containers/EntityBadgeIcons.js.map +1 -1
- package/dist/containers/EntityLink.js +1 -1
- package/dist/containers/EntityLink.js.map +1 -1
- package/dist/containers/Login.d.ts +1 -0
- package/dist/containers/Login.js +3 -2
- package/dist/containers/Login.js.map +1 -1
- package/dist/containers/MissingQueryResultsWarning.js +1 -1
- package/dist/containers/MissingQueryResultsWarning.js.map +1 -1
- package/dist/containers/QueryCount.js +1 -1
- package/dist/containers/QueryCount.js.map +1 -1
- package/dist/containers/QueryWrapper.js +2 -2
- package/dist/containers/QueryWrapper.js.map +1 -1
- package/dist/containers/download_list/DownloadConfirmation.d.ts +5 -0
- package/dist/containers/download_list/DownloadConfirmation.js +19 -17
- package/dist/containers/download_list/DownloadConfirmation.js.map +1 -1
- package/dist/containers/download_list_v2/RequestDownloadCard.js +1 -1
- package/dist/containers/download_list_v2/RequestDownloadCard.js.map +1 -1
- package/dist/containers/entity/annotations/SchemaDrivenAnnotationEditor.js +5 -4
- package/dist/containers/entity/annotations/SchemaDrivenAnnotationEditor.js.map +1 -1
- package/dist/containers/entity/metadata/AnnotationsTable.js +3 -3
- package/dist/containers/entity/metadata/AnnotationsTable.js.map +1 -1
- package/dist/containers/entity/metadata/EntityModal.js +1 -1
- package/dist/containers/entity/metadata/EntityModal.js.map +1 -1
- package/dist/containers/entity/metadata/MetadataTable.js +1 -1
- package/dist/containers/entity/metadata/MetadataTable.js.map +1 -1
- package/dist/containers/entity_finder/SelectionPane.js +1 -1
- package/dist/containers/entity_finder/SelectionPane.js.map +1 -1
- package/dist/containers/entity_finder/details/configurations/EntityChildrenDetails.js +1 -1
- package/dist/containers/entity_finder/details/configurations/EntityChildrenDetails.js.map +1 -1
- package/dist/containers/entity_finder/details/view/DetailsViewTableRenderers.js +2 -2
- package/dist/containers/entity_finder/details/view/DetailsViewTableRenderers.js.map +1 -1
- package/dist/containers/entity_finder/tree/EntityTree.js +1 -1
- package/dist/containers/entity_finder/tree/EntityTree.js.map +1 -1
- package/dist/containers/home_page/featured_tools/FeaturedToolsList.js +1 -1
- package/dist/containers/home_page/featured_tools/FeaturedToolsList.js.map +1 -1
- package/dist/containers/home_page/goals/Goals.js +1 -1
- package/dist/containers/home_page/goals/Goals.js.map +1 -1
- package/dist/containers/home_page/programs/Programs.js +1 -1
- package/dist/containers/home_page/programs/Programs.js.map +1 -1
- package/dist/containers/home_page/project_view_carousel/ProjectViewCarousel.js +3 -2
- package/dist/containers/home_page/project_view_carousel/ProjectViewCarousel.js.map +1 -1
- package/dist/containers/home_page/resources/Resources.js +1 -1
- package/dist/containers/home_page/resources/Resources.js.map +1 -1
- package/dist/containers/query_wrapper_plot_nav/QueryWrapperPlotNav.js +2 -2
- package/dist/containers/query_wrapper_plot_nav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/containers/table/StandaloneQueryWrapper.js +1 -1
- package/dist/containers/table/StandaloneQueryWrapper.js.map +1 -1
- package/dist/containers/table/datasets/DatasetItemsEditor.js +1 -1
- package/dist/containers/table/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/umd/synapse-react-client.development.js +219 -135
- package/dist/umd/synapse-react-client.development.js.map +3 -3
- package/dist/umd/synapse-react-client.production.min.js +74 -74
- package/dist/utils/SynapseClient.d.ts +3 -1
- package/dist/utils/SynapseClient.js +18 -3
- package/dist/utils/SynapseClient.js.map +1 -1
- package/dist/utils/hooks/SynapseAPI/entity/queryKeys.d.ts +80 -0
- package/dist/utils/hooks/SynapseAPI/entity/queryKeys.js +59 -0
- package/dist/utils/hooks/SynapseAPI/entity/queryKeys.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/{useEntity.d.ts → entity/useEntity.d.ts} +4 -4
- package/dist/utils/hooks/SynapseAPI/{useEntity.js → entity/useEntity.js} +13 -16
- package/dist/utils/hooks/SynapseAPI/entity/useEntity.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/entity/useEntityBoundSchema.d.ts +7 -0
- package/dist/utils/hooks/SynapseAPI/entity/useEntityBoundSchema.js +18 -0
- package/dist/utils/hooks/SynapseAPI/entity/useEntityBoundSchema.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/{useEntityBundle.d.ts → entity/useEntityBundle.d.ts} +3 -3
- package/dist/utils/hooks/SynapseAPI/{useEntityBundle.js → entity/useEntityBundle.js} +4 -3
- package/dist/utils/hooks/SynapseAPI/entity/useEntityBundle.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/{useGetEntityChildren.d.ts → entity/useGetEntityChildren.d.ts} +3 -3
- package/dist/utils/hooks/SynapseAPI/{useGetEntityChildren.js → entity/useGetEntityChildren.js} +5 -4
- package/dist/utils/hooks/SynapseAPI/entity/useGetEntityChildren.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/{useGetEntityHeaders.d.ts → entity/useGetEntityHeaders.d.ts} +3 -3
- package/dist/utils/hooks/SynapseAPI/{useGetEntityHeaders.js → entity/useGetEntityHeaders.js} +2 -2
- package/dist/utils/hooks/SynapseAPI/entity/useGetEntityHeaders.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/{useGetQueryResultBundle.d.ts → entity/useGetQueryResultBundle.d.ts} +3 -3
- package/dist/utils/hooks/SynapseAPI/{useGetQueryResultBundle.js → entity/useGetQueryResultBundle.js} +6 -5
- package/dist/utils/hooks/SynapseAPI/entity/useGetQueryResultBundle.js.map +1 -0
- package/dist/utils/hooks/SynapseAPI/useSchema.d.ts +0 -4
- package/dist/utils/hooks/SynapseAPI/useSchema.js +1 -12
- package/dist/utils/hooks/SynapseAPI/useSchema.js.map +1 -1
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListQueryResponse.d.ts +5 -0
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListQueryResponse.js +3 -0
- package/dist/utils/synapseTypes/DownloadListV2/DownloadListQueryResponse.js.map +1 -0
- package/package.json +1 -1
- package/dist/utils/hooks/SynapseAPI/useEntity.js.map +0 -1
- package/dist/utils/hooks/SynapseAPI/useEntityBundle.js.map +0 -1
- package/dist/utils/hooks/SynapseAPI/useGetEntityChildren.js.map +0 -1
- package/dist/utils/hooks/SynapseAPI/useGetEntityHeaders.js.map +0 -1
- package/dist/utils/hooks/SynapseAPI/useGetQueryResultBundle.js.map +0 -1
|
@@ -30596,6 +30596,7 @@ var SRC = (() => {
|
|
|
30596
30596
|
bindOAuthProviderToAccount: () => bindOAuthProviderToAccount,
|
|
30597
30597
|
cancelDataAccessRequest: () => cancelDataAccessRequest,
|
|
30598
30598
|
changePasswordWithCurrentPassword: () => changePasswordWithCurrentPassword,
|
|
30599
|
+
changePasswordWithToken: () => changePasswordWithToken,
|
|
30599
30600
|
checkUploadComplete: () => checkUploadComplete,
|
|
30600
30601
|
clearDownloadListV2: () => clearDownloadListV2,
|
|
30601
30602
|
consentToOAuth2Request: () => consentToOAuth2Request,
|
|
@@ -30718,6 +30719,7 @@ var SRC = (() => {
|
|
|
30718
30719
|
rejectFormData: () => rejectFormData,
|
|
30719
30720
|
removeItemFromDownloadListV2: () => removeItemFromDownloadListV2,
|
|
30720
30721
|
removeUserFavorite: () => removeUserFavorite,
|
|
30722
|
+
resetPassword: () => resetPassword,
|
|
30721
30723
|
searchEntities: () => searchEntities,
|
|
30722
30724
|
setAccessTokenCookie: () => setAccessTokenCookie,
|
|
30723
30725
|
signOut: () => signOut,
|
|
@@ -35487,8 +35489,9 @@ var SRC = (() => {
|
|
|
35487
35489
|
});
|
|
35488
35490
|
}
|
|
35489
35491
|
render() {
|
|
35490
|
-
var _a;
|
|
35492
|
+
var _a, _b;
|
|
35491
35493
|
const registerAccountUrl = (_a = this.props.registerAccountUrl) != null ? _a : `${getEndpoint(BackendDestinationEnum.PORTAL_ENDPOINT)}#!RegisterAccount:0`;
|
|
35494
|
+
const resetPasswordUrl = (_b = this.props.resetPasswordUrl) != null ? _b : `${getEndpoint(BackendDestinationEnum.PORTAL_ENDPOINT)}#!PasswordReset:0`;
|
|
35492
35495
|
return /* @__PURE__ */ React10.createElement("div", {
|
|
35493
35496
|
id: "loginPage",
|
|
35494
35497
|
className: "container LoginComponent SRC-syn-border-spacing bootstrap-4-backport"
|
|
@@ -35526,7 +35529,7 @@ var SRC = (() => {
|
|
|
35526
35529
|
value: this.state.password,
|
|
35527
35530
|
onChange: this.handleChange
|
|
35528
35531
|
}), this.getLoginFailureView(), /* @__PURE__ */ React10.createElement("a", {
|
|
35529
|
-
href:
|
|
35532
|
+
href: resetPasswordUrl
|
|
35530
35533
|
}, "Forgot password?"), /* @__PURE__ */ React10.createElement(import_react_bootstrap2.Button, {
|
|
35531
35534
|
variant: "primary-500",
|
|
35532
35535
|
onSubmit: this.handleLogin,
|
|
@@ -36641,7 +36644,8 @@ var SRC = (() => {
|
|
|
36641
36644
|
requestDetails: queryRequestDetails
|
|
36642
36645
|
};
|
|
36643
36646
|
const asyncJobId = yield doPost("/repo/v1/download/list/query/async/start", downloadListQueryRequest, accessToken, void 0, BackendDestinationEnum.REPO_ENDPOINT);
|
|
36644
|
-
|
|
36647
|
+
const response = yield getAsyncResultBodyFromJobId(asyncJobId.token, `/repo/v1/download/list/query/async/get/${asyncJobId.token}`, accessToken);
|
|
36648
|
+
return response.responseDetails;
|
|
36645
36649
|
});
|
|
36646
36650
|
var clearDownloadListV2 = (accessToken) => {
|
|
36647
36651
|
return doDelete("/repo/v1/download/list", accessToken, void 0, BackendDestinationEnum.REPO_ENDPOINT);
|
|
@@ -36735,6 +36739,14 @@ var SRC = (() => {
|
|
|
36735
36739
|
var changePasswordWithCurrentPassword = (newPassword, accessToken) => {
|
|
36736
36740
|
return doPost("/auth/v1/user/changePassword", newPassword, accessToken, void 0, BackendDestinationEnum.REPO_ENDPOINT);
|
|
36737
36741
|
};
|
|
36742
|
+
var changePasswordWithToken = (newPassword) => {
|
|
36743
|
+
return doPost("/auth/v1/user/changePassword", newPassword, void 0, void 0, BackendDestinationEnum.REPO_ENDPOINT);
|
|
36744
|
+
};
|
|
36745
|
+
var resetPassword = (email) => {
|
|
36746
|
+
const endpoint = window.location.href + "?passwordResetToken=";
|
|
36747
|
+
const url = `/auth/v1/user/password/reset?passwordResetEndpoint=${encodeURIComponent(endpoint)}`;
|
|
36748
|
+
return doPost(url, { email }, void 0, void 0, BackendDestinationEnum.REPO_ENDPOINT);
|
|
36749
|
+
};
|
|
36738
36750
|
|
|
36739
36751
|
// src/lib/containers/UserCardSmall.tsx
|
|
36740
36752
|
var import_react19 = __toModule(require_react());
|
|
@@ -59820,14 +59832,76 @@ Please refer to our full <a target="_blank" href="https://help.synapse.org/docs/
|
|
|
59820
59832
|
return facet.facetType === "enumeration" && facet.facetValues.length == 1 && facet.facetValues[0].value == SynapseConstants_exports.VALUE_NOT_SET;
|
|
59821
59833
|
};
|
|
59822
59834
|
|
|
59823
|
-
// src/lib/utils/hooks/SynapseAPI/
|
|
59835
|
+
// src/lib/utils/hooks/SynapseAPI/entity/queryKeys.ts
|
|
59836
|
+
var entityQueryKeys = {
|
|
59837
|
+
all: [{ objectType: "entity" }],
|
|
59838
|
+
entity: (id2) => [__spreadProps(__spreadValues({}, entityQueryKeys.all[0]), { id: id2 })],
|
|
59839
|
+
version: (id2, versionNumber) => [
|
|
59840
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.entity(id2)[0]), {
|
|
59841
|
+
versionNumber
|
|
59842
|
+
})
|
|
59843
|
+
],
|
|
59844
|
+
versions: (id2) => [
|
|
59845
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.entity(id2)[0]), {
|
|
59846
|
+
scope: "versions"
|
|
59847
|
+
})
|
|
59848
|
+
],
|
|
59849
|
+
versionsQuery: (id2, limit, offset2) => [
|
|
59850
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.versions(id2)[0]), {
|
|
59851
|
+
versionQuery: {
|
|
59852
|
+
limit,
|
|
59853
|
+
offset: offset2
|
|
59854
|
+
}
|
|
59855
|
+
})
|
|
59856
|
+
],
|
|
59857
|
+
json: (id2) => [__spreadProps(__spreadValues({}, entityQueryKeys.entity(id2)[0]), { scope: "json" })],
|
|
59858
|
+
path: (id2) => [__spreadProps(__spreadValues({}, entityQueryKeys.entity(id2)[0]), { scope: "path" })],
|
|
59859
|
+
bundle: (id2, versionNumber, bundleRequest) => [
|
|
59860
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.version(id2, versionNumber)[0]), {
|
|
59861
|
+
scope: "entityBundle",
|
|
59862
|
+
entityBundleRequest: bundleRequest
|
|
59863
|
+
})
|
|
59864
|
+
],
|
|
59865
|
+
children: (request, infinite) => {
|
|
59866
|
+
var _a;
|
|
59867
|
+
return [
|
|
59868
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.entity((_a = request.parentId) != null ? _a : "root")[0]), {
|
|
59869
|
+
scope: "children",
|
|
59870
|
+
isInfinite: infinite,
|
|
59871
|
+
entityChildrenRequest: request
|
|
59872
|
+
})
|
|
59873
|
+
];
|
|
59874
|
+
},
|
|
59875
|
+
tableQueryResult: (queryBundleRequest, infinite) => [
|
|
59876
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.entity(queryBundleRequest.entityId)[0]), {
|
|
59877
|
+
scope: "tableQueryResult",
|
|
59878
|
+
isInfinite: infinite,
|
|
59879
|
+
tableQueryBundleRequest: queryBundleRequest
|
|
59880
|
+
})
|
|
59881
|
+
],
|
|
59882
|
+
boundJSONSchema: (id2) => [
|
|
59883
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.entity(id2)[0]), {
|
|
59884
|
+
scope: "boundJSONSchema"
|
|
59885
|
+
})
|
|
59886
|
+
],
|
|
59887
|
+
schemaValidationResults: (id2) => [
|
|
59888
|
+
__spreadProps(__spreadValues({}, entityQueryKeys.entity(id2)[0]), {
|
|
59889
|
+
scope: "schemaValidationResults"
|
|
59890
|
+
})
|
|
59891
|
+
]
|
|
59892
|
+
};
|
|
59893
|
+
function invalidateAllQueriesForEntity(queryClient, id2) {
|
|
59894
|
+
return queryClient.invalidateQueries(entityQueryKeys.entity(id2));
|
|
59895
|
+
}
|
|
59896
|
+
|
|
59897
|
+
// src/lib/utils/hooks/SynapseAPI/entity/useGetQueryResultBundle.ts
|
|
59824
59898
|
function useGetQueryResultBundle(queryBundleRequest, options2) {
|
|
59825
59899
|
const { accessToken } = useSynapseContext();
|
|
59826
|
-
return useQuery(
|
|
59900
|
+
return useQuery(entityQueryKeys.tableQueryResult(queryBundleRequest, false), () => SynapseClient_exports.getQueryTableResults(queryBundleRequest, accessToken), options2);
|
|
59827
59901
|
}
|
|
59828
59902
|
function useInfiniteQueryResultBundle(queryBundleRequest, options2) {
|
|
59829
59903
|
const { accessToken } = useSynapseContext();
|
|
59830
|
-
return useInfiniteQuery(
|
|
59904
|
+
return useInfiniteQuery(entityQueryKeys.tableQueryResult(queryBundleRequest, true), (context) => {
|
|
59831
59905
|
const offset2 = context.pageParam ? parseInt(context.pageParam) : 0;
|
|
59832
59906
|
return SynapseClient_exports.getQueryTableAsyncJobResults(__spreadProps(__spreadValues({}, queryBundleRequest), {
|
|
59833
59907
|
query: __spreadProps(__spreadValues({}, queryBundleRequest.query), {
|
|
@@ -60015,9 +60089,7 @@ Please refer to our full <a target="_blank" href="https://help.synapse.org/docs/
|
|
|
60015
60089
|
};
|
|
60016
60090
|
|
|
60017
60091
|
// src/lib/containers/home_page/project_view_carousel/ProjectViewCarousel.tsx
|
|
60018
|
-
var ProjectViewCarousel = ({
|
|
60019
|
-
entityId
|
|
60020
|
-
}) => {
|
|
60092
|
+
var ProjectViewCarousel = ({ entityId }) => {
|
|
60021
60093
|
const queryBundleRequest = {
|
|
60022
60094
|
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest",
|
|
60023
60095
|
entityId,
|
|
@@ -64963,7 +65035,7 @@ filepath = ${entityId}.path`;
|
|
|
64963
65035
|
var import_react100 = __toModule(require_react());
|
|
64964
65036
|
var import_react_error_boundary5 = __toModule(require_react_error_boundary_umd());
|
|
64965
65037
|
|
|
64966
|
-
// src/lib/utils/hooks/SynapseAPI/useGetEntityHeaders.ts
|
|
65038
|
+
// src/lib/utils/hooks/SynapseAPI/entity/useGetEntityHeaders.ts
|
|
64967
65039
|
function useGetEntityHeaders(references, options2) {
|
|
64968
65040
|
const { accessToken } = useSynapseContext();
|
|
64969
65041
|
return useQuery(["entityHeaders", accessToken, references], () => SynapseClient_exports.getEntityHeaders(references, accessToken), options2);
|
|
@@ -71635,14 +71707,14 @@ filepath = ${entityId}.path`;
|
|
|
71635
71707
|
var import_react204 = __toModule(require_react());
|
|
71636
71708
|
var import_react_error_boundary8 = __toModule(require_react_error_boundary_umd());
|
|
71637
71709
|
|
|
71638
|
-
// src/lib/utils/hooks/SynapseAPI/useGetEntityChildren.ts
|
|
71710
|
+
// src/lib/utils/hooks/SynapseAPI/entity/useGetEntityChildren.ts
|
|
71639
71711
|
function useGetEntityChildren(request, options2) {
|
|
71640
71712
|
const { accessToken } = useSynapseContext();
|
|
71641
|
-
return useQuery(
|
|
71713
|
+
return useQuery(entityQueryKeys.children(request, false), () => SynapseClient_exports.getEntityChildren(request, accessToken), options2);
|
|
71642
71714
|
}
|
|
71643
71715
|
function useGetEntityChildrenInfinite(request, options2) {
|
|
71644
71716
|
const { accessToken } = useSynapseContext();
|
|
71645
|
-
return useInfiniteQuery(
|
|
71717
|
+
return useInfiniteQuery(entityQueryKeys.children(request, true), (context) => __async(this, null, function* () {
|
|
71646
71718
|
return yield SynapseClient_exports.getEntityChildren(__spreadProps(__spreadValues({}, request), {
|
|
71647
71719
|
includeTotalChildCount: context.pageParam ? false : request.includeTotalChildCount,
|
|
71648
71720
|
nextPageToken: context.pageParam
|
|
@@ -75853,20 +75925,14 @@ filepath = ${entityId}.path`;
|
|
|
75853
75925
|
var import_react198 = __toModule(require_react());
|
|
75854
75926
|
var import_sanitize_html = __toModule(require_sanitize_html());
|
|
75855
75927
|
|
|
75856
|
-
// src/lib/utils/hooks/SynapseAPI/
|
|
75928
|
+
// src/lib/utils/hooks/SynapseAPI/entity/useEntityBoundSchema.ts
|
|
75857
75929
|
function useGetSchemaBinding(entityId, options2) {
|
|
75858
75930
|
const { accessToken } = useSynapseContext();
|
|
75859
|
-
return useQuery(
|
|
75931
|
+
return useQuery(entityQueryKeys.boundJSONSchema(entityId), () => SynapseClient_exports.getSchemaBinding(entityId, accessToken), options2);
|
|
75860
75932
|
}
|
|
75861
75933
|
function useGetValidationResults(entityId, options2) {
|
|
75862
75934
|
const { accessToken } = useSynapseContext();
|
|
75863
|
-
return useQuery(
|
|
75864
|
-
}
|
|
75865
|
-
function useGetSchema(schema$id, options2) {
|
|
75866
|
-
return useQuery(["schema", schema$id], () => __async(this, null, function* () {
|
|
75867
|
-
const response = yield SynapseClient_exports.getValidationSchema(schema$id);
|
|
75868
|
-
return response.validationSchema;
|
|
75869
|
-
}), options2);
|
|
75935
|
+
return useQuery(entityQueryKeys.schemaValidationResults(entityId), () => SynapseClient_exports.getSchemaValidationResults(entityId, accessToken), options2);
|
|
75870
75936
|
}
|
|
75871
75937
|
|
|
75872
75938
|
// src/lib/containers/EntityBadgeIcons.tsx
|
|
@@ -75876,7 +75942,7 @@ filepath = ${entityId}.path`;
|
|
|
75876
75942
|
var import_react197 = __toModule(require_react());
|
|
75877
75943
|
var import_react_bootstrap51 = __toModule(require_react_bootstrap());
|
|
75878
75944
|
|
|
75879
|
-
// src/lib/utils/hooks/SynapseAPI/useEntityBundle.ts
|
|
75945
|
+
// src/lib/utils/hooks/SynapseAPI/entity/useEntityBundle.ts
|
|
75880
75946
|
var ALL_FIELDS = {
|
|
75881
75947
|
includeEntity: true,
|
|
75882
75948
|
includeEntityPath: true,
|
|
@@ -75895,27 +75961,25 @@ filepath = ${entityId}.path`;
|
|
|
75895
75961
|
};
|
|
75896
75962
|
function useGetEntityBundle(entityId, bundleRequest = ALL_FIELDS, version2, options2) {
|
|
75897
75963
|
const { accessToken } = useSynapseContext();
|
|
75898
|
-
return useQuery(
|
|
75964
|
+
return useQuery(entityQueryKeys.bundle(entityId, version2, bundleRequest), () => SynapseClient_exports.getEntityBundleV2(entityId, bundleRequest, version2, accessToken), options2);
|
|
75899
75965
|
}
|
|
75900
75966
|
|
|
75901
75967
|
// src/lib/containers/entity/metadata/AnnotationsTable.tsx
|
|
75902
75968
|
var import_react137 = __toModule(require_react());
|
|
75903
75969
|
|
|
75904
|
-
// src/lib/utils/hooks/SynapseAPI/useEntity.ts
|
|
75970
|
+
// src/lib/utils/hooks/SynapseAPI/entity/useEntity.ts
|
|
75905
75971
|
var import_react136 = __toModule(require_react());
|
|
75906
75972
|
function useGetEntity(entityId, versionNumber, options2) {
|
|
75907
75973
|
const { accessToken } = useSynapseContext();
|
|
75908
|
-
return useQuery(
|
|
75974
|
+
return useQuery(entityQueryKeys.version(entityId, versionNumber), () => SynapseClient_exports.getEntity(accessToken, entityId, versionNumber == null ? void 0 : versionNumber.toString()), options2);
|
|
75909
75975
|
}
|
|
75910
75976
|
function useUpdateEntity(options2) {
|
|
75911
75977
|
const queryClient = useQueryClient();
|
|
75912
75978
|
const { accessToken } = useSynapseContext();
|
|
75913
75979
|
return useMutation((entity) => SynapseClient_exports.updateEntity(entity, accessToken), __spreadProps(__spreadValues({}, options2), {
|
|
75914
75980
|
onSuccess: (updatedEntity, variables, ctx) => __async(this, null, function* () {
|
|
75915
|
-
yield queryClient
|
|
75916
|
-
|
|
75917
|
-
});
|
|
75918
|
-
queryClient.setQueryData(["entity", updatedEntity.id, "entity", void 0], updatedEntity);
|
|
75981
|
+
yield invalidateAllQueriesForEntity(queryClient, updatedEntity.id);
|
|
75982
|
+
queryClient.setQueryData(entityQueryKeys.entity(updatedEntity.id), updatedEntity);
|
|
75919
75983
|
if (options2 == null ? void 0 : options2.onSuccess) {
|
|
75920
75984
|
yield options2.onSuccess(updatedEntity, variables, ctx);
|
|
75921
75985
|
}
|
|
@@ -75925,7 +75989,7 @@ filepath = ${entityId}.path`;
|
|
|
75925
75989
|
function useGetVersionsInfinite(entityId, options2) {
|
|
75926
75990
|
const LIMIT = 200;
|
|
75927
75991
|
const { accessToken } = useSynapseContext();
|
|
75928
|
-
return useInfiniteQuery(
|
|
75992
|
+
return useInfiniteQuery(entityQueryKeys.versions(entityId), (context) => __async(this, null, function* () {
|
|
75929
75993
|
return yield SynapseClient_exports.getEntityVersions(entityId, accessToken, context.pageParam, LIMIT);
|
|
75930
75994
|
}), __spreadProps(__spreadValues({}, options2), {
|
|
75931
75995
|
getNextPageParam: (lastPage, pages) => {
|
|
@@ -75946,7 +76010,7 @@ filepath = ${entityId}.path`;
|
|
|
75946
76010
|
const [entityMetadata, setEntityMetadata] = (0, import_react136.useState)();
|
|
75947
76011
|
const [annotations, setAnnotations] = (0, import_react136.useState)();
|
|
75948
76012
|
const { accessToken } = useSynapseContext();
|
|
75949
|
-
const query = useQuery(
|
|
76013
|
+
const query = useQuery(entityQueryKeys.json(entityId), () => SynapseClient_exports.getEntityJson(entityId, accessToken), options2);
|
|
75950
76014
|
(0, import_react136.useEffect)(() => {
|
|
75951
76015
|
if (query.data) {
|
|
75952
76016
|
setEntityMetadata(getStandardEntityFields(query.data));
|
|
@@ -75967,10 +76031,8 @@ filepath = ${entityId}.path`;
|
|
|
75967
76031
|
}, __spreadProps(__spreadValues({}, options2), {
|
|
75968
76032
|
onSuccess: (data2, variables, ctx) => __async(this, null, function* () {
|
|
75969
76033
|
const entityId = data2.id;
|
|
75970
|
-
yield queryClient
|
|
75971
|
-
|
|
75972
|
-
});
|
|
75973
|
-
queryClient.setQueryData([accessToken, "entity", entityId, "json"], data2);
|
|
76034
|
+
yield invalidateAllQueriesForEntity(queryClient, entityId);
|
|
76035
|
+
queryClient.setQueryData(entityQueryKeys.json(entityId), data2);
|
|
75974
76036
|
if (options2 == null ? void 0 : options2.onSuccess) {
|
|
75975
76037
|
yield options2.onSuccess(data2, variables, ctx);
|
|
75976
76038
|
}
|
|
@@ -75979,7 +76041,7 @@ filepath = ${entityId}.path`;
|
|
|
75979
76041
|
}
|
|
75980
76042
|
function useGetEntityPath(entityId, options2) {
|
|
75981
76043
|
const { accessToken } = useSynapseContext();
|
|
75982
|
-
return useQuery(
|
|
76044
|
+
return useQuery(entityQueryKeys.path(entityId), () => SynapseClient_exports.getEntityPath(entityId, accessToken), options2);
|
|
75983
76045
|
}
|
|
75984
76046
|
|
|
75985
76047
|
// src/lib/containers/entity/metadata/AnnotationsTable.tsx
|
|
@@ -82002,6 +82064,14 @@ filepath = ${entityId}.path`;
|
|
|
82002
82064
|
};
|
|
82003
82065
|
var AddToList_default = AddToList;
|
|
82004
82066
|
|
|
82067
|
+
// src/lib/utils/hooks/SynapseAPI/useSchema.ts
|
|
82068
|
+
function useGetSchema(schema$id, options2) {
|
|
82069
|
+
return useQuery(["schema", schema$id], () => __async(this, null, function* () {
|
|
82070
|
+
const response = yield SynapseClient_exports.getValidationSchema(schema$id);
|
|
82071
|
+
return response.validationSchema;
|
|
82072
|
+
}), options2);
|
|
82073
|
+
}
|
|
82074
|
+
|
|
82005
82075
|
// src/lib/containers/entity/annotations/AdditionalPropertiesSchemaField.tsx
|
|
82006
82076
|
var import_react178 = __toModule(require_react());
|
|
82007
82077
|
var import_react_bootstrap44 = __toModule(require_react_bootstrap());
|
|
@@ -87640,7 +87710,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
87640
87710
|
const [showConfirmation, setShowConfirmation] = import_react195.default.useState(false);
|
|
87641
87711
|
const ANNOTATION_EDITOR_TOOLTIP_ID = "AnnotationEditorTooltip";
|
|
87642
87712
|
const { entityMetadata: entityJson, annotations } = useGetJson(entityId, {
|
|
87643
|
-
enabled:
|
|
87713
|
+
enabled: !!entityId && !formData,
|
|
87644
87714
|
onError: (e3) => {
|
|
87645
87715
|
if (e3.status !== 404) {
|
|
87646
87716
|
handleError(e3);
|
|
@@ -90333,11 +90403,8 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90333
90403
|
var React397 = __toModule(require_react());
|
|
90334
90404
|
|
|
90335
90405
|
// src/lib/containers/download_list/DownloadConfirmation.tsx
|
|
90336
|
-
var import_react218 = __toModule(require_react());
|
|
90337
|
-
var import_react_bootstrap55 = __toModule(require_react_bootstrap());
|
|
90338
|
-
|
|
90339
|
-
// src/lib/containers/QueryVisualizationWrapper.tsx
|
|
90340
90406
|
var import_react217 = __toModule(require_react());
|
|
90407
|
+
var import_react_bootstrap55 = __toModule(require_react_bootstrap());
|
|
90341
90408
|
|
|
90342
90409
|
// src/lib/containers/QueryWrapper.tsx
|
|
90343
90410
|
var React344 = __toModule(require_react());
|
|
@@ -90574,71 +90641,6 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90574
90641
|
}, children));
|
|
90575
90642
|
}
|
|
90576
90643
|
|
|
90577
|
-
// src/lib/containers/QueryVisualizationWrapper.tsx
|
|
90578
|
-
var QueryVisualizationContext = (0, import_react217.createContext)(void 0);
|
|
90579
|
-
var QueryVisualizationContextProvider = ({ children, queryVisualizationContext }) => {
|
|
90580
|
-
return /* @__PURE__ */ import_react217.default.createElement(QueryVisualizationContext.Provider, {
|
|
90581
|
-
value: queryVisualizationContext
|
|
90582
|
-
}, children);
|
|
90583
|
-
};
|
|
90584
|
-
function useQueryVisualizationContext() {
|
|
90585
|
-
const context = (0, import_react217.useContext)(QueryVisualizationContext);
|
|
90586
|
-
if (context === void 0) {
|
|
90587
|
-
throw new Error("useQueryVisualizationContext must be used within a QueryWrapper");
|
|
90588
|
-
}
|
|
90589
|
-
return context;
|
|
90590
|
-
}
|
|
90591
|
-
var QueryVisualizationContextConsumer = QueryVisualizationContext.Consumer;
|
|
90592
|
-
function QueryVisualizationWrapper(props) {
|
|
90593
|
-
var _a;
|
|
90594
|
-
const { data: data2, getLastQueryRequest, isFacetsAvailable, isLoadingNewBundle } = useQueryContext();
|
|
90595
|
-
const [topLevelControlsState, setTopLevelControlsState] = (0, import_react217.useState)({
|
|
90596
|
-
showColumnFilter: true,
|
|
90597
|
-
showFacetFilter: true,
|
|
90598
|
-
showFacetVisualization: (_a = props.defaultShowFacetVisualization) != null ? _a : true,
|
|
90599
|
-
showSearchBar: false,
|
|
90600
|
-
showDownloadConfirmation: false,
|
|
90601
|
-
showColumnSelectDropdown: false,
|
|
90602
|
-
showSqlEditor: false
|
|
90603
|
-
});
|
|
90604
|
-
(0, import_react217.useEffect)(() => {
|
|
90605
|
-
if (!isFacetsAvailable) {
|
|
90606
|
-
setTopLevelControlsState((state) => __spreadProps(__spreadValues({}, state), {
|
|
90607
|
-
showFacetFilter: false,
|
|
90608
|
-
showFacetVisualization: false
|
|
90609
|
-
}));
|
|
90610
|
-
}
|
|
90611
|
-
}, [isFacetsAvailable]);
|
|
90612
|
-
(0, import_react217.useEffect)(() => {
|
|
90613
|
-
if (isLoadingNewBundle) {
|
|
90614
|
-
setSelectedRowIndices([]);
|
|
90615
|
-
}
|
|
90616
|
-
}, [isLoadingNewBundle]);
|
|
90617
|
-
const [isColumnSelected, setIsColumnSelected] = (0, import_react217.useState)([]);
|
|
90618
|
-
const [selectedRowIndices, setSelectedRowIndices] = (0, import_react217.useState)([]);
|
|
90619
|
-
const lastQueryRequest = getLastQueryRequest();
|
|
90620
|
-
const selectColumns = data2 == null ? void 0 : data2.selectColumns;
|
|
90621
|
-
(0, import_react217.useEffect)(() => {
|
|
90622
|
-
var _a2, _b;
|
|
90623
|
-
setIsColumnSelected((_b = selectColumns == null ? void 0 : selectColumns.slice(0, (_a2 = props.visibleColumnCount) != null ? _a2 : Infinity).map((el2) => el2.name)) != null ? _b : []);
|
|
90624
|
-
}, [selectColumns, lastQueryRequest.query.sql, props.visibleColumnCount]);
|
|
90625
|
-
const context = {
|
|
90626
|
-
topLevelControlsState,
|
|
90627
|
-
setTopLevelControlsState,
|
|
90628
|
-
columnsToShowInTable: isColumnSelected,
|
|
90629
|
-
setColumnsToShowInTable: setIsColumnSelected,
|
|
90630
|
-
selectedRowIndices,
|
|
90631
|
-
setSelectedRowIndices,
|
|
90632
|
-
facetAliases: props.facetAliases,
|
|
90633
|
-
rgbIndex: props.rgbIndex,
|
|
90634
|
-
unitDescription: props.unitDescription
|
|
90635
|
-
};
|
|
90636
|
-
const { children } = props;
|
|
90637
|
-
return /* @__PURE__ */ import_react217.default.createElement(QueryVisualizationContextProvider, {
|
|
90638
|
-
queryVisualizationContext: context
|
|
90639
|
-
}, children);
|
|
90640
|
-
}
|
|
90641
|
-
|
|
90642
90644
|
// src/lib/containers/download_list/DownloadConfirmation.tsx
|
|
90643
90645
|
function addToDownload(token2, closeConfirmationFn, queryBundleRequest, folderId, goToDownloadListFn) {
|
|
90644
90646
|
return __async(this, null, function* () {
|
|
@@ -90672,7 +90674,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90672
90674
|
},
|
|
90673
90675
|
[3 /* INFO_ITEMS_IN_LIST */]: {
|
|
90674
90676
|
className: "alert-info",
|
|
90675
|
-
infoText: /* @__PURE__ */
|
|
90677
|
+
infoText: /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null, "You already have files in your download list, which will be mixed with new files added to your download list.", /* @__PURE__ */ import_react217.default.createElement("br", null), "We recommend completing or clearing your download list before adding these files."),
|
|
90676
90678
|
closeText: "Cancel"
|
|
90677
90679
|
},
|
|
90678
90680
|
[1 /* PROCESSING */]: {
|
|
@@ -90688,7 +90690,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90688
90690
|
[4 /* SIGNED_OUT */]: {
|
|
90689
90691
|
className: "alert-danger",
|
|
90690
90692
|
closeText: "Close",
|
|
90691
|
-
infoText: /* @__PURE__ */
|
|
90693
|
+
infoText: /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null, "Please ", /* @__PURE__ */ import_react217.default.createElement(SignInButton_default, {
|
|
90692
90694
|
style: { color: "#337ab7" }
|
|
90693
90695
|
}), " to add files to your download list.")
|
|
90694
90696
|
}
|
|
@@ -90697,38 +90699,42 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90697
90699
|
switch (props.status) {
|
|
90698
90700
|
case 0 /* LOADING_INFO */:
|
|
90699
90701
|
case 1 /* PROCESSING */:
|
|
90700
|
-
return /* @__PURE__ */
|
|
90702
|
+
return /* @__PURE__ */ import_react217.default.createElement("div", null, /* @__PURE__ */ import_react217.default.createElement("span", {
|
|
90701
90703
|
className: "spinner white"
|
|
90702
|
-
}), /* @__PURE__ */
|
|
90704
|
+
}), /* @__PURE__ */ import_react217.default.createElement("span", {
|
|
90703
90705
|
className: "spinner__text"
|
|
90704
90706
|
}, StatusConstruct[props.status].infoText));
|
|
90705
90707
|
case 4 /* SIGNED_OUT */:
|
|
90706
|
-
return /* @__PURE__ */
|
|
90708
|
+
return /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null, StatusConstruct[props.status].infoText);
|
|
90707
90709
|
case 2 /* INFO */:
|
|
90708
90710
|
case 3 /* INFO_ITEMS_IN_LIST */:
|
|
90709
|
-
return /* @__PURE__ */
|
|
90711
|
+
return /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null, /* @__PURE__ */ import_react217.default.createElement(DownloadDetails, {
|
|
90710
90712
|
numFiles: props.fileCount,
|
|
90711
90713
|
numBytes: props.fileSize
|
|
90712
|
-
}), /* @__PURE__ */
|
|
90714
|
+
}), /* @__PURE__ */ import_react217.default.createElement("span", {
|
|
90713
90715
|
className: "download-confirmation-infoText"
|
|
90714
90716
|
}, StatusConstruct[props.status].infoText));
|
|
90715
90717
|
default:
|
|
90716
|
-
return /* @__PURE__ */
|
|
90718
|
+
return /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null);
|
|
90717
90719
|
}
|
|
90718
90720
|
};
|
|
90719
|
-
var DownloadConfirmation = ({
|
|
90720
|
-
|
|
90721
|
-
|
|
90721
|
+
var DownloadConfirmation = ({
|
|
90722
|
+
getLastQueryRequest,
|
|
90723
|
+
folderId,
|
|
90724
|
+
fnClose,
|
|
90725
|
+
setTopLevelControlsState,
|
|
90726
|
+
topLevelControlsState,
|
|
90727
|
+
downloadCartPageUrl = "/DownloadCart"
|
|
90728
|
+
}) => {
|
|
90722
90729
|
const { accessToken } = useSynapseContext();
|
|
90723
|
-
const
|
|
90724
|
-
const [
|
|
90725
|
-
const [
|
|
90726
|
-
const
|
|
90727
|
-
|
|
90728
|
-
});
|
|
90730
|
+
const { showDownloadConfirmation = true } = topLevelControlsState != null ? topLevelControlsState : {};
|
|
90731
|
+
const [status, setStatus2] = (0, import_react217.useState)(accessToken ? 0 /* LOADING_INFO */ : 4 /* SIGNED_OUT */);
|
|
90732
|
+
const [fileCount, setFileCount] = (0, import_react217.useState)(0);
|
|
90733
|
+
const [fileSize, setFileSize] = (0, import_react217.useState)(0);
|
|
90734
|
+
const { data: downloadListStatistics, refetch } = useGetDownloadListStatistics();
|
|
90729
90735
|
const lastQueryRequest = getLastQueryRequest();
|
|
90730
|
-
const [showDownloadList, setShowDownloadList] = (0,
|
|
90731
|
-
const updateStats = (0,
|
|
90736
|
+
const [showDownloadList, setShowDownloadList] = (0, import_react217.useState)(false);
|
|
90737
|
+
const updateStats = (0, import_react217.useCallback)((count2, bytes, downloadListStatistics2) => {
|
|
90732
90738
|
if (accessToken && downloadListStatistics2) {
|
|
90733
90739
|
const hasFilesInDownloadList = downloadListStatistics2.totalNumberOfFiles > 0;
|
|
90734
90740
|
const size2 = bytes != null ? bytes : 0;
|
|
@@ -90755,6 +90761,11 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90755
90761
|
entityChildrenData,
|
|
90756
90762
|
downloadListStatistics
|
|
90757
90763
|
]);
|
|
90764
|
+
const partMask = SynapseConstants_exports.BUNDLE_MASK_QUERY_COUNT | SynapseConstants_exports.BUNDLE_MASK_SUM_FILES_SIZE_BYTES;
|
|
90765
|
+
const queryBundleRequestSizeInformation = __spreadProps(__spreadValues({}, lastQueryRequest), {
|
|
90766
|
+
partMask
|
|
90767
|
+
});
|
|
90768
|
+
const { data: queryResultBundle } = useGetQueryResultBundle(queryBundleRequestSizeInformation);
|
|
90758
90769
|
useDeepCompareEffect(() => {
|
|
90759
90770
|
var _a;
|
|
90760
90771
|
if (queryResultBundle && downloadListStatistics) {
|
|
@@ -90767,9 +90778,11 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90767
90778
|
downloadListStatistics
|
|
90768
90779
|
]);
|
|
90769
90780
|
const onCancel = fnClose ? () => fnClose() : () => {
|
|
90770
|
-
|
|
90771
|
-
|
|
90772
|
-
|
|
90781
|
+
if (setTopLevelControlsState) {
|
|
90782
|
+
setTopLevelControlsState((topLevelControlsState2) => __spreadProps(__spreadValues({}, topLevelControlsState2), {
|
|
90783
|
+
showDownloadConfirmation: false
|
|
90784
|
+
}));
|
|
90785
|
+
}
|
|
90773
90786
|
};
|
|
90774
90787
|
const triggerAddToDownload = () => __async(void 0, null, function* () {
|
|
90775
90788
|
if (!accessToken) {
|
|
@@ -90790,24 +90803,24 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90790
90803
|
console.error("Missing the Download Cart Page URL in the component configuration.");
|
|
90791
90804
|
}
|
|
90792
90805
|
const showFacetFilter = topLevelControlsState == null ? void 0 : topLevelControlsState.showFacetFilter;
|
|
90793
|
-
return /* @__PURE__ */
|
|
90806
|
+
return /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null, /* @__PURE__ */ import_react217.default.createElement(import_react_bootstrap55.Alert, {
|
|
90794
90807
|
dismissible: false,
|
|
90795
90808
|
show: true,
|
|
90796
90809
|
variant: "info",
|
|
90797
90810
|
transition: false,
|
|
90798
|
-
className: `download-confirmation ${StatusConstruct[status].className} ${
|
|
90811
|
+
className: `download-confirmation ${StatusConstruct[status].className} ${showDownloadConfirmation ? "" : "hidden"}
|
|
90799
90812
|
${showFacetFilter ? QUERY_FILTERS_EXPANDED_CSS : QUERY_FILTERS_COLLAPSED_CSS}
|
|
90800
90813
|
`
|
|
90801
|
-
}, /* @__PURE__ */
|
|
90814
|
+
}, /* @__PURE__ */ import_react217.default.createElement(DownloadConfirmationContent, {
|
|
90802
90815
|
status,
|
|
90803
90816
|
fileCount,
|
|
90804
90817
|
fileSize
|
|
90805
|
-
}), /* @__PURE__ */
|
|
90818
|
+
}), /* @__PURE__ */ import_react217.default.createElement("div", {
|
|
90806
90819
|
className: "download-confirmation-action"
|
|
90807
|
-
}, status !== 1 /* PROCESSING */ && /* @__PURE__ */
|
|
90820
|
+
}, status !== 1 /* PROCESSING */ && /* @__PURE__ */ import_react217.default.createElement("button", {
|
|
90808
90821
|
className: "btn btn-link",
|
|
90809
90822
|
onClick: onCancel
|
|
90810
|
-
}, StatusConstruct[status].closeText), (status === 2 /* INFO */ || status === 3 /* INFO_ITEMS_IN_LIST */) && /* @__PURE__ */
|
|
90823
|
+
}, StatusConstruct[status].closeText), (status === 2 /* INFO */ || status === 3 /* INFO_ITEMS_IN_LIST */) && /* @__PURE__ */ import_react217.default.createElement("button", {
|
|
90811
90824
|
type: "button",
|
|
90812
90825
|
className: "btn btn-primary",
|
|
90813
90826
|
onClick: triggerAddToDownload
|
|
@@ -90816,6 +90829,74 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
90816
90829
|
|
|
90817
90830
|
// src/lib/containers/FullTextSearch.tsx
|
|
90818
90831
|
var import_react219 = __toModule(require_react());
|
|
90832
|
+
|
|
90833
|
+
// src/lib/containers/QueryVisualizationWrapper.tsx
|
|
90834
|
+
var import_react218 = __toModule(require_react());
|
|
90835
|
+
var QueryVisualizationContext = (0, import_react218.createContext)(void 0);
|
|
90836
|
+
var QueryVisualizationContextProvider = ({ children, queryVisualizationContext }) => {
|
|
90837
|
+
return /* @__PURE__ */ import_react218.default.createElement(QueryVisualizationContext.Provider, {
|
|
90838
|
+
value: queryVisualizationContext
|
|
90839
|
+
}, children);
|
|
90840
|
+
};
|
|
90841
|
+
function useQueryVisualizationContext() {
|
|
90842
|
+
const context = (0, import_react218.useContext)(QueryVisualizationContext);
|
|
90843
|
+
if (context === void 0) {
|
|
90844
|
+
throw new Error("useQueryVisualizationContext must be used within a QueryWrapper");
|
|
90845
|
+
}
|
|
90846
|
+
return context;
|
|
90847
|
+
}
|
|
90848
|
+
var QueryVisualizationContextConsumer = QueryVisualizationContext.Consumer;
|
|
90849
|
+
function QueryVisualizationWrapper(props) {
|
|
90850
|
+
var _a;
|
|
90851
|
+
const { data: data2, getLastQueryRequest, isFacetsAvailable, isLoadingNewBundle } = useQueryContext();
|
|
90852
|
+
const [topLevelControlsState, setTopLevelControlsState] = (0, import_react218.useState)({
|
|
90853
|
+
showColumnFilter: true,
|
|
90854
|
+
showFacetFilter: true,
|
|
90855
|
+
showFacetVisualization: (_a = props.defaultShowFacetVisualization) != null ? _a : true,
|
|
90856
|
+
showSearchBar: false,
|
|
90857
|
+
showDownloadConfirmation: false,
|
|
90858
|
+
showColumnSelectDropdown: false,
|
|
90859
|
+
showSqlEditor: false
|
|
90860
|
+
});
|
|
90861
|
+
(0, import_react218.useEffect)(() => {
|
|
90862
|
+
if (!isFacetsAvailable) {
|
|
90863
|
+
setTopLevelControlsState((state) => __spreadProps(__spreadValues({}, state), {
|
|
90864
|
+
showFacetFilter: false,
|
|
90865
|
+
showFacetVisualization: false
|
|
90866
|
+
}));
|
|
90867
|
+
}
|
|
90868
|
+
}, [isFacetsAvailable]);
|
|
90869
|
+
(0, import_react218.useEffect)(() => {
|
|
90870
|
+
if (isLoadingNewBundle) {
|
|
90871
|
+
setSelectedRowIndices([]);
|
|
90872
|
+
}
|
|
90873
|
+
}, [isLoadingNewBundle]);
|
|
90874
|
+
const [isColumnSelected, setIsColumnSelected] = (0, import_react218.useState)([]);
|
|
90875
|
+
const [selectedRowIndices, setSelectedRowIndices] = (0, import_react218.useState)([]);
|
|
90876
|
+
const lastQueryRequest = getLastQueryRequest();
|
|
90877
|
+
const selectColumns = data2 == null ? void 0 : data2.selectColumns;
|
|
90878
|
+
(0, import_react218.useEffect)(() => {
|
|
90879
|
+
var _a2, _b;
|
|
90880
|
+
setIsColumnSelected((_b = selectColumns == null ? void 0 : selectColumns.slice(0, (_a2 = props.visibleColumnCount) != null ? _a2 : Infinity).map((el2) => el2.name)) != null ? _b : []);
|
|
90881
|
+
}, [selectColumns, lastQueryRequest.query.sql, props.visibleColumnCount]);
|
|
90882
|
+
const context = {
|
|
90883
|
+
topLevelControlsState,
|
|
90884
|
+
setTopLevelControlsState,
|
|
90885
|
+
columnsToShowInTable: isColumnSelected,
|
|
90886
|
+
setColumnsToShowInTable: setIsColumnSelected,
|
|
90887
|
+
selectedRowIndices,
|
|
90888
|
+
setSelectedRowIndices,
|
|
90889
|
+
facetAliases: props.facetAliases,
|
|
90890
|
+
rgbIndex: props.rgbIndex,
|
|
90891
|
+
unitDescription: props.unitDescription
|
|
90892
|
+
};
|
|
90893
|
+
const { children } = props;
|
|
90894
|
+
return /* @__PURE__ */ import_react218.default.createElement(QueryVisualizationContextProvider, {
|
|
90895
|
+
queryVisualizationContext: context
|
|
90896
|
+
}, children);
|
|
90897
|
+
}
|
|
90898
|
+
|
|
90899
|
+
// src/lib/containers/FullTextSearch.tsx
|
|
90819
90900
|
library.add(faSearch);
|
|
90820
90901
|
library.add(faTimes);
|
|
90821
90902
|
var MIN_SEARCH_QUERY_LENGTH = 3;
|
|
@@ -96976,6 +97057,9 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
96976
97057
|
queryContext,
|
|
96977
97058
|
queryVisualizationContext
|
|
96978
97059
|
})), /* @__PURE__ */ React397.createElement(SqlEditor_default, null), /* @__PURE__ */ React397.createElement(DownloadConfirmation, {
|
|
97060
|
+
getLastQueryRequest: queryContext.getLastQueryRequest,
|
|
97061
|
+
topLevelControlsState: queryVisualizationContext.topLevelControlsState,
|
|
97062
|
+
setTopLevelControlsState: queryVisualizationContext.setTopLevelControlsState,
|
|
96979
97063
|
downloadCartPageUrl
|
|
96980
97064
|
}), /* @__PURE__ */ React397.createElement(TopLevelControls_default, {
|
|
96981
97065
|
showColumnSelection: tableConfiguration !== void 0,
|