@cuemath/leap 3.5.35 → 3.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/timeline/daily-timeline/daily-timeline-types.js.map +1 -1
- package/dist/features/timeline/daily-timeline/daily-timeline.js +74 -63
- package/dist/features/timeline/daily-timeline/daily-timeline.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js +71 -67
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +56 -52
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-types.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js +97 -94
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-timeline-types.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\nimport { type ITimeLineItem, type ITimelineData } from './api/use-daily-timeline-get';\n\nexport enum NODE_STATE {\n COMPLETED = 'COMPLETED',\n IN_PROGRESS = 'IN_PROGRESS',\n PENDING = 'PENDING',\n NOT_STARTED = 'NOT_STARTED',\n WAIT_FOR_REVIEW = 'WAIT_FOR_REVIEW',\n}\n\nexport enum USER_TYPE {\n TEACHER = 'TEACHER',\n STUDENT = 'STUDENT',\n PARENT = 'PARENT',\n}\n\nexport enum CARD_TYPE {\n CW = 'CW',\n HW = 'HW',\n CIRCLE = 'CIRCLE',\n}\n\nexport interface IDailyTimelineProps {\n userType: USER_TYPE;\n studentId: string;\n courseStreams?: TCourseStream[];\n onPuzzleClick?: (card: ITimeLineItem) => void;\n onReviewClick?: (\n userNodeId: string | null,\n isSatMockTestBlock: boolean,\n userBlockId: string | null,\n ) => void;\n scrollAreaHeight?: string | number;\n}\n\nexport interface IDailyTimelineItemsProps extends IDailyTimelineProps {\n entry: ITimelineData;\n isFirstElement: boolean;\n shouldShowTag: boolean;\n}\n"],"names":["NODE_STATE","USER_TYPE","CARD_TYPE"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,cAAc,eACdA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,kBAAkB,mBALRA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,KAAK,MACLA,EAAA,KAAK,MACLA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"daily-timeline-types.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\nimport { type ITimeLineItem, type ITimelineData } from './api/use-daily-timeline-get';\n\nexport enum NODE_STATE {\n COMPLETED = 'COMPLETED',\n IN_PROGRESS = 'IN_PROGRESS',\n PENDING = 'PENDING',\n NOT_STARTED = 'NOT_STARTED',\n WAIT_FOR_REVIEW = 'WAIT_FOR_REVIEW',\n}\n\nexport enum USER_TYPE {\n TEACHER = 'TEACHER',\n STUDENT = 'STUDENT',\n PARENT = 'PARENT',\n}\n\nexport enum CARD_TYPE {\n CW = 'CW',\n HW = 'HW',\n CIRCLE = 'CIRCLE',\n}\n\nexport interface IDailyTimelineProps {\n userType: USER_TYPE;\n studentId: string;\n courseStreams?: TCourseStream[];\n onPuzzleClick?: (card: ITimeLineItem) => void;\n onReviewClick?: (\n userNodeId: string | null,\n isSatMockTestBlock: boolean,\n userBlockId: string | null,\n ) => void;\n scrollAreaHeight?: string | number;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport interface IDailyTimelineItemsProps extends IDailyTimelineProps {\n entry: ITimelineData;\n isFirstElement: boolean;\n shouldShowTag: boolean;\n}\n"],"names":["NODE_STATE","USER_TYPE","CARD_TYPE"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,cAAc,eACdA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,kBAAkB,mBALRA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,KAAK,MACLA,EAAA,KAAK,MACLA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,99 +1,110 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useDailyTimelineGet as
|
|
4
|
-
import { ScrollWrapper as
|
|
5
|
-
import { USER_TYPE as
|
|
6
|
-
import { INITIAL_PAGE as
|
|
7
|
-
import { getTimezone as
|
|
8
|
-
import { DAILY_TIMELINE_ANALYTICS_EVENTS as
|
|
9
|
-
import
|
|
10
|
-
import { useUIContext as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
17
|
-
({
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as s, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useState as M, useCallback as T, useMemo as F, useEffect as m, Fragment as V } from "react";
|
|
3
|
+
import { useDailyTimelineGet as Y } from "./api/use-daily-timeline-get.js";
|
|
4
|
+
import { ScrollWrapper as j, DailyTimelineContainer as P } from "./daily-timeline-styled.js";
|
|
5
|
+
import { USER_TYPE as k, CARD_TYPE as z } from "./daily-timeline-types.js";
|
|
6
|
+
import { INITIAL_PAGE as G } from "./comps/constants.js";
|
|
7
|
+
import { getTimezone as O } from "../../../helpers/date-time.js";
|
|
8
|
+
import { DAILY_TIMELINE_ANALYTICS_EVENTS as L } from "./daily-timeline-events.js";
|
|
9
|
+
import U from "./daily-timeline-view.js";
|
|
10
|
+
import { useUIContext as W } from "../../ui/context/context.js";
|
|
11
|
+
import b from "../../hooks/use-previous.js";
|
|
12
|
+
import X from "../../ui/error/error.js";
|
|
13
|
+
import q from "../../ui/layout/flex-view.js";
|
|
14
|
+
import B from "../../ui/intersection-loader/intersection-loader.js";
|
|
15
|
+
import H from "../../ui/loader/app-loader/app-loader.js";
|
|
16
|
+
const N = A(
|
|
17
|
+
({
|
|
18
|
+
userType: g,
|
|
19
|
+
studentId: i,
|
|
20
|
+
courseStreams: f,
|
|
21
|
+
onPuzzleClick: v,
|
|
22
|
+
onReviewClick: x,
|
|
23
|
+
scrollAreaHeight: y,
|
|
24
|
+
onAPIComplete: l
|
|
25
|
+
}) => {
|
|
26
|
+
const [c, _] = M([]), [p, S] = M(!1), { onEvent: t } = W(), {
|
|
27
|
+
get: d,
|
|
20
28
|
data: e,
|
|
21
|
-
isProcessingFailed:
|
|
22
|
-
isProcessing:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
isProcessingFailed: E,
|
|
30
|
+
isProcessing: I,
|
|
31
|
+
isProcessed: h
|
|
32
|
+
} = Y(i), C = b(e == null ? void 0 : e.curr_page), a = T(
|
|
33
|
+
(r = G, o = !1) => {
|
|
34
|
+
o && S(!0), d(i, {
|
|
26
35
|
page: r,
|
|
27
|
-
timezone:
|
|
28
|
-
course_stream:
|
|
36
|
+
timezone: O(),
|
|
37
|
+
course_stream: g === k.TEACHER ? f : []
|
|
29
38
|
});
|
|
30
39
|
},
|
|
31
|
-
[
|
|
32
|
-
),
|
|
40
|
+
[d, i, g, f]
|
|
41
|
+
), $ = F(() => {
|
|
33
42
|
const r = /* @__PURE__ */ new Set();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
c.forEach((n) => {
|
|
44
|
+
n.daily_logs && n.daily_logs.forEach((u) => {
|
|
45
|
+
u.course_stream && u.course_stream !== z.CIRCLE && r.add(u.course_stream);
|
|
37
46
|
});
|
|
38
47
|
});
|
|
39
48
|
const o = new Set(
|
|
40
|
-
(
|
|
49
|
+
(f || []).filter((n) => String(n) !== z.CIRCLE)
|
|
41
50
|
);
|
|
42
|
-
return o.size > 1 || r.size > 1 || o.size > 0 && r.size > 0 && (o.size !== r.size || !Array.from(o).every((
|
|
43
|
-
}, [
|
|
44
|
-
e != null && e.next_page && !
|
|
51
|
+
return o.size > 1 || r.size > 1 || o.size > 0 && r.size > 0 && (o.size !== r.size || !Array.from(o).every((n) => r.has(n)));
|
|
52
|
+
}, [c, f]), w = T(() => {
|
|
53
|
+
e != null && e.next_page && !p && (a(e.next_page, !0), t(L.TIMELINE_SCROLLED, {
|
|
45
54
|
student_id: i
|
|
46
55
|
}));
|
|
47
|
-
}, [e, i, t,
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
return
|
|
51
|
-
e && (e.curr_page === 1 ?
|
|
52
|
-
}, [e, C]),
|
|
53
|
-
t(
|
|
56
|
+
}, [e, i, t, p, a]), D = T(() => {
|
|
57
|
+
a(1, !1), _([]);
|
|
58
|
+
}, [a]);
|
|
59
|
+
return m(() => {
|
|
60
|
+
e && (e.curr_page === 1 ? _((e == null ? void 0 : e.user_logs) ?? []) : e.curr_page && C !== e.curr_page && (_((r) => [...r, ...e.user_logs ?? []]), S(!1)));
|
|
61
|
+
}, [e, C]), m(() => {
|
|
62
|
+
t(L.TIMELINE_VIEWED, {
|
|
54
63
|
student_id: i
|
|
55
64
|
});
|
|
56
|
-
}, [i, t]),
|
|
57
|
-
t(
|
|
65
|
+
}, [i, t]), m(() => () => {
|
|
66
|
+
t(L.TIMELINE_CLOSED, {
|
|
58
67
|
student_id: i
|
|
59
68
|
});
|
|
60
|
-
}, [i, t]),
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
|
|
69
|
+
}, [i, t]), m(() => {
|
|
70
|
+
a(1, !1);
|
|
71
|
+
}, [a]), m(() => {
|
|
72
|
+
(h || E) && (l == null || l(!!(h && !E)));
|
|
73
|
+
}, [h, E, l]), E ? /* @__PURE__ */ s(X, { height: y ?? "100vh", onTryAgain: D }) : I && !c.length ? /* @__PURE__ */ s(
|
|
74
|
+
q,
|
|
64
75
|
{
|
|
65
76
|
$alignItems: "center",
|
|
66
77
|
$justifyContent: "center",
|
|
67
|
-
$height:
|
|
68
|
-
children: /* @__PURE__ */ s(
|
|
78
|
+
$height: y || "100vh",
|
|
79
|
+
children: /* @__PURE__ */ s(H, { width: "100%", height: "100%" })
|
|
69
80
|
}
|
|
70
|
-
) : /* @__PURE__ */ s(
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
) : /* @__PURE__ */ s(j, { $alignItems: "center", $gapX: 1, children: /* @__PURE__ */ R(P, { children: [
|
|
82
|
+
c.map((r, o) => /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(
|
|
83
|
+
U,
|
|
73
84
|
{
|
|
74
85
|
entry: r,
|
|
75
86
|
isFirstElement: o === 0,
|
|
76
|
-
shouldShowTag:
|
|
77
|
-
onPuzzleClick:
|
|
78
|
-
onReviewClick:
|
|
79
|
-
userType:
|
|
87
|
+
shouldShowTag: $,
|
|
88
|
+
onPuzzleClick: v,
|
|
89
|
+
onReviewClick: x,
|
|
90
|
+
userType: g,
|
|
80
91
|
studentId: i
|
|
81
92
|
}
|
|
82
93
|
) }, `timeline-entry-${o}`)),
|
|
83
94
|
/* @__PURE__ */ s(
|
|
84
|
-
|
|
95
|
+
B,
|
|
85
96
|
{
|
|
86
|
-
onLoadMore:
|
|
87
|
-
isLoading:
|
|
97
|
+
onLoadMore: w,
|
|
98
|
+
isLoading: p,
|
|
88
99
|
hasMore: !!(e != null && e.next_page)
|
|
89
100
|
}
|
|
90
101
|
)
|
|
91
102
|
] }) });
|
|
92
103
|
}
|
|
93
104
|
);
|
|
94
|
-
|
|
95
|
-
const
|
|
105
|
+
N.displayName = "DailyTimeline";
|
|
106
|
+
const ce = N;
|
|
96
107
|
export {
|
|
97
|
-
|
|
108
|
+
ce as default
|
|
98
109
|
};
|
|
99
110
|
//# sourceMappingURL=daily-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({ userType, studentId, courseStreams, onPuzzleClick, onReviewClick, scrollAreaHeight }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n } = useDailyTimelineGet(studentId);\n\n const prevCurrentPage = usePrevious(timelineData?.curr_page);\n\n const fetchTimeline = useCallback(\n (page = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n timezone: getTimezone(),\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== CARD_TYPE.CIRCLE) {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== CARD_TYPE.CIRCLE),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\n\n const handleLoadMore = useCallback(() => {\n if (timelineData?.next_page && !isLoadingMore) {\n fetchTimeline(timelineData.next_page, true);\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_SCROLLED, {\n student_id: studentId,\n });\n }\n }, [timelineData, studentId, trackEvent, isLoadingMore, fetchTimeline]);\n\n const onTryAgain = useCallback(() => {\n fetchTimeline(1, false);\n setAllTimelineData([]);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(timelineData?.user_logs ?? []);\n } else if (timelineData.curr_page && prevCurrentPage !== timelineData.curr_page) {\n setAllTimelineData(prev => [...prev, ...(timelineData.user_logs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, prevCurrentPage]);\n\n useEffect(() => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEWED, {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_CLOSED, {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n if (isProcessingFailed) {\n return <Error height={scrollAreaHeight ?? '100vh'} onTryAgain={onTryAgain} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height={scrollAreaHeight || '100vh'}\n >\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper $alignItems=\"center\" $gapX={1}>\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => (\n <Fragment key={`timeline-entry-${index}`}>\n <DailyTimelineView\n entry={entry}\n isFirstElement={index === 0}\n shouldShowTag={shouldShowTag}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n userType={userType}\n studentId={studentId}\n />\n </Fragment>\n ))}\n <IntersectionLoader\n onLoadMore={handleLoadMore}\n isLoading={isLoadingMore}\n hasMore={!!timelineData?.next_page}\n />\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzleClick","onReviewClick","scrollAreaHeight","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","prevCurrentPage","usePrevious","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","CARD_TYPE","courseStreamsSet","stream","handleLoadMore","DAILY_TIMELINE_ANALYTICS_EVENTS","onTryAgain","useEffect","prev","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","js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G,EAAK;AAAA,IAAA,GACrB,CAACA,CAAa,CAAC,GAEdL,IACM,gBAAAyB,EAAAC,GAAA,EAAM,QAAQpC,KAAoB,SAAS,YAAAgC,EAAwB,CAAA,IAGzErB,KAAgB,CAACV,EAAgB,SAEjC,gBAAAkC;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,SAASrC,KAAoB;AAAA,QAE7B,UAAC,gBAAAmC,EAAAG,GAAA,EAAU,OAAM,QAAO,QAAO,QAAO;AAAA,MAAA;AAAA,IAAA,IAM1C,gBAAAH,EAACI,GAAA,EAAqB,aAAY,UAAS,OAAO,GAChD,UAAA,gBAAAC,EAACC,GAAA,EACE,UAAA;AAAA,MAAAxC,EAAgB,IAAI,CAACwB,GAAOiB,wBAC1BC,GACC,EAAA,UAAA,gBAAAR;AAAA,QAACS;AAAA,QAAA;AAAA,UACC,OAAAnB;AAAA,UACA,gBAAgBiB,MAAU;AAAA,UAC1B,eAAApB;AAAA,UACA,eAAAxB;AAAA,UACA,eAAAC;AAAA,UACA,UAAAJ;AAAA,UACA,WAAAC;AAAA,QAAA;AAAA,MARW,EAAA,GAAA,kBAAkB8C,CAAK,EAUtC,CACD;AAAA,MACD,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,YAAYf;AAAA,UACZ,WAAW1B;AAAA,UACX,SAAS,CAAC,EAACK,KAAA,QAAAA,EAAc;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEAhB,EAAc,cAAc;AAE5B,MAAAqD,KAAerD;"}
|
|
1
|
+
{"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({\n userType,\n studentId,\n courseStreams,\n onPuzzleClick,\n onReviewClick,\n scrollAreaHeight,\n onAPIComplete,\n }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n } = useDailyTimelineGet(studentId);\n\n const prevCurrentPage = usePrevious(timelineData?.curr_page);\n\n const fetchTimeline = useCallback(\n (page = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n timezone: getTimezone(),\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== CARD_TYPE.CIRCLE) {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== CARD_TYPE.CIRCLE),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\n\n const handleLoadMore = useCallback(() => {\n if (timelineData?.next_page && !isLoadingMore) {\n fetchTimeline(timelineData.next_page, true);\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_SCROLLED, {\n student_id: studentId,\n });\n }\n }, [timelineData, studentId, trackEvent, isLoadingMore, fetchTimeline]);\n\n const onTryAgain = useCallback(() => {\n fetchTimeline(1, false);\n setAllTimelineData([]);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(timelineData?.user_logs ?? []);\n } else if (timelineData.curr_page && prevCurrentPage !== timelineData.curr_page) {\n setAllTimelineData(prev => [...prev, ...(timelineData.user_logs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, prevCurrentPage]);\n\n useEffect(() => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEWED, {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_CLOSED, {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed ? true : false);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessingFailed) {\n return <Error height={scrollAreaHeight ?? '100vh'} onTryAgain={onTryAgain} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height={scrollAreaHeight || '100vh'}\n >\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper $alignItems=\"center\" $gapX={1}>\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => (\n <Fragment key={`timeline-entry-${index}`}>\n <DailyTimelineView\n entry={entry}\n isFirstElement={index === 0}\n shouldShowTag={shouldShowTag}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n userType={userType}\n studentId={studentId}\n />\n </Fragment>\n ))}\n <IntersectionLoader\n onLoadMore={handleLoadMore}\n isLoading={isLoadingMore}\n hasMore={!!timelineData?.next_page}\n />\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzleClick","onReviewClick","scrollAreaHeight","onAPIComplete","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","isProcessed","useDailyTimelineGet","prevCurrentPage","usePrevious","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","CARD_TYPE","courseStreamsSet","stream","handleLoadMore","DAILY_TIMELINE_ANALYTICS_EVENTS","onTryAgain","useEffect","prev","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","Fragment","DailyTimelineView","IntersectionLoader","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,MACI;AACJ,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EA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AAmC;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,SAASvC,KAAoB;AAAA,QAE7B,UAAC,gBAAAqC,EAAAG,GAAA,EAAU,OAAM,QAAO,QAAO,QAAO;AAAA,MAAA;AAAA,IAAA,IAM1C,gBAAAH,EAACI,GAAA,EAAqB,aAAY,UAAS,OAAO,GAChD,UAAA,gBAAAC,EAACC,GAAA,EACE,UAAA;AAAA,MAAAzC,EAAgB,IAAI,CAACyB,GAAOiB,wBAC1BC,GACC,EAAA,UAAA,gBAAAR;AAAA,QAACS;AAAA,QAAA;AAAA,UACC,OAAAnB;AAAA,UACA,gBAAgBiB,MAAU;AAAA,UAC1B,eAAApB;AAAA,UACA,eAAA1B;AAAA,UACA,eAAAC;AAAA,UACA,UAAAJ;AAAA,UACA,WAAAC;AAAA,QAAA;AAAA,MARW,EAAA,GAAA,kBAAkBgD,CAAK,EAUtC,CACD;AAAA,MACD,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,YAAYf;AAAA,UACZ,WAAW3B;AAAA,UACX,SAAS,CAAC,EAACK,KAAA,QAAAA,EAAc;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEAjB,EAAc,cAAc;AAE5B,MAAAuD,KAAevD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report-types.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report-types.ts"],"sourcesContent":["import { type NODE_TYPES } from '../../../../types/models/worksheet';\nimport { type TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport { type THueNames } from '../../../ui/types';\nimport { type NODE_STATE } from '../../daily-timeline/daily-timeline-types';\nimport { type IUserMilestone } from '../monthly-timeline-types';\n\nexport enum CARD_TYPE {\n 'general' = 'general',\n 'legacy' = 'legacy',\n 'diagnostic' = 'diagnostic',\n 'remedial' = 'remedial',\n 'recap' = 'recap',\n 'learn' = 'learn',\n 'extra_practice' = 'extra_practice',\n 'practice' = 'practice',\n 'test' = 'test',\n 'revision' = 'revision',\n 'advanced' = 'advanced',\n 'challenge' = 'challenge',\n 'video' = 'video',\n 'simulation' = 'simulation',\n 'note' = 'note',\n 'subjective' = 'subjective',\n 'deck' = 'deck',\n 'puzzle' = 'puzzle',\n 'test_series' = 'test_series',\n 'activity' = 'activity',\n 'project' = 'project',\n 'certificate' = 'certificate',\n 'ppt_viva' = 'ppt_viva',\n 'ppt_content' = 'ppt_content',\n 'wb_activity' = 'wb_activity',\n 'smart_practice' = 'smart_practice',\n 'exit_ticket' = 'exit_ticket',\n 'monthly_mastery_test' = 'monthly_mastery_test',\n 'supplementary_mastery_test' = 'supplementary_mastery_test',\n 'trial_diagnostic' = 'trial_diagnostic',\n 'trial_basic' = 'trial_basic',\n 'trial_intermediate' = 'trial_intermediate',\n 'trial_advanced' = 'trial_advanced',\n 'sat_mock_test' = 'sat_mock_test',\n 'pdf' = 'pdf',\n}\n\nexport type ActivitiesByCardType = Partial<{\n [K in CARD_TYPE]: IMonthlyActivity[];\n}>;\n\nexport type TFeedback = 'positive' | 'negative';\n\nexport interface IMonthlyReportResponse {\n course_stream: TCourseStream;\n id: string;\n created_on_ts: number;\n is_deleted: boolean;\n report_date: string;\n report_date_ts: number;\n report_month: number;\n report_year: number;\n student_course_ids: string[];\n user_id: string;\n updated_on_ts: number;\n calendar_data: TCalendarData | null;\n progress_data: {\n user_milestones: IUserMilestone[];\n activities: ActivitiesByCardType;\n user_achievements: IAchievementAsset[];\n };\n feedback: TFeedback | null;\n}\n\nexport interface IProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyActivity {\n id: string;\n node_type: NODE_TYPES;\n card_type: CARD_TYPE;\n card_header: CARD_TYPE | null;\n feedback_comments: string | null;\n state: NODE_STATE;\n title?: string;\n accuracy?: number | null;\n subtext?: string | null;\n is_timed?: boolean;\n image_hue?: THueNames;\n image_url?: string;\n sat_max_score?: number | null;\n sat_total_score?: number | null;\n item_ref?: string | null;\n thumbnail_url?: string;\n user_attempt_id?: string | null;\n tip: string | null;\n user_block_id: string | null;\n user_chapter_id: string | null;\n user_node_id: string | null;\n}\n\nexport interface IAchievementAsset {\n asset_id: string;\n url: string;\n}\n\nexport interface IMonthlyReportProps {\n reportId: string;\n studentName: string;\n onPuzzleClick?: (params: {\n item_ref: IMonthlyActivity['item_ref'];\n feedback_comments: IMonthlyActivity['feedback_comments'];\n image_hue: IMonthlyActivity['image_hue'];\n title: IMonthlyActivity['title'];\n tip: IMonthlyActivity['tip'];\n }) => void;\n showSnackbar?: (params: { type: 'error' | 'info'; message: string; bgColor: string }) => void;\n onFeedback?: (feedback: TFeedback, studentCourseId: string) => void;\n}\n\nexport type TClassType = 'REGULAR' | 'EXTRA';\nexport interface IClassEvent {\n class_type: TClassType;\n is_paused: boolean;\n is_present: boolean;\n status: string;\n tag: string | null;\n theme: string;\n time: number;\n}\n\nexport type TCalendarData = Record<string, IClassEvent[]>;\n"],"names":["CARD_TYPE"],"mappings":"AAMY,IAAAA,sBAAAA,OACVA,EAAA,UAAY,WACZA,EAAA,SAAW,UACXA,EAAA,aAAe,cACfA,EAAA,WAAa,YACbA,EAAA,QAAU,SACVA,EAAA,QAAU,SACVA,EAAA,iBAAmB,kBACnBA,EAAA,WAAa,YACbA,EAAA,OAAS,QACTA,EAAA,WAAa,YACbA,EAAA,WAAa,YACbA,EAAA,YAAc,aACdA,EAAA,QAAU,SACVA,EAAA,aAAe,cACfA,EAAA,OAAS,QACTA,EAAA,aAAe,cACfA,EAAA,OAAS,QACTA,EAAA,SAAW,UACXA,EAAA,cAAgB,eAChBA,EAAA,WAAa,YACbA,EAAA,UAAY,WACZA,EAAA,cAAgB,eAChBA,EAAA,WAAa,YACbA,EAAA,cAAgB,eAChBA,EAAA,cAAgB,eAChBA,EAAA,iBAAmB,kBACnBA,EAAA,cAAgB,eAChBA,EAAA,uBAAyB,wBACzBA,EAAA,6BAA+B,8BAC/BA,EAAA,mBAAqB,oBACrBA,EAAA,cAAgB,eAChBA,EAAA,qBAAuB,sBACvBA,EAAA,iBAAmB,kBACnBA,EAAA,gBAAkB,iBAClBA,EAAA,MAAQ,OAnCEA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"monthly-report-types.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report-types.ts"],"sourcesContent":["import { type NODE_TYPES } from '../../../../types/models/worksheet';\nimport { type TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport { type THueNames } from '../../../ui/types';\nimport { type NODE_STATE } from '../../daily-timeline/daily-timeline-types';\nimport { type IUserMilestone } from '../monthly-timeline-types';\n\nexport enum CARD_TYPE {\n 'general' = 'general',\n 'legacy' = 'legacy',\n 'diagnostic' = 'diagnostic',\n 'remedial' = 'remedial',\n 'recap' = 'recap',\n 'learn' = 'learn',\n 'extra_practice' = 'extra_practice',\n 'practice' = 'practice',\n 'test' = 'test',\n 'revision' = 'revision',\n 'advanced' = 'advanced',\n 'challenge' = 'challenge',\n 'video' = 'video',\n 'simulation' = 'simulation',\n 'note' = 'note',\n 'subjective' = 'subjective',\n 'deck' = 'deck',\n 'puzzle' = 'puzzle',\n 'test_series' = 'test_series',\n 'activity' = 'activity',\n 'project' = 'project',\n 'certificate' = 'certificate',\n 'ppt_viva' = 'ppt_viva',\n 'ppt_content' = 'ppt_content',\n 'wb_activity' = 'wb_activity',\n 'smart_practice' = 'smart_practice',\n 'exit_ticket' = 'exit_ticket',\n 'monthly_mastery_test' = 'monthly_mastery_test',\n 'supplementary_mastery_test' = 'supplementary_mastery_test',\n 'trial_diagnostic' = 'trial_diagnostic',\n 'trial_basic' = 'trial_basic',\n 'trial_intermediate' = 'trial_intermediate',\n 'trial_advanced' = 'trial_advanced',\n 'sat_mock_test' = 'sat_mock_test',\n 'pdf' = 'pdf',\n}\n\nexport type ActivitiesByCardType = Partial<{\n [K in CARD_TYPE]: IMonthlyActivity[];\n}>;\n\nexport type TFeedback = 'positive' | 'negative';\n\nexport interface IMonthlyReportResponse {\n course_stream: TCourseStream;\n id: string;\n created_on_ts: number;\n is_deleted: boolean;\n report_date: string;\n report_date_ts: number;\n report_month: number;\n report_year: number;\n student_course_ids: string[];\n user_id: string;\n updated_on_ts: number;\n calendar_data: TCalendarData | null;\n progress_data: {\n user_milestones: IUserMilestone[];\n activities: ActivitiesByCardType;\n user_achievements: IAchievementAsset[];\n };\n feedback: TFeedback | null;\n}\n\nexport interface IProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyActivity {\n id: string;\n node_type: NODE_TYPES;\n card_type: CARD_TYPE;\n card_header: CARD_TYPE | null;\n feedback_comments: string | null;\n state: NODE_STATE;\n title?: string;\n accuracy?: number | null;\n subtext?: string | null;\n is_timed?: boolean;\n image_hue?: THueNames;\n image_url?: string;\n sat_max_score?: number | null;\n sat_total_score?: number | null;\n item_ref?: string | null;\n thumbnail_url?: string;\n user_attempt_id?: string | null;\n tip: string | null;\n user_block_id: string | null;\n user_chapter_id: string | null;\n user_node_id: string | null;\n}\n\nexport interface IAchievementAsset {\n asset_id: string;\n url: string;\n}\n\nexport interface IMonthlyReportProps {\n reportId: string;\n studentName: string;\n onPuzzleClick?: (params: {\n item_ref: IMonthlyActivity['item_ref'];\n feedback_comments: IMonthlyActivity['feedback_comments'];\n image_hue: IMonthlyActivity['image_hue'];\n title: IMonthlyActivity['title'];\n tip: IMonthlyActivity['tip'];\n }) => void;\n showSnackbar?: (params: { type: 'error' | 'info'; message: string; bgColor: string }) => void;\n onFeedback?: (feedback: TFeedback, studentCourseId: string) => void;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport type TClassType = 'REGULAR' | 'EXTRA';\nexport interface IClassEvent {\n class_type: TClassType;\n is_paused: boolean;\n is_present: boolean;\n status: string;\n tag: string | null;\n theme: string;\n time: number;\n}\n\nexport type TCalendarData = Record<string, IClassEvent[]>;\n"],"names":["CARD_TYPE"],"mappings":"AAMY,IAAAA,sBAAAA,OACVA,EAAA,UAAY,WACZA,EAAA,SAAW,UACXA,EAAA,aAAe,cACfA,EAAA,WAAa,YACbA,EAAA,QAAU,SACVA,EAAA,QAAU,SACVA,EAAA,iBAAmB,kBACnBA,EAAA,WAAa,YACbA,EAAA,OAAS,QACTA,EAAA,WAAa,YACbA,EAAA,WAAa,YACbA,EAAA,YAAc,aACdA,EAAA,QAAU,SACVA,EAAA,aAAe,cACfA,EAAA,OAAS,QACTA,EAAA,aAAe,cACfA,EAAA,OAAS,QACTA,EAAA,SAAW,UACXA,EAAA,cAAgB,eAChBA,EAAA,WAAa,YACbA,EAAA,UAAY,WACZA,EAAA,cAAgB,eAChBA,EAAA,WAAa,YACbA,EAAA,cAAgB,eAChBA,EAAA,cAAgB,eAChBA,EAAA,iBAAmB,kBACnBA,EAAA,cAAgB,eAChBA,EAAA,uBAAyB,wBACzBA,EAAA,6BAA+B,8BAC/BA,EAAA,mBAAqB,oBACrBA,EAAA,cAAgB,eAChBA,EAAA,qBAAuB,sBACvBA,EAAA,iBAAmB,kBACnBA,EAAA,gBAAkB,iBAClBA,EAAA,MAAQ,OAnCEA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,79 +1,83 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { monthlyReportGet as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { MonthlyReportContainer as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { IS_APP_RUNNING_IN_RN as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
studentName:
|
|
17
|
-
reportId:
|
|
18
|
-
onPuzzleClick:
|
|
19
|
-
showSnackbar:
|
|
20
|
-
onFeedback:
|
|
1
|
+
import { jsx as t, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { memo as b, useCallback as N, useEffect as d } from "react";
|
|
3
|
+
import { monthlyReportGet as Y } from "./api/use-monthly-report-api.js";
|
|
4
|
+
import w from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import C from "../../../ui/error/error.js";
|
|
6
|
+
import { MonthlyReportContainer as E } from "./monthly-report-styled.js";
|
|
7
|
+
import G from "./comps/goals/goals.js";
|
|
8
|
+
import A from "./comps/activities/activities.js";
|
|
9
|
+
import F from "../../../ui/layout/flex-view.js";
|
|
10
|
+
import T from "./comps/attendance/attendance.js";
|
|
11
|
+
import U from "./comps/feedback/feedback.js";
|
|
12
|
+
import V from "./comps/achievements/achievements.js";
|
|
13
|
+
import { IS_APP_RUNNING_IN_RN as X } from "../../../../constants/app-config.js";
|
|
14
|
+
import q from "../../../ui/separator/separator.js";
|
|
15
|
+
const z = ({
|
|
16
|
+
studentName: u,
|
|
17
|
+
reportId: r,
|
|
18
|
+
onPuzzleClick: R,
|
|
19
|
+
showSnackbar: p,
|
|
20
|
+
onFeedback: j,
|
|
21
|
+
onAPIComplete: o
|
|
21
22
|
}) => {
|
|
22
23
|
const {
|
|
23
|
-
get:
|
|
24
|
-
data:
|
|
25
|
-
isProcessing:
|
|
26
|
-
isProcessingFailed:
|
|
27
|
-
isStale:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
get: g,
|
|
25
|
+
data: _,
|
|
26
|
+
isProcessing: a,
|
|
27
|
+
isProcessingFailed: s,
|
|
28
|
+
isStale: M,
|
|
29
|
+
isProcessed: n
|
|
30
|
+
} = Y(r), {
|
|
31
|
+
progress_data: $,
|
|
32
|
+
calendar_data: y,
|
|
33
|
+
report_month: i,
|
|
34
|
+
report_year: c,
|
|
35
|
+
feedback: k,
|
|
36
|
+
student_course_ids: m
|
|
37
|
+
} = _ || {}, {
|
|
38
|
+
user_milestones: D,
|
|
39
|
+
activities: v,
|
|
40
|
+
user_achievements: x
|
|
41
|
+
} = $ || {}, e = N(() => {
|
|
42
|
+
g(r);
|
|
43
|
+
}, [g, r]);
|
|
44
|
+
if (d(() => {
|
|
43
45
|
e();
|
|
44
|
-
}, [e]),
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return /* @__PURE__ */ t(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
}, [e]), d(() => {
|
|
47
|
+
M && !a && e();
|
|
48
|
+
}, [M, a, e]), d(() => {
|
|
49
|
+
(n || s) && (o == null || o(!!(n && !s)));
|
|
50
|
+
}, [n, s, o]), a && !_)
|
|
51
|
+
return /* @__PURE__ */ t(F, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(w, { height: "100dvh" }) });
|
|
52
|
+
if (s)
|
|
53
|
+
return /* @__PURE__ */ t(F, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(C, { onTryAgain: e }) });
|
|
54
|
+
const h = m == null ? void 0 : m[0], l = /* @__PURE__ */ new Date(), f = l.getMonth(), L = f === 0 ? l.getFullYear() - 1 : l.getFullYear();
|
|
55
|
+
return /* @__PURE__ */ S(E, { children: [
|
|
56
|
+
D && /* @__PURE__ */ t(G, { milestones: D, isExpended: !0 }),
|
|
57
|
+
v && /* @__PURE__ */ t(A, { activities: v, onPuzzleClick: R }),
|
|
58
|
+
x && /* @__PURE__ */ t(V, { achievements: x, studentName: u }),
|
|
59
|
+
y && i && c && /* @__PURE__ */ t(
|
|
60
|
+
T,
|
|
57
61
|
{
|
|
58
|
-
calendarData:
|
|
59
|
-
reportMonth:
|
|
60
|
-
reportYear:
|
|
61
|
-
onDateClick:
|
|
62
|
+
calendarData: y,
|
|
63
|
+
reportMonth: i,
|
|
64
|
+
reportYear: c,
|
|
65
|
+
onDateClick: p
|
|
62
66
|
}
|
|
63
67
|
),
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
X && !k && h && (i === (f === 0 ? 12 : f) && c === L) && h ? /* @__PURE__ */ t(
|
|
69
|
+
U,
|
|
66
70
|
{
|
|
67
|
-
reportId:
|
|
68
|
-
studentName:
|
|
69
|
-
onFeedback:
|
|
70
|
-
studentCourseId:
|
|
71
|
-
showSnackbar:
|
|
71
|
+
reportId: r,
|
|
72
|
+
studentName: u,
|
|
73
|
+
onFeedback: j,
|
|
74
|
+
studentCourseId: h,
|
|
75
|
+
showSnackbar: p
|
|
72
76
|
}
|
|
73
|
-
) : /* @__PURE__ */ t(
|
|
77
|
+
) : /* @__PURE__ */ t(q, { heightX: 1 })
|
|
74
78
|
] });
|
|
75
|
-
},
|
|
79
|
+
}, ct = b(z);
|
|
76
80
|
export {
|
|
77
|
-
|
|
81
|
+
ct as default
|
|
78
82
|
};
|
|
79
83
|
//# sourceMappingURL=monthly-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\nimport Separator from '../../../ui/separator/separator';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = monthlyReportGet(reportId);\n\n const {\n progress_data: progressData,\n calendar_data: calendarData,\n report_month: month,\n report_year: year,\n feedback,\n student_course_ids: studentCourseIds,\n } = reportData || {};\n\n const {\n user_milestones: userMilestones,\n activities,\n user_achievements: userAchievements,\n } = progressData || {};\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, [isStale, isProcessing, fetchData]);\n\n if (isProcessing && !reportData) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <AppLoader height=\"100dvh\" />\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n const firstStudentCourseId = studentCourseIds?.[0];\n\n // Check if the report is for the last month (previous month)\n const currentDate = new Date();\n const lastMonth = currentDate.getMonth(); // Current month - 1 (getMonth() returns 0-11)\n const lastMonthYear = lastMonth === 0 ? currentDate.getFullYear() - 1 : currentDate.getFullYear();\n const adjustedLastMonth = lastMonth === 0 ? 12 : lastMonth; // Handle January edge case\n const isLastMonth = month === adjustedLastMonth && year === lastMonthYear;\n\n const shouldShowFeedback =\n IS_APP_RUNNING_IN_RN && !feedback && firstStudentCourseId && isLastMonth;\n const hasCalendarData = calendarData && month && year;\n\n return (\n <Styled.MonthlyReportContainer>\n {userMilestones && <Goals milestones={userMilestones} isExpended={true} />}\n\n {activities && <Activities activities={activities} onPuzzleClick={onPuzzleClick} />}\n\n {userAchievements && (\n <Achievements achievements={userAchievements} studentName={studentName} />\n )}\n\n {hasCalendarData && (\n <Attendance\n calendarData={calendarData}\n reportMonth={month}\n reportYear={year}\n onDateClick={showSnackbar}\n />\n )}\n\n {shouldShowFeedback && firstStudentCourseId ? (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={firstStudentCourseId}\n showSnackbar={showSnackbar}\n />\n ) : (\n <Separator heightX={1} />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","getReport","reportData","isProcessing","isProcessingFailed","isStale","monthlyReportGet","progressData","calendarData","month","year","feedback","studentCourseIds","userMilestones","activities","userAchievements","fetchData","useCallback","useEffect","jsx","FlexView","AppLoader","Error","firstStudentCourseId","currentDate","lastMonth","lastMonthYear","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","Separator","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,
|
|
1
|
+
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\nimport Separator from '../../../ui/separator/separator';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n onAPIComplete,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n isProcessed,\n } = monthlyReportGet(reportId);\n\n const {\n progress_data: progressData,\n calendar_data: calendarData,\n report_month: month,\n report_year: year,\n feedback,\n student_course_ids: studentCourseIds,\n } = reportData || {};\n\n const {\n user_milestones: userMilestones,\n activities,\n user_achievements: userAchievements,\n } = progressData || {};\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, [isStale, isProcessing, fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed ? true : false);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing && !reportData) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <AppLoader height=\"100dvh\" />\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n const firstStudentCourseId = studentCourseIds?.[0];\n\n // Check if the report is for the last month (previous month)\n const currentDate = new Date();\n const lastMonth = currentDate.getMonth(); // Current month - 1 (getMonth() returns 0-11)\n const lastMonthYear = lastMonth === 0 ? currentDate.getFullYear() - 1 : currentDate.getFullYear();\n const adjustedLastMonth = lastMonth === 0 ? 12 : lastMonth; // Handle January edge case\n const isLastMonth = month === adjustedLastMonth && year === lastMonthYear;\n\n const shouldShowFeedback =\n IS_APP_RUNNING_IN_RN && !feedback && firstStudentCourseId && isLastMonth;\n const hasCalendarData = calendarData && month && year;\n\n return (\n <Styled.MonthlyReportContainer>\n {userMilestones && <Goals milestones={userMilestones} isExpended={true} />}\n\n {activities && <Activities activities={activities} onPuzzleClick={onPuzzleClick} />}\n\n {userAchievements && (\n <Achievements achievements={userAchievements} studentName={studentName} />\n )}\n\n {hasCalendarData && (\n <Attendance\n calendarData={calendarData}\n reportMonth={month}\n reportYear={year}\n onDateClick={showSnackbar}\n />\n )}\n\n {shouldShowFeedback && firstStudentCourseId ? (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={firstStudentCourseId}\n showSnackbar={showSnackbar}\n />\n ) : (\n <Separator heightX={1} />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","onAPIComplete","getReport","reportData","isProcessing","isProcessingFailed","isStale","isProcessed","monthlyReportGet","progressData","calendarData","month","year","feedback","studentCourseIds","userMilestones","activities","userAchievements","fetchData","useCallback","useEffect","jsx","FlexView","AppLoader","Error","firstStudentCourseId","currentDate","lastMonth","lastMonthYear","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","Separator","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEC,EAAiBX,CAAQ,GAEvB;AAAA,IACJ,eAAeY;AAAA,IACf,eAAeC;AAAA,IACf,cAAcC;AAAA,IACd,a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EAA8B,CAAA;AAAA,IAEhFmB,KACC,gBAAAI,EAACY,GAAa,EAAA,cAAchB,GAAkB,aAAArB,GAA0B;AAAA,IATtDc,KAAgBC,KAASC,KAa3C,gBAAAS;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,cAAAxB;AAAA,QACA,aAAaC;AAAA,QACb,YAAYC;AAAA,QACZ,aAAab;AAAA,MAAA;AAAA,IACf;AAAA,IAnBJoC,KAAwB,CAACtB,KAAYY,MAHnBd,OADMgB,MAAc,IAAI,KAAKA,MACEf,MAASgB,MAyBjCH,IACrB,gBAAAJ;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,UAAAvC;AAAA,QACA,aAAAD;AAAA,QACA,YAAAI;AAAA,QACA,iBAAiByB;AAAA,QACjB,cAAA1B;AAAA,MAAA;AAAA,IAGF,IAAA,gBAAAsB,EAACgB,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,EAE3B,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK5C,CAAa;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline-types.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\n\nexport enum REPORT_TYPE {\n MPR_V1 = 'MPR_V1',\n MPR_V2 = 'MPR_V2',\n PTM = 'PTM',\n}\n\nexport enum EGoalCategory {\n SCHOOL_SUCCESS = 'SCHOOL_SUCCESS',\n ENRICHMENT = 'ENRICHMENT',\n TEST_PREP = 'TEST_PREP',\n}\n\nexport interface IMonthlyTimeline {\n year: number;\n month: number;\n reports: IMonthlyTimelineReport[];\n}\n\nexport interface IMonthlyTimelineReport {\n report_data: TimelineReportData | null;\n course_stream: TCourseStream | null;\n report_type: REPORT_TYPE;\n}\n\nexport interface TimelineReportData {\n id: string | null;\n progress_data: ProgressData | null;\n}\n\nexport interface ProgressData {\n user_milestones: IUserMilestone[];\n}\n\nexport interface IUserMilestone {\n goal_category: EGoalCategory;\n goal_code: string;\n milestone_name: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapters: IUserChapter[];\n user_milestone_id: string;\n}\n\nexport interface IUserChapter {\n chapter_code: string;\n chapter_name: string;\n image_url: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapter_id: string;\n}\n\nexport interface ProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyTimelineProps {\n userType: 'PARENT' | 'TEACHER' | 'STUDENT';\n studentId: string;\n courseStreams?: string[];\n onReportClick?: (reportId: string, reportType: REPORT_TYPE, year: number, month: string) => void;\n scrollAreaHeight?: string | number;\n}\n\nexport interface IMonthlyTimelineViewProps {\n reports: IMonthlyTimelineReport[];\n onReportClick?: IMonthlyTimelineProps['onReportClick'];\n year: number;\n month: number;\n}\n"],"names":["REPORT_TYPE","EGoalCategory"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,MAAM,OAHIA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,aAAa,cACbA,EAAA,YAAY,aAHFA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"monthly-timeline-types.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\n\nexport enum REPORT_TYPE {\n MPR_V1 = 'MPR_V1',\n MPR_V2 = 'MPR_V2',\n PTM = 'PTM',\n}\n\nexport enum EGoalCategory {\n SCHOOL_SUCCESS = 'SCHOOL_SUCCESS',\n ENRICHMENT = 'ENRICHMENT',\n TEST_PREP = 'TEST_PREP',\n}\n\nexport interface IMonthlyTimeline {\n year: number;\n month: number;\n reports: IMonthlyTimelineReport[];\n}\n\nexport interface IMonthlyTimelineReport {\n report_data: TimelineReportData | null;\n course_stream: TCourseStream | null;\n report_type: REPORT_TYPE;\n}\n\nexport interface TimelineReportData {\n id: string | null;\n progress_data: ProgressData | null;\n}\n\nexport interface ProgressData {\n user_milestones: IUserMilestone[];\n}\n\nexport interface IUserMilestone {\n goal_category: EGoalCategory;\n goal_code: string;\n milestone_name: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapters: IUserChapter[];\n user_milestone_id: string;\n}\n\nexport interface IUserChapter {\n chapter_code: string;\n chapter_name: string;\n image_url: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapter_id: string;\n}\n\nexport interface ProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyTimelineProps {\n userType: 'PARENT' | 'TEACHER' | 'STUDENT';\n studentId: string;\n courseStreams?: string[];\n onReportClick?: (reportId: string, reportType: REPORT_TYPE, year: number, month: string) => void;\n scrollAreaHeight?: string | number;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport interface IMonthlyTimelineViewProps {\n reports: IMonthlyTimelineReport[];\n onReportClick?: IMonthlyTimelineProps['onReportClick'];\n year: number;\n month: number;\n}\n"],"names":["REPORT_TYPE","EGoalCategory"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,MAAM,OAHIA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,aAAa,cACbA,EAAA,YAAY,aAHFA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,65 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { monthlyTimelineGet as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsx as r, Fragment as w, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { memo as L, useMemo as R, useCallback as X, useEffect as y } from "react";
|
|
3
|
+
import { monthlyTimelineGet as j } from "./api/use-monthly-timeline-get.js";
|
|
4
|
+
import F from "./monthly-timeline-view.js";
|
|
5
|
+
import M from "../../ui/loader/app-loader/app-loader.js";
|
|
6
6
|
import t from "../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { yearImages as
|
|
11
|
-
import
|
|
12
|
-
import { ImageContainer as
|
|
13
|
-
import { getTimezone as
|
|
14
|
-
import { ILLUSTRATIONS as
|
|
15
|
-
const
|
|
16
|
-
userType:
|
|
17
|
-
studentId:
|
|
18
|
-
courseStreams:
|
|
19
|
-
onReportClick:
|
|
7
|
+
import S from "../../ui/text/text.js";
|
|
8
|
+
import u from "../../ui/image/image.js";
|
|
9
|
+
import l from "../../ui/separator/separator.js";
|
|
10
|
+
import { yearImages as A, monthNames as B } from "./constants.js";
|
|
11
|
+
import I from "../../ui/error/error.js";
|
|
12
|
+
import { ImageContainer as v, DateText as z } from "./monthly-timeline-styled.js";
|
|
13
|
+
import { getTimezone as C } from "../../../helpers/date-time.js";
|
|
14
|
+
import { ILLUSTRATIONS as D } from "../../../assets/illustrations/illustrations.js";
|
|
15
|
+
const K = ({
|
|
16
|
+
userType: f,
|
|
17
|
+
studentId: m,
|
|
18
|
+
courseStreams: g,
|
|
19
|
+
onReportClick: x,
|
|
20
|
+
onAPIComplete: o
|
|
20
21
|
}) => {
|
|
21
|
-
const
|
|
22
|
+
const a = R(
|
|
22
23
|
() => ({
|
|
23
|
-
course_streams:
|
|
24
|
-
timezone:
|
|
24
|
+
course_streams: f === "TEACHER" ? g : [],
|
|
25
|
+
timezone: C()
|
|
25
26
|
}),
|
|
26
|
-
[
|
|
27
|
+
[g, f]
|
|
27
28
|
), {
|
|
28
|
-
get:
|
|
29
|
-
data:
|
|
30
|
-
isProcessing:
|
|
31
|
-
isProcessingFailed:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
get: p,
|
|
30
|
+
data: i = [],
|
|
31
|
+
isProcessing: E,
|
|
32
|
+
isProcessingFailed: n,
|
|
33
|
+
isProcessed: s
|
|
34
|
+
} = j(m, a), h = X(() => {
|
|
35
|
+
p(m, a);
|
|
36
|
+
}, [p, a, m]);
|
|
37
|
+
return y(() => {
|
|
38
|
+
h();
|
|
39
|
+
}, [h]), y(() => {
|
|
40
|
+
(s || n) && (o == null || o(!!(s && !n)));
|
|
41
|
+
}, [s, n, o]), E ? /* @__PURE__ */ r(M, { height: "100dvh" }) : n ? /* @__PURE__ */ r(t, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ r(I, { onTryAgain: h }) }) : /* @__PURE__ */ r(w, { children: (i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ r(t, { $gapX: 2, children: i.map((e, _) => {
|
|
42
|
+
const T = _ === 0, b = e.month === 12, $ = !T && b, d = A[e.year];
|
|
43
|
+
return /* @__PURE__ */ c(t, { $width: "100%", children: [
|
|
44
|
+
!T && !$ && /* @__PURE__ */ r(l, { heightX: 2 }),
|
|
45
|
+
$ && d && /* @__PURE__ */ r(v, { $marginBottom: -122, children: /* @__PURE__ */ r(u, { src: d, alt: e.year.toString() }) }),
|
|
46
|
+
/* @__PURE__ */ c(t, { $gutterX: 1, children: [
|
|
47
|
+
/* @__PURE__ */ r(z, { $renderAs: "ac4", $color: "BLACK_T_60", children: B[e.month - 1] }),
|
|
48
|
+
/* @__PURE__ */ r(l, { heightX: 1 }),
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
F,
|
|
47
51
|
{
|
|
48
|
-
reports:
|
|
49
|
-
month:
|
|
50
|
-
year:
|
|
51
|
-
onReportClick:
|
|
52
|
+
reports: e.reports,
|
|
53
|
+
month: e.month,
|
|
54
|
+
year: e.year,
|
|
55
|
+
onReportClick: x
|
|
52
56
|
}
|
|
53
57
|
)
|
|
54
58
|
] })
|
|
55
|
-
] }, `${
|
|
56
|
-
}) }) : /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
] }, `${e.month}-${e.year}`);
|
|
60
|
+
}) }) : /* @__PURE__ */ c(t, { $justifyContent: "center", $alignItems: "center", $height: "100%", children: [
|
|
61
|
+
/* @__PURE__ */ r(u, { src: D.EMPTY_REPORTS }),
|
|
62
|
+
/* @__PURE__ */ r(l, { heightX: 1.5 }),
|
|
63
|
+
/* @__PURE__ */ r(S, { $renderAs: "ab2", color: "BLACK_T_60", children: "Report will be available next month." })
|
|
60
64
|
] }) });
|
|
61
|
-
},
|
|
65
|
+
}, rr = L(K);
|
|
62
66
|
export {
|
|
63
|
-
|
|
67
|
+
rr as default
|
|
64
68
|
};
|
|
65
69
|
//# sourceMappingURL=monthly-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <>\n {timelineData?.length > 0 ? (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Styled.DateText $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Styled.DateText>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n ) : (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100%\">\n <Image src={ILLUSTRATIONS.EMPTY_REPORTS} />\n <Separator heightX={1.5} />\n <Text $renderAs=\"ab2\" color=\"BLACK_T_60\">\n Report will be available next month.\n </Text>\n </FlexView>\n )}\n </>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","initialQueryParams","useMemo","getTimezone","getTimeline","timelineData","isProcessing","isProcessingFailed","monthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","Fragment","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Styled.DateText","monthNames","MonthlyTimelineView","ILLUSTRATIONS","Text","monthlyTimeline","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAA6C,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAqBC;AAAA,IACzB,OAAO;AAAA,MACL,
|
|
1
|
+
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n onAPIComplete,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n isProcessed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed ? true : false);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <>\n {timelineData?.length > 0 ? (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Styled.DateText $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Styled.DateText>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n ) : (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100%\">\n <Image src={ILLUSTRATIONS.EMPTY_REPORTS} />\n <Separator heightX={1.5} />\n <Text $renderAs=\"ab2\" color=\"BLACK_T_60\">\n Report will be available next month.\n </Text>\n </FlexView>\n )}\n </>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","onAPIComplete","initialQueryParams","useMemo","getTimezone","getTimeline","timelineData","isProcessing","isProcessingFailed","isProcessed","monthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","Fragment","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Styled.DateText","monthNames","MonthlyTimelineView","ILLUSTRATIONS","Text","monthlyTimeline","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAA6C,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAqBC;AAAA,IACzB,OAAO;AAAA,MACL,gBAAgBN,MAAa,YAAYE,IAAgB,CAAC;AAAA,MAC1D,UAAUK,EAAY;AAAA,IAAA;AAAA,IAExB,CAACL,GAAeF,CAAQ;AAAA,EAAA,GAGpB;AAAA,IACJ,KAAKQ;AAAA,IACL,MAAMC,IAAe,CAAC;AAAA,IACtB,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEC,EAAmBZ,GAAWI,CAAkB,GAE9CS,IAAYC,EAAY,MAAM;AAClC,IAAAP,EAAYP,GAAWI,CAAkB;AAAA,EACxC,GAAA,CAACG,GAAaH,GAAoBJ,CAAS,CAAC;AAY/C,SAVAe,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEdE,EAAU,MAAM;AACd,KAAIJ,KAAeD,OACjBP,KAAA,QAAAA,EAAgB,GAAAQ,KAAe,CAACD;AAAA,EAEjC,GAAA,CAACC,GAAaD,GAAoBP,CAAa,CAAC,GAE/CM,IACK,gBAAAO,EAACC,GAAU,EAAA,QAAO,SAAS,CAAA,IAGhCP,IAEC,gBAAAM,EAAAE,GAAA,EAAS,OAAO,GAAG,aAAY,UAAS,iBAAgB,UACvD,UAAC,gBAAAF,EAAAG,GAAA,EAAM,YAAYN,EAAA,CAAW,EAChC,CAA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GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,sBACxBO,GAAK,EAAA,WAAU,OAAM,OAAM,cAAa,UAEzC,wCAAA;AAAA,EAAA,EACF,CAAA,EAEJ,CAAA;AAEJ,GAEeC,KAAAC,EAAKxC,CAAe;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptm-report-types.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report-types.ts"],"sourcesContent":["// ============================\n// SHARED INTERFACES\n// ============================\n\nexport interface IIntroSlide {\n color: string;\n content: string;\n section_name: string;\n type: string;\n}\n\nexport interface IStrategyOption {\n option_info: string;\n option_label: string;\n}\n\nexport interface IStrategyCategory {\n category_label: string;\n icon: string;\n options: IStrategyOption[];\n}\n\n// ============================\n// CONFIG INTERFACES\n// ============================\n\nexport interface ILearningStrategyConfig {\n intro_slide: IIntroSlide;\n learning_strategy_cta: string;\n max: number;\n min: number;\n page_heading: string;\n page_subheading: string;\n show_key_need?: boolean;\n step_no: number;\n steps_info: string;\n steps_label: string;\n strategies: {\n advanced_math: IStrategyCategory;\n learning_gaps: IStrategyCategory;\n math_anxiety: IStrategyCategory;\n math_foundation: IStrategyCategory;\n mental_math: IStrategyCategory;\n more_practice: IStrategyCategory;\n };\n}\n\nexport interface IParentSupportOptionConfig {\n icon: string;\n option_cta: string | null;\n option_info: string;\n option_key: string;\n option_label: string;\n report_statement: string;\n slides_ratio: string;\n slides_tag: string;\n}\n\nexport interface IParentSupportConfig {\n intro_slide: IIntroSlide;\n options: IParentSupportOptionConfig[];\n page_heading: string;\n page_subheading: string;\n step_no: number;\n steps_info: string;\n steps_label: string;\n}\n\nexport interface IRealWorldProjectConfig {\n intro_slide: IIntroSlide;\n max: number;\n page_heading: string;\n ptm_report_color?: {\n images: string[];\n objective: string;\n remarks: string;\n };\n remarks_heading: string;\n remarks_placeholder: string;\n step_no: number;\n steps_info: string;\n steps_label: string;\n tag: string;\n}\n\nexport interface ISchoolSupportArea {\n area_label?: string;\n optional: boolean;\n options?: string[];\n placeholder?: string;\n question: string;\n report_statement: string | string[];\n report_statement_with_performance?: string[];\n report_statement_with_previous_performance?: string[];\n type: string;\n}\n\nexport interface ISchoolSupportHomeworkHelpConfig {\n area_name: string;\n areas: ISchoolSupportArea[];\n color: string;\n optional: boolean;\n page_heading: string;\n}\n\nexport interface ISchoolSupportTestHelpConfig {\n area_name: string;\n areas: ISchoolSupportArea[];\n color: string;\n optional: boolean;\n page_heading: string;\n}\n\nexport interface ISchoolSupportSubsectionsConfig {\n homework_help: ISchoolSupportHomeworkHelpConfig;\n test_help: ISchoolSupportTestHelpConfig;\n}\n\nexport interface ISchoolSupportConfig {\n intro_slide: IIntroSlide;\n step_no: number;\n steps_info: string;\n steps_label: string;\n subsections: ISchoolSupportSubsectionsConfig;\n}\n\nexport interface IObservationAreaConfig {\n area_key: string;\n area_label: string;\n icon: string;\n report_statement: string;\n}\n\nexport interface IFocusAreaConfig {\n areas: IObservationAreaConfig[];\n max: number;\n page_heading: string;\n page_subheading: string;\n report_tag: string;\n}\n\nexport interface IStrengthOptionConfig {\n option_label: string;\n report_statement: string;\n report_tag: string;\n}\n\nexport interface IStrengthAreaConfig extends IObservationAreaConfig {\n options: IStrengthOptionConfig[];\n}\n\nexport interface IStrengthsConfig {\n areas: IStrengthAreaConfig[];\n max: number;\n page_heading: string;\n page_subheading: string;\n}\n\nexport interface ITeacherRemarksConfig {\n area_label: string;\n page_heading: string;\n page_subheading: string;\n placeholder: string;\n report_tag: string;\n}\n\nexport interface ITeacherObservationSubsectionsConfig {\n focus_area: IFocusAreaConfig;\n strengths: IStrengthsConfig;\n teacher_remarks: ITeacherRemarksConfig;\n}\n\nexport interface ITeacherObservationConfig {\n intro_slide: IIntroSlide;\n step_no: number;\n steps_info: string;\n steps_label: string;\n subsections: ITeacherObservationSubsectionsConfig;\n}\n\nexport interface IUpcomingChaptersConfig {\n area_label: string;\n intro_slide: IIntroSlide;\n page_heading: string;\n page_subheading: string;\n placeholder: string;\n step_no: number;\n steps_info: string;\n steps_label: string;\n}\n\nexport interface IPTMReportSectionsConfig {\n learning_strategy: ILearningStrategyConfig;\n parent_support: IParentSupportConfig;\n real_world_project?: IRealWorldProjectConfig;\n school_support?: ISchoolSupportConfig;\n teacher_observation: ITeacherObservationConfig;\n upcoming_chapters?: IUpcomingChaptersConfig;\n}\n\n// ============================\n// REPORT INTERFACES (actual report data)\n// ============================\n\nexport interface IReportStrategies {\n advanced_math?: number[];\n learning_gaps?: number[];\n math_anxiety?: number[];\n math_foundation?: number[];\n mental_math?: number[];\n more_practice?: number[];\n}\n\nexport interface IReportTeacherObservation {\n focus_area: string;\n strengths: Record<string, number>;\n teacher_remarks: string;\n}\n\nexport interface IRealWorldProjectReport {\n images?: number[];\n observation: string;\n}\n\nexport interface IUpcomingChaptersReport {\n upcoming_chapters: string;\n}\n\nexport interface ISchoolSupportHomeworkHelpReport {\n is_hw_help_provided: number;\n selected: number[];\n topics: string;\n}\n\nexport interface ISchoolSupportTestHelpReport {\n performance: {\n scored: string;\n total: string;\n grade: string;\n };\n previous_performance: {\n scored: string;\n total: string;\n grade: string;\n };\n selected: number[];\n}\n\nexport interface ISchoolSupportReport {\n homework_help: ISchoolSupportHomeworkHelpReport;\n test_help: ISchoolSupportTestHelpReport;\n}\n\nexport interface IReportSections {\n parent_support: number[];\n strategies: IReportStrategies;\n teacher_observation: IReportTeacherObservation;\n real_world_project?: IRealWorldProjectReport;\n upcoming_chapters?: IUpcomingChaptersReport;\n school_support?: ISchoolSupportReport;\n}\n\n// ============================\n// STUDENT & TEACHER DATA\n// ============================\n\nexport interface IAttendanceData {\n classes_completed: number;\n weeks_completed: number;\n}\n\nexport interface IHomeworkData {\n incomplete_sheets: number | null;\n sheets_assigned: number;\n sheets_not_completed: number;\n}\n\nexport interface IKeyNeed {\n created_by_id?: string;\n evidence_of_key_need?: string;\n is_published?: boolean;\n is_seen_by_teacher?: boolean;\n key_need: string;\n last_modified_by?: string;\n measure_of_success: string;\n strategies?: any[];\n timestamp?: number;\n}\n\nexport interface ILateClassData {\n break_time: number;\n date: number;\n enter_datetime: number;\n id: string;\n is_invalid: boolean;\n is_skipped: boolean;\n perfect_hit: number;\n scheduled_duration_minutes: number;\n scheduled_end_time: number;\n scheduled_start_datetime: number;\n scheduled_start_time: number;\n status: string;\n student_course_id: string;\n student_id: string;\n tag: string;\n teacher_classroom_id: string;\n was_late: boolean;\n}\n\nexport interface IRealWorldProjectInfo {\n activity: string;\n attempt_id?: string;\n objective: string;\n image_upload_urls?: string[];\n}\n\nexport interface IStudentData {\n attendance_data: IAttendanceData;\n key_need: IKeyNeed;\n country: string;\n country_code: string;\n first_name: string;\n gender: string;\n grade: string;\n homework_data: IHomeworkData;\n last_name: string;\n name: string;\n parent_name: string;\n phone: string;\n plus_class_streak: number;\n real_world_project?: IRealWorldProjectInfo;\n late_class_data: ILateClassData[];\n student_service_id: string;\n}\n\nexport interface ITeacherData {\n email: string;\n first_name: string;\n gender: string;\n last_name: string;\n name: string;\n phone: string;\n}\n\nexport interface IPTMReport {\n report_sections: IReportSections;\n state: string;\n student_data: IStudentData;\n teacher_data: ITeacherData;\n}\n\n// ============================\n// PTM CONFIG INTERFACES\n// ============================\n\nexport interface IDefaultKeyNeed {\n key_need: string;\n measure_of_success: string;\n}\n\nexport interface IFeedbackConfig {\n questions: string[];\n}\n\nexport interface IPTMSchedulingConfig {\n colatteral_image_link: string;\n colatteral_text: string;\n cta_label: string;\n cta_label_share_report?: string;\n cta_text: string;\n cta_text_share_report?: string;\n optional?: boolean;\n step_no: number;\n steps_info: string;\n steps_label: string;\n}\n\nexport interface ISlidesConfigBullet {\n content: string;\n title?: string;\n}\n\nexport interface ISlidesConfig {\n qna?: {\n content: string;\n header: string;\n type: string;\n };\n thankyou: {\n bullets?: ISlidesConfigBullet[];\n content?: string;\n header: string;\n subheader?: string;\n type: string;\n };\n welcome: {\n bullets: ISlidesConfigBullet[];\n header: string;\n type: string;\n };\n}\n\nexport interface IPTMConfigDetails {\n default_key_need: IDefaultKeyNeed;\n feedback_config: IFeedbackConfig;\n late_if_minutes: number;\n late_if_seconds: number;\n ptm_expiry_days: number;\n ptm_report_sections: IPTMReportSectionsConfig;\n ptm_scheduling: IPTMSchedulingConfig;\n report_color_config: Record<string, string>;\n slides_config: ISlidesConfig;\n}\n\nexport interface IPTMConfig {\n config: IPTMConfigDetails;\n created_on_ts: number;\n id: string;\n is_active: boolean;\n meta: null;\n ptm_type: string;\n updated_on_ts: number;\n version: number;\n}\n\n// ============================\n// MAIN PTM RESPONSE INTERFACE\n// ============================\n\nexport interface IPTMReportResponse {\n created_on_ts: number;\n due_date: number;\n id: string;\n is_moment_ptm: boolean;\n meta: {\n student_classroom_id: string;\n student_course_id: string;\n };\n opportunity_action_id: string | null;\n ptm_config: IPTMConfig;\n ptm_config_id: string;\n ptm_id: string;\n ptm_platform: string | null;\n ptm_state: string;\n ptm_type: string;\n report: IPTMReport;\n reschedule_reason: string | null;\n scheduled_on: number;\n student_classroom_id: string;\n student_course_id: string;\n student_id: string;\n teacher_classroom_id: string;\n teacher_id: string;\n updated_on_ts: number;\n}\n\n// ============================\n// UTILITY INTERFACES & ENUMS\n// ============================\n\nexport interface IPTMReportProps {\n ptmId: string;\n}\n\nexport enum EPTMTypes {\n ON_DEMAND = 'ON_DEMAND',\n PLUS_CLASS_7 = 'PLUS_CLASS_7',\n}\n"],"names":["EPTMTypes"],"mappings":"AAgdY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,eAAe,gBAFLA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ptm-report-types.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report-types.ts"],"sourcesContent":["// ============================\n// SHARED INTERFACES\n// ============================\n\nexport interface IIntroSlide {\n color: string;\n content: string;\n section_name: string;\n type: string;\n}\n\nexport interface IStrategyOption {\n option_info: string;\n option_label: string;\n}\n\nexport interface IStrategyCategory {\n category_label: string;\n icon: string;\n options: IStrategyOption[];\n}\n\n// ============================\n// CONFIG INTERFACES\n// ============================\n\nexport interface ILearningStrategyConfig {\n intro_slide: IIntroSlide;\n learning_strategy_cta: string;\n max: number;\n min: number;\n page_heading: string;\n page_subheading: string;\n show_key_need?: boolean;\n step_no: number;\n steps_info: string;\n steps_label: string;\n strategies: {\n advanced_math: IStrategyCategory;\n learning_gaps: IStrategyCategory;\n math_anxiety: IStrategyCategory;\n math_foundation: IStrategyCategory;\n mental_math: IStrategyCategory;\n more_practice: IStrategyCategory;\n };\n}\n\nexport interface IParentSupportOptionConfig {\n icon: string;\n option_cta: string | null;\n option_info: string;\n option_key: string;\n option_label: string;\n report_statement: string;\n slides_ratio: string;\n slides_tag: string;\n}\n\nexport interface IParentSupportConfig {\n intro_slide: IIntroSlide;\n options: IParentSupportOptionConfig[];\n page_heading: string;\n page_subheading: string;\n step_no: number;\n steps_info: string;\n steps_label: string;\n}\n\nexport interface IRealWorldProjectConfig {\n intro_slide: IIntroSlide;\n max: number;\n page_heading: string;\n ptm_report_color?: {\n images: string[];\n objective: string;\n remarks: string;\n };\n remarks_heading: string;\n remarks_placeholder: string;\n step_no: number;\n steps_info: string;\n steps_label: string;\n tag: string;\n}\n\nexport interface ISchoolSupportArea {\n area_label?: string;\n optional: boolean;\n options?: string[];\n placeholder?: string;\n question: string;\n report_statement: string | string[];\n report_statement_with_performance?: string[];\n report_statement_with_previous_performance?: string[];\n type: string;\n}\n\nexport interface ISchoolSupportHomeworkHelpConfig {\n area_name: string;\n areas: ISchoolSupportArea[];\n color: string;\n optional: boolean;\n page_heading: string;\n}\n\nexport interface ISchoolSupportTestHelpConfig {\n area_name: string;\n areas: ISchoolSupportArea[];\n color: string;\n optional: boolean;\n page_heading: string;\n}\n\nexport interface ISchoolSupportSubsectionsConfig {\n homework_help: ISchoolSupportHomeworkHelpConfig;\n test_help: ISchoolSupportTestHelpConfig;\n}\n\nexport interface ISchoolSupportConfig {\n intro_slide: IIntroSlide;\n step_no: number;\n steps_info: string;\n steps_label: string;\n subsections: ISchoolSupportSubsectionsConfig;\n}\n\nexport interface IObservationAreaConfig {\n area_key: string;\n area_label: string;\n icon: string;\n report_statement: string;\n}\n\nexport interface IFocusAreaConfig {\n areas: IObservationAreaConfig[];\n max: number;\n page_heading: string;\n page_subheading: string;\n report_tag: string;\n}\n\nexport interface IStrengthOptionConfig {\n option_label: string;\n report_statement: string;\n report_tag: string;\n}\n\nexport interface IStrengthAreaConfig extends IObservationAreaConfig {\n options: IStrengthOptionConfig[];\n}\n\nexport interface IStrengthsConfig {\n areas: IStrengthAreaConfig[];\n max: number;\n page_heading: string;\n page_subheading: string;\n}\n\nexport interface ITeacherRemarksConfig {\n area_label: string;\n page_heading: string;\n page_subheading: string;\n placeholder: string;\n report_tag: string;\n}\n\nexport interface ITeacherObservationSubsectionsConfig {\n focus_area: IFocusAreaConfig;\n strengths: IStrengthsConfig;\n teacher_remarks: ITeacherRemarksConfig;\n}\n\nexport interface ITeacherObservationConfig {\n intro_slide: IIntroSlide;\n step_no: number;\n steps_info: string;\n steps_label: string;\n subsections: ITeacherObservationSubsectionsConfig;\n}\n\nexport interface IUpcomingChaptersConfig {\n area_label: string;\n intro_slide: IIntroSlide;\n page_heading: string;\n page_subheading: string;\n placeholder: string;\n step_no: number;\n steps_info: string;\n steps_label: string;\n}\n\nexport interface IPTMReportSectionsConfig {\n learning_strategy: ILearningStrategyConfig;\n parent_support: IParentSupportConfig;\n real_world_project?: IRealWorldProjectConfig;\n school_support?: ISchoolSupportConfig;\n teacher_observation: ITeacherObservationConfig;\n upcoming_chapters?: IUpcomingChaptersConfig;\n}\n\n// ============================\n// REPORT INTERFACES (actual report data)\n// ============================\n\nexport interface IReportStrategies {\n advanced_math?: number[];\n learning_gaps?: number[];\n math_anxiety?: number[];\n math_foundation?: number[];\n mental_math?: number[];\n more_practice?: number[];\n}\n\nexport interface IReportTeacherObservation {\n focus_area: string;\n strengths: Record<string, number>;\n teacher_remarks: string;\n}\n\nexport interface IRealWorldProjectReport {\n images?: number[];\n observation: string;\n}\n\nexport interface IUpcomingChaptersReport {\n upcoming_chapters: string;\n}\n\nexport interface ISchoolSupportHomeworkHelpReport {\n is_hw_help_provided: number;\n selected: number[];\n topics: string;\n}\n\nexport interface ISchoolSupportTestHelpReport {\n performance: {\n scored: string;\n total: string;\n grade: string;\n };\n previous_performance: {\n scored: string;\n total: string;\n grade: string;\n };\n selected: number[];\n}\n\nexport interface ISchoolSupportReport {\n homework_help: ISchoolSupportHomeworkHelpReport;\n test_help: ISchoolSupportTestHelpReport;\n}\n\nexport interface IReportSections {\n parent_support: number[];\n strategies: IReportStrategies;\n teacher_observation: IReportTeacherObservation;\n real_world_project?: IRealWorldProjectReport;\n upcoming_chapters?: IUpcomingChaptersReport;\n school_support?: ISchoolSupportReport;\n}\n\n// ============================\n// STUDENT & TEACHER DATA\n// ============================\n\nexport interface IAttendanceData {\n classes_completed: number;\n weeks_completed: number;\n}\n\nexport interface IHomeworkData {\n incomplete_sheets: number | null;\n sheets_assigned: number;\n sheets_not_completed: number;\n}\n\nexport interface IKeyNeed {\n created_by_id?: string;\n evidence_of_key_need?: string;\n is_published?: boolean;\n is_seen_by_teacher?: boolean;\n key_need: string;\n last_modified_by?: string;\n measure_of_success: string;\n strategies?: any[];\n timestamp?: number;\n}\n\nexport interface ILateClassData {\n break_time: number;\n date: number;\n enter_datetime: number;\n id: string;\n is_invalid: boolean;\n is_skipped: boolean;\n perfect_hit: number;\n scheduled_duration_minutes: number;\n scheduled_end_time: number;\n scheduled_start_datetime: number;\n scheduled_start_time: number;\n status: string;\n student_course_id: string;\n student_id: string;\n tag: string;\n teacher_classroom_id: string;\n was_late: boolean;\n}\n\nexport interface IRealWorldProjectInfo {\n activity: string;\n attempt_id?: string;\n objective: string;\n image_upload_urls?: string[];\n}\n\nexport interface IStudentData {\n attendance_data: IAttendanceData;\n key_need: IKeyNeed;\n country: string;\n country_code: string;\n first_name: string;\n gender: string;\n grade: string;\n homework_data: IHomeworkData;\n last_name: string;\n name: string;\n parent_name: string;\n phone: string;\n plus_class_streak: number;\n real_world_project?: IRealWorldProjectInfo;\n late_class_data: ILateClassData[];\n student_service_id: string;\n}\n\nexport interface ITeacherData {\n email: string;\n first_name: string;\n gender: string;\n last_name: string;\n name: string;\n phone: string;\n}\n\nexport interface IPTMReport {\n report_sections: IReportSections;\n state: string;\n student_data: IStudentData;\n teacher_data: ITeacherData;\n}\n\n// ============================\n// PTM CONFIG INTERFACES\n// ============================\n\nexport interface IDefaultKeyNeed {\n key_need: string;\n measure_of_success: string;\n}\n\nexport interface IFeedbackConfig {\n questions: string[];\n}\n\nexport interface IPTMSchedulingConfig {\n colatteral_image_link: string;\n colatteral_text: string;\n cta_label: string;\n cta_label_share_report?: string;\n cta_text: string;\n cta_text_share_report?: string;\n optional?: boolean;\n step_no: number;\n steps_info: string;\n steps_label: string;\n}\n\nexport interface ISlidesConfigBullet {\n content: string;\n title?: string;\n}\n\nexport interface ISlidesConfig {\n qna?: {\n content: string;\n header: string;\n type: string;\n };\n thankyou: {\n bullets?: ISlidesConfigBullet[];\n content?: string;\n header: string;\n subheader?: string;\n type: string;\n };\n welcome: {\n bullets: ISlidesConfigBullet[];\n header: string;\n type: string;\n };\n}\n\nexport interface IPTMConfigDetails {\n default_key_need: IDefaultKeyNeed;\n feedback_config: IFeedbackConfig;\n late_if_minutes: number;\n late_if_seconds: number;\n ptm_expiry_days: number;\n ptm_report_sections: IPTMReportSectionsConfig;\n ptm_scheduling: IPTMSchedulingConfig;\n report_color_config: Record<string, string>;\n slides_config: ISlidesConfig;\n}\n\nexport interface IPTMConfig {\n config: IPTMConfigDetails;\n created_on_ts: number;\n id: string;\n is_active: boolean;\n meta: null;\n ptm_type: string;\n updated_on_ts: number;\n version: number;\n}\n\n// ============================\n// MAIN PTM RESPONSE INTERFACE\n// ============================\n\nexport interface IPTMReportResponse {\n created_on_ts: number;\n due_date: number;\n id: string;\n is_moment_ptm: boolean;\n meta: {\n student_classroom_id: string;\n student_course_id: string;\n };\n opportunity_action_id: string | null;\n ptm_config: IPTMConfig;\n ptm_config_id: string;\n ptm_id: string;\n ptm_platform: string | null;\n ptm_state: string;\n ptm_type: string;\n report: IPTMReport;\n reschedule_reason: string | null;\n scheduled_on: number;\n student_classroom_id: string;\n student_course_id: string;\n student_id: string;\n teacher_classroom_id: string;\n teacher_id: string;\n updated_on_ts: number;\n}\n\n// ============================\n// UTILITY INTERFACES & ENUMS\n// ============================\n\nexport interface IPTMReportProps {\n ptmId: string;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport enum EPTMTypes {\n ON_DEMAND = 'ON_DEMAND',\n PLUS_CLASS_7 = 'PLUS_CLASS_7',\n}\n"],"names":["EPTMTypes"],"mappings":"AAidY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,eAAe,gBAFLA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,113 +1,116 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { usePTMReportGet as
|
|
4
|
-
import { EPTMTypes as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Container as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import { memo as fe, useCallback as he, useEffect as f } from "react";
|
|
3
|
+
import { usePTMReportGet as de } from "./api/use-ptm-report-get.js";
|
|
4
|
+
import { EPTMTypes as ue } from "./ptm-report-types.js";
|
|
5
|
+
import _e from "../../../ui/loader/app-loader/app-loader.js";
|
|
6
|
+
import Ce from "./comps/student-info/student-info.js";
|
|
7
|
+
import { Container as Re } from "./ptm-report-styled.js";
|
|
8
|
+
import ke from "./comps/key-need/key-need.js";
|
|
9
|
+
import h from "../../../ui/layout/flex-view.js";
|
|
10
|
+
import Te from "./comps/teacher-observations/teacher-observations.js";
|
|
11
|
+
import Se from "./comps/strategies/strategies.js";
|
|
12
|
+
import we from "./comps/parent-support/parent-support.js";
|
|
13
|
+
import ye from "./comps/upcoming-chapters/upcoming-chapters.js";
|
|
14
|
+
import Me from "./comps/real-world-projects/real-world-projects.js";
|
|
15
|
+
import Pe from "./comps/school-support/school-support.js";
|
|
16
|
+
import be from "../../../ui/error/error.js";
|
|
17
|
+
const De = ({ ptmId: r, onAPIComplete: t }) => {
|
|
18
18
|
const {
|
|
19
|
-
get:
|
|
20
|
-
data:
|
|
21
|
-
isProcessing:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
19
|
+
get: m,
|
|
20
|
+
data: g,
|
|
21
|
+
isProcessing: d,
|
|
22
|
+
isProcessed: s,
|
|
23
|
+
isProcessingFailed: o
|
|
24
|
+
} = de(r), a = he(() => {
|
|
25
|
+
m(r);
|
|
26
|
+
}, [m, r]);
|
|
27
|
+
if (f(() => {
|
|
28
|
+
a();
|
|
29
|
+
}, [a]), f(() => {
|
|
30
|
+
(s || o) && (t == null || t(!!(s && !o)));
|
|
31
|
+
}, [s, o, t]), d || !g)
|
|
32
|
+
return /* @__PURE__ */ e(_e, { height: "100dvh" });
|
|
33
|
+
if (o)
|
|
34
|
+
return /* @__PURE__ */ e(h, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(be, { onTryAgain: a }) });
|
|
35
|
+
const { ptm_config: u, report: _ } = g, { ptm_type: n, config: C } = u || {}, { ptm_report_sections: R, late_if_minutes: k } = C || {}, {
|
|
36
|
+
teacher_observation: T,
|
|
37
|
+
learning_strategy: S,
|
|
38
|
+
parent_support: w,
|
|
39
|
+
school_support: y
|
|
40
|
+
} = R || {}, { subsections: M } = y || {}, { homework_help: P, test_help: b } = M || {}, { options: D } = w || {}, { strategies: O } = S || {}, { subsections: j } = T || {}, {
|
|
41
|
+
focus_area: A,
|
|
42
|
+
strengths: x,
|
|
43
|
+
teacher_remarks: v
|
|
44
|
+
} = j || {}, { areas: E = [], report_tag: F } = A || {}, { areas: N = [] } = x || {}, { report_tag: U } = v || {}, { report_sections: $, student_data: H } = _, {
|
|
45
|
+
teacher_observation: W,
|
|
46
|
+
parent_support: G,
|
|
47
|
+
strategies: K,
|
|
48
|
+
real_world_project: X,
|
|
49
|
+
school_support: L,
|
|
50
|
+
upcoming_chapters: V
|
|
51
|
+
} = $ || {}, { homework_help: q, test_help: z } = L || {}, { upcoming_chapters: B } = V || {}, {
|
|
52
|
+
strengths: J = {},
|
|
53
|
+
focus_area: Q,
|
|
54
|
+
teacher_remarks: Y
|
|
55
|
+
} = W || {}, {
|
|
56
|
+
first_name: l,
|
|
57
|
+
grade: Z,
|
|
58
|
+
key_need: p,
|
|
59
|
+
attendance_data: I,
|
|
60
|
+
homework_data: ee,
|
|
61
|
+
late_class_data: te = [],
|
|
62
|
+
real_world_project: oe
|
|
63
|
+
} = H || {}, { classes_completed: re, weeks_completed: se } = I || {}, { sheets_assigned: ae, sheets_not_completed: ne } = ee || {}, pe = E.find(
|
|
64
|
+
({ area_key: ge }) => ge === Q
|
|
65
|
+
), ce = (p == null ? void 0 : p.key_need) ?? "", c = n === ue.ON_DEMAND, ie = te.length, me = n && n.split("_").includes("UPGRADE");
|
|
66
|
+
return /* @__PURE__ */ i(Re, { children: [
|
|
67
|
+
/* @__PURE__ */ e(Ce, { name: l, grade: Z }),
|
|
68
|
+
/* @__PURE__ */ i(h, { $gutterX: 1, $gapX: 1, children: [
|
|
69
|
+
/* @__PURE__ */ e(ke, { text: ce }),
|
|
70
|
+
(c || me) && /* @__PURE__ */ i(le, { children: [
|
|
71
|
+
/* @__PURE__ */ e(Me, { projectReport: X, projectInfo: oe }),
|
|
69
72
|
/* @__PURE__ */ e(
|
|
70
|
-
|
|
73
|
+
Pe,
|
|
71
74
|
{
|
|
72
|
-
homeworkHelpReport:
|
|
73
|
-
homeworkHelpConfig:
|
|
74
|
-
testHelpReport:
|
|
75
|
-
testHelpConfig:
|
|
76
|
-
studentName:
|
|
77
|
-
isOnDemandPTM:
|
|
75
|
+
homeworkHelpReport: q,
|
|
76
|
+
homeworkHelpConfig: P,
|
|
77
|
+
testHelpReport: z,
|
|
78
|
+
testHelpConfig: b,
|
|
79
|
+
studentName: l,
|
|
80
|
+
isOnDemandPTM: c
|
|
78
81
|
}
|
|
79
82
|
)
|
|
80
83
|
] }),
|
|
81
84
|
/* @__PURE__ */ e(
|
|
82
|
-
|
|
85
|
+
Te,
|
|
83
86
|
{
|
|
84
|
-
strengthAreas:
|
|
85
|
-
strengthsReport:
|
|
86
|
-
focusArea:
|
|
87
|
-
focusAreaReportTag:
|
|
88
|
-
teacherRemarks:
|
|
89
|
-
teacherRemarkTag:
|
|
87
|
+
strengthAreas: N,
|
|
88
|
+
strengthsReport: J,
|
|
89
|
+
focusArea: pe,
|
|
90
|
+
focusAreaReportTag: F,
|
|
91
|
+
teacherRemarks: Y,
|
|
92
|
+
teacherRemarkTag: U
|
|
90
93
|
}
|
|
91
94
|
),
|
|
92
|
-
/* @__PURE__ */ e(
|
|
95
|
+
/* @__PURE__ */ e(Se, { report: K, strategyConfig: O }),
|
|
93
96
|
/* @__PURE__ */ e(
|
|
94
|
-
|
|
97
|
+
we,
|
|
95
98
|
{
|
|
96
|
-
report:
|
|
97
|
-
options:
|
|
98
|
-
classesCompleted:
|
|
99
|
-
weeksCompleted:
|
|
100
|
-
sheetsAssigned:
|
|
101
|
-
sheetsNotCompleted:
|
|
102
|
-
lateClassesCount:
|
|
103
|
-
lateIfMinutes:
|
|
99
|
+
report: G,
|
|
100
|
+
options: D,
|
|
101
|
+
classesCompleted: re,
|
|
102
|
+
weeksCompleted: se,
|
|
103
|
+
sheetsAssigned: ae,
|
|
104
|
+
sheetsNotCompleted: ne,
|
|
105
|
+
lateClassesCount: ie,
|
|
106
|
+
lateIfMinutes: k
|
|
104
107
|
}
|
|
105
108
|
),
|
|
106
|
-
|
|
109
|
+
c && /* @__PURE__ */ e(ye, { chapters: B })
|
|
107
110
|
] })
|
|
108
111
|
] });
|
|
109
|
-
},
|
|
112
|
+
}, qe = fe(De);
|
|
110
113
|
export {
|
|
111
|
-
|
|
114
|
+
qe as default
|
|
112
115
|
};
|
|
113
116
|
//# sourceMappingURL=ptm-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptm-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { usePTMReportGet } from './api/use-ptm-report-get';\nimport { EPTMTypes, type IPTMReportProps } from './ptm-report-types';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport StudentInfo from './comps/student-info/student-info';\nimport * as Styled from './ptm-report-styled';\nimport KeyNeed from './comps/key-need/key-need';\nimport FlexView from '../../../ui/layout/flex-view';\nimport TeacherObservations from './comps/teacher-observations/teacher-observations';\nimport Strategies from './comps/strategies/strategies';\nimport ParentSupport from './comps/parent-support/parent-support';\nimport UpcomingChapters from './comps/upcoming-chapters/upcoming-chapters';\nimport RealWorldProjects from './comps/real-world-projects/real-world-projects';\nimport SchoolSupport from './comps/school-support/school-support';\nimport Error from '../../../ui/error/error';\n\nconst PTMReport: FC<IPTMReportProps> = ({ ptmId }) => {\n const {\n get: getPTMReport,\n data: ptmReportData,\n isProcessing,\n isProcessingFailed,\n } = usePTMReportGet(ptmId);\n\n const fetchPTMReport = useCallback(() => {\n getPTMReport(ptmId);\n }, [getPTMReport, ptmId]);\n\n useEffect(() => {\n fetchPTMReport();\n }, [fetchPTMReport]);\n\n if (isProcessing || !ptmReportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchPTMReport} />\n </FlexView>\n );\n }\n\n const { ptm_config: ptmConfig, report } = ptmReportData;\n const { ptm_type: ptmType, config } = ptmConfig || {};\n const { ptm_report_sections: sectionsConfig, late_if_minutes: lateIfMinutes } = config || {};\n\n const {\n teacher_observation: teacherObservationConfig,\n learning_strategy: strategyConfig,\n parent_support: parentSupportConfig,\n school_support: schoolSupportConfig,\n } = sectionsConfig || {};\n\n const { subsections: schoolSubsections } = schoolSupportConfig || {};\n const { homework_help: homeworkConfig, test_help: testConfig } = schoolSubsections || {};\n\n const { options: parentOptions } = parentSupportConfig || {};\n const { strategies: strategiesConfig } = strategyConfig || {};\n const { subsections: teacherSubsections } = teacherObservationConfig || {};\n\n const {\n focus_area: focusAreaConfig,\n strengths: strengthsConfig,\n teacher_remarks: remarksConfig,\n } = teacherSubsections || {};\n\n const { areas: focusAreas = [], report_tag: focusAreaTag } = focusAreaConfig || {};\n const { areas: strengthAreas = [] } = strengthsConfig || {};\n const { report_tag: remarksTag } = remarksConfig || {};\n\n const { report_sections: reportSections, student_data: studentData } = report;\n\n const {\n teacher_observation: teacherObservationReport,\n parent_support: parentSupportReport,\n strategies: strategiesReport,\n real_world_project: realWorldReport,\n school_support: schoolSupportReport,\n upcoming_chapters: upcomingChaptersReport,\n } = reportSections || {};\n\n const { homework_help: homeworkReport, test_help: testReport } = schoolSupportReport || {};\n\n const { upcoming_chapters: upcomingChapters } = upcomingChaptersReport || {};\n\n const {\n strengths: strengthsReport = {},\n focus_area: selectedFocusAreaKey,\n teacher_remarks: teacherRemarks,\n } = teacherObservationReport || {};\n\n const {\n first_name: studentName,\n grade: studentGrade,\n key_need: keyNeedData,\n attendance_data: attendanceData,\n homework_data: homeworkData,\n late_class_data: lateClasses = [],\n real_world_project: realWorldProjectData,\n } = studentData || {};\n\n const { classes_completed: completedClasses, weeks_completed: completedWeeks } =\n attendanceData || {};\n\n const { sheets_assigned: assignedSheets, sheets_not_completed: incompleteSheets } =\n homeworkData || {};\n\n const selectedFocusArea = focusAreas.find(\n ({ area_key: areaKey }) => areaKey === selectedFocusAreaKey,\n );\n\n const keyNeedText = keyNeedData?.key_need ?? '';\n const isOnDemandPTM = ptmType === EPTMTypes.ON_DEMAND;\n const lateClassesCount = lateClasses.length;\n const isUpgradePTM = ptmType && ptmType.split('_').includes('UPGRADE');\n const isUpgradeOrOnDemandPTM = isOnDemandPTM || isUpgradePTM;\n\n return (\n <Styled.Container>\n <StudentInfo name={studentName} grade={studentGrade} />\n <FlexView $gutterX={1} $gapX={1}>\n <KeyNeed text={keyNeedText} />\n {isUpgradeOrOnDemandPTM && (\n <>\n <RealWorldProjects projectReport={realWorldReport} projectInfo={realWorldProjectData} />\n <SchoolSupport\n homeworkHelpReport={homeworkReport}\n homeworkHelpConfig={homeworkConfig}\n testHelpReport={testReport}\n testHelpConfig={testConfig}\n studentName={studentName}\n isOnDemandPTM={isOnDemandPTM}\n />\n </>\n )}\n <TeacherObservations\n strengthAreas={strengthAreas}\n strengthsReport={strengthsReport}\n focusArea={selectedFocusArea}\n focusAreaReportTag={focusAreaTag}\n teacherRemarks={teacherRemarks}\n teacherRemarkTag={remarksTag}\n />\n <Strategies report={strategiesReport} strategyConfig={strategiesConfig} />\n <ParentSupport\n report={parentSupportReport}\n options={parentOptions}\n classesCompleted={completedClasses}\n weeksCompleted={completedWeeks}\n sheetsAssigned={assignedSheets}\n sheetsNotCompleted={incompleteSheets}\n lateClassesCount={lateClassesCount}\n lateIfMinutes={lateIfMinutes}\n />\n {isOnDemandPTM && <UpcomingChapters chapters={upcomingChapters} />}\n </FlexView>\n </Styled.Container>\n );\n};\n\nexport default memo(PTMReport);\n"],"names":["PTMReport","ptmId","getPTMReport","ptmReportData","isProcessing","isProcessingFailed","usePTMReportGet","fetchPTMReport","useCallback","useEffect","jsx","AppLoader","FlexView","Error","ptmConfig","report","ptmType","config","sectionsConfig","lateIfMinutes","teacherObservationConfig","strategyConfig","parentSupportConfig","schoolSupportConfig","schoolSubsections","homeworkConfig","testConfig","parentOptions","strategiesConfig","teacherSubsections","focusAreaConfig","strengthsConfig","remarksConfig","focusAreas","focusAreaTag","strengthAreas","remarksTag","reportSections","studentData","teacherObservationReport","parentSupportReport","strategiesReport","realWorldReport","schoolSupportReport","upcomingChaptersReport","homeworkReport","testReport","upcomingChapters","strengthsReport","selectedFocusAreaKey","teacherRemarks","studentName","studentGrade","keyNeedData","attendanceData","homeworkData","lateClasses","realWorldProjectData","completedClasses","completedWeeks","assignedSheets","incompleteSheets","selectedFocusArea","areaKey","keyNeedText","isOnDemandPTM","EPTMTypes","lateClassesCount","isUpgradePTM","jsxs","Styled.Container","StudentInfo","KeyNeed","Fragment","RealWorldProjects","SchoolSupport","TeacherObservations","Strategies","ParentSupport","UpcomingChapters","ptmReport","memo"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAiC,CAAC,EAAE,OAAAC,QAAY;AAC9C,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,GAAgBL,CAAK,GAEnBM,IAAiBC,GAAY,MAAM;AACvC,IAAAN,EAAaD,CAAK;AAAA,EAAA,GACjB,CAACC,GAAcD,CAAK,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;AAAA,UAACiE;AAAA,UAAA;AAAA,YACC,oBAAoB9B;AAAA,YACpB,oBAAoBpB;AAAA,YACpB,gBAAgBqB;AAAA,YAChB,gBAAgBpB;AAAA,YAChB,aAAAyB;AAAA,YACA,eAAAc;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,MAEF,gBAAAvD;AAAA,QAACkE;AAAA,QAAA;AAAA,UACC,eAAAzC;AAAA,UACA,iBAAAa;AAAA,UACA,WAAWc;AAAA,UACX,oBAAoB5B;AAAA,UACpB,gBAAAgB;AAAA,UACA,kBAAkBd;AAAA,QAAA;AAAA,MACpB;AAAA,MACC,gBAAA1B,EAAAmE,IAAA,EAAW,QAAQpC,GAAkB,gBAAgBb,GAAkB;AAAA,MACxE,gBAAAlB;AAAA,QAACoE;AAAA,QAAA;AAAA,UACC,QAAQtC;AAAA,UACR,SAASb;AAAA,UACT,kBAAkB+B;AAAA,UAClB,gBAAgBC;AAAA,UAChB,gBAAgBC;AAAA,UAChB,oBAAoBC;AAAA,UACpB,kBAAAM;AAAA,UACA,eAAAhD;AAAA,QAAA;AAAA,MACF;AAAA,MACC8C,KAAiB,gBAAAvD,EAACqE,IAAiB,EAAA,UAAUhC,EAAkB,CAAA;AAAA,IAAA,GAClE;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeiC,KAAAC,GAAKjF,EAAS;"}
|
|
1
|
+
{"version":3,"file":"ptm-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { usePTMReportGet } from './api/use-ptm-report-get';\nimport { EPTMTypes, type IPTMReportProps } from './ptm-report-types';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport StudentInfo from './comps/student-info/student-info';\nimport * as Styled from './ptm-report-styled';\nimport KeyNeed from './comps/key-need/key-need';\nimport FlexView from '../../../ui/layout/flex-view';\nimport TeacherObservations from './comps/teacher-observations/teacher-observations';\nimport Strategies from './comps/strategies/strategies';\nimport ParentSupport from './comps/parent-support/parent-support';\nimport UpcomingChapters from './comps/upcoming-chapters/upcoming-chapters';\nimport RealWorldProjects from './comps/real-world-projects/real-world-projects';\nimport SchoolSupport from './comps/school-support/school-support';\nimport Error from '../../../ui/error/error';\n\nconst PTMReport: FC<IPTMReportProps> = ({ ptmId, onAPIComplete }) => {\n const {\n get: getPTMReport,\n data: ptmReportData,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = usePTMReportGet(ptmId);\n\n const fetchPTMReport = useCallback(() => {\n getPTMReport(ptmId);\n }, [getPTMReport, ptmId]);\n\n useEffect(() => {\n fetchPTMReport();\n }, [fetchPTMReport]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed ? true : false);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing || !ptmReportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchPTMReport} />\n </FlexView>\n );\n }\n\n const { ptm_config: ptmConfig, report } = ptmReportData;\n const { ptm_type: ptmType, config } = ptmConfig || {};\n const { ptm_report_sections: sectionsConfig, late_if_minutes: lateIfMinutes } = config || {};\n\n const {\n teacher_observation: teacherObservationConfig,\n learning_strategy: strategyConfig,\n parent_support: parentSupportConfig,\n school_support: schoolSupportConfig,\n } = sectionsConfig || {};\n\n const { subsections: schoolSubsections } = schoolSupportConfig || {};\n const { homework_help: homeworkConfig, test_help: testConfig } = schoolSubsections || {};\n\n const { options: parentOptions } = parentSupportConfig || {};\n const { strategies: strategiesConfig } = strategyConfig || {};\n const { subsections: teacherSubsections } = teacherObservationConfig || {};\n\n const {\n focus_area: focusAreaConfig,\n strengths: strengthsConfig,\n teacher_remarks: remarksConfig,\n } = teacherSubsections || {};\n\n const { areas: focusAreas = [], report_tag: focusAreaTag } = focusAreaConfig || {};\n const { areas: strengthAreas = [] } = strengthsConfig || {};\n const { report_tag: remarksTag } = remarksConfig || {};\n\n const { report_sections: reportSections, student_data: studentData } = report;\n\n const {\n teacher_observation: teacherObservationReport,\n parent_support: parentSupportReport,\n strategies: strategiesReport,\n real_world_project: realWorldReport,\n school_support: schoolSupportReport,\n upcoming_chapters: upcomingChaptersReport,\n } = reportSections || {};\n\n const { homework_help: homeworkReport, test_help: testReport } = schoolSupportReport || {};\n\n const { upcoming_chapters: upcomingChapters } = upcomingChaptersReport || {};\n\n const {\n strengths: strengthsReport = {},\n focus_area: selectedFocusAreaKey,\n teacher_remarks: teacherRemarks,\n } = teacherObservationReport || {};\n\n const {\n first_name: studentName,\n grade: studentGrade,\n key_need: keyNeedData,\n attendance_data: attendanceData,\n homework_data: homeworkData,\n late_class_data: lateClasses = [],\n real_world_project: realWorldProjectData,\n } = studentData || {};\n\n const { classes_completed: completedClasses, weeks_completed: completedWeeks } =\n attendanceData || {};\n\n const { sheets_assigned: assignedSheets, sheets_not_completed: incompleteSheets } =\n homeworkData || {};\n\n const selectedFocusArea = focusAreas.find(\n ({ area_key: areaKey }) => areaKey === selectedFocusAreaKey,\n );\n\n const keyNeedText = keyNeedData?.key_need ?? '';\n const isOnDemandPTM = ptmType === EPTMTypes.ON_DEMAND;\n const lateClassesCount = lateClasses.length;\n const isUpgradePTM = ptmType && ptmType.split('_').includes('UPGRADE');\n const isUpgradeOrOnDemandPTM = isOnDemandPTM || isUpgradePTM;\n\n return (\n <Styled.Container>\n <StudentInfo name={studentName} grade={studentGrade} />\n <FlexView $gutterX={1} $gapX={1}>\n <KeyNeed text={keyNeedText} />\n {isUpgradeOrOnDemandPTM && (\n <>\n <RealWorldProjects projectReport={realWorldReport} projectInfo={realWorldProjectData} />\n <SchoolSupport\n homeworkHelpReport={homeworkReport}\n homeworkHelpConfig={homeworkConfig}\n testHelpReport={testReport}\n testHelpConfig={testConfig}\n studentName={studentName}\n isOnDemandPTM={isOnDemandPTM}\n />\n </>\n )}\n <TeacherObservations\n strengthAreas={strengthAreas}\n strengthsReport={strengthsReport}\n focusArea={selectedFocusArea}\n focusAreaReportTag={focusAreaTag}\n teacherRemarks={teacherRemarks}\n teacherRemarkTag={remarksTag}\n />\n <Strategies report={strategiesReport} strategyConfig={strategiesConfig} />\n <ParentSupport\n report={parentSupportReport}\n options={parentOptions}\n classesCompleted={completedClasses}\n weeksCompleted={completedWeeks}\n sheetsAssigned={assignedSheets}\n sheetsNotCompleted={incompleteSheets}\n lateClassesCount={lateClassesCount}\n lateIfMinutes={lateIfMinutes}\n />\n {isOnDemandPTM && <UpcomingChapters chapters={upcomingChapters} />}\n </FlexView>\n </Styled.Container>\n );\n};\n\nexport default memo(PTMReport);\n"],"names":["PTMReport","ptmId","onAPIComplete","getPTMReport","ptmReportData","isProcessing","isProcessed","isProcessingFailed","usePTMReportGet","fetchPTMReport","useCallback","useEffect","jsx","AppLoader","FlexView","Error","ptmConfig","report","ptmType","config","sectionsConfig","lateIfMinutes","teacherObservationConfig","strategyConfig","parentSupportConfig","schoolSupportConfig","schoolSubsections","homeworkConfig","testConfig","parentOptions","strategiesConfig","teacherSubsections","focusAreaConfig","strengthsConfig","remarksConfig","focusAreas","focusAreaTag","strengthAreas","remarksTag","reportSections","studentData","teacherObservationReport","parentSupportReport","strategiesReport","realWorldReport","schoolSupportReport","upcomingChaptersReport","homeworkReport","testReport","upcomingChapters","strengthsReport","selectedFocusAreaKey","teacherRemarks","studentName","studentGrade","keyNeedData","attendanceData","homeworkData","lateClasses","realWorldProjectData","completedClasses","completedWeeks","assignedSheets","incompleteSheets","selectedFocusArea","areaKey","keyNeedText","isOnDemandPTM","EPTMTypes","lateClassesCount","isUpgradePTM","jsxs","Styled.Container","StudentInfo","KeyNeed","Fragment","RealWorldProjects","SchoolSupport","TeacherObservations","Strategies","ParentSupport","UpcomingChapters","ptmReport","memo"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAiC,CAAC,EAAE,O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F,EAAS;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1633,6 +1633,7 @@ declare interface IDailyTimelineProps {
|
|
|
1633
1633
|
onPuzzleClick?: (card: ITimeLineItem) => void;
|
|
1634
1634
|
onReviewClick?: (userNodeId: string | null, isSatMockTestBlock: boolean, userBlockId: string | null) => void;
|
|
1635
1635
|
scrollAreaHeight?: string | number;
|
|
1636
|
+
onAPIComplete?: (success: boolean) => void;
|
|
1636
1637
|
}
|
|
1637
1638
|
|
|
1638
1639
|
declare interface IDatePickerInputProps extends Omit<ICustomInputFieldProps, 'value' | 'onChange'> {
|
|
@@ -3020,6 +3021,7 @@ declare interface IMonthlyReportProps {
|
|
|
3020
3021
|
bgColor: string;
|
|
3021
3022
|
}) => void;
|
|
3022
3023
|
onFeedback?: (feedback: TFeedback, studentCourseId: string) => void;
|
|
3024
|
+
onAPIComplete?: (success: boolean) => void;
|
|
3023
3025
|
}
|
|
3024
3026
|
|
|
3025
3027
|
declare interface IMonthlyTimelineProps {
|
|
@@ -3028,6 +3030,7 @@ declare interface IMonthlyTimelineProps {
|
|
|
3028
3030
|
courseStreams?: string[];
|
|
3029
3031
|
onReportClick?: (reportId: string, reportType: REPORT_TYPE, year: number, month: string) => void;
|
|
3030
3032
|
scrollAreaHeight?: string | number;
|
|
3033
|
+
onAPIComplete?: (success: boolean) => void;
|
|
3031
3034
|
}
|
|
3032
3035
|
|
|
3033
3036
|
export declare interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {
|
|
@@ -3464,6 +3467,7 @@ declare interface IProjects_2 {
|
|
|
3464
3467
|
|
|
3465
3468
|
declare interface IPTMReportProps {
|
|
3466
3469
|
ptmId: string;
|
|
3470
|
+
onAPIComplete?: (success: boolean) => void;
|
|
3467
3471
|
}
|
|
3468
3472
|
|
|
3469
3473
|
declare interface IPublishData {
|