diff --git a/apiserver/plane/app/serializers/cycle.py b/apiserver/plane/app/serializers/cycle.py index a041dd227..77c3f16cc 100644 --- a/apiserver/plane/app/serializers/cycle.py +++ b/apiserver/plane/app/serializers/cycle.py @@ -33,7 +33,6 @@ class CycleWriteSerializer(BaseSerializer): class CycleSerializer(BaseSerializer): - owned_by = UserLiteSerializer(read_only=True) is_favorite = serializers.BooleanField(read_only=True) total_issues = serializers.IntegerField(read_only=True) cancelled_issues = serializers.IntegerField(read_only=True) diff --git a/packages/types/src/cycles.d.ts b/packages/types/src/cycles.d.ts index 91c6ef1d5..12cbab4c6 100644 --- a/packages/types/src/cycles.d.ts +++ b/packages/types/src/cycles.d.ts @@ -30,7 +30,7 @@ export interface ICycle { is_favorite: boolean; issue: string; name: string; - owned_by: IUser; + owned_by: string; project: string; project_detail: IProjectLite; status: TCycleGroups; diff --git a/web/components/analytics/custom-analytics/sidebar/sidebar-header.tsx b/web/components/analytics/custom-analytics/sidebar/sidebar-header.tsx index d46cad191..4a18011d1 100644 --- a/web/components/analytics/custom-analytics/sidebar/sidebar-header.tsx +++ b/web/components/analytics/custom-analytics/sidebar/sidebar-header.tsx @@ -1,7 +1,7 @@ import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; // hooks -import { useCycle, useModule, useProject } from "hooks/store"; +import { useCycle, useMember, useModule, useProject } from "hooks/store"; // helpers import { renderEmoji } from "helpers/emoji.helper"; import { renderFormattedDate } from "helpers/date-time.helper"; @@ -15,10 +15,12 @@ export const CustomAnalyticsSidebarHeader = observer(() => { const { getProjectById } = useProject(); const { getCycleById } = useCycle(); const { getModuleById } = useModule(); + const { getUserDetails } = useMember(); const cycleDetails = cycleId ? getCycleById(cycleId.toString()) : undefined; const moduleDetails = moduleId ? getModuleById(moduleId.toString()) : undefined; const projectDetails = projectId ? getProjectById(projectId.toString()) : undefined; + const cycleOwnerDetails = cycleDetails ? getUserDetails(cycleDetails.owned_by) : undefined; return ( <> @@ -29,7 +31,7 @@ export const CustomAnalyticsSidebarHeader = observer(() => {
Lead
- {cycleDetails.owned_by?.display_name} + {cycleOwnerDetails?.display_name}
Start Date
diff --git a/web/components/cycles/active-cycle-details.tsx b/web/components/cycles/active-cycle-details.tsx index 12d836695..a0101b1c1 100644 --- a/web/components/cycles/active-cycle-details.tsx +++ b/web/components/cycles/active-cycle-details.tsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite"; import useSWR from "swr"; import { useTheme } from "next-themes"; // hooks -import { useCycle, useIssues, useProject, useUser } from "hooks/store"; +import { useCycle, useIssues, useMember, useProject, useUser } from "hooks/store"; import useToast from "hooks/use-toast"; // ui import { SingleProgressStats } from "components/core"; @@ -58,6 +58,7 @@ export const ActiveCycleDetails: React.FC = observer((props removeCycleFromFavorites, } = useCycle(); const { currentProjectDetails } = useProject(); + const { getUserDetails } = useMember(); // toast alert const { setToastAlert } = useToast(); @@ -67,6 +68,7 @@ export const ActiveCycleDetails: React.FC = observer((props ); const activeCycle = currentProjectActiveCycleId ? getActiveCycleById(currentProjectActiveCycleId) : null; + const cycleOwnerDetails = activeCycle ? getUserDetails(activeCycle.owned_by) : undefined; const { data: activeCycleIssues } = useSWR( workspaceSlug && projectId && currentProjectActiveCycleId @@ -203,20 +205,20 @@ export const ActiveCycleDetails: React.FC = observer((props
- {activeCycle.owned_by.avatar && activeCycle.owned_by.avatar !== "" ? ( + {cycleOwnerDetails?.avatar && cycleOwnerDetails?.avatar !== "" ? ( {activeCycle.owned_by.display_name} ) : ( - {activeCycle.owned_by.display_name.charAt(0)} + {cycleOwnerDetails?.display_name.charAt(0)} )} - {activeCycle.owned_by.display_name} + {cycleOwnerDetails?.display_name}
{activeCycle.assignees.length > 0 && ( diff --git a/web/components/cycles/sidebar.tsx b/web/components/cycles/sidebar.tsx index 52da51b77..4bf76f91f 100644 --- a/web/components/cycles/sidebar.tsx +++ b/web/components/cycles/sidebar.tsx @@ -6,7 +6,7 @@ import { Disclosure, Popover, Transition } from "@headlessui/react"; // services import { CycleService } from "services/cycle.service"; // hooks -import { useApplication, useCycle, useUser } from "hooks/store"; +import { useApplication, useCycle, useMember, useUser } from "hooks/store"; import useToast from "hooks/use-toast"; // components import { SidebarProgressStats } from "components/core"; @@ -73,8 +73,10 @@ export const CycleDetailsSidebar: React.FC = observer((props) => { membership: { currentProjectRole }, } = useUser(); const { getCycleById, updateCycleDetails } = useCycle(); + const { getUserDetails } = useMember(); const cycleDetails = getCycleById(cycleId); + const cycleOwnerDetails = cycleDetails ? getUserDetails(cycleDetails.owned_by) : undefined; const { setToastAlert } = useToast(); @@ -518,8 +520,8 @@ export const CycleDetailsSidebar: React.FC = observer((props) => {
- - {cycleDetails.owned_by.display_name} + + {cycleOwnerDetails?.display_name}