fix: updated the issue create sorting

This commit is contained in:
guru_sainath 2024-06-03 21:53:17 +05:30
parent 4025ddca51
commit a26cf199f7
3 changed files with 8 additions and 10 deletions

View File

@ -60,8 +60,8 @@ export const DeleteEstimateModal: FC<TDeleteEstimateModal> = observer((props) =>
{/* estimate steps */}
<div className="px-5">
<div className="text-base">
Deleting the estimate <span className="font-medium text-custom-primary-100">{estimate?.name}</span>
<div className="text-base text-custom-text-200">
Deleting the estimate <span className="font-bold text-custom-text-100">{estimate?.name}</span>
&nbsp;system will remove it from all issues permanently. This action cannot be undone. If you add estimates
again, you will need to update all the issues.
</div>

View File

@ -7,8 +7,6 @@ import { Button, Sortable } from "@plane/ui";
import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points";
// constants
import { maxEstimatesCount } from "@/constants/estimates";
// hooks
import { useEstimate } from "@/hooks/store";
type TEstimatePointCreateRoot = {
workspaceSlug: string;
@ -22,8 +20,6 @@ type TEstimatePointCreateRoot = {
export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((props) => {
// props
const { workspaceSlug, projectId, estimateId, estimateType, estimatePoints, setEstimatePoints } = props;
// hooks
const { asJson: estimate, updateEstimateSortOrder } = useEstimate(estimateId);
// states
const [estimatePointCreate, setEstimatePointCreate] = useState<TEstimatePointsObject[] | undefined>(undefined);
@ -76,13 +72,14 @@ export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((p
const handleDragEstimatePoints = (updatedEstimatedOrder: TEstimatePointsObject[]) => {
const updatedEstimateKeysOrder = updatedEstimatedOrder.map((item, index) => ({ ...item, key: index + 1 }));
updateEstimateSortOrder(workspaceSlug, projectId, updatedEstimateKeysOrder);
setEstimatePoints(() => updatedEstimateKeysOrder);
};
if (!workspaceSlug || !projectId) return <></>;
return (
<div className="space-y-3">
<div className="text-sm font-medium text-custom-text-200 capitalize">{estimate?.type}</div>
<div className="text-sm font-medium text-custom-text-200 capitalize">{estimateType}</div>
<div>
<Sortable
data={estimatePoints}
@ -105,6 +102,7 @@ export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((p
keyExtractor={(item: TEstimatePointsObject) => item?.id?.toString() || item.value.toString()}
/>
</div>
{estimatePointCreate &&
estimatePointCreate.map((estimatePoint) => (
<EstimatePointCreate
@ -133,7 +131,7 @@ export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((p
})
}
>
Add {estimate?.type}
Add {estimateType}
</Button>
)}
</div>

View File

@ -2,7 +2,7 @@ import { FC, Fragment, useState } from "react";
import { observer } from "mobx-react";
import { Plus } from "lucide-react";
import { TEstimatePointsObject } from "@plane/types";
import { Button, Draggable, Sortable, TOAST_TYPE, setToast } from "@plane/ui";
import { Button, Sortable, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { EstimatePointItemPreview, EstimatePointCreate } from "@/components/estimates/points";
// constants