[WEB-522] chore:Estimate structure (#4801)
* dv: seperating constants for ce and ee * dev: update estimate constants * dev: updated estimate structure for ce and ee
This commit is contained in:
parent
ee4ad580fc
commit
52617baf0e
30 changed files with 78 additions and 145 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Pen, Trash } from "lucide-react";
|
import { Crown, Pen, Trash } from "lucide-react";
|
||||||
|
import { Tooltip } from "@plane/ui";
|
||||||
|
|
||||||
type TEstimateListItem = {
|
type TEstimateListItem = {
|
||||||
estimateId: string;
|
estimateId: string;
|
||||||
|
|
@ -12,17 +13,24 @@ type TEstimateListItem = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EstimateListItemButtons: FC<TEstimateListItem> = observer((props) => {
|
export const EstimateListItemButtons: FC<TEstimateListItem> = observer((props) => {
|
||||||
const { estimateId, isAdmin, isEditable, onEditClick, onDeleteClick } = props;
|
const { estimateId, isAdmin, isEditable, onDeleteClick } = props;
|
||||||
if (!isAdmin || !isEditable) return <></>;
|
|
||||||
|
|
||||||
|
if (!isAdmin || !isEditable) return <></>;
|
||||||
return (
|
return (
|
||||||
<div className="relative flex items-center gap-1">
|
<div className="relative flex items-center gap-1">
|
||||||
<button
|
<Tooltip
|
||||||
className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80"
|
tooltipContent={
|
||||||
onClick={() => onEditClick && onEditClick(estimateId)}
|
<div className="relative flex items-center gap-2">
|
||||||
|
<div>Upgrade</div>
|
||||||
|
<Crown size={12} className="text-amber-400" />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
position="top"
|
||||||
>
|
>
|
||||||
<Pen size={12} />
|
<button className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80">
|
||||||
</button>
|
<Pen size={12} />
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
<button
|
<button
|
||||||
className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80"
|
className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80"
|
||||||
onClick={() => onDeleteClick && onDeleteClick(estimateId)}
|
onClick={() => onDeleteClick && onDeleteClick(estimateId)}
|
||||||
3
web/ce/components/estimates/index.ts
Normal file
3
web/ce/components/estimates/index.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export * from "./estimate-list-item-buttons";
|
||||||
|
|
||||||
|
export * from "./update";
|
||||||
1
web/ce/components/estimates/update/index.ts
Normal file
1
web/ce/components/estimates/update/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "./modal";
|
||||||
14
web/ce/components/estimates/update/modal.tsx
Normal file
14
web/ce/components/estimates/update/modal.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import { FC } from "react";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
|
||||||
|
type TUpdateEstimateModal = {
|
||||||
|
workspaceSlug: string;
|
||||||
|
projectId: string;
|
||||||
|
estimateId: string | undefined;
|
||||||
|
isOpen: boolean;
|
||||||
|
handleClose: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const UpdateEstimateModal: FC<TUpdateEstimateModal> = observer(() => <></>);
|
||||||
|
|
@ -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: {
|
||||||
|
|
@ -119,18 +121,3 @@ export const ESTIMATE_SYSTEMS: TEstimateSystems = {
|
||||||
is_ee: true,
|
is_ee: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ESTIMATE_OPTIONS_STAGE_ONE = [
|
|
||||||
{
|
|
||||||
key: EEstimateUpdateStages.EDIT,
|
|
||||||
title: "Add, update or remove estimates",
|
|
||||||
description: "Manage current system either adding, updating or removing the points or categories.",
|
|
||||||
is_ee: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: EEstimateUpdateStages.SWITCH,
|
|
||||||
title: "Change estimate type",
|
|
||||||
description: "Convert your points system to categories system and vice versa.",
|
|
||||||
is_ee: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -5,9 +5,10 @@ import { TYAxisValues } from "@plane/types";
|
||||||
import { CustomSelect } from "@plane/ui";
|
import { CustomSelect } from "@plane/ui";
|
||||||
// constants
|
// constants
|
||||||
import { ANALYTICS_Y_AXIS_VALUES } from "@/constants/analytics";
|
import { ANALYTICS_Y_AXIS_VALUES } from "@/constants/analytics";
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
// hooks
|
// hooks
|
||||||
import { useAppRouter, useProjectEstimates } from "@/hooks/store";
|
import { useAppRouter, useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
value: TYAxisValues;
|
value: TYAxisValues;
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,13 @@ import { CustomSelect, Spinner } from "@plane/ui";
|
||||||
import ProgressChart from "@/components/core/sidebar/progress-chart";
|
import ProgressChart from "@/components/core/sidebar/progress-chart";
|
||||||
import { CycleProgressStats } from "@/components/cycles";
|
import { CycleProgressStats } from "@/components/cycles";
|
||||||
// constants
|
// constants
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
|
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
|
||||||
// helpers
|
// helpers
|
||||||
import { getDate } from "@/helpers/date-time.helper";
|
import { getDate } from "@/helpers/date-time.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssues, useCycle, useProjectEstimates } from "@/hooks/store";
|
import { useIssues, useCycle, useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TCycleAnalyticsProgress = {
|
type TCycleAnalyticsProgress = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import { ArchiveCycleModal, CycleDeleteModal, CycleAnalyticsProgress } from "@/c
|
||||||
import { DateRangeDropdown } from "@/components/dropdowns";
|
import { DateRangeDropdown } from "@/components/dropdowns";
|
||||||
// constants
|
// constants
|
||||||
import { CYCLE_STATUS } from "@/constants/cycle";
|
import { CYCLE_STATUS } from "@/constants/cycle";
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
import { CYCLE_UPDATED } from "@/constants/event-tracker";
|
import { CYCLE_UPDATED } from "@/constants/event-tracker";
|
||||||
import { EUserWorkspaceRoles } from "@/constants/workspace";
|
import { EUserWorkspaceRoles } from "@/constants/workspace";
|
||||||
// helpers
|
// helpers
|
||||||
|
|
@ -24,6 +23,8 @@ import { findHowManyDaysLeft, getDate, renderFormattedPayloadDate } from "@/help
|
||||||
import { copyUrlToClipboard } from "@/helpers/string.helper";
|
import { copyUrlToClipboard } from "@/helpers/string.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useEventTracker, useCycle, useUser, useMember, useProjectEstimates } from "@/hooks/store";
|
import { useEventTracker, useCycle, useUser, useMember, useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
// services
|
// services
|
||||||
import { CycleService } from "@/services/cycle.service";
|
import { CycleService } from "@/services/cycle.service";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ import { Button, TOAST_TYPE, setToast } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import { EModalPosition, EModalWidth, ModalCore } from "@/components/core";
|
import { EModalPosition, EModalWidth, ModalCore } from "@/components/core";
|
||||||
import { EstimateCreateStageOne, EstimatePointCreateRoot } from "@/components/estimates";
|
import { EstimateCreateStageOne, EstimatePointCreateRoot } from "@/components/estimates";
|
||||||
// constants
|
|
||||||
import { EEstimateSystem, ESTIMATE_SYSTEMS } from "@/constants/estimates";
|
|
||||||
// hooks
|
// hooks
|
||||||
import { useProjectEstimates } from "@/hooks/store";
|
import { useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem, ESTIMATE_SYSTEMS } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TCreateEstimateModal = {
|
type TCreateEstimateModal = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import { TEstimateSystemKeys } from "@plane/types";
|
||||||
import { Tooltip } from "@plane/ui";
|
import { Tooltip } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import { RadioInput } from "@/components/estimates";
|
import { RadioInput } from "@/components/estimates";
|
||||||
// constants
|
// plane web constants
|
||||||
import { ESTIMATE_SYSTEMS } from "@/constants/estimates";
|
import { ESTIMATE_SYSTEMS } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TEstimateCreateStageOne = {
|
type TEstimateCreateStageOne = {
|
||||||
estimateSystem: TEstimateSystemKeys;
|
estimateSystem: TEstimateSystemKeys;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ import { observer } from "mobx-react";
|
||||||
import { cn } from "@/helpers/common.helper";
|
import { cn } from "@/helpers/common.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useEstimate, useProjectEstimates } from "@/hooks/store";
|
import { useEstimate, useProjectEstimates } from "@/hooks/store";
|
||||||
import { EstimateListItemButtons } from "./estimate-list-item-buttons";
|
// plane web components
|
||||||
|
import { EstimateListItemButtons } from "@/plane-web/components/estimates";
|
||||||
|
|
||||||
type TEstimateListItem = {
|
type TEstimateListItem = {
|
||||||
estimateId: string;
|
estimateId: string;
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,10 @@ export * from "./estimate-disable-switch";
|
||||||
// estimates
|
// estimates
|
||||||
export * from "./estimate-list";
|
export * from "./estimate-list";
|
||||||
export * from "./estimate-list-item";
|
export * from "./estimate-list-item";
|
||||||
export * from "./estimate-list-item-buttons";
|
|
||||||
|
|
||||||
// create
|
// create
|
||||||
export * from "./create";
|
export * from "./create";
|
||||||
|
|
||||||
// update
|
|
||||||
export * from "./update";
|
|
||||||
|
|
||||||
// delete
|
// delete
|
||||||
export * from "./delete";
|
export * from "./delete";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||||
import { Button, Sortable } from "@plane/ui";
|
import { Button, Sortable } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points";
|
import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points";
|
||||||
// constants
|
// plane web constants
|
||||||
import { maxEstimatesCount } from "@/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,13 +5,13 @@ import { observer } from "mobx-react";
|
||||||
import { Check, Info, X } from "lucide-react";
|
import { Check, Info, X } from "lucide-react";
|
||||||
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||||
import { Spinner, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
import { Spinner, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
||||||
// constants
|
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
// helpers
|
// helpers
|
||||||
import { cn } from "@/helpers/common.helper";
|
import { cn } from "@/helpers/common.helper";
|
||||||
import { isEstimatePointValuesRepeated } from "@/helpers/estimates";
|
import { isEstimatePointValuesRepeated } from "@/helpers/estimates";
|
||||||
// hooks
|
// hooks
|
||||||
import { useEstimate } from "@/hooks/store";
|
import { useEstimate } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TEstimatePointCreate = {
|
type TEstimatePointCreate = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ import { GripVertical, Pencil, Trash2 } from "lucide-react";
|
||||||
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||||
// components
|
// components
|
||||||
import { EstimatePointUpdate, EstimatePointDelete } from "@/components/estimates/points";
|
import { EstimatePointUpdate, EstimatePointDelete } from "@/components/estimates/points";
|
||||||
import { minEstimatesCount } from "@/constants/estimates";
|
// plane web constants
|
||||||
|
import { estimateCount } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TEstimatePointItemPreview = {
|
type TEstimatePointItemPreview = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
@ -61,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={() =>
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ import { observer } from "mobx-react";
|
||||||
import { Check, Info, X } from "lucide-react";
|
import { Check, Info, X } from "lucide-react";
|
||||||
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||||
import { Spinner, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
import { Spinner, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
||||||
// constants
|
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
// helpers
|
// helpers
|
||||||
import { cn } from "@/helpers/common.helper";
|
import { cn } from "@/helpers/common.helper";
|
||||||
import { isEstimatePointValuesRepeated } from "@/helpers/estimates";
|
import { isEstimatePointValuesRepeated } from "@/helpers/estimates";
|
||||||
// hooks
|
// hooks
|
||||||
import { useEstimatePoint } from "@/hooks/store";
|
import { useEstimatePoint } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TEstimatePointUpdate = {
|
type TEstimatePointUpdate = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,13 @@ import {
|
||||||
EstimateEmptyScreen,
|
EstimateEmptyScreen,
|
||||||
EstimateDisableSwitch,
|
EstimateDisableSwitch,
|
||||||
CreateEstimateModal,
|
CreateEstimateModal,
|
||||||
UpdateEstimateModal,
|
|
||||||
DeleteEstimateModal,
|
DeleteEstimateModal,
|
||||||
EstimateList,
|
EstimateList,
|
||||||
} from "@/components/estimates";
|
} from "@/components/estimates";
|
||||||
// hooks
|
// hooks
|
||||||
import { useProject, useProjectEstimates } from "@/hooks/store";
|
import { useProject, useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web components
|
||||||
|
import { UpdateEstimateModal } from "@/plane-web/components/estimates";
|
||||||
|
|
||||||
type TEstimateRoot = {
|
type TEstimateRoot = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
export * from "./modal";
|
|
||||||
export * from "./stage-one";
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
"use client";
|
|
||||||
|
|
||||||
import { FC } from "react";
|
|
||||||
import { observer } from "mobx-react";
|
|
||||||
import { Button } from "@plane/ui";
|
|
||||||
// components
|
|
||||||
import { EModalPosition, EModalWidth, ModalCore } from "@/components/core";
|
|
||||||
import { EstimateUpdateStageOne } from "@/components/estimates";
|
|
||||||
|
|
||||||
type TUpdateEstimateModal = {
|
|
||||||
workspaceSlug: string;
|
|
||||||
projectId: string;
|
|
||||||
estimateId: string | undefined;
|
|
||||||
isOpen: boolean;
|
|
||||||
handleClose: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const UpdateEstimateModal: FC<TUpdateEstimateModal> = observer((props) => {
|
|
||||||
// props
|
|
||||||
const { isOpen, handleClose } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalCore isOpen={isOpen} position={EModalPosition.TOP} width={EModalWidth.XXL}>
|
|
||||||
<div className="relative space-y-6 py-5">
|
|
||||||
{/* heading */}
|
|
||||||
<div className="relative flex justify-between items-center gap-2 px-5">
|
|
||||||
<div className="relative flex items-center gap-1">
|
|
||||||
<div className="text-xl font-medium text-custom-text-200">Edit estimate system</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="px-5">
|
|
||||||
<EstimateUpdateStageOne />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative flex justify-end items-center gap-3 px-5 pt-5 border-t border-custom-border-200">
|
|
||||||
<Button variant="neutral-primary" size="sm" onClick={handleClose}>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ModalCore>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
"use client";
|
|
||||||
|
|
||||||
import { FC } from "react";
|
|
||||||
import { Crown } from "lucide-react";
|
|
||||||
import { TEstimateUpdateStageKeys } from "@plane/types";
|
|
||||||
import { Tooltip } from "@plane/ui";
|
|
||||||
// constants
|
|
||||||
import { ESTIMATE_OPTIONS_STAGE_ONE } from "@/constants/estimates";
|
|
||||||
// helpers
|
|
||||||
import { cn } from "@/helpers/common.helper";
|
|
||||||
|
|
||||||
type TEstimateUpdateStageOne = {
|
|
||||||
handleEstimateEditType?: (stage: TEstimateUpdateStageKeys) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const EstimateUpdateStageOne: FC<TEstimateUpdateStageOne> = (props) => {
|
|
||||||
const { handleEstimateEditType } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="space-y-3">
|
|
||||||
{ESTIMATE_OPTIONS_STAGE_ONE &&
|
|
||||||
ESTIMATE_OPTIONS_STAGE_ONE.map((stage) => (
|
|
||||||
<div
|
|
||||||
key={stage.key}
|
|
||||||
className={cn(
|
|
||||||
"border border-custom-border-300 cursor-pointer space-y-1 p-3 rounded transition-colors",
|
|
||||||
stage?.is_ee ? `bg-custom-background-90` : `hover:bg-custom-background-90`
|
|
||||||
)}
|
|
||||||
onClick={() => !stage?.is_ee && handleEstimateEditType && handleEstimateEditType(stage.key)}
|
|
||||||
>
|
|
||||||
<h3 className="text-base font-medium relative flex items-center gap-2">
|
|
||||||
{stage.title}
|
|
||||||
{stage?.is_ee && (
|
|
||||||
<Tooltip tooltipContent={"upgrade"}>
|
|
||||||
<Crown size={12} className="text-amber-400" />
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
</h3>
|
|
||||||
<p className="text-sm text-custom-text-200">{stage.description}</p>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
@ -12,12 +12,13 @@ import { CustomSelect, Spinner } from "@plane/ui";
|
||||||
import ProgressChart from "@/components/core/sidebar/progress-chart";
|
import ProgressChart from "@/components/core/sidebar/progress-chart";
|
||||||
import { ModuleProgressStats } from "@/components/modules";
|
import { ModuleProgressStats } from "@/components/modules";
|
||||||
// constants
|
// constants
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
|
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
|
||||||
// helpers
|
// helpers
|
||||||
import { getDate } from "@/helpers/date-time.helper";
|
import { getDate } from "@/helpers/date-time.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssues, useModule, useProjectEstimates } from "@/hooks/store";
|
import { useIssues, useModule, useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type TModuleAnalyticsProgress = {
|
type TModuleAnalyticsProgress = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ import {
|
||||||
import { LinkModal, LinksList } from "@/components/core";
|
import { LinkModal, LinksList } from "@/components/core";
|
||||||
import { DateRangeDropdown, MemberDropdown } from "@/components/dropdowns";
|
import { DateRangeDropdown, MemberDropdown } from "@/components/dropdowns";
|
||||||
import { ArchiveModuleModal, DeleteModuleModal, ModuleAnalyticsProgress } from "@/components/modules";
|
import { ArchiveModuleModal, DeleteModuleModal, ModuleAnalyticsProgress } from "@/components/modules";
|
||||||
// constant
|
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
import {
|
import {
|
||||||
MODULE_LINK_CREATED,
|
MODULE_LINK_CREATED,
|
||||||
MODULE_LINK_DELETED,
|
MODULE_LINK_DELETED,
|
||||||
|
|
@ -49,6 +47,8 @@ import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper"
|
||||||
import { copyUrlToClipboard } from "@/helpers/string.helper";
|
import { copyUrlToClipboard } from "@/helpers/string.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useModule, useUser, useEventTracker, useProjectEstimates } from "@/hooks/store";
|
import { useModule, useUser, useEventTracker, useProjectEstimates } from "@/hooks/store";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
const defaultValues: Partial<IModule> = {
|
const defaultValues: Partial<IModule> = {
|
||||||
lead_id: "",
|
lead_id: "",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import { FavoriteStar } from "@/components/core";
|
||||||
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
|
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
|
||||||
import { ModuleQuickActions } from "@/components/modules";
|
import { ModuleQuickActions } from "@/components/modules";
|
||||||
// constants
|
// constants
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
import { MODULE_FAVORITED, MODULE_UNFAVORITED } from "@/constants/event-tracker";
|
import { MODULE_FAVORITED, MODULE_UNFAVORITED } from "@/constants/event-tracker";
|
||||||
import { MODULE_STATUS } from "@/constants/module";
|
import { MODULE_STATUS } from "@/constants/module";
|
||||||
import { EUserProjectRoles } from "@/constants/project";
|
import { EUserProjectRoles } from "@/constants/project";
|
||||||
|
|
@ -22,6 +21,8 @@ import { generateQueryParams } from "@/helpers/router.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useEventTracker, useMember, useModule, useProjectEstimates, useUser } from "@/hooks/store";
|
import { useEventTracker, useMember, useModule, useProjectEstimates, useUser } from "@/hooks/store";
|
||||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
moduleId: string;
|
moduleId: string;
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ import { CircularProgressIndicator } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import { ListItem } from "@/components/core/list";
|
import { ListItem } from "@/components/core/list";
|
||||||
import { ModuleListItemAction } from "@/components/modules";
|
import { ModuleListItemAction } from "@/components/modules";
|
||||||
// constants
|
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
|
||||||
// helpers
|
// helpers
|
||||||
import { generateQueryParams } from "@/helpers/router.helper";
|
import { generateQueryParams } from "@/helpers/router.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useAppRouter, useModule, useProjectEstimates } from "@/hooks/store";
|
import { useAppRouter, useModule, useProjectEstimates } from "@/hooks/store";
|
||||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||||
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
moduleId: string;
|
moduleId: string;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "ce/components/estimates/estimate-list-item-buttons";
|
||||||
1
web/ee/components/estimates/index.ts
Normal file
1
web/ee/components/estimates/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "./estimate-list-item-buttons";
|
||||||
1
web/ee/components/estimates/update/index.ts
Normal file
1
web/ee/components/estimates/update/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "./modal";
|
||||||
1
web/ee/components/estimates/update/modal.tsx
Normal file
1
web/ee/components/estimates/update/modal.tsx
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "ce/components/estimates/update/modal";
|
||||||
1
web/ee/constants/estimates.ts
Normal file
1
web/ee/constants/estimates.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "ce/constants/estimates";
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
// plane web constants
|
||||||
|
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||||
|
|
||||||
export const isEstimatePointValuesRepeated = (
|
export const isEstimatePointValuesRepeated = (
|
||||||
estimatePoints: string[],
|
estimatePoints: string[],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue