From bc401457c781b6033509c19362228eac07699503 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:34:11 +0530 Subject: [PATCH] [WEB-3031] fix: project overview description activity (#2089) * fix: project overview description activity * fix: project overview metrics * chore: project settings ux updated --- .../ee/bgtasks/project_activites_task.py | 10 +- web/core/components/project/form.tsx | 4 +- .../project-overview/details/stats/root.tsx | 115 +----------------- 3 files changed, 10 insertions(+), 119 deletions(-) diff --git a/apiserver/plane/ee/bgtasks/project_activites_task.py b/apiserver/plane/ee/bgtasks/project_activites_task.py index ae714a96a4..4cd8adc5de 100644 --- a/apiserver/plane/ee/bgtasks/project_activites_task.py +++ b/apiserver/plane/ee/bgtasks/project_activites_task.py @@ -50,7 +50,7 @@ def track_description( project_activities, epoch, ): - if current_instance.get("description") != requested_data.get("description"): + if current_instance.get("description_html") != requested_data.get("description_html"): last_activity = ( WorkspaceActivity.objects.filter(project_id=project_id) .order_by("-created_at") @@ -58,7 +58,7 @@ def track_description( ) if ( last_activity is not None - and last_activity.field == "description" + and last_activity.field == "description_html" and actor_id == str(last_activity.actor_id) ): last_activity.created_at = timezone.now() @@ -68,8 +68,8 @@ def track_description( WorkspaceActivity( actor_id=actor_id, verb="updated", - old_value=current_instance.get("description"), - new_value=requested_data.get("description"), + old_value=current_instance.get("description_html"), + new_value=requested_data.get("description_html"), field="description", project_id=project_id, workspace_id=workspace_id, @@ -567,7 +567,7 @@ def update_project_activity( ): project_activity_MAPPER = { "name": track_name, - "description": track_description, + "description_html": track_description, "target_date": track_target_date, "start_date": track_start_date, "priority": track_priority, diff --git a/web/core/components/project/form.tsx b/web/core/components/project/form.tsx index 8ce776eb66..58869988b4 100644 --- a/web/core/components/project/form.tsx +++ b/web/core/components/project/form.tsx @@ -261,7 +261,7 @@ export const ProjectDetailsForm: FC = (props) => { {errors?.name?.message}
-

Description

+

Summary

= (props) => { id="description" name="description" value={value} - placeholder="Enter project description" + placeholder="Enter project summary" onChange={onChange} className="min-h-[102px] text-sm font-medium" hasError={Boolean(errors?.description)} diff --git a/web/ee/components/project-overview/details/stats/root.tsx b/web/ee/components/project-overview/details/stats/root.tsx index 67e198b6e9..6d0c0677e4 100644 --- a/web/ee/components/project-overview/details/stats/root.tsx +++ b/web/ee/components/project-overview/details/stats/root.tsx @@ -1,37 +1,15 @@ import useSWR from "swr"; +import { TStateAnalytics } from "@plane/types"; import { Loader } from "@plane/ui"; -import { cn } from "@plane/utils"; +import { ProgressSection } from "@/plane-web/components/common/layout/main/sections/progress-root"; import projectService from "@/plane-web/services/project/project.service"; import { TProject } from "@/plane-web/types"; -import { NoStats } from "./no-data"; -type TStatBlockProp = { - title: string; - stat: number; - color: string; - percentage: number; -}; type TStatsTodayProps = { workspaceSlug: string; project: TProject; }; -const StatBlock = (props: TStatBlockProp) => { - const { title, stat, color, percentage } = props; - return ( -
-
-
-
{title}
-
-
-
{stat}
-
{percentage}%
-
-
- ); -}; - export const StatsToday = (props: TStatsTodayProps) => { const { workspaceSlug, project } = props; @@ -45,100 +23,13 @@ export const StatsToday = (props: TStatsTodayProps) => { } ); - const stats = [ - { - title: "Overdue", - stat: analytics?.overdue_issues, - color: "#FF3333", - }, - { - title: "Backlog", - stat: analytics?.backlog_issues, - color: "#EBEDF2", - }, - { - title: "Unstarted", - stat: analytics?.unstarted_issues, - color: "#6E6E6E", - }, - { - title: "Started", - stat: analytics?.started_issues, - color: "#FF9500", - }, - { - title: "Completed", - stat: analytics?.completed_issues, - color: "#26D950", - }, - ]; - return isLoading ? ( ) : (
-
Metrics as of today
- {(!analytics || project.total_issues === 0) && } - {analytics && project.total_issues > 0 && ( -
- {/* Progress bar */} -
- {stats.map((stat) => ( -
- ))} -
- - {/* Numbers */} -
- - -
-
- STATUS -
- -
- - - -
-
- )} +
); };