From e03f537ac72c6d46fa434bcddd7e688059f8d792 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Mon, 16 Jun 2025 17:54:59 +0530 Subject: [PATCH] fix: space build errors. --- .../issue-layouts/calendar/calendar.tsx | 3 +- .../issue-layouts/calendar/day-tile.tsx | 3 +- .../issue-layouts/calendar/index.ts | 1 - .../issue-layouts/calendar/week-days.tsx | 3 +- space/ee/helpers/calendar.helper.ts | 36 +++---------------- space/ee/store/issue_calendar_view.store.ts | 6 ++-- yarn.lock | 16 +++------ 7 files changed, 15 insertions(+), 53 deletions(-) diff --git a/space/ee/components/issue-layouts/calendar/calendar.tsx b/space/ee/components/issue-layouts/calendar/calendar.tsx index 0316a5554c..6445014571 100644 --- a/space/ee/components/issue-layouts/calendar/calendar.tsx +++ b/space/ee/components/issue-layouts/calendar/calendar.tsx @@ -3,7 +3,7 @@ import { useRef, useState } from "react"; import { observer } from "mobx-react"; // plane -import type { TGroupedIssues, TLoader, TPaginationData } from "@plane/types"; +import type { TGroupedIssues, TLoader, TPaginationData, ICalendarWeek } from "@plane/types"; import { Spinner } from "@plane/ui"; import { cn } from "@plane/utils"; // components @@ -18,7 +18,6 @@ import { IIssue } from "@/types/issue"; // import { CalendarHeader } from "./header"; import { CalendarIssueBlocks } from "./issue-blocks"; -import { ICalendarWeek } from "./types"; import { CalendarWeekDays } from "./week-days"; import { CalendarWeekHeader } from "./week-header"; diff --git a/space/ee/components/issue-layouts/calendar/day-tile.tsx b/space/ee/components/issue-layouts/calendar/day-tile.tsx index ba07ea7286..86203821cc 100644 --- a/space/ee/components/issue-layouts/calendar/day-tile.tsx +++ b/space/ee/components/issue-layouts/calendar/day-tile.tsx @@ -3,7 +3,7 @@ import { useRef } from "react"; import { observer } from "mobx-react"; // types -import { TGroupedIssues, TPaginationData } from "@plane/types"; +import { TGroupedIssues, TPaginationData, ICalendarDate } from "@plane/types"; // helpers import { cn } from "@/helpers/common.helper"; // plane web @@ -12,7 +12,6 @@ import { renderFormattedPayloadDate } from "@/plane-web/helpers/date-time.helper import { IIssue } from "@/types/issue"; // import { CalendarIssueBlocks } from "./issue-blocks"; -import { ICalendarDate } from "./types"; type Props = { date: ICalendarDate; diff --git a/space/ee/components/issue-layouts/calendar/index.ts b/space/ee/components/issue-layouts/calendar/index.ts index dbafcb98f3..85128236ab 100644 --- a/space/ee/components/issue-layouts/calendar/index.ts +++ b/space/ee/components/issue-layouts/calendar/index.ts @@ -1,6 +1,5 @@ export * from "./dropdowns"; export * from "./calendar"; -export * from "./types.d"; export * from "./day-tile"; export * from "./header"; export * from "./issue-blocks"; diff --git a/space/ee/components/issue-layouts/calendar/week-days.tsx b/space/ee/components/issue-layouts/calendar/week-days.tsx index 64727c82f8..162f6f7b3d 100644 --- a/space/ee/components/issue-layouts/calendar/week-days.tsx +++ b/space/ee/components/issue-layouts/calendar/week-days.tsx @@ -1,12 +1,11 @@ import { observer } from "mobx-react"; -import { TGroupedIssues, TPaginationData } from "@plane/types"; +import { TGroupedIssues, TPaginationData, ICalendarDate, ICalendarWeek } from "@plane/types"; // helpers import { renderFormattedPayloadDate } from "@/plane-web/helpers/date-time.helper"; // types import { IIssue } from "@/types/issue"; // import { CalendarDayTile } from "./day-tile"; -import { ICalendarDate, ICalendarWeek } from "./types"; type Props = { getIssueById: (issueId: string) => IIssue | undefined; diff --git a/space/ee/helpers/calendar.helper.ts b/space/ee/helpers/calendar.helper.ts index abcffd22b9..3334a8dfb6 100644 --- a/space/ee/helpers/calendar.helper.ts +++ b/space/ee/helpers/calendar.helper.ts @@ -1,29 +1,6 @@ -<<<<<<<< HEAD:packages/utils/src/calendar.ts -// plane imports import { EStartOfTheWeek } from "@plane/constants"; -import { ICalendarDate, ICalendarPayload } from "@plane/types"; -// local imports -import { getWeekNumberOfDate, renderFormattedPayloadDate } from "./datetime"; -======== -import { ICalendarDate, ICalendarPayload } from "../types"; -import { renderFormattedPayloadDate } from "./date-time.helper"; - -/** - * @returns {number} week number of date - * @description Returns week number of date - * @param {Date} date - * @example getWeekNumber(new Date("2023-09-01")) // 35 - */ -export const getWeekNumberOfDate = (date: Date): number => { - const currentDate = date; - // Adjust the starting day to Sunday (0) instead of Monday (1) - const startDate = new Date(currentDate.getFullYear(), 0, 1); - // Calculate the number of days between currentDate and startDate - const days = Math.floor((currentDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000)); - // Adjust the calculation for weekNumber - const weekNumber = Math.ceil((days + 1) / 7); - return weekNumber; -}; +import { ICalendarDate, ICalendarPayload } from "@plane/types"; +import { getWeekNumberOfDate, renderFormattedPayloadDate } from "@plane/utils"; export const formatDate = (date: Date, format: string): string => { const day = date.getDate(); @@ -61,7 +38,6 @@ export const formatDate = (date: Date, format: string): string => { return formattedDate; }; ->>>>>>>> 98fee2ac1d34e72653d20075d6b482cc8312182c:space/ee/helpers/calendar.helper.ts /** * @returns {ICalendarPayload} calendar payload to render the calendar @@ -115,7 +91,6 @@ export const generateCalendarData = (currentStructure: ICalendarPayload | null, return calendarData; }; -<<<<<<<< HEAD:packages/utils/src/calendar.ts /** * Returns a new array sorted by the startOfWeek. @@ -127,10 +102,9 @@ export const getOrderedDays = ( items: T[], getDayIndex: (item: T) => number, startOfWeek: EStartOfTheWeek = EStartOfTheWeek.SUNDAY -): T[] => [...items].sort((a, b) => { +): T[] => + [...items].sort((a, b) => { const dayA = (7 + getDayIndex(a) - startOfWeek) % 7; const dayB = (7 + getDayIndex(b) - startOfWeek) % 7; return dayA - dayB; - }) -======== ->>>>>>>> 98fee2ac1d34e72653d20075d6b482cc8312182c:space/ee/helpers/calendar.helper.ts + }); diff --git a/space/ee/store/issue_calendar_view.store.ts b/space/ee/store/issue_calendar_view.store.ts index 6db444328a..9d4facd43d 100644 --- a/space/ee/store/issue_calendar_view.store.ts +++ b/space/ee/store/issue_calendar_view.store.ts @@ -1,8 +1,8 @@ import { observable, action, makeObservable, runInAction, computed } from "mobx"; import { computedFn } from "mobx-utils"; -// -import { generateCalendarData, getWeekNumberOfDate } from "../helpers/calendar.helper"; -import { ICalendarPayload, ICalendarWeek } from "../types"; +// plane imports +import { ICalendarPayload, ICalendarWeek } from "@plane/types"; +import { generateCalendarData, getWeekNumberOfDate } from "@plane/utils"; export interface ICalendarStore { calendarFilters: { diff --git a/yarn.lock b/yarn.lock index e1e108a5d9..a49fb8aa0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6000,17 +6000,9 @@ bowser@^2.11.0: resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f" integrity sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA== -brace-expansion@^1.1.7: - version "1.1.12" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" - integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: +brace-expansion@2.0.2, brace-expansion@^1.1.7, brace-expansion@^2.0.1: version "2.0.2" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== dependencies: balanced-match "^1.0.0" @@ -10620,9 +10612,9 @@ next-themes@^0.2.1: resolved "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz#0c9f128e847979daf6c67f70b38e6b6567856e45" integrity sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A== -next@^14.2.29: +next@14.2.30: version "14.2.30" - resolved "https://registry.npmjs.org/next/-/next-14.2.30.tgz#7b7288859794574067f65d6e2ea98822f2173006" + resolved "https://registry.yarnpkg.com/next/-/next-14.2.30.tgz#7b7288859794574067f65d6e2ea98822f2173006" integrity sha512-+COdu6HQrHHFQ1S/8BBsCag61jZacmvbuL2avHvQFbWa2Ox7bE+d8FyNgxRLjXQ5wtPyQwEmk85js/AuaG2Sbg== dependencies: "@next/env" "14.2.30"