Feat: The PageRank value on the dataset settings page fails to display when the page is opened. (#17309)

### Summary
Feat: The PageRank value on the dataset settings page fails to display
when the page is opened.
This commit is contained in:
balibabu
2026-07-24 15:27:24 +08:00
committed by GitHub
parent 0403d19b5a
commit 890a414a47

View File

@@ -29,10 +29,17 @@ export function transformParserConfigSetups(
}
return Object.entries(setups)
.map(([fileFormat, config]) => ({
fileFormat,
...config,
}))
.map(([fileFormat, config]) => {
const { pages, ...rest } = (config ?? {}) as Record<string, any>;
const normalizedPages = Array.isArray(pages)
? pages.map(([from, to]: [number, number]) => ({ from, to }))
: pages;
return {
fileFormat,
...rest,
...(normalizedPages !== undefined ? { pages: normalizedPages } : {}),
} as Record<string, any>;
})
.sort((a, b) => (a.order_index ?? Infinity) - (b.order_index ?? Infinity));
}