mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-03 06:03:12 +00:00
Sort assets in search indexing app (#18791)
This commit is contained in:
parent
998cbd1558
commit
b3679f0cea
@ -22,11 +22,12 @@ describe('ApplicationUtils tests', () => {
|
|||||||
it('getEntityStatsData should return stats data in array', () => {
|
it('getEntityStatsData should return stats data in array', () => {
|
||||||
const resultData = getEntityStatsData(MOCK_APPLICATION_ENTITY_STATS);
|
const resultData = getEntityStatsData(MOCK_APPLICATION_ENTITY_STATS);
|
||||||
|
|
||||||
expect(resultData).toEqual(
|
const sortedMockData = MOCK_APPLICATION_ENTITY_STATS_DATA.map((data) => ({
|
||||||
MOCK_APPLICATION_ENTITY_STATS_DATA.map((data) => ({
|
...data,
|
||||||
...data,
|
name: upperFirst(data.name),
|
||||||
name: upperFirst(data.name),
|
})).sort((a, b) => a.name.localeCompare(b.name));
|
||||||
}))
|
|
||||||
);
|
// Verify the result matches the sorted mock data
|
||||||
|
expect(resultData).toEqual(sortedMockData);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -60,7 +60,7 @@ export const getStatusFromPipelineState = (status: PipelineState) => {
|
|||||||
export const getEntityStatsData = (data: EntityStats): EntityStatsData[] => {
|
export const getEntityStatsData = (data: EntityStats): EntityStatsData[] => {
|
||||||
const filteredRow = ['failedRecords', 'totalRecords', 'successRecords'];
|
const filteredRow = ['failedRecords', 'totalRecords', 'successRecords'];
|
||||||
|
|
||||||
return Object.keys(data).reduce((acc, key) => {
|
const result = Object.keys(data).reduce((acc, key) => {
|
||||||
if (filteredRow.includes(key)) {
|
if (filteredRow.includes(key)) {
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
@ -73,4 +73,6 @@ export const getEntityStatsData = (data: EntityStats): EntityStatsData[] => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, [] as EntityStatsData[]);
|
}, [] as EntityStatsData[]);
|
||||||
|
|
||||||
|
return result.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user