diff --git a/apps/app/components/core/calendar-view/calendar.tsx b/apps/app/components/core/calendar-view/calendar.tsx index a9824d004..19a09710a 100644 --- a/apps/app/components/core/calendar-view/calendar.tsx +++ b/apps/app/components/core/calendar-view/calendar.tsx @@ -51,6 +51,7 @@ import { IIssue } from "types"; // constant import { monthOptions, yearOptions } from "constants/calendar"; import modulesService from "services/modules.service"; +import { getStateGroupIcon } from "components/icons"; type Props = { addIssueToDate: (date: string) => void; @@ -62,9 +63,10 @@ interface ICalendarRange { } export const CalendarView: React.FC = ({ addIssueToDate }) => { - const [showWeekEnds, setShowWeekEnds] = useState(false); - const [currentDate, setCurrentDate] = useState(new Date()); - const [isMonthlyView, setIsMonthlyView] = useState(true); + const [showWeekEnds, setShowWeekEnds] = useState(false); + const [currentDate, setCurrentDate] = useState(new Date()); + const [isMonthlyView, setIsMonthlyView] = useState(true); + const [showAllIssues, setShowAllIssues] = useState(false); const router = useRouter(); const { workspaceSlug, projectId, cycleId, moduleId } = router.query; @@ -151,15 +153,15 @@ export const CalendarView: React.FC = ({ addIssueToDate }) => { const currentViewDays = showWeekEnds ? totalDate : onlyWeekDays; const calendarIssues = cycleId - ? cycleCalendarIssues + ? (cycleCalendarIssues as IIssue[]) : moduleId - ? moduleCalendarIssues - : projectCalendarIssues; + ? (moduleCalendarIssues as IIssue[]) + : (projectCalendarIssues as IIssue[]); const currentViewDaysData = currentViewDays.map((date: Date) => { const filterIssue = calendarIssues && calendarIssues.length > 0 - ? (calendarIssues as IIssue[]).filter( + ? calendarIssues.filter( (issue) => issue.target_date && renderDateFormat(issue.target_date) === renderDateFormat(date) ) @@ -324,7 +326,7 @@ export const CalendarView: React.FC = ({ addIssueToDate }) => {
+
{isMonthlyView ? "Monthly" : "Weekly"}
@@ -445,61 +445,87 @@ export const CalendarView: React.FC = ({ addIssueToDate }) => { showWeekEnds ? "grid-cols-7" : "grid-cols-5" } `} > - {currentViewDaysData.map((date, index) => ( - - {(provided, snapshot) => ( -
{ + const totalIssues = date.issues.length; + + return ( + + {(provided) => ( +
- {isMonthlyView && {formatDate(new Date(date.date), "d")}} - {date.issues.length > 0 && - date.issues.map((issue: IIssue, index) => ( - - {(provided, snapshot) => ( -
- - {issue.name} - -
- )} -
- ))} -
- + )} +
- - Add new issue - + +
+ {provided.placeholder}
- {provided.placeholder} -
- )} -
- ))} + )} + + ); + })}
diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index 240368d7f..f063de373 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -426,7 +426,7 @@ export const IssuesView: React.FC = ({ )} {areFiltersApplied && ( -
+
)}