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"; import useSWR from "swr";
// hook
import useEstimateOption from "hooks/use-estimate-option";
// services // services
import issuesService from "services/issues.service"; import issuesService from "services/issues.service";
// icons // 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: { const activityDetails: {
[key: string]: { [key: string]: {
@ -324,8 +338,7 @@ const activityDetails: {
else else
return ( return (
<> <>
set the estimate point to{" "} set the estimate point to <EstimatePoint point={activity.new_value} />
<span className="font-medium text-custom-text-100">{activity.new_value}</span>
{showIssue && ( {showIssue && (
<> <>
{" "} {" "}

View file

@ -32,7 +32,9 @@ const useEstimateOption = (estimateKey?: number | null) => {
); );
const estimateValue: any = 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 { return {
isEstimateActive: projectDetails?.estimate ? true : false, isEstimateActive: projectDetails?.estimate ? true : false,