mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 12:39:01 +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', () => {
|
||||
const resultData = getEntityStatsData(MOCK_APPLICATION_ENTITY_STATS);
|
||||
|
||||
expect(resultData).toEqual(
|
||||
MOCK_APPLICATION_ENTITY_STATS_DATA.map((data) => ({
|
||||
...data,
|
||||
name: upperFirst(data.name),
|
||||
}))
|
||||
);
|
||||
const sortedMockData = MOCK_APPLICATION_ENTITY_STATS_DATA.map((data) => ({
|
||||
...data,
|
||||
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[] => {
|
||||
const filteredRow = ['failedRecords', 'totalRecords', 'successRecords'];
|
||||
|
||||
return Object.keys(data).reduce((acc, key) => {
|
||||
const result = Object.keys(data).reduce((acc, key) => {
|
||||
if (filteredRow.includes(key)) {
|
||||
return acc;
|
||||
}
|
||||
@ -73,4 +73,6 @@ export const getEntityStatsData = (data: EntityStats): EntityStatsData[] => {
|
||||
},
|
||||
];
|
||||
}, [] as EntityStatsData[]);
|
||||
|
||||
return result.sort((a, b) => a.name.localeCompare(b.name));
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user