analytica-frontend-lib 1.2.60 → 1.2.62
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 +6 -2
- package/dist/ActivitiesHistory/index.js.map +1 -1
- package/dist/ActivitiesHistory/index.mjs +6 -2
- package/dist/ActivitiesHistory/index.mjs.map +1 -1
- package/dist/ActivityDetails/index.d.ts +1 -1
- package/dist/ActivityDetails/index.d.ts.map +1 -1
- package/dist/ActivityDetails/index.js +131 -49
- package/dist/ActivityDetails/index.js.map +1 -1
- package/dist/ActivityDetails/index.mjs +131 -49
- package/dist/ActivityDetails/index.mjs.map +1 -1
- package/dist/CorrectActivityModal/index.d.ts +1 -1
- package/dist/CorrectActivityModal/index.d.ts.map +1 -1
- package/dist/CorrectActivityModal/index.js +122 -38
- package/dist/CorrectActivityModal/index.js.map +1 -1
- package/dist/CorrectActivityModal/index.mjs +122 -38
- package/dist/CorrectActivityModal/index.mjs.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.d.ts +4 -56
- package/dist/hooks/useActivitiesHistory/index.d.ts.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.js +6 -2
- package/dist/hooks/useActivitiesHistory/index.js.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.mjs +6 -2
- package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -1
- package/dist/hooks/useActivitiesHistory.d.ts +4 -56
- package/dist/hooks/useActivitiesHistory.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +310 -77
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +303 -77
- package/dist/index.mjs.map +1 -1
- package/dist/types/studentActivityCorrection.d.ts +5 -0
- package/dist/types/studentActivityCorrection.d.ts.map +1 -1
- package/dist/utils/filterHelpers.d.ts +105 -0
- package/dist/utils/filterHelpers.d.ts.map +1 -0
- package/dist/utils/subjectMappers.d.ts +29 -0
- package/dist/utils/subjectMappers.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9789,7 +9789,9 @@ var FileAttachment_default = FileAttachment;
|
|
|
9789
9789
|
var QUESTION_STATUS2 = {
|
|
9790
9790
|
CORRETA: "CORRETA",
|
|
9791
9791
|
INCORRETA: "INCORRETA",
|
|
9792
|
-
EM_BRANCO: "EM_BRANCO"
|
|
9792
|
+
EM_BRANCO: "EM_BRANCO",
|
|
9793
|
+
/** Reserved for future use - pending teacher evaluation for essay questions */
|
|
9794
|
+
PENDENTE: "PENDENTE"
|
|
9793
9795
|
};
|
|
9794
9796
|
var getQuestionStatusBadgeConfig = (status) => {
|
|
9795
9797
|
const configs = {
|
|
@@ -9807,6 +9809,11 @@ var getQuestionStatusBadgeConfig = (status) => {
|
|
|
9807
9809
|
label: "Em branco",
|
|
9808
9810
|
bgColor: "bg-gray-100",
|
|
9809
9811
|
textColor: "text-gray-600"
|
|
9812
|
+
},
|
|
9813
|
+
[QUESTION_STATUS2.PENDENTE]: {
|
|
9814
|
+
label: "Pendente",
|
|
9815
|
+
bgColor: "bg-warning-background",
|
|
9816
|
+
textColor: "text-warning-800"
|
|
9810
9817
|
}
|
|
9811
9818
|
};
|
|
9812
9819
|
return configs[status];
|
|
@@ -9890,17 +9897,26 @@ var CorrectActivityModal = ({
|
|
|
9890
9897
|
const [savedObservation, setSavedObservation] = useState18("");
|
|
9891
9898
|
const [attachedFiles, setAttachedFiles] = useState18([]);
|
|
9892
9899
|
const [savedFiles, setSavedFiles] = useState18([]);
|
|
9900
|
+
const [existingAttachment, setExistingAttachment] = useState18(
|
|
9901
|
+
null
|
|
9902
|
+
);
|
|
9893
9903
|
const fileInputRef = useRef12(null);
|
|
9894
9904
|
useEffect17(() => {
|
|
9895
9905
|
if (isOpen) {
|
|
9896
9906
|
setObservation("");
|
|
9897
9907
|
setIsObservationExpanded(false);
|
|
9898
|
-
setIsObservationSaved(false);
|
|
9899
|
-
setSavedObservation("");
|
|
9900
9908
|
setAttachedFiles([]);
|
|
9901
9909
|
setSavedFiles([]);
|
|
9910
|
+
setExistingAttachment(data?.attachment ?? null);
|
|
9911
|
+
if (data?.observation || data?.attachment) {
|
|
9912
|
+
setIsObservationSaved(true);
|
|
9913
|
+
setSavedObservation(data.observation || "");
|
|
9914
|
+
} else {
|
|
9915
|
+
setIsObservationSaved(false);
|
|
9916
|
+
setSavedObservation("");
|
|
9917
|
+
}
|
|
9902
9918
|
}
|
|
9903
|
-
}, [isOpen, data?.studentId]);
|
|
9919
|
+
}, [isOpen, data?.studentId, data?.observation, data?.attachment]);
|
|
9904
9920
|
const handleOpenObservation = () => {
|
|
9905
9921
|
setIsObservationExpanded(true);
|
|
9906
9922
|
};
|
|
@@ -9914,12 +9930,16 @@ var CorrectActivityModal = ({
|
|
|
9914
9930
|
setAttachedFiles((prev) => prev.filter((f) => f.id !== id));
|
|
9915
9931
|
};
|
|
9916
9932
|
const handleSaveObservation = () => {
|
|
9917
|
-
if (observation.trim() || attachedFiles.length > 0) {
|
|
9933
|
+
if (observation.trim() || attachedFiles.length > 0 || existingAttachment) {
|
|
9934
|
+
if (!data?.studentId) {
|
|
9935
|
+
return;
|
|
9936
|
+
}
|
|
9918
9937
|
setSavedObservation(observation);
|
|
9919
9938
|
setSavedFiles([...attachedFiles]);
|
|
9920
9939
|
setIsObservationSaved(true);
|
|
9921
9940
|
setIsObservationExpanded(false);
|
|
9922
9941
|
onObservationSubmit?.(
|
|
9942
|
+
data.studentId,
|
|
9923
9943
|
observation,
|
|
9924
9944
|
attachedFiles.map((f) => f.file)
|
|
9925
9945
|
);
|
|
@@ -9933,9 +9953,80 @@ var CorrectActivityModal = ({
|
|
|
9933
9953
|
};
|
|
9934
9954
|
if (!data) return null;
|
|
9935
9955
|
const title = isViewOnly ? "Detalhes da atividade" : "Corrigir atividade";
|
|
9936
|
-
const formattedScore = data.score
|
|
9956
|
+
const formattedScore = data.score == null ? "-" : data.score.toFixed(1);
|
|
9937
9957
|
const renderObservationSection = () => {
|
|
9938
|
-
|
|
9958
|
+
const getFileNameFromUrl = (url) => {
|
|
9959
|
+
try {
|
|
9960
|
+
const urlObj = new URL(url);
|
|
9961
|
+
const urlPath = urlObj.pathname;
|
|
9962
|
+
return urlPath.split("/").pop() || "Anexo";
|
|
9963
|
+
} catch {
|
|
9964
|
+
return "Anexo";
|
|
9965
|
+
}
|
|
9966
|
+
};
|
|
9967
|
+
const renderAttachmentInput = () => {
|
|
9968
|
+
if (attachedFiles.length > 0) {
|
|
9969
|
+
return /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px]", children: [
|
|
9970
|
+
/* @__PURE__ */ jsx50(Paperclip3, { size: 18, className: "text-text-800 flex-shrink-0" }),
|
|
9971
|
+
/* @__PURE__ */ jsx50("span", { className: "text-base font-medium text-text-800 truncate", children: attachedFiles[0].file.name }),
|
|
9972
|
+
/* @__PURE__ */ jsx50(
|
|
9973
|
+
"button",
|
|
9974
|
+
{
|
|
9975
|
+
type: "button",
|
|
9976
|
+
onClick: () => handleFileRemove(attachedFiles[0].id),
|
|
9977
|
+
className: "text-text-700 hover:text-text-800 flex-shrink-0",
|
|
9978
|
+
"aria-label": `Remover ${attachedFiles[0].file.name}`,
|
|
9979
|
+
children: /* @__PURE__ */ jsx50(X6, { size: 18 })
|
|
9980
|
+
}
|
|
9981
|
+
)
|
|
9982
|
+
] });
|
|
9983
|
+
}
|
|
9984
|
+
if (existingAttachment) {
|
|
9985
|
+
return /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
9986
|
+
/* @__PURE__ */ jsxs41(
|
|
9987
|
+
"a",
|
|
9988
|
+
{
|
|
9989
|
+
href: existingAttachment,
|
|
9990
|
+
target: "_blank",
|
|
9991
|
+
rel: "noopener noreferrer",
|
|
9992
|
+
className: "flex items-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px] hover:bg-secondary-600 transition-colors",
|
|
9993
|
+
children: [
|
|
9994
|
+
/* @__PURE__ */ jsx50(Paperclip3, { size: 18, className: "text-text-800 flex-shrink-0" }),
|
|
9995
|
+
/* @__PURE__ */ jsx50("span", { className: "text-base font-medium text-text-800 truncate", children: getFileNameFromUrl(existingAttachment) })
|
|
9996
|
+
]
|
|
9997
|
+
}
|
|
9998
|
+
),
|
|
9999
|
+
/* @__PURE__ */ jsxs41(
|
|
10000
|
+
Button_default,
|
|
10001
|
+
{
|
|
10002
|
+
type: "button",
|
|
10003
|
+
variant: "outline",
|
|
10004
|
+
size: "small",
|
|
10005
|
+
onClick: () => fileInputRef.current?.click(),
|
|
10006
|
+
className: "flex items-center gap-2",
|
|
10007
|
+
children: [
|
|
10008
|
+
/* @__PURE__ */ jsx50(Paperclip3, { size: 18 }),
|
|
10009
|
+
"Trocar"
|
|
10010
|
+
]
|
|
10011
|
+
}
|
|
10012
|
+
)
|
|
10013
|
+
] });
|
|
10014
|
+
}
|
|
10015
|
+
return /* @__PURE__ */ jsxs41(
|
|
10016
|
+
Button_default,
|
|
10017
|
+
{
|
|
10018
|
+
type: "button",
|
|
10019
|
+
variant: "outline",
|
|
10020
|
+
size: "small",
|
|
10021
|
+
onClick: () => fileInputRef.current?.click(),
|
|
10022
|
+
className: "flex items-center gap-2",
|
|
10023
|
+
children: [
|
|
10024
|
+
/* @__PURE__ */ jsx50(Paperclip3, { size: 18 }),
|
|
10025
|
+
"Anexar"
|
|
10026
|
+
]
|
|
10027
|
+
}
|
|
10028
|
+
);
|
|
10029
|
+
};
|
|
9939
10030
|
if (isObservationSaved) {
|
|
9940
10031
|
return /* @__PURE__ */ jsxs41("div", { className: "bg-background border border-border-100 rounded-lg p-4 space-y-2", children: [
|
|
9941
10032
|
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3", children: [
|
|
@@ -9951,6 +10042,25 @@ var CorrectActivityModal = ({
|
|
|
9951
10042
|
),
|
|
9952
10043
|
/* @__PURE__ */ jsx50("span", { className: "text-base font-medium text-text-800 truncate", children: savedFiles[0].file.name })
|
|
9953
10044
|
] }),
|
|
10045
|
+
savedFiles.length === 0 && existingAttachment && /* @__PURE__ */ jsxs41(
|
|
10046
|
+
"a",
|
|
10047
|
+
{
|
|
10048
|
+
href: existingAttachment,
|
|
10049
|
+
target: "_blank",
|
|
10050
|
+
rel: "noopener noreferrer",
|
|
10051
|
+
className: "flex items-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px] hover:bg-secondary-600 transition-colors",
|
|
10052
|
+
children: [
|
|
10053
|
+
/* @__PURE__ */ jsx50(
|
|
10054
|
+
Paperclip3,
|
|
10055
|
+
{
|
|
10056
|
+
size: 18,
|
|
10057
|
+
className: "text-text-800 flex-shrink-0"
|
|
10058
|
+
}
|
|
10059
|
+
),
|
|
10060
|
+
/* @__PURE__ */ jsx50("span", { className: "text-base font-medium text-text-800 truncate", children: getFileNameFromUrl(existingAttachment) })
|
|
10061
|
+
]
|
|
10062
|
+
}
|
|
10063
|
+
),
|
|
9954
10064
|
/* @__PURE__ */ jsxs41(
|
|
9955
10065
|
Button_default,
|
|
9956
10066
|
{
|
|
@@ -10001,40 +10111,14 @@ var CorrectActivityModal = ({
|
|
|
10001
10111
|
}
|
|
10002
10112
|
),
|
|
10003
10113
|
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col-reverse sm:flex-row gap-3 sm:justify-between", children: [
|
|
10004
|
-
|
|
10005
|
-
/* @__PURE__ */ jsx50(Paperclip3, { size: 18, className: "text-text-800 flex-shrink-0" }),
|
|
10006
|
-
/* @__PURE__ */ jsx50("span", { className: "text-base font-medium text-text-800 truncate", children: attachedFiles[0].file.name }),
|
|
10007
|
-
/* @__PURE__ */ jsx50(
|
|
10008
|
-
"button",
|
|
10009
|
-
{
|
|
10010
|
-
type: "button",
|
|
10011
|
-
onClick: () => handleFileRemove(attachedFiles[0].id),
|
|
10012
|
-
className: "text-text-700 hover:text-text-800 flex-shrink-0",
|
|
10013
|
-
"aria-label": `Remover ${attachedFiles[0].file.name}`,
|
|
10014
|
-
children: /* @__PURE__ */ jsx50(X6, { size: 18 })
|
|
10015
|
-
}
|
|
10016
|
-
)
|
|
10017
|
-
] }) : /* @__PURE__ */ jsxs41(
|
|
10018
|
-
Button_default,
|
|
10019
|
-
{
|
|
10020
|
-
type: "button",
|
|
10021
|
-
variant: "outline",
|
|
10022
|
-
size: "small",
|
|
10023
|
-
onClick: () => fileInputRef.current?.click(),
|
|
10024
|
-
className: "flex items-center gap-2",
|
|
10025
|
-
children: [
|
|
10026
|
-
/* @__PURE__ */ jsx50(Paperclip3, { size: 18 }),
|
|
10027
|
-
"Anexar"
|
|
10028
|
-
]
|
|
10029
|
-
}
|
|
10030
|
-
),
|
|
10114
|
+
renderAttachmentInput(),
|
|
10031
10115
|
/* @__PURE__ */ jsx50(
|
|
10032
10116
|
Button_default,
|
|
10033
10117
|
{
|
|
10034
10118
|
type: "button",
|
|
10035
10119
|
size: "small",
|
|
10036
10120
|
onClick: handleSaveObservation,
|
|
10037
|
-
disabled: !observation.trim() && attachedFiles.length === 0,
|
|
10121
|
+
disabled: !observation.trim() && attachedFiles.length === 0 && !existingAttachment,
|
|
10038
10122
|
children: "Salvar"
|
|
10039
10123
|
}
|
|
10040
10124
|
)
|
|
@@ -10060,8 +10144,8 @@ var CorrectActivityModal = ({
|
|
|
10060
10144
|
contentClassName: "max-h-[80vh] overflow-y-auto",
|
|
10061
10145
|
children: /* @__PURE__ */ jsxs41("div", { className: "space-y-6", children: [
|
|
10062
10146
|
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-3", children: [
|
|
10063
|
-
/* @__PURE__ */ jsx50("div", { className: "w-10 h-10 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx50(Text_default, { className: "text-lg font-semibold text-primary-700", children: data.studentName
|
|
10064
|
-
/* @__PURE__ */ jsx50(Text_default, { className: "text-lg font-medium text-text-950", children: data.studentName })
|
|
10147
|
+
/* @__PURE__ */ jsx50("div", { className: "w-10 h-10 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx50(Text_default, { className: "text-lg font-semibold text-primary-700", children: data.studentName?.charAt(0).toUpperCase() || "-" }) }),
|
|
10148
|
+
/* @__PURE__ */ jsx50(Text_default, { className: "text-lg font-medium text-text-950", children: data.studentName || "Aluno" })
|
|
10065
10149
|
] }),
|
|
10066
10150
|
/* @__PURE__ */ jsxs41("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
10067
10151
|
/* @__PURE__ */ jsx50(StatCard, { label: "Nota", value: formattedScore, variant: "score" }),
|
|
@@ -10085,7 +10169,7 @@ var CorrectActivityModal = ({
|
|
|
10085
10169
|
renderObservationSection(),
|
|
10086
10170
|
/* @__PURE__ */ jsxs41("div", { className: "space-y-2", children: [
|
|
10087
10171
|
/* @__PURE__ */ jsx50(Text_default, { className: "text-sm font-bold text-text-950", children: "Respostas" }),
|
|
10088
|
-
/* @__PURE__ */ jsx50(AccordionGroup, { type: "multiple", className: "space-y-2", children: data.questions
|
|
10172
|
+
/* @__PURE__ */ jsx50(AccordionGroup, { type: "multiple", className: "space-y-2", children: data.questions?.map((question) => {
|
|
10089
10173
|
const badgeConfig = getQuestionStatusBadgeConfig(question.status);
|
|
10090
10174
|
return /* @__PURE__ */ jsx50(
|
|
10091
10175
|
CardAccordation,
|
|
@@ -20662,7 +20746,7 @@ var ActivityDetails = ({
|
|
|
20662
20746
|
onBack,
|
|
20663
20747
|
onViewActivity,
|
|
20664
20748
|
emptyStateImage,
|
|
20665
|
-
mapSubjectNameToEnum
|
|
20749
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2
|
|
20666
20750
|
}) => {
|
|
20667
20751
|
const { isMobile } = useMobile();
|
|
20668
20752
|
const [page, setPage] = useState40(1);
|
|
@@ -20709,7 +20793,11 @@ var ActivityDetails = ({
|
|
|
20709
20793
|
setIsViewOnlyModal(isViewOnly);
|
|
20710
20794
|
setCorrectionError(null);
|
|
20711
20795
|
try {
|
|
20712
|
-
const correction = await fetchStudentCorrection(
|
|
20796
|
+
const correction = await fetchStudentCorrection(
|
|
20797
|
+
activityId,
|
|
20798
|
+
studentId,
|
|
20799
|
+
student.studentName || "Aluno"
|
|
20800
|
+
);
|
|
20713
20801
|
setCorrectionData(correction);
|
|
20714
20802
|
setIsModalOpen(true);
|
|
20715
20803
|
} catch (err) {
|
|
@@ -20725,21 +20813,15 @@ var ActivityDetails = ({
|
|
|
20725
20813
|
setIsModalOpen(false);
|
|
20726
20814
|
}, []);
|
|
20727
20815
|
const handleObservationSubmit = useCallback16(
|
|
20728
|
-
async (observation, files) => {
|
|
20729
|
-
if (!activityId || !
|
|
20816
|
+
async (studentId, observation, files) => {
|
|
20817
|
+
if (!activityId || !studentId) return;
|
|
20730
20818
|
try {
|
|
20731
|
-
await submitObservation(
|
|
20732
|
-
activityId,
|
|
20733
|
-
correctionData.studentId,
|
|
20734
|
-
observation,
|
|
20735
|
-
files
|
|
20736
|
-
);
|
|
20737
|
-
setIsModalOpen(false);
|
|
20819
|
+
await submitObservation(activityId, studentId, observation, files);
|
|
20738
20820
|
} catch (err) {
|
|
20739
20821
|
console.error("Failed to submit observation:", err);
|
|
20740
20822
|
}
|
|
20741
20823
|
},
|
|
20742
|
-
[activityId,
|
|
20824
|
+
[activityId, submitObservation]
|
|
20743
20825
|
);
|
|
20744
20826
|
const tableData = useMemo24(() => {
|
|
20745
20827
|
if (!data?.students) return [];
|
|
@@ -20782,7 +20864,7 @@ var ActivityDetails = ({
|
|
|
20782
20864
|
onBack();
|
|
20783
20865
|
}
|
|
20784
20866
|
};
|
|
20785
|
-
const subjectEnum = data?.activity?.subjectName &&
|
|
20867
|
+
const subjectEnum = data?.activity?.subjectName && mapSubjectNameToEnum2 ? mapSubjectNameToEnum2(data.activity.subjectName) : null;
|
|
20786
20868
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
20787
20869
|
if (loading && !data) {
|
|
20788
20870
|
return /* @__PURE__ */ jsx82("div", { className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden", children: /* @__PURE__ */ jsxs66("div", { className: "flex flex-col w-full h-full max-w-[1150px] mx-auto z-10 lg:px-0 px-4 pt-4 gap-4", children: [
|
|
@@ -23005,7 +23087,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
23005
23087
|
]
|
|
23006
23088
|
}
|
|
23007
23089
|
];
|
|
23008
|
-
var createTableColumns2 = (
|
|
23090
|
+
var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
23009
23091
|
{
|
|
23010
23092
|
key: "startDate",
|
|
23011
23093
|
label: "In\xEDcio",
|
|
@@ -23048,7 +23130,7 @@ var createTableColumns2 = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
23048
23130
|
className: "max-w-[140px]",
|
|
23049
23131
|
render: (value) => {
|
|
23050
23132
|
const subjectName = typeof value === "string" ? value : "";
|
|
23051
|
-
const subjectEnum =
|
|
23133
|
+
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
23052
23134
|
if (!subjectEnum) {
|
|
23053
23135
|
return /* @__PURE__ */ jsx87(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
23054
23136
|
}
|
|
@@ -23161,7 +23243,7 @@ var RecommendedLessonsHistory = ({
|
|
|
23161
23243
|
onEditGoal,
|
|
23162
23244
|
emptyStateImage,
|
|
23163
23245
|
noSearchImage,
|
|
23164
|
-
mapSubjectNameToEnum,
|
|
23246
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
23165
23247
|
userFilterData,
|
|
23166
23248
|
title = "Hist\xF3rico de aulas recomendadas",
|
|
23167
23249
|
createButtonText = "Criar aula",
|
|
@@ -23188,8 +23270,8 @@ var RecommendedLessonsHistory = ({
|
|
|
23188
23270
|
[userFilterData]
|
|
23189
23271
|
);
|
|
23190
23272
|
const tableColumns = useMemo25(
|
|
23191
|
-
() => createTableColumns2(
|
|
23192
|
-
[
|
|
23273
|
+
() => createTableColumns2(mapSubjectNameToEnum2, onDeleteGoal, onEditGoal),
|
|
23274
|
+
[mapSubjectNameToEnum2, onDeleteGoal, onEditGoal]
|
|
23193
23275
|
);
|
|
23194
23276
|
const handleParamsChange = useCallback20(
|
|
23195
23277
|
(params) => {
|
|
@@ -23400,12 +23482,12 @@ import { Fragment as Fragment22, jsx as jsx89, jsxs as jsxs72 } from "react/jsx-
|
|
|
23400
23482
|
var LessonHeader = ({
|
|
23401
23483
|
data,
|
|
23402
23484
|
onViewLesson,
|
|
23403
|
-
mapSubjectNameToEnum,
|
|
23485
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
23404
23486
|
viewLessonLabel
|
|
23405
23487
|
}) => {
|
|
23406
23488
|
const { goal, breakdown } = data;
|
|
23407
23489
|
const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
23408
|
-
const subjectEnum =
|
|
23490
|
+
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
23409
23491
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
23410
23492
|
return /* @__PURE__ */ jsx89("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs72("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
|
|
23411
23493
|
/* @__PURE__ */ jsxs72("div", { className: "flex flex-col gap-2", children: [
|
|
@@ -23973,7 +24055,7 @@ var RecommendedLessonDetails = ({
|
|
|
23973
24055
|
onViewLesson,
|
|
23974
24056
|
onViewStudentPerformance,
|
|
23975
24057
|
onBreadcrumbClick,
|
|
23976
|
-
mapSubjectNameToEnum,
|
|
24058
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
23977
24059
|
breadcrumbs,
|
|
23978
24060
|
labels: customLabels,
|
|
23979
24061
|
className
|
|
@@ -24035,7 +24117,7 @@ var RecommendedLessonDetails = ({
|
|
|
24035
24117
|
{
|
|
24036
24118
|
data,
|
|
24037
24119
|
onViewLesson,
|
|
24038
|
-
mapSubjectNameToEnum,
|
|
24120
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
24039
24121
|
viewLessonLabel: labels.viewLesson
|
|
24040
24122
|
}
|
|
24041
24123
|
),
|
|
@@ -24236,11 +24318,11 @@ import { CaretRight as CaretRight11 } from "phosphor-react";
|
|
|
24236
24318
|
|
|
24237
24319
|
// src/components/ActivitiesHistory/utils/renderSubjectCell.tsx
|
|
24238
24320
|
import { jsx as jsx96, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
24239
|
-
var renderSubjectCell = (subjectName,
|
|
24321
|
+
var renderSubjectCell = (subjectName, mapSubjectNameToEnum2, showEmptyDash = false) => {
|
|
24240
24322
|
if (!subjectName) {
|
|
24241
24323
|
return showEmptyDash ? /* @__PURE__ */ jsx96(Text_default, { size: "sm", color: "text-text-400", children: "-" }) : null;
|
|
24242
24324
|
}
|
|
24243
|
-
const subjectEnum =
|
|
24325
|
+
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
24244
24326
|
if (!subjectEnum) {
|
|
24245
24327
|
return /* @__PURE__ */ jsx96(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
24246
24328
|
}
|
|
@@ -24335,7 +24417,7 @@ var mapActivityStatusToDisplay = (apiStatus) => mapApiStatusToDisplay(apiStatus)
|
|
|
24335
24417
|
|
|
24336
24418
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
24337
24419
|
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
24338
|
-
var createHistoryTableColumns = (
|
|
24420
|
+
var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
24339
24421
|
{
|
|
24340
24422
|
key: "startDate",
|
|
24341
24423
|
label: "In\xEDcio",
|
|
@@ -24372,7 +24454,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum) => [
|
|
|
24372
24454
|
className: "max-w-[140px]",
|
|
24373
24455
|
render: (value) => {
|
|
24374
24456
|
const subjectName = typeof value === "string" ? value : "";
|
|
24375
|
-
return renderSubjectCell(subjectName,
|
|
24457
|
+
return renderSubjectCell(subjectName, mapSubjectNameToEnum2, false);
|
|
24376
24458
|
}
|
|
24377
24459
|
},
|
|
24378
24460
|
{
|
|
@@ -24488,7 +24570,7 @@ var activityHistoryResponseSchema = z6.object({
|
|
|
24488
24570
|
startDate: z6.string().nullable(),
|
|
24489
24571
|
finalDate: z6.string().nullable(),
|
|
24490
24572
|
status: z6.nativeEnum(GenericApiStatus),
|
|
24491
|
-
completionPercentage: z6.number().min(0).max(100),
|
|
24573
|
+
completionPercentage: z6.number().min(0).max(100).optional().default(0),
|
|
24492
24574
|
subjectId: z6.string().uuid().optional().nullable(),
|
|
24493
24575
|
schoolId: z6.string().optional(),
|
|
24494
24576
|
schoolName: z6.string().optional(),
|
|
@@ -24499,7 +24581,11 @@ var activityHistoryResponseSchema = z6.object({
|
|
|
24499
24581
|
var activitiesHistoryApiResponseSchema = z6.object({
|
|
24500
24582
|
message: z6.string(),
|
|
24501
24583
|
data: z6.object({
|
|
24502
|
-
activities: z6.array(
|
|
24584
|
+
activities: z6.array(z6.unknown()).transform(
|
|
24585
|
+
(items) => items.map((item) => activityHistoryResponseSchema.safeParse(item)).filter(
|
|
24586
|
+
(result) => result.success
|
|
24587
|
+
).map((result) => result.data)
|
|
24588
|
+
),
|
|
24503
24589
|
pagination: z6.object({
|
|
24504
24590
|
total: z6.number(),
|
|
24505
24591
|
page: z6.number(),
|
|
@@ -24582,7 +24668,7 @@ var HistoryTab = ({
|
|
|
24582
24668
|
onRowClick,
|
|
24583
24669
|
emptyStateImage,
|
|
24584
24670
|
noSearchImage,
|
|
24585
|
-
mapSubjectNameToEnum,
|
|
24671
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
24586
24672
|
userFilterData
|
|
24587
24673
|
}) => {
|
|
24588
24674
|
const fetchActivitiesHistoryRef = useRef26(fetchActivitiesHistory);
|
|
@@ -24605,8 +24691,8 @@ var HistoryTab = ({
|
|
|
24605
24691
|
[userFilterData]
|
|
24606
24692
|
);
|
|
24607
24693
|
const historyTableColumns = useMemo28(
|
|
24608
|
-
() => createHistoryTableColumns(
|
|
24609
|
-
[
|
|
24694
|
+
() => createHistoryTableColumns(mapSubjectNameToEnum2),
|
|
24695
|
+
[mapSubjectNameToEnum2]
|
|
24610
24696
|
);
|
|
24611
24697
|
const handleParamsChange = useCallback24(
|
|
24612
24698
|
(params) => {
|
|
@@ -24697,7 +24783,7 @@ import { Plus as Plus5 } from "phosphor-react";
|
|
|
24697
24783
|
// src/components/ActivitiesHistory/config/modelsTableColumns.tsx
|
|
24698
24784
|
import { Trash as Trash3, PencilSimple as PencilSimple3, PaperPlaneTilt as PaperPlaneTilt3 } from "phosphor-react";
|
|
24699
24785
|
import { jsx as jsx100, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
24700
|
-
var createModelsTableColumns = (
|
|
24786
|
+
var createModelsTableColumns = (mapSubjectNameToEnum2, onSendActivity, onEditModel, onDeleteModel) => [
|
|
24701
24787
|
{
|
|
24702
24788
|
key: "title",
|
|
24703
24789
|
label: "T\xEDtulo",
|
|
@@ -24721,7 +24807,7 @@ var createModelsTableColumns = (mapSubjectNameToEnum, onSendActivity, onEditMode
|
|
|
24721
24807
|
className: "max-w-[160px]",
|
|
24722
24808
|
render: (value) => {
|
|
24723
24809
|
const subjectName = typeof value === "string" ? value : "";
|
|
24724
|
-
return renderSubjectCell(subjectName,
|
|
24810
|
+
return renderSubjectCell(subjectName, mapSubjectNameToEnum2, true);
|
|
24725
24811
|
}
|
|
24726
24812
|
},
|
|
24727
24813
|
{
|
|
@@ -24919,7 +25005,7 @@ var ModelsTab = ({
|
|
|
24919
25005
|
onEditModel,
|
|
24920
25006
|
emptyStateImage,
|
|
24921
25007
|
noSearchImage,
|
|
24922
|
-
mapSubjectNameToEnum,
|
|
25008
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
24923
25009
|
userFilterData,
|
|
24924
25010
|
subjectsMap
|
|
24925
25011
|
}) => {
|
|
@@ -24957,12 +25043,12 @@ var ModelsTab = ({
|
|
|
24957
25043
|
}, []);
|
|
24958
25044
|
const modelsTableColumns = useMemo29(
|
|
24959
25045
|
() => createModelsTableColumns(
|
|
24960
|
-
|
|
25046
|
+
mapSubjectNameToEnum2,
|
|
24961
25047
|
onSendActivity,
|
|
24962
25048
|
onEditModel,
|
|
24963
25049
|
handleDeleteClick
|
|
24964
25050
|
),
|
|
24965
|
-
[
|
|
25051
|
+
[mapSubjectNameToEnum2, onSendActivity, onEditModel, handleDeleteClick]
|
|
24966
25052
|
);
|
|
24967
25053
|
const handleParamsChange = useCallback26(
|
|
24968
25054
|
(params) => {
|
|
@@ -25101,7 +25187,7 @@ var ActivitiesHistory = ({
|
|
|
25101
25187
|
onEditModel,
|
|
25102
25188
|
emptyStateImage,
|
|
25103
25189
|
noSearchImage,
|
|
25104
|
-
mapSubjectNameToEnum,
|
|
25190
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
25105
25191
|
userFilterData,
|
|
25106
25192
|
subjectsMap
|
|
25107
25193
|
}) => {
|
|
@@ -25183,7 +25269,7 @@ var ActivitiesHistory = ({
|
|
|
25183
25269
|
onRowClick,
|
|
25184
25270
|
emptyStateImage,
|
|
25185
25271
|
noSearchImage,
|
|
25186
|
-
mapSubjectNameToEnum,
|
|
25272
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
25187
25273
|
userFilterData
|
|
25188
25274
|
}
|
|
25189
25275
|
),
|
|
@@ -25198,7 +25284,7 @@ var ActivitiesHistory = ({
|
|
|
25198
25284
|
onEditModel,
|
|
25199
25285
|
emptyStateImage,
|
|
25200
25286
|
noSearchImage,
|
|
25201
|
-
mapSubjectNameToEnum,
|
|
25287
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
25202
25288
|
userFilterData,
|
|
25203
25289
|
subjectsMap
|
|
25204
25290
|
}
|
|
@@ -25210,6 +25296,139 @@ var ActivitiesHistory = ({
|
|
|
25210
25296
|
);
|
|
25211
25297
|
};
|
|
25212
25298
|
|
|
25299
|
+
// src/utils/subjectMappers.ts
|
|
25300
|
+
var SUBJECT_NAME_MAPPING = {
|
|
25301
|
+
matem\u00E1tica: "Matem\xE1tica" /* MATEMATICA */,
|
|
25302
|
+
portugu\u00EAs: "Portugu\xEAs" /* PORTUGUES */,
|
|
25303
|
+
ci\u00EAncias: "Biologia" /* BIOLOGIA */,
|
|
25304
|
+
hist\u00F3ria: "Hist\xF3ria" /* HISTORIA */,
|
|
25305
|
+
geografia: "Geografia" /* GEOGRAFIA */,
|
|
25306
|
+
ingl\u00EAs: "Ingl\xEAs" /* INGLES */,
|
|
25307
|
+
"educa\xE7\xE3o f\xEDsica": "Ed. F\xEDsica" /* EDUCACAO_FISICA */,
|
|
25308
|
+
artes: "Artes" /* ARTES */,
|
|
25309
|
+
tecnologia: "Trilhas" /* TRILHAS */,
|
|
25310
|
+
f\u00EDsica: "F\xEDsica" /* FISICA */,
|
|
25311
|
+
literatura: "Literatura" /* LITERATURA */,
|
|
25312
|
+
biologia: "Biologia" /* BIOLOGIA */,
|
|
25313
|
+
qu\u00EDmica: "Qu\xEDmica" /* QUIMICA */,
|
|
25314
|
+
filosofia: "Filosofia" /* FILOSOFIA */,
|
|
25315
|
+
espanhol: "Espanhol" /* ESPANHOL */,
|
|
25316
|
+
reda\u00E7\u00E3o: "Reda\xE7\xE3o" /* REDACAO */,
|
|
25317
|
+
sociologia: "Sociologia" /* SOCIOLOGIA */,
|
|
25318
|
+
trilhas: "Trilhas" /* TRILHAS */
|
|
25319
|
+
};
|
|
25320
|
+
var mapSubjectNameToEnum = (subjectName) => {
|
|
25321
|
+
const normalized = subjectName.trim().toLowerCase();
|
|
25322
|
+
return SUBJECT_NAME_MAPPING[normalized] || null;
|
|
25323
|
+
};
|
|
25324
|
+
var mapSubjectEnumToName = (subjectEnum) => {
|
|
25325
|
+
const reverseMapping = {
|
|
25326
|
+
["Matem\xE1tica" /* MATEMATICA */]: "Matem\xE1tica",
|
|
25327
|
+
["Portugu\xEAs" /* PORTUGUES */]: "Portugu\xEAs",
|
|
25328
|
+
["Biologia" /* BIOLOGIA */]: "Biologia",
|
|
25329
|
+
["Hist\xF3ria" /* HISTORIA */]: "Hist\xF3ria",
|
|
25330
|
+
["Geografia" /* GEOGRAFIA */]: "Geografia",
|
|
25331
|
+
["Ingl\xEAs" /* INGLES */]: "Ingl\xEAs",
|
|
25332
|
+
["Ed. F\xEDsica" /* EDUCACAO_FISICA */]: "Educa\xE7\xE3o F\xEDsica",
|
|
25333
|
+
["Artes" /* ARTES */]: "Artes",
|
|
25334
|
+
["F\xEDsica" /* FISICA */]: "F\xEDsica",
|
|
25335
|
+
["Literatura" /* LITERATURA */]: "Literatura",
|
|
25336
|
+
["Qu\xEDmica" /* QUIMICA */]: "Qu\xEDmica",
|
|
25337
|
+
["Filosofia" /* FILOSOFIA */]: "Filosofia",
|
|
25338
|
+
["Espanhol" /* ESPANHOL */]: "Espanhol",
|
|
25339
|
+
["Reda\xE7\xE3o" /* REDACAO */]: "Reda\xE7\xE3o",
|
|
25340
|
+
["Sociologia" /* SOCIOLOGIA */]: "Sociologia",
|
|
25341
|
+
["Trilhas" /* TRILHAS */]: "Trilhas"
|
|
25342
|
+
};
|
|
25343
|
+
return reverseMapping[subjectEnum] || subjectEnum;
|
|
25344
|
+
};
|
|
25345
|
+
|
|
25346
|
+
// src/utils/filterHelpers.ts
|
|
25347
|
+
var getSchoolOptionsFromUserData = (userData) => {
|
|
25348
|
+
if (!userData?.userInstitutions) {
|
|
25349
|
+
return [];
|
|
25350
|
+
}
|
|
25351
|
+
const schoolsMap = /* @__PURE__ */ new Map();
|
|
25352
|
+
for (const userInst of userData.userInstitutions) {
|
|
25353
|
+
if (userInst.school?.id && userInst.school?.name) {
|
|
25354
|
+
schoolsMap.set(userInst.school.id, {
|
|
25355
|
+
id: userInst.school.id,
|
|
25356
|
+
name: userInst.school.name
|
|
25357
|
+
});
|
|
25358
|
+
}
|
|
25359
|
+
}
|
|
25360
|
+
return Array.from(schoolsMap.values()).sort(
|
|
25361
|
+
(a, b) => a.name.localeCompare(b.name, "pt-BR")
|
|
25362
|
+
);
|
|
25363
|
+
};
|
|
25364
|
+
var getSubjectOptionsFromUserData = (userData) => {
|
|
25365
|
+
if (!userData?.subTeacherTopicClasses) {
|
|
25366
|
+
return [];
|
|
25367
|
+
}
|
|
25368
|
+
const subjectsMap = /* @__PURE__ */ new Map();
|
|
25369
|
+
for (const subTeacher of userData.subTeacherTopicClasses) {
|
|
25370
|
+
if (subTeacher.subject?.id && subTeacher.subject?.name) {
|
|
25371
|
+
subjectsMap.set(subTeacher.subject.id, {
|
|
25372
|
+
id: subTeacher.subject.id,
|
|
25373
|
+
name: subTeacher.subject.name
|
|
25374
|
+
});
|
|
25375
|
+
}
|
|
25376
|
+
}
|
|
25377
|
+
return Array.from(subjectsMap.values()).sort(
|
|
25378
|
+
(a, b) => a.name.localeCompare(b.name, "pt-BR")
|
|
25379
|
+
);
|
|
25380
|
+
};
|
|
25381
|
+
var getSchoolYearOptionsFromUserData = (userData) => {
|
|
25382
|
+
if (!userData?.userInstitutions) {
|
|
25383
|
+
return [];
|
|
25384
|
+
}
|
|
25385
|
+
const schoolYearsMap = /* @__PURE__ */ new Map();
|
|
25386
|
+
for (const userInst of userData.userInstitutions) {
|
|
25387
|
+
if (userInst.schoolYear?.id && userInst.schoolYear?.name) {
|
|
25388
|
+
schoolYearsMap.set(userInst.schoolYear.id, {
|
|
25389
|
+
id: userInst.schoolYear.id,
|
|
25390
|
+
name: userInst.schoolYear.name
|
|
25391
|
+
});
|
|
25392
|
+
}
|
|
25393
|
+
}
|
|
25394
|
+
return Array.from(schoolYearsMap.values()).sort(
|
|
25395
|
+
(a, b) => a.name.localeCompare(b.name, "pt-BR")
|
|
25396
|
+
);
|
|
25397
|
+
};
|
|
25398
|
+
var getClassOptionsFromUserData = (userData) => {
|
|
25399
|
+
if (!userData) {
|
|
25400
|
+
return [];
|
|
25401
|
+
}
|
|
25402
|
+
const classesMap = /* @__PURE__ */ new Map();
|
|
25403
|
+
if (userData.userInstitutions) {
|
|
25404
|
+
for (const userInst of userData.userInstitutions) {
|
|
25405
|
+
if (userInst.class?.id && userInst.class?.name) {
|
|
25406
|
+
classesMap.set(userInst.class.id, {
|
|
25407
|
+
id: userInst.class.id,
|
|
25408
|
+
name: userInst.class.name
|
|
25409
|
+
});
|
|
25410
|
+
}
|
|
25411
|
+
}
|
|
25412
|
+
}
|
|
25413
|
+
if (userData.subTeacherTopicClasses) {
|
|
25414
|
+
for (const subTeacher of userData.subTeacherTopicClasses) {
|
|
25415
|
+
if (subTeacher.class?.id && subTeacher.class?.name) {
|
|
25416
|
+
classesMap.set(subTeacher.class.id, {
|
|
25417
|
+
id: subTeacher.class.id,
|
|
25418
|
+
name: subTeacher.class.name
|
|
25419
|
+
});
|
|
25420
|
+
}
|
|
25421
|
+
}
|
|
25422
|
+
}
|
|
25423
|
+
return Array.from(classesMap.values()).sort(
|
|
25424
|
+
(a, b) => a.name.localeCompare(b.name, "pt-BR")
|
|
25425
|
+
);
|
|
25426
|
+
};
|
|
25427
|
+
var buildUserFilterData = (userData) => ({
|
|
25428
|
+
schools: getSchoolOptionsFromUserData(userData),
|
|
25429
|
+
subjects: getSubjectOptionsFromUserData(userData)
|
|
25430
|
+
});
|
|
25431
|
+
|
|
25213
25432
|
// src/hooks/useChat.ts
|
|
25214
25433
|
import { useState as useState50, useEffect as useEffect46, useCallback as useCallback27, useRef as useRef28 } from "react";
|
|
25215
25434
|
var WS_STATES = {
|
|
@@ -26189,6 +26408,7 @@ export {
|
|
|
26189
26408
|
Whiteboard_default as Whiteboard,
|
|
26190
26409
|
activitiesHistoryApiResponseSchema,
|
|
26191
26410
|
activityModelsApiResponseSchema,
|
|
26411
|
+
buildUserFilterData,
|
|
26192
26412
|
cn,
|
|
26193
26413
|
convertActivityFiltersToQuestionsFilter,
|
|
26194
26414
|
createActivitiesHistoryHook,
|
|
@@ -26224,10 +26444,13 @@ export {
|
|
|
26224
26444
|
getCategoryText,
|
|
26225
26445
|
getChatUserInfo,
|
|
26226
26446
|
getChatWsUrl,
|
|
26447
|
+
getClassOptionsFromUserData,
|
|
26227
26448
|
getDeviceType,
|
|
26228
26449
|
getGoalStatusBadgeAction,
|
|
26229
26450
|
getQuestionStatusBadgeConfig,
|
|
26230
26451
|
getRootDomain,
|
|
26452
|
+
getSchoolOptionsFromUserData,
|
|
26453
|
+
getSchoolYearOptionsFromUserData,
|
|
26231
26454
|
getSelectedIdsFromCategories,
|
|
26232
26455
|
getStatusBadge,
|
|
26233
26456
|
getStatusBadgeAction,
|
|
@@ -26239,6 +26462,7 @@ export {
|
|
|
26239
26462
|
getSubjectIcon,
|
|
26240
26463
|
getSubjectInfo,
|
|
26241
26464
|
getSubjectName,
|
|
26465
|
+
getSubjectOptionsFromUserData,
|
|
26242
26466
|
goalApiResponseSchema,
|
|
26243
26467
|
goalDetailsApiResponseSchema,
|
|
26244
26468
|
goalsHistoryApiResponseSchema,
|
|
@@ -26256,6 +26480,8 @@ export {
|
|
|
26256
26480
|
mapInternalStatusToApi,
|
|
26257
26481
|
mapQuestionTypeToEnum,
|
|
26258
26482
|
mapQuestionTypeToEnumRequired,
|
|
26483
|
+
mapSubjectEnumToName,
|
|
26484
|
+
mapSubjectNameToEnum,
|
|
26259
26485
|
questionTypeLabels,
|
|
26260
26486
|
supportSchema,
|
|
26261
26487
|
syncDropdownState,
|