Skip to content

Commit 8e42af6

Browse files
authored
[DT-980] Fix the enumerate snapshots to get more snapshots than the first 10 (#2719)
1 parent e5e60a1 commit 8e42af6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/components/data_search/DatasetSearchTable.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import Tab from '@mui/material/Tab';
22
import Tabs from '@mui/material/Tabs';
3+
import useOnMount from '@mui/utils/useOnMount'
34
import * as React from 'react';
45
import { Box, Button } from '@mui/material';
5-
import { useEffect, useState, useRef } from 'react';
6+
import { useEffect, useState } from 'react';
67
import { isEmpty } from 'lodash';
78
import { TerraDataRepo } from '../../libs/ajax/TerraDataRepo';
89
import { DatasetSearchTableDisplay } from './DatasetSearchTableDisplay';
@@ -195,12 +196,12 @@ export const DatasetSearchTable = (props) => {
195196
}
196197
};
197198

198-
useEffect(() => {
199-
if (isEmpty(filtered)) {
199+
useOnMount(() => {
200+
if (isEmpty(datasets)) {
200201
return;
201202
}
202-
getExportableDatasets(filtered);
203-
}, [filtered]);
203+
getExportableDatasets(datasets);
204+
});
204205

205206
useEffect(() => {
206207
setFiltered(datasets);

src/libs/ajax/TerraDataRepo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export const TerraDataRepo = {
1818
};
1919
const rootTdrApiUrl = await Config.getTdrApiUrl();
2020
const snapshotPromises = partitionedIdentifiers.map(sublist => {
21-
const url = `${rootTdrApiUrl}/api/repository/v1/snapshots?duosDatasetIds=${sublist.join('&duosDatasetIds=')}`;
21+
// 1000 should be safe with only 70 DUOS IDs.
22+
const url = `${rootTdrApiUrl}/api/repository/v1/snapshots?limit=1000&duosDatasetIds=${sublist.join('&duosDatasetIds=')}`;
2223
return axios.get(url, Config.authOpts());
2324
});
2425
await Promise.all(snapshotPromises).then(function(responses) {

0 commit comments

Comments
 (0)