analytica-frontend-lib 1.2.50 → 1.2.52
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.css +19387 -0
- package/dist/ActivitiesHistory/index.css.map +1 -0
- package/dist/ActivitiesHistory/index.d.ts +2 -0
- package/dist/ActivitiesHistory/index.d.ts.map +1 -0
- package/dist/ActivitiesHistory/index.js +7381 -0
- package/dist/ActivitiesHistory/index.js.map +1 -0
- package/dist/ActivitiesHistory/index.mjs +7424 -0
- package/dist/ActivitiesHistory/index.mjs.map +1 -0
- package/dist/ActivityCardQuestionBanks/index.css +25 -0
- package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
- package/dist/ActivityCardQuestionPreview/index.css +25 -0
- package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
- package/dist/ActivityDetails/index.css +25 -0
- package/dist/ActivityDetails/index.css.map +1 -1
- package/dist/ActivityFilters/index.css +25 -0
- package/dist/ActivityFilters/index.css.map +1 -1
- package/dist/ActivityPreview/index.css +25 -0
- package/dist/ActivityPreview/index.css.map +1 -1
- package/dist/AlertManager/index.css +25 -0
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/RecommendedLessonsHistory/index.css +25 -0
- package/dist/RecommendedLessonsHistory/index.css.map +1 -1
- package/dist/RecommendedLessonsHistory/index.js +10 -2
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +10 -2
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/SendActivityModal/SendActivityModal.css +25 -0
- package/dist/SendActivityModal/SendActivityModal.css.map +1 -1
- package/dist/SendActivityModal/index.css +25 -0
- package/dist/SendActivityModal/index.css.map +1 -1
- package/dist/TableProvider/index.css +25 -0
- package/dist/TableProvider/index.css.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.d.ts +210 -0
- package/dist/hooks/useActivitiesHistory/index.d.ts.map +1 -0
- package/dist/hooks/useActivitiesHistory/index.js +181 -0
- package/dist/hooks/useActivitiesHistory/index.js.map +1 -0
- package/dist/hooks/useActivitiesHistory/index.mjs +141 -0
- package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -0
- package/dist/hooks/useActivitiesHistory.d.ts +210 -0
- package/dist/hooks/useActivitiesHistory.d.ts.map +1 -0
- package/dist/hooks/useActivityModels/index.d.ts +220 -0
- package/dist/hooks/useActivityModels/index.d.ts.map +1 -0
- package/dist/hooks/useActivityModels/index.js +186 -0
- package/dist/hooks/useActivityModels/index.js.map +1 -0
- package/dist/hooks/useActivityModels/index.mjs +146 -0
- package/dist/hooks/useActivityModels/index.mjs.map +1 -0
- package/dist/hooks/useActivityModels.d.ts +220 -0
- package/dist/hooks/useActivityModels.d.ts.map +1 -0
- package/dist/index.css +25 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1369 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1350 -37
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +25 -0
- package/dist/styles.css.map +1 -1
- package/dist/types/activitiesHistory/index.d.ts +196 -0
- package/dist/types/activitiesHistory/index.d.ts.map +1 -0
- package/dist/types/activitiesHistory/index.js +92 -0
- package/dist/types/activitiesHistory/index.js.map +1 -0
- package/dist/types/activitiesHistory/index.mjs +59 -0
- package/dist/types/activitiesHistory/index.mjs.map +1 -0
- package/dist/types/activitiesHistory.d.ts +196 -0
- package/dist/types/activitiesHistory.d.ts.map +1 -0
- package/dist/types/common.d.ts +44 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/recommendedLessons/index.d.ts +10 -18
- package/dist/types/recommendedLessons/index.d.ts.map +1 -1
- package/dist/types/recommendedLessons/index.js +27 -22
- package/dist/types/recommendedLessons/index.js.map +1 -1
- package/dist/types/recommendedLessons/index.mjs +26 -23
- package/dist/types/recommendedLessons/index.mjs.map +1 -1
- package/dist/types/recommendedLessons.d.ts +10 -18
- package/dist/types/recommendedLessons.d.ts.map +1 -1
- package/dist/utils/hookErrorHandler.d.ts +24 -0
- package/dist/utils/hookErrorHandler.d.ts.map +1 -0
- package/package.json +7 -1
- package/dist/RecommendedLessonDetails/index.d.ts +0 -4
- package/dist/RecommendedLessonDetails/index.d.ts.map +0 -1
- package/dist/RecommendedLessonDetails/index.js +0 -2250
- package/dist/RecommendedLessonDetails/index.js.map +0 -1
- package/dist/RecommendedLessonDetails/index.mjs +0 -2242
- package/dist/RecommendedLessonDetails/index.mjs.map +0 -1
- package/dist/hooks/useRecommendedLessonDetails/index.d.ts +0 -780
- package/dist/hooks/useRecommendedLessonDetails/index.d.ts.map +0 -1
- package/dist/hooks/useRecommendedLessonDetails/index.js +0 -204
- package/dist/hooks/useRecommendedLessonDetails/index.js.map +0 -1
- package/dist/hooks/useRecommendedLessonDetails/index.mjs +0 -174
- package/dist/hooks/useRecommendedLessonDetails/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -31,11 +31,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
ACTIVITY_AVAILABILITY: () => ACTIVITY_AVAILABILITY,
|
|
34
|
+
ACTIVITY_FILTER_STATUS_OPTIONS: () => ACTIVITY_FILTER_STATUS_OPTIONS,
|
|
34
35
|
ANSWER_STATUS: () => ANSWER_STATUS,
|
|
35
36
|
AccordionGroup: () => AccordionGroup,
|
|
37
|
+
ActivitiesHistory: () => ActivitiesHistory,
|
|
38
|
+
ActivityApiStatus: () => GenericApiStatus,
|
|
39
|
+
ActivityBadgeActionType: () => BadgeActionType,
|
|
36
40
|
ActivityCardQuestionBanks: () => ActivityCardQuestionBanks,
|
|
37
41
|
ActivityCardQuestionPreview: () => ActivityCardQuestionPreview,
|
|
38
42
|
ActivityDetails: () => ActivityDetails,
|
|
43
|
+
ActivityDisplayStatus: () => GenericDisplayStatus,
|
|
44
|
+
ActivityDraftType: () => ActivityDraftType,
|
|
39
45
|
ActivityFilters: () => ActivityFilters,
|
|
40
46
|
ActivityFiltersPopover: () => ActivityFiltersPopover,
|
|
41
47
|
ActivityPreview: () => ActivityPreview,
|
|
@@ -69,6 +75,8 @@ __export(src_exports, {
|
|
|
69
75
|
Chips: () => Chips_default,
|
|
70
76
|
CorrectActivityModal: () => CorrectActivityModal_default,
|
|
71
77
|
CreateActivity: () => CreateActivity,
|
|
78
|
+
DEFAULT_ACTIVITIES_PAGINATION: () => DEFAULT_ACTIVITIES_PAGINATION,
|
|
79
|
+
DEFAULT_MODELS_PAGINATION: () => DEFAULT_MODELS_PAGINATION,
|
|
72
80
|
DIFFICULTY_LEVEL_ENUM: () => DIFFICULTY_LEVEL_ENUM,
|
|
73
81
|
DateTimeInput: () => DateTimeInput_default,
|
|
74
82
|
Divider: () => Divider_default,
|
|
@@ -84,9 +92,9 @@ __export(src_exports, {
|
|
|
84
92
|
FilterModal: () => FilterModal,
|
|
85
93
|
GOAL_FILTER_STATUS_OPTIONS: () => GOAL_FILTER_STATUS_OPTIONS,
|
|
86
94
|
GOAL_STATUS_OPTIONS: () => GOAL_STATUS_OPTIONS,
|
|
87
|
-
GoalApiStatus: () =>
|
|
88
|
-
GoalBadgeActionType: () =>
|
|
89
|
-
GoalDisplayStatus: () =>
|
|
95
|
+
GoalApiStatus: () => GenericApiStatus,
|
|
96
|
+
GoalBadgeActionType: () => BadgeActionType,
|
|
97
|
+
GoalDisplayStatus: () => GenericDisplayStatus,
|
|
90
98
|
IconButton: () => IconButton_default,
|
|
91
99
|
IconRender: () => IconRender_default,
|
|
92
100
|
IconRoundedButton: () => IconRoundedButton_default,
|
|
@@ -167,6 +175,7 @@ __export(src_exports, {
|
|
|
167
175
|
StatisticsCard: () => StatisticsCard,
|
|
168
176
|
Stepper: () => Stepper_default,
|
|
169
177
|
StudentLessonStatus: () => StudentLessonStatus,
|
|
178
|
+
StudentPerformanceModal: () => StudentPerformanceModal,
|
|
170
179
|
SubjectEnum: () => SubjectEnum,
|
|
171
180
|
SubjectInfo: () => SubjectInfo,
|
|
172
181
|
Support: () => Support_default,
|
|
@@ -190,15 +199,21 @@ __export(src_exports, {
|
|
|
190
199
|
Toaster: () => Toaster_default,
|
|
191
200
|
VideoPlayer: () => VideoPlayer_default,
|
|
192
201
|
Whiteboard: () => Whiteboard_default,
|
|
202
|
+
activitiesHistoryApiResponseSchema: () => activitiesHistoryApiResponseSchema,
|
|
203
|
+
activityModelsApiResponseSchema: () => activityModelsApiResponseSchema,
|
|
193
204
|
cn: () => cn,
|
|
194
205
|
convertActivityFiltersToQuestionsFilter: () => convertActivityFiltersToQuestionsFilter,
|
|
206
|
+
createActivitiesHistoryHook: () => createActivitiesHistoryHook,
|
|
195
207
|
createActivityFiltersDataHook: () => createActivityFiltersDataHook,
|
|
208
|
+
createActivityModelsHook: () => createActivityModelsHook,
|
|
196
209
|
createNotificationStore: () => createNotificationStore,
|
|
197
210
|
createNotificationsHook: () => createNotificationsHook,
|
|
198
211
|
createQuestionsListHook: () => createQuestionsListHook,
|
|
199
212
|
createRecommendedLessonDetailsHook: () => createRecommendedLessonDetailsHook,
|
|
200
213
|
createRecommendedLessonsHistoryHook: () => createRecommendedLessonsHistoryHook,
|
|
214
|
+
createUseActivitiesHistory: () => createUseActivitiesHistory,
|
|
201
215
|
createUseActivityFiltersData: () => createUseActivityFiltersData,
|
|
216
|
+
createUseActivityModels: () => createUseActivityModels,
|
|
202
217
|
createUseNotificationStore: () => createUseNotificationStore,
|
|
203
218
|
createUseNotifications: () => createUseNotifications,
|
|
204
219
|
createUseQuestionsList: () => createUseQuestionsList,
|
|
@@ -214,6 +229,7 @@ __export(src_exports, {
|
|
|
214
229
|
formatTimeAgo: () => formatTimeAgo,
|
|
215
230
|
formatTimeSpent: () => formatTimeSpent,
|
|
216
231
|
generateFileId: () => generateFileId,
|
|
232
|
+
getActivityStatusBadgeAction: () => getActivityStatusBadgeAction,
|
|
217
233
|
getCategoryIcon: () => getCategoryIcon,
|
|
218
234
|
getCategoryText: () => getCategoryText,
|
|
219
235
|
getDeviceType: () => getDeviceType,
|
|
@@ -234,12 +250,15 @@ __export(src_exports, {
|
|
|
234
250
|
goalApiResponseSchema: () => goalApiResponseSchema,
|
|
235
251
|
goalDetailsApiResponseSchema: () => goalDetailsApiResponseSchema,
|
|
236
252
|
goalsHistoryApiResponseSchema: () => goalsHistoryApiResponseSchema,
|
|
253
|
+
handleActivityFetchError: () => handleActivityFetchError,
|
|
237
254
|
handleGoalFetchError: () => handleGoalFetchError,
|
|
238
255
|
handleLessonDetailsFetchError: () => handleLessonDetailsFetchError,
|
|
256
|
+
handleModelFetchError: () => handleModelFetchError,
|
|
239
257
|
historyApiResponseSchema: () => historyApiResponseSchema,
|
|
240
258
|
isDeadlinePassed: () => isDeadlinePassed,
|
|
241
259
|
isFormValid: () => isFormValid,
|
|
242
260
|
isStepValid: () => isStepValid,
|
|
261
|
+
mapActivityStatusToDisplay: () => mapActivityStatusToDisplay,
|
|
243
262
|
mapApiStatusToInternal: () => mapApiStatusToInternal,
|
|
244
263
|
mapInternalStatusToApi: () => mapInternalStatusToApi,
|
|
245
264
|
mapQuestionTypeToEnum: () => mapQuestionTypeToEnum,
|
|
@@ -249,7 +268,9 @@ __export(src_exports, {
|
|
|
249
268
|
syncDropdownState: () => syncDropdownState,
|
|
250
269
|
toggleArrayItem: () => toggleArrayItem,
|
|
251
270
|
toggleSingleValue: () => toggleSingleValue,
|
|
271
|
+
transformActivityToTableItem: () => transformActivityToTableItem,
|
|
252
272
|
transformGoalToTableItem: () => transformGoalToTableItem,
|
|
273
|
+
transformModelToTableItem: () => transformModelToTableItem,
|
|
253
274
|
useAlertFormStore: () => useAlertFormStore,
|
|
254
275
|
useApiConfig: () => useApiConfig,
|
|
255
276
|
useAppContent: () => useAppContent,
|
|
@@ -5224,6 +5245,11 @@ var Toaster = () => {
|
|
|
5224
5245
|
toast.id
|
|
5225
5246
|
)) });
|
|
5226
5247
|
};
|
|
5248
|
+
var useToast = () => {
|
|
5249
|
+
const addToast = ToastStore_default((state) => state.addToast);
|
|
5250
|
+
const removeToast = ToastStore_default((state) => state.removeToast);
|
|
5251
|
+
return { addToast, removeToast };
|
|
5252
|
+
};
|
|
5227
5253
|
var Toaster_default = Toaster;
|
|
5228
5254
|
|
|
5229
5255
|
// src/components/Search/Search.tsx
|
|
@@ -22522,26 +22548,26 @@ var SendActivityModal_default = SendActivityModal;
|
|
|
22522
22548
|
var import_react71 = require("react");
|
|
22523
22549
|
var import_phosphor_react44 = require("phosphor-react");
|
|
22524
22550
|
|
|
22525
|
-
// src/types/
|
|
22526
|
-
var
|
|
22527
|
-
|
|
22528
|
-
|
|
22529
|
-
|
|
22530
|
-
return
|
|
22531
|
-
})(
|
|
22532
|
-
var
|
|
22533
|
-
|
|
22534
|
-
|
|
22535
|
-
|
|
22536
|
-
return
|
|
22537
|
-
})(
|
|
22538
|
-
var
|
|
22539
|
-
|
|
22540
|
-
|
|
22541
|
-
|
|
22542
|
-
return
|
|
22543
|
-
})(
|
|
22544
|
-
var
|
|
22551
|
+
// src/types/common.ts
|
|
22552
|
+
var GenericApiStatus = /* @__PURE__ */ ((GenericApiStatus2) => {
|
|
22553
|
+
GenericApiStatus2["A_VENCER"] = "A_VENCER";
|
|
22554
|
+
GenericApiStatus2["VENCIDA"] = "VENCIDA";
|
|
22555
|
+
GenericApiStatus2["CONCLUIDA"] = "CONCLUIDA";
|
|
22556
|
+
return GenericApiStatus2;
|
|
22557
|
+
})(GenericApiStatus || {});
|
|
22558
|
+
var GenericDisplayStatus = /* @__PURE__ */ ((GenericDisplayStatus4) => {
|
|
22559
|
+
GenericDisplayStatus4["ATIVA"] = "ATIVA";
|
|
22560
|
+
GenericDisplayStatus4["VENCIDA"] = "VENCIDA";
|
|
22561
|
+
GenericDisplayStatus4["CONCLUIDA"] = "CONCLU\xCDDA";
|
|
22562
|
+
return GenericDisplayStatus4;
|
|
22563
|
+
})(GenericDisplayStatus || {});
|
|
22564
|
+
var BadgeActionType = /* @__PURE__ */ ((BadgeActionType4) => {
|
|
22565
|
+
BadgeActionType4["SUCCESS"] = "success";
|
|
22566
|
+
BadgeActionType4["WARNING"] = "warning";
|
|
22567
|
+
BadgeActionType4["ERROR"] = "error";
|
|
22568
|
+
return BadgeActionType4;
|
|
22569
|
+
})(BadgeActionType || {});
|
|
22570
|
+
var getStatusBadgeAction2 = (status) => {
|
|
22545
22571
|
const actionMap = {
|
|
22546
22572
|
["CONCLU\xCDDA" /* CONCLUIDA */]: "success" /* SUCCESS */,
|
|
22547
22573
|
["ATIVA" /* ATIVA */]: "warning" /* WARNING */,
|
|
@@ -22549,6 +22575,17 @@ var getGoalStatusBadgeAction = (status) => {
|
|
|
22549
22575
|
};
|
|
22550
22576
|
return actionMap[status] ?? "warning" /* WARNING */;
|
|
22551
22577
|
};
|
|
22578
|
+
var mapApiStatusToDisplay = (apiStatus) => {
|
|
22579
|
+
const statusMap = {
|
|
22580
|
+
["A_VENCER" /* A_VENCER */]: "ATIVA" /* ATIVA */,
|
|
22581
|
+
["VENCIDA" /* VENCIDA */]: "VENCIDA" /* VENCIDA */,
|
|
22582
|
+
["CONCLUIDA" /* CONCLUIDA */]: "CONCLU\xCDDA" /* CONCLUIDA */
|
|
22583
|
+
};
|
|
22584
|
+
return statusMap[apiStatus];
|
|
22585
|
+
};
|
|
22586
|
+
|
|
22587
|
+
// src/types/recommendedLessons.ts
|
|
22588
|
+
var getGoalStatusBadgeAction = (status) => getStatusBadgeAction2(status);
|
|
22552
22589
|
var GOAL_FILTER_STATUS_OPTIONS = [
|
|
22553
22590
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
22554
22591
|
{ id: "A_VENCER" /* A_VENCER */, name: "Ativa" }
|
|
@@ -23226,7 +23263,7 @@ var RecommendedLessonsHistory = ({
|
|
|
23226
23263
|
};
|
|
23227
23264
|
|
|
23228
23265
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
23229
|
-
var
|
|
23266
|
+
var import_react79 = require("react");
|
|
23230
23267
|
|
|
23231
23268
|
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
23232
23269
|
var import_react72 = require("@phosphor-icons/react");
|
|
@@ -23543,6 +23580,10 @@ var StudentsTable = ({
|
|
|
23543
23580
|
] }) });
|
|
23544
23581
|
};
|
|
23545
23582
|
|
|
23583
|
+
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
23584
|
+
var import_react77 = require("react");
|
|
23585
|
+
var import_react78 = require("@phosphor-icons/react");
|
|
23586
|
+
|
|
23546
23587
|
// src/components/RecommendedLessonDetails/types.ts
|
|
23547
23588
|
var DEFAULT_LABELS = {
|
|
23548
23589
|
viewLesson: "Ver aula",
|
|
@@ -23556,9 +23597,285 @@ var DEFAULT_LABELS = {
|
|
|
23556
23597
|
completionColumn: "Conclus\xE3o",
|
|
23557
23598
|
durationColumn: "Dura\xE7\xE3o"
|
|
23558
23599
|
};
|
|
23600
|
+
var DEFAULT_PERFORMANCE_LABELS = {
|
|
23601
|
+
title: "Desempenho",
|
|
23602
|
+
correctAnswersLabel: "N\xB0 DE QUEST\xD5ES CORRETAS",
|
|
23603
|
+
incorrectAnswersLabel: "N\xB0 DE QUEST\xD5ES INCORRETAS",
|
|
23604
|
+
bestResultLabel: "MELHOR RESULTADO",
|
|
23605
|
+
hardestTopicLabel: "MAIOR DIFICULDADE",
|
|
23606
|
+
lessonsTitle: "Aulas"
|
|
23607
|
+
};
|
|
23559
23608
|
|
|
23560
|
-
// src/components/RecommendedLessonDetails/
|
|
23609
|
+
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
23561
23610
|
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
23611
|
+
var PerformanceCard = ({
|
|
23612
|
+
icon,
|
|
23613
|
+
label,
|
|
23614
|
+
value,
|
|
23615
|
+
secondaryLabel,
|
|
23616
|
+
secondaryValue,
|
|
23617
|
+
variant
|
|
23618
|
+
}) => {
|
|
23619
|
+
const headerBgColor = {
|
|
23620
|
+
success: "bg-success-200",
|
|
23621
|
+
error: "bg-error-100"
|
|
23622
|
+
}[variant];
|
|
23623
|
+
const valueColor = {
|
|
23624
|
+
success: "text-success-700",
|
|
23625
|
+
error: "text-error-700"
|
|
23626
|
+
}[variant];
|
|
23627
|
+
const iconBgColor = {
|
|
23628
|
+
success: "bg-warning-300",
|
|
23629
|
+
error: "bg-error-300"
|
|
23630
|
+
}[variant];
|
|
23631
|
+
const secondaryLabelColor = {
|
|
23632
|
+
success: "text-success-600",
|
|
23633
|
+
error: "text-error-600"
|
|
23634
|
+
}[variant];
|
|
23635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
|
|
23636
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
23637
|
+
"div",
|
|
23638
|
+
{
|
|
23639
|
+
className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
|
|
23640
|
+
children: [
|
|
23641
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23642
|
+
Text_default,
|
|
23643
|
+
{
|
|
23644
|
+
as: "span",
|
|
23645
|
+
className: `size-8 rounded-full flex items-center justify-center ${iconBgColor}`,
|
|
23646
|
+
children: icon
|
|
23647
|
+
}
|
|
23648
|
+
),
|
|
23649
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23650
|
+
Text_default,
|
|
23651
|
+
{
|
|
23652
|
+
size: "2xs",
|
|
23653
|
+
weight: "medium",
|
|
23654
|
+
className: "text-text-800 uppercase text-center leading-none",
|
|
23655
|
+
children: label
|
|
23656
|
+
}
|
|
23657
|
+
),
|
|
23658
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
|
|
23659
|
+
]
|
|
23660
|
+
}
|
|
23661
|
+
),
|
|
23662
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
|
|
23663
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23664
|
+
Text_default,
|
|
23665
|
+
{
|
|
23666
|
+
size: "2xs",
|
|
23667
|
+
weight: "medium",
|
|
23668
|
+
className: `${secondaryLabelColor} uppercase text-center`,
|
|
23669
|
+
children: secondaryLabel
|
|
23670
|
+
}
|
|
23671
|
+
),
|
|
23672
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
|
|
23673
|
+
] })
|
|
23674
|
+
] });
|
|
23675
|
+
};
|
|
23676
|
+
var getAlternativeStatus = (isCorrect, isSelected) => {
|
|
23677
|
+
if (isCorrect) {
|
|
23678
|
+
return "correct";
|
|
23679
|
+
}
|
|
23680
|
+
if (isSelected) {
|
|
23681
|
+
return "incorrect";
|
|
23682
|
+
}
|
|
23683
|
+
return void 0;
|
|
23684
|
+
};
|
|
23685
|
+
var mapAlternatives = (question) => {
|
|
23686
|
+
return question.alternatives.map((alt) => ({
|
|
23687
|
+
value: alt.id,
|
|
23688
|
+
label: alt.text,
|
|
23689
|
+
status: getAlternativeStatus(alt.isCorrect, alt.isSelected)
|
|
23690
|
+
}));
|
|
23691
|
+
};
|
|
23692
|
+
var getSelectedValue = (question) => {
|
|
23693
|
+
const selected = question.alternatives.find((alt) => alt.isSelected);
|
|
23694
|
+
return selected?.id;
|
|
23695
|
+
};
|
|
23696
|
+
var QuestionAccordionItem = ({
|
|
23697
|
+
question,
|
|
23698
|
+
index
|
|
23699
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23700
|
+
CardAccordation,
|
|
23701
|
+
{
|
|
23702
|
+
value: question.id,
|
|
23703
|
+
className: "bg-background rounded-xl border border-border-50",
|
|
23704
|
+
triggerClassName: "py-5 px-5",
|
|
23705
|
+
contentClassName: "px-5 pb-5",
|
|
23706
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex items-center justify-between flex-1", children: [
|
|
23707
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
|
|
23708
|
+
"Quest\xE3o ",
|
|
23709
|
+
index + 1
|
|
23710
|
+
] }),
|
|
23711
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23712
|
+
Badge_default,
|
|
23713
|
+
{
|
|
23714
|
+
size: "small",
|
|
23715
|
+
action: question.isCorrect ? "success" : "error",
|
|
23716
|
+
variant: "solid",
|
|
23717
|
+
iconLeft: question.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react78.CheckCircleIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react78.XCircleIcon, {}),
|
|
23718
|
+
children: question.isCorrect ? "Correta" : "Incorreta"
|
|
23719
|
+
}
|
|
23720
|
+
)
|
|
23721
|
+
] }),
|
|
23722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
23723
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
|
|
23724
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23725
|
+
CardAccordation,
|
|
23726
|
+
{
|
|
23727
|
+
value: `${question.id}-alternatives`,
|
|
23728
|
+
className: "bg-background rounded-lg border border-border-50",
|
|
23729
|
+
triggerClassName: "py-5 px-5",
|
|
23730
|
+
contentClassName: "px-5 py-5",
|
|
23731
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
|
|
23732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23733
|
+
AlternativesList,
|
|
23734
|
+
{
|
|
23735
|
+
mode: "readonly",
|
|
23736
|
+
alternatives: mapAlternatives(question),
|
|
23737
|
+
selectedValue: getSelectedValue(question),
|
|
23738
|
+
layout: "default"
|
|
23739
|
+
}
|
|
23740
|
+
)
|
|
23741
|
+
}
|
|
23742
|
+
)
|
|
23743
|
+
] })
|
|
23744
|
+
}
|
|
23745
|
+
);
|
|
23746
|
+
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23747
|
+
CardAccordation,
|
|
23748
|
+
{
|
|
23749
|
+
value: lesson.id,
|
|
23750
|
+
className: "bg-background rounded-xl border border-border-50",
|
|
23751
|
+
triggerClassName: "py-5 px-5",
|
|
23752
|
+
contentClassName: "px-5 pb-5",
|
|
23753
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col gap-1 flex-1", children: [
|
|
23754
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
|
|
23755
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23756
|
+
ProgressBar_default,
|
|
23757
|
+
{
|
|
23758
|
+
value: lesson.progress,
|
|
23759
|
+
variant: "blue",
|
|
23760
|
+
size: "medium",
|
|
23761
|
+
showPercentage: true,
|
|
23762
|
+
layout: "default"
|
|
23763
|
+
}
|
|
23764
|
+
)
|
|
23765
|
+
] }),
|
|
23766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23767
|
+
QuestionAccordionItem,
|
|
23768
|
+
{
|
|
23769
|
+
question,
|
|
23770
|
+
index
|
|
23771
|
+
},
|
|
23772
|
+
question.id
|
|
23773
|
+
)) })
|
|
23774
|
+
}
|
|
23775
|
+
);
|
|
23776
|
+
var LoadingSkeleton2 = () => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col gap-4 animate-pulse", children: [
|
|
23777
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "h-6 bg-background-200 rounded w-48" }),
|
|
23778
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
23779
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" }),
|
|
23780
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" })
|
|
23781
|
+
] })
|
|
23782
|
+
] });
|
|
23783
|
+
var PerformanceContent = ({
|
|
23784
|
+
data,
|
|
23785
|
+
labels
|
|
23786
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
23787
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
23788
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23789
|
+
Text_default,
|
|
23790
|
+
{
|
|
23791
|
+
as: "span",
|
|
23792
|
+
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
23793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react78.UserIcon, { size: 16, className: "text-text-500" })
|
|
23794
|
+
}
|
|
23795
|
+
),
|
|
23796
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
|
|
23797
|
+
] }),
|
|
23798
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
23799
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23800
|
+
PerformanceCard,
|
|
23801
|
+
{
|
|
23802
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23803
|
+
import_react78.LightbulbFilamentIcon,
|
|
23804
|
+
{
|
|
23805
|
+
size: 18,
|
|
23806
|
+
weight: "fill",
|
|
23807
|
+
className: "text-white"
|
|
23808
|
+
}
|
|
23809
|
+
),
|
|
23810
|
+
label: labels.correctAnswersLabel,
|
|
23811
|
+
value: data.correctAnswers,
|
|
23812
|
+
secondaryLabel: labels.bestResultLabel,
|
|
23813
|
+
secondaryValue: data.bestResult,
|
|
23814
|
+
variant: "success"
|
|
23815
|
+
}
|
|
23816
|
+
),
|
|
23817
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23818
|
+
PerformanceCard,
|
|
23819
|
+
{
|
|
23820
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23821
|
+
import_react78.WarningCircleIcon,
|
|
23822
|
+
{
|
|
23823
|
+
size: 18,
|
|
23824
|
+
weight: "fill",
|
|
23825
|
+
className: "text-error-700"
|
|
23826
|
+
}
|
|
23827
|
+
),
|
|
23828
|
+
label: labels.incorrectAnswersLabel,
|
|
23829
|
+
value: data.incorrectAnswers,
|
|
23830
|
+
secondaryLabel: labels.hardestTopicLabel,
|
|
23831
|
+
secondaryValue: data.hardestTopic,
|
|
23832
|
+
variant: "error"
|
|
23833
|
+
}
|
|
23834
|
+
)
|
|
23835
|
+
] }),
|
|
23836
|
+
data.lessons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
23837
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
|
|
23838
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(LessonAccordionItem, { lesson }, lesson.id)) })
|
|
23839
|
+
] })
|
|
23840
|
+
] });
|
|
23841
|
+
var renderModalContent = (loading, data, labels) => {
|
|
23842
|
+
if (loading) {
|
|
23843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(LoadingSkeleton2, {});
|
|
23844
|
+
}
|
|
23845
|
+
if (data) {
|
|
23846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(PerformanceContent, { data, labels });
|
|
23847
|
+
}
|
|
23848
|
+
return null;
|
|
23849
|
+
};
|
|
23850
|
+
var StudentPerformanceModal = ({
|
|
23851
|
+
isOpen,
|
|
23852
|
+
onClose,
|
|
23853
|
+
data,
|
|
23854
|
+
loading = false,
|
|
23855
|
+
labels: customLabels
|
|
23856
|
+
}) => {
|
|
23857
|
+
const labels = (0, import_react77.useMemo)(
|
|
23858
|
+
() => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
|
|
23859
|
+
[customLabels]
|
|
23860
|
+
);
|
|
23861
|
+
if (!data && !loading) {
|
|
23862
|
+
return null;
|
|
23863
|
+
}
|
|
23864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23865
|
+
Modal_default,
|
|
23866
|
+
{
|
|
23867
|
+
isOpen,
|
|
23868
|
+
onClose,
|
|
23869
|
+
title: labels.title,
|
|
23870
|
+
size: "lg",
|
|
23871
|
+
contentClassName: "max-h-[70vh] overflow-y-auto",
|
|
23872
|
+
children: renderModalContent(loading, data, labels)
|
|
23873
|
+
}
|
|
23874
|
+
);
|
|
23875
|
+
};
|
|
23876
|
+
|
|
23877
|
+
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
23878
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
23562
23879
|
var RecommendedLessonDetails = ({
|
|
23563
23880
|
data,
|
|
23564
23881
|
loading = false,
|
|
@@ -23571,11 +23888,11 @@ var RecommendedLessonDetails = ({
|
|
|
23571
23888
|
labels: customLabels,
|
|
23572
23889
|
className
|
|
23573
23890
|
}) => {
|
|
23574
|
-
const labels = (0,
|
|
23891
|
+
const labels = (0, import_react79.useMemo)(
|
|
23575
23892
|
() => ({ ...DEFAULT_LABELS, ...customLabels }),
|
|
23576
23893
|
[customLabels]
|
|
23577
23894
|
);
|
|
23578
|
-
const defaultBreadcrumbs = (0,
|
|
23895
|
+
const defaultBreadcrumbs = (0, import_react79.useMemo)(
|
|
23579
23896
|
() => [
|
|
23580
23897
|
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
23581
23898
|
{ label: data?.goal.title || "Detalhes" }
|
|
@@ -23583,7 +23900,7 @@ var RecommendedLessonDetails = ({
|
|
|
23583
23900
|
[data?.goal.title]
|
|
23584
23901
|
);
|
|
23585
23902
|
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
23586
|
-
const displayStudents = (0,
|
|
23903
|
+
const displayStudents = (0, import_react79.useMemo)(() => {
|
|
23587
23904
|
if (!data?.details.students) return [];
|
|
23588
23905
|
const deadline = data?.goal.finalDate;
|
|
23589
23906
|
return data.details.students.map(
|
|
@@ -23591,17 +23908,17 @@ var RecommendedLessonDetails = ({
|
|
|
23591
23908
|
);
|
|
23592
23909
|
}, [data?.details.students, data?.goal.finalDate]);
|
|
23593
23910
|
if (loading) {
|
|
23594
|
-
return /* @__PURE__ */ (0,
|
|
23911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23595
23912
|
"div",
|
|
23596
23913
|
{
|
|
23597
23914
|
className: cn("flex flex-col gap-6", className),
|
|
23598
23915
|
"data-testid": "lesson-details-loading",
|
|
23599
|
-
children: /* @__PURE__ */ (0,
|
|
23916
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(LoadingSkeleton, {})
|
|
23600
23917
|
}
|
|
23601
23918
|
);
|
|
23602
23919
|
}
|
|
23603
23920
|
if (error) {
|
|
23604
|
-
return /* @__PURE__ */ (0,
|
|
23921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23605
23922
|
"div",
|
|
23606
23923
|
{
|
|
23607
23924
|
className: cn(
|
|
@@ -23609,21 +23926,21 @@ var RecommendedLessonDetails = ({
|
|
|
23609
23926
|
className
|
|
23610
23927
|
),
|
|
23611
23928
|
"data-testid": "lesson-details-error",
|
|
23612
|
-
children: /* @__PURE__ */ (0,
|
|
23929
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
|
|
23613
23930
|
}
|
|
23614
23931
|
);
|
|
23615
23932
|
}
|
|
23616
23933
|
if (!data) {
|
|
23617
23934
|
return null;
|
|
23618
23935
|
}
|
|
23619
|
-
return /* @__PURE__ */ (0,
|
|
23936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
23620
23937
|
"div",
|
|
23621
23938
|
{
|
|
23622
23939
|
className: cn("flex flex-col gap-6", className),
|
|
23623
23940
|
"data-testid": "recommended-lesson-details",
|
|
23624
23941
|
children: [
|
|
23625
|
-
/* @__PURE__ */ (0,
|
|
23626
|
-
/* @__PURE__ */ (0,
|
|
23942
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
|
|
23943
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23627
23944
|
LessonHeader,
|
|
23628
23945
|
{
|
|
23629
23946
|
data,
|
|
@@ -23632,8 +23949,8 @@ var RecommendedLessonDetails = ({
|
|
|
23632
23949
|
viewLessonLabel: labels.viewLesson
|
|
23633
23950
|
}
|
|
23634
23951
|
),
|
|
23635
|
-
/* @__PURE__ */ (0,
|
|
23636
|
-
/* @__PURE__ */ (0,
|
|
23952
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ResultsSection, { data, labels }),
|
|
23953
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23637
23954
|
StudentsTable,
|
|
23638
23955
|
{
|
|
23639
23956
|
students: displayStudents,
|
|
@@ -23648,7 +23965,7 @@ var RecommendedLessonDetails = ({
|
|
|
23648
23965
|
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
23649
23966
|
|
|
23650
23967
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
23651
|
-
var
|
|
23968
|
+
var import_react80 = require("react");
|
|
23652
23969
|
var import_zod5 = require("zod");
|
|
23653
23970
|
var goalLessonSubjectSchema = import_zod5.z.object({
|
|
23654
23971
|
id: import_zod5.z.string(),
|
|
@@ -23751,12 +24068,12 @@ var handleLessonDetailsFetchError = (error) => {
|
|
|
23751
24068
|
};
|
|
23752
24069
|
var createUseRecommendedLessonDetails = (apiClient) => {
|
|
23753
24070
|
return (lessonId) => {
|
|
23754
|
-
const [state, setState] = (0,
|
|
24071
|
+
const [state, setState] = (0, import_react80.useState)({
|
|
23755
24072
|
data: null,
|
|
23756
24073
|
loading: true,
|
|
23757
24074
|
error: null
|
|
23758
24075
|
});
|
|
23759
|
-
const fetchLessonDetails = (0,
|
|
24076
|
+
const fetchLessonDetails = (0, import_react80.useCallback)(async () => {
|
|
23760
24077
|
if (!lessonId) {
|
|
23761
24078
|
setState({
|
|
23762
24079
|
data: null,
|
|
@@ -23802,7 +24119,7 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
23802
24119
|
});
|
|
23803
24120
|
}
|
|
23804
24121
|
}, [lessonId]);
|
|
23805
|
-
(0,
|
|
24122
|
+
(0, import_react80.useEffect)(() => {
|
|
23806
24123
|
fetchLessonDetails();
|
|
23807
24124
|
}, [fetchLessonDetails]);
|
|
23808
24125
|
return {
|
|
@@ -23812,14 +24129,1010 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
23812
24129
|
};
|
|
23813
24130
|
};
|
|
23814
24131
|
var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
24132
|
+
|
|
24133
|
+
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
24134
|
+
var import_react85 = require("react");
|
|
24135
|
+
|
|
24136
|
+
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
24137
|
+
var import_react82 = require("react");
|
|
24138
|
+
var import_phosphor_react46 = require("phosphor-react");
|
|
24139
|
+
|
|
24140
|
+
// src/components/ActivitiesHistory/components/ErrorDisplay.tsx
|
|
24141
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
24142
|
+
var ErrorDisplay = ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) });
|
|
24143
|
+
|
|
24144
|
+
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
24145
|
+
var import_phosphor_react45 = require("phosphor-react");
|
|
24146
|
+
|
|
24147
|
+
// src/components/ActivitiesHistory/utils/renderSubjectCell.tsx
|
|
24148
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
24149
|
+
var renderSubjectCell = (subjectName, mapSubjectNameToEnum, showEmptyDash = false) => {
|
|
24150
|
+
if (!subjectName) {
|
|
24151
|
+
return showEmptyDash ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text_default, { size: "sm", color: "text-text-400", children: "-" }) : null;
|
|
24152
|
+
}
|
|
24153
|
+
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
24154
|
+
if (!subjectEnum) {
|
|
24155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
24156
|
+
}
|
|
24157
|
+
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
24158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
24159
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24160
|
+
"span",
|
|
24161
|
+
{
|
|
24162
|
+
className: cn(
|
|
24163
|
+
"w-[21px] h-[21px] flex items-center justify-center rounded-sm text-text-950 shrink-0",
|
|
24164
|
+
subjectInfo.colorClass
|
|
24165
|
+
),
|
|
24166
|
+
children: subjectInfo.icon
|
|
24167
|
+
}
|
|
24168
|
+
),
|
|
24169
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
24170
|
+
] });
|
|
24171
|
+
};
|
|
24172
|
+
|
|
24173
|
+
// src/components/ActivitiesHistory/utils/renderTruncatedText.tsx
|
|
24174
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
24175
|
+
var renderTruncatedText = (value) => {
|
|
24176
|
+
const text = typeof value === "string" ? value : "";
|
|
24177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text_default, { size: "sm", title: text, children: text });
|
|
24178
|
+
};
|
|
24179
|
+
|
|
24180
|
+
// src/components/ActivitiesHistory/utils/filterBuilders.ts
|
|
24181
|
+
var isNonEmptyArray2 = (param) => Array.isArray(param) && param.length > 0;
|
|
24182
|
+
var isValidApiStatus = (value) => Object.values(GenericApiStatus).includes(value);
|
|
24183
|
+
var buildHistoryFiltersFromParams = (params) => {
|
|
24184
|
+
const filters = {
|
|
24185
|
+
page: params.page,
|
|
24186
|
+
limit: params.limit
|
|
24187
|
+
};
|
|
24188
|
+
if (params.search) {
|
|
24189
|
+
filters.search = params.search;
|
|
24190
|
+
}
|
|
24191
|
+
if (isNonEmptyArray2(params.status) && isValidApiStatus(params.status[0])) {
|
|
24192
|
+
filters.status = params.status[0];
|
|
24193
|
+
}
|
|
24194
|
+
if (isNonEmptyArray2(params.school)) {
|
|
24195
|
+
filters.schoolId = params.school[0];
|
|
24196
|
+
}
|
|
24197
|
+
if (isNonEmptyArray2(params.subject)) {
|
|
24198
|
+
filters.subjectId = params.subject[0];
|
|
24199
|
+
}
|
|
24200
|
+
return filters;
|
|
24201
|
+
};
|
|
24202
|
+
var buildModelsFiltersFromParams = (params) => {
|
|
24203
|
+
const filters = {
|
|
24204
|
+
page: params.page,
|
|
24205
|
+
limit: params.limit
|
|
24206
|
+
};
|
|
24207
|
+
if (params.search) {
|
|
24208
|
+
filters.search = params.search;
|
|
24209
|
+
}
|
|
24210
|
+
if (isNonEmptyArray2(params.subject)) {
|
|
24211
|
+
filters.subjectId = params.subject[0];
|
|
24212
|
+
}
|
|
24213
|
+
return filters;
|
|
24214
|
+
};
|
|
24215
|
+
|
|
24216
|
+
// src/components/ActivitiesHistory/utils/filterOptions.ts
|
|
24217
|
+
var getSchoolOptions2 = (data) => {
|
|
24218
|
+
if (!data?.schools) return [];
|
|
24219
|
+
return data.schools.map((school) => ({
|
|
24220
|
+
id: school.id,
|
|
24221
|
+
name: school.name
|
|
24222
|
+
}));
|
|
24223
|
+
};
|
|
24224
|
+
var getSubjectOptions2 = (data) => {
|
|
24225
|
+
if (!data?.subjects) return [];
|
|
24226
|
+
return data.subjects.map((subject) => ({
|
|
24227
|
+
id: subject.id,
|
|
24228
|
+
name: subject.name
|
|
24229
|
+
}));
|
|
24230
|
+
};
|
|
24231
|
+
|
|
24232
|
+
// src/types/activitiesHistory.ts
|
|
24233
|
+
var ActivityDraftType = /* @__PURE__ */ ((ActivityDraftType2) => {
|
|
24234
|
+
ActivityDraftType2["MODELO"] = "MODELO";
|
|
24235
|
+
ActivityDraftType2["RASCUNHO"] = "RASCUNHO";
|
|
24236
|
+
return ActivityDraftType2;
|
|
24237
|
+
})(ActivityDraftType || {});
|
|
24238
|
+
var getActivityStatusBadgeAction = (status) => getStatusBadgeAction2(status);
|
|
24239
|
+
var ACTIVITY_FILTER_STATUS_OPTIONS = [
|
|
24240
|
+
{ id: "A_VENCER" /* A_VENCER */, name: "A Vencer" },
|
|
24241
|
+
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
24242
|
+
{ id: "CONCLUIDA" /* CONCLUIDA */, name: "Conclu\xEDda" }
|
|
24243
|
+
];
|
|
24244
|
+
var mapActivityStatusToDisplay = (apiStatus) => mapApiStatusToDisplay(apiStatus);
|
|
24245
|
+
|
|
24246
|
+
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
24247
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
24248
|
+
var createHistoryTableColumns = (mapSubjectNameToEnum) => [
|
|
24249
|
+
{
|
|
24250
|
+
key: "startDate",
|
|
24251
|
+
label: "In\xEDcio",
|
|
24252
|
+
sortable: true
|
|
24253
|
+
},
|
|
24254
|
+
{
|
|
24255
|
+
key: "deadline",
|
|
24256
|
+
label: "Prazo",
|
|
24257
|
+
sortable: true
|
|
24258
|
+
},
|
|
24259
|
+
{
|
|
24260
|
+
key: "title",
|
|
24261
|
+
label: "T\xEDtulo",
|
|
24262
|
+
sortable: true,
|
|
24263
|
+
className: "max-w-[200px] truncate",
|
|
24264
|
+
render: renderTruncatedText
|
|
24265
|
+
},
|
|
24266
|
+
{
|
|
24267
|
+
key: "school",
|
|
24268
|
+
label: "Escola",
|
|
24269
|
+
sortable: true,
|
|
24270
|
+
className: "max-w-[150px] truncate",
|
|
24271
|
+
render: renderTruncatedText
|
|
24272
|
+
},
|
|
24273
|
+
{
|
|
24274
|
+
key: "year",
|
|
24275
|
+
label: "Ano",
|
|
24276
|
+
sortable: true
|
|
24277
|
+
},
|
|
24278
|
+
{
|
|
24279
|
+
key: "subject",
|
|
24280
|
+
label: "Mat\xE9ria",
|
|
24281
|
+
sortable: true,
|
|
24282
|
+
className: "max-w-[140px]",
|
|
24283
|
+
render: (value) => {
|
|
24284
|
+
const subjectName = typeof value === "string" ? value : "";
|
|
24285
|
+
return renderSubjectCell(subjectName, mapSubjectNameToEnum, false);
|
|
24286
|
+
}
|
|
24287
|
+
},
|
|
24288
|
+
{
|
|
24289
|
+
key: "class",
|
|
24290
|
+
label: "Turma",
|
|
24291
|
+
sortable: true
|
|
24292
|
+
},
|
|
24293
|
+
{
|
|
24294
|
+
key: "status",
|
|
24295
|
+
label: "Status",
|
|
24296
|
+
sortable: true,
|
|
24297
|
+
render: (value) => {
|
|
24298
|
+
const status = typeof value === "string" ? value : "";
|
|
24299
|
+
if (!status) {
|
|
24300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
24301
|
+
}
|
|
24302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
24303
|
+
Badge_default,
|
|
24304
|
+
{
|
|
24305
|
+
variant: "solid",
|
|
24306
|
+
action: getActivityStatusBadgeAction(status),
|
|
24307
|
+
size: "small",
|
|
24308
|
+
children: status
|
|
24309
|
+
}
|
|
24310
|
+
);
|
|
24311
|
+
}
|
|
24312
|
+
},
|
|
24313
|
+
{
|
|
24314
|
+
key: "completionPercentage",
|
|
24315
|
+
label: "Conclus\xE3o",
|
|
24316
|
+
sortable: true,
|
|
24317
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
24318
|
+
ProgressBar_default,
|
|
24319
|
+
{
|
|
24320
|
+
value: Number(value),
|
|
24321
|
+
variant: "blue",
|
|
24322
|
+
size: "medium",
|
|
24323
|
+
layout: "compact",
|
|
24324
|
+
showPercentage: true,
|
|
24325
|
+
compactWidth: "w-[100px]"
|
|
24326
|
+
}
|
|
24327
|
+
)
|
|
24328
|
+
},
|
|
24329
|
+
{
|
|
24330
|
+
key: "navigation",
|
|
24331
|
+
label: "",
|
|
24332
|
+
sortable: false,
|
|
24333
|
+
className: "w-12",
|
|
24334
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_phosphor_react45.CaretRight, { size: 20, className: "text-text-600" }) })
|
|
24335
|
+
}
|
|
24336
|
+
];
|
|
24337
|
+
|
|
24338
|
+
// src/components/ActivitiesHistory/config/historyFiltersConfig.ts
|
|
24339
|
+
var createHistoryFiltersConfig = (userData) => [
|
|
24340
|
+
{
|
|
24341
|
+
key: "status",
|
|
24342
|
+
label: "STATUS",
|
|
24343
|
+
categories: [
|
|
24344
|
+
{
|
|
24345
|
+
key: "status",
|
|
24346
|
+
label: "Status da Atividade",
|
|
24347
|
+
selectedIds: [],
|
|
24348
|
+
itens: ACTIVITY_FILTER_STATUS_OPTIONS
|
|
24349
|
+
}
|
|
24350
|
+
]
|
|
24351
|
+
},
|
|
24352
|
+
{
|
|
24353
|
+
key: "academic",
|
|
24354
|
+
label: "DADOS ACAD\xCAMICOS",
|
|
24355
|
+
categories: [
|
|
24356
|
+
{
|
|
24357
|
+
key: "school",
|
|
24358
|
+
label: "Escola",
|
|
24359
|
+
selectedIds: [],
|
|
24360
|
+
itens: getSchoolOptions2(userData)
|
|
24361
|
+
}
|
|
24362
|
+
]
|
|
24363
|
+
},
|
|
24364
|
+
{
|
|
24365
|
+
key: "content",
|
|
24366
|
+
label: "CONTE\xDADO",
|
|
24367
|
+
categories: [
|
|
24368
|
+
{
|
|
24369
|
+
key: "subject",
|
|
24370
|
+
label: "Mat\xE9ria",
|
|
24371
|
+
selectedIds: [],
|
|
24372
|
+
itens: getSubjectOptions2(userData)
|
|
24373
|
+
}
|
|
24374
|
+
]
|
|
24375
|
+
}
|
|
24376
|
+
];
|
|
24377
|
+
|
|
24378
|
+
// src/hooks/useActivitiesHistory.ts
|
|
24379
|
+
var import_react81 = require("react");
|
|
24380
|
+
var import_zod7 = require("zod");
|
|
24381
|
+
var import_dayjs4 = __toESM(require("dayjs"));
|
|
24382
|
+
|
|
24383
|
+
// src/utils/hookErrorHandler.ts
|
|
24384
|
+
var import_zod6 = require("zod");
|
|
24385
|
+
var createFetchErrorHandler = (validationErrorMessage, genericErrorMessage) => (error) => {
|
|
24386
|
+
if (error instanceof import_zod6.z.ZodError) {
|
|
24387
|
+
console.error(validationErrorMessage, error);
|
|
24388
|
+
return validationErrorMessage;
|
|
24389
|
+
}
|
|
24390
|
+
console.error(genericErrorMessage, error);
|
|
24391
|
+
return genericErrorMessage;
|
|
24392
|
+
};
|
|
24393
|
+
|
|
24394
|
+
// src/hooks/useActivitiesHistory.ts
|
|
24395
|
+
var activityHistoryResponseSchema = import_zod7.z.object({
|
|
24396
|
+
id: import_zod7.z.string().uuid(),
|
|
24397
|
+
title: import_zod7.z.string(),
|
|
24398
|
+
startDate: import_zod7.z.string().nullable(),
|
|
24399
|
+
finalDate: import_zod7.z.string().nullable(),
|
|
24400
|
+
status: import_zod7.z.nativeEnum(GenericApiStatus),
|
|
24401
|
+
completionPercentage: import_zod7.z.number().min(0).max(100),
|
|
24402
|
+
subjectId: import_zod7.z.string().uuid(),
|
|
24403
|
+
schoolId: import_zod7.z.string().optional(),
|
|
24404
|
+
schoolName: import_zod7.z.string().optional(),
|
|
24405
|
+
year: import_zod7.z.string().optional(),
|
|
24406
|
+
className: import_zod7.z.string().optional(),
|
|
24407
|
+
subjectName: import_zod7.z.string().optional()
|
|
24408
|
+
});
|
|
24409
|
+
var activitiesHistoryApiResponseSchema = import_zod7.z.object({
|
|
24410
|
+
message: import_zod7.z.string(),
|
|
24411
|
+
data: import_zod7.z.object({
|
|
24412
|
+
activities: import_zod7.z.array(activityHistoryResponseSchema),
|
|
24413
|
+
pagination: import_zod7.z.object({
|
|
24414
|
+
total: import_zod7.z.number(),
|
|
24415
|
+
page: import_zod7.z.number(),
|
|
24416
|
+
limit: import_zod7.z.number(),
|
|
24417
|
+
totalPages: import_zod7.z.number()
|
|
24418
|
+
})
|
|
24419
|
+
})
|
|
24420
|
+
});
|
|
24421
|
+
var DEFAULT_ACTIVITIES_PAGINATION = {
|
|
24422
|
+
total: 0,
|
|
24423
|
+
page: 1,
|
|
24424
|
+
limit: 10,
|
|
24425
|
+
totalPages: 0
|
|
24426
|
+
};
|
|
24427
|
+
var transformActivityToTableItem = (activity) => {
|
|
24428
|
+
return {
|
|
24429
|
+
id: activity.id,
|
|
24430
|
+
startDate: activity.startDate ? (0, import_dayjs4.default)(activity.startDate).format("DD/MM") : "-",
|
|
24431
|
+
deadline: activity.finalDate ? (0, import_dayjs4.default)(activity.finalDate).format("DD/MM") : "-",
|
|
24432
|
+
title: activity.title,
|
|
24433
|
+
school: activity.schoolName || "-",
|
|
24434
|
+
year: activity.year || "-",
|
|
24435
|
+
subject: activity.subjectName || "-",
|
|
24436
|
+
class: activity.className || "-",
|
|
24437
|
+
status: mapActivityStatusToDisplay(activity.status),
|
|
24438
|
+
completionPercentage: activity.completionPercentage
|
|
24439
|
+
};
|
|
24440
|
+
};
|
|
24441
|
+
var handleActivityFetchError = createFetchErrorHandler(
|
|
24442
|
+
"Erro ao validar dados de hist\xF3rico de atividades",
|
|
24443
|
+
"Erro ao carregar hist\xF3rico de atividades"
|
|
24444
|
+
);
|
|
24445
|
+
var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
24446
|
+
return () => {
|
|
24447
|
+
const [state, setState] = (0, import_react81.useState)({
|
|
24448
|
+
activities: [],
|
|
24449
|
+
loading: false,
|
|
24450
|
+
error: null,
|
|
24451
|
+
pagination: DEFAULT_ACTIVITIES_PAGINATION
|
|
24452
|
+
});
|
|
24453
|
+
const fetchActivities = (0, import_react81.useCallback)(
|
|
24454
|
+
async (filters) => {
|
|
24455
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
24456
|
+
try {
|
|
24457
|
+
const responseData = await fetchActivitiesHistory(filters);
|
|
24458
|
+
const validatedData = activitiesHistoryApiResponseSchema.parse(responseData);
|
|
24459
|
+
const tableItems = validatedData.data.activities.map(
|
|
24460
|
+
transformActivityToTableItem
|
|
24461
|
+
);
|
|
24462
|
+
setState({
|
|
24463
|
+
activities: tableItems,
|
|
24464
|
+
loading: false,
|
|
24465
|
+
error: null,
|
|
24466
|
+
pagination: validatedData.data.pagination
|
|
24467
|
+
});
|
|
24468
|
+
} catch (error) {
|
|
24469
|
+
const errorMessage = handleActivityFetchError(error);
|
|
24470
|
+
setState((prev) => ({
|
|
24471
|
+
...prev,
|
|
24472
|
+
loading: false,
|
|
24473
|
+
error: errorMessage
|
|
24474
|
+
}));
|
|
24475
|
+
}
|
|
24476
|
+
},
|
|
24477
|
+
[fetchActivitiesHistory]
|
|
24478
|
+
);
|
|
24479
|
+
return {
|
|
24480
|
+
...state,
|
|
24481
|
+
fetchActivities
|
|
24482
|
+
};
|
|
24483
|
+
};
|
|
24484
|
+
};
|
|
24485
|
+
var createActivitiesHistoryHook = createUseActivitiesHistory;
|
|
24486
|
+
|
|
24487
|
+
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
24488
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
24489
|
+
var HistoryTab = ({
|
|
24490
|
+
fetchActivitiesHistory,
|
|
24491
|
+
onCreateActivity,
|
|
24492
|
+
onRowClick,
|
|
24493
|
+
emptyStateImage,
|
|
24494
|
+
noSearchImage,
|
|
24495
|
+
mapSubjectNameToEnum,
|
|
24496
|
+
userFilterData
|
|
24497
|
+
}) => {
|
|
24498
|
+
const fetchActivitiesHistoryRef = (0, import_react82.useRef)(fetchActivitiesHistory);
|
|
24499
|
+
fetchActivitiesHistoryRef.current = fetchActivitiesHistory;
|
|
24500
|
+
const useActivitiesHistory = (0, import_react82.useMemo)(
|
|
24501
|
+
() => createUseActivitiesHistory(
|
|
24502
|
+
(filters) => fetchActivitiesHistoryRef.current(filters)
|
|
24503
|
+
),
|
|
24504
|
+
[]
|
|
24505
|
+
);
|
|
24506
|
+
const {
|
|
24507
|
+
activities,
|
|
24508
|
+
loading,
|
|
24509
|
+
error,
|
|
24510
|
+
pagination,
|
|
24511
|
+
fetchActivities
|
|
24512
|
+
} = useActivitiesHistory();
|
|
24513
|
+
const historyFilterConfigs = (0, import_react82.useMemo)(
|
|
24514
|
+
() => createHistoryFiltersConfig(userFilterData),
|
|
24515
|
+
[userFilterData]
|
|
24516
|
+
);
|
|
24517
|
+
const historyTableColumns = (0, import_react82.useMemo)(
|
|
24518
|
+
() => createHistoryTableColumns(mapSubjectNameToEnum),
|
|
24519
|
+
[mapSubjectNameToEnum]
|
|
24520
|
+
);
|
|
24521
|
+
const handleParamsChange = (0, import_react82.useCallback)(
|
|
24522
|
+
(params) => {
|
|
24523
|
+
const filters = buildHistoryFiltersFromParams(params);
|
|
24524
|
+
fetchActivities(filters);
|
|
24525
|
+
},
|
|
24526
|
+
[fetchActivities]
|
|
24527
|
+
);
|
|
24528
|
+
if (error) {
|
|
24529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ErrorDisplay, { error });
|
|
24530
|
+
}
|
|
24531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
24532
|
+
TableProvider,
|
|
24533
|
+
{
|
|
24534
|
+
data: activities,
|
|
24535
|
+
headers: historyTableColumns,
|
|
24536
|
+
loading,
|
|
24537
|
+
variant: "borderless",
|
|
24538
|
+
enableSearch: true,
|
|
24539
|
+
enableFilters: true,
|
|
24540
|
+
enableTableSort: true,
|
|
24541
|
+
enablePagination: true,
|
|
24542
|
+
enableRowClick: true,
|
|
24543
|
+
initialFilters: historyFilterConfigs,
|
|
24544
|
+
paginationConfig: {
|
|
24545
|
+
itemLabel: "atividades",
|
|
24546
|
+
itemsPerPageOptions: [10, 20, 50, 100],
|
|
24547
|
+
defaultItemsPerPage: 10,
|
|
24548
|
+
totalItems: pagination.total,
|
|
24549
|
+
totalPages: pagination.totalPages
|
|
24550
|
+
},
|
|
24551
|
+
searchPlaceholder: "Buscar atividade",
|
|
24552
|
+
noSearchResultState: {
|
|
24553
|
+
image: noSearchImage
|
|
24554
|
+
},
|
|
24555
|
+
emptyState: {
|
|
24556
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
24557
|
+
EmptyState_default,
|
|
24558
|
+
{
|
|
24559
|
+
image: emptyStateImage,
|
|
24560
|
+
title: "Incentive sua turma ao aprendizado",
|
|
24561
|
+
description: "Crie uma nova atividade e ajude seus alunos a colocarem o conte\xFAdo em pr\xE1tica!",
|
|
24562
|
+
buttonText: "Criar atividade",
|
|
24563
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_phosphor_react46.Plus, { size: 18 }),
|
|
24564
|
+
buttonVariant: "outline",
|
|
24565
|
+
buttonAction: "primary",
|
|
24566
|
+
onButtonClick: onCreateActivity
|
|
24567
|
+
}
|
|
24568
|
+
)
|
|
24569
|
+
},
|
|
24570
|
+
onParamsChange: handleParamsChange,
|
|
24571
|
+
onRowClick,
|
|
24572
|
+
children: (renderProps) => {
|
|
24573
|
+
const {
|
|
24574
|
+
controls,
|
|
24575
|
+
table,
|
|
24576
|
+
pagination: paginationComponent
|
|
24577
|
+
} = renderProps;
|
|
24578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "space-y-4", children: [
|
|
24579
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
24580
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
24581
|
+
Button_default,
|
|
24582
|
+
{
|
|
24583
|
+
variant: "solid",
|
|
24584
|
+
action: "primary",
|
|
24585
|
+
size: "medium",
|
|
24586
|
+
onClick: onCreateActivity,
|
|
24587
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_phosphor_react46.Plus, { size: 18, weight: "bold" }),
|
|
24588
|
+
children: "Criar atividade"
|
|
24589
|
+
}
|
|
24590
|
+
),
|
|
24591
|
+
controls
|
|
24592
|
+
] }),
|
|
24593
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
24594
|
+
table,
|
|
24595
|
+
paginationComponent
|
|
24596
|
+
] })
|
|
24597
|
+
] });
|
|
24598
|
+
}
|
|
24599
|
+
}
|
|
24600
|
+
) });
|
|
24601
|
+
};
|
|
24602
|
+
|
|
24603
|
+
// src/components/ActivitiesHistory/tabs/ModelsTab.tsx
|
|
24604
|
+
var import_react84 = require("react");
|
|
24605
|
+
var import_phosphor_react48 = require("phosphor-react");
|
|
24606
|
+
|
|
24607
|
+
// src/components/ActivitiesHistory/config/modelsTableColumns.tsx
|
|
24608
|
+
var import_phosphor_react47 = require("phosphor-react");
|
|
24609
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
24610
|
+
var createModelsTableColumns = (mapSubjectNameToEnum, onSendActivity, onEditModel, onDeleteModel) => [
|
|
24611
|
+
{
|
|
24612
|
+
key: "title",
|
|
24613
|
+
label: "T\xEDtulo",
|
|
24614
|
+
sortable: true,
|
|
24615
|
+
className: "max-w-[400px]",
|
|
24616
|
+
render: (value) => {
|
|
24617
|
+
const title = typeof value === "string" ? value : "";
|
|
24618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text_default, { size: "sm", title, className: "truncate block", children: title });
|
|
24619
|
+
}
|
|
24620
|
+
},
|
|
24621
|
+
{
|
|
24622
|
+
key: "savedAt",
|
|
24623
|
+
label: "Salvo em",
|
|
24624
|
+
sortable: true,
|
|
24625
|
+
className: "w-[120px]"
|
|
24626
|
+
},
|
|
24627
|
+
{
|
|
24628
|
+
key: "subject",
|
|
24629
|
+
label: "Mat\xE9ria",
|
|
24630
|
+
sortable: true,
|
|
24631
|
+
className: "max-w-[160px]",
|
|
24632
|
+
render: (value) => {
|
|
24633
|
+
const subjectName = typeof value === "string" ? value : "";
|
|
24634
|
+
return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
|
|
24635
|
+
}
|
|
24636
|
+
},
|
|
24637
|
+
{
|
|
24638
|
+
key: "actions",
|
|
24639
|
+
label: "",
|
|
24640
|
+
sortable: false,
|
|
24641
|
+
className: "w-[220px]",
|
|
24642
|
+
render: (_value, row) => {
|
|
24643
|
+
const handleSend = (e) => {
|
|
24644
|
+
e.stopPropagation();
|
|
24645
|
+
onSendActivity?.(row);
|
|
24646
|
+
};
|
|
24647
|
+
const handleEdit = (e) => {
|
|
24648
|
+
e.stopPropagation();
|
|
24649
|
+
onEditModel?.(row);
|
|
24650
|
+
};
|
|
24651
|
+
const handleDelete = (e) => {
|
|
24652
|
+
e.stopPropagation();
|
|
24653
|
+
onDeleteModel(row);
|
|
24654
|
+
};
|
|
24655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
24656
|
+
onSendActivity && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
24657
|
+
Button_default,
|
|
24658
|
+
{
|
|
24659
|
+
variant: "outline",
|
|
24660
|
+
action: "primary",
|
|
24661
|
+
size: "small",
|
|
24662
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_phosphor_react47.PaperPlaneTilt, { size: 16 }),
|
|
24663
|
+
onClick: handleSend,
|
|
24664
|
+
"aria-label": "Enviar atividade",
|
|
24665
|
+
children: "Enviar atividade"
|
|
24666
|
+
}
|
|
24667
|
+
),
|
|
24668
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
24669
|
+
IconButton_default,
|
|
24670
|
+
{
|
|
24671
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_phosphor_react47.Trash, { size: 20 }),
|
|
24672
|
+
size: "md",
|
|
24673
|
+
onClick: handleDelete,
|
|
24674
|
+
"aria-label": "Deletar modelo",
|
|
24675
|
+
className: "text-text-600 hover:text-error-500 hover:bg-transparent"
|
|
24676
|
+
}
|
|
24677
|
+
),
|
|
24678
|
+
onEditModel && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
24679
|
+
IconButton_default,
|
|
24680
|
+
{
|
|
24681
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_phosphor_react47.PencilSimple, { size: 20 }),
|
|
24682
|
+
size: "md",
|
|
24683
|
+
onClick: handleEdit,
|
|
24684
|
+
"aria-label": "Editar modelo",
|
|
24685
|
+
className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
|
|
24686
|
+
}
|
|
24687
|
+
)
|
|
24688
|
+
] });
|
|
24689
|
+
}
|
|
24690
|
+
}
|
|
24691
|
+
];
|
|
24692
|
+
|
|
24693
|
+
// src/components/ActivitiesHistory/config/modelsFiltersConfig.ts
|
|
24694
|
+
var createModelsFiltersConfig = (userData) => [
|
|
24695
|
+
{
|
|
24696
|
+
key: "content",
|
|
24697
|
+
label: "CONTE\xDADO",
|
|
24698
|
+
categories: [
|
|
24699
|
+
{
|
|
24700
|
+
key: "subject",
|
|
24701
|
+
label: "Mat\xE9ria",
|
|
24702
|
+
selectedIds: [],
|
|
24703
|
+
itens: getSubjectOptions2(userData)
|
|
24704
|
+
}
|
|
24705
|
+
]
|
|
24706
|
+
}
|
|
24707
|
+
];
|
|
24708
|
+
|
|
24709
|
+
// src/hooks/useActivityModels.ts
|
|
24710
|
+
var import_react83 = require("react");
|
|
24711
|
+
var import_zod8 = require("zod");
|
|
24712
|
+
var import_dayjs5 = __toESM(require("dayjs"));
|
|
24713
|
+
var activityDraftFiltersSchema = import_zod8.z.object({
|
|
24714
|
+
questionTypes: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
24715
|
+
questionBanks: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
24716
|
+
subjects: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
24717
|
+
topics: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
24718
|
+
subtopics: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
24719
|
+
contents: import_zod8.z.array(import_zod8.z.string()).optional()
|
|
24720
|
+
}).nullable();
|
|
24721
|
+
var activityModelResponseSchema = import_zod8.z.object({
|
|
24722
|
+
id: import_zod8.z.string().uuid(),
|
|
24723
|
+
type: import_zod8.z.nativeEnum(ActivityDraftType),
|
|
24724
|
+
title: import_zod8.z.string().nullable(),
|
|
24725
|
+
creatorUserInstitutionId: import_zod8.z.string().uuid().nullable(),
|
|
24726
|
+
subjectId: import_zod8.z.string().uuid().nullable(),
|
|
24727
|
+
filters: activityDraftFiltersSchema,
|
|
24728
|
+
createdAt: import_zod8.z.string(),
|
|
24729
|
+
updatedAt: import_zod8.z.string()
|
|
24730
|
+
});
|
|
24731
|
+
var activityModelsApiResponseSchema = import_zod8.z.object({
|
|
24732
|
+
message: import_zod8.z.string(),
|
|
24733
|
+
data: import_zod8.z.object({
|
|
24734
|
+
activityDrafts: import_zod8.z.array(activityModelResponseSchema),
|
|
24735
|
+
total: import_zod8.z.number()
|
|
24736
|
+
})
|
|
24737
|
+
});
|
|
24738
|
+
var DEFAULT_MODELS_PAGINATION = {
|
|
24739
|
+
total: 0,
|
|
24740
|
+
page: 1,
|
|
24741
|
+
limit: 10,
|
|
24742
|
+
totalPages: 0
|
|
24743
|
+
};
|
|
24744
|
+
var transformModelToTableItem = (model, subjectsMap) => {
|
|
24745
|
+
const subjectName = model.subjectId ? subjectsMap?.get(model.subjectId) || "" : "";
|
|
24746
|
+
return {
|
|
24747
|
+
id: model.id,
|
|
24748
|
+
title: model.title || "Sem t\xEDtulo",
|
|
24749
|
+
savedAt: (0, import_dayjs5.default)(model.createdAt).format("DD/MM/YYYY"),
|
|
24750
|
+
subject: subjectName,
|
|
24751
|
+
subjectId: model.subjectId
|
|
24752
|
+
};
|
|
24753
|
+
};
|
|
24754
|
+
var handleModelFetchError = createFetchErrorHandler(
|
|
24755
|
+
"Erro ao validar dados de modelos de atividades",
|
|
24756
|
+
"Erro ao carregar modelos de atividades"
|
|
24757
|
+
);
|
|
24758
|
+
var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
24759
|
+
return () => {
|
|
24760
|
+
const [state, setState] = (0, import_react83.useState)({
|
|
24761
|
+
models: [],
|
|
24762
|
+
loading: false,
|
|
24763
|
+
error: null,
|
|
24764
|
+
pagination: DEFAULT_MODELS_PAGINATION
|
|
24765
|
+
});
|
|
24766
|
+
const fetchModels = (0, import_react83.useCallback)(
|
|
24767
|
+
async (filters, subjectsMap) => {
|
|
24768
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
24769
|
+
try {
|
|
24770
|
+
const responseData = await fetchActivityModels(filters);
|
|
24771
|
+
const validatedData = activityModelsApiResponseSchema.parse(responseData);
|
|
24772
|
+
const tableItems = validatedData.data.activityDrafts.map(
|
|
24773
|
+
(model) => transformModelToTableItem(model, subjectsMap)
|
|
24774
|
+
);
|
|
24775
|
+
const limit = filters?.limit || 10;
|
|
24776
|
+
const page = filters?.page || 1;
|
|
24777
|
+
const total = validatedData.data.total;
|
|
24778
|
+
const totalPages = Math.ceil(total / limit);
|
|
24779
|
+
setState({
|
|
24780
|
+
models: tableItems,
|
|
24781
|
+
loading: false,
|
|
24782
|
+
error: null,
|
|
24783
|
+
pagination: {
|
|
24784
|
+
total,
|
|
24785
|
+
page,
|
|
24786
|
+
limit,
|
|
24787
|
+
totalPages
|
|
24788
|
+
}
|
|
24789
|
+
});
|
|
24790
|
+
} catch (error) {
|
|
24791
|
+
const errorMessage = handleModelFetchError(error);
|
|
24792
|
+
setState((prev) => ({
|
|
24793
|
+
...prev,
|
|
24794
|
+
loading: false,
|
|
24795
|
+
error: errorMessage
|
|
24796
|
+
}));
|
|
24797
|
+
}
|
|
24798
|
+
},
|
|
24799
|
+
[fetchActivityModels]
|
|
24800
|
+
);
|
|
24801
|
+
const deleteModel = (0, import_react83.useCallback)(
|
|
24802
|
+
async (id) => {
|
|
24803
|
+
try {
|
|
24804
|
+
await deleteActivityModel(id);
|
|
24805
|
+
return true;
|
|
24806
|
+
} catch (error) {
|
|
24807
|
+
console.error("Erro ao deletar modelo:", error);
|
|
24808
|
+
return false;
|
|
24809
|
+
}
|
|
24810
|
+
},
|
|
24811
|
+
[deleteActivityModel]
|
|
24812
|
+
);
|
|
24813
|
+
return {
|
|
24814
|
+
...state,
|
|
24815
|
+
fetchModels,
|
|
24816
|
+
deleteModel
|
|
24817
|
+
};
|
|
24818
|
+
};
|
|
24819
|
+
};
|
|
24820
|
+
var createActivityModelsHook = createUseActivityModels;
|
|
24821
|
+
|
|
24822
|
+
// src/components/ActivitiesHistory/tabs/ModelsTab.tsx
|
|
24823
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
24824
|
+
var ModelsTab = ({
|
|
24825
|
+
fetchActivityModels,
|
|
24826
|
+
deleteActivityModel,
|
|
24827
|
+
onCreateModel,
|
|
24828
|
+
onSendActivity,
|
|
24829
|
+
onEditModel,
|
|
24830
|
+
emptyStateImage,
|
|
24831
|
+
noSearchImage,
|
|
24832
|
+
mapSubjectNameToEnum,
|
|
24833
|
+
userFilterData,
|
|
24834
|
+
subjectsMap
|
|
24835
|
+
}) => {
|
|
24836
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react84.useState)(false);
|
|
24837
|
+
const [modelToDelete, setModelToDelete] = (0, import_react84.useState)(null);
|
|
24838
|
+
const { addToast } = useToast();
|
|
24839
|
+
const fetchActivityModelsRef = (0, import_react84.useRef)(fetchActivityModels);
|
|
24840
|
+
fetchActivityModelsRef.current = fetchActivityModels;
|
|
24841
|
+
const deleteActivityModelRef = (0, import_react84.useRef)(deleteActivityModel);
|
|
24842
|
+
deleteActivityModelRef.current = deleteActivityModel;
|
|
24843
|
+
const subjectsMapRef = (0, import_react84.useRef)(subjectsMap);
|
|
24844
|
+
subjectsMapRef.current = subjectsMap;
|
|
24845
|
+
const useActivityModels = (0, import_react84.useMemo)(
|
|
24846
|
+
() => createUseActivityModels(
|
|
24847
|
+
(filters) => fetchActivityModelsRef.current(filters),
|
|
24848
|
+
(id) => deleteActivityModelRef.current(id)
|
|
24849
|
+
),
|
|
24850
|
+
[]
|
|
24851
|
+
);
|
|
24852
|
+
const {
|
|
24853
|
+
models,
|
|
24854
|
+
loading: modelsLoading,
|
|
24855
|
+
error: modelsError,
|
|
24856
|
+
pagination: modelsPagination,
|
|
24857
|
+
fetchModels,
|
|
24858
|
+
deleteModel
|
|
24859
|
+
} = useActivityModels();
|
|
24860
|
+
const modelsFilterConfigs = (0, import_react84.useMemo)(
|
|
24861
|
+
() => createModelsFiltersConfig(userFilterData),
|
|
24862
|
+
[userFilterData]
|
|
24863
|
+
);
|
|
24864
|
+
const handleDeleteClick = (0, import_react84.useCallback)((model) => {
|
|
24865
|
+
setModelToDelete(model);
|
|
24866
|
+
setDeleteDialogOpen(true);
|
|
24867
|
+
}, []);
|
|
24868
|
+
const modelsTableColumns = (0, import_react84.useMemo)(
|
|
24869
|
+
() => createModelsTableColumns(
|
|
24870
|
+
mapSubjectNameToEnum,
|
|
24871
|
+
onSendActivity,
|
|
24872
|
+
onEditModel,
|
|
24873
|
+
handleDeleteClick
|
|
24874
|
+
),
|
|
24875
|
+
[mapSubjectNameToEnum, onSendActivity, onEditModel, handleDeleteClick]
|
|
24876
|
+
);
|
|
24877
|
+
const handleParamsChange = (0, import_react84.useCallback)(
|
|
24878
|
+
(params) => {
|
|
24879
|
+
const filters = buildModelsFiltersFromParams(params);
|
|
24880
|
+
fetchModels(filters, subjectsMapRef.current);
|
|
24881
|
+
},
|
|
24882
|
+
[fetchModels]
|
|
24883
|
+
);
|
|
24884
|
+
(0, import_react84.useEffect)(() => {
|
|
24885
|
+
fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
|
|
24886
|
+
}, [fetchModels]);
|
|
24887
|
+
const handleConfirmDelete = (0, import_react84.useCallback)(async () => {
|
|
24888
|
+
if (modelToDelete) {
|
|
24889
|
+
const success = await deleteModel(modelToDelete.id);
|
|
24890
|
+
if (success) {
|
|
24891
|
+
addToast({ title: "Modelo deletado com sucesso", action: "success" });
|
|
24892
|
+
fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
|
|
24893
|
+
} else {
|
|
24894
|
+
addToast({ title: "Erro ao deletar modelo", action: "warning" });
|
|
24895
|
+
}
|
|
24896
|
+
}
|
|
24897
|
+
setDeleteDialogOpen(false);
|
|
24898
|
+
setModelToDelete(null);
|
|
24899
|
+
}, [modelToDelete, deleteModel, fetchModels, addToast]);
|
|
24900
|
+
const handleCancelDelete = (0, import_react84.useCallback)(() => {
|
|
24901
|
+
setDeleteDialogOpen(false);
|
|
24902
|
+
setModelToDelete(null);
|
|
24903
|
+
}, []);
|
|
24904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
|
|
24905
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Toaster_default, {}),
|
|
24906
|
+
modelsError ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ErrorDisplay, { error: modelsError }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "w-full", "data-testid": "activity-models-tab", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
24907
|
+
TableProvider,
|
|
24908
|
+
{
|
|
24909
|
+
data: models,
|
|
24910
|
+
headers: modelsTableColumns,
|
|
24911
|
+
loading: modelsLoading,
|
|
24912
|
+
variant: "borderless",
|
|
24913
|
+
enableSearch: true,
|
|
24914
|
+
enableFilters: true,
|
|
24915
|
+
enableTableSort: true,
|
|
24916
|
+
enablePagination: true,
|
|
24917
|
+
initialFilters: modelsFilterConfigs,
|
|
24918
|
+
paginationConfig: {
|
|
24919
|
+
itemLabel: "modelos",
|
|
24920
|
+
itemsPerPageOptions: [10, 20, 50, 100],
|
|
24921
|
+
defaultItemsPerPage: 10,
|
|
24922
|
+
totalItems: modelsPagination.total,
|
|
24923
|
+
totalPages: modelsPagination.totalPages
|
|
24924
|
+
},
|
|
24925
|
+
searchPlaceholder: "Buscar modelo",
|
|
24926
|
+
noSearchResultState: {
|
|
24927
|
+
image: noSearchImage
|
|
24928
|
+
},
|
|
24929
|
+
emptyState: {
|
|
24930
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
24931
|
+
EmptyState_default,
|
|
24932
|
+
{
|
|
24933
|
+
image: emptyStateImage,
|
|
24934
|
+
title: "Crie modelos para agilizar suas atividades",
|
|
24935
|
+
description: "Salve modelos de atividades para reutilizar e enviar rapidamente para suas turmas!",
|
|
24936
|
+
buttonText: "Criar modelo",
|
|
24937
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_phosphor_react48.Plus, { size: 18 }),
|
|
24938
|
+
buttonVariant: "outline",
|
|
24939
|
+
buttonAction: "primary",
|
|
24940
|
+
onButtonClick: onCreateModel
|
|
24941
|
+
}
|
|
24942
|
+
)
|
|
24943
|
+
},
|
|
24944
|
+
onParamsChange: handleParamsChange,
|
|
24945
|
+
children: (renderProps) => {
|
|
24946
|
+
const {
|
|
24947
|
+
controls,
|
|
24948
|
+
table,
|
|
24949
|
+
pagination: paginationComponent
|
|
24950
|
+
} = renderProps;
|
|
24951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "space-y-4", children: [
|
|
24952
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
24953
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
24954
|
+
Button_default,
|
|
24955
|
+
{
|
|
24956
|
+
variant: "solid",
|
|
24957
|
+
action: "primary",
|
|
24958
|
+
size: "medium",
|
|
24959
|
+
onClick: onCreateModel,
|
|
24960
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_phosphor_react48.Plus, { size: 18, weight: "bold" }),
|
|
24961
|
+
children: "Criar modelo"
|
|
24962
|
+
}
|
|
24963
|
+
),
|
|
24964
|
+
controls
|
|
24965
|
+
] }),
|
|
24966
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
24967
|
+
table,
|
|
24968
|
+
paginationComponent
|
|
24969
|
+
] })
|
|
24970
|
+
] });
|
|
24971
|
+
}
|
|
24972
|
+
}
|
|
24973
|
+
) }),
|
|
24974
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
24975
|
+
AlertDialog,
|
|
24976
|
+
{
|
|
24977
|
+
isOpen: deleteDialogOpen,
|
|
24978
|
+
onChangeOpen: setDeleteDialogOpen,
|
|
24979
|
+
title: "Deletar modelo",
|
|
24980
|
+
description: `Tem certeza que deseja deletar o modelo "${modelToDelete?.title}"? Esta a\xE7\xE3o n\xE3o pode ser desfeita.`,
|
|
24981
|
+
submitButtonLabel: "Deletar",
|
|
24982
|
+
cancelButtonLabel: "Cancelar",
|
|
24983
|
+
onSubmit: handleConfirmDelete,
|
|
24984
|
+
onCancel: handleCancelDelete
|
|
24985
|
+
}
|
|
24986
|
+
)
|
|
24987
|
+
] });
|
|
24988
|
+
};
|
|
24989
|
+
|
|
24990
|
+
// src/components/ActivitiesHistory/tabs/DraftsTab.tsx
|
|
24991
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
24992
|
+
var DraftsTab = () => {
|
|
24993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) });
|
|
24994
|
+
};
|
|
24995
|
+
|
|
24996
|
+
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
24997
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
24998
|
+
var PAGE_TITLES = {
|
|
24999
|
+
["history" /* HISTORY */]: "Hist\xF3rico de atividades",
|
|
25000
|
+
["drafts" /* DRAFTS */]: "Rascunhos",
|
|
25001
|
+
["models" /* MODELS */]: "Modelos de atividades"
|
|
25002
|
+
};
|
|
25003
|
+
var ActivitiesHistory = ({
|
|
25004
|
+
fetchActivitiesHistory,
|
|
25005
|
+
fetchActivityModels,
|
|
25006
|
+
deleteActivityModel,
|
|
25007
|
+
onCreateActivity,
|
|
25008
|
+
onCreateModel,
|
|
25009
|
+
onRowClick,
|
|
25010
|
+
onSendActivity,
|
|
25011
|
+
onEditModel,
|
|
25012
|
+
emptyStateImage,
|
|
25013
|
+
noSearchImage,
|
|
25014
|
+
mapSubjectNameToEnum,
|
|
25015
|
+
userFilterData,
|
|
25016
|
+
subjectsMap
|
|
25017
|
+
}) => {
|
|
25018
|
+
const [activeTab, setActiveTab] = (0, import_react85.useState)("history" /* HISTORY */);
|
|
25019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
25020
|
+
"div",
|
|
25021
|
+
{
|
|
25022
|
+
"data-testid": "activities-history",
|
|
25023
|
+
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
25024
|
+
children: [
|
|
25025
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
25026
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "flex flex-col w-full h-full max-w-[1350px] mx-auto z-10 lg:px-0 px-4 pt-4 sm:pt-0", children: [
|
|
25027
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "flex flex-col sm:flex-row w-full mb-6 items-start sm:items-center sm:justify-between gap-0 sm:gap-4", children: [
|
|
25028
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25029
|
+
Text_default,
|
|
25030
|
+
{
|
|
25031
|
+
as: "h1",
|
|
25032
|
+
weight: "bold",
|
|
25033
|
+
className: "leading-[28px] tracking-[0.2px] text-xl lg:text-2xl",
|
|
25034
|
+
children: PAGE_TITLES[activeTab]
|
|
25035
|
+
}
|
|
25036
|
+
),
|
|
25037
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25038
|
+
Menu,
|
|
25039
|
+
{
|
|
25040
|
+
defaultValue: "history" /* HISTORY */,
|
|
25041
|
+
value: activeTab,
|
|
25042
|
+
onValueChange: (value) => setActiveTab(value),
|
|
25043
|
+
variant: "menu2",
|
|
25044
|
+
className: "bg-transparent shadow-none px-0",
|
|
25045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
25046
|
+
MenuContent,
|
|
25047
|
+
{
|
|
25048
|
+
variant: "menu2",
|
|
25049
|
+
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
25050
|
+
children: [
|
|
25051
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25052
|
+
MenuItem,
|
|
25053
|
+
{
|
|
25054
|
+
variant: "menu2",
|
|
25055
|
+
value: "history" /* HISTORY */,
|
|
25056
|
+
"data-testid": "menu-item-history",
|
|
25057
|
+
className: "whitespace-nowrap flex-1 lg:flex-none",
|
|
25058
|
+
children: "Hist\xF3rico"
|
|
25059
|
+
}
|
|
25060
|
+
),
|
|
25061
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25062
|
+
MenuItem,
|
|
25063
|
+
{
|
|
25064
|
+
variant: "menu2",
|
|
25065
|
+
value: "drafts" /* DRAFTS */,
|
|
25066
|
+
"data-testid": "menu-item-drafts",
|
|
25067
|
+
className: "whitespace-nowrap flex-1 lg:flex-none",
|
|
25068
|
+
children: "Rascunhos"
|
|
25069
|
+
}
|
|
25070
|
+
),
|
|
25071
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25072
|
+
MenuItem,
|
|
25073
|
+
{
|
|
25074
|
+
variant: "menu2",
|
|
25075
|
+
value: "models" /* MODELS */,
|
|
25076
|
+
"data-testid": "menu-item-models",
|
|
25077
|
+
className: "whitespace-nowrap flex-1 lg:flex-none",
|
|
25078
|
+
children: "Modelos"
|
|
25079
|
+
}
|
|
25080
|
+
)
|
|
25081
|
+
]
|
|
25082
|
+
}
|
|
25083
|
+
)
|
|
25084
|
+
}
|
|
25085
|
+
) })
|
|
25086
|
+
] }),
|
|
25087
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
25088
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25089
|
+
HistoryTab,
|
|
25090
|
+
{
|
|
25091
|
+
fetchActivitiesHistory,
|
|
25092
|
+
onCreateActivity,
|
|
25093
|
+
onRowClick,
|
|
25094
|
+
emptyStateImage,
|
|
25095
|
+
noSearchImage,
|
|
25096
|
+
mapSubjectNameToEnum,
|
|
25097
|
+
userFilterData
|
|
25098
|
+
}
|
|
25099
|
+
),
|
|
25100
|
+
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(DraftsTab, {}),
|
|
25101
|
+
activeTab === "models" /* MODELS */ && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
25102
|
+
ModelsTab,
|
|
25103
|
+
{
|
|
25104
|
+
fetchActivityModels,
|
|
25105
|
+
deleteActivityModel,
|
|
25106
|
+
onCreateModel,
|
|
25107
|
+
onSendActivity,
|
|
25108
|
+
onEditModel,
|
|
25109
|
+
emptyStateImage,
|
|
25110
|
+
noSearchImage,
|
|
25111
|
+
mapSubjectNameToEnum,
|
|
25112
|
+
userFilterData,
|
|
25113
|
+
subjectsMap
|
|
25114
|
+
}
|
|
25115
|
+
)
|
|
25116
|
+
] })
|
|
25117
|
+
] })
|
|
25118
|
+
]
|
|
25119
|
+
}
|
|
25120
|
+
);
|
|
25121
|
+
};
|
|
23815
25122
|
// Annotate the CommonJS export names for ESM import in node:
|
|
23816
25123
|
0 && (module.exports = {
|
|
23817
25124
|
ACTIVITY_AVAILABILITY,
|
|
25125
|
+
ACTIVITY_FILTER_STATUS_OPTIONS,
|
|
23818
25126
|
ANSWER_STATUS,
|
|
23819
25127
|
AccordionGroup,
|
|
25128
|
+
ActivitiesHistory,
|
|
25129
|
+
ActivityApiStatus,
|
|
25130
|
+
ActivityBadgeActionType,
|
|
23820
25131
|
ActivityCardQuestionBanks,
|
|
23821
25132
|
ActivityCardQuestionPreview,
|
|
23822
25133
|
ActivityDetails,
|
|
25134
|
+
ActivityDisplayStatus,
|
|
25135
|
+
ActivityDraftType,
|
|
23823
25136
|
ActivityFilters,
|
|
23824
25137
|
ActivityFiltersPopover,
|
|
23825
25138
|
ActivityPreview,
|
|
@@ -23853,6 +25166,8 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
23853
25166
|
Chips,
|
|
23854
25167
|
CorrectActivityModal,
|
|
23855
25168
|
CreateActivity,
|
|
25169
|
+
DEFAULT_ACTIVITIES_PAGINATION,
|
|
25170
|
+
DEFAULT_MODELS_PAGINATION,
|
|
23856
25171
|
DIFFICULTY_LEVEL_ENUM,
|
|
23857
25172
|
DateTimeInput,
|
|
23858
25173
|
Divider,
|
|
@@ -23951,6 +25266,7 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
23951
25266
|
StatisticsCard,
|
|
23952
25267
|
Stepper,
|
|
23953
25268
|
StudentLessonStatus,
|
|
25269
|
+
StudentPerformanceModal,
|
|
23954
25270
|
SubjectEnum,
|
|
23955
25271
|
SubjectInfo,
|
|
23956
25272
|
Support,
|
|
@@ -23974,15 +25290,21 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
23974
25290
|
Toaster,
|
|
23975
25291
|
VideoPlayer,
|
|
23976
25292
|
Whiteboard,
|
|
25293
|
+
activitiesHistoryApiResponseSchema,
|
|
25294
|
+
activityModelsApiResponseSchema,
|
|
23977
25295
|
cn,
|
|
23978
25296
|
convertActivityFiltersToQuestionsFilter,
|
|
25297
|
+
createActivitiesHistoryHook,
|
|
23979
25298
|
createActivityFiltersDataHook,
|
|
25299
|
+
createActivityModelsHook,
|
|
23980
25300
|
createNotificationStore,
|
|
23981
25301
|
createNotificationsHook,
|
|
23982
25302
|
createQuestionsListHook,
|
|
23983
25303
|
createRecommendedLessonDetailsHook,
|
|
23984
25304
|
createRecommendedLessonsHistoryHook,
|
|
25305
|
+
createUseActivitiesHistory,
|
|
23985
25306
|
createUseActivityFiltersData,
|
|
25307
|
+
createUseActivityModels,
|
|
23986
25308
|
createUseNotificationStore,
|
|
23987
25309
|
createUseNotifications,
|
|
23988
25310
|
createUseQuestionsList,
|
|
@@ -23998,6 +25320,7 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
23998
25320
|
formatTimeAgo,
|
|
23999
25321
|
formatTimeSpent,
|
|
24000
25322
|
generateFileId,
|
|
25323
|
+
getActivityStatusBadgeAction,
|
|
24001
25324
|
getCategoryIcon,
|
|
24002
25325
|
getCategoryText,
|
|
24003
25326
|
getDeviceType,
|
|
@@ -24018,12 +25341,15 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
24018
25341
|
goalApiResponseSchema,
|
|
24019
25342
|
goalDetailsApiResponseSchema,
|
|
24020
25343
|
goalsHistoryApiResponseSchema,
|
|
25344
|
+
handleActivityFetchError,
|
|
24021
25345
|
handleGoalFetchError,
|
|
24022
25346
|
handleLessonDetailsFetchError,
|
|
25347
|
+
handleModelFetchError,
|
|
24023
25348
|
historyApiResponseSchema,
|
|
24024
25349
|
isDeadlinePassed,
|
|
24025
25350
|
isFormValid,
|
|
24026
25351
|
isStepValid,
|
|
25352
|
+
mapActivityStatusToDisplay,
|
|
24027
25353
|
mapApiStatusToInternal,
|
|
24028
25354
|
mapInternalStatusToApi,
|
|
24029
25355
|
mapQuestionTypeToEnum,
|
|
@@ -24033,7 +25359,9 @@ var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
|
24033
25359
|
syncDropdownState,
|
|
24034
25360
|
toggleArrayItem,
|
|
24035
25361
|
toggleSingleValue,
|
|
25362
|
+
transformActivityToTableItem,
|
|
24036
25363
|
transformGoalToTableItem,
|
|
25364
|
+
transformModelToTableItem,
|
|
24037
25365
|
useAlertFormStore,
|
|
24038
25366
|
useApiConfig,
|
|
24039
25367
|
useAppContent,
|