Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(manager): avoid reviewing applications #160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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 @@ -33,7 +33,11 @@ import { errorModalDelayMs } from "../../constants";
import ErrorModal from "../common/ErrorModal";
import { getRoundStrategyType, useAllo } from "common";

export default function ApplicationsApproved() {
export default function ApplicationsApproved({
isAvoidReview = false,
}: {
isAvoidReview?: boolean;
}) {
const { id } = useParams();
const allo = useAllo();

Expand Down Expand Up @@ -177,19 +181,21 @@ export default function ApplicationsApproved() {

return (
<>
{approvedApplications && approvedApplications.length > 0 && (
<div className="flex items-center justify-end mb-4">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by approving/rejecting multiple applications at
once.
</span>
{bulkSelectApproved ? (
<Cancel onClick={() => setBulkSelectApproved(false)} />
) : (
<Select onClick={() => setBulkSelectApproved(true)} />
)}
</div>
)}
{!isAvoidReview &&
approvedApplications &&
approvedApplications.length > 0 && (
<div className="flex items-center justify-end mb-4">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by approving/rejecting multiple applications at
once.
</span>
{bulkSelectApproved ? (
<Cancel onClick={() => setBulkSelectApproved(false)} />
) : (
<Select onClick={() => setBulkSelectApproved(true)} />
)}
</div>
)}
<CardsContainer>
{!isLoading &&
approvedApplications?.map((application, index) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ import ErrorModal from "../common/ErrorModal";
import { errorModalDelayMs } from "../../constants";
import { getRoundStrategyType, useAllo } from "common";

export default function ApplicationsRejected() {
export default function ApplicationsRejected({
isAvoidReview = false,
}: {
isAvoidReview?: boolean;
}) {
const { id } = useParams();
const allo = useAllo();

Expand Down Expand Up @@ -175,19 +179,21 @@ export default function ApplicationsRejected() {

return (
<>
{rejectedApplications && rejectedApplications.length > 0 && (
<div className="flex items-center justify-end mb-4">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by approving/rejecting multiple applications at
once.
</span>
{bulkSelectRejected ? (
<Cancel onClick={() => setBulkSelectRejected(false)} />
) : (
<Select onClick={() => setBulkSelectRejected(true)} />
)}
</div>
)}
{!isAvoidReview &&
rejectedApplications &&
rejectedApplications.length > 0 && (
<div className="flex items-center justify-end mb-4">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by approving/rejecting multiple applications at
once.
</span>
{bulkSelectRejected ? (
<Cancel onClick={() => setBulkSelectRejected(false)} />
) : (
<Select onClick={() => setBulkSelectRejected(true)} />
)}
</div>
)}
<CardsContainer>
{!isLoading &&
rejectedApplications?.map((application, index) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ export async function exportAndDownloadCSV(
type Props = {
isDirectRound?: boolean;
round: Round;
isAvoidReview?: boolean;
};

// Approve or reject applications received in bulk, both in QF & direct grants

export default function ApplicationsToApproveReject({
round,
isDirectRound = false
isDirectRound = false,
isAvoidReview = false,
}: Props) {
const { id } = useParams();
const { chain } = useWallet();
Expand Down Expand Up @@ -282,19 +284,24 @@ export default function ApplicationsToApproveReject({
)}
</Button>
)}
{filteredApplications && filteredApplications.length > 0 && (
<div className="flex items-center justify-end ml-auto">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by approving/rejecting multiple applications at
once.
</span>
{bulkSelect ? (
<Cancel onClick={() => setBulkSelect(false)} />
) : (
<Select hidden={!canReviewApplication} onClick={() => setBulkSelect(true)} />
)}
</div>
)}
{!isAvoidReview &&
filteredApplications &&
filteredApplications.length > 0 && (
<div className="flex items-center justify-end ml-auto">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by approving/rejecting multiple applications at
once.
</span>
{bulkSelect ? (
<Cancel onClick={() => setBulkSelect(false)} />
) : (
<Select
hidden={!canReviewApplication}
onClick={() => setBulkSelect(true)}
/>
)}
</div>
)}
</div>
<CardsContainer>
{!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ import { exportAndDownloadCSV } from "./ApplicationsToApproveReject";

// Move applications received in direct grants to In Review

export default function ApplicationsToReview() {
export default function ApplicationsToReview({
isAvoidReview = false,
}: {
isAvoidReview?: boolean;
}) {
const { id } = useParams();
const { chain } = useWallet();

Expand Down Expand Up @@ -234,19 +238,21 @@ export default function ApplicationsToReview() {
)}
</Button>
)}
{filteredApplications && filteredApplications.length > 0 && (
<div className="flex items-center justify-end ml-auto">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by moving multiple applications to "In Review"
state at once.
</span>
{bulkSelect ? (
<Cancel onClick={() => setBulkSelect(false)} />
) : (
<Select onClick={() => setBulkSelect(true)} />
)}
</div>
)}
{!isAvoidReview &&
filteredApplications &&
filteredApplications.length > 0 && (
<div className="flex items-center justify-end ml-auto">
<span className="text-grey-400 text-sm mr-6">
Save in gas fees by moving multiple applications to "In Review"
state at once.
</span>
{bulkSelect ? (
<Cancel onClick={() => setBulkSelect(false)} />
) : (
<Select onClick={() => setBulkSelect(true)} />
)}
</div>
)}
</div>
<CardsContainer>
{!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function getApplicationStatusTitle(status: ProjectStatus) {
}
}

// Avoiding review for ZUZALU rounds
const isAvoidReview = true;

export default function ViewApplicationPage() {
datadogLogs.logger.info("====> Route: /round/:roundId/application/:id");
datadogLogs.logger.info(`====> URL: ${window.location.href}`);
Expand Down Expand Up @@ -371,10 +374,10 @@ export default function ViewApplicationPage() {
status === "done" || status === "approved"
? "bg-teal-500 border-teal-500"
: status === "current"
? "border-violet-500"
: status === "rejected"
? "bg-red-500 border-red-500"
: ""
? "border-violet-500"
: status === "rejected"
? "bg-red-500 border-red-500"
: ""
}
`}
>
Expand Down Expand Up @@ -409,8 +412,8 @@ export default function ViewApplicationPage() {
status === "done"
? "bg-teal-500"
: status === "rejected"
? "bg-red-500"
: "bg-grey-200"
? "bg-red-500"
: "bg-grey-200"
}`}
style={{
transform: "rotate(180deg)",
Expand Down Expand Up @@ -463,17 +466,19 @@ export default function ViewApplicationPage() {
? getRoundStrategyType(application.payoutStrategy.strategyName)
: undefined;

const showReviewButton = (): boolean => {
return moment().isBetween(
round?.applicationsStartTime,
round?.applicationsEndTime
) &&
strategyType === "DirectGrants" &&
application?.status === "PENDING" &&
application?.inReview === false;
}
const showReviewButton = (): boolean =>
isAvoidReview
? false
: moment().isBetween(
round?.applicationsStartTime,
round?.applicationsEndTime
) &&
strategyType === "DirectGrants" &&
application?.status === "PENDING" &&
application?.inReview === false;

const showApproveReject = () => {
if (isAvoidReview) return false;
const canReviewApplication = moment().isBetween(
round?.applicationsStartTime,
round?.applicationsEndTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,12 @@ function GrantApplications(props: {
<Tab.Panels>
<Tab.Panel>
{props.isDirectRound ? (
<ApplicationsToReview />
<ApplicationsToReview isAvoidReview={true} />
) : (
<ApplicationsToApproveReject
round={props.round!}
isDirectRound={Boolean(props.isDirectRound)}
isAvoidReview={true}
/>
)}
</Tab.Panel>
Expand All @@ -527,14 +528,15 @@ function GrantApplications(props: {
<ApplicationsToApproveReject
round={props.round!}
isDirectRound={Boolean(props.isDirectRound)}
isAvoidReview={true}
/>
</Tab.Panel>
)}
<Tab.Panel>
<ApplicationsApproved />
<ApplicationsApproved isAvoidReview={true} />
</Tab.Panel>
<Tab.Panel>
<ApplicationsRejected />
<ApplicationsRejected isAvoidReview={true} />
</Tab.Panel>
</Tab.Panels>
</Tab.Group>
Expand Down