@@ -423,78 +423,7 @@ function BoardSummaryTable(props: Readonly<IBoardSummaryTableProps>): JSX.Elemen
423
423
allDataLoaded : true ,
424
424
} ) ;
425
425
} ;
426
- /*
427
- const oldhandleActionItems = async () => {
428
- const updatedBoardsTableItems = [...updatedState.boardsTableItems];
429
- const updatedActionItemsByBoard = { ...updatedState.actionItemsByBoard };
430
-
431
- await Promise.all(updatedState.feedbackBoards.map(async (feedbackBoard) => {
432
- const feedbackBoardId: string = feedbackBoard.id;
433
-
434
- // Fetch feedback items for the board
435
- const feedbackItems = await itemDataService.getFeedbackItemsForBoard(feedbackBoardId);
436
- if (!feedbackItems.length) {
437
- return;
438
- }
439
-
440
- const feedbackItemsCount = feedbackItems.length;
441
-
442
- const workItemTypeToStatesMap: { [key: string]: WorkItemStateColor[] } = {};
443
- await Promise.all(props.supportedWorkItemTypes.map(async (workItemType) => {
444
- const workItemTypeStates = await workItemService.getWorkItemStates(workItemType.name);
445
- workItemTypeToStatesMap[workItemType.name] = workItemTypeStates;
446
- }));
447
-
448
- const aggregatedWorkItems: WorkItem[] = [];
449
- await Promise.all(feedbackItems.map(async (feedbackItem) => {
450
- if (!feedbackItem.associatedActionItemIds?.length) {
451
- return;
452
- }
453
-
454
- const workItems = await workItemService.getWorkItemsByIds(feedbackItem.associatedActionItemIds);
455
- if (!workItems.length) {
456
- return;
457
- }
458
426
459
- aggregatedWorkItems.push(...workItems);
460
- }));
461
-
462
- // Update action items for the board
463
- updatedActionItemsByBoard[feedbackBoardId] = {
464
- isDataLoaded: true,
465
- actionItems: aggregatedWorkItems,
466
- };
467
-
468
- const pendingWorkItems = aggregatedWorkItems.filter((workItem) => {
469
- const states = workItemTypeToStatesMap[workItem.fields['System.WorkItemType']]
470
- .filter((workItemState) => workItemState.name === workItem.fields['System.State']);
471
- return !states.length || (states[0].category !== 'Completed' && states[0].category !== 'Removed');
472
- });
473
-
474
- const pendingWorkItemsCount = pendingWorkItems.length;
475
- const totalWorkItemsCount = aggregatedWorkItems.length;
476
-
477
- // Batch update for the boards table items
478
- const boardIndex = updatedBoardsTableItems.findIndex(item => item.id === feedbackBoardId);
479
- if (boardIndex !== -1) {
480
- updatedBoardsTableItems[boardIndex] = {
481
- ...updatedBoardsTableItems[boardIndex],
482
- feedbackItemsCount,
483
- pendingWorkItemsCount,
484
- totalWorkItemsCount,
485
- };
486
- }
487
- }));
488
-
489
- // Final state update
490
- setBoardSummaryState({
491
- ...updatedState,
492
- boardsTableItems: updatedBoardsTableItems,
493
- actionItemsByBoard: updatedActionItemsByBoard,
494
- allDataLoaded: true,
495
- });
496
- };
497
- */
498
427
const boardRowSummary = ( row : Row < IBoardSummaryTableItem > ) => {
499
428
const currentBoard = boardSummaryState . boardsTableItems . find ( board => board . id === row . original . id ) ;
500
429
const actionItems = boardSummaryState . actionItemsByBoard [ currentBoard . id ] ;
0 commit comments