Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DT-980] Fix the enumerate snapshots to get more snapshots than the first 10 #2719

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/data_search/DatasetSearchTable.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Tab from '@mui/material/Tab';
import Tabs from '@mui/material/Tabs';
import useOnMount from '@mui/utils/useOnMount'
import * as React from 'react';
import { Box, Button } from '@mui/material';
import { useEffect, useState, useRef } from 'react';
import { useEffect, useState } from 'react';
import { isEmpty } from 'lodash';
import { TerraDataRepo } from '../../libs/ajax/TerraDataRepo';
import { DatasetSearchTableDisplay } from './DatasetSearchTableDisplay';
Expand Down Expand Up @@ -201,12 +202,12 @@ export const DatasetSearchTable = (props) => {
}
};

useEffect(() => {
if (isEmpty(filtered)) {
useOnMount(() => {
if (isEmpty(datasets)) {
return;
}
getExportableDatasets(filtered);
}, [filtered]);
getExportableDatasets(datasets);
});

useEffect(() => {
setFiltered(datasets);
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ajax/TerraDataRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const TerraDataRepo = {
};
const rootTdrApiUrl = await Config.getTdrApiUrl();
const snapshotPromises = partitionedIdentifiers.map(sublist => {
const url = `${rootTdrApiUrl}/api/repository/v1/snapshots?duosDatasetIds=${sublist.join('&duosDatasetIds=')}`;
// 1000 should be safe with only 70 DUOS IDs.
const url = `${rootTdrApiUrl}/api/repository/v1/snapshots?limit=1000&duosDatasetIds=${sublist.join('&duosDatasetIds=')}`;
return axios.get(url, Config.authOpts());
});
await Promise.all(snapshotPromises).then(function(responses) {
Expand Down
Loading