feat(FN-971): add mission status summary with progress bar to mission list
- Add MissionSummary type and getMissionSummary method to MissionStore - Include mission summary data in GET /missions API endpoint - Update frontend types and API client for mission summary - Display mission status summary with progress bar on MissionManager list cards - Add CSS styles for progress bar and summary display - Update MissionManager tests for summary display
This commit is contained in:
@@ -31,6 +31,7 @@ import type {
|
||||
FeatureStatus,
|
||||
InterviewState,
|
||||
} from "@fusion/core";
|
||||
import type { MissionSummary } from "@fusion/core";
|
||||
import {
|
||||
MISSION_STATUSES,
|
||||
MILESTONE_STATUSES,
|
||||
@@ -184,7 +185,7 @@ export function createMissionRouter(store: TaskStore): Router {
|
||||
|
||||
/**
|
||||
* GET /api/missions
|
||||
* List all missions ordered by createdAt desc
|
||||
* List all missions ordered by createdAt desc, with status summary
|
||||
*/
|
||||
router.get(
|
||||
"/",
|
||||
@@ -192,7 +193,12 @@ export function createMissionRouter(store: TaskStore): Router {
|
||||
const missions = missionStore.listMissions();
|
||||
// Sort by createdAt desc
|
||||
missions.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
||||
res.json(missions);
|
||||
// Attach status summary to each mission
|
||||
const missionsWithSummary = missions.map((mission) => ({
|
||||
...mission,
|
||||
summary: missionStore.getMissionSummary(mission.id),
|
||||
}));
|
||||
res.json(missionsWithSummary);
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user