优化
This commit is contained in:
@@ -67,8 +67,15 @@ export function normalizeModuleOrder(modules) {
|
||||
for (const prerequisite of financeChain) {
|
||||
if (!normalized.includes(prerequisite)) normalized.splice(normalized.indexOf('finance-downloads'), 0, prerequisite)
|
||||
}
|
||||
normalized.splice(normalized.indexOf('finance-downloads'), 1)
|
||||
normalized.splice(normalized.indexOf('finance-settlement-full') + 1, 0, 'finance-downloads')
|
||||
const completeFinanceChain = [...financeChain, 'finance-downloads']
|
||||
const firstChainIndex = normalized.findIndex((name) => completeFinanceChain.includes(name))
|
||||
let predecessor = firstChainIndex > 0 ? normalized[firstChainIndex - 1] : null
|
||||
if (!predecessor) predecessor = ['phase3-container-loading', 'inbound-measurement', 'orders', 'merchant-qualification-fixture']
|
||||
.find((name) => normalized.includes(name)) || null
|
||||
const withoutChain = normalized.filter((name) => !completeFinanceChain.includes(name))
|
||||
const insertionIndex = predecessor ? withoutChain.indexOf(predecessor) + 1 : withoutChain.length
|
||||
withoutChain.splice(insertionIndex, 0, ...completeFinanceChain)
|
||||
normalized.splice(0, normalized.length, ...withoutChain)
|
||||
}
|
||||
if (normalized.includes('fee-items')) {
|
||||
const prerequisites = ['merchant-qualification-fixture', 'orders']
|
||||
|
||||
Reference in New Issue
Block a user