fix: issue activity estimate value bug fix (#2281)

* fix: issue activity estimate value bug fix

* fix: activity typo fix
This commit is contained in:
Anmol Singh Bhatia 2023-09-28 13:18:35 +05:30 committed by GitHub
parent 34af666b5f
commit 60a69e28e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -2,6 +2,8 @@ import { useRouter } from "next/router";
import useSWR from "swr";
// hook
import useEstimateOption from "hooks/use-estimate-option";
// services
import issuesService from "services/issues.service";
// icons
@ -77,6 +79,18 @@ const LabelPill = ({ labelId }: { labelId: string }) => {
/>
);
};
const EstimatePoint = ({ point }: { point: string }) => {
const { estimateValue, isEstimateActive } = useEstimateOption(Number(point));
const currentPoint = Number(point) + 1;
return (
<span className="font-medium text-custom-text-100">
{isEstimateActive
? estimateValue
: `${currentPoint} ${currentPoint > 1 ? "points" : "point"}`}
</span>
);
};
const activityDetails: {
[key: string]: {
@ -324,8 +338,7 @@ const activityDetails: {
else
return (
<>
set the estimate point to{" "}
<span className="font-medium text-custom-text-100">{activity.new_value}</span>
set the estimate point to <EstimatePoint point={activity.new_value} />
{showIssue && (
<>
{" "}

View File

@ -32,7 +32,9 @@ const useEstimateOption = (estimateKey?: number | null) => {
);
const estimateValue: any =
(estimateKey && estimateDetails?.points?.find((e) => e.key === estimateKey)?.value) ?? "None";
estimateKey || estimateKey === 0
? estimateDetails?.points?.find((e) => e.key === estimateKey)?.value
: "None";
return {
isEstimateActive: projectDetails?.estimate ? true : false,