Skip to content

Commit

Permalink
Merge pull request #175 from Rushikesh-Sonawane99/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-1650 chore: Resolved tour guide step-5 issue for mobile view
  • Loading branch information
itsvick authored Aug 22, 2024
2 parents d53d55a + 4938756 commit 70c392a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/AttendanceStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function AttendanceStatus({
learnerAttendanceData,
onDateSelection,
onUpdate,
}: AttendanceStatusProps) {
}: Readonly<AttendanceStatusProps>) {
const { t } = useTranslation();
const determinePathColor = useDeterminePathColor();
const selectedDate = shortDateFormat(onDateSelection);
Expand Down
11 changes: 6 additions & 5 deletions src/components/GuideTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const GuideTour: React.FC<GuideTourProps> = ({ toggleDrawer }) => {
}
};

const handleJoyrideCallback = (data: JoyrideCallbackData) => {
const handleJoyrideCallback = async (data: JoyrideCallbackData) => {
const { action, index, type, status } = data;

if (status === 'finished' || status === 'skipped') {
Expand All @@ -54,10 +54,11 @@ const GuideTour: React.FC<GuideTourProps> = ({ toggleDrawer }) => {
} else if (type === 'step:after' || type === 'tour:start') {
if (action === 'next') {
if (stepIndex === 4) {
toggleDrawer(true)();
setTimeout(() => {
setStepIndex((prevIndex) => prevIndex + 1);
}, 0);
await new Promise<void>((resolve) => {
toggleDrawer(true)();
setTimeout(resolve, 645); // Adjust the delay time as needed
});
setStepIndex((prevIndex) => prevIndex + 1);
} else {
setStepIndex((prevIndex) => prevIndex + 1);
}
Expand Down
7 changes: 4 additions & 3 deletions src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
} from '../utils/Interfaces';
import {
accessControl,
dashboardDaysLimit,
eventDaysLimit,
lowLearnerAttendanceLimit,
} from './../../app.config';
Expand Down Expand Up @@ -404,14 +405,14 @@ const Dashboard: React.FC<DashboardProps> = () => {
currentDate.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1);
const weekStartDate = new Date(currentDate.setDate(diffToMonday));
const startDate = new Date(
currentDate.setDate(currentDate.getDate() - 30)
currentDate.setDate(currentDate.getDate() - dashboardDaysLimit)
);
startDate.setHours(0, 0, 0, 0);
const endDate = new Date(weekStartDate);
endDate.setDate(weekStartDate.getDate() + 6);
endDate.setDate(weekStartDate.getDate() + modifyAttendanceLimit);
endDate.setHours(23, 59, 59, 999);
const fromDateFormatted = shortDateFormat(startDate);
const toDateFormatted = shortDateFormat(endDate);
const toDateFormatted = shortDateFormat(new Date());
const attendanceRequest: AttendancePercentageProps = {
limit: 300,
page: 0,
Expand Down

0 comments on commit 70c392a

Please sign in to comment.