دریافت اطلاعات از سرور ناموفق بود: {error}. داده جایگزین نمایش داده نمیشود. بازخوانی وظیفهها
void loadTasks()}/>}
@@ -67,7 +84,7 @@ export default function OrchestrationCommandCenter() {
منتظر تصمیم شما تصمیم Gate1 برای کار محدود؛ تأیید بهمعنای انتشار یا اجرای Production نیست. دکمهها فقط اقدامهای مجاز اعلامشده توسط سرور هستند؛ برای بررسی و تصمیم، جزئیات را باز کنید.
فیلتر تصمیمهاsetDecisionFilter(e.target.value)} className="border rounded p-2 m-2">در انتظار و بهتعویقافتاده در انتظار تصمیم بهتعویقافتاده
{!loading&&!error&&!tasks.some(t=>['GATE1_PENDING','GATE1_HELD'].includes(t.state)&&(decisionFilter==='ALL'||t.state===decisionFilter))&&تصمیمی در این فیلتر منتظر نیست.
}
- {!loading&&!error&&tasks.filter(t=>['GATE1_PENDING','GATE1_HELD'].includes(t.state)&&(decisionFilter==='ALL'||t.state===decisionFilter)).map(t=>void select(t)}>{t.title} {label(t.department)} · {label(t.state)} · سقف بودجه: {t.budgetLimitCents??'نامشخص'} سنت
رزرو آزمایشی؛ هزینه واقعی نامشخص
{t.availableActions.filter(a=>['APPROVE_GATE1','REJECT_GATE1','HOLD_GATE1'].includes(a.id)).map(a=>void select(t)}>{actionLabel(a)} )}
{selected?.id!==t.id&&<>محدوده: {typeof t.metadata?.scope==='string'?t.metadata.scope:'گزارش نشده؛ جزئیات را بررسی کنید'}
معیارهای پذیرش {Array.isArray(t.metadata?.acceptanceCriteria)&&t.metadata.acceptanceCriteria.every(c=>typeof c==='string')?{(t.metadata.acceptanceCriteria as string[]).map((c,i)=>{c} )} :گزارش نشده؛ جزئیات را بررسی کنید
}>} )}
+ {!loading&&!error&&tasks.filter(t=>['GATE1_PENDING','GATE1_HELD'].includes(t.state)&&(decisionFilter==='ALL'||t.state===decisionFilter)).map(t=>void select(t)}>{t.title} {label(t.department)} · {label(t.state)} · سقف بودجه: {t.budgetLimitCents??'نامشخص'} سنت
رزرو آزمایشی؛ هزینه واقعی نامشخص
{t.availableActions.filter(a=>['APPROVE_GATE1','REJECT_GATE1','HOLD_GATE1'].includes(a.id)).map(a=>void decide(t,a)}>{actionLabel(a)} )}
{selected?.id!==t.id&&<>محدوده: {typeof t.metadata?.scope==='string'?t.metadata.scope:'گزارش نشده؛ جزئیات را بررسی کنید'}
معیارهای پذیرش {Array.isArray(t.metadata?.acceptanceCriteria)&&t.metadata.acceptanceCriteria.every(c=>typeof c==='string')?{(t.metadata.acceptanceCriteria as string[]).map((c,i)=>{c} )} :گزارش نشده؛ جزئیات را بررسی کنید
}>} )}
}
{section==='نمای کلی'&&!loading&&!error&&فهرست وظیفههای ثبتشده {tasks.length} وظیفه از سرور دریافت شد. این فهرست نشاندهنده سلامت عامل یا وضعیت زنده اجرا نیست.
{[...new Set(tasks.map(t=>t.state))].map(state=>{label(state)}: {tasks.filter(t=>t.state===state).length} )}
}
{(['نمای کلی','وظیفهها و تأییدها','اجراها و خروجیها'] as Section[]).includes(section)&&جستوجوی وظیفهها setSearch(e.target.value)}/>
diff --git a/frontend/admin-panel/src/pages/OwnerDecisions.test.tsx b/frontend/admin-panel/src/pages/OwnerDecisions.test.tsx
index 8f6e1b47..d76de5f6 100644
--- a/frontend/admin-panel/src/pages/OwnerDecisions.test.tsx
+++ b/frontend/admin-panel/src/pages/OwnerDecisions.test.tsx
@@ -17,14 +17,16 @@ it('opens with obvious pending and held owner queue, scope, criteria and budget;
fireEvent.change(within(queue).getByLabelText('فیلتر تصمیمها'),{target:{value:'GATE1_HELD'}});
expect(within(queue).queryByRole('button',{name:proposal.title})).not.toBeInTheDocument();
fireEvent.click(within(queue).getByRole('button',{name:'کار نگهداشته'}));
- expect(await screen.findByRole('button',{name:'تعویق تصمیم Gate1'})).toBeInTheDocument();
+ const detail=await screen.findByRole('region',{name:'جزئیات وظیفه'});
+ expect(within(detail).getByRole('button',{name:'تعویق تصمیم Gate1'})).toBeInTheDocument();
expect(api.put).not.toHaveBeenCalled();expect(api.post).not.toHaveBeenCalled();
});
it('holds through authenticated server transition and reloads instead of fabricating a local decision',async()=>{
vi.mocked(api.put).mockResolvedValue({data:{}});
render( );
fireEvent.click(await screen.findByRole('button',{name:proposal.title}));
- fireEvent.click(await screen.findByRole('button',{name:'تعویق تصمیم Gate1'}));
+ const detail=await screen.findByRole('region',{name:'جزئیات وظیفه'});
+ fireEvent.click(within(detail).getByRole('button',{name:'تعویق تصمیم Gate1'}));
const dialog=screen.getByRole('dialog');
expect(within(dialog).queryByLabelText('زمان انقضا')).not.toBeInTheDocument();
fireEvent.change(within(dialog).getByLabelText('دلیل'),{target:{value:'بررسی بودجه'}});