mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
dev: update estimate constants
This commit is contained in:
parent
edbc707199
commit
362731ad2a
@ -13,8 +13,10 @@ export enum EEstimateUpdateStages {
|
||||
SWITCH = "switch",
|
||||
}
|
||||
|
||||
export const minEstimatesCount = 2;
|
||||
export const maxEstimatesCount = 6;
|
||||
export const estimateCount = {
|
||||
min: 2,
|
||||
max: 6,
|
||||
};
|
||||
|
||||
export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
||||
points: {
|
||||
|
@ -8,7 +8,7 @@ import { Button, Sortable } from "@plane/ui";
|
||||
// components
|
||||
import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points";
|
||||
// plane web constants
|
||||
import { maxEstimatesCount } from "@/plane-web/constants/estimates";
|
||||
import { estimateCount } from "@/plane-web/constants/estimates";
|
||||
|
||||
type TEstimatePointCreateRoot = {
|
||||
workspaceSlug: string;
|
||||
@ -89,7 +89,7 @@ export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((p
|
||||
};
|
||||
|
||||
const handleCreate = () => {
|
||||
if (estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= maxEstimatesCount - 1) {
|
||||
if (estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= estimateCount.max - 1) {
|
||||
handleEstimatePointCreate("add", {
|
||||
id: undefined,
|
||||
key: estimatePoints.length + (estimatePointCreate?.length || 0) + 1,
|
||||
@ -143,7 +143,7 @@ export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((p
|
||||
isError={estimatePointCreateError.includes(estimatePoint.key) ? true : false}
|
||||
/>
|
||||
))}
|
||||
{estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= maxEstimatesCount - 1 && (
|
||||
{estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= estimateCount.max - 1 && (
|
||||
<Button variant="link-primary" size="sm" prependIcon={<Plus />} onClick={handleCreate}>
|
||||
Add {estimateType}
|
||||
</Button>
|
||||
|
@ -5,7 +5,7 @@ import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||
// components
|
||||
import { EstimatePointUpdate, EstimatePointDelete } from "@/components/estimates/points";
|
||||
// plane web constants
|
||||
import { minEstimatesCount } from "@/plane-web/constants/estimates";
|
||||
import { estimateCount } from "@/plane-web/constants/estimates";
|
||||
|
||||
type TEstimatePointItemPreview = {
|
||||
workspaceSlug: string;
|
||||
@ -62,7 +62,7 @@ export const EstimatePointItemPreview: FC<TEstimatePointItemPreview> = observer(
|
||||
>
|
||||
<Pencil size={14} className="text-custom-text-200" />
|
||||
</div>
|
||||
{estimatePoints.length > minEstimatesCount && (
|
||||
{estimatePoints.length > estimateCount.min && (
|
||||
<div
|
||||
className="rounded-sm w-6 h-6 flex-shrink-0 relative flex justify-center items-center hover:bg-custom-background-80 transition-colors cursor-pointer"
|
||||
onClick={() =>
|
||||
|
@ -13,8 +13,8 @@ export enum EEstimateUpdateStages {
|
||||
SWITCH = "switch",
|
||||
}
|
||||
|
||||
export const minEstimatesCount = 2;
|
||||
export const maxEstimatesCount = 6;
|
||||
export const estimateCount.min = 2;
|
||||
export const estimateCount.max = 6;
|
||||
|
||||
export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
||||
points: {
|
||||
|
3
web/ee/constants/estimates.ts
Normal file
3
web/ee/constants/estimates.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as ceConstants from "@/plane-web/constants/estimates";
|
||||
|
||||
export { ceConstants };
|
Loading…
Reference in New Issue
Block a user