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",
|
SWITCH = "switch",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const minEstimatesCount = 2;
|
export const estimateCount = {
|
||||||
export const maxEstimatesCount = 6;
|
min: 2,
|
||||||
|
max: 6,
|
||||||
|
};
|
||||||
|
|
||||||
export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
||||||
points: {
|
points: {
|
||||||
|
@ -8,7 +8,7 @@ import { Button, Sortable } from "@plane/ui";
|
|||||||
// components
|
// components
|
||||||
import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points";
|
import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points";
|
||||||
// plane web constants
|
// plane web constants
|
||||||
import { maxEstimatesCount } from "@/plane-web/constants/estimates";
|
import { estimateCount } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TEstimatePointCreateRoot = {
|
type TEstimatePointCreateRoot = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
@ -89,7 +89,7 @@ export const EstimatePointCreateRoot: FC<TEstimatePointCreateRoot> = observer((p
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCreate = () => {
|
const handleCreate = () => {
|
||||||
if (estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= maxEstimatesCount - 1) {
|
if (estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= estimateCount.max - 1) {
|
||||||
handleEstimatePointCreate("add", {
|
handleEstimatePointCreate("add", {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
key: estimatePoints.length + (estimatePointCreate?.length || 0) + 1,
|
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}
|
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}>
|
<Button variant="link-primary" size="sm" prependIcon={<Plus />} onClick={handleCreate}>
|
||||||
Add {estimateType}
|
Add {estimateType}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -5,7 +5,7 @@ import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
|||||||
// components
|
// components
|
||||||
import { EstimatePointUpdate, EstimatePointDelete } from "@/components/estimates/points";
|
import { EstimatePointUpdate, EstimatePointDelete } from "@/components/estimates/points";
|
||||||
// plane web constants
|
// plane web constants
|
||||||
import { minEstimatesCount } from "@/plane-web/constants/estimates";
|
import { estimateCount } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TEstimatePointItemPreview = {
|
type TEstimatePointItemPreview = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
@ -62,7 +62,7 @@ export const EstimatePointItemPreview: FC<TEstimatePointItemPreview> = observer(
|
|||||||
>
|
>
|
||||||
<Pencil size={14} className="text-custom-text-200" />
|
<Pencil size={14} className="text-custom-text-200" />
|
||||||
</div>
|
</div>
|
||||||
{estimatePoints.length > minEstimatesCount && (
|
{estimatePoints.length > estimateCount.min && (
|
||||||
<div
|
<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"
|
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={() =>
|
onClick={() =>
|
||||||
|
@ -13,8 +13,8 @@ export enum EEstimateUpdateStages {
|
|||||||
SWITCH = "switch",
|
SWITCH = "switch",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const minEstimatesCount = 2;
|
export const estimateCount.min = 2;
|
||||||
export const maxEstimatesCount = 6;
|
export const estimateCount.max = 6;
|
||||||
|
|
||||||
export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
||||||
points: {
|
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