analytica-frontend-lib 1.2.71 → 1.2.73
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/ActivitiesHistory/index.js +14 -3
- package/dist/ActivitiesHistory/index.js.map +1 -1
- package/dist/ActivitiesHistory/index.mjs +14 -3
- package/dist/ActivitiesHistory/index.mjs.map +1 -1
- package/dist/ActivityDetails/index.d.ts +4 -11
- package/dist/ActivityDetails/index.d.ts.map +1 -1
- package/dist/ActivityDetails/index.js +175 -64
- package/dist/ActivityDetails/index.js.map +1 -1
- package/dist/ActivityDetails/index.mjs +142 -31
- package/dist/ActivityDetails/index.mjs.map +1 -1
- package/dist/ActivityFilters/index.js +5 -5
- package/dist/ActivityFilters/index.js.map +1 -1
- package/dist/ActivityFilters/index.mjs +5 -5
- package/dist/ActivityFilters/index.mjs.map +1 -1
- package/dist/CorrectActivityModal/index.d.ts.map +1 -1
- package/dist/CorrectActivityModal/index.js +1 -2
- package/dist/CorrectActivityModal/index.js.map +1 -1
- package/dist/CorrectActivityModal/index.mjs +1 -2
- package/dist/CorrectActivityModal/index.mjs.map +1 -1
- package/dist/RecommendedLessonsHistory/index.js +14 -3
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +14 -3
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/TableProvider/index.d.ts +10 -1
- package/dist/TableProvider/index.d.ts.map +1 -1
- package/dist/TableProvider/index.js +14 -3
- package/dist/TableProvider/index.js.map +1 -1
- package/dist/TableProvider/index.mjs +14 -3
- package/dist/TableProvider/index.mjs.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.d.ts +14 -14
- package/dist/hooks/useActivitiesHistory.d.ts +14 -14
- package/dist/hooks/useActivityDetails.d.ts +59 -0
- package/dist/hooks/useActivityDetails.d.ts.map +1 -0
- package/dist/hooks/useActivityModels/index.d.ts +6 -6
- package/dist/hooks/useActivityModels.d.ts +6 -6
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +537 -417
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +390 -272
- package/dist/index.mjs.map +1 -1
- package/dist/types/activityDetails.d.ts +29 -0
- package/dist/types/activityDetails.d.ts.map +1 -1
- package/dist/types/activityFilters.d.ts +1 -1
- package/dist/types/activityFilters.d.ts.map +1 -1
- package/dist/types/questions.d.ts +6 -7
- package/dist/types/questions.d.ts.map +1 -1
- package/dist/utils/activityDetailsUtils.d.ts +4 -4
- package/dist/utils/activityDetailsUtils.d.ts.map +1 -1
- package/dist/utils/index.js +13 -10
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +13 -10
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/questionFiltersConverter.d.ts.map +1 -1
- package/dist/utils/studentActivityCorrection/types.d.ts +5 -5
- package/dist/utils/studentActivityCorrection/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ function arraysEqual(a, b, comparator) {
|
|
|
38
38
|
function areFiltersEqual(filters1, filters2) {
|
|
39
39
|
if (filters1 === filters2) return true;
|
|
40
40
|
if (!filters1 || !filters2) return false;
|
|
41
|
-
return arraysEqual(filters1.types, filters2.types) && arraysEqual(filters1.bankIds, filters2.bankIds) && arraysEqual(filters1.yearIds, filters2.yearIds) && arraysEqual(filters1.
|
|
41
|
+
return arraysEqual(filters1.types, filters2.types) && arraysEqual(filters1.bankIds, filters2.bankIds) && arraysEqual(filters1.yearIds, filters2.yearIds) && arraysEqual(filters1.subjectIds, filters2.subjectIds) && arraysEqual(filters1.topicIds, filters2.topicIds) && arraysEqual(filters1.subtopicIds, filters2.subtopicIds) && arraysEqual(filters1.contentIds, filters2.contentIds);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// src/components/Quiz/useQuizStore.ts
|
|
@@ -667,12 +667,19 @@ function mapQuestionTypeToEnumRequired(type, fallback = "ALTERNATIVA" /* ALTERNA
|
|
|
667
667
|
}
|
|
668
668
|
|
|
669
669
|
// src/types/activityDetails.ts
|
|
670
|
+
import { z } from "zod";
|
|
670
671
|
var STUDENT_ACTIVITY_STATUS = {
|
|
671
672
|
CONCLUIDO: "CONCLUIDO",
|
|
672
673
|
AGUARDANDO_CORRECAO: "AGUARDANDO_CORRECAO",
|
|
673
674
|
AGUARDANDO_RESPOSTA: "AGUARDANDO_RESPOSTA",
|
|
674
675
|
NAO_ENTREGUE: "NAO_ENTREGUE"
|
|
675
676
|
};
|
|
677
|
+
var studentActivityStatusSchema = z.enum([
|
|
678
|
+
STUDENT_ACTIVITY_STATUS.CONCLUIDO,
|
|
679
|
+
STUDENT_ACTIVITY_STATUS.AGUARDANDO_CORRECAO,
|
|
680
|
+
STUDENT_ACTIVITY_STATUS.AGUARDANDO_RESPOSTA,
|
|
681
|
+
STUDENT_ACTIVITY_STATUS.NAO_ENTREGUE
|
|
682
|
+
]);
|
|
676
683
|
var ACTIVITY_AVAILABILITY = {
|
|
677
684
|
DISPONIVEL: "DISPONIVEL",
|
|
678
685
|
NAO_INICIADA: "NAO_INICIADA",
|
|
@@ -701,19 +708,15 @@ var getStatusBadgeConfig = (status) => {
|
|
|
701
708
|
label: "N\xE3o Entregue",
|
|
702
709
|
bgColor: "bg-red-50",
|
|
703
710
|
textColor: "text-red-800"
|
|
704
|
-
},
|
|
705
|
-
default: {
|
|
706
|
-
label: "Desconhecido",
|
|
707
|
-
bgColor: "bg-gray-50",
|
|
708
|
-
textColor: "text-gray-800"
|
|
709
711
|
}
|
|
710
712
|
};
|
|
711
|
-
return configs[status]
|
|
713
|
+
return configs[status];
|
|
712
714
|
};
|
|
713
715
|
var formatTimeSpent = (seconds) => {
|
|
714
|
-
const
|
|
715
|
-
const
|
|
716
|
-
const
|
|
716
|
+
const totalSeconds = Math.floor(Math.abs(seconds));
|
|
717
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
718
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
719
|
+
const secs = totalSeconds % 60;
|
|
717
720
|
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
|
|
718
721
|
};
|
|
719
722
|
var formatQuestionNumbers = (numbers) => {
|
|
@@ -11991,7 +11994,6 @@ var CorrectActivityModal = ({
|
|
|
11991
11994
|
}
|
|
11992
11995
|
await onQuestionCorrectionSubmit(data.studentId, {
|
|
11993
11996
|
questionId: questionData.question.id,
|
|
11994
|
-
questionNumber,
|
|
11995
11997
|
isCorrect: correction.isCorrect,
|
|
11996
11998
|
teacherFeedback: correction.teacherFeedback
|
|
11997
11999
|
});
|
|
@@ -12070,7 +12072,7 @@ var CorrectActivityModal = ({
|
|
|
12070
12072
|
renderQuestionDissertative({
|
|
12071
12073
|
result
|
|
12072
12074
|
}),
|
|
12073
|
-
|
|
12075
|
+
onQuestionCorrectionSubmit && /* @__PURE__ */ jsx62("div", { className: "space-y-4 border-t border-border-100 pt-4 mt-4", children: renderEssayCorrectionFields(questionData) })
|
|
12074
12076
|
] });
|
|
12075
12077
|
break;
|
|
12076
12078
|
case "PREENCHER" /* PREENCHER */:
|
|
@@ -14453,13 +14455,12 @@ import { Notebook } from "phosphor-react";
|
|
|
14453
14455
|
// src/utils/questionFiltersConverter.ts
|
|
14454
14456
|
var convertActivityFiltersToQuestionsFilter = (filters) => {
|
|
14455
14457
|
return {
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
contentIds: filters.contentIds.length > 0 ? filters.contentIds : void 0
|
|
14458
|
+
questionType: filters.types,
|
|
14459
|
+
questionBankYearId: filters.yearIds.map((yearId) => yearId.split("-")[0]),
|
|
14460
|
+
subjectId: filters.subjectIds,
|
|
14461
|
+
topicId: filters.topicIds,
|
|
14462
|
+
subtopicId: filters.subtopicIds,
|
|
14463
|
+
contentId: filters.contentIds
|
|
14463
14464
|
};
|
|
14464
14465
|
};
|
|
14465
14466
|
|
|
@@ -14733,7 +14734,7 @@ function convertFiltersToBackendFormat(filters) {
|
|
|
14733
14734
|
return {
|
|
14734
14735
|
questionTypes: filters.types,
|
|
14735
14736
|
questionBanks: filters.bankIds,
|
|
14736
|
-
subjects: filters.
|
|
14737
|
+
subjects: filters.subjectIds,
|
|
14737
14738
|
topics: filters.topicIds,
|
|
14738
14739
|
subtopics: filters.subtopicIds,
|
|
14739
14740
|
contents: filters.contentIds
|
|
@@ -14746,7 +14747,7 @@ function convertBackendFiltersToActivityFiltersData(backendFilters) {
|
|
|
14746
14747
|
return {
|
|
14747
14748
|
types: (backendFilters.questionTypes || []).filter(isValidQuestionType),
|
|
14748
14749
|
bankIds: backendFilters.questionBanks || [],
|
|
14749
|
-
|
|
14750
|
+
subjectIds: backendFilters.subjects || [],
|
|
14750
14751
|
topicIds: backendFilters.topics || [],
|
|
14751
14752
|
subtopicIds: backendFilters.subtopics || [],
|
|
14752
14753
|
contentIds: backendFilters.contents || [],
|
|
@@ -15186,7 +15187,7 @@ var CreateActivity = ({
|
|
|
15186
15187
|
if (questions.length === 0 && !hasFirstSaveBeenDone.current) {
|
|
15187
15188
|
return false;
|
|
15188
15189
|
}
|
|
15189
|
-
if (!appliedFilters
|
|
15190
|
+
if (!appliedFilters?.subjectIds?.length) {
|
|
15190
15191
|
return false;
|
|
15191
15192
|
}
|
|
15192
15193
|
if (loadingInitialQuestions || isSaving) {
|
|
@@ -15195,7 +15196,10 @@ var CreateActivity = ({
|
|
|
15195
15196
|
return true;
|
|
15196
15197
|
}, [questions.length, appliedFilters, loadingInitialQuestions, isSaving]);
|
|
15197
15198
|
const createDraftPayload = useCallback7(() => {
|
|
15198
|
-
const subjectId = appliedFilters
|
|
15199
|
+
const subjectId = appliedFilters?.subjectIds?.[0];
|
|
15200
|
+
if (!subjectId) {
|
|
15201
|
+
throw new Error("Subject ID n\xE3o encontrado");
|
|
15202
|
+
}
|
|
15199
15203
|
const title = generateTitle(activityType, subjectId, knowledgeAreas);
|
|
15200
15204
|
const filters = convertFiltersToBackendFormat(appliedFilters);
|
|
15201
15205
|
const questionIds = questions.map((q) => q.id);
|
|
@@ -15410,7 +15414,7 @@ var CreateActivity = ({
|
|
|
15410
15414
|
if (questions.length === 0 && !hasFirstSaveBeenDone.current) {
|
|
15411
15415
|
return;
|
|
15412
15416
|
}
|
|
15413
|
-
if (!appliedFilters
|
|
15417
|
+
if (!appliedFilters) {
|
|
15414
15418
|
return;
|
|
15415
15419
|
}
|
|
15416
15420
|
const questionIds = questions.map((q) => q.id).join(",");
|
|
@@ -15468,7 +15472,8 @@ var CreateActivity = ({
|
|
|
15468
15472
|
const handleReorder = useCallback7(
|
|
15469
15473
|
(orderedQuestions) => {
|
|
15470
15474
|
setQuestions(orderedQuestions);
|
|
15471
|
-
|
|
15475
|
+
const hasSubjectIds = Array.isArray(appliedFilters?.subjectIds) && appliedFilters.subjectIds.length > 0;
|
|
15476
|
+
if (hasFirstSaveBeenDone.current && hasSubjectIds && !loadingInitialQuestions && !isSaving) {
|
|
15472
15477
|
if (saveTimeoutRef.current) {
|
|
15473
15478
|
clearTimeout(saveTimeoutRef.current);
|
|
15474
15479
|
}
|
|
@@ -15514,7 +15519,7 @@ var CreateActivity = ({
|
|
|
15514
15519
|
async (formData) => {
|
|
15515
15520
|
setIsSendingActivity(true);
|
|
15516
15521
|
try {
|
|
15517
|
-
const subjectId = activity?.subjectId || appliedFilters?.
|
|
15522
|
+
const subjectId = activity?.subjectId || appliedFilters?.subjectIds?.[0];
|
|
15518
15523
|
if (!subjectId) {
|
|
15519
15524
|
throw new Error("Subject ID n\xE3o encontrado");
|
|
15520
15525
|
}
|
|
@@ -16303,8 +16308,8 @@ var ActivityFilters = ({
|
|
|
16303
16308
|
if (initialFilters.types && initialFilters.types.length > 0) {
|
|
16304
16309
|
setSelectedQuestionTypes(initialFilters.types);
|
|
16305
16310
|
}
|
|
16306
|
-
if (initialFilters.
|
|
16307
|
-
setSelectedSubject(initialFilters.
|
|
16311
|
+
if (initialFilters.subjectIds && initialFilters.subjectIds.length > 0) {
|
|
16312
|
+
setSelectedSubject(initialFilters.subjectIds[0]);
|
|
16308
16313
|
}
|
|
16309
16314
|
hasAppliedBasicInitialFiltersRef.current = true;
|
|
16310
16315
|
}, [initialFilters]);
|
|
@@ -16344,7 +16349,7 @@ var ActivityFilters = ({
|
|
|
16344
16349
|
if (!initialFilters) {
|
|
16345
16350
|
return;
|
|
16346
16351
|
}
|
|
16347
|
-
const subjectIds = initialFilters.
|
|
16352
|
+
const subjectIds = initialFilters.subjectIds || [];
|
|
16348
16353
|
const topicIds = initialFilters.topicIds || [];
|
|
16349
16354
|
const subtopicIds = initialFilters.subtopicIds || [];
|
|
16350
16355
|
if (subjectIds.length > 0 && !hasRequestedTopicsRef.current) {
|
|
@@ -16466,7 +16471,7 @@ var ActivityFilters = ({
|
|
|
16466
16471
|
types: selectedQuestionTypes,
|
|
16467
16472
|
bankIds: bankIds.bankIds || [],
|
|
16468
16473
|
yearIds: bankIds.yearIds || [],
|
|
16469
|
-
|
|
16474
|
+
subjectIds: selectedSubjects,
|
|
16470
16475
|
topicIds: knowledgeIds.topicIds,
|
|
16471
16476
|
subtopicIds: knowledgeIds.subtopicIds,
|
|
16472
16477
|
contentIds: knowledgeIds.contentIds
|
|
@@ -16608,6 +16613,8 @@ function TableProvider({
|
|
|
16608
16613
|
rowKey,
|
|
16609
16614
|
onParamsChange,
|
|
16610
16615
|
onRowClick,
|
|
16616
|
+
headerContent,
|
|
16617
|
+
containerClassName,
|
|
16611
16618
|
children
|
|
16612
16619
|
}) {
|
|
16613
16620
|
const [searchQuery, setSearchQuery] = useState29("");
|
|
@@ -16752,6 +16759,10 @@ function TableProvider({
|
|
|
16752
16759
|
}
|
|
16753
16760
|
) })
|
|
16754
16761
|
] });
|
|
16762
|
+
const headerSection = (headerContent || controls) && /* @__PURE__ */ jsxs59("div", { className: "flex flex-col md:flex-row items-stretch md:items-center justify-between gap-4", children: [
|
|
16763
|
+
headerContent && /* @__PURE__ */ jsx76("div", { children: headerContent }),
|
|
16764
|
+
controls && /* @__PURE__ */ jsx76("div", { className: "flex-1 md:flex-none", children: controls })
|
|
16765
|
+
] });
|
|
16755
16766
|
const table = /* @__PURE__ */ jsx76("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs59(
|
|
16756
16767
|
Table_default,
|
|
16757
16768
|
{
|
|
@@ -16848,7 +16859,11 @@ function TableProvider({
|
|
|
16848
16859
|
) });
|
|
16849
16860
|
if (children) {
|
|
16850
16861
|
return /* @__PURE__ */ jsxs59(Fragment16, { children: [
|
|
16851
|
-
children({
|
|
16862
|
+
children({
|
|
16863
|
+
controls: headerSection || controls || null,
|
|
16864
|
+
table,
|
|
16865
|
+
pagination
|
|
16866
|
+
}),
|
|
16852
16867
|
enableFilters && /* @__PURE__ */ jsx76(
|
|
16853
16868
|
FilterModal,
|
|
16854
16869
|
{
|
|
@@ -16862,8 +16877,9 @@ function TableProvider({
|
|
|
16862
16877
|
)
|
|
16863
16878
|
] });
|
|
16864
16879
|
}
|
|
16865
|
-
|
|
16866
|
-
|
|
16880
|
+
const wrapperClassName = containerClassName || "w-full space-y-4";
|
|
16881
|
+
return /* @__PURE__ */ jsxs59("div", { className: wrapperClassName, children: [
|
|
16882
|
+
headerSection,
|
|
16867
16883
|
table,
|
|
16868
16884
|
pagination,
|
|
16869
16885
|
enableFilters && /* @__PURE__ */ jsx76(
|
|
@@ -21606,8 +21622,104 @@ var ActivityPreview = ({
|
|
|
21606
21622
|
};
|
|
21607
21623
|
|
|
21608
21624
|
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
21609
|
-
import { useState as useState40, useMemo as useMemo24, useCallback as
|
|
21625
|
+
import { useState as useState40, useMemo as useMemo24, useCallback as useCallback18, useEffect as useEffect40 } from "react";
|
|
21610
21626
|
import { Medal as Medal2, Star as Star2, File as File3, CaretRight as CaretRight9, WarningCircle as WarningCircle7 } from "phosphor-react";
|
|
21627
|
+
|
|
21628
|
+
// src/hooks/useActivityDetails.ts
|
|
21629
|
+
import { useCallback as useCallback17 } from "react";
|
|
21630
|
+
var buildQueryParams = (params) => {
|
|
21631
|
+
const paramsObj = {};
|
|
21632
|
+
if (params?.page) paramsObj.page = params.page;
|
|
21633
|
+
if (params?.limit) paramsObj.limit = params.limit;
|
|
21634
|
+
if (params?.sortBy) paramsObj.sortBy = params.sortBy;
|
|
21635
|
+
if (params?.sortOrder) paramsObj.sortOrder = params.sortOrder;
|
|
21636
|
+
if (params?.status) paramsObj.status = params.status;
|
|
21637
|
+
return paramsObj;
|
|
21638
|
+
};
|
|
21639
|
+
var useActivityDetails = (apiClient) => {
|
|
21640
|
+
const fetchActivityDetails = useCallback17(
|
|
21641
|
+
async (id, params) => {
|
|
21642
|
+
const queryParams = buildQueryParams(params);
|
|
21643
|
+
const [detailsResponse, quizResponse] = await Promise.all([
|
|
21644
|
+
apiClient.get(`/activities/${id}/details`, {
|
|
21645
|
+
params: queryParams
|
|
21646
|
+
}),
|
|
21647
|
+
apiClient.get(`/activities/${id}/quiz`).catch(() => null)
|
|
21648
|
+
]);
|
|
21649
|
+
return {
|
|
21650
|
+
...detailsResponse.data.data,
|
|
21651
|
+
activity: quizResponse?.data?.data
|
|
21652
|
+
};
|
|
21653
|
+
},
|
|
21654
|
+
[apiClient]
|
|
21655
|
+
);
|
|
21656
|
+
const fetchStudentCorrection = useCallback17(
|
|
21657
|
+
async (activityId, studentId) => {
|
|
21658
|
+
const response = await apiClient.get(
|
|
21659
|
+
`/questions/activity/${activityId}/user/${studentId}/answers`
|
|
21660
|
+
);
|
|
21661
|
+
return response.data;
|
|
21662
|
+
},
|
|
21663
|
+
[apiClient]
|
|
21664
|
+
);
|
|
21665
|
+
const submitObservation = useCallback17(
|
|
21666
|
+
async (actId, studentId, observation, file) => {
|
|
21667
|
+
let attachmentUrl = null;
|
|
21668
|
+
if (file) {
|
|
21669
|
+
const presignedRes = await apiClient.post(
|
|
21670
|
+
"/user/get-pre-signed-url",
|
|
21671
|
+
{
|
|
21672
|
+
fileName: file.name,
|
|
21673
|
+
fileType: file.type,
|
|
21674
|
+
fileSize: file.size
|
|
21675
|
+
}
|
|
21676
|
+
);
|
|
21677
|
+
const { url, fields } = presignedRes.data.data;
|
|
21678
|
+
const formData = new FormData();
|
|
21679
|
+
for (const [key2, value] of Object.entries(fields)) {
|
|
21680
|
+
formData.append(key2, value);
|
|
21681
|
+
}
|
|
21682
|
+
formData.append("file", file);
|
|
21683
|
+
await fetch(url, {
|
|
21684
|
+
method: "POST",
|
|
21685
|
+
body: formData
|
|
21686
|
+
}).then((response) => {
|
|
21687
|
+
if (!response.ok) {
|
|
21688
|
+
throw new Error("Falha ao fazer upload do arquivo");
|
|
21689
|
+
}
|
|
21690
|
+
});
|
|
21691
|
+
const baseUrl = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
21692
|
+
const key = fields.key.startsWith("/") ? fields.key.slice(1) : fields.key;
|
|
21693
|
+
attachmentUrl = `${baseUrl}/${key}`;
|
|
21694
|
+
}
|
|
21695
|
+
await apiClient.post(
|
|
21696
|
+
`/activities/${actId}/students/${studentId}/feedback/observation`,
|
|
21697
|
+
{
|
|
21698
|
+
observation,
|
|
21699
|
+
attachmentUrl
|
|
21700
|
+
}
|
|
21701
|
+
);
|
|
21702
|
+
},
|
|
21703
|
+
[apiClient]
|
|
21704
|
+
);
|
|
21705
|
+
const submitQuestionCorrection = useCallback17(
|
|
21706
|
+
async (activityId, studentId, payload) => {
|
|
21707
|
+
await apiClient.post(
|
|
21708
|
+
`/activities/${activityId}/students/${studentId}/questions/correction`,
|
|
21709
|
+
payload
|
|
21710
|
+
);
|
|
21711
|
+
},
|
|
21712
|
+
[apiClient]
|
|
21713
|
+
);
|
|
21714
|
+
return {
|
|
21715
|
+
fetchActivityDetails,
|
|
21716
|
+
fetchStudentCorrection,
|
|
21717
|
+
submitObservation,
|
|
21718
|
+
submitQuestionCorrection
|
|
21719
|
+
};
|
|
21720
|
+
};
|
|
21721
|
+
|
|
21722
|
+
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
21611
21723
|
import { Fragment as Fragment21, jsx as jsx91, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
21612
21724
|
var createTableColumns = (onCorrectActivity) => [
|
|
21613
21725
|
{
|
|
@@ -21695,10 +21807,7 @@ var createTableColumns = (onCorrectActivity) => [
|
|
|
21695
21807
|
];
|
|
21696
21808
|
var ActivityDetails = ({
|
|
21697
21809
|
activityId,
|
|
21698
|
-
|
|
21699
|
-
fetchStudentCorrection,
|
|
21700
|
-
submitObservation,
|
|
21701
|
-
submitQuestionCorrection,
|
|
21810
|
+
apiClient,
|
|
21702
21811
|
onBack,
|
|
21703
21812
|
onViewActivity,
|
|
21704
21813
|
emptyStateImage,
|
|
@@ -21718,6 +21827,12 @@ var ActivityDetails = ({
|
|
|
21718
21827
|
const [isModalOpen, setIsModalOpen] = useState40(false);
|
|
21719
21828
|
const [isViewOnlyModal, setIsViewOnlyModal] = useState40(false);
|
|
21720
21829
|
const [correctionError, setCorrectionError] = useState40(null);
|
|
21830
|
+
const {
|
|
21831
|
+
fetchActivityDetails,
|
|
21832
|
+
fetchStudentCorrection,
|
|
21833
|
+
submitObservation,
|
|
21834
|
+
submitQuestionCorrection
|
|
21835
|
+
} = useActivityDetails(apiClient);
|
|
21721
21836
|
useEffect40(() => {
|
|
21722
21837
|
const loadData = async () => {
|
|
21723
21838
|
if (!activityId) return;
|
|
@@ -21741,7 +21856,7 @@ var ActivityDetails = ({
|
|
|
21741
21856
|
};
|
|
21742
21857
|
loadData();
|
|
21743
21858
|
}, [activityId, page, limit, sortBy, sortOrder, fetchActivityDetails]);
|
|
21744
|
-
const handleCorrectActivity =
|
|
21859
|
+
const handleCorrectActivity = useCallback18(
|
|
21745
21860
|
async (studentId) => {
|
|
21746
21861
|
const student = data?.students.find((s) => s.studentId === studentId);
|
|
21747
21862
|
if (!student || !activityId) return;
|
|
@@ -21766,23 +21881,24 @@ var ActivityDetails = ({
|
|
|
21766
21881
|
},
|
|
21767
21882
|
[data?.students, activityId, fetchStudentCorrection]
|
|
21768
21883
|
);
|
|
21769
|
-
const handleCloseModal =
|
|
21884
|
+
const handleCloseModal = useCallback18(() => {
|
|
21770
21885
|
setIsModalOpen(false);
|
|
21771
21886
|
}, []);
|
|
21772
|
-
const handleObservationSubmit =
|
|
21887
|
+
const handleObservationSubmit = useCallback18(
|
|
21773
21888
|
async (studentId, observation, files) => {
|
|
21774
21889
|
if (!activityId || !studentId) return;
|
|
21775
21890
|
try {
|
|
21776
|
-
|
|
21891
|
+
const file = files.length > 0 ? files[0] : null;
|
|
21892
|
+
await submitObservation(activityId, studentId, observation, file);
|
|
21777
21893
|
} catch (err) {
|
|
21778
21894
|
console.error("Failed to submit observation:", err);
|
|
21779
21895
|
}
|
|
21780
21896
|
},
|
|
21781
21897
|
[activityId, submitObservation]
|
|
21782
21898
|
);
|
|
21783
|
-
const handleQuestionCorrectionSubmit =
|
|
21899
|
+
const handleQuestionCorrectionSubmit = useCallback18(
|
|
21784
21900
|
async (studentId, payload) => {
|
|
21785
|
-
if (!activityId || !studentId
|
|
21901
|
+
if (!activityId || !studentId) return;
|
|
21786
21902
|
try {
|
|
21787
21903
|
await submitQuestionCorrection(activityId, studentId, payload);
|
|
21788
21904
|
} catch (err) {
|
|
@@ -22074,10 +22190,10 @@ import {
|
|
|
22074
22190
|
import dayjs2 from "dayjs";
|
|
22075
22191
|
|
|
22076
22192
|
// src/components/Support/schema/index.ts
|
|
22077
|
-
import { z } from "zod";
|
|
22078
|
-
var supportSchema =
|
|
22193
|
+
import { z as z2 } from "zod";
|
|
22194
|
+
var supportSchema = z2.object({
|
|
22079
22195
|
// Tipo de problema selecionado
|
|
22080
|
-
problemType:
|
|
22196
|
+
problemType: z2.enum(["tecnico", "acesso", "outros"], {
|
|
22081
22197
|
// istanbul ignore next - errorMap é testado em runtime pelo zod real
|
|
22082
22198
|
errorMap: (
|
|
22083
22199
|
/* istanbul ignore next */
|
|
@@ -22087,13 +22203,13 @@ var supportSchema = z.object({
|
|
|
22087
22203
|
)
|
|
22088
22204
|
}),
|
|
22089
22205
|
// Título do problema
|
|
22090
|
-
title:
|
|
22206
|
+
title: z2.string().min(1, "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar.").min(5, "T\xEDtulo deve ter pelo menos 5 caracteres").max(100, "T\xEDtulo deve ter no m\xE1ximo 100 caracteres").trim(),
|
|
22091
22207
|
// Descrição do problema
|
|
22092
|
-
description:
|
|
22208
|
+
description: z2.string().min(1, "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar.").min(10, "Descri\xE7\xE3o deve ter pelo menos 10 caracteres").max(1e3, "Descri\xE7\xE3o deve ter no m\xE1ximo 1000 caracteres").trim()
|
|
22093
22209
|
});
|
|
22094
22210
|
|
|
22095
22211
|
// src/components/Support/components/TicketModal.tsx
|
|
22096
|
-
import { useState as useState41, useEffect as useEffect41, useCallback as
|
|
22212
|
+
import { useState as useState41, useEffect as useEffect41, useCallback as useCallback19 } from "react";
|
|
22097
22213
|
import dayjs from "dayjs";
|
|
22098
22214
|
import "dayjs/locale/pt-br";
|
|
22099
22215
|
|
|
@@ -22225,7 +22341,7 @@ var TicketModal = ({
|
|
|
22225
22341
|
setShowCloseConfirmation(false);
|
|
22226
22342
|
onClose();
|
|
22227
22343
|
};
|
|
22228
|
-
const fetchAnswers =
|
|
22344
|
+
const fetchAnswers = useCallback19(async () => {
|
|
22229
22345
|
if (!ticket.id || ticket.status !== "respondido" /* RESPONDIDO */) return;
|
|
22230
22346
|
setIsLoadingAnswers(true);
|
|
22231
22347
|
try {
|
|
@@ -23049,7 +23165,7 @@ var Support = ({
|
|
|
23049
23165
|
var Support_default = Support;
|
|
23050
23166
|
|
|
23051
23167
|
// src/components/SendActivityModal/SendActivityModal.tsx
|
|
23052
|
-
import { useCallback as
|
|
23168
|
+
import { useCallback as useCallback20, useEffect as useEffect43, useRef as useRef24 } from "react";
|
|
23053
23169
|
import {
|
|
23054
23170
|
CaretLeftIcon,
|
|
23055
23171
|
ArrowRightIcon,
|
|
@@ -23061,7 +23177,7 @@ import {
|
|
|
23061
23177
|
import { create as create16 } from "zustand";
|
|
23062
23178
|
|
|
23063
23179
|
// src/components/SendActivityModal/validation.ts
|
|
23064
|
-
import { z as
|
|
23180
|
+
import { z as z3 } from "zod";
|
|
23065
23181
|
var ERROR_MESSAGES = {
|
|
23066
23182
|
SUBTYPE_REQUIRED: "Campo obrigat\xF3rio! Por favor, selecione uma op\xE7\xE3o para continuar.",
|
|
23067
23183
|
TITLE_REQUIRED: "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar.",
|
|
@@ -23070,20 +23186,20 @@ var ERROR_MESSAGES = {
|
|
|
23070
23186
|
FINAL_DATE_REQUIRED: "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar.",
|
|
23071
23187
|
FINAL_DATE_INVALID: "A data final deve ser maior ou igual \xE0 data inicial."
|
|
23072
23188
|
};
|
|
23073
|
-
var activityStepSchema =
|
|
23074
|
-
subtype:
|
|
23189
|
+
var activityStepSchema = z3.object({
|
|
23190
|
+
subtype: z3.enum(["TAREFA", "TRABALHO", "PROVA"], {
|
|
23075
23191
|
errorMap: () => ({ message: ERROR_MESSAGES.SUBTYPE_REQUIRED })
|
|
23076
23192
|
}),
|
|
23077
|
-
title:
|
|
23193
|
+
title: z3.string({ required_error: ERROR_MESSAGES.TITLE_REQUIRED }).transform((val) => val.trim()).refine((val) => val.length > 0, {
|
|
23078
23194
|
message: ERROR_MESSAGES.TITLE_REQUIRED
|
|
23079
23195
|
}),
|
|
23080
|
-
notification:
|
|
23196
|
+
notification: z3.string().optional()
|
|
23081
23197
|
});
|
|
23082
|
-
var recipientStepSchema =
|
|
23083
|
-
students:
|
|
23084
|
-
|
|
23085
|
-
studentId:
|
|
23086
|
-
userInstitutionId:
|
|
23198
|
+
var recipientStepSchema = z3.object({
|
|
23199
|
+
students: z3.array(
|
|
23200
|
+
z3.object({
|
|
23201
|
+
studentId: z3.string(),
|
|
23202
|
+
userInstitutionId: z3.string()
|
|
23087
23203
|
}),
|
|
23088
23204
|
{
|
|
23089
23205
|
required_error: ERROR_MESSAGES.STUDENTS_REQUIRED,
|
|
@@ -23093,18 +23209,18 @@ var recipientStepSchema = z2.object({
|
|
|
23093
23209
|
});
|
|
23094
23210
|
var DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
23095
23211
|
var TIME_REGEX = /^\d{2}:\d{2}$/;
|
|
23096
|
-
var deadlineStepBaseSchema =
|
|
23097
|
-
startDate:
|
|
23212
|
+
var deadlineStepBaseSchema = z3.object({
|
|
23213
|
+
startDate: z3.string({
|
|
23098
23214
|
required_error: ERROR_MESSAGES.START_DATE_REQUIRED,
|
|
23099
23215
|
invalid_type_error: ERROR_MESSAGES.START_DATE_REQUIRED
|
|
23100
23216
|
}).min(1, ERROR_MESSAGES.START_DATE_REQUIRED).regex(DATE_REGEX, ERROR_MESSAGES.START_DATE_REQUIRED),
|
|
23101
|
-
startTime:
|
|
23102
|
-
finalDate:
|
|
23217
|
+
startTime: z3.string().regex(TIME_REGEX).default("00:00"),
|
|
23218
|
+
finalDate: z3.string({
|
|
23103
23219
|
required_error: ERROR_MESSAGES.FINAL_DATE_REQUIRED,
|
|
23104
23220
|
invalid_type_error: ERROR_MESSAGES.FINAL_DATE_REQUIRED
|
|
23105
23221
|
}).min(1, ERROR_MESSAGES.FINAL_DATE_REQUIRED).regex(DATE_REGEX, ERROR_MESSAGES.FINAL_DATE_REQUIRED),
|
|
23106
|
-
finalTime:
|
|
23107
|
-
canRetry:
|
|
23222
|
+
finalTime: z3.string().regex(TIME_REGEX).default("23:59"),
|
|
23223
|
+
canRetry: z3.boolean().default(false)
|
|
23108
23224
|
});
|
|
23109
23225
|
var deadlineStepSchema = deadlineStepBaseSchema.refine(
|
|
23110
23226
|
(data) => {
|
|
@@ -23374,62 +23490,62 @@ var SendActivityModal = ({
|
|
|
23374
23490
|
prevInitialDataRef.current = void 0;
|
|
23375
23491
|
}
|
|
23376
23492
|
}, [isOpen, reset]);
|
|
23377
|
-
const handleCategoriesChange =
|
|
23493
|
+
const handleCategoriesChange = useCallback20(
|
|
23378
23494
|
(updatedCategories) => {
|
|
23379
23495
|
setCategories(updatedCategories);
|
|
23380
23496
|
onCategoriesChange?.(updatedCategories);
|
|
23381
23497
|
},
|
|
23382
23498
|
[setCategories, onCategoriesChange]
|
|
23383
23499
|
);
|
|
23384
|
-
const handleActivityTypeSelect =
|
|
23500
|
+
const handleActivityTypeSelect = useCallback20(
|
|
23385
23501
|
(subtype) => {
|
|
23386
23502
|
store.setFormData({ subtype });
|
|
23387
23503
|
},
|
|
23388
23504
|
[store]
|
|
23389
23505
|
);
|
|
23390
|
-
const handleTitleChange =
|
|
23506
|
+
const handleTitleChange = useCallback20(
|
|
23391
23507
|
(e) => {
|
|
23392
23508
|
store.setFormData({ title: e.target.value });
|
|
23393
23509
|
},
|
|
23394
23510
|
[store]
|
|
23395
23511
|
);
|
|
23396
|
-
const handleNotificationChange =
|
|
23512
|
+
const handleNotificationChange = useCallback20(
|
|
23397
23513
|
(e) => {
|
|
23398
23514
|
store.setFormData({ notification: e.target.value });
|
|
23399
23515
|
},
|
|
23400
23516
|
[store]
|
|
23401
23517
|
);
|
|
23402
|
-
const handleStartDateChange =
|
|
23518
|
+
const handleStartDateChange = useCallback20(
|
|
23403
23519
|
(date) => {
|
|
23404
23520
|
store.setFormData({ startDate: date });
|
|
23405
23521
|
},
|
|
23406
23522
|
[store]
|
|
23407
23523
|
);
|
|
23408
|
-
const handleStartTimeChange =
|
|
23524
|
+
const handleStartTimeChange = useCallback20(
|
|
23409
23525
|
(time) => {
|
|
23410
23526
|
store.setFormData({ startTime: time });
|
|
23411
23527
|
},
|
|
23412
23528
|
[store]
|
|
23413
23529
|
);
|
|
23414
|
-
const handleFinalDateChange =
|
|
23530
|
+
const handleFinalDateChange = useCallback20(
|
|
23415
23531
|
(date) => {
|
|
23416
23532
|
store.setFormData({ finalDate: date });
|
|
23417
23533
|
},
|
|
23418
23534
|
[store]
|
|
23419
23535
|
);
|
|
23420
|
-
const handleFinalTimeChange =
|
|
23536
|
+
const handleFinalTimeChange = useCallback20(
|
|
23421
23537
|
(time) => {
|
|
23422
23538
|
store.setFormData({ finalTime: time });
|
|
23423
23539
|
},
|
|
23424
23540
|
[store]
|
|
23425
23541
|
);
|
|
23426
|
-
const handleRetryChange =
|
|
23542
|
+
const handleRetryChange = useCallback20(
|
|
23427
23543
|
(value) => {
|
|
23428
23544
|
store.setFormData({ canRetry: value === "yes" });
|
|
23429
23545
|
},
|
|
23430
23546
|
[store]
|
|
23431
23547
|
);
|
|
23432
|
-
const handleSubmit =
|
|
23548
|
+
const handleSubmit = useCallback20(async () => {
|
|
23433
23549
|
const isValid = store.validateAllSteps();
|
|
23434
23550
|
if (!isValid) return;
|
|
23435
23551
|
try {
|
|
@@ -23443,7 +23559,7 @@ var SendActivityModal = ({
|
|
|
23443
23559
|
}
|
|
23444
23560
|
}
|
|
23445
23561
|
}, [store, onSubmit, onError]);
|
|
23446
|
-
const handleCancel =
|
|
23562
|
+
const handleCancel = useCallback20(() => {
|
|
23447
23563
|
onClose();
|
|
23448
23564
|
}, [onClose]);
|
|
23449
23565
|
const renderError = (error) => {
|
|
@@ -23681,7 +23797,7 @@ var SendActivityModal = ({
|
|
|
23681
23797
|
var SendActivityModal_default = SendActivityModal;
|
|
23682
23798
|
|
|
23683
23799
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
23684
|
-
import { useState as useState44, useCallback as
|
|
23800
|
+
import { useState as useState44, useCallback as useCallback22, useMemo as useMemo25, useRef as useRef25 } from "react";
|
|
23685
23801
|
import { Plus as Plus3, CaretRight as CaretRight10, Trash as Trash2, PencilSimple as PencilSimple2 } from "phosphor-react";
|
|
23686
23802
|
|
|
23687
23803
|
// src/types/common.ts
|
|
@@ -23768,51 +23884,51 @@ var formatDaysToComplete = (daysToComplete) => {
|
|
|
23768
23884
|
};
|
|
23769
23885
|
|
|
23770
23886
|
// src/hooks/useRecommendedLessons.ts
|
|
23771
|
-
import { useState as useState43, useCallback as
|
|
23772
|
-
import { z as
|
|
23887
|
+
import { useState as useState43, useCallback as useCallback21 } from "react";
|
|
23888
|
+
import { z as z4 } from "zod";
|
|
23773
23889
|
import dayjs3 from "dayjs";
|
|
23774
|
-
var goalSubjectSchema =
|
|
23775
|
-
id:
|
|
23776
|
-
name:
|
|
23890
|
+
var goalSubjectSchema = z4.object({
|
|
23891
|
+
id: z4.string().uuid(),
|
|
23892
|
+
name: z4.string()
|
|
23777
23893
|
}).nullable();
|
|
23778
|
-
var goalCreatorSchema =
|
|
23779
|
-
id:
|
|
23780
|
-
name:
|
|
23894
|
+
var goalCreatorSchema = z4.object({
|
|
23895
|
+
id: z4.string().uuid(),
|
|
23896
|
+
name: z4.string()
|
|
23781
23897
|
}).nullable();
|
|
23782
|
-
var goalStatsSchema =
|
|
23783
|
-
totalStudents:
|
|
23784
|
-
completedCount:
|
|
23785
|
-
completionPercentage:
|
|
23898
|
+
var goalStatsSchema = z4.object({
|
|
23899
|
+
totalStudents: z4.number(),
|
|
23900
|
+
completedCount: z4.number(),
|
|
23901
|
+
completionPercentage: z4.number()
|
|
23786
23902
|
});
|
|
23787
|
-
var goalBreakdownSchema =
|
|
23788
|
-
classId:
|
|
23789
|
-
className:
|
|
23790
|
-
schoolId:
|
|
23791
|
-
schoolName:
|
|
23792
|
-
studentCount:
|
|
23793
|
-
completedCount:
|
|
23903
|
+
var goalBreakdownSchema = z4.object({
|
|
23904
|
+
classId: z4.string().uuid(),
|
|
23905
|
+
className: z4.string(),
|
|
23906
|
+
schoolId: z4.string(),
|
|
23907
|
+
schoolName: z4.string(),
|
|
23908
|
+
studentCount: z4.number(),
|
|
23909
|
+
completedCount: z4.number()
|
|
23794
23910
|
});
|
|
23795
|
-
var goalDataSchema =
|
|
23796
|
-
id:
|
|
23797
|
-
title:
|
|
23798
|
-
startDate:
|
|
23799
|
-
finalDate:
|
|
23800
|
-
createdAt:
|
|
23801
|
-
progress:
|
|
23802
|
-
totalLessons:
|
|
23911
|
+
var goalDataSchema = z4.object({
|
|
23912
|
+
id: z4.string().uuid(),
|
|
23913
|
+
title: z4.string(),
|
|
23914
|
+
startDate: z4.string().nullable(),
|
|
23915
|
+
finalDate: z4.string().nullable(),
|
|
23916
|
+
createdAt: z4.string(),
|
|
23917
|
+
progress: z4.number(),
|
|
23918
|
+
totalLessons: z4.number()
|
|
23803
23919
|
});
|
|
23804
|
-
var goalHistoryItemSchema =
|
|
23920
|
+
var goalHistoryItemSchema = z4.object({
|
|
23805
23921
|
goal: goalDataSchema,
|
|
23806
23922
|
subject: goalSubjectSchema,
|
|
23807
23923
|
creator: goalCreatorSchema,
|
|
23808
23924
|
stats: goalStatsSchema,
|
|
23809
|
-
breakdown:
|
|
23925
|
+
breakdown: z4.array(goalBreakdownSchema)
|
|
23810
23926
|
});
|
|
23811
|
-
var goalsHistoryApiResponseSchema =
|
|
23812
|
-
message:
|
|
23813
|
-
data:
|
|
23814
|
-
goals:
|
|
23815
|
-
total:
|
|
23927
|
+
var goalsHistoryApiResponseSchema = z4.object({
|
|
23928
|
+
message: z4.string(),
|
|
23929
|
+
data: z4.object({
|
|
23930
|
+
goals: z4.array(goalHistoryItemSchema),
|
|
23931
|
+
total: z4.number()
|
|
23816
23932
|
})
|
|
23817
23933
|
});
|
|
23818
23934
|
var determineGoalStatus = (finalDate, completionPercentage) => {
|
|
@@ -23851,7 +23967,7 @@ var transformGoalToTableItem = (item) => {
|
|
|
23851
23967
|
};
|
|
23852
23968
|
};
|
|
23853
23969
|
var handleGoalFetchError = (error) => {
|
|
23854
|
-
if (error instanceof
|
|
23970
|
+
if (error instanceof z4.ZodError) {
|
|
23855
23971
|
console.error("Erro ao validar dados de hist\xF3rico de aulas:", error);
|
|
23856
23972
|
return "Erro ao validar dados de hist\xF3rico de aulas";
|
|
23857
23973
|
}
|
|
@@ -23871,7 +23987,7 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
23871
23987
|
totalPages: 0
|
|
23872
23988
|
}
|
|
23873
23989
|
});
|
|
23874
|
-
const fetchGoals =
|
|
23990
|
+
const fetchGoals = useCallback21(
|
|
23875
23991
|
async (filters) => {
|
|
23876
23992
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
23877
23993
|
try {
|
|
@@ -24243,7 +24359,7 @@ var RecommendedLessonsHistory = ({
|
|
|
24243
24359
|
() => createTableColumns2(mapSubjectNameToEnum2, onDeleteGoal, onEditGoal),
|
|
24244
24360
|
[mapSubjectNameToEnum2, onDeleteGoal, onEditGoal]
|
|
24245
24361
|
);
|
|
24246
|
-
const handleParamsChange =
|
|
24362
|
+
const handleParamsChange = useCallback22(
|
|
24247
24363
|
(params) => {
|
|
24248
24364
|
const filters = buildFiltersFromParams(params);
|
|
24249
24365
|
fetchGoals(filters);
|
|
@@ -24399,7 +24515,7 @@ var RecommendedLessonsHistory = ({
|
|
|
24399
24515
|
};
|
|
24400
24516
|
|
|
24401
24517
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
24402
|
-
import { useMemo as useMemo27, useState as useState45, useCallback as
|
|
24518
|
+
import { useMemo as useMemo27, useState as useState45, useCallback as useCallback24 } from "react";
|
|
24403
24519
|
|
|
24404
24520
|
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
24405
24521
|
import { CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
|
|
@@ -24621,7 +24737,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
24621
24737
|
};
|
|
24622
24738
|
|
|
24623
24739
|
// src/components/RecommendedLessonDetails/components/StudentsTable.tsx
|
|
24624
|
-
import { useCallback as
|
|
24740
|
+
import { useCallback as useCallback23 } from "react";
|
|
24625
24741
|
import { UserIcon } from "@phosphor-icons/react";
|
|
24626
24742
|
import { jsx as jsx101, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
24627
24743
|
var StudentsTable = ({
|
|
@@ -24631,7 +24747,7 @@ var StudentsTable = ({
|
|
|
24631
24747
|
emptyMessage = "Nenhum aluno encontrado"
|
|
24632
24748
|
}) => {
|
|
24633
24749
|
const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
|
|
24634
|
-
const canViewPerformance =
|
|
24750
|
+
const canViewPerformance = useCallback23((student) => {
|
|
24635
24751
|
return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
24636
24752
|
}, []);
|
|
24637
24753
|
return /* @__PURE__ */ jsx101("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ jsxs80(Table_default, { children: [
|
|
@@ -25054,7 +25170,7 @@ var RecommendedLessonDetails = ({
|
|
|
25054
25170
|
const [performanceData, setPerformanceData] = useState45(null);
|
|
25055
25171
|
const [performanceLoading, setPerformanceLoading] = useState45(false);
|
|
25056
25172
|
const [performanceError, setPerformanceError] = useState45(null);
|
|
25057
|
-
const handleViewStudentPerformance =
|
|
25173
|
+
const handleViewStudentPerformance = useCallback24(
|
|
25058
25174
|
async (studentId) => {
|
|
25059
25175
|
if (!fetchStudentPerformance || !goalId) return;
|
|
25060
25176
|
setPerformanceModalOpen(true);
|
|
@@ -25075,7 +25191,7 @@ var RecommendedLessonDetails = ({
|
|
|
25075
25191
|
},
|
|
25076
25192
|
[fetchStudentPerformance, goalId]
|
|
25077
25193
|
);
|
|
25078
|
-
const handleClosePerformanceModal =
|
|
25194
|
+
const handleClosePerformanceModal = useCallback24(() => {
|
|
25079
25195
|
setPerformanceModalOpen(false);
|
|
25080
25196
|
setPerformanceData(null);
|
|
25081
25197
|
setPerformanceError(null);
|
|
@@ -25165,101 +25281,101 @@ var RecommendedLessonDetails = ({
|
|
|
25165
25281
|
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
25166
25282
|
|
|
25167
25283
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
25168
|
-
import { useState as useState46, useCallback as
|
|
25169
|
-
import { z as
|
|
25170
|
-
var goalLessonSubjectSchema =
|
|
25171
|
-
id:
|
|
25172
|
-
name:
|
|
25173
|
-
color:
|
|
25174
|
-
icon:
|
|
25284
|
+
import { useState as useState46, useCallback as useCallback25, useEffect as useEffect44 } from "react";
|
|
25285
|
+
import { z as z5 } from "zod";
|
|
25286
|
+
var goalLessonSubjectSchema = z5.object({
|
|
25287
|
+
id: z5.string(),
|
|
25288
|
+
name: z5.string(),
|
|
25289
|
+
color: z5.string(),
|
|
25290
|
+
icon: z5.string()
|
|
25175
25291
|
});
|
|
25176
|
-
var lessonContentSchema =
|
|
25177
|
-
id:
|
|
25178
|
-
name:
|
|
25292
|
+
var lessonContentSchema = z5.object({
|
|
25293
|
+
id: z5.string(),
|
|
25294
|
+
name: z5.string()
|
|
25179
25295
|
});
|
|
25180
|
-
var goalLessonSchema =
|
|
25181
|
-
id:
|
|
25296
|
+
var goalLessonSchema = z5.object({
|
|
25297
|
+
id: z5.string(),
|
|
25182
25298
|
content: lessonContentSchema,
|
|
25183
25299
|
subtopic: lessonContentSchema,
|
|
25184
25300
|
topic: lessonContentSchema,
|
|
25185
25301
|
subject: goalLessonSubjectSchema
|
|
25186
25302
|
});
|
|
25187
|
-
var goalLessonProgressSchema =
|
|
25188
|
-
id:
|
|
25189
|
-
userId:
|
|
25190
|
-
lessonId:
|
|
25191
|
-
progress:
|
|
25303
|
+
var goalLessonProgressSchema = z5.object({
|
|
25304
|
+
id: z5.string(),
|
|
25305
|
+
userId: z5.string(),
|
|
25306
|
+
lessonId: z5.string(),
|
|
25307
|
+
progress: z5.number(),
|
|
25192
25308
|
lesson: goalLessonSchema
|
|
25193
25309
|
});
|
|
25194
|
-
var goalLessonGoalItemSchema =
|
|
25195
|
-
goalId:
|
|
25196
|
-
supLessonsProgressId:
|
|
25310
|
+
var goalLessonGoalItemSchema = z5.object({
|
|
25311
|
+
goalId: z5.string(),
|
|
25312
|
+
supLessonsProgressId: z5.string(),
|
|
25197
25313
|
supLessonsProgress: goalLessonProgressSchema
|
|
25198
25314
|
});
|
|
25199
|
-
var goalMetadataSchema =
|
|
25200
|
-
id:
|
|
25201
|
-
title:
|
|
25202
|
-
startDate:
|
|
25203
|
-
finalDate:
|
|
25204
|
-
progress:
|
|
25205
|
-
lessonsGoals:
|
|
25315
|
+
var goalMetadataSchema = z5.object({
|
|
25316
|
+
id: z5.string(),
|
|
25317
|
+
title: z5.string(),
|
|
25318
|
+
startDate: z5.string(),
|
|
25319
|
+
finalDate: z5.string(),
|
|
25320
|
+
progress: z5.number(),
|
|
25321
|
+
lessonsGoals: z5.array(goalLessonGoalItemSchema)
|
|
25206
25322
|
});
|
|
25207
|
-
var goalApiResponseSchema =
|
|
25208
|
-
message:
|
|
25323
|
+
var goalApiResponseSchema = z5.object({
|
|
25324
|
+
message: z5.string(),
|
|
25209
25325
|
data: goalMetadataSchema
|
|
25210
25326
|
});
|
|
25211
|
-
var goalDetailStudentSchema =
|
|
25212
|
-
userInstitutionId:
|
|
25213
|
-
userId:
|
|
25214
|
-
name:
|
|
25215
|
-
progress:
|
|
25216
|
-
completedAt:
|
|
25217
|
-
avgScore:
|
|
25218
|
-
daysToComplete:
|
|
25327
|
+
var goalDetailStudentSchema = z5.object({
|
|
25328
|
+
userInstitutionId: z5.string(),
|
|
25329
|
+
userId: z5.string(),
|
|
25330
|
+
name: z5.string(),
|
|
25331
|
+
progress: z5.number(),
|
|
25332
|
+
completedAt: z5.string().nullable(),
|
|
25333
|
+
avgScore: z5.number().nullable(),
|
|
25334
|
+
daysToComplete: z5.number().nullable()
|
|
25219
25335
|
});
|
|
25220
|
-
var goalDetailAggregatedSchema =
|
|
25221
|
-
completionPercentage:
|
|
25222
|
-
avgScore:
|
|
25336
|
+
var goalDetailAggregatedSchema = z5.object({
|
|
25337
|
+
completionPercentage: z5.number(),
|
|
25338
|
+
avgScore: z5.number().nullable()
|
|
25223
25339
|
});
|
|
25224
|
-
var goalDetailContentPerformanceItemSchema =
|
|
25225
|
-
contentId:
|
|
25226
|
-
contentName:
|
|
25227
|
-
rate:
|
|
25340
|
+
var goalDetailContentPerformanceItemSchema = z5.object({
|
|
25341
|
+
contentId: z5.string(),
|
|
25342
|
+
contentName: z5.string(),
|
|
25343
|
+
rate: z5.number()
|
|
25228
25344
|
}).nullable();
|
|
25229
|
-
var goalDetailContentPerformanceSchema =
|
|
25345
|
+
var goalDetailContentPerformanceSchema = z5.object({
|
|
25230
25346
|
best: goalDetailContentPerformanceItemSchema,
|
|
25231
25347
|
worst: goalDetailContentPerformanceItemSchema
|
|
25232
25348
|
});
|
|
25233
|
-
var goalDetailsDataSchema =
|
|
25234
|
-
students:
|
|
25349
|
+
var goalDetailsDataSchema = z5.object({
|
|
25350
|
+
students: z5.array(goalDetailStudentSchema),
|
|
25235
25351
|
aggregated: goalDetailAggregatedSchema,
|
|
25236
25352
|
contentPerformance: goalDetailContentPerformanceSchema
|
|
25237
25353
|
});
|
|
25238
|
-
var goalDetailsApiResponseSchema =
|
|
25239
|
-
message:
|
|
25354
|
+
var goalDetailsApiResponseSchema = z5.object({
|
|
25355
|
+
message: z5.string(),
|
|
25240
25356
|
data: goalDetailsDataSchema
|
|
25241
25357
|
});
|
|
25242
|
-
var goalBreakdownSchema2 =
|
|
25243
|
-
classId:
|
|
25244
|
-
className:
|
|
25245
|
-
schoolId:
|
|
25246
|
-
schoolName:
|
|
25247
|
-
studentCount:
|
|
25248
|
-
completedCount:
|
|
25358
|
+
var goalBreakdownSchema2 = z5.object({
|
|
25359
|
+
classId: z5.string().uuid(),
|
|
25360
|
+
className: z5.string(),
|
|
25361
|
+
schoolId: z5.string(),
|
|
25362
|
+
schoolName: z5.string(),
|
|
25363
|
+
studentCount: z5.number(),
|
|
25364
|
+
completedCount: z5.number()
|
|
25249
25365
|
});
|
|
25250
|
-
var historyGoalItemSchema =
|
|
25251
|
-
goal:
|
|
25252
|
-
breakdown:
|
|
25366
|
+
var historyGoalItemSchema = z5.object({
|
|
25367
|
+
goal: z5.object({ id: z5.string().uuid() }),
|
|
25368
|
+
breakdown: z5.array(goalBreakdownSchema2)
|
|
25253
25369
|
});
|
|
25254
|
-
var historyApiResponseSchema =
|
|
25255
|
-
message:
|
|
25256
|
-
data:
|
|
25257
|
-
goals:
|
|
25258
|
-
total:
|
|
25370
|
+
var historyApiResponseSchema = z5.object({
|
|
25371
|
+
message: z5.string(),
|
|
25372
|
+
data: z5.object({
|
|
25373
|
+
goals: z5.array(historyGoalItemSchema),
|
|
25374
|
+
total: z5.number()
|
|
25259
25375
|
})
|
|
25260
25376
|
});
|
|
25261
25377
|
var handleLessonDetailsFetchError = (error) => {
|
|
25262
|
-
if (error instanceof
|
|
25378
|
+
if (error instanceof z5.ZodError) {
|
|
25263
25379
|
console.error("Erro ao validar dados dos detalhes da aula:", error);
|
|
25264
25380
|
return "Erro ao validar dados dos detalhes da aula";
|
|
25265
25381
|
}
|
|
@@ -25273,7 +25389,7 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
25273
25389
|
loading: true,
|
|
25274
25390
|
error: null
|
|
25275
25391
|
});
|
|
25276
|
-
const fetchLessonDetails =
|
|
25392
|
+
const fetchLessonDetails = useCallback25(async () => {
|
|
25277
25393
|
if (!lessonId) {
|
|
25278
25394
|
setState({
|
|
25279
25395
|
data: null,
|
|
@@ -25334,7 +25450,7 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
25334
25450
|
import { useState as useState50 } from "react";
|
|
25335
25451
|
|
|
25336
25452
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
25337
|
-
import { useCallback as
|
|
25453
|
+
import { useCallback as useCallback27, useMemo as useMemo28, useRef as useRef26 } from "react";
|
|
25338
25454
|
import { Plus as Plus4 } from "phosphor-react";
|
|
25339
25455
|
|
|
25340
25456
|
// src/components/ActivitiesHistory/components/ErrorDisplay.tsx
|
|
@@ -25576,14 +25692,14 @@ var createHistoryFiltersConfig = (userData) => [
|
|
|
25576
25692
|
];
|
|
25577
25693
|
|
|
25578
25694
|
// src/hooks/useActivitiesHistory.ts
|
|
25579
|
-
import { useState as useState47, useCallback as
|
|
25580
|
-
import { z as
|
|
25695
|
+
import { useState as useState47, useCallback as useCallback26 } from "react";
|
|
25696
|
+
import { z as z7 } from "zod";
|
|
25581
25697
|
import dayjs4 from "dayjs";
|
|
25582
25698
|
|
|
25583
25699
|
// src/utils/hookErrorHandler.ts
|
|
25584
|
-
import { z as
|
|
25700
|
+
import { z as z6 } from "zod";
|
|
25585
25701
|
var createFetchErrorHandler = (validationErrorMessage, genericErrorMessage) => (error) => {
|
|
25586
|
-
if (error instanceof
|
|
25702
|
+
if (error instanceof z6.ZodError) {
|
|
25587
25703
|
console.error(validationErrorMessage, error);
|
|
25588
25704
|
return validationErrorMessage;
|
|
25589
25705
|
}
|
|
@@ -25592,33 +25708,33 @@ var createFetchErrorHandler = (validationErrorMessage, genericErrorMessage) => (
|
|
|
25592
25708
|
};
|
|
25593
25709
|
|
|
25594
25710
|
// src/hooks/useActivitiesHistory.ts
|
|
25595
|
-
var activityHistoryResponseSchema =
|
|
25596
|
-
id:
|
|
25597
|
-
title:
|
|
25598
|
-
startDate:
|
|
25599
|
-
finalDate:
|
|
25600
|
-
status:
|
|
25601
|
-
completionPercentage:
|
|
25602
|
-
subjectId:
|
|
25603
|
-
schoolId:
|
|
25604
|
-
schoolName:
|
|
25605
|
-
year:
|
|
25606
|
-
className:
|
|
25607
|
-
subjectName:
|
|
25711
|
+
var activityHistoryResponseSchema = z7.object({
|
|
25712
|
+
id: z7.string().uuid(),
|
|
25713
|
+
title: z7.string(),
|
|
25714
|
+
startDate: z7.string().nullable(),
|
|
25715
|
+
finalDate: z7.string().nullable(),
|
|
25716
|
+
status: z7.nativeEnum(GenericApiStatus),
|
|
25717
|
+
completionPercentage: z7.number().min(0).max(100).optional().default(0),
|
|
25718
|
+
subjectId: z7.string().uuid().optional().nullable(),
|
|
25719
|
+
schoolId: z7.string().optional(),
|
|
25720
|
+
schoolName: z7.string().optional(),
|
|
25721
|
+
year: z7.string().optional(),
|
|
25722
|
+
className: z7.string().optional(),
|
|
25723
|
+
subjectName: z7.string().optional()
|
|
25608
25724
|
});
|
|
25609
|
-
var activitiesHistoryApiResponseSchema =
|
|
25610
|
-
message:
|
|
25611
|
-
data:
|
|
25612
|
-
activities:
|
|
25725
|
+
var activitiesHistoryApiResponseSchema = z7.object({
|
|
25726
|
+
message: z7.string(),
|
|
25727
|
+
data: z7.object({
|
|
25728
|
+
activities: z7.array(z7.unknown()).transform(
|
|
25613
25729
|
(items) => items.map((item) => activityHistoryResponseSchema.safeParse(item)).filter(
|
|
25614
25730
|
(result) => result.success
|
|
25615
25731
|
).map((result) => result.data)
|
|
25616
25732
|
),
|
|
25617
|
-
pagination:
|
|
25618
|
-
total:
|
|
25619
|
-
page:
|
|
25620
|
-
limit:
|
|
25621
|
-
totalPages:
|
|
25733
|
+
pagination: z7.object({
|
|
25734
|
+
total: z7.number(),
|
|
25735
|
+
page: z7.number(),
|
|
25736
|
+
limit: z7.number(),
|
|
25737
|
+
totalPages: z7.number()
|
|
25622
25738
|
})
|
|
25623
25739
|
})
|
|
25624
25740
|
});
|
|
@@ -25654,7 +25770,7 @@ var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
|
25654
25770
|
error: null,
|
|
25655
25771
|
pagination: DEFAULT_ACTIVITIES_PAGINATION
|
|
25656
25772
|
});
|
|
25657
|
-
const fetchActivities =
|
|
25773
|
+
const fetchActivities = useCallback26(
|
|
25658
25774
|
async (filters) => {
|
|
25659
25775
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
25660
25776
|
try {
|
|
@@ -25722,7 +25838,7 @@ var HistoryTab = ({
|
|
|
25722
25838
|
() => createHistoryTableColumns(mapSubjectNameToEnum2),
|
|
25723
25839
|
[mapSubjectNameToEnum2]
|
|
25724
25840
|
);
|
|
25725
|
-
const handleParamsChange =
|
|
25841
|
+
const handleParamsChange = useCallback27(
|
|
25726
25842
|
(params) => {
|
|
25727
25843
|
const filters = buildHistoryFiltersFromParams(params);
|
|
25728
25844
|
fetchActivities(filters);
|
|
@@ -25805,7 +25921,7 @@ var HistoryTab = ({
|
|
|
25805
25921
|
};
|
|
25806
25922
|
|
|
25807
25923
|
// src/components/ActivitiesHistory/tabs/ModelsTab.tsx
|
|
25808
|
-
import { useState as useState49, useCallback as
|
|
25924
|
+
import { useState as useState49, useCallback as useCallback29, useMemo as useMemo29, useRef as useRef27, useEffect as useEffect45 } from "react";
|
|
25809
25925
|
import { Plus as Plus5 } from "phosphor-react";
|
|
25810
25926
|
|
|
25811
25927
|
// src/components/ActivitiesHistory/config/modelsTableColumns.tsx
|
|
@@ -25911,32 +26027,32 @@ var createModelsFiltersConfig = (userData) => [
|
|
|
25911
26027
|
];
|
|
25912
26028
|
|
|
25913
26029
|
// src/hooks/useActivityModels.ts
|
|
25914
|
-
import { useState as useState48, useCallback as
|
|
25915
|
-
import { z as
|
|
26030
|
+
import { useState as useState48, useCallback as useCallback28 } from "react";
|
|
26031
|
+
import { z as z8 } from "zod";
|
|
25916
26032
|
import dayjs5 from "dayjs";
|
|
25917
|
-
var activityDraftFiltersSchema =
|
|
25918
|
-
questionTypes:
|
|
25919
|
-
questionBanks:
|
|
25920
|
-
subjects:
|
|
25921
|
-
topics:
|
|
25922
|
-
subtopics:
|
|
25923
|
-
contents:
|
|
26033
|
+
var activityDraftFiltersSchema = z8.object({
|
|
26034
|
+
questionTypes: z8.array(z8.string()).optional(),
|
|
26035
|
+
questionBanks: z8.array(z8.string()).optional(),
|
|
26036
|
+
subjects: z8.array(z8.string()).optional(),
|
|
26037
|
+
topics: z8.array(z8.string()).optional(),
|
|
26038
|
+
subtopics: z8.array(z8.string()).optional(),
|
|
26039
|
+
contents: z8.array(z8.string()).optional()
|
|
25924
26040
|
}).nullable();
|
|
25925
|
-
var activityModelResponseSchema =
|
|
25926
|
-
id:
|
|
25927
|
-
type:
|
|
25928
|
-
title:
|
|
25929
|
-
creatorUserInstitutionId:
|
|
25930
|
-
subjectId:
|
|
26041
|
+
var activityModelResponseSchema = z8.object({
|
|
26042
|
+
id: z8.string().uuid(),
|
|
26043
|
+
type: z8.nativeEnum(ActivityDraftType),
|
|
26044
|
+
title: z8.string().nullable(),
|
|
26045
|
+
creatorUserInstitutionId: z8.string().uuid().nullable(),
|
|
26046
|
+
subjectId: z8.string().uuid().nullable(),
|
|
25931
26047
|
filters: activityDraftFiltersSchema,
|
|
25932
|
-
createdAt:
|
|
25933
|
-
updatedAt:
|
|
26048
|
+
createdAt: z8.string(),
|
|
26049
|
+
updatedAt: z8.string()
|
|
25934
26050
|
});
|
|
25935
|
-
var activityModelsApiResponseSchema =
|
|
25936
|
-
message:
|
|
25937
|
-
data:
|
|
25938
|
-
activityDrafts:
|
|
25939
|
-
total:
|
|
26051
|
+
var activityModelsApiResponseSchema = z8.object({
|
|
26052
|
+
message: z8.string(),
|
|
26053
|
+
data: z8.object({
|
|
26054
|
+
activityDrafts: z8.array(activityModelResponseSchema),
|
|
26055
|
+
total: z8.number()
|
|
25940
26056
|
})
|
|
25941
26057
|
});
|
|
25942
26058
|
var DEFAULT_MODELS_PAGINATION = {
|
|
@@ -25967,7 +26083,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
25967
26083
|
error: null,
|
|
25968
26084
|
pagination: DEFAULT_MODELS_PAGINATION
|
|
25969
26085
|
});
|
|
25970
|
-
const fetchModels =
|
|
26086
|
+
const fetchModels = useCallback28(
|
|
25971
26087
|
async (filters, subjectsMap) => {
|
|
25972
26088
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
25973
26089
|
try {
|
|
@@ -26002,7 +26118,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
26002
26118
|
},
|
|
26003
26119
|
[fetchActivityModels]
|
|
26004
26120
|
);
|
|
26005
|
-
const deleteModel =
|
|
26121
|
+
const deleteModel = useCallback28(
|
|
26006
26122
|
async (id) => {
|
|
26007
26123
|
try {
|
|
26008
26124
|
await deleteActivityModel(id);
|
|
@@ -26065,7 +26181,7 @@ var ModelsTab = ({
|
|
|
26065
26181
|
() => createModelsFiltersConfig(userFilterData),
|
|
26066
26182
|
[userFilterData]
|
|
26067
26183
|
);
|
|
26068
|
-
const handleDeleteClick =
|
|
26184
|
+
const handleDeleteClick = useCallback29((model) => {
|
|
26069
26185
|
setModelToDelete(model);
|
|
26070
26186
|
setDeleteDialogOpen(true);
|
|
26071
26187
|
}, []);
|
|
@@ -26078,7 +26194,7 @@ var ModelsTab = ({
|
|
|
26078
26194
|
),
|
|
26079
26195
|
[mapSubjectNameToEnum2, onSendActivity, onEditModel, handleDeleteClick]
|
|
26080
26196
|
);
|
|
26081
|
-
const handleParamsChange =
|
|
26197
|
+
const handleParamsChange = useCallback29(
|
|
26082
26198
|
(params) => {
|
|
26083
26199
|
const filters = buildModelsFiltersFromParams(params);
|
|
26084
26200
|
fetchModels(filters, subjectsMapRef.current);
|
|
@@ -26088,7 +26204,7 @@ var ModelsTab = ({
|
|
|
26088
26204
|
useEffect45(() => {
|
|
26089
26205
|
fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
|
|
26090
26206
|
}, [fetchModels]);
|
|
26091
|
-
const handleConfirmDelete =
|
|
26207
|
+
const handleConfirmDelete = useCallback29(async () => {
|
|
26092
26208
|
if (modelToDelete) {
|
|
26093
26209
|
const success = await deleteModel(modelToDelete.id);
|
|
26094
26210
|
if (success) {
|
|
@@ -26101,7 +26217,7 @@ var ModelsTab = ({
|
|
|
26101
26217
|
setDeleteDialogOpen(false);
|
|
26102
26218
|
setModelToDelete(null);
|
|
26103
26219
|
}, [modelToDelete, deleteModel, fetchModels, addToast]);
|
|
26104
|
-
const handleCancelDelete =
|
|
26220
|
+
const handleCancelDelete = useCallback29(() => {
|
|
26105
26221
|
setDeleteDialogOpen(false);
|
|
26106
26222
|
setModelToDelete(null);
|
|
26107
26223
|
}, []);
|
|
@@ -26458,7 +26574,7 @@ var buildUserFilterData = (userData) => ({
|
|
|
26458
26574
|
});
|
|
26459
26575
|
|
|
26460
26576
|
// src/hooks/useChat.ts
|
|
26461
|
-
import { useState as useState51, useEffect as useEffect46, useCallback as
|
|
26577
|
+
import { useState as useState51, useEffect as useEffect46, useCallback as useCallback30, useRef as useRef28 } from "react";
|
|
26462
26578
|
var WS_STATES = {
|
|
26463
26579
|
CONNECTING: 0,
|
|
26464
26580
|
OPEN: 1,
|
|
@@ -26490,12 +26606,12 @@ function useChat({
|
|
|
26490
26606
|
const isConnectingRef = useRef28(false);
|
|
26491
26607
|
const connectRef = useRef28(() => {
|
|
26492
26608
|
});
|
|
26493
|
-
const sendWsMessage =
|
|
26609
|
+
const sendWsMessage = useCallback30((message) => {
|
|
26494
26610
|
if (wsRef.current?.readyState === WS_STATES.OPEN) {
|
|
26495
26611
|
wsRef.current.send(JSON.stringify(message));
|
|
26496
26612
|
}
|
|
26497
26613
|
}, []);
|
|
26498
|
-
const sendMessage =
|
|
26614
|
+
const sendMessage = useCallback30(
|
|
26499
26615
|
(content) => {
|
|
26500
26616
|
const trimmedContent = content.trim();
|
|
26501
26617
|
if (!trimmedContent) return;
|
|
@@ -26506,12 +26622,12 @@ function useChat({
|
|
|
26506
26622
|
},
|
|
26507
26623
|
[sendWsMessage]
|
|
26508
26624
|
);
|
|
26509
|
-
const leave =
|
|
26625
|
+
const leave = useCallback30(() => {
|
|
26510
26626
|
isManualDisconnectRef.current = true;
|
|
26511
26627
|
sendWsMessage({ type: "leave" });
|
|
26512
26628
|
wsRef.current?.close(1e3, "User left");
|
|
26513
26629
|
}, [sendWsMessage]);
|
|
26514
|
-
const handleMessage =
|
|
26630
|
+
const handleMessage = useCallback30(
|
|
26515
26631
|
(event) => {
|
|
26516
26632
|
try {
|
|
26517
26633
|
const data = JSON.parse(event.data);
|
|
@@ -26579,7 +26695,7 @@ function useChat({
|
|
|
26579
26695
|
},
|
|
26580
26696
|
[onError]
|
|
26581
26697
|
);
|
|
26582
|
-
const connect =
|
|
26698
|
+
const connect = useCallback30(() => {
|
|
26583
26699
|
if (isConnectingRef.current) {
|
|
26584
26700
|
return;
|
|
26585
26701
|
}
|
|
@@ -26632,7 +26748,7 @@ function useChat({
|
|
|
26632
26748
|
maxReconnectAttempts
|
|
26633
26749
|
]);
|
|
26634
26750
|
connectRef.current = connect;
|
|
26635
|
-
const reconnect =
|
|
26751
|
+
const reconnect = useCallback30(() => {
|
|
26636
26752
|
isManualDisconnectRef.current = false;
|
|
26637
26753
|
reconnectAttemptsRef.current = 0;
|
|
26638
26754
|
connectRef.current();
|
|
@@ -26681,7 +26797,7 @@ function createUseChat(baseWsUrl) {
|
|
|
26681
26797
|
}
|
|
26682
26798
|
|
|
26683
26799
|
// src/hooks/useChatRooms.ts
|
|
26684
|
-
import { useState as useState52, useCallback as
|
|
26800
|
+
import { useState as useState52, useCallback as useCallback31 } from "react";
|
|
26685
26801
|
function useChatRooms({
|
|
26686
26802
|
apiClient
|
|
26687
26803
|
}) {
|
|
@@ -26689,7 +26805,7 @@ function useChatRooms({
|
|
|
26689
26805
|
const [availableUsers, setAvailableUsers] = useState52([]);
|
|
26690
26806
|
const [loading, setLoading] = useState52(false);
|
|
26691
26807
|
const [error, setError] = useState52(null);
|
|
26692
|
-
const fetchRooms =
|
|
26808
|
+
const fetchRooms = useCallback31(async () => {
|
|
26693
26809
|
setLoading(true);
|
|
26694
26810
|
setError(null);
|
|
26695
26811
|
try {
|
|
@@ -26705,7 +26821,7 @@ function useChatRooms({
|
|
|
26705
26821
|
setLoading(false);
|
|
26706
26822
|
}
|
|
26707
26823
|
}, [apiClient]);
|
|
26708
|
-
const fetchAvailableUsers =
|
|
26824
|
+
const fetchAvailableUsers = useCallback31(async () => {
|
|
26709
26825
|
setLoading(true);
|
|
26710
26826
|
setError(null);
|
|
26711
26827
|
try {
|
|
@@ -26721,7 +26837,7 @@ function useChatRooms({
|
|
|
26721
26837
|
setLoading(false);
|
|
26722
26838
|
}
|
|
26723
26839
|
}, [apiClient]);
|
|
26724
|
-
const createRoom =
|
|
26840
|
+
const createRoom = useCallback31(
|
|
26725
26841
|
async (participantIds) => {
|
|
26726
26842
|
setLoading(true);
|
|
26727
26843
|
setError(null);
|
|
@@ -26745,7 +26861,7 @@ function useChatRooms({
|
|
|
26745
26861
|
},
|
|
26746
26862
|
[apiClient, fetchRooms]
|
|
26747
26863
|
);
|
|
26748
|
-
const clearError =
|
|
26864
|
+
const clearError = useCallback31(() => {
|
|
26749
26865
|
setError(null);
|
|
26750
26866
|
}, []);
|
|
26751
26867
|
return {
|
|
@@ -26779,7 +26895,7 @@ var CHAT_MESSAGE_TYPES = {
|
|
|
26779
26895
|
};
|
|
26780
26896
|
|
|
26781
26897
|
// src/components/Chat/Chat.tsx
|
|
26782
|
-
import { useState as useState53, useEffect as useEffect47, useCallback as
|
|
26898
|
+
import { useState as useState53, useEffect as useEffect47, useCallback as useCallback32, useRef as useRef29 } from "react";
|
|
26783
26899
|
import {
|
|
26784
26900
|
PaperPlaneTiltIcon as PaperPlaneTiltIcon2,
|
|
26785
26901
|
XIcon,
|
|
@@ -26994,7 +27110,7 @@ function ChatContent({
|
|
|
26994
27110
|
onBackToList?.();
|
|
26995
27111
|
}
|
|
26996
27112
|
}, [initialRoomId, rooms, roomsLoading, onBackToList]);
|
|
26997
|
-
const handleSelectRoom =
|
|
27113
|
+
const handleSelectRoom = useCallback32(
|
|
26998
27114
|
(room) => {
|
|
26999
27115
|
setSelectedRoom(room);
|
|
27000
27116
|
setView("room");
|
|
@@ -27002,12 +27118,12 @@ function ChatContent({
|
|
|
27002
27118
|
},
|
|
27003
27119
|
[onRoomChange]
|
|
27004
27120
|
);
|
|
27005
|
-
const handleOpenCreateModal =
|
|
27121
|
+
const handleOpenCreateModal = useCallback32(async () => {
|
|
27006
27122
|
await fetchAvailableUsers();
|
|
27007
27123
|
setSelectedUserIds(/* @__PURE__ */ new Set());
|
|
27008
27124
|
setShowCreateModal(true);
|
|
27009
27125
|
}, [fetchAvailableUsers]);
|
|
27010
|
-
const handleToggleUser =
|
|
27126
|
+
const handleToggleUser = useCallback32((id) => {
|
|
27011
27127
|
setSelectedUserIds((prev) => {
|
|
27012
27128
|
const next = new Set(prev);
|
|
27013
27129
|
if (next.has(id)) {
|
|
@@ -27018,7 +27134,7 @@ function ChatContent({
|
|
|
27018
27134
|
return next;
|
|
27019
27135
|
});
|
|
27020
27136
|
}, []);
|
|
27021
|
-
const handleCreateRoom =
|
|
27137
|
+
const handleCreateRoom = useCallback32(async () => {
|
|
27022
27138
|
if (selectedUserIds.size === 0) return;
|
|
27023
27139
|
const room = await createRoom(Array.from(selectedUserIds));
|
|
27024
27140
|
if (room) {
|
|
@@ -27027,12 +27143,12 @@ function ChatContent({
|
|
|
27027
27143
|
onRoomChange?.(room.id);
|
|
27028
27144
|
}
|
|
27029
27145
|
}, [selectedUserIds, createRoom, onRoomChange]);
|
|
27030
|
-
const handleSendMessage =
|
|
27146
|
+
const handleSendMessage = useCallback32(() => {
|
|
27031
27147
|
if (!messageInput.trim()) return;
|
|
27032
27148
|
sendMessage(messageInput);
|
|
27033
27149
|
setMessageInput("");
|
|
27034
27150
|
}, [messageInput, sendMessage]);
|
|
27035
|
-
const handleBackToList =
|
|
27151
|
+
const handleBackToList = useCallback32(() => {
|
|
27036
27152
|
setSelectedRoom(null);
|
|
27037
27153
|
setView("list");
|
|
27038
27154
|
onBackToList?.();
|
|
@@ -27238,7 +27354,7 @@ var isChatUserInfoValid = (userInfo) => {
|
|
|
27238
27354
|
};
|
|
27239
27355
|
var getChatWsUrl = (apiUrl) => {
|
|
27240
27356
|
const baseUrl = apiUrl;
|
|
27241
|
-
return baseUrl.replace(/^http/, "ws")
|
|
27357
|
+
return baseUrl.replace(/^http/, "ws");
|
|
27242
27358
|
};
|
|
27243
27359
|
var getChatUserInfo = (user, tokens, sessionInfo, defaultUserName = "Usuario") => {
|
|
27244
27360
|
const userId = String(user?.userInstitutionId ?? sessionInfo?.userId ?? "");
|
|
@@ -27279,7 +27395,7 @@ var CalendarActivityStatus = /* @__PURE__ */ ((CalendarActivityStatus2) => {
|
|
|
27279
27395
|
})(CalendarActivityStatus || {});
|
|
27280
27396
|
|
|
27281
27397
|
// src/hooks/useSendActivity.ts
|
|
27282
|
-
import { useState as useState54, useCallback as
|
|
27398
|
+
import { useState as useState54, useCallback as useCallback33, useMemo as useMemo30, useRef as useRef30 } from "react";
|
|
27283
27399
|
import dayjs6 from "dayjs";
|
|
27284
27400
|
function transformToCategoryConfig(data) {
|
|
27285
27401
|
return [
|
|
@@ -27348,7 +27464,7 @@ function useSendActivity(config) {
|
|
|
27348
27464
|
title: selectedModel.title
|
|
27349
27465
|
};
|
|
27350
27466
|
}, [selectedModel]);
|
|
27351
|
-
const loadCategories =
|
|
27467
|
+
const loadCategories = useCallback33(async () => {
|
|
27352
27468
|
if (categoriesLoadedRef.current) return;
|
|
27353
27469
|
setIsCategoriesLoading(true);
|
|
27354
27470
|
try {
|
|
@@ -27363,7 +27479,7 @@ function useSendActivity(config) {
|
|
|
27363
27479
|
setIsCategoriesLoading(false);
|
|
27364
27480
|
}
|
|
27365
27481
|
}, [fetchCategories, onError]);
|
|
27366
|
-
const openModal =
|
|
27482
|
+
const openModal = useCallback33(
|
|
27367
27483
|
(model) => {
|
|
27368
27484
|
setSelectedModel(model);
|
|
27369
27485
|
setIsOpen(true);
|
|
@@ -27371,17 +27487,17 @@ function useSendActivity(config) {
|
|
|
27371
27487
|
},
|
|
27372
27488
|
[loadCategories]
|
|
27373
27489
|
);
|
|
27374
|
-
const closeModal =
|
|
27490
|
+
const closeModal = useCallback33(() => {
|
|
27375
27491
|
setIsOpen(false);
|
|
27376
27492
|
setSelectedModel(null);
|
|
27377
27493
|
}, []);
|
|
27378
|
-
const onCategoriesChange =
|
|
27494
|
+
const onCategoriesChange = useCallback33(
|
|
27379
27495
|
(updatedCategories) => {
|
|
27380
27496
|
setCategories(updatedCategories);
|
|
27381
27497
|
},
|
|
27382
27498
|
[]
|
|
27383
27499
|
);
|
|
27384
|
-
const handleSubmit =
|
|
27500
|
+
const handleSubmit = useCallback33(
|
|
27385
27501
|
async (data) => {
|
|
27386
27502
|
if (!selectedModel) return;
|
|
27387
27503
|
setIsLoading(true);
|
|
@@ -27691,6 +27807,7 @@ export {
|
|
|
27691
27807
|
mapSubjectEnumToName,
|
|
27692
27808
|
mapSubjectNameToEnum,
|
|
27693
27809
|
questionTypeLabels,
|
|
27810
|
+
studentActivityStatusSchema,
|
|
27694
27811
|
supportSchema,
|
|
27695
27812
|
syncDropdownState,
|
|
27696
27813
|
toggleArrayItem,
|
|
@@ -27698,6 +27815,7 @@ export {
|
|
|
27698
27815
|
transformActivityToTableItem,
|
|
27699
27816
|
transformGoalToTableItem,
|
|
27700
27817
|
transformModelToTableItem,
|
|
27818
|
+
useActivityDetails,
|
|
27701
27819
|
useAlertFormStore,
|
|
27702
27820
|
useApiConfig,
|
|
27703
27821
|
useAppContent,
|