This commit is contained in:
2026-08-14 10:09:46 +08:00
parent 0bc752a2be
commit 66089f9b99
31 changed files with 719 additions and 141 deletions
+14
View File
@@ -16,6 +16,20 @@ const CONFIGURED_MODULES = ['merchant-qualification-fixture', 'customers', 'over
export function normalizeModuleOrder(modules) {
const normalized = [...modules]
if (normalized.includes('fee-items')) {
const prerequisites = ['merchant-qualification-fixture', 'orders']
const feeItemsIndex = normalized.indexOf('fee-items')
const ordered = prerequisites.every((name, index) => {
const prerequisiteIndex = normalized.indexOf(name)
const previousIndex = index === 0 ? -1 : normalized.indexOf(prerequisites[index - 1])
return prerequisiteIndex > previousIndex && prerequisiteIndex < feeItemsIndex
})
if (!ordered) {
const requested = normalized.filter((name) => !prerequisites.includes(name))
requested.splice(requested.indexOf('fee-items'), 0, ...prerequisites)
normalized.splice(0, normalized.length, ...requested)
}
}
const loadingIndex = normalized.indexOf('phase3-loading')
const overviewIndex = normalized.indexOf('phase3-container-overview')
if (loadingIndex < 0 || overviewIndex < 0 || overviewIndex > loadingIndex) return normalized