@cuemath/leap 2.8.60-ag3 → 2.8.60-as1
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/constants/api.js +2 -3
- package/dist/constants/api.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +7 -9
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +4 -5
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +1 -2
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +7 -7
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +6 -6
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +2 -2
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +18 -18
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +22 -44
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +157 -211
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/styles.js +30 -37
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/create/api/goal-submit.js +1 -1
- package/dist/features/milestone/create/api/goal-submit.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/patch-goal-plan.js +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/patch-goal-plan.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-milestone-resources.js +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-milestone-resources.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +81 -127
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-item.js +41 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-item.js.map +1 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view-styled.js +10 -16
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view-styled.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +46 -77
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/recent-chapters/recent-chapters.js +31 -28
- package/dist/features/recent-chapters/recent-chapters.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-item.js +51 -0
- package/dist/features/sheet-v2/resource-list/resource-item.js.map +1 -0
- package/dist/features/sheet-v2/resource-list/resource-list.js +21 -40
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/features/sheets/resources-list/resource-item/resource-item.js.map +1 -1
- package/dist/features/sheets/resources-list/resource-item/styled.js +0 -1
- package/dist/features/sheets/resources-list/resource-item/styled.js.map +1 -1
- package/dist/features/sheets/sheets-analytics-events.js +2 -6
- package/dist/features/sheets/sheets-analytics-events.js.map +1 -1
- package/dist/index.d.ts +9 -12
- package/dist/index.js +326 -328
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +0 -444
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js +0 -10
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\nexport interface ICardWrapperProps {\n $bgImage: string;\n}\n\nexport interface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: fit-content;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n theme,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n left: 0;\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport interface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\n\nexport const CardOptions = styled(FlexView)`\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n width: 180px;\n position: relative;\n left: 0;\n top: 0;\n`;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","CardOptions","CardOptionWrapper","$disabled","OptionText"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IA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,EAA2B,CAAC;AAAA,EAC1E,OAAAC;AAAA,EACA,WAAAiB;AACF,MACS;AAAA,cACKA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,oBAG/BA,IAAY,gBAAgBjB,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIpDA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGjC,GAEYkB,IAAapB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createPostAPI as t } from "@cuemath/rest-api";
|
2
|
-
import {
|
2
|
+
import { BASE_URL_V3_1 as e } from "../../../../constants/api.js";
|
3
3
|
const { usePost: i } = t({
|
4
4
|
getURL: (s, { studentId: o }) => `${e}/users/${o}/milestones/`
|
5
5
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"goal-submit.js","sources":["../../../../../src/features/milestone/create/api/goal-submit.ts"],"sourcesContent":["import type { TMilestonePayload } from '../milestone-create-types';\n\nimport { createPostAPI } from '@cuemath/rest-api';\n\nimport {
|
1
|
+
{"version":3,"file":"goal-submit.js","sources":["../../../../../src/features/milestone/create/api/goal-submit.ts"],"sourcesContent":["import type { TMilestonePayload } from '../milestone-create-types';\n\nimport { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_1 } from '../../../../constants/api';\n\nconst { usePost: useGoalCreationPost } = createPostAPI<\n { id: string },\n TMilestonePayload,\n { studentId: string }\n>({\n getURL: (_, { studentId }) => `${BASE_URL_V3_1}/users/${studentId}/milestones/`,\n});\n\nexport { useGoalCreationPost };\n"],"names":["useGoalCreationPost","createPostAPI","_","studentId","BASE_URL_V3_1"],"mappings":";;AAMA,MAAM,EAAE,SAASA,EAAoB,IAAIC,EAIvC;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,WAAAC,EAAgB,MAAA,GAAGC,CAAa,UAAUD,CAAS;AACnE,CAAC;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createPatchAPI as e } from "@cuemath/rest-api";
|
2
|
-
import {
|
2
|
+
import { BASE_URL_V3_1 as o } from "../../../../../../constants/api.js";
|
3
3
|
const { usePatch: c } = e({
|
4
4
|
getURL: (t) => `${o}/user-milestone/${t}`
|
5
5
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"patch-goal-plan.js","sources":["../../../../../../../src/features/milestone/edit/comps/edit-milestone-modal/api/patch-goal-plan.ts"],"sourcesContent":["import { createPatchAPI } from '@cuemath/rest-api';\n\nimport {
|
1
|
+
{"version":3,"file":"patch-goal-plan.js","sources":["../../../../../../../src/features/milestone/edit/comps/edit-milestone-modal/api/patch-goal-plan.ts"],"sourcesContent":["import { createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_1 } from '../../../../../../constants/api';\n\nconst { usePatch: useGoalPlanPatch } = createPatchAPI<{ id: string }, Record<string, unknown>>({\n getURL: milestoneId => `${BASE_URL_V3_1}/user-milestone/${milestoneId}`,\n});\n\nexport { useGoalPlanPatch };\n"],"names":["useGoalPlanPatch","createPatchAPI","milestoneId","BASE_URL_V3_1"],"mappings":";;AAIA,MAAM,EAAE,UAAUA,EAAiB,IAAIC,EAAwD;AAAA,EAC7F,QAAQ,CAAAC,MAAe,GAAGC,CAAa,mBAAmBD,CAAW;AACvE,CAAC;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createGetAPI as t } from "@cuemath/rest-api";
|
2
|
-
import {
|
2
|
+
import { BASE_URL_V3 as o } from "../../../../constants/api.js";
|
3
3
|
const { useGet: n, invalidate: a } = t({
|
4
4
|
getURL: (e, r, { studentId: s }) => `${o}/users/${s}/user-milestone/${e}/resources`
|
5
5
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-milestone-resources.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-milestone-resources.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport {
|
1
|
+
{"version":3,"file":"get-milestone-resources.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-milestone-resources.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\ninterface IGetMilestoneResourcesAPIMetaData {\n studentId: string;\n}\n\nconst { useGet: useGetMilestoneResources, invalidate: invalidateMilestoneResources } = createGetAPI<\n INodeDataProps[],\n void,\n IGetMilestoneResourcesAPIMetaData\n>({\n getURL: (userMilestoneId, _, { studentId }) =>\n `${BASE_URL_V3}/users/${studentId}/user-milestone/${userMilestoneId}/resources`,\n});\n\nexport { useGetMilestoneResources, invalidateMilestoneResources };\n"],"names":["useGetMilestoneResources","invalidateMilestoneResources","createGetAPI","userMilestoneId","_","studentId","BASE_URL_V3"],"mappings":";;AAUA,MAAM,EAAE,QAAQA,GAA0B,YAAYC,EAAA,IAAiCC,EAIrF;AAAA,EACA,QAAQ,CAACC,GAAiBC,GAAG,EAAE,WAAAC,EAAA,MAC7B,GAAGC,CAAW,UAAUD,CAAS,mBAAmBF,CAAe;AACvE,CAAC;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createGetAPI as s } from "@cuemath/rest-api";
|
2
|
-
import {
|
2
|
+
import { BASE_URL_V3 as a } from "../../../../constants/api.js";
|
3
3
|
const { useGet: l, invalidate: m } = s({
|
4
4
|
getURL: (e, r, { studentId: t }) => `${a}/users/${t}/user-milestone/${e}/tests`
|
5
5
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-tests-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-tests-list.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport {
|
1
|
+
{"version":3,"file":"get-tests-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-tests-list.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\n//* Home page test help data.\nconst { useGet: useGetTestHelpData, invalidate: invalidateTestHelpData } = createGetAPI<\n INodeDataProps[],\n void,\n {\n studentId: string;\n }\n>({\n getURL: (userMilestoneId, _, { studentId }) =>\n `${BASE_URL_V3}/users/${studentId}/user-milestone/${userMilestoneId}/tests`,\n});\n\nexport { useGetTestHelpData, invalidateTestHelpData };\n"],"names":["useGetTestHelpData","invalidateTestHelpData","createGetAPI","userMilestoneId","_","studentId","BASE_URL_V3"],"mappings":";;AAOA,MAAM,EAAE,QAAQA,GAAoB,YAAYC,EAAA,IAA2BC,EAMzE;AAAA,EACA,QAAQ,CAACC,GAAiBC,GAAG,EAAE,WAAAC,EAAA,MAC7B,GAAGC,CAAW,UAAUD,CAAS,mBAAmBF,CAAe;AACvE,CAAC;"}
|
@@ -1,165 +1,119 @@
|
|
1
|
-
import {
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import
|
14
|
-
|
1
|
+
import { jsx as e, jsxs as d, Fragment as w } from "react/jsx-runtime";
|
2
|
+
import { memo as M, useCallback as A, useEffect as x } from "react";
|
3
|
+
import H from "styled-components";
|
4
|
+
import { IMAGES as P } from "../../../../assets/images/images.js";
|
5
|
+
import N from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import b from "../../../ui/buttons/button/button.js";
|
7
|
+
import S from "../../../ui/layout/flex-view.js";
|
8
|
+
import k from "../../../ui/loader/app-loader/app-loader.js";
|
9
|
+
import $ from "../../../ui/separator/separator.js";
|
10
|
+
import y from "../../../ui/text/text.js";
|
11
|
+
import { MILESTONE_WIDGET_MIN_HEIGHT as L } from "../../constants.js";
|
12
|
+
import { useGetTestHelpData as O } from "../../milestone-list-container/api/get-tests-list.js";
|
13
|
+
import { TESTS_CREATION_ANALYTICS_EVENTS as X } from "../tests-creation/tests-creation-analytics-events.js";
|
14
|
+
import j from "./test-list-view.js";
|
15
|
+
const s = H(S)`
|
16
|
+
position: relative;
|
17
|
+
min-height: ${L}px;
|
18
|
+
`, Q = M((o) => {
|
15
19
|
const {
|
16
|
-
isChaptersAvailable:
|
17
|
-
isDraftMilestone:
|
18
|
-
isMilestoneActive:
|
19
|
-
userType:
|
20
|
-
studentId:
|
21
|
-
userMilestoneId:
|
22
|
-
canUpdatePlan:
|
23
|
-
} =
|
24
|
-
get:
|
25
|
-
data:
|
26
|
-
isProcessingFailed:
|
27
|
-
isProcessed:
|
28
|
-
isStale:
|
29
|
-
isProcessing:
|
30
|
-
} =
|
31
|
-
|
32
|
-
studentId:
|
20
|
+
isChaptersAvailable: p,
|
21
|
+
isDraftMilestone: h,
|
22
|
+
isMilestoneActive: n,
|
23
|
+
userType: T,
|
24
|
+
studentId: a,
|
25
|
+
userMilestoneId: r,
|
26
|
+
canUpdatePlan: f
|
27
|
+
} = o, { onCreateMilestoneTest: i } = o, {
|
28
|
+
get: g,
|
29
|
+
data: t,
|
30
|
+
isProcessingFailed: l,
|
31
|
+
isProcessed: m,
|
32
|
+
isStale: u,
|
33
|
+
isProcessing: E
|
34
|
+
} = O(), I = !f || !p || !n || n && h, _ = n && !p ? "Chapters need to be assigned" : h ? "Allowed after plan is published" : "Plan is completed", c = A(() => {
|
35
|
+
g(r, void 0, {
|
36
|
+
studentId: a
|
33
37
|
});
|
34
|
-
}, [
|
35
|
-
|
36
|
-
!
|
37
|
-
}, [
|
38
|
-
const
|
38
|
+
}, [g, a, r]);
|
39
|
+
x(() => {
|
40
|
+
!E && (!m && !l || u) && c();
|
41
|
+
}, [c, m, E, l, u]);
|
42
|
+
const C = A(() => {
|
39
43
|
if (typeof i == "function") {
|
40
|
-
i == null || i(
|
44
|
+
i == null || i(r, ((t == null ? void 0 : t.length) || 0) + 1);
|
41
45
|
return;
|
42
46
|
}
|
43
47
|
throw new Error("No callback provided. If provided it must be a function");
|
44
|
-
}, [i,
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
48
|
+
}, [i, r, t]);
|
49
|
+
return l ? /* @__PURE__ */ e(s, { $alignItems: "center", $justifyContent: "center", $background: "WHITE", children: /* @__PURE__ */ d(S, { $flexGapX: 1.5, $alignItems: "center", $justifyContent: "center", children: [
|
50
|
+
/* @__PURE__ */ e(y, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
51
|
+
/* @__PURE__ */ e(
|
52
|
+
b,
|
53
|
+
{
|
54
|
+
widthX: 14,
|
55
|
+
size: "small",
|
56
|
+
shape: "square",
|
57
|
+
renderAs: "primary",
|
58
|
+
label: "Try again",
|
59
|
+
onClick: c
|
49
60
|
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
), O = l(
|
54
|
-
(a) => {
|
55
|
-
if (typeof n == "function") {
|
56
|
-
n == null || n(a);
|
57
|
-
return;
|
58
|
-
}
|
59
|
-
throw new Error("No callback provided. If provided it must be a function");
|
60
|
-
},
|
61
|
-
[n]
|
62
|
-
), P = l(
|
63
|
-
(a) => {
|
64
|
-
if (typeof s == "function") {
|
65
|
-
s == null || s(a, t);
|
66
|
-
return;
|
67
|
-
}
|
68
|
-
throw new Error("No callback provided. If provided it must be a function");
|
69
|
-
},
|
70
|
-
[s, t]
|
71
|
-
);
|
72
|
-
return p ? /* @__PURE__ */ u(
|
73
|
-
T,
|
74
|
-
{
|
75
|
-
$flexGapX: 1.5,
|
76
|
-
$alignItems: "center",
|
77
|
-
$justifyContent: "center",
|
78
|
-
$height: "100%",
|
79
|
-
$background: "WHITE",
|
80
|
-
children: [
|
81
|
-
/* @__PURE__ */ e(N, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
82
|
-
/* @__PURE__ */ e(
|
83
|
-
S,
|
84
|
-
{
|
85
|
-
widthX: 14,
|
86
|
-
size: "small",
|
87
|
-
shape: "square",
|
88
|
-
renderAs: "primary",
|
89
|
-
label: "Try again",
|
90
|
-
onClick: h
|
91
|
-
}
|
92
|
-
)
|
93
|
-
]
|
94
|
-
}
|
95
|
-
) : f ? r != null && r.length ? /* @__PURE__ */ e(
|
96
|
-
W,
|
61
|
+
)
|
62
|
+
] }) }) : m ? t != null && t.length ? /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
63
|
+
j,
|
97
64
|
{
|
98
|
-
...
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
onCreateNewTest: $,
|
107
|
-
canUpdatedPlan: I,
|
108
|
-
isMilestoneActive: d
|
65
|
+
...o,
|
66
|
+
milestoneId: r,
|
67
|
+
sheets: t,
|
68
|
+
userType: T,
|
69
|
+
studentId: a,
|
70
|
+
onCreateNewTest: C,
|
71
|
+
canUpdatedPlan: f,
|
72
|
+
isMilestoneActive: n
|
109
73
|
}
|
110
|
-
) : /* @__PURE__ */
|
111
|
-
|
74
|
+
) }) : /* @__PURE__ */ d(
|
75
|
+
s,
|
112
76
|
{
|
113
77
|
$gapX: 6.75,
|
114
78
|
$alignItems: "center",
|
115
79
|
$justifyContent: "center",
|
116
80
|
$background: "WHITE",
|
117
|
-
$height: v,
|
118
81
|
children: [
|
119
|
-
/* @__PURE__ */ e("img", { src:
|
120
|
-
/* @__PURE__ */ e(
|
121
|
-
|
82
|
+
/* @__PURE__ */ e("img", { src: P.EMPTY_MIX_TESTS, alt: "empty_mix_tests" }),
|
83
|
+
/* @__PURE__ */ e($, { heightX: 2 }),
|
84
|
+
T === "TEACHER" ? /* @__PURE__ */ d(w, { children: [
|
122
85
|
/* @__PURE__ */ e(
|
123
|
-
|
86
|
+
N,
|
124
87
|
{
|
125
88
|
renderAs: "primary",
|
126
89
|
position: "bottom",
|
127
|
-
hidden: !
|
128
|
-
tooltipItem:
|
90
|
+
hidden: !I,
|
91
|
+
tooltipItem: _,
|
129
92
|
children: /* @__PURE__ */ e(
|
130
|
-
|
93
|
+
b,
|
131
94
|
{
|
132
95
|
widthX: 10,
|
133
96
|
renderAs: "primary",
|
134
97
|
shape: "square",
|
135
98
|
size: "small",
|
136
99
|
label: "Create a Test",
|
137
|
-
onClick:
|
138
|
-
disabled:
|
139
|
-
analyticsLabel:
|
100
|
+
onClick: C,
|
101
|
+
disabled: I,
|
102
|
+
analyticsLabel: X.CUSTOM_TEST_CREATION_STARTED,
|
140
103
|
analyticsProps: {
|
141
|
-
milestone_id:
|
104
|
+
milestone_id: r
|
142
105
|
}
|
143
106
|
}
|
144
107
|
)
|
145
108
|
}
|
146
109
|
),
|
147
|
-
/* @__PURE__ */ e(
|
148
|
-
] }) : /* @__PURE__ */ e(
|
110
|
+
/* @__PURE__ */ e($, { heightX: 2 })
|
111
|
+
] }) : /* @__PURE__ */ e(y, { $renderAs: "ab2-bold", $color: "BLACK_T_87", children: "Wait for the teacher to create a test" })
|
149
112
|
]
|
150
113
|
}
|
151
|
-
) : /* @__PURE__ */ e(
|
152
|
-
T,
|
153
|
-
{
|
154
|
-
$height: v,
|
155
|
-
$alignItems: "center",
|
156
|
-
$justifyContent: "center",
|
157
|
-
$background: "WHITE",
|
158
|
-
children: /* @__PURE__ */ e(j, { height: "100%" })
|
159
|
-
}
|
160
|
-
);
|
114
|
+
) : /* @__PURE__ */ e(s, { $alignItems: "center", $justifyContent: "center", $background: "WHITE", children: /* @__PURE__ */ e(k, { height: "100%" }) });
|
161
115
|
});
|
162
116
|
export {
|
163
|
-
|
117
|
+
Q as default
|
164
118
|
};
|
165
119
|
//# sourceMappingURL=test-list-container.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-list-container.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-container.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestsListProps } from './types';\n\nimport { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { IMAGES } from '../../../../assets/images/images';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { useGetTestHelpData } from '../../milestone-list-container/api/get-tests-list';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport TestSheetsList from './test-list-view';\n\nconst MilestoneTestsList: FC<ITestsListProps> = memo(props => {\n const {\n isChaptersAvailable,\n isDraftMilestone,\n isMilestoneActive,\n userType,\n studentId,\n userMilestoneId,\n canUpdatePlan,\n } = props;\n const { onCreateMilestoneTest, onTestPreview, onTestStart, onTestReview } = props;\n\n const {\n get: getTestHelpData,\n data,\n isProcessingFailed,\n isProcessed,\n isStale,\n isProcessing,\n } = useGetTestHelpData();\n\n const isTestSheetCreationDisabled =\n !canUpdatePlan ||\n !isChaptersAvailable ||\n !isMilestoneActive ||\n (isMilestoneActive && isDraftMilestone);\n const testCreationCtaTooltipText =\n isMilestoneActive && !isChaptersAvailable\n ? 'Chapters need to be assigned'\n : isDraftMilestone\n ? 'Allowed after plan is published'\n : 'Plan is completed';\n\n const handleOnTryAgain = useCallback(() => {\n getTestHelpData(userMilestoneId, undefined, {\n studentId,\n });\n }, [getTestHelpData, studentId, userMilestoneId]);\n\n useEffect(() => {\n if (!isProcessing && ((!isProcessed && !isProcessingFailed) || isStale)) {\n handleOnTryAgain();\n }\n }, [handleOnTryAgain, isProcessed, isProcessing, isProcessingFailed, isStale]);\n\n const handleOnCreateMilestoneTest = useCallback(() => {\n if (typeof onCreateMilestoneTest === 'function') {\n onCreateMilestoneTest?.(userMilestoneId, (data?.length || 0) + 1);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n }, [onCreateMilestoneTest, userMilestoneId, data]);\n\n const handleOnTestPreview = useCallback(\n (sheetData: INodeDataProps) => {\n if (typeof onTestPreview === 'function') {\n onTestPreview?.(sheetData, userMilestoneId);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n },\n [onTestPreview, userMilestoneId],\n );\n\n const handleOnTestStart = useCallback(\n (sheetData: INodeDataProps) => {\n if (typeof onTestStart === 'function') {\n onTestStart?.(sheetData);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n },\n [onTestStart],\n );\n\n const handleOnTestReview = useCallback(\n (sheetData: INodeDataProps) => {\n if (typeof onTestReview === 'function') {\n onTestReview?.(sheetData, userMilestoneId);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n },\n [onTestReview, userMilestoneId],\n );\n\n if (isProcessingFailed) {\n return (\n <FlexView\n $flexGapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height=\"100%\"\n $background=\"WHITE\"\n >\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={handleOnTryAgain}\n />\n </FlexView>\n );\n }\n\n if (isProcessed) {\n if (data?.length) {\n return (\n <TestSheetsList\n {...props}\n onNodeAttempt={handleOnTestStart}\n onNodeView={handleOnTestPreview}\n onNodeReview={handleOnTestReview}\n milestoneId={userMilestoneId}\n sheets={data}\n userType={userType}\n studentId={studentId}\n onCreateNewTest={handleOnCreateMilestoneTest}\n canUpdatedPlan={canUpdatePlan}\n isMilestoneActive={isMilestoneActive}\n />\n );\n }\n\n return (\n <FlexView\n $gapX={6.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n >\n <img src={IMAGES.EMPTY_MIX_TESTS} alt=\"empty_mix_tests\" />\n <Separator heightX={2} />\n {userType === 'TEACHER' ? (\n <>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n hidden={!isTestSheetCreationDisabled}\n tooltipItem={testCreationCtaTooltipText}\n >\n <Button\n widthX={10}\n renderAs=\"primary\"\n shape=\"square\"\n size=\"small\"\n label=\"Create a Test\"\n onClick={handleOnCreateMilestoneTest}\n disabled={isTestSheetCreationDisabled}\n analyticsLabel={TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_CREATION_STARTED}\n analyticsProps={{\n milestone_id: userMilestoneId,\n }}\n />\n </ArrowTooltip>\n <Separator heightX={2} />\n </>\n ) : (\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_T_87\">\n Wait for the teacher to create a test\n </Text>\n )}\n </FlexView>\n );\n }\n\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n >\n <AppLoader height=\"100%\" />\n </FlexView>\n );\n});\n\nexport default MilestoneTestsList;\n"],"names":["MilestoneTestsList","memo","props","isChaptersAvailable","isDraftMilestone","isMilestoneActive","userType","studentId","userMilestoneId","canUpdatePlan","onCreateMilestoneTest","onTestPreview","onTestStart","onTestReview","getTestHelpData","data","isProcessingFailed","isProcessed","isStale","isProcessing","useGetTestHelpData","isTestSheetCreationDisabled","testCreationCtaTooltipText","handleOnTryAgain","useCallback","useEffect","handleOnCreateMilestoneTest","handleOnTestPreview","sheetData","handleOnTestStart","handleOnTestReview","jsxs","FlexView","jsx","Text","Button","TestSheetsList","MILESTONE_WIDGET_MIN_HEIGHT","IMAGES","Separator","Fragment","ArrowTooltip","TESTS_CREATION_ANALYTICS_EVENTS","AppLoader"],"mappings":";;;;;;;;;;;;;AAiBM,MAAAA,KAA0CC,EAAK,CAASC,MAAA;AACtD,QAAA;AAAA,IACJ,qBAAAC;AAAA,IACA,kBAAAC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A,MACZ,iBAAgB;AAAA,MAChB,aAAY;AAAA,MACZ,SAASK;AAAA,MAET,UAAA;AAAA,QAAA,gBAAAJ,EAAC,OAAI,EAAA,KAAKK,EAAO,iBAAiB,KAAI,mBAAkB;AAAA,QACxD,gBAAAL,EAACM,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QACtBjC,MAAa,YAEV,gBAAAyB,EAAAS,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,QAAQ,CAACpB;AAAA,cACT,aAAaC;AAAA,cAEb,UAAA,gBAAAW;AAAA,gBAACE;AAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,UAAS;AAAA,kBACT,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,OAAM;AAAA,kBACN,SAAST;AAAA,kBACT,UAAUL;AAAA,kBACV,gBAAgBqB,EAAgC;AAAA,kBAChD,gBAAgB;AAAA,oBACd,cAAclC;AAAA,kBAChB;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAyB,EAACM,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QAAA,EAAA,CACzB,IAEC,gBAAAN,EAAAC,GAAA,EAAK,WAAU,YAAW,QAAO,cAAa,UAE/C,yCAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAON,gBAAAD;AAAA,IAACD;AAAA,IAAA;AAAA,MACC,SAASK;AAAA,MACT,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,aAAY;AAAA,MAEZ,UAAA,gBAAAJ,EAACU,GAAU,EAAA,QAAO,OAAO,CAAA;AAAA,IAAA;AAAA,EAAA;AAG/B,CAAC;"}
|
1
|
+
{"version":3,"file":"test-list-container.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-container.tsx"],"sourcesContent":["import type { ITestsListProps } from './types';\n\nimport { memo, useCallback, useEffect, type FC } from 'react';\nimport styled from 'styled-components';\n\nimport { IMAGES } from '../../../../assets/images/images';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { useGetTestHelpData } from '../../milestone-list-container/api/get-tests-list';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport TestSheetsList from './test-list-view';\n\nconst TestHelpWrapper = styled(FlexView)`\n position: relative;\n min-height: ${MILESTONE_WIDGET_MIN_HEIGHT}px;\n`;\n\nconst MilestoneTestsList: FC<ITestsListProps> = memo(props => {\n const {\n isChaptersAvailable,\n isDraftMilestone,\n isMilestoneActive,\n userType,\n studentId,\n userMilestoneId,\n canUpdatePlan,\n } = props;\n const { onCreateMilestoneTest } = props;\n\n const {\n get: getTestHelpData,\n data,\n isProcessingFailed,\n isProcessed,\n isStale,\n isProcessing,\n } = useGetTestHelpData();\n\n const isTestSheetCreationDisabled =\n !canUpdatePlan ||\n !isChaptersAvailable ||\n !isMilestoneActive ||\n (isMilestoneActive && isDraftMilestone);\n const testCreationCtaTooltipText =\n isMilestoneActive && !isChaptersAvailable\n ? 'Chapters need to be assigned'\n : isDraftMilestone\n ? 'Allowed after plan is published'\n : 'Plan is completed';\n\n const handleOnTryAgain = useCallback(() => {\n getTestHelpData(userMilestoneId, undefined, {\n studentId,\n });\n }, [getTestHelpData, studentId, userMilestoneId]);\n\n useEffect(() => {\n if (!isProcessing && ((!isProcessed && !isProcessingFailed) || isStale)) {\n handleOnTryAgain();\n }\n }, [handleOnTryAgain, isProcessed, isProcessing, isProcessingFailed, isStale]);\n\n const handleOnCreateMilestoneTest = useCallback(() => {\n if (typeof onCreateMilestoneTest === 'function') {\n onCreateMilestoneTest?.(userMilestoneId, (data?.length || 0) + 1);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n }, [onCreateMilestoneTest, userMilestoneId, data]);\n\n if (isProcessingFailed) {\n return (\n <TestHelpWrapper $alignItems=\"center\" $justifyContent=\"center\" $background=\"WHITE\">\n <FlexView $flexGapX={1.5} $alignItems=\"center\" $justifyContent=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={handleOnTryAgain}\n />\n </FlexView>\n </TestHelpWrapper>\n );\n }\n\n if (isProcessed) {\n if (data?.length) {\n return (\n <TestHelpWrapper>\n <TestSheetsList\n {...props}\n milestoneId={userMilestoneId}\n sheets={data}\n userType={userType}\n studentId={studentId}\n onCreateNewTest={handleOnCreateMilestoneTest}\n canUpdatedPlan={canUpdatePlan}\n isMilestoneActive={isMilestoneActive}\n />\n </TestHelpWrapper>\n );\n }\n\n return (\n <TestHelpWrapper\n $gapX={6.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n >\n <img src={IMAGES.EMPTY_MIX_TESTS} alt=\"empty_mix_tests\" />\n <Separator heightX={2} />\n {userType === 'TEACHER' ? (\n <>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n hidden={!isTestSheetCreationDisabled}\n tooltipItem={testCreationCtaTooltipText}\n >\n <Button\n widthX={10}\n renderAs=\"primary\"\n shape=\"square\"\n size=\"small\"\n label=\"Create a Test\"\n onClick={handleOnCreateMilestoneTest}\n disabled={isTestSheetCreationDisabled}\n analyticsLabel={TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_CREATION_STARTED}\n analyticsProps={{\n milestone_id: userMilestoneId,\n }}\n />\n </ArrowTooltip>\n <Separator heightX={2} />\n </>\n ) : (\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_T_87\">\n Wait for the teacher to create a test\n </Text>\n )}\n </TestHelpWrapper>\n );\n }\n\n return (\n <TestHelpWrapper $alignItems=\"center\" $justifyContent=\"center\" $background=\"WHITE\">\n <AppLoader height=\"100%\" />\n </TestHelpWrapper>\n );\n});\n\nexport default MilestoneTestsList;\n"],"names":["TestHelpWrapper","styled","FlexView","MILESTONE_WIDGET_MIN_HEIGHT","MilestoneTestsList","memo","props","isChaptersAvailable","isDraftMilestone","isMilestoneActive","userType","studentId","userMilestoneId","canUpdatePlan","onCreateMilestoneTest","getTestHelpData","data","isProcessingFailed","isProcessed","isStale","isProcessing","useGetTestHelpData","isTestSheetCreationDisabled","testCreationCtaTooltipText","handleOnTryAgain","useCallback","useEffect","handleOnCreateMilestoneTest","jsx","jsxs","Text","Button","TestSheetsList","IMAGES","Separator","Fragment","ArrowTooltip","TESTS_CREATION_ANALYTICS_EVENTS","AppLoader"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAMA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA,gBAEvBC,CAA2B;AAAA,GAGrCC,IAA0CC,EAAK,CAASC,MAAA;AACtD,QAAA;AAAA,IACJ,qBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,eAAAC;AAAA,EACE,IAAAP,GACE,EAAE,uBAAAQ,EAA0B,IAAAR,GAE5B;AAAA,IACJ,KAAKS;AAAA,IACL,MAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,MACEC,EAAmB,GAEjBC,IACJ,CAACT,KACD,CAACN,KACD,CAACE,KACAA,KAAqBD,GAClBe,IACJd,KAAqB,CAACF,IAClB,iCACAC,IACE,oCACA,qBAEFgB,IAAmBC,EAAY,MAAM;AACzC,IAAAV,EAAgBH,GAAiB,QAAW;AAAA,MAC1C,WAAAD;AAAA,IAAA,CACD;AA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ACP,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,aAAY;AAAA,MAEZ,UAAA;AAAA,QAAA,gBAAA4B,EAAC,OAAI,EAAA,KAAKK,EAAO,iBAAiB,KAAI,mBAAkB;AAAA,QACxD,gBAAAL,EAACM,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QACtBxB,MAAa,YAEV,gBAAAmB,EAAAM,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,QAAQ,CAACd;AAAA,cACT,aAAaC;AAAA,cAEb,UAAA,gBAAAK;AAAA,gBAACG;AAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,UAAS;AAAA,kBACT,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,OAAM;AAAA,kBACN,SAASJ;AAAA,kBACT,UAAUL;AAAA,kBACV,gBAAgBe,EAAgC;AAAA,kBAChD,gBAAgB;AAAA,oBACd,cAAczB;AAAA,kBAChB;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAgB,EAACM,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QAAA,EAAA,CACzB,IAEC,gBAAAN,EAAAE,GAAA,EAAK,WAAU,YAAW,QAAO,cAAa,UAE/C,yCAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAOL,gBAAAF,EAAA5B,GAAA,EAAgB,aAAY,UAAS,iBAAgB,UAAS,aAAY,SACzE,UAAC,gBAAA4B,EAAAU,GAAA,EAAU,QAAO,OAAA,CAAO,EAC3B,CAAA;AAEJ,CAAC;"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
2
|
+
import { h as d } from "../../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as f, useMemo as s } from "react";
|
4
|
+
import l from "../../../homework/homework-card.js";
|
5
|
+
const T = (e) => {
|
6
|
+
const t = /* @__PURE__ */ new Set();
|
7
|
+
return e == null || e.forEach((r) => {
|
8
|
+
t.add(r.chapter_name);
|
9
|
+
}), Array.from(t);
|
10
|
+
}, _ = f((e) => {
|
11
|
+
const { sheet: t, userType: r, milestoneId: $, ...c } = e, {
|
12
|
+
items: a,
|
13
|
+
// state,
|
14
|
+
sheet_time: n,
|
15
|
+
// node_type: nodeType,
|
16
|
+
// image_url: imageUrl,
|
17
|
+
// permissions,
|
18
|
+
// accuracy,
|
19
|
+
// due_date_ts: dueDateTs,
|
20
|
+
total_questions: o
|
21
|
+
// image_hue: imageHue,
|
22
|
+
// card_header: cardHeader = '',
|
23
|
+
} = t, m = s(() => n && Math.ceil(n / 60) || 0, [n]), i = s(() => T(a), [a]), p = s(() => i.join(", "), [i]), u = s(
|
24
|
+
() => `${typeof o == "number" ? `${o} ${d.pluralize(o, "Question")}, ` : ""}${m} Mins`,
|
25
|
+
[o, m]
|
26
|
+
);
|
27
|
+
return /* @__PURE__ */ h(
|
28
|
+
l,
|
29
|
+
{
|
30
|
+
header: p,
|
31
|
+
subHeader: u,
|
32
|
+
userType: r,
|
33
|
+
nodeData: t,
|
34
|
+
...c
|
35
|
+
}
|
36
|
+
);
|
37
|
+
});
|
38
|
+
export {
|
39
|
+
_ as default
|
40
|
+
};
|
41
|
+
//# sourceMappingURL=test-list-item.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"test-list-item.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-item.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestItemProps } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo, useMemo } from 'react';\n\nimport HomeworkCard from '../../../homework/homework-card';\n\nconst getTopicsFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics);\n};\n\nconst TestListItem: FC<ITestItemProps> = memo(props => {\n const { sheet, userType, milestoneId, ...resProps } = props;\n const {\n items,\n // state,\n sheet_time: sheetTime,\n // node_type: nodeType,\n // image_url: imageUrl,\n // permissions,\n // accuracy,\n // due_date_ts: dueDateTs,\n total_questions: totalQuestions,\n // image_hue: imageHue,\n // card_header: cardHeader = '',\n } = sheet;\n // const {\n // can_start: canStart,\n // can_resume: canResume,\n // can_review: canReview,\n // can_teacher_review: canTeacherReview,\n // } = permissions || {};\n // const isStudent = useMemo(() => userType === 'STUDENT', [userType]);\n // const canReviewSheet = useMemo(\n // () => (isStudent ? canReview : canTeacherReview),\n // [canReview, canTeacherReview, isStudent],\n // );\n const totalSheetTime = useMemo(() => (sheetTime && Math.ceil(sheetTime / 60)) || 0, [sheetTime]);\n const topics = useMemo(() => getTopicsFromItems(items), [items]);\n const testChapterName = useMemo(() => topics.join(', '), [topics]);\n const subHeader = useMemo(\n () =>\n `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, `\n : ''\n }${totalSheetTime} Mins`,\n [totalQuestions, totalSheetTime],\n );\n\n // const handleOnClick = useCallback(() => {\n // if (isStudent) {\n // if (canStart || canResume) {\n // if (typeof onTestStart === 'function') {\n // onTestStart(sheet);\n\n // return;\n // }\n\n // throw new Error('No callback is available');\n // }\n // }\n\n // if (canReviewSheet) {\n // if (typeof onTestReview !== 'function') {\n // throw new Error('onTestReview must be a function');\n // }\n\n // onTestReview(sheet, milestoneId);\n\n // return;\n // }\n\n // if (typeof onTestPreview !== 'function') {\n // throw new Error('onTestPreview must be a function');\n // }\n\n // onTestPreview(milestoneId, sheet);\n\n // return;\n // }, [\n // canResume,\n // canReviewSheet,\n // canStart,\n // isStudent,\n // milestoneId,\n // onTestPreview,\n // onTestReview,\n // onTestStart,\n // sheet,\n // ]);\n\n return (\n <HomeworkCard\n header={testChapterName}\n subHeader={subHeader}\n userType={userType}\n nodeData={sheet}\n {...resProps}\n />\n );\n});\n\nexport default TestListItem;\n"],"names":["getTopicsFromItems","items","topics","item","TestListItem","memo","props","sheet","userType","milestoneId","resProps","sheetTime","totalQuestions","totalSheetTime","useMemo","testChapterName","subHeader","pluralize","jsx","HomeworkCard"],"mappings":";;;;AASA,MAAMA,IAAqB,CAACC,MAA0C;AAC9D,QAAAC,wBAAa;AAEnB,SAAAD,KAAA,QAAAA,EAAO,QAAQ,CAAQE,MAAA;AACd,IAAAD,EAAA,IAAIC,EAAK,YAAY;AAAA,EAAA,IAGvB,MAAM,KAAKD,CAAM;AAC1B,GAEME,IAAmCC,EAAK,CAASC,MAAA;AACrD,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,aAAAC,GAAa,GAAGC,EAAa,IAAAJ,GAChD;AAAA,IACJ,OAAAL;AAAA;AAAA,IAEA,YAAYU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMZ,iBAAiBC;AAAA;AAAA;AAAA,EAGf,IAAAL,GAYEM,IAAiBC,EAAQ,MAAOH,KAAa,KAAK,KAAKA,IAAY,EAAE,KAAM,GAAG,CAACA,CAAS,CAAC,GACzFT,IAASY,EAAQ,MAAMd,EAAmBC,CAAK,GAAG,CAACA,CAAK,CAAC,GACzDc,IAAkBD,EAAQ,MAAMZ,EAAO,KAAK,IAAI,GAAG,CAACA,CAAM,CAAC,GAC3Dc,IAAYF;AAAA,IAChB,MACE,GACE,OAAOF,KAAmB,WACtB,GAAGA,CAAc,IAAIK,EAAAA,UAAUL,GAAgB,UAAU,CAAC,OAC1D,EACN,GAAGC,CAAc;AAAA,IACnB,CAACD,GAAgBC,CAAc;AAAA,EAAA;AA8C/B,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,QAAQJ;AAAA,MACR,WAAAC;AAAA,MACA,UAAAR;AAAA,MACA,UAAUD;AAAA,MACT,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
|
@@ -1,16 +1,11 @@
|
|
1
|
-
import { styled as
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
return `
|
10
|
-
border-radius: 50%;
|
11
|
-
box-shadow: 0px 10px 20px 0px ${r.BLACK_T_15};
|
12
|
-
`;
|
13
|
-
}), a = t.div`
|
1
|
+
import { styled as o } from "styled-components";
|
2
|
+
const p = o.div(({ theme: t }) => `
|
3
|
+
position: absolute;
|
4
|
+
bottom: ${t.layout.gutter}px;
|
5
|
+
right: ${t.layout.gutter}px;
|
6
|
+
box-shadow: 0px 10px 20px 0px ${t.colors.BLACK_T_20};
|
7
|
+
border-radius: 50%;
|
8
|
+
`), e = o.div`
|
14
9
|
display: grid;
|
15
10
|
grid-template-columns: repeat(3, 200px);
|
16
11
|
grid-gap: 32px;
|
@@ -18,8 +13,7 @@ const i = t(o)`
|
|
18
13
|
padding: 32px 0;
|
19
14
|
`;
|
20
15
|
export {
|
21
|
-
|
22
|
-
|
23
|
-
a as TestSheetItemWrapper
|
16
|
+
p as IconContainer,
|
17
|
+
e as TestSheetItemWrapper
|
24
18
|
};
|
25
19
|
//# sourceMappingURL=test-list-view-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-list-view-styled.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view-styled.ts"],"sourcesContent":["import { styled } from 'styled-components';\n\
|
1
|
+
{"version":3,"file":"test-list-view-styled.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view-styled.ts"],"sourcesContent":["import { styled } from 'styled-components';\n\nconst IconContainer = styled.div(({ theme }) => {\n return `\n position: absolute;\n bottom: ${theme.layout.gutter}px;\n right: ${theme.layout.gutter}px;\n box-shadow: 0px 10px 20px 0px ${theme.colors.BLACK_T_20};\n border-radius: 50%;\n `;\n});\n\nconst TestSheetItemWrapper = styled.div`\n display: grid;\n grid-template-columns: repeat(3, 200px);\n grid-gap: 32px;\n justify-content: center;\n padding: 32px 0;\n`;\n\nexport { IconContainer, TestSheetItemWrapper };\n"],"names":["IconContainer","styled","theme","TestSheetItemWrapper"],"mappings":";AAEA,MAAMA,IAAgBC,EAAO,IAAI,CAAC,EAAE,OAAAC,QAC3B;AAAA;AAAA,cAEKA,EAAM,OAAO,MAAM;AAAA,aACpBA,EAAM,OAAO,MAAM;AAAA,oCACIA,EAAM,OAAO,UAAU;AAAA;AAAA,GAG1D,GAEKC,IAAuBF,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|