Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fonstack committed Dec 10, 2024
1 parent c36ea59 commit c93f3bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ export const SplitPayoutBeneficiaryForm = ({
];
};

const selectedSubmission = isPayoutCreated
? beneficiaries[index]?.decryptedSubmission ?? beneficiarySubmission!
: beneficiarySubmission!;

return (
<div>
<div className="mb-1">{index + 1}.</div>
Expand All @@ -179,19 +183,8 @@ export const SplitPayoutBeneficiaryForm = ({
isPayoutCreated ? beneficiaries[index]?.decryptedSubmission ?? beneficiarySubmission! : beneficiarySubmission!
}
ghIssue={
getGhIssueFromSubmission(
isPayoutCreated
? beneficiaries[index]?.decryptedSubmission ?? beneficiarySubmission!
: beneficiarySubmission!,
vaultGithubIssues
) ||
getGhPRFromSubmission(
isPayoutCreated
? beneficiaries[index]?.decryptedSubmission ?? beneficiarySubmission!
: beneficiarySubmission!,
vaultGithubPRs,
vaultGithubIssues
)
getGhIssueFromSubmission(selectedSubmission, vaultGithubIssues) ||
getGhPRFromSubmission(selectedSubmission, vaultGithubPRs, vaultGithubIssues)
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ export const autocalculateMultiPayoutPointingSystem = (
if (!constraints || !constraints.length) return undefined;
if (!beneficiaries || beneficiaries.length === 0) return undefined;

console.log({ beneficiaries, constraints, totalAmountToPay, maxCapPerPoint });

const beneficiariesCalculated = [] as IBeneficiaryWithCalcs[];

const needPoints = beneficiaries.every((ben) => ben.percentageOfPayout === "" || ben.percentageOfPayout === undefined);
Expand All @@ -114,8 +112,8 @@ export const autocalculateMultiPayoutPointingSystem = (

let totalMultiplier = 0;

if (beneficiary.ghIssue?.labels.includes("complete-fix")) totalMultiplier += BONUS_POINTS_CONSTRAINTS.fix;
if (beneficiary.ghIssue?.labels.includes("complete-test")) totalMultiplier += BONUS_POINTS_CONSTRAINTS.test;
if (beneficiary.ghIssue?.labels?.includes("complete-fix")) totalMultiplier += BONUS_POINTS_CONSTRAINTS.fix;
if (beneficiary.ghIssue?.labels?.includes("complete-test")) totalMultiplier += BONUS_POINTS_CONSTRAINTS.test;

const complementaryPoints = totalMultiplier * +mainIssuePoints;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export const SubmissionCard = ({
const commChannel = submissionData?.communicationChannel;
const severityColors = getSeveritiesColorsArray(vault);

const isComplementary = !!(ghIssue as GithubPR)?.linkedIssueNumber;
const isGithubPR = (issue: GithubIssue | GithubPR): issue is GithubPR => {
return "linkedIssueNumber" in issue;
};

const isComplementary = ghIssue ? isGithubPR(ghIssue) && !!ghIssue.linkedIssueNumber : false;

const createdAt = new Date(+submission?.createdAt * 1000);

Expand Down Expand Up @@ -85,7 +89,6 @@ export const SubmissionCard = ({
const getText = () => {
const labels = (ghIssue as GithubPR).labels;
if (labels.includes("complete-fix") && labels.includes("complete-test")) {
console.log(ghIssue);
return `COMPLETE (fix & test) -> ${(ghIssue as GithubPR).linkedIssue?.severity}`;
} else if (labels.includes("complete-fix")) {
return `COMPLETE (fix) -> ${(ghIssue as GithubPR).linkedIssue?.severity}`;
Expand Down

0 comments on commit c93f3bd

Please sign in to comment.