Skip to content

Commit 1df7bd9

Browse files
authored
Merge pull request #503 from microsoft/macae-v3-fr-dev-92
Macae v3 fr dev 92
2 parents 3210725 + e2b16f3 commit 1df7bd9

21 files changed

+47
-194
lines changed

src/frontend/src/api/config.tsx

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -131,51 +131,6 @@ export function headerBuilder(headers?: Record<string, string>): Record<string,
131131
};
132132
}
133133

134-
/**
135-
* Initialize team on the backend - takes about 20 seconds
136-
* @returns Promise with team initialization response
137-
*/
138-
// export async function initializeTeam(): Promise<{
139-
// status: string;
140-
// team_id: string;
141-
// }> {
142-
// const apiUrl = getApiUrl();
143-
// if (!apiUrl) {
144-
// throw new Error('API URL not configured');
145-
// }
146-
147-
// const headers = headerBuilder({
148-
// 'Content-Type': 'application/json',
149-
// });
150-
151-
// console.log('initializeTeam: Starting team initialization...');
152-
153-
// try {
154-
// const response = await fetch(`${apiUrl}/init_team`, {
155-
// method: 'GET',
156-
// headers,
157-
// });
158-
159-
// if (!response.ok) {
160-
// const errorText = await response.text();
161-
// throw new Error(errorText || `HTTP error! status: ${response.status}`);
162-
// }
163-
164-
// const data = await response.json();
165-
// console.log('initializeTeam: Team initialization completed:', data);
166-
167-
// // Validate the expected response format
168-
// if (data.status !== 'Request started successfully' || !data.team_id) {
169-
// throw new Error('Invalid response format from init_team endpoint');
170-
// }
171-
172-
// return data;
173-
// } catch (error) {
174-
// console.error('initializeTeam: Error initializing team:', error);
175-
// throw error;
176-
// }
177-
// }
178-
179134
export const toBoolean = (value: any): boolean => {
180135
if (typeof value !== 'string') {
181136
return false;
@@ -192,5 +147,4 @@ export default {
192147
config,
193148
USER_ID,
194149
API_URL,
195-
//initializeTeam
196150
};

src/frontend/src/pages/HomePage.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import React, { useEffect, useState, useCallback } from 'react';
22
import { useNavigate } from 'react-router-dom';
33
import {
4-
Button,
54
Spinner
65
} from '@fluentui/react-components';
7-
import {
8-
Add20Regular,
9-
ErrorCircle20Regular,
10-
Sparkle20Filled
11-
} from '@fluentui/react-icons';
126
import '../styles/PlanPage.css';
137
import CoralShellColumn from '../coral/components/Layout/CoralShellColumn';
148
import CoralShellRow from '../coral/components/Layout/CoralShellRow';
@@ -17,7 +11,6 @@ import HomeInput from '@/components/content/HomeInput';
1711
import { NewTaskService } from '../services/NewTaskService';
1812
import PlanPanelLeft from '@/components/content/PlanPanelLeft';
1913
import ContentToolbar from '@/coral/components/Content/ContentToolbar';
20-
import { TaskService } from '../services/TaskService';
2114
import { TeamConfig } from '../models/Team';
2215
import { TeamService } from '../services/TeamService';
2316
import InlineToaster, { useInlineToaster } from "../components/toast/InlineToaster";
@@ -30,16 +23,15 @@ const HomePage: React.FC = () => {
3023
const navigate = useNavigate();
3124
const { showToast, dismissToast } = useInlineToaster();
3225
const [selectedTeam, setSelectedTeam] = useState<TeamConfig | null>(null);
33-
const [isLoadingTeam, setIsLoadingTeam] = useState(true);
34-
26+
const [isLoadingTeam, setIsLoadingTeam] = useState<boolean>(true);
27+
const [reloadLeftList, setReloadLeftList] = useState<boolean>(true);
3528

3629
useEffect(() => {
3730
const initTeam = async () => {
3831
setIsLoadingTeam(true);
3932

4033
try {
4134
console.log('Initializing team from backend...');
42-
4335
// Call the backend init_team endpoint (takes ~20 seconds)
4436
const initResponse = await TeamService.initializeTeam();
4537

@@ -91,7 +83,7 @@ const HomePage: React.FC = () => {
9183
};
9284

9385
initTeam();
94-
}, []);
86+
}, [setIsLoadingTeam, showToast, navigate, setReloadLeftList]);
9587

9688
/**
9789
* Handle new task creation from the "New task" button
@@ -112,6 +104,7 @@ const HomePage: React.FC = () => {
112104
// TODO REFRACTOR THIS CODE
113105
setIsLoadingTeam(true);
114106
const initResponse = await TeamService.initializeTeam(true);
107+
setReloadLeftList(true)
115108
if (initResponse.data?.status === 'Request started successfully' && initResponse.data?.team_id) {
116109
console.log('Team initialization completed:', initResponse.data?.team_id);
117110

@@ -152,7 +145,7 @@ const HomePage: React.FC = () => {
152145
"info"
153146
);
154147
}
155-
}, [showToast]);
148+
}, [showToast, setReloadLeftList]);
156149

157150

158151
/**
@@ -187,6 +180,7 @@ const HomePage: React.FC = () => {
187180
<CoralShellColumn>
188181
<CoralShellRow>
189182
<PlanPanelLeft
183+
reloadTasks={reloadLeftList}
190184
onNewTaskButton={handleNewTaskButton}
191185
onTeamSelect={handleTeamSelect}
192186
onTeamUpload={handleTeamUpload}

src/frontend/src/pages/PlanPage.tsx

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ const PlanPage: React.FC = () => {
6565
const processAgentMessage = useCallback((agentMessageData: AgentMessageData, planData: ProcessedPlanData, is_final: boolean = false) => {
6666

6767
// Persist / forward to backend (fire-and-forget with logging)
68-
console.log(planData)
69-
console.log(is_final)
70-
console.log(agentMessageData)
7168
const agentMessageResponse = PlanDataService.createAgentMessageResponse(agentMessageData, planData, is_final);
7269
console.log('📤 Persisting agent message:', agentMessageResponse);
7370
void apiService.sendAgentMessage(agentMessageResponse)
@@ -262,45 +259,6 @@ const PlanPage: React.FC = () => {
262259

263260
return () => unsubscribe();
264261
}, [scrollToBottom, planData, processAgentMessage]); //onPlanReceived, scrollToBottom
265-
// Create loadPlanData function with useCallback to memoize it
266-
const loadPlanData = useCallback(
267-
async (useCache = true): Promise<ProcessedPlanData | null> => {
268-
if (!planId) return null;
269-
270-
setLoading(true);
271-
try {
272-
273-
let planResult: ProcessedPlanData | null = null;
274-
console.log("Fetching plan with ID:", planId);
275-
planResult = await PlanDataService.fetchPlanData(planId, useCache);
276-
console.log("Plan data fetched:", planResult);
277-
if (planResult?.plan?.overall_status === PlanStatus.IN_PROGRESS) {
278-
setShowApprovalButtons(true);
279-
280-
} else {
281-
setShowApprovalButtons(false);
282-
setWaitingForPlan(false);
283-
}
284-
if (planResult?.plan?.overall_status !== PlanStatus.COMPLETED) {
285-
setContinueWithWebsocketFlow(true);
286-
}
287-
if (planResult?.messages) {
288-
setAgentMessages(planResult.messages);
289-
}
290-
if (planResult?.mplan) {
291-
setPlanApprovalRequest(planResult.mplan);
292-
}
293-
setPlanData(planResult);
294-
return planResult;
295-
} catch (err) {
296-
console.log("Failed to load plan data:", err);
297-
return null;
298-
} finally {
299-
setLoading(false);
300-
}
301-
},
302-
[planId, navigate]
303-
);
304262

305263
// Loading message rotation effect
306264
useEffect(() => {
@@ -376,7 +334,47 @@ const PlanPage: React.FC = () => {
376334
webSocketService.disconnect();
377335
};
378336
}
379-
}, [planId, loading, continueWithWebsocketFlow, loadPlanData, planData]);
337+
}, [planId, loading, continueWithWebsocketFlow]);
338+
339+
// Create loadPlanData function with useCallback to memoize it
340+
const loadPlanData = useCallback(
341+
async (useCache = true): Promise<ProcessedPlanData | null> => {
342+
if (!planId) return null;
343+
344+
setLoading(true);
345+
try {
346+
347+
let planResult: ProcessedPlanData | null = null;
348+
console.log("Fetching plan with ID:", planId);
349+
planResult = await PlanDataService.fetchPlanData(planId, useCache);
350+
console.log("Plan data fetched:", planResult);
351+
if (planResult?.plan?.overall_status === PlanStatus.IN_PROGRESS) {
352+
setShowApprovalButtons(true);
353+
354+
} else {
355+
setShowApprovalButtons(false);
356+
setWaitingForPlan(false);
357+
}
358+
if (planResult?.plan?.overall_status !== PlanStatus.COMPLETED) {
359+
setContinueWithWebsocketFlow(true);
360+
}
361+
if (planResult?.messages) {
362+
setAgentMessages(planResult.messages);
363+
}
364+
if (planResult?.mplan) {
365+
setPlanApprovalRequest(planResult.mplan);
366+
}
367+
setPlanData(planResult);
368+
return planResult;
369+
} catch (err) {
370+
console.log("Failed to load plan data:", err);
371+
return null;
372+
} finally {
373+
setLoading(false);
374+
}
375+
},
376+
[planId, navigate]
377+
);
380378

381379

382380
// Handle plan approval

src/mcp_server/datasets/competitor_pricing_analysis.csv

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/mcp_server/datasets/customer_churn_analysis.csv

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/mcp_server/datasets/customer_feedback_surveys.csv

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/mcp_server/datasets/customer_profile.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/mcp_server/datasets/customer_service_interactions.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/mcp_server/datasets/delivery_performance_metrics.csv

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/mcp_server/datasets/email_marketing_engagement.csv

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)