@databiosphere/findable-ui 16.1.0 → 18.0.0
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -0
- package/lib/apis/azul/common/filterTransformer.js +1 -1
- package/lib/apis/azul/common/utils.d.ts +1 -1
- package/lib/apis/azul/common/utils.js +5 -1
- package/lib/common/entities.d.ts +3 -3
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +3 -2
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +6 -4
- package/lib/components/Export/components/ExportForm/components/ExportManifestDownloadFormatForm/exportManifestDownloadFormatForm.d.ts +3 -2
- package/lib/components/Export/components/ExportForm/components/ExportManifestDownloadFormatForm/exportManifestDownloadFormatForm.js +2 -12
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraForm/exportToTerraForm.d.ts +5 -2
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraForm/exportToTerraForm.js +2 -2
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraNotStarted/exportToTerraNotStarted.d.ts +3 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraNotStarted/exportToTerraNotStarted.js +2 -2
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/exportToTerra.js +9 -6
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.d.ts +3 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.js +3 -4
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +3 -2
- package/lib/components/Export/components/ManifestDownload/manifestDownload.js +6 -4
- package/lib/components/Filter/common/utils.js +1 -1
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +1 -1
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.d.ts +1 -1
- package/lib/components/Table/common/utils.js +1 -1
- package/lib/config/entities.d.ts +1 -1
- package/lib/hooks/types.d.ts +4 -0
- package/lib/hooks/types.js +5 -0
- package/lib/hooks/useCategoryFilter.js +5 -1
- package/lib/hooks/useFileManifest/common/entities.d.ts +0 -5
- package/lib/hooks/useFileManifest/common/entities.js +0 -6
- package/lib/hooks/useFileManifest/useFileManifest.d.ts +8 -5
- package/lib/hooks/useFileManifest/useFileManifest.js +29 -8
- package/lib/hooks/useFileManifest/useFileManifestDownload.js +10 -9
- package/lib/hooks/useFileManifest/useFileManifestFormat.d.ts +12 -0
- package/lib/hooks/useFileManifest/useFileManifestFormat.js +10 -0
- package/lib/hooks/useRequestFileLocation.d.ts +1 -4
- package/lib/hooks/useRequestFileLocation.js +1 -5
- package/lib/hooks/useRequestManifest/constants.d.ts +2 -0
- package/lib/hooks/useRequestManifest/constants.js +4 -0
- package/lib/hooks/useRequestManifest/types.d.ts +6 -0
- package/lib/hooks/useRequestManifest/types.js +1 -0
- package/lib/hooks/useRequestManifest/useRequestManifest.d.ts +10 -0
- package/lib/hooks/useRequestManifest/useRequestManifest.js +30 -0
- package/lib/hooks/useRequestManifest/utils.d.ts +65 -0
- package/lib/hooks/useRequestManifest/utils.js +118 -0
- package/lib/mocks/useRequestFileManifest.mocks.d.ts +11 -0
- package/lib/mocks/useRequestFileManifest.mocks.js +100 -0
- package/lib/providers/fileManifestState/constants.d.ts +0 -2
- package/lib/providers/fileManifestState/constants.js +0 -11
- package/lib/providers/fileManifestState.d.ts +3 -25
- package/lib/providers/fileManifestState.js +5 -40
- package/lib/viewModelBuilders/common/utils.d.ts +6 -6
- package/lib/viewModelBuilders/common/utils.js +10 -10
- package/lib/views/ExploreView/exploreView.js +1 -1
- package/lib/views/ExportView/exportView.js +2 -2
- package/package.json +1 -1
- package/src/apis/azul/common/filterTransformer.ts +1 -1
- package/src/apis/azul/common/utils.ts +4 -2
- package/src/common/entities.ts +3 -3
- package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +17 -10
- package/src/components/Export/components/ExportForm/components/ExportManifestDownloadFormatForm/exportManifestDownloadFormatForm.tsx +7 -16
- package/src/components/Export/components/ExportToTerra/components/ExportToTerraForm/exportToTerraForm.tsx +8 -4
- package/src/components/Export/components/ExportToTerra/components/ExportToTerraNotStarted/exportToTerraNotStarted.tsx +4 -1
- package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +13 -9
- package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx +4 -9
- package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +17 -11
- package/src/components/Filter/common/utils.ts +1 -1
- package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +1 -1
- package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +1 -1
- package/src/components/Table/common/utils.ts +1 -1
- package/src/config/entities.ts +1 -1
- package/src/hooks/types.ts +4 -0
- package/src/hooks/useCategoryFilter.ts +5 -1
- package/src/hooks/useFileManifest/common/entities.ts +0 -6
- package/src/hooks/useFileManifest/common/utils.ts +2 -2
- package/src/hooks/useFileManifest/useFileManifest.ts +34 -13
- package/src/hooks/useFileManifest/useFileManifestDownload.ts +21 -16
- package/src/hooks/useFileManifest/useFileManifestFormat.ts +23 -0
- package/src/hooks/useRequestFileLocation.ts +1 -5
- package/src/hooks/useRequestManifest/constants.ts +6 -0
- package/src/hooks/useRequestManifest/types.ts +7 -0
- package/src/hooks/useRequestManifest/useRequestManifest.ts +49 -0
- package/src/hooks/useRequestManifest/utils.ts +153 -0
- package/src/mocks/useRequestFileManifest.mocks.ts +121 -0
- package/src/providers/fileManifestState/constants.ts +0 -15
- package/src/providers/fileManifestState.tsx +7 -81
- package/src/viewModelBuilders/common/utils.ts +10 -10
- package/src/views/ExploreView/exploreView.tsx +1 -1
- package/src/views/ExportView/exportView.tsx +2 -2
- package/tests/buildRequestFilters.test.ts +68 -0
- package/tests/buildRequestManifest.test.ts +103 -0
- package/tests/useRequestManifest.test.ts +193 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +0 -15
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +0 -28
- package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +0 -5
- package/lib/hooks/useFileManifest/useFileManifestURL.js +0 -11
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +0 -11
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +0 -40
- package/lib/providers/fileManifestState/actions.d.ts +0 -9
- package/lib/providers/fileManifestState/actions.js +0 -19
- package/lib/providers/fileManifestState/utils.d.ts +0 -34
- package/lib/providers/fileManifestState/utils.js +0 -80
- package/src/hooks/useFileManifest/common/buildFileManifestRequestURL.ts +0 -44
- package/src/hooks/useFileManifest/useFileManifestURL.ts +0 -12
- package/src/hooks/useFileManifest/useRequestFileManifest.ts +0 -51
- package/src/providers/fileManifestState/actions.ts +0 -34
- package/src/providers/fileManifestState/utils.ts +0 -108
- package/tests/fileManifestRequestFilters.test.ts +0 -160
- package/tests/updateFilesFacetsStatus.test.ts +0 -84
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [18.0.0](https://github.com/DataBiosphere/findable-ui/compare/v17.0.0...v18.0.0) (2024-12-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* ensure select category value label is string and type key as unknown ([#298](https://github.com/DataBiosphere/findable-ui/issues/298)) (#299)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* ensure select category value label is string and type key as unknown ([#298](https://github.com/DataBiosphere/findable-ui/issues/298)) ([#299](https://github.com/DataBiosphere/findable-ui/issues/299)) ([c7b5baa](https://github.com/DataBiosphere/findable-ui/commit/c7b5baae525f6e54493a2748070fa46cc36d9f67))
|
|
13
|
+
|
|
14
|
+
## [17.0.0](https://github.com/DataBiosphere/findable-ui/compare/v16.1.0...v17.0.0) (2024-12-12)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### ⚠ BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* exports via main button don't include orphans ([#287](https://github.com/DataBiosphere/findable-ui/issues/287)) (#288)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* exports via main button don't include orphans ([#287](https://github.com/DataBiosphere/findable-ui/issues/287)) ([#288](https://github.com/DataBiosphere/findable-ui/issues/288)) ([86e3e40](https://github.com/DataBiosphere/findable-ui/commit/86e3e4047cce84a90348719c9ca7b41a3a93e4c3))
|
|
24
|
+
|
|
3
25
|
## [16.1.0](https://github.com/DataBiosphere/findable-ui/compare/v16.0.0...v16.1.0) (2024-12-12)
|
|
4
26
|
|
|
5
27
|
|
|
@@ -88,7 +88,7 @@ export function transformTermFacets(termFacets, filterState) {
|
|
|
88
88
|
categoryValues.push({
|
|
89
89
|
count: 0,
|
|
90
90
|
key: term,
|
|
91
|
-
label: term ?? LABEL.UNSPECIFIED,
|
|
91
|
+
label: String(term ?? LABEL.UNSPECIFIED),
|
|
92
92
|
selected: false, // Selected state updated in filter hook
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -4,4 +4,4 @@ import { ParamValue } from "./filterTransformer";
|
|
|
4
4
|
* @param value - Filter value.
|
|
5
5
|
* @returns filter parameter value.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getFilterParameterValue(value:
|
|
7
|
+
export declare function getFilterParameterValue(value: unknown): ParamValue;
|
|
@@ -13,5 +13,9 @@ export function getFilterParameterValue(value) {
|
|
|
13
13
|
if (value === "false") {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
if (typeof value === "string" || typeof value === "boolean")
|
|
17
|
+
return value;
|
|
18
|
+
if (value === null || value === undefined)
|
|
19
|
+
return null;
|
|
20
|
+
return String(value);
|
|
17
21
|
}
|
package/lib/common/entities.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface CategoryTag {
|
|
|
13
13
|
/**
|
|
14
14
|
* Category values to be used as keys. For example, "Homo sapiens" or "10X 3' v2 sequencing".
|
|
15
15
|
*/
|
|
16
|
-
export type CategoryValueKey =
|
|
16
|
+
export type CategoryValueKey = unknown;
|
|
17
17
|
/**
|
|
18
18
|
* Set of selected category values.
|
|
19
19
|
*/
|
|
@@ -46,7 +46,7 @@ export interface SelectCategory {
|
|
|
46
46
|
*/
|
|
47
47
|
export interface SelectCategoryValue {
|
|
48
48
|
count: number;
|
|
49
|
-
key:
|
|
49
|
+
key: CategoryValueKey;
|
|
50
50
|
label: string;
|
|
51
51
|
selected: boolean;
|
|
52
52
|
}
|
|
@@ -64,7 +64,7 @@ export interface SelectCategoryValueView {
|
|
|
64
64
|
*/
|
|
65
65
|
export interface SelectCategoryView {
|
|
66
66
|
isDisabled?: boolean;
|
|
67
|
-
key:
|
|
67
|
+
key: CategoryKey;
|
|
68
68
|
label: string;
|
|
69
69
|
values: SelectCategoryValueView[];
|
|
70
70
|
}
|
|
@@ -2,7 +2,7 @@ import { ElementType } from "react";
|
|
|
2
2
|
import { Filters } from "../../../../common/entities";
|
|
3
3
|
import { FileManifestType } from "../../../../hooks/useFileManifest/common/entities";
|
|
4
4
|
import { FileManifestState } from "../../../../providers/fileManifestState";
|
|
5
|
-
import { FormFacet } from "../../common/entities";
|
|
5
|
+
import { FormFacet, ManifestDownloadFormat } from "../../common/entities";
|
|
6
6
|
interface DownloadCurlCommandProps {
|
|
7
7
|
DownloadCurlForm: ElementType;
|
|
8
8
|
DownloadCurlStart: ElementType;
|
|
@@ -12,6 +12,7 @@ interface DownloadCurlCommandProps {
|
|
|
12
12
|
fileSummaryFacetName: string;
|
|
13
13
|
filters: Filters;
|
|
14
14
|
formFacet: FormFacet;
|
|
15
|
+
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
15
16
|
}
|
|
16
|
-
export declare const DownloadCurlCommand: ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState,
|
|
17
|
+
export declare const DownloadCurlCommand: ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, manifestDownloadFormat, }: DownloadCurlCommandProps) => JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -2,16 +2,18 @@ import React, { useState } from "react";
|
|
|
2
2
|
import { MANIFEST_DOWNLOAD_FORMAT } from "../../../../apis/azul/common/entities";
|
|
3
3
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
4
4
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
5
|
-
import {
|
|
5
|
+
import { useRequestFileLocation, } from "../../../../hooks/useRequestFileLocation";
|
|
6
|
+
import { useRequestManifest } from "../../../../hooks/useRequestManifest/useRequestManifest";
|
|
6
7
|
import { BULK_DOWNLOAD_EXECUTION_ENVIRONMENT, } from "../../common/entities";
|
|
7
8
|
import { trackBulkDownloadRequested } from "../../common/tracking";
|
|
8
9
|
import { DownloadCurlCommandNotStarted } from "./components/DownloadCurlCommandNotStarted/downloadCurlCommandNotStarted";
|
|
9
10
|
import { DownloadCurlCommandReady } from "./components/DownloadCurlCommandReady/downloadCurlCommandReady";
|
|
10
|
-
export const DownloadCurlCommand = ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState,
|
|
11
|
-
|
|
11
|
+
export const DownloadCurlCommand = ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, manifestDownloadFormat = MANIFEST_DOWNLOAD_FORMAT.CURL, }) => {
|
|
12
|
+
useFileManifest(filters, fileSummaryFacetName);
|
|
12
13
|
const [executionEnvironment, setExecutionEnvironment] = useState(BULK_DOWNLOAD_EXECUTION_ENVIRONMENT.BASH);
|
|
13
14
|
const { exploreState: { tabValue: entityList }, } = useExploreState();
|
|
14
|
-
const {
|
|
15
|
+
const { requestMethod, requestUrl } = useRequestManifest(manifestDownloadFormat, formFacet);
|
|
16
|
+
const { data, isLoading, run } = useRequestFileLocation(requestUrl, requestMethod);
|
|
15
17
|
const curlCommand = getBulkDownloadCurlCommand(data, executionEnvironment);
|
|
16
18
|
return curlCommand ? (React.createElement(DownloadCurlCommandReady, { curlCommand: curlCommand, DownloadCurlSuccess: DownloadCurlSuccess })) : (React.createElement(DownloadCurlCommandNotStarted, { DownloadCurlForm: DownloadCurlForm, DownloadCurlStart: DownloadCurlStart, executionEnvironment: executionEnvironment, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, onRequestManifest: () => {
|
|
17
19
|
// Execute GTM tracking.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { FileManifestFormatState } from "../../../../../../hooks/useFileManifest/useFileManifestFormat";
|
|
1
2
|
import { ManifestDownloadFormat } from "../../../../common/entities";
|
|
2
3
|
export interface ExportManifestDownloadFormatFormProps {
|
|
3
|
-
|
|
4
|
+
fileManifestFormatState: FileManifestFormatState;
|
|
4
5
|
manifestDownloadFormats: ManifestDownloadFormat[];
|
|
5
6
|
}
|
|
6
|
-
export declare const ExportManifestDownloadFormatForm: ({
|
|
7
|
+
export declare const ExportManifestDownloadFormatForm: ({ fileManifestFormatState, manifestDownloadFormats, }: ExportManifestDownloadFormatFormProps) => JSX.Element;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { FormControlLabel, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { useFileManifestState } from "../../../../../../hooks/useFileManifestState";
|
|
4
|
-
import { FileManifestActionKind } from "../../../../../../providers/fileManifestState";
|
|
5
3
|
import { RadioCheckedIcon } from "../../../../../common/CustomIcon/components/RadioCheckedIcon/radioCheckedIcon";
|
|
6
4
|
import { RadioUncheckedIcon } from "../../../../../common/CustomIcon/components/RadioUncheckedIcon/radioUncheckedIcon";
|
|
7
5
|
import { FormControl } from "../../exportForm.styles";
|
|
8
|
-
export const ExportManifestDownloadFormatForm = ({
|
|
9
|
-
const { fileManifestDispatch } = useFileManifestState();
|
|
10
|
-
// Updates file manifest format state.
|
|
11
|
-
const onUpdateManifestFormat = (format) => {
|
|
12
|
-
fileManifestDispatch({
|
|
13
|
-
payload: format,
|
|
14
|
-
type: FileManifestActionKind.UpdateFileManifestFormat,
|
|
15
|
-
});
|
|
16
|
-
};
|
|
6
|
+
export const ExportManifestDownloadFormatForm = ({ fileManifestFormatState, manifestDownloadFormats, }) => {
|
|
17
7
|
return (React.createElement(FormControl, null,
|
|
18
8
|
React.createElement(FormLabel, null, "Download Format"),
|
|
19
|
-
React.createElement(RadioGroup, { value:
|
|
9
|
+
React.createElement(RadioGroup, { value: fileManifestFormatState.fileManifestFormat ?? "" }, manifestDownloadFormats.map((manifestFormat) => (React.createElement(FormControlLabel, { control: React.createElement(Radio, { checkedIcon: React.createElement(RadioCheckedIcon, null), icon: React.createElement(RadioUncheckedIcon, null), onChange: () => fileManifestFormatState.setFileManifestFormat(manifestFormat), size: "small", value: manifestFormat }), key: manifestFormat, label: manifestFormat }))))));
|
|
20
10
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { FileManifestFormatState } from "../../../../../../hooks/useFileManifest/useFileManifestFormat";
|
|
1
3
|
import { FormFacet, ManifestDownloadFormat } from "../../../../common/entities";
|
|
2
4
|
import { OnRequestManifestFn } from "../../../ExportForm/exportForm";
|
|
3
5
|
export interface ExportToTerraFormProps {
|
|
6
|
+
fileManifestFormatState: FileManifestFormatState;
|
|
4
7
|
formFacet: FormFacet;
|
|
5
8
|
isLoading: boolean;
|
|
6
|
-
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
7
9
|
manifestDownloadFormats: ManifestDownloadFormat[];
|
|
8
10
|
onRequestManifest: OnRequestManifestFn;
|
|
11
|
+
setFileManifestFormat: Dispatch<SetStateAction<ManifestDownloadFormat | undefined>>;
|
|
9
12
|
}
|
|
10
|
-
export declare const ExportToTerraForm: ({ formFacet, isLoading,
|
|
13
|
+
export declare const ExportToTerraForm: ({ fileManifestFormatState, formFacet, isLoading, manifestDownloadFormats, onRequestManifest, }: ExportToTerraFormProps) => JSX.Element;
|
|
@@ -2,9 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { ExportButton } from "../../../ExportForm/components/ExportButton/exportButton";
|
|
3
3
|
import { ExportManifestDownloadFormatForm } from "../../../ExportForm/components/ExportManifestDownloadFormatForm/exportManifestDownloadFormatForm";
|
|
4
4
|
import { ExportForm, } from "../../../ExportForm/exportForm";
|
|
5
|
-
export const ExportToTerraForm = ({ formFacet, isLoading,
|
|
5
|
+
export const ExportToTerraForm = ({ fileManifestFormatState, formFacet, isLoading, manifestDownloadFormats, onRequestManifest, }) => {
|
|
6
6
|
return (React.createElement(ExportForm, { Button: renderButton, formFacet: formFacet, isLoading: isLoading, onRequestManifest: onRequestManifest },
|
|
7
|
-
React.createElement(ExportManifestDownloadFormatForm, {
|
|
7
|
+
React.createElement(ExportManifestDownloadFormatForm, { fileManifestFormatState: fileManifestFormatState, manifestDownloadFormats: manifestDownloadFormats })));
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Build the export button.
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ElementType } from "react";
|
|
2
|
+
import { FileManifestFormatState } from "../../../../../../hooks/useFileManifest/useFileManifestFormat";
|
|
2
3
|
import { FileManifestState } from "../../../../../../providers/fileManifestState";
|
|
3
4
|
import { FormFacet, ManifestDownloadFormat } from "../../../../common/entities";
|
|
4
5
|
import { OnRequestManifestFn } from "../../../ExportForm/exportForm";
|
|
5
6
|
export interface ExportToTerraNotStartedProps {
|
|
6
7
|
ExportTerraForm: ElementType;
|
|
7
8
|
ExportToTerraStart: ElementType;
|
|
9
|
+
fileManifestFormatState: FileManifestFormatState;
|
|
8
10
|
fileManifestState: FileManifestState;
|
|
9
11
|
formFacet: FormFacet;
|
|
10
12
|
isLoading: boolean;
|
|
11
13
|
manifestDownloadFormats: ManifestDownloadFormat[];
|
|
12
14
|
onRequestManifest: OnRequestManifestFn;
|
|
13
15
|
}
|
|
14
|
-
export declare const ExportToTerraNotStarted: ({ ExportTerraForm, ExportToTerraStart, fileManifestState, formFacet, isLoading, manifestDownloadFormats, onRequestManifest, }: ExportToTerraNotStartedProps) => JSX.Element;
|
|
16
|
+
export declare const ExportToTerraNotStarted: ({ ExportTerraForm, ExportToTerraStart, fileManifestFormatState, fileManifestState, formFacet, isLoading, manifestDownloadFormats, onRequestManifest, }: ExportToTerraNotStartedProps) => JSX.Element;
|
|
@@ -3,12 +3,12 @@ import { PAPER_PANEL_STYLE } from "../../../../../common/Paper/paper";
|
|
|
3
3
|
import { FluidPaper } from "../../../../../common/Paper/paper.styles";
|
|
4
4
|
import { Loading } from "../../../../../Loading/loading";
|
|
5
5
|
import { Section, SectionContent } from "../../../../export.styles";
|
|
6
|
-
export const ExportToTerraNotStarted = ({ ExportTerraForm, ExportToTerraStart, fileManifestState, formFacet, isLoading, manifestDownloadFormats, onRequestManifest, }) => {
|
|
6
|
+
export const ExportToTerraNotStarted = ({ ExportTerraForm, ExportToTerraStart, fileManifestFormatState, fileManifestState, formFacet, isLoading, manifestDownloadFormats, onRequestManifest, }) => {
|
|
7
7
|
return (React.createElement("div", null,
|
|
8
8
|
React.createElement(Loading, { loading: isLoading, panelStyle: PAPER_PANEL_STYLE.FLUID, text: "Your link will be ready shortly..." }),
|
|
9
9
|
React.createElement(FluidPaper, null,
|
|
10
10
|
React.createElement(Section, null,
|
|
11
11
|
React.createElement(SectionContent, null,
|
|
12
12
|
React.createElement(ExportToTerraStart, null)),
|
|
13
|
-
React.createElement(ExportTerraForm, { formFacet: formFacet, isLoading: fileManifestState.isLoading,
|
|
13
|
+
React.createElement(ExportTerraForm, { fileManifestFormatState: fileManifestFormatState, formFacet: formFacet, isLoading: fileManifestState.isLoading, manifestDownloadFormats: manifestDownloadFormats, onRequestManifest: onRequestManifest })))));
|
|
14
14
|
};
|
|
@@ -15,4 +15,4 @@ export interface ExportToTerraProps {
|
|
|
15
15
|
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
16
16
|
manifestDownloadFormats: ManifestDownloadFormat[];
|
|
17
17
|
}
|
|
18
|
-
export declare const ExportToTerra: ({ ExportForm, ExportToTerraStart, ExportToTerraSuccess, fileManifestState,
|
|
18
|
+
export declare const ExportToTerra: ({ ExportForm, ExportToTerraStart, ExportToTerraSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, manifestDownloadFormat, manifestDownloadFormats, }: ExportToTerraProps) => JSX.Element;
|
|
@@ -2,17 +2,20 @@ import React from "react";
|
|
|
2
2
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
3
3
|
import { useExportToTerraResponseURL } from "../../../../hooks/useExportToTerraResponseURL";
|
|
4
4
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
5
|
-
import {
|
|
5
|
+
import { useFileManifestFormat } from "../../../../hooks/useFileManifest/useFileManifestFormat";
|
|
6
|
+
import { useRequestFileLocation } from "../../../../hooks/useRequestFileLocation";
|
|
7
|
+
import { useRequestManifest } from "../../../../hooks/useRequestManifest/useRequestManifest";
|
|
6
8
|
import { trackExportToTerraRequested } from "../../common/tracking";
|
|
7
9
|
import { ExportToTerraNotStarted } from "./components/ExportToTerraNotStarted/exportToTerraNotStarted";
|
|
8
10
|
import { ExportToTerraReady } from "./components/ExportToTerraReady/exportToTerraReady";
|
|
9
|
-
export const ExportToTerra = ({ ExportForm, ExportToTerraStart, ExportToTerraSuccess, fileManifestState,
|
|
11
|
+
export const ExportToTerra = ({ ExportForm, ExportToTerraStart, ExportToTerraSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, manifestDownloadFormat, manifestDownloadFormats, }) => {
|
|
10
12
|
const { exploreState: { tabValue: entityList }, } = useExploreState();
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const {
|
|
13
|
+
useFileManifest(filters, fileSummaryFacetName);
|
|
14
|
+
const fileManifestFormatState = useFileManifestFormat(manifestDownloadFormat);
|
|
15
|
+
const { requestMethod, requestParams, requestUrl } = useRequestManifest(fileManifestFormatState.fileManifestFormat, formFacet);
|
|
16
|
+
const { data, isLoading, run } = useRequestFileLocation(requestUrl, requestMethod);
|
|
14
17
|
const exportURL = useExportToTerraResponseURL(requestParams, data);
|
|
15
|
-
return exportURL ? (React.createElement(ExportToTerraReady, { ExportToTerraSuccess: ExportToTerraSuccess, exportURL: exportURL })) : (React.createElement(ExportToTerraNotStarted, { ExportTerraForm: ExportForm, ExportToTerraStart: ExportToTerraStart, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, manifestDownloadFormats: manifestDownloadFormats, onRequestManifest: () => {
|
|
18
|
+
return exportURL ? (React.createElement(ExportToTerraReady, { ExportToTerraSuccess: ExportToTerraSuccess, exportURL: exportURL })) : (React.createElement(ExportToTerraNotStarted, { ExportTerraForm: ExportForm, ExportToTerraStart: ExportToTerraStart, fileManifestFormatState: fileManifestFormatState, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, manifestDownloadFormats: manifestDownloadFormats, onRequestManifest: () => {
|
|
16
19
|
// Execute GA tracking
|
|
17
20
|
trackExportToTerraRequested(entityList);
|
|
18
21
|
// Request manifest
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Filters } from "../../../../../../common/entities";
|
|
2
2
|
import { FileManifestType } from "../../../../../../hooks/useFileManifest/common/entities";
|
|
3
|
+
import { ManifestDownloadFormat } from "../../../../common/entities";
|
|
3
4
|
export interface ManifestDownloadEntityProps {
|
|
4
5
|
fileManifestType: FileManifestType;
|
|
5
6
|
filters: Filters;
|
|
7
|
+
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
6
8
|
metadataFilters: Filters;
|
|
7
9
|
}
|
|
8
|
-
export declare const ManifestDownloadEntity: ({
|
|
10
|
+
export declare const ManifestDownloadEntity: ({ filters, metadataFilters, }: ManifestDownloadEntityProps) => JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { useRequestFileManifest } from "../../../../../../hooks/useFileManifest/useRequestFileManifest";
|
|
2
|
+
import { useFileManifest } from "../../../../../../hooks/useFileManifest/useFileManifest";
|
|
4
3
|
import { FileManifestDownload } from "./components/FileManifestDownload/fileManifestDownload";
|
|
5
4
|
import { FileManifestSpreadsheet } from "./components/FileManifestSpreadsheet/fileManifestSpreadsheet";
|
|
6
|
-
export const ManifestDownloadEntity = ({
|
|
7
|
-
|
|
5
|
+
export const ManifestDownloadEntity = ({ filters, metadataFilters, }) => {
|
|
6
|
+
useFileManifest(filters, undefined);
|
|
8
7
|
return (React.createElement(React.Fragment, null,
|
|
9
8
|
React.createElement(FileManifestSpreadsheet, { filters: metadataFilters }),
|
|
10
9
|
React.createElement(FileManifestDownload, { filters: filters })));
|
|
@@ -2,7 +2,7 @@ import { ElementType } from "react";
|
|
|
2
2
|
import { Filters } from "../../../../common/entities";
|
|
3
3
|
import { FileManifestType } from "../../../../hooks/useFileManifest/common/entities";
|
|
4
4
|
import { FileManifestState } from "../../../../providers/fileManifestState";
|
|
5
|
-
import { FormFacet } from "../../common/entities";
|
|
5
|
+
import { FormFacet, ManifestDownloadFormat } from "../../common/entities";
|
|
6
6
|
export interface ManifestDownloadProps {
|
|
7
7
|
fileManifestState: FileManifestState;
|
|
8
8
|
fileManifestType: FileManifestType;
|
|
@@ -10,7 +10,8 @@ export interface ManifestDownloadProps {
|
|
|
10
10
|
filters: Filters;
|
|
11
11
|
formFacet: FormFacet;
|
|
12
12
|
ManifestDownloadForm: ElementType;
|
|
13
|
+
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
13
14
|
ManifestDownloadStart: ElementType;
|
|
14
15
|
ManifestDownloadSuccess: ElementType;
|
|
15
16
|
}
|
|
16
|
-
export declare const ManifestDownload: ({ fileManifestState,
|
|
17
|
+
export declare const ManifestDownload: ({ fileManifestState, fileSummaryFacetName, filters, formFacet, ManifestDownloadForm, manifestDownloadFormat, ManifestDownloadStart, ManifestDownloadSuccess, }: ManifestDownloadProps) => JSX.Element;
|
|
@@ -2,14 +2,16 @@ import React from "react";
|
|
|
2
2
|
import { MANIFEST_DOWNLOAD_FORMAT } from "../../../../apis/azul/common/entities";
|
|
3
3
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
4
4
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
5
|
-
import {
|
|
5
|
+
import { useRequestFileLocation, } from "../../../../hooks/useRequestFileLocation";
|
|
6
|
+
import { useRequestManifest } from "../../../../hooks/useRequestManifest/useRequestManifest";
|
|
6
7
|
import { trackFileManifestRequested } from "../../common/tracking";
|
|
7
8
|
import { ManifestDownloadNotStarted } from "./components/ManifestDownloadNotStarted/manifestDownloadNotStarted";
|
|
8
9
|
import { ManifestDownloadReady } from "./components/ManifestDownloadReady/manifestDownloadReady";
|
|
9
|
-
export const ManifestDownload = ({ fileManifestState,
|
|
10
|
-
|
|
10
|
+
export const ManifestDownload = ({ fileManifestState, fileSummaryFacetName, filters, formFacet, ManifestDownloadForm, manifestDownloadFormat = MANIFEST_DOWNLOAD_FORMAT.COMPACT, ManifestDownloadStart, ManifestDownloadSuccess, }) => {
|
|
11
|
+
useFileManifest(filters, fileSummaryFacetName);
|
|
11
12
|
const { exploreState: { tabValue: entityList }, } = useExploreState();
|
|
12
|
-
const {
|
|
13
|
+
const { requestMethod, requestUrl } = useRequestManifest(manifestDownloadFormat, formFacet);
|
|
14
|
+
const { data, isLoading, run } = useRequestFileLocation(requestUrl, requestMethod);
|
|
13
15
|
const manifestURL = getManifestDownloadURL(data);
|
|
14
16
|
return manifestURL ? (React.createElement(ManifestDownloadReady, { ManifestDownloadSuccess: ManifestDownloadSuccess, manifestURL: manifestURL })) : (React.createElement(ManifestDownloadNotStarted, { ManifestDownloadForm: ManifestDownloadForm, ManifestDownloadStart: ManifestDownloadStart, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, onRequestManifest: () => {
|
|
15
17
|
trackFileManifestRequested(entityList);
|
|
@@ -60,7 +60,7 @@ export function getSortMatchesFn(searchTerm) {
|
|
|
60
60
|
if (match) {
|
|
61
61
|
matches.push({ labelRanges: match.ranges, score: match.score, value });
|
|
62
62
|
}
|
|
63
|
-
else {
|
|
63
|
+
else if (typeof value.key === "string") {
|
|
64
64
|
match = matchString(value.key || "");
|
|
65
65
|
if (match)
|
|
66
66
|
matches.push({ score: match.score, value });
|
|
@@ -2,7 +2,7 @@ import { VariableSizeListProps as ListProps } from "react-window";
|
|
|
2
2
|
import { CategoryKey } from "../../../../common/entities";
|
|
3
3
|
import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
|
|
4
4
|
import { FilterMenuSearchMatch } from "../../common/entities";
|
|
5
|
-
export type ItemSizeByItemKey = Map<
|
|
5
|
+
export type ItemSizeByItemKey = Map<unknown, number>;
|
|
6
6
|
export interface VariableSizeListProps {
|
|
7
7
|
categoryKey: CategoryKey;
|
|
8
8
|
categorySection?: string;
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
categorySection?: string;
|
|
8
8
|
matchedItem: FilterMenuSearchMatch;
|
|
9
9
|
onFilter: OnFilterFn;
|
|
10
|
-
onUpdateItemSizeByItemKey: (itemKey:
|
|
10
|
+
onUpdateItemSizeByItemKey: (itemKey: unknown, itemSize: number) => void;
|
|
11
11
|
style: CSSProperties;
|
|
12
12
|
}
|
|
13
13
|
export default function VariableSizeListItem({ categoryKey, categorySection, matchedItem, onFilter, onUpdateItemSizeByItemKey, style, }: Props): JSX.Element;
|
|
@@ -42,7 +42,7 @@ export function buildCategoryViews(columns, columnFilters) {
|
|
|
42
42
|
const values = [...getFacetedUniqueValues()].map(([value, count]) => ({
|
|
43
43
|
count,
|
|
44
44
|
key: value,
|
|
45
|
-
label: value,
|
|
45
|
+
label: String(value ?? ""),
|
|
46
46
|
selected: false, // Selected state updated in reducer.
|
|
47
47
|
}));
|
|
48
48
|
categoryViews.push({
|
package/lib/config/entities.d.ts
CHANGED
|
@@ -158,7 +158,11 @@ function isCategoryAcceptListed(category, categoryConfigs) {
|
|
|
158
158
|
* @returns Number indicating sort precedence of cv0 vs cv1.
|
|
159
159
|
*/
|
|
160
160
|
function sortCategoryValueViews(cvv0, cvv1) {
|
|
161
|
-
return
|
|
161
|
+
return !cvv0.label
|
|
162
|
+
? 1
|
|
163
|
+
: !cvv1.label
|
|
164
|
+
? -1
|
|
165
|
+
: COLLATOR_CASE_INSENSITIVE.compare(cvv0.label, cvv1.label);
|
|
162
166
|
}
|
|
163
167
|
/**
|
|
164
168
|
* Sort category views by display label, ascending.
|
|
@@ -38,11 +38,6 @@ export declare enum FILE_MANIFEST_TYPE {
|
|
|
38
38
|
EXPORT_TO_TERRA = "EXPORT_TO_TERRA"
|
|
39
39
|
}
|
|
40
40
|
export type FileManifestType = FILE_MANIFEST_TYPE;
|
|
41
|
-
export declare enum FILES_FACETS_STATUS {
|
|
42
|
-
COMPLETED = "COMPLETED",
|
|
43
|
-
IN_PROGRESS = "IN_PROGRESS",
|
|
44
|
-
NOT_STARTED = "NOT_STARTED"
|
|
45
|
-
}
|
|
46
41
|
export type SelectedSearchTermsBySearchKey = Map<CategoryKey, Set<CategoryValueKey>>;
|
|
47
42
|
/**
|
|
48
43
|
* Model of an individual facet value. For example, the term "Homo Sapiens" contained in the facet "Species".
|
|
@@ -7,9 +7,3 @@ export var FILE_MANIFEST_TYPE;
|
|
|
7
7
|
FILE_MANIFEST_TYPE["ENTITY_EXPORT_TO_TERRA"] = "ENTITY_EXPORT_TO_TERRA";
|
|
8
8
|
FILE_MANIFEST_TYPE["EXPORT_TO_TERRA"] = "EXPORT_TO_TERRA";
|
|
9
9
|
})(FILE_MANIFEST_TYPE || (FILE_MANIFEST_TYPE = {}));
|
|
10
|
-
export var FILES_FACETS_STATUS;
|
|
11
|
-
(function (FILES_FACETS_STATUS) {
|
|
12
|
-
FILES_FACETS_STATUS["COMPLETED"] = "COMPLETED";
|
|
13
|
-
FILES_FACETS_STATUS["IN_PROGRESS"] = "IN_PROGRESS";
|
|
14
|
-
FILES_FACETS_STATUS["NOT_STARTED"] = "NOT_STARTED";
|
|
15
|
-
})(FILES_FACETS_STATUS || (FILES_FACETS_STATUS = {}));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Filters } from "../../common/entities";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Initializes the file manifest with specified filters and a file summary facet name.
|
|
4
|
+
* This hook sets up the file manifest state by dispatching an action to fetch the manifest
|
|
5
|
+
* based on the provided initial filters and file summary facet name. It also ensures that
|
|
6
|
+
* the manifest state is cleared when the component is unmounted.
|
|
7
|
+
* @param initialFilters - The initial filters used to fetch the file manifest.
|
|
8
|
+
* @param fileSummaryFacetName - The name of the file summary facet to be used in the file manifest request.
|
|
6
9
|
*/
|
|
7
|
-
export declare const useFileManifest: (
|
|
10
|
+
export declare const useFileManifest: (initialFilters?: Filters | undefined, fileSummaryFacetName?: string) => void;
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { FileManifestActionKind } from "../../providers/fileManifestState";
|
|
1
3
|
import { useFileManifestState } from "../useFileManifestState";
|
|
2
|
-
import { METHOD, useRequestFileLocation, } from "../useRequestFileLocation";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Initializes the file manifest with specified filters and a file summary facet name.
|
|
6
|
+
* This hook sets up the file manifest state by dispatching an action to fetch the manifest
|
|
7
|
+
* based on the provided initial filters and file summary facet name. It also ensures that
|
|
8
|
+
* the manifest state is cleared when the component is unmounted.
|
|
9
|
+
* @param initialFilters - The initial filters used to fetch the file manifest.
|
|
10
|
+
* @param fileSummaryFacetName - The name of the file summary facet to be used in the file manifest request.
|
|
7
11
|
*/
|
|
8
|
-
export const useFileManifest = (
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
+
export const useFileManifest = (initialFilters = [], fileSummaryFacetName) => {
|
|
13
|
+
// Initial file manifest filter.
|
|
14
|
+
const [initFilters] = useState(() => initialFilters);
|
|
15
|
+
// File manifest state.
|
|
16
|
+
const { fileManifestDispatch } = useFileManifestState();
|
|
17
|
+
// Fetches file manifest with the given file manifest filters, format.
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
fileManifestDispatch({
|
|
20
|
+
payload: {
|
|
21
|
+
fileSummaryFacetName,
|
|
22
|
+
filters: initFilters,
|
|
23
|
+
},
|
|
24
|
+
type: FileManifestActionKind.FetchFileManifest,
|
|
25
|
+
});
|
|
26
|
+
return () => {
|
|
27
|
+
fileManifestDispatch({
|
|
28
|
+
payload: undefined,
|
|
29
|
+
type: FileManifestActionKind.ClearFileManifest,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}, [fileManifestDispatch, fileSummaryFacetName, initFilters]);
|
|
12
33
|
};
|
|
@@ -2,9 +2,9 @@ import { useEffect } from "react";
|
|
|
2
2
|
import { MANIFEST_DOWNLOAD_FORMAT } from "../../apis/azul/common/entities";
|
|
3
3
|
import { BULK_DOWNLOAD_EXECUTION_ENVIRONMENT } from "../../components/Export/common/entities";
|
|
4
4
|
import { useCatalog } from "../useCatalog";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useConfig } from "../useConfig";
|
|
6
|
+
import { useRequestFileLocation, } from "../useRequestFileLocation";
|
|
7
|
+
import { buildRequestManifest } from "../useRequestManifest/utils";
|
|
8
8
|
/**
|
|
9
9
|
* Returns file manifest download url and file name.
|
|
10
10
|
* @param filters - Filters.
|
|
@@ -12,13 +12,14 @@ import { useFileManifestURL } from "./useFileManifestURL";
|
|
|
12
12
|
* @returns file manifest download url and file name.
|
|
13
13
|
*/
|
|
14
14
|
export const useFileManifestDownload = (filters, disabled) => {
|
|
15
|
-
//
|
|
16
|
-
const
|
|
15
|
+
// Retrieve the endpoint URL from configured data source.
|
|
16
|
+
const config = useConfig();
|
|
17
|
+
const endpointUrl = config.config.dataSource.url;
|
|
17
18
|
// Determine catalog.
|
|
18
19
|
const catalog = useCatalog(); // catalog should be defined.
|
|
19
|
-
// Build request URL.
|
|
20
|
-
const {
|
|
21
|
-
const { data, isIdle, isLoading, run } =
|
|
20
|
+
// Build request manifest request URL.
|
|
21
|
+
const { requestMethod, requestUrl } = buildRequestManifest(endpointUrl, catalog, filters, MANIFEST_DOWNLOAD_FORMAT.COMPACT);
|
|
22
|
+
const { data, isIdle, isLoading, run } = useRequestFileLocation(requestUrl, requestMethod);
|
|
22
23
|
const manifestURL = getManifestDownloadURL(data);
|
|
23
24
|
const fileName = getManifestDownloadFileName(data);
|
|
24
25
|
// Requests file manifest.
|
|
@@ -26,7 +27,7 @@ export const useFileManifestDownload = (filters, disabled) => {
|
|
|
26
27
|
if (disabled)
|
|
27
28
|
return;
|
|
28
29
|
run();
|
|
29
|
-
}, [disabled,
|
|
30
|
+
}, [disabled, requestUrl, run]);
|
|
30
31
|
return {
|
|
31
32
|
fileName,
|
|
32
33
|
isIdle,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { ManifestDownloadFormat } from "../../components/Export/common/entities";
|
|
3
|
+
export interface FileManifestFormatState {
|
|
4
|
+
fileManifestFormat: ManifestDownloadFormat | undefined;
|
|
5
|
+
setFileManifestFormat: Dispatch<SetStateAction<ManifestDownloadFormat | undefined>>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Facilitates the management of file manifest format state.
|
|
9
|
+
* @param manifestDownloadFormat - The initial manifest download format used to fetch the file manifest.
|
|
10
|
+
* @returns The file manifest format state and a function to set the file manifest format.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useFileManifestFormat: (manifestDownloadFormat?: ManifestDownloadFormat) => FileManifestFormatState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Facilitates the management of file manifest format state.
|
|
4
|
+
* @param manifestDownloadFormat - The initial manifest download format used to fetch the file manifest.
|
|
5
|
+
* @returns The file manifest format state and a function to set the file manifest format.
|
|
6
|
+
*/
|
|
7
|
+
export const useFileManifestFormat = (manifestDownloadFormat) => {
|
|
8
|
+
const [fileManifestFormat, setFileManifestFormat] = useState(manifestDownloadFormat);
|
|
9
|
+
return { fileManifestFormat, setFileManifestFormat };
|
|
10
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { METHOD } from "./types";
|
|
1
2
|
export interface FileLocation {
|
|
2
3
|
commandLine?: {
|
|
3
4
|
[key: string]: string;
|
|
@@ -14,10 +15,6 @@ export interface UseRequestFileLocationResult {
|
|
|
14
15
|
run: () => void;
|
|
15
16
|
}
|
|
16
17
|
export type Method = METHOD;
|
|
17
|
-
export declare enum METHOD {
|
|
18
|
-
GET = "GET",
|
|
19
|
-
PUT = "PUT"
|
|
20
|
-
}
|
|
21
18
|
/**
|
|
22
19
|
* Function to make a get request and map the result to camelCase
|
|
23
20
|
* @param url - url for the get request
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef } from "react";
|
|
2
2
|
import { FILE_LOCATION_PENDING, FILE_LOCATION_SUCCESSFULLY, } from "../apis/azul/common/constants";
|
|
3
|
+
import { METHOD } from "./types";
|
|
3
4
|
import { useAsync } from "./useAsync";
|
|
4
5
|
import { useAuthentication } from "./useAuthentication/useAuthentication";
|
|
5
|
-
export var METHOD;
|
|
6
|
-
(function (METHOD) {
|
|
7
|
-
METHOD["GET"] = "GET";
|
|
8
|
-
METHOD["PUT"] = "PUT";
|
|
9
|
-
})(METHOD || (METHOD = {}));
|
|
10
6
|
/**
|
|
11
7
|
* Returns fetch request options.
|
|
12
8
|
* @param accessToken - Access token.
|