fix: issue activity estimate value bug fix (#2281)
* fix: issue activity estimate value bug fix * fix: activity typo fix
This commit is contained in:
parent
34af666b5f
commit
60a69e28e3
2 changed files with 18 additions and 3 deletions
|
|
@ -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 && (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue