Changeset 4f2900a for pages/dashboard/admin/+Page.tsx
- Timestamp:
- 02/20/26 00:11:25 (5 months ago)
- Branches:
- main
- Children:
- 9d40151
- Parents:
- d07d68c
- File:
-
- 1 edited
-
pages/dashboard/admin/+Page.tsx (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pages/dashboard/admin/+Page.tsx
rd07d68c r4f2900a 41 41 buildName: string 42 42 }>({open: false, buildId: null, buildName: ''}); 43 const [rejectReason, setRejectReason] = useState('');44 43 const [approvalLoading, setApprovalLoading] = useState(false); 45 44 … … 76 75 const openBuildApproval = (buildId: number, buildName: string) => { 77 76 setBuildApprovalDialog({open: true, buildId, buildName}); 78 setRejectReason('');79 77 }; 80 78 … … 93 91 }; 94 92 95 const handleRejectBuild = async () => {96 if (!buildApprovalDialog.buildId || !rejectReason.trim()) return;97 setApprovalLoading(true);98 try {99 await onSetBuildApprovalStatus({100 buildId: buildApprovalDialog.buildId,101 isApproved: false,102 });103 setBuildApprovalDialog({open: false, buildId: null, buildName: ''});104 loadData();105 } catch (e) {106 console.error("Reject error:", e); // 🔧 add this107 alert("Reject failed");108 } finally {109 setApprovalLoading(false);110 }111 };93 // const handleRejectBuild = async () => { 94 // if (!buildApprovalDialog.buildId || !rejectReason.trim()) return; 95 // setApprovalLoading(true); 96 // try { 97 // await onSetBuildApprovalStatus({ 98 // buildId: buildApprovalDialog.buildId, 99 // isApproved: false, 100 // }); 101 // setBuildApprovalDialog({open: false, buildId: null, buildName: ''}); 102 // loadData(); 103 // } catch (e) { 104 // console.error("Reject error:", e); // 🔧 add this 105 // alert("Reject failed"); 106 // } finally { 107 // setApprovalLoading(false); 108 // } 109 // }; 112 110 113 111 const openSuggestionReview = (id: number, action: 'approved' | 'rejected') => { … … 456 454 Build ID: {buildApprovalDialog.buildId} 457 455 </Typography> 458 <TextField459 fullWidth460 multiline461 rows={2}462 label="Reject reason (optional)"463 value={rejectReason}464 onChange={(e) => setRejectReason(e.target.value)}465 placeholder="Why reject this build?"466 sx={{mt: 1}}467 />456 {/*<TextField*/} 457 {/* fullWidth*/} 458 {/* multiline*/} 459 {/* rows={2}*/} 460 {/* label="Reject reason (optional)"*/} 461 {/* value={rejectReason}*/} 462 {/* onChange={(e) => setRejectReason(e.target.value)}*/} 463 {/* placeholder="Why reject this build?"*/} 464 {/* sx={{mt: 1}}*/} 465 {/*/>*/} 468 466 </DialogContent> 469 467 <DialogActions> … … 474 472 Cancel 475 473 </Button> 476 <Button477 onClick={handleRejectBuild}478 variant="outlined"479 color="error"480 disabled={approvalLoading || !rejectReason.trim()}481 >482 {approvalLoading ? <CircularProgress size={20}/> : 'Reject'}483 </Button>474 {/*<Button*/} 475 {/* onClick={handleRejectBuild}*/} 476 {/* variant="outlined"*/} 477 {/* color="error"*/} 478 {/* disabled={approvalLoading || !rejectReason.trim()}*/} 479 {/*>*/} 480 {/* {approvalLoading ? <CircularProgress size={20}/> : 'Reject'}*/} 481 {/*</Button>*/} 484 482 <Button 485 483 onClick={handleApproveBuild}
Note:
See TracChangeset
for help on using the changeset viewer.
