Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};
Expand Down Expand Up @@ -141,6 +141,8 @@ const AssignmentRequestTable: React.FC<AssignmentRequestTableProps> = (
{status === RowWorkStatus.Working && (
<CircularProgress size={25} />
)}
{status === RowWorkStatus.Approved && "Approved"}
{status === RowWorkStatus.Denied && "Rejected"}
</div>
</TableCell>
</TableRow>
Expand Down
21 changes: 3 additions & 18 deletions src/containers/AdminAssignmentRequest/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 });

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -191,10 +180,7 @@ AdminAssignmentRequest.propTypes = {
const queries = {
pendingAssignmentRequests: {
query: gql`
query assignmentRequestsWithUser(
$organizationId: String!
$status: String
) {
query assignmentRequestsWithUser($organizationId: String!) {
currentUser {
id
roles(organizationId: $organizationId)
Expand All @@ -207,7 +193,7 @@ const queries = {
}
}
}
assignmentRequests(organizationId: $organizationId, status: $status) {
assignmentRequests(organizationId: $organizationId) {
id
createdAt
amount
Expand All @@ -222,8 +208,7 @@ const queries = {
`,
options: (ownProps) => ({
variables: {
organizationId: ownProps.match.params.organizationId,
status: "pending"
organizationId: ownProps.match.params.organizationId
},
fetchPolicy: "network-only",
pollInterval: 10000
Expand Down
Loading