Skip to content

Commit ff723c5

Browse files
Merge pull request #163 from Sanketika-Obsrv/listpage_fixes
List Page fixes
2 parents 1becfec + 564e527 commit ff723c5

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

web-console-v2/src/pages/DatasetList/DatasetList.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ const DatasetList: React.FC = () => {
339339
setEditTagsAnchorEl(null);
340340
setSelectedDataset(null);
341341
};
342+
342343
const handleEditTagsSave = async (
343344
dataset: Dataset,
344345
tags: string[],
@@ -367,13 +368,25 @@ const DatasetList: React.FC = () => {
367368
};
368369

369370
await updateDataset({ data: payload });
371+
372+
const updatedDatasets = datasets.map((ds) =>
373+
ds.dataset_id === dataset.dataset_id ? { ...ds, tags } : ds
374+
);
375+
setDatasets(updatedDatasets);
376+
377+
const allTags = Array.from(
378+
new Set(updatedDatasets.flatMap((dataset) => dataset.tags || []))
379+
);
380+
381+
const updatedFilters = {
382+
...filters,
383+
tag: _.union(defaultFilters.tag, allTags),
384+
};
385+
setFilters(updatedFilters);
386+
370387
setLoading(false);
371388
showAlertMessage(dataset.name, 'success', 'Edit Tags');
372-
setDatasets((prevDatasets) =>
373-
prevDatasets.map((ds) =>
374-
ds.dataset_id === dataset.dataset_id ? { ...ds, tags } : ds,
375-
),
376-
);
389+
handleCloseEditTagsPopover();
377390
} catch (error) {
378391
showAlertMessage(dataset.name, 'error', 'Edit Tags');
379392
setLoading(false);

web-console-v2/src/pages/DatasetList/DatasetlistCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ const DatasetlistCard: React.FC<DatasetlistCardProps> = ({
212212
Volume
213213
</Typography>
214214
<Typography variant="caption">
215-
0
215+
{eventCounts.totalEvents}
216216
</Typography>
217217
</Grid>
218218
<Grid item xs={1} className={styles.gridItemNoBorder}>
219219
<Typography variant="captionMedium">
220220
Size
221221
</Typography>
222222
<Typography variant="caption">
223-
0
223+
{prettyBytes(datasetSize)}
224224
</Typography>
225225
</Grid>
226226
</>

web-console-v2/src/services/dataset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ export const filterDatasets = (
519519
export const useTotalEvents = (datasetId: string, isMasterDataset: boolean) => {
520520
const dateFormat = 'YYYY-MM-DDT00:00:00+05:30';
521521
const startDate = '2000-01-01';
522-
const endDate = dayjs().add(1, 'day').format(dateFormat);
522+
const endDate = dayjs().format(dateFormat);
523523

524524
return useQueryWithLocalStorageFallback(
525525
['totalEvents', datasetId],

0 commit comments

Comments
 (0)