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

Admin tweaks - Delete stream badges and change logic for build submission rejections #125

Merged
merged 3 commits into from
Jun 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion packages/nextjs/app/admin/_components/ActionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ActionModal = forwardRef<HTMLDialogElement, ActionModalProps>(({ gr
</div>
{action !== PROPOSAL_STATUS.REJECTED && (
<div className="w-full flex-col space-y-1">
<p className="m-0 font-semibold text-base">Transction Hash</p>
<p className="m-0 font-semibold text-base">Transaction Hash</p>
<input
type="text"
ref={transactionInputRef}
Expand Down
6 changes: 0 additions & 6 deletions packages/nextjs/app/admin/_components/GrantReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@ export const GrantReview = ({ grant, selected, toggleSelection }: GrantReviewPro
</a>
);
})}
{grant.builderData?.stream?.cap && (
<div className="badge badge-primary">
<span className="font-bold">Stream:&nbsp;</span>
{grant.builderData.stream.cap} ETH
</div>
)}
</div>
</div>
<div className="p-4">
Expand Down
7 changes: 7 additions & 0 deletions packages/nextjs/services/database/grants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export const reviewGrant = async ({ grantId, action, txHash, txChainId, note }:
// Prepare the data to update based on the action
const updateData: Partial<GrantData> = { status: action };

// Reject build submission moving back to APPROVED status
const grantSnapshot = await getGrantSnapshotById(grantId);
const currentStatus = grantSnapshot.data()?.status;
if (currentStatus === PROPOSAL_STATUS.SUBMITTED && action === PROPOSAL_STATUS.REJECTED) {
updateData.status = PROPOSAL_STATUS.APPROVED;
}

if (note !== undefined) {
updateData.note = note;
}
Expand Down
Loading