@cuemath/leap 3.5.29-as2 → 3.5.29-as3

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.
@@ -1,12 +1,13 @@
1
1
  import { createGetAPI as r, createPatchAPI as o } from "@cuemath/rest-api";
2
2
  import { BASE_URL_V1 as e } from "../../../../constants/api.js";
3
- const { useGet: n } = r({
3
+ const { useGet: p, invalidate: a } = r({
4
4
  getURL: (t) => `${e}/monthly-progress-reports/${t}`
5
- }), { usePatch: c } = o({
5
+ }), { usePatch: h } = o({
6
6
  getURL: (t) => `${e}/monthly-progress-reports/${t}`
7
7
  });
8
8
  export {
9
- n as useMonthlyReportGet,
10
- c as useMonthlyReportPatch
9
+ p as useMonthlyReportGet,
10
+ a as useMonthlyReportInvalidate,
11
+ h as useMonthlyReportPatch
11
12
  };
12
13
  //# sourceMappingURL=use-monthly-report-get.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-monthly-report-get.js","sources":["../../../../../src/features/timeline/monthly-report/api/use-monthly-report-get.ts"],"sourcesContent":["import { createGetAPI, createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { type IMonthlyReportResponse } from '../monthly-report-types';\n\nconst { useGet: useMonthlyReportGet } = createGetAPI<IMonthlyReportResponse>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n});\n\nconst { usePatch: useMonthlyReportPatch } = createPatchAPI<\n IMonthlyReportResponse,\n { feedback: string }\n>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n});\n\nexport { useMonthlyReportGet, useMonthlyReportPatch };\n"],"names":["useMonthlyReportGet","createGetAPI","reportId","BASE_URL_V1","useMonthlyReportPatch","createPatchAPI"],"mappings":";;AAKA,MAAM,EAAE,QAAQA,EAAoB,IAAIC,EAAqC;AAAA,EAC3E,QAAQ,CAACC,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC,GAEK,EAAE,UAAUE,EAAsB,IAAIC,EAG1C;AAAA,EACA,QAAQ,CAACH,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC;"}
1
+ {"version":3,"file":"use-monthly-report-get.js","sources":["../../../../../src/features/timeline/monthly-report/api/use-monthly-report-get.ts"],"sourcesContent":["import { createGetAPI, createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { type IMonthlyReportResponse } from '../monthly-report-types';\n\nconst { useGet: useMonthlyReportGet, invalidate: useMonthlyReportInvalidate } =\n createGetAPI<IMonthlyReportResponse>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n });\n\nconst { usePatch: useMonthlyReportPatch } = createPatchAPI<\n IMonthlyReportResponse,\n { feedback: string }\n>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n});\n\nexport { useMonthlyReportGet, useMonthlyReportPatch, useMonthlyReportInvalidate };\n"],"names":["useMonthlyReportGet","useMonthlyReportInvalidate","createGetAPI","reportId","BASE_URL_V1","useMonthlyReportPatch","createPatchAPI"],"mappings":";;AAKA,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAC/CC,EAAqC;AAAA,EACnC,QAAQ,CAACC,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC,GAEG,EAAE,UAAUE,EAAsB,IAAIC,EAG1C;AAAA,EACA,QAAQ,CAACH,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC;"}
@@ -0,0 +1,9 @@
1
+ import e from "styled-components";
2
+ import o from "../../../../ui/layout/flex-view.js";
3
+ const i = e(o)`
4
+ margin: 0 -16px;
5
+ `;
6
+ export {
7
+ i as FeedbackContainer
8
+ };
9
+ //# sourceMappingURL=feedback-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback-styled.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const FeedbackContainer = styled(FlexView)`\n margin: 0 -16px;\n`;\n"],"names":["FeedbackContainer","styled","FlexView"],"mappings":";;AAGa,MAAAA,IAAoBC,EAAOC,CAAQ;AAAA;AAAA;"}
@@ -1,56 +1,57 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { memo as k, useCallback as i } from "react";
3
- import n from "../../../../ui/layout/flex-view.js";
2
+ import { memo as X, useCallback as i } from "react";
3
+ import s from "../../../../ui/layout/flex-view.js";
4
4
  import { ILLUSTRATIONS as p } from "../../../../../assets/illustrations/illustrations.js";
5
5
  import g from "../../../../ui/image/image.js";
6
- import { useMonthlyReportPatch as w } from "../../api/use-monthly-report-get.js";
6
+ import { useMonthlyReportInvalidate as w, useMonthlyReportPatch as y } from "../../api/use-monthly-report-get.js";
7
7
  import $ from "../../../../ui/separator/separator.js";
8
- import y from "../../../../ui/text/text.js";
8
+ import P from "../../../../ui/text/text.js";
9
9
  import f from "../../../../ui/buttons/clickable/clickable.js";
10
- const P = ({
11
- reportId: s,
10
+ import { FeedbackContainer as x } from "./feedback-styled.js";
11
+ const R = ({
12
+ reportId: n,
12
13
  studentName: b,
13
14
  onFeedback: l,
14
- studentCourseId: h,
15
- showSnackbar: a
15
+ studentCourseId: a,
16
+ showSnackbar: h
16
17
  }) => {
17
- const C = i(
18
+ const u = i(
18
19
  (r, o) => {
19
- r && a && a({
20
+ r && h && h({
20
21
  type: "error",
21
22
  message: "Something went wrong. Please try again.",
22
23
  bgColor: "red"
23
- }), !r && l && (o != null && o.feedback) && l(o.feedback, h);
24
+ }), !r && l && (o != null && o.feedback) && (w(n), l(o.feedback, a));
24
25
  },
25
- [l, h]
26
- ), { patch: m, isProcessing: d } = w({
27
- onComplete: C
26
+ [l, a]
27
+ ), { patch: m, isProcessing: d } = y({
28
+ onComplete: u
28
29
  }), t = i(
29
30
  (r) => {
30
- m(s, { feedback: r });
31
+ m(n, { feedback: r });
31
32
  },
32
- [s, m]
33
- ), u = i(() => {
33
+ [n, m]
34
+ ), C = i(() => {
34
35
  t("positive");
35
- }, [t]), X = i(() => {
36
+ }, [t]), k = i(() => {
36
37
  t("negative");
37
38
  }, [t]);
38
- return /* @__PURE__ */ c(n, { $gapX: 1.25, children: [
39
- /* @__PURE__ */ c(y, { $renderAs: "ab2-black", $color: "BLACK_1", children: [
39
+ return /* @__PURE__ */ c(x, { $gapX: 1.25, $background: "WHITE_3", children: [
40
+ /* @__PURE__ */ c(P, { $renderAs: "ab2-black", $color: "BLACK_1", $align: "center", children: [
40
41
  "Are you happy with ",
41
42
  b ?? "her",
42
43
  " progress?"
43
44
  ] }),
44
45
  /* @__PURE__ */ e($, { heightX: 1.5 }),
45
- /* @__PURE__ */ c(n, { $flexDirection: "row", $flexGapX: 3, $alignItems: "center", $justifyContent: "center", children: [
46
+ /* @__PURE__ */ c(s, { $flexDirection: "row", $flexGapX: 3, $alignItems: "center", $justifyContent: "center", children: [
46
47
  /* @__PURE__ */ e(
47
48
  f,
48
49
  {
49
50
  label: "Report thumps up",
50
51
  disabled: d,
51
- onClick: u,
52
+ onClick: C,
52
53
  children: /* @__PURE__ */ e(
53
- n,
54
+ s,
54
55
  {
55
56
  $widthX: 5,
56
57
  $heightX: 5,
@@ -68,9 +69,9 @@ const P = ({
68
69
  {
69
70
  label: "Report thumps down",
70
71
  disabled: d,
71
- onClick: X,
72
+ onClick: k,
72
73
  children: /* @__PURE__ */ e(
73
- n,
74
+ s,
74
75
  {
75
76
  $widthX: 5,
76
77
  $heightX: 5,
@@ -86,8 +87,8 @@ const P = ({
86
87
  ] }),
87
88
  /* @__PURE__ */ e($, { heightX: 1.5 })
88
89
  ] });
89
- }, v = k(P);
90
+ }, U = X(R);
90
91
  export {
91
- v as default
92
+ U as default
92
93
  };
93
94
  //# sourceMappingURL=feedback.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feedback.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport type { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport type { IFeedbackTypesProps } from './feedback-types';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../ui/image/image';\nimport { useMonthlyReportPatch } from '../../api/use-monthly-report-get';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\n\nconst Feedback = ({\n reportId,\n studentName,\n onFeedback,\n studentCourseId,\n showSnackbar,\n}: IFeedbackTypesProps) => {\n const onComplete = useCallback(\n (err: string | null, data?: IMonthlyReportResponse) => {\n if (err && showSnackbar) {\n showSnackbar({\n type: 'error',\n message: 'Something went wrong. Please try again.',\n bgColor: 'red',\n });\n }\n\n if (!err && onFeedback && data?.feedback) {\n onFeedback(data.feedback, studentCourseId);\n }\n },\n [onFeedback, studentCourseId],\n );\n\n const { patch: updateMilestone, isProcessing } = useMonthlyReportPatch({\n onComplete,\n });\n\n const handleFeedback = useCallback(\n (feedback: TFeedback) => {\n updateMilestone(reportId, { feedback });\n },\n [reportId, updateMilestone],\n );\n\n const handlePositiveFeedback = useCallback(() => {\n handleFeedback('positive');\n }, [handleFeedback]);\n\n const handleNegativeFeedback = useCallback(() => {\n handleFeedback('negative');\n }, [handleFeedback]);\n\n return (\n <FlexView $gapX={1.25}>\n <Text $renderAs=\"ab2-black\" $color=\"BLACK_1\">\n Are you happy with {studentName ?? 'her'} progress?\n </Text>\n <Separator heightX={1.5} />\n <FlexView $flexDirection=\"row\" $flexGapX={3} $alignItems=\"center\" $justifyContent=\"center\">\n <Clickable\n label=\"Report thumps up\"\n disabled={isProcessing}\n onClick={handlePositiveFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2.5}\n $borderColor=\"BLACK_5\"\n >\n <Image src={ILLUSTRATIONS.THUMPS_UP} alt=\"UP\" width={32} height={32} />\n </FlexView>\n </Clickable>\n <Clickable\n label=\"Report thumps down\"\n disabled={isProcessing}\n onClick={handleNegativeFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderColor=\"BLACK_5\"\n $borderRadiusX={2.5}\n >\n <Image src={ILLUSTRATIONS.THUMPS_DOWN} alt=\"DOWN\" width={32} height={32} />\n </FlexView>\n </Clickable>\n </FlexView>\n <Separator heightX={1.5} />\n </FlexView>\n );\n};\n\nexport default memo(Feedback);\n"],"names":["Feedback","reportId","studentName","onFeedback","studentCourseId","showSnackbar","onComplete","useCallback","err","data","updateMilestone","isProcessing","useMonthlyReportPatch","handleFeedback","feedback","handlePositiveFeedback","handleNegativeFeedback","jsxs","FlexView","Text","jsx","Separator","Clickable","Image","ILLUSTRATIONS","Feedback$1","memo"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAW,CAAC;AAAA,EAChB,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AACF,MAA2B;AACzB,QAAMC,IAAaC;AAAA,IACjB,CAACC,GAAoBC,MAAkC;AACrD,MAAID,KAAOH,KACIA,EAAA;AAAA,QACX,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,MAAA,CACV,GAGC,CAACG,KAAOL,MAAcM,KAAA,QAAAA,EAAM,aACnBN,EAAAM,EAAK,UAAUL,CAAe;AAAA,IAE7C;AAAA,IACA,CAACD,GAAYC,CAAe;AAAA,EAAA,GAGxB,EAAE,OAAOM,GAAiB,cAAAC,EAAA,IAAiBC,EAAsB;AAAA,IACrE,YAAAN;AAAA,EAAA,CACD,GAEKO,IAAiBN;AAAA,IAC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AA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,cAAa;AAAA,cACb,gBAAgB;AAAA,cAEhB,UAAA,gBAAAE,EAACG,GAAM,EAAA,KAAKC,EAAc,aAAa,KAAI,QAAO,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UAC3E;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAJ,EAACC,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,EAC3B,EAAA,CAAA;AAEJ,GAEeI,IAAAC,EAAK1B,CAAQ;"}
1
+ {"version":3,"file":"feedback.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport type { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport type { IFeedbackTypesProps } from './feedback-types';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../ui/image/image';\nimport {\n useMonthlyReportInvalidate,\n useMonthlyReportPatch,\n} from '../../api/use-monthly-report-get';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\n\nimport * as Styled from './feedback-styled';\n\nconst Feedback = ({\n reportId,\n studentName,\n onFeedback,\n studentCourseId,\n showSnackbar,\n}: IFeedbackTypesProps) => {\n const onComplete = useCallback(\n (err: string | null, data?: IMonthlyReportResponse) => {\n if (err && showSnackbar) {\n showSnackbar({\n type: 'error',\n message: 'Something went wrong. Please try again.',\n bgColor: 'red',\n });\n }\n\n if (!err && onFeedback && data?.feedback) {\n useMonthlyReportInvalidate(reportId);\n onFeedback(data.feedback, studentCourseId);\n }\n },\n [onFeedback, studentCourseId],\n );\n\n const { patch: updateMilestone, isProcessing } = useMonthlyReportPatch({\n onComplete,\n });\n\n const handleFeedback = useCallback(\n (feedback: TFeedback) => {\n updateMilestone(reportId, { feedback });\n },\n [reportId, updateMilestone],\n );\n\n const handlePositiveFeedback = useCallback(() => {\n handleFeedback('positive');\n }, [handleFeedback]);\n\n const handleNegativeFeedback = useCallback(() => {\n handleFeedback('negative');\n }, [handleFeedback]);\n\n return (\n <Styled.FeedbackContainer $gapX={1.25} $background=\"WHITE_3\">\n <Text $renderAs=\"ab2-black\" $color=\"BLACK_1\" $align=\"center\">\n Are you happy with {studentName ?? 'her'} progress?\n </Text>\n <Separator heightX={1.5} />\n <FlexView $flexDirection=\"row\" $flexGapX={3} $alignItems=\"center\" $justifyContent=\"center\">\n <Clickable\n label=\"Report thumps up\"\n disabled={isProcessing}\n onClick={handlePositiveFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2.5}\n $borderColor=\"BLACK_5\"\n >\n <Image src={ILLUSTRATIONS.THUMPS_UP} alt=\"UP\" width={32} height={32} />\n </FlexView>\n </Clickable>\n <Clickable\n label=\"Report thumps down\"\n disabled={isProcessing}\n onClick={handleNegativeFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderColor=\"BLACK_5\"\n $borderRadiusX={2.5}\n >\n <Image src={ILLUSTRATIONS.THUMPS_DOWN} alt=\"DOWN\" width={32} height={32} />\n </FlexView>\n </Clickable>\n </FlexView>\n <Separator heightX={1.5} />\n </Styled.FeedbackContainer>\n );\n};\n\nexport default memo(Feedback);\n"],"names":["Feedback","reportId","studentName","onFeedback","studentCourseId","showSnackbar","onComplete","useCallback","err","data","useMonthlyReportInvalidate","updateMilestone","isProcessing","useMonthlyReportPatch","handleFeedback","feedback","handlePositiveFeedback","handleNegativeFeedback","Styled.FeedbackContainer","jsxs","Text","jsx","Separator","FlexView","Clickable","Image","ILLUSTRATIONS","Feedback$1","memo"],"mappings":";;;;;;;;;;AAiBA,MAAMA,IAAW,CAAC;AAAA,EAChB,UAAA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UACN,UAAUZ;AAAA,UACV,SAASI;AAAA,UAET,UAAA,gBAAAK;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,gBAAgB;AAAA,cAChB,cAAa;AAAA,cAEb,UAAA,gBAAAF,EAACI,GAAM,EAAA,KAAKC,EAAc,WAAW,KAAI,MAAK,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UACvE;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAL;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,UAAUZ;AAAA,UACV,SAASK;AAAA,UAET,UAAA,gBAAAI;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,cAAa;AAAA,cACb,gBAAgB;AAAA,cAEhB,UAAA,gBAAAF,EAACI,GAAM,EAAA,KAAKC,EAAc,aAAa,KAAI,QAAO,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UAC3E;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAL,EAACC,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,EAC3B,EAAA,CAAA;AAEJ,GAEeK,IAAAC,EAAK5B,CAAQ;"}
@@ -1,45 +1,48 @@
1
- import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
- import { memo as d, useCallback as l, useEffect as u } from "react";
3
- import { useMonthlyReportGet as _ } from "./api/use-monthly-report-get.js";
4
- import h from "../../ui/loader/app-loader/app-loader.js";
5
- import g from "../../ui/error/error.js";
6
- import { MonthlyReportContainer as v } from "./monthly-report-styled.js";
7
- import y from "./comps/goals/goals.js";
8
- import R from "./comps/activities/activities.js";
9
- import x from "../../ui/layout/flex-view.js";
10
- import A from "./comps/attendance/attendance.js";
11
- import C from "./comps/feedback/feedback.js";
1
+ import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
+ import { memo as _, useCallback as h, useEffect as m } from "react";
3
+ import { useMonthlyReportGet as g } from "./api/use-monthly-report-get.js";
4
+ import y from "../../ui/loader/app-loader/app-loader.js";
5
+ import v from "../../ui/error/error.js";
6
+ import { MonthlyReportContainer as x } from "./monthly-report-styled.js";
7
+ import R from "./comps/goals/goals.js";
8
+ import A from "./comps/activities/activities.js";
9
+ import c from "../../ui/layout/flex-view.js";
10
+ import C from "./comps/attendance/attendance.js";
11
+ import $ from "./comps/feedback/feedback.js";
12
+ import j from "./comps/achievements/achievements.js";
12
13
  import { IS_APP_RUNNING_IN_RN as D } from "../../../constants/app-config.js";
13
- import M from "./comps/achievements/achievements.js";
14
- const N = ({
14
+ const I = ({
15
15
  studentName: i,
16
- reportId: r,
17
- onPuzzleClick: a,
16
+ reportId: o,
17
+ onPuzzleClick: p,
18
18
  showSnackbar: s,
19
- onFeedback: m
19
+ onFeedback: f
20
20
  }) => {
21
21
  const {
22
22
  get: n,
23
23
  data: e,
24
- isProcessing: p,
25
- isProcessingFailed: c
26
- } = _(), o = l(() => {
27
- n(r);
28
- }, [n, r]);
29
- return u(() => {
30
- o();
31
- }, [o]), p || !e ? /* @__PURE__ */ t(h, { height: "100dvh" }) : c ? /* @__PURE__ */ t(x, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(g, { onTryAgain: o }) }) : e ? /* @__PURE__ */ f(v, { children: [
32
- /* @__PURE__ */ t(y, { milestones: e.progress_data.user_milestones, isExpended: !0 }),
33
- /* @__PURE__ */ t(R, { activities: e.progress_data.activities, onPuzzleClick: a }),
24
+ isProcessing: a,
25
+ isProcessingFailed: l,
26
+ isStale: d
27
+ } = g(), r = h(() => {
28
+ n(o);
29
+ }, [n, o]);
30
+ return m(() => {
31
+ r();
32
+ }, [r]), m(() => {
33
+ d && !a && r();
34
+ }, []), a || !e ? /* @__PURE__ */ t(c, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(y, { height: "100dvh" }) }) : l ? /* @__PURE__ */ t(c, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(v, { onTryAgain: r }) }) : e ? /* @__PURE__ */ u(x, { children: [
35
+ /* @__PURE__ */ t(R, { milestones: e.progress_data.user_milestones, isExpended: !0 }),
36
+ /* @__PURE__ */ t(A, { activities: e.progress_data.activities, onPuzzleClick: p }),
34
37
  /* @__PURE__ */ t(
35
- M,
38
+ j,
36
39
  {
37
40
  achievements: e.progress_data.user_achievements,
38
41
  studentName: i
39
42
  }
40
43
  ),
41
44
  /* @__PURE__ */ t(
42
- A,
45
+ C,
43
46
  {
44
47
  calendarData: e.calendar_data,
45
48
  reportMonth: e.report_month,
@@ -48,17 +51,17 @@ const N = ({
48
51
  }
49
52
  ),
50
53
  D && !e.feedback && e.student_course_ids[0] && /* @__PURE__ */ t(
51
- C,
54
+ $,
52
55
  {
53
- reportId: r,
56
+ reportId: o,
54
57
  studentName: i,
55
- onFeedback: m,
58
+ onFeedback: f,
56
59
  studentCourseId: e.student_course_ids[0],
57
60
  showSnackbar: s
58
61
  }
59
62
  )
60
63
  ] }) : null;
61
- }, Y = d(N);
64
+ }, Y = _(I);
62
65
  export {
63
66
  Y as default
64
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"monthly-report.js","sources":["../../../../src/features/timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { useMonthlyReportGet } from './api/use-monthly-report-get';\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 { IS_APP_RUNNING_IN_RN } from '../../../constants/app-config';\nimport Achievements from './comps/achievements/achievements';\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 } = useMonthlyReportGet();\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing || !reportData) {\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 if (!reportData) {\n return null;\n }\n\n return (\n <Styled.MonthlyReportContainer>\n <Goals milestones={reportData.progress_data.user_milestones} isExpended={true} />\n <Activities activities={reportData.progress_data.activities} onPuzzleClick={onPuzzleClick} />\n <Achievements\n achievements={reportData.progress_data.user_achievements}\n studentName={studentName}\n />\n <Attendance\n calendarData={reportData.calendar_data}\n reportMonth={reportData.report_month}\n reportYear={reportData.report_year}\n onDateClick={showSnackbar}\n />\n {IS_APP_RUNNING_IN_RN && !reportData.feedback && reportData.student_course_ids[0] && (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={reportData.student_course_ids[0]}\n showSnackbar={showSnackbar}\n />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","getReport","reportData","isProcessing","isProcessingFailed","useMonthlyReportGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AA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C;AAAA,QAChD,cAAAH;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA,IA1BO;AA4BX,GAEesB,IAAAC,EAAK3B,CAAa;"}
1
+ {"version":3,"file":"monthly-report.js","sources":["../../../../src/features/timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { useMonthlyReportGet } from './api/use-monthly-report-get';\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';\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 } = useMonthlyReportGet();\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 }, []);\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 if (!reportData) {\n return null;\n }\n\n return (\n <Styled.MonthlyReportContainer>\n <Goals milestones={reportData.progress_data.user_milestones} isExpended={true} />\n <Activities activities={reportData.progress_data.activities} onPuzzleClick={onPuzzleClick} />\n <Achievements\n achievements={reportData.progress_data.user_achievements}\n studentName={studentName}\n />\n <Attendance\n calendarData={reportData.calendar_data}\n reportMonth={reportData.report_month}\n reportYear={reportData.report_year}\n onDateClick={showSnackbar}\n />\n {IS_APP_RUNNING_IN_RN && !reportData.feedback && reportData.student_course_ids[0] && (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={reportData.student_course_ids[0]}\n showSnackbar={showSnackbar}\n />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","getReport","reportData","isProcessing","isProcessingFailed","isStale","useMonthlyReportGet","fetchData","useCallback","useEffect","jsx","FlexView","AppLoader","Error","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;AAeA,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,MACEC,EAAoB,GAElBC,IAAYC,EAAY,MAAM;AAClC,IAAAP,EAAUJ,CAAQ;AAAA,EAAA,GACjB,CAACI,GAAWJ,CAAQ,CAAC;AAYpB,SAVJY,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEdE,EAAU,MAAM;AACV,IAAAJ,KAAW,CAACF,KACJI;EAEd,GAAG,CAAE,CAAA,GAEDJ,KAAgB,CAACD,IAEhB,gBAAAQ,EAAAC,GAAA,EAAS,OAAO,GAAG,aAAY,UAAS,iBAAgB,UACvD,UAAC,gBAAAD,EAAAE,GAAA,EAAU,QAAO,SAAA,CAAS,E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