-
-
- {Object.keys(filters).length > 0 &&
- nullFilters.length !== Object.keys(filters).length && (
-
{
- if (viewId) {
- setFilters({}, true);
- setToastAlert({
- title: "View updated",
- message: "Your view has been updated",
- type: "success",
- });
- } else
- setCreateViewModal({
- query: filters,
- });
- }}
- className="flex items-center gap-2 text-sm"
- >
- {!viewId && }
- {viewId ? "Update" : "Save"} view
-
- )}
-
+
+
+ {Object.keys(filters).length > 0 && nullFilters.length !== Object.keys(filters).length && (
+
{
+ if (viewId) {
+ setFilters({}, true);
+ setToastAlert({
+ title: "View updated",
+ message: "Your view has been updated",
+ type: "success",
+ });
+ } else
+ setCreateViewModal({
+ query: filters,
+ });
+ }}
+ className="flex items-center gap-2 text-sm"
+ >
+ {!viewId && }
+ {viewId ? "Update" : "Save"} view
+
+ )}
{Object.keys(filters).length > 0 && nullFilters.length !== Object.keys(filters).length && (
-
+
)}
diff --git a/apps/app/components/issues/activity.tsx b/apps/app/components/issues/activity.tsx
index f06ec625a..dd50f3bca 100644
--- a/apps/app/components/issues/activity.tsx
+++ b/apps/app/components/issues/activity.tsx
@@ -29,6 +29,7 @@ import { addSpaceIfCamelCase } from "helpers/string.helper";
// types
import { IIssueComment, IIssueLabels } from "types";
import { PROJECT_ISSUES_ACTIVITY, PROJECT_ISSUE_LABELS } from "constants/fetch-keys";
+import useEstimateOption from "hooks/use-estimate-option";
const activityDetails: {
[key: string]: {
@@ -56,6 +57,10 @@ const activityDetails: {
message: "set the cycle to",
icon: ,
},
+ estimate_point: {
+ message: "set the estimate point to",
+ icon: ,
+ },
labels: {
icon: ,
},
@@ -107,6 +112,8 @@ export const IssueActivitySection: React.FC = () => {
const router = useRouter();
const { workspaceSlug, projectId, issueId } = router.query;
+ const { isEstimateActive, estimatePoints } = useEstimateOption();
+
const { data: issueActivities, mutate: mutateIssueActivities } = useSWR(
workspaceSlug && projectId && issueId ? PROJECT_ISSUES_ACTIVITY(issueId as string) : null,
workspaceSlug && projectId && issueId
@@ -278,8 +285,14 @@ export const IssueActivitySection: React.FC = () => {
value = "attachment";
} else if (activityItem.field === "link") {
value = "link";
- } else if (activityItem.field === "estimate") {
- value = "estimate";
+ } else if (activityItem.field === "estimate_point") {
+ value = activityItem.new_value
+ ? isEstimateActive
+ ? estimatePoints.find((e) => e.key === parseInt(activityItem.new_value ?? "", 10))
+ ?.value
+ : activityItem.new_value +
+ ` Point${parseInt(activityItem.new_value ?? "", 10) > 1 ? "s" : ""}`
+ : "None";
}
if ("field" in activityItem && activityItem.field !== "updated_by") {
diff --git a/apps/app/components/issues/form.tsx b/apps/app/components/issues/form.tsx
index 9051ed2a5..7c19b5b79 100644
--- a/apps/app/components/issues/form.tsx
+++ b/apps/app/components/issues/form.tsx
@@ -48,7 +48,7 @@ const defaultValues: Partial = {
name: "",
description: "",
description_html: "",
- estimate_point: 0,
+ estimate_point: null,
state: "",
cycle: null,
priority: null,
diff --git a/apps/app/components/issues/select/estimate.tsx b/apps/app/components/issues/select/estimate.tsx
index 661409b4f..813bd14f0 100644
--- a/apps/app/components/issues/select/estimate.tsx
+++ b/apps/app/components/issues/select/estimate.tsx
@@ -8,8 +8,8 @@ import { PlayIcon } from "@heroicons/react/24/outline";
import useEstimateOption from "hooks/use-estimate-option";
type Props = {
- value: number;
- onChange: (value: number) => void;
+ value: number | null;
+ onChange: (value: number | null) => void;
};
export const IssueEstimateSelect: React.FC = ({ value, onChange }) => {
@@ -24,18 +24,26 @@ export const IssueEstimateSelect: React.FC = ({ value, onChange }) => {
- {estimatePoints?.find((e) => e.key === value)?.value ?? "Estimate points"}
+ {estimatePoints?.find((e) => e.key === value)?.value ?? "Estimate"}
}
onChange={onChange}
position="right"
- width="w-full min-w-[6rem]"
+ width="w-full min-w-[8rem]"
noChevron
>
+
+ <>
+
+
+
+ None
+ >
+
{estimatePoints &&
estimatePoints.map((point) => (
-
+
<>
diff --git a/apps/app/components/issues/sidebar-select/estimate.tsx b/apps/app/components/issues/sidebar-select/estimate.tsx
index 2491c0978..adf7bec97 100644
--- a/apps/app/components/issues/sidebar-select/estimate.tsx
+++ b/apps/app/components/issues/sidebar-select/estimate.tsx
@@ -1,17 +1,17 @@
import React from "react";
+// hooks
+import useEstimateOption from "hooks/use-estimate-option";
// ui
import { CustomSelect } from "components/ui";
// icons
-import { BanknotesIcon, PlayIcon } from "@heroicons/react/24/outline";
+import { PlayIcon } from "@heroicons/react/24/outline";
// types
import { UserAuth } from "types";
-import useEstimateOption from "hooks/use-estimate-option";
-// constants
type Props = {
- value: number;
- onChange: (val: number) => void;
+ value: number | null;
+ onChange: (val: number | null) => void;
userAuth: UserAuth;
};
@@ -35,7 +35,7 @@ export const SidebarEstimateSelect: React.FC = ({ value, onChange, userAu
- {estimatePoints?.find((e) => e.key === value)?.value ?? "Estimate points"}
+ {estimatePoints?.find((e) => e.key === value)?.value ?? "Estimate"}
}
@@ -44,9 +44,17 @@ export const SidebarEstimateSelect: React.FC = ({ value, onChange, userAu
width="w-full"
disabled={isNotAllowed}
>
+
+ <>
+
+
+
+ None
+ >
+
{estimatePoints &&
estimatePoints.map((point) => (
-
+
<>
diff --git a/apps/app/components/issues/sidebar.tsx b/apps/app/components/issues/sidebar.tsx
index a9c6149a6..09eef138e 100644
--- a/apps/app/components/issues/sidebar.tsx
+++ b/apps/app/components/issues/sidebar.tsx
@@ -294,7 +294,7 @@ export const IssueDetailsSidebar: React.FC = ({
render={({ field: { value } }) => (
submitChanges({ estimate_point: val })}
+ onChange={(val: number | null) => submitChanges({ estimate_point: val })}
userAuth={memberRole}
/>
)}
diff --git a/apps/app/components/issues/view-select/estimate.tsx b/apps/app/components/issues/view-select/estimate.tsx
index e3dbb2028..a44c01ce0 100644
--- a/apps/app/components/issues/view-select/estimate.tsx
+++ b/apps/app/components/issues/view-select/estimate.tsx
@@ -58,7 +58,7 @@ export const ViewEstimateSelect: React.FC = ({
- {estimateValue}
+ {estimateValue ?? "Estimate"}
}
@@ -67,11 +67,24 @@ export const ViewEstimateSelect: React.FC = ({
disabled={isNotAllowed}
position={position}
selfPositioned={selfPositioned}
- width="w-full min-w-[6rem]"
+ width="w-full min-w-[8rem]"
>
+
+ <>
+
+
+
+ None
+ >
+
{estimatePoints?.map((estimate) => (
-
- <>{estimate.value}>
+
+ <>
+
+
+
+ {estimate.value}
+ >
))}
diff --git a/apps/app/hooks/use-estimate-option.tsx b/apps/app/hooks/use-estimate-option.tsx
index 664b1af87..ef35503e7 100644
--- a/apps/app/hooks/use-estimate-option.tsx
+++ b/apps/app/hooks/use-estimate-option.tsx
@@ -13,7 +13,7 @@ import { orderArrayBy } from "helpers/array.helper";
// fetch-keys
import { ESTIMATE_POINTS_LIST } from "constants/fetch-keys";
-const useEstimateOption = (estimateKey?: number) => {
+const useEstimateOption = (estimateKey?: number | null) => {
const router = useRouter();
const { workspaceSlug, projectId } = router.query;
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx
index 3f120741e..b2ebf721d 100644
--- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx
+++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx
@@ -34,6 +34,7 @@ const defaultValues = {
name: "",
description: "",
description_html: "",
+ estimate_point: null,
state: "",
assignees_list: [],
priority: "low",
diff --git a/apps/app/types/issues.d.ts b/apps/app/types/issues.d.ts
index 7094b5ce8..a7fc92163 100644
--- a/apps/app/types/issues.d.ts
+++ b/apps/app/types/issues.d.ts
@@ -87,7 +87,7 @@ export interface IIssue {
description: any;
description_html: any;
description_stripped: any;
- estimate_point: number;
+ estimate_point: number | null;
id: string;
issue_cycle: IIssueCycle | null;
issue_link: {