@@ -1062,7 +1062,7 @@ const MapProject = () => {
10621062 }
10631063
10641064
1065- const getRowsResults = async ( rows ) => {
1065+ const getRowsResults = async ( rows , selectedAlgos ) => {
10661066 abortRef . current = false ;
10671067
10681068 // Function to process a single batch
@@ -1190,10 +1190,9 @@ const MapProject = () => {
11901190 await Promise . race ( activeRequests ) ;
11911191 }
11921192 } ;
1193-
1194- let subActions = [ ...map ( algosSelected , algo => algo . name || algo . id ) ]
1195- if ( ! isMultiAlgo )
1196- subActions . push ( 'reranker' )
1193+ let _selectedAlgos = filter ( algosSelected , algo => selectedAlgos . includes ( algo . id ) )
1194+ let subActions = [ ...map ( _selectedAlgos , algo => algo . name || algo . id ) ]
1195+ subActions . push ( 'reranker' )
11971196 if ( autoMatchUnmappedOnly )
11981197 subActions . push ( 'unmatched_only' )
11991198 if ( inAIAssistantGroup && autoRunAIAnalysis )
@@ -1209,24 +1208,23 @@ const MapProject = () => {
12091208 ? filter ( rows , row => rowStatuses . unmapped . includes ( row . __index ) )
12101209 : filter ( rows , row => ! rowStatuses . reviewed . includes ( row . __index ) )
12111210
1212- let nextAlgo = { ...getFirstAlgoDef ( ) }
12131211 const algoPromises = [ ]
1214- while ( nextAlgo ?. id ) {
1215- if ( [ 'custom' , 'ocl-search' , 'ocl-semantic' ] . includes ( nextAlgo . type ) )
1216- algoPromises . push ( processWithConcurrency ( repo , nextAlgo , rowsToProcess ) ) ;
1217- else if ( nextAlgo . type === 'ocl-ciel-bridge' && canBridge )
1218- algoPromises . push ( fetchBulkBridgeCandidates ( rowsToProcess , nextAlgo ) )
1219- else if ( nextAlgo . type === 'ocl-scispacy' && canScispacy )
1220- algoPromises . push ( fetchBulkScispacyCandidates ( rowsToProcess , nextAlgo ) )
1221- nextAlgo = getNextAlgoDef ( nextAlgo . id )
1222- }
1212+ forEach ( _selectedAlgos , algo => {
1213+ if ( [ 'custom' , 'ocl-search' , 'ocl-semantic' ] . includes ( algo . type ) )
1214+ algoPromises . push ( processWithConcurrency ( repo , algo , rowsToProcess ) ) ;
1215+ else if ( algo . type === 'ocl-ciel-bridge' && canBridge )
1216+ algoPromises . push ( fetchBulkBridgeCandidates ( rowsToProcess , algo ) )
1217+ else if ( algo . type === 'ocl-scispacy' && canScispacy )
1218+ algoPromises . push ( fetchBulkScispacyCandidates ( rowsToProcess , algo ) )
1219+ } )
12231220 await Promise . all ( algoPromises )
1224-
1225- await processRerankWithConcurrency ( rowsToProcess , 2 )
1221+ if ( _selectedAlgos . length )
1222+ await processRerankWithConcurrency ( rowsToProcess , 2 )
12261223 if ( inAIAssistantGroup && autoRunAIAnalysis ) {
12271224 await new Promise ( resolve => setTimeout ( resolve , 1000 ) )
12281225 await runBulkAIAnalysis ( rowsToProcess )
12291226 } else {
1227+ setIsLoadingInDecisionView ( false )
12301228 setLoadingMatches ( false )
12311229 setEndMatchingAt ( moment ( ) )
12321230 }
@@ -1416,7 +1414,7 @@ const MapProject = () => {
14161414 setMatchDialog ( true )
14171415 }
14181416
1419- const onGetCandidatesSubmit = event => {
1417+ const onGetCandidatesSubmit = ( event , selectedAlgos ) => {
14201418 event . stopPropagation ( )
14211419 event . preventDefault ( )
14221420 setAlert ( false )
@@ -1429,7 +1427,7 @@ const MapProject = () => {
14291427 setScispacyCandidatesStartedAt ( null )
14301428 setScispacyCandidatesEndedAt ( null )
14311429 setLoadingMatches ( true )
1432- getRowsResults ( data )
1430+ getRowsResults ( data , selectedAlgos )
14331431 } else {
14341432 setAlert ( { message : t ( 'map_project.no_valid_columns_for_matching' ) } )
14351433 setTimeout ( ( ) => setAlert ( false ) , 10000 )
@@ -2880,7 +2878,8 @@ const MapProject = () => {
28802878 AIModel,
28812879 setAIModel,
28822880 repoVersion,
2883- inAIAssistantGroup
2881+ inAIAssistantGroup,
2882+ algosSelected
28842883 } }
28852884 />
28862885 </ Paper >
0 commit comments