From e1352737d6b98025f4aa6d9de7d4cad7da7ec130 Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 4 Sep 2026 23:32:41 +0700 Subject: [PATCH 1/2] feat: show completed assignment requests --- .../components/AssignmentRequestTable.tsx | 6 ++++-- src/containers/AdminAssignmentRequest/index.jsx | 10 +++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/containers/AdminAssignmentRequest/components/AssignmentRequestTable.tsx b/src/containers/AdminAssignmentRequest/components/AssignmentRequestTable.tsx index c05adf591..4ea3cbe7a 100644 --- a/src/containers/AdminAssignmentRequest/components/AssignmentRequestTable.tsx +++ b/src/containers/AdminAssignmentRequest/components/AssignmentRequestTable.tsx @@ -41,9 +41,9 @@ const rowStyleForStatus = (rowStatus: string) => { if (rowStatus === RowWorkStatus.Error) { overrideStyle = { backgroundColor: theme.colors.lightGray }; } else if (rowStatus === RowWorkStatus.Approved) { - overrideStyle = { opacity: 0, backgroundColor: theme.colors.green }; + overrideStyle = { backgroundColor: theme.colors.lightGreen }; } else if (rowStatus === RowWorkStatus.Denied) { - overrideStyle = { opacity: 0, backgroundColor: theme.colors.lightRed }; + overrideStyle = { backgroundColor: red[50] }; } return { ...baseStyle, ...overrideStyle }; }; @@ -141,6 +141,8 @@ const AssignmentRequestTable: React.FC = ( {status === RowWorkStatus.Working && ( )} + {status === RowWorkStatus.Approved && "Approved"} + {status === RowWorkStatus.Denied && "Rejected"} diff --git a/src/containers/AdminAssignmentRequest/index.jsx b/src/containers/AdminAssignmentRequest/index.jsx index b4b878dcd..b4f070729 100644 --- a/src/containers/AdminAssignmentRequest/index.jsx +++ b/src/containers/AdminAssignmentRequest/index.jsx @@ -191,10 +191,7 @@ AdminAssignmentRequest.propTypes = { const queries = { pendingAssignmentRequests: { query: gql` - query assignmentRequestsWithUser( - $organizationId: String! - $status: String - ) { + query assignmentRequestsWithUser($organizationId: String!) { currentUser { id roles(organizationId: $organizationId) @@ -207,7 +204,7 @@ const queries = { } } } - assignmentRequests(organizationId: $organizationId, status: $status) { + assignmentRequests(organizationId: $organizationId) { id createdAt amount @@ -222,8 +219,7 @@ const queries = { `, options: (ownProps) => ({ variables: { - organizationId: ownProps.match.params.organizationId, - status: "pending" + organizationId: ownProps.match.params.organizationId }, fetchPolicy: "network-only", pollInterval: 10000 From 0b902e3e80537c2d23851a88b7f4f88f61a98c18 Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 4 Sep 2026 23:39:17 +0700 Subject: [PATCH 2/2] fix: keep resolved assignment requests visible --- src/containers/AdminAssignmentRequest/index.jsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/containers/AdminAssignmentRequest/index.jsx b/src/containers/AdminAssignmentRequest/index.jsx index b4f070729..c6cd5faac 100644 --- a/src/containers/AdminAssignmentRequest/index.jsx +++ b/src/containers/AdminAssignmentRequest/index.jsx @@ -13,7 +13,6 @@ import React, { Component } from "react"; import { RequestAutoApproveType } from "../../api/organization-membership"; import { hasRole } from "../../lib/permissions"; -import { sleep } from "../../lib/utils"; import { loadData } from "../hoc/with-operations"; import AssignmentRequestTable, { RowWorkStatus @@ -63,14 +62,6 @@ class AdminAssignmentRequest extends Component { this.setState({ assignmentRequests }); }; - deleteRequest = (requestId) => { - let { assignmentRequests } = this.state; - assignmentRequests = assignmentRequests.filter( - (request) => request.id !== requestId - ); - this.setState({ assignmentRequests }); - }; - handleDismissAutoApproveRequest = () => this.setState({ autoApproveReqId: undefined }); @@ -109,8 +100,6 @@ class AdminAssignmentRequest extends Component { ? RowWorkStatus.Approved : RowWorkStatus.Denied; this.setRequestStatus(requestId, newStatus); - await sleep(2000); - this.deleteRequest(requestId); } catch (exc) { this.setRequestStatus(requestId, RowWorkStatus.Error); }