analytica-frontend-lib 1.2.86 → 1.2.88
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.map +1 -1
- package/dist/ActivitiesHistory/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +1 -1
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +1 -1
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/QuestionsData/index.d.ts +26 -1
- package/dist/QuestionsData/index.d.ts.map +1 -1
- package/dist/QuestionsData/index.js.map +1 -1
- package/dist/QuestionsData/index.mjs.map +1 -1
- package/dist/RecommendedLessonsHistory/index.d.ts +1 -1
- package/dist/RecommendedLessonsHistory/index.d.ts.map +1 -1
- package/dist/RecommendedLessonsHistory/index.js +148 -142
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +147 -141
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/StudentRanking/index.d.ts +33 -9
- package/dist/StudentRanking/index.d.ts.map +1 -1
- package/dist/StudentRanking/index.js.map +1 -1
- package/dist/StudentRanking/index.mjs.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.js.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -1
- package/dist/hooks/useNotifications.d.ts +2 -2
- package/dist/hooks/useNotifications.d.ts.map +1 -1
- package/dist/hooks/useQuestionsData.d.ts +218 -0
- package/dist/hooks/useQuestionsData.d.ts.map +1 -0
- package/dist/hooks/useRecommendedClassDrafts/index.d.ts +57 -0
- package/dist/hooks/useRecommendedClassDrafts/index.d.ts.map +1 -0
- package/dist/hooks/{useGoalDrafts → useRecommendedClassDrafts}/index.js +40 -40
- package/dist/hooks/useRecommendedClassDrafts/index.js.map +1 -0
- package/dist/hooks/{useGoalDrafts → useRecommendedClassDrafts}/index.mjs +33 -33
- package/dist/hooks/useRecommendedClassDrafts/index.mjs.map +1 -0
- package/dist/hooks/useRecommendedClassDrafts.d.ts +57 -0
- package/dist/hooks/useRecommendedClassDrafts.d.ts.map +1 -0
- package/dist/hooks/{useGoalModels.d.ts → useRecommendedClassModels.d.ts} +32 -32
- package/dist/hooks/useRecommendedClassModels.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonDetails.d.ts +44 -44
- package/dist/hooks/useRecommendedLessonDetails.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessons/index.d.ts +35 -35
- package/dist/hooks/useRecommendedLessons/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessons/index.js +41 -41
- package/dist/hooks/useRecommendedLessons/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessons/index.mjs +37 -37
- package/dist/hooks/useRecommendedLessons/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessons.d.ts +35 -35
- package/dist/hooks/useRecommendedLessons.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts +21 -21
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.js +39 -33
- package/dist/hooks/useRecommendedLessonsPage/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.mjs +39 -33
- package/dist/hooks/useRecommendedLessonsPage/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage.d.ts +21 -21
- package/dist/hooks/useRecommendedLessonsPage.d.ts.map +1 -1
- package/dist/hooks/useStudentsHighlight.d.ts +275 -0
- package/dist/hooks/useStudentsHighlight.d.ts.map +1 -0
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +570 -351
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +516 -308
- package/dist/index.mjs.map +1 -1
- package/dist/store/notificationStore.d.ts.map +1 -1
- package/dist/types/activitiesHistory/index.js.map +1 -1
- package/dist/types/activitiesHistory/index.mjs.map +1 -1
- package/dist/types/common.d.ts +2 -2
- package/dist/types/notifications.d.ts +5 -5
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/recommendedLessons/index.d.ts +112 -112
- package/dist/types/recommendedLessons/index.d.ts.map +1 -1
- package/dist/types/recommendedLessons/index.js +25 -25
- package/dist/types/recommendedLessons/index.js.map +1 -1
- package/dist/types/recommendedLessons/index.mjs +17 -17
- package/dist/types/recommendedLessons/index.mjs.map +1 -1
- package/dist/types/recommendedLessons.d.ts +112 -112
- package/dist/types/recommendedLessons.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/hooks/useGoalDrafts/index.d.ts +0 -57
- package/dist/hooks/useGoalDrafts/index.d.ts.map +0 -1
- package/dist/hooks/useGoalDrafts/index.js.map +0 -1
- package/dist/hooks/useGoalDrafts/index.mjs.map +0 -1
- package/dist/hooks/useGoalDrafts.d.ts +0 -57
- package/dist/hooks/useGoalDrafts.d.ts.map +0 -1
- package/dist/hooks/useGoalModels.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -85,9 +85,9 @@ __export(src_exports, {
|
|
|
85
85
|
CorrectActivityModal: () => CorrectActivityModal_default,
|
|
86
86
|
CreateActivity: () => CreateActivity,
|
|
87
87
|
DEFAULT_ACTIVITIES_PAGINATION: () => DEFAULT_ACTIVITIES_PAGINATION,
|
|
88
|
-
DEFAULT_GOAL_DRAFTS_PAGINATION: () => DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
89
|
-
DEFAULT_GOAL_MODELS_PAGINATION: () => DEFAULT_GOAL_MODELS_PAGINATION,
|
|
90
88
|
DEFAULT_MODELS_PAGINATION: () => DEFAULT_MODELS_PAGINATION,
|
|
89
|
+
DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION: () => DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION,
|
|
90
|
+
DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION: () => DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION,
|
|
91
91
|
DIFFICULTY_LEVEL_ENUM: () => DIFFICULTY_LEVEL_ENUM,
|
|
92
92
|
DateTimeInput: () => DateTimeInput_default,
|
|
93
93
|
Divider: () => Divider_default,
|
|
@@ -101,16 +101,7 @@ __export(src_exports, {
|
|
|
101
101
|
EmptyState: () => EmptyState_default,
|
|
102
102
|
FileAttachment: () => FileAttachment_default,
|
|
103
103
|
FilterModal: () => FilterModal,
|
|
104
|
-
GOAL_ACTIVITY_STATUS: () => GOAL_ACTIVITY_STATUS,
|
|
105
|
-
GOAL_FILTER_STATUS_OPTIONS: () => GOAL_FILTER_STATUS_OPTIONS,
|
|
106
|
-
GOAL_STATUS_OPTIONS: () => GOAL_STATUS_OPTIONS,
|
|
107
104
|
GeneralActivityStatus: () => ActivityStatus2,
|
|
108
|
-
GoalApiStatus: () => GenericApiStatus,
|
|
109
|
-
GoalBadgeActionType: () => BadgeActionType,
|
|
110
|
-
GoalDisplayStatus: () => GenericDisplayStatus,
|
|
111
|
-
GoalDraftType: () => GoalDraftType,
|
|
112
|
-
GoalDraftsTab: () => GoalDraftsTab,
|
|
113
|
-
GoalPageTab: () => GoalPageTab,
|
|
114
105
|
IconButton: () => IconButton_default,
|
|
115
106
|
IconRender: () => IconRender_default,
|
|
116
107
|
IconRoundedButton: () => IconRoundedButton_default,
|
|
@@ -170,10 +161,19 @@ __export(src_exports, {
|
|
|
170
161
|
QuizResultTitle: () => QuizResultTitle,
|
|
171
162
|
QuizTitle: () => QuizTitle,
|
|
172
163
|
QuizTrueOrFalse: () => QuizTrueOrFalse,
|
|
164
|
+
RECOMMENDED_CLASS_ACTIVITY_STATUS: () => RECOMMENDED_CLASS_ACTIVITY_STATUS,
|
|
165
|
+
RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS: () => RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS,
|
|
166
|
+
RECOMMENDED_CLASS_STATUS_OPTIONS: () => RECOMMENDED_CLASS_STATUS_OPTIONS,
|
|
173
167
|
Radio: () => Radio_default,
|
|
174
168
|
RadioGroup: () => RadioGroup,
|
|
175
169
|
RadioGroupItem: () => RadioGroupItem,
|
|
176
170
|
RankingCard: () => RankingCard,
|
|
171
|
+
RecommendedClassApiStatus: () => GenericApiStatus,
|
|
172
|
+
RecommendedClassBadgeActionType: () => BadgeActionType,
|
|
173
|
+
RecommendedClassDisplayStatus: () => GenericDisplayStatus,
|
|
174
|
+
RecommendedClassDraftType: () => RecommendedClassDraftType,
|
|
175
|
+
RecommendedClassDraftsTab: () => RecommendedClassDraftsTab,
|
|
176
|
+
RecommendedClassPageTab: () => RecommendedClassPageTab,
|
|
177
177
|
RecommendedLessonDetails: () => RecommendedLessonDetails_default,
|
|
178
178
|
RecommendedLessonsHistory: () => RecommendedLessonsHistory,
|
|
179
179
|
STUDENT_ACTIVITY_STATUS: () => STUDENT_ACTIVITY_STATUS,
|
|
@@ -227,36 +227,41 @@ __export(src_exports, {
|
|
|
227
227
|
activitiesHistoryApiResponseSchema: () => activitiesHistoryApiResponseSchema,
|
|
228
228
|
activityModelsApiResponseSchema: () => activityModelsApiResponseSchema,
|
|
229
229
|
buildUserFilterData: () => buildUserFilterData,
|
|
230
|
+
calculatePerformancePercentage: () => calculatePerformancePercentage,
|
|
230
231
|
checkLessonAvailability: () => checkLessonAvailability,
|
|
231
232
|
cn: () => cn,
|
|
232
233
|
convertActivityFiltersToQuestionsFilter: () => convertActivityFiltersToQuestionsFilter,
|
|
233
234
|
createActivitiesHistoryHook: () => createActivitiesHistoryHook,
|
|
234
235
|
createActivityFiltersDataHook: () => createActivityFiltersDataHook,
|
|
235
236
|
createActivityModelsHook: () => createActivityModelsHook,
|
|
236
|
-
createGoalDraftsHook: () => createGoalDraftsHook,
|
|
237
|
-
createGoalModelsHook: () => createGoalModelsHook,
|
|
238
237
|
createNotificationStore: () => createNotificationStore,
|
|
239
238
|
createNotificationsHook: () => createNotificationsHook,
|
|
239
|
+
createQuestionsDataHook: () => createQuestionsDataHook,
|
|
240
240
|
createQuestionsListHook: () => createQuestionsListHook,
|
|
241
|
+
createRecommendedClassDraftsHook: () => createRecommendedClassDraftsHook,
|
|
242
|
+
createRecommendedClassModelsHook: () => createRecommendedClassModelsHook,
|
|
241
243
|
createRecommendedLessonDetailsHook: () => createRecommendedLessonDetailsHook,
|
|
242
244
|
createRecommendedLessonsHistoryHook: () => createRecommendedLessonsHistoryHook,
|
|
243
245
|
createRecommendedLessonsPageHook: () => createRecommendedLessonsPageHook,
|
|
246
|
+
createStudentsHighlightHook: () => createStudentsHighlightHook,
|
|
244
247
|
createUseActivitiesHistory: () => createUseActivitiesHistory,
|
|
245
248
|
createUseActivityFiltersData: () => createUseActivityFiltersData,
|
|
246
249
|
createUseActivityModels: () => createUseActivityModels,
|
|
247
250
|
createUseChat: () => createUseChat,
|
|
248
251
|
createUseChatRooms: () => createUseChatRooms,
|
|
249
|
-
createUseGoalDrafts: () => createUseGoalDrafts,
|
|
250
|
-
createUseGoalModels: () => createUseGoalModels,
|
|
251
252
|
createUseNotificationStore: () => createUseNotificationStore,
|
|
252
253
|
createUseNotifications: () => createUseNotifications,
|
|
254
|
+
createUseQuestionsData: () => createUseQuestionsData,
|
|
253
255
|
createUseQuestionsList: () => createUseQuestionsList,
|
|
256
|
+
createUseRecommendedClassDrafts: () => createUseRecommendedClassDrafts,
|
|
257
|
+
createUseRecommendedClassModels: () => createUseRecommendedClassModels,
|
|
254
258
|
createUseRecommendedLessonDetails: () => createUseRecommendedLessonDetails,
|
|
255
259
|
createUseRecommendedLessonsHistory: () => createUseRecommendedLessonsHistory,
|
|
256
260
|
createUseRecommendedLessonsPage: () => createUseRecommendedLessonsPage,
|
|
261
|
+
createUseStudentsHighlight: () => createUseStudentsHighlight,
|
|
257
262
|
createZustandAuthAdapter: () => createZustandAuthAdapter,
|
|
258
263
|
deriveStudentStatus: () => deriveStudentStatus,
|
|
259
|
-
|
|
264
|
+
determineRecommendedClassStatus: () => determineRecommendedClassStatus,
|
|
260
265
|
formatDateToBrazilian: () => formatDateToBrazilian,
|
|
261
266
|
formatDaysToComplete: () => formatDaysToComplete,
|
|
262
267
|
formatFileSize: () => formatFileSize,
|
|
@@ -271,8 +276,8 @@ __export(src_exports, {
|
|
|
271
276
|
getChatWsUrl: () => getChatWsUrl,
|
|
272
277
|
getClassOptionsFromUserData: () => getClassOptionsFromUserData,
|
|
273
278
|
getDeviceType: () => getDeviceType,
|
|
274
|
-
getGoalStatusBadgeAction: () => getGoalStatusBadgeAction,
|
|
275
279
|
getQuestionStatusBadgeConfig: () => getQuestionStatusBadgeConfig,
|
|
280
|
+
getRecommendedClassStatusBadgeAction: () => getRecommendedClassStatusBadgeAction,
|
|
276
281
|
getRootDomain: () => getRootDomain,
|
|
277
282
|
getSchoolOptionsFromUserData: () => getSchoolOptionsFromUserData,
|
|
278
283
|
getSchoolYearOptionsFromUserData: () => getSchoolYearOptionsFromUserData,
|
|
@@ -288,16 +293,14 @@ __export(src_exports, {
|
|
|
288
293
|
getSubjectInfo: () => getSubjectInfo,
|
|
289
294
|
getSubjectName: () => getSubjectName,
|
|
290
295
|
getSubjectOptionsFromUserData: () => getSubjectOptionsFromUserData,
|
|
291
|
-
goalApiResponseSchema: () => goalApiResponseSchema,
|
|
292
|
-
goalDetailsApiResponseSchema: () => goalDetailsApiResponseSchema,
|
|
293
|
-
goalModelsApiResponseSchema: () => goalModelsApiResponseSchema,
|
|
294
|
-
goalsHistoryApiResponseSchema: () => goalsHistoryApiResponseSchema,
|
|
295
296
|
handleActivityFetchError: () => handleActivityFetchError,
|
|
296
|
-
handleGoalDraftFetchError: () => handleGoalDraftFetchError,
|
|
297
|
-
handleGoalFetchError: () => handleGoalFetchError,
|
|
298
|
-
handleGoalModelFetchError: () => handleGoalModelFetchError,
|
|
299
297
|
handleLessonDetailsFetchError: () => handleLessonDetailsFetchError,
|
|
300
298
|
handleModelFetchError: () => handleModelFetchError,
|
|
299
|
+
handleQuestionsDataFetchError: () => handleQuestionsDataFetchError,
|
|
300
|
+
handleRecommendedClassDraftFetchError: () => handleRecommendedClassDraftFetchError,
|
|
301
|
+
handleRecommendedClassFetchError: () => handleRecommendedClassFetchError,
|
|
302
|
+
handleRecommendedClassModelFetchError: () => handleRecommendedClassModelFetchError,
|
|
303
|
+
handleStudentsHighlightFetchError: () => handleStudentsHighlightFetchError,
|
|
301
304
|
historyApiResponseSchema: () => historyApiResponseSchema,
|
|
302
305
|
isChatUserInfoValid: () => isChatUserInfoValid,
|
|
303
306
|
isDeadlinePassed: () => isDeadlinePassed,
|
|
@@ -313,16 +316,24 @@ __export(src_exports, {
|
|
|
313
316
|
mapSubjectEnumToName: () => mapSubjectEnumToName,
|
|
314
317
|
mapSubjectNameToEnum: () => mapSubjectNameToEnum,
|
|
315
318
|
questionTypeLabels: () => questionTypeLabels,
|
|
319
|
+
questionsDataApiResponseSchema: () => questionsDataApiResponseSchema,
|
|
320
|
+
recommendedClassApiResponseSchema: () => recommendedClassApiResponseSchema,
|
|
321
|
+
recommendedClassDetailsApiResponseSchema: () => recommendedClassDetailsApiResponseSchema,
|
|
322
|
+
recommendedClassHistoryApiResponseSchema: () => recommendedClassHistoryApiResponseSchema,
|
|
323
|
+
recommendedClassModelsApiResponseSchema: () => recommendedClassModelsApiResponseSchema,
|
|
316
324
|
renderSubjectCell: () => renderSubjectCell,
|
|
317
325
|
studentActivityStatusSchema: () => studentActivityStatusSchema,
|
|
326
|
+
studentsHighlightApiResponseSchema: () => studentsHighlightApiResponseSchema,
|
|
318
327
|
supportSchema: () => supportSchema,
|
|
319
328
|
syncDropdownState: () => syncDropdownState,
|
|
320
329
|
toggleArrayItem: () => toggleArrayItem,
|
|
321
330
|
toggleSingleValue: () => toggleSingleValue,
|
|
322
331
|
transformActivityToTableItem: () => transformActivityToTableItem,
|
|
323
|
-
transformGoalModelToTableItem: () => transformGoalModelToTableItem,
|
|
324
|
-
transformGoalToTableItem: () => transformGoalToTableItem,
|
|
325
332
|
transformModelToTableItem: () => transformModelToTableItem,
|
|
333
|
+
transformQuestionsData: () => transformQuestionsData,
|
|
334
|
+
transformRecommendedClassModelToTableItem: () => transformRecommendedClassModelToTableItem,
|
|
335
|
+
transformRecommendedClassToTableItem: () => transformRecommendedClassToTableItem,
|
|
336
|
+
transformStudentHighlightItem: () => transformStudentHighlightItem,
|
|
326
337
|
useActivityDetails: () => useActivityDetails,
|
|
327
338
|
useAlertFormStore: () => useAlertFormStore,
|
|
328
339
|
useApiConfig: () => useApiConfig,
|
|
@@ -4393,12 +4404,12 @@ function useTableSort(data, options = {}) {
|
|
|
4393
4404
|
}
|
|
4394
4405
|
return { column: null, direction: null };
|
|
4395
4406
|
};
|
|
4396
|
-
const
|
|
4407
|
+
const initialState6 = getInitialState();
|
|
4397
4408
|
const [sortColumn, setSortColumn] = (0, import_react15.useState)(
|
|
4398
|
-
|
|
4409
|
+
initialState6.column
|
|
4399
4410
|
);
|
|
4400
4411
|
const [sortDirection, setSortDirection] = (0, import_react15.useState)(
|
|
4401
|
-
|
|
4412
|
+
initialState6.direction
|
|
4402
4413
|
);
|
|
4403
4414
|
(0, import_react15.useEffect)(() => {
|
|
4404
4415
|
if (!syncWithUrl || globalThis.window === void 0) return;
|
|
@@ -12974,7 +12985,7 @@ var import_middleware3 = require("zustand/middleware");
|
|
|
12974
12985
|
var NotificationEntityType = /* @__PURE__ */ ((NotificationEntityType2) => {
|
|
12975
12986
|
NotificationEntityType2["ACTIVITY"] = "ACTIVITY";
|
|
12976
12987
|
NotificationEntityType2["TRAIL"] = "TRAIL";
|
|
12977
|
-
NotificationEntityType2["
|
|
12988
|
+
NotificationEntityType2["RECOMMENDEDCLASS"] = "RECOMMENDEDCLASS";
|
|
12978
12989
|
return NotificationEntityType2;
|
|
12979
12990
|
})(NotificationEntityType || {});
|
|
12980
12991
|
|
|
@@ -12983,8 +12994,7 @@ var mapBackendNotification = (backendNotification) => {
|
|
|
12983
12994
|
let type = "GENERAL";
|
|
12984
12995
|
let entityType = null;
|
|
12985
12996
|
if (backendNotification.entityType) {
|
|
12986
|
-
|
|
12987
|
-
switch (backendEntityType) {
|
|
12997
|
+
switch (backendNotification.entityType.toUpperCase()) {
|
|
12988
12998
|
case "ACTIVITY" /* ACTIVITY */:
|
|
12989
12999
|
type = "ACTIVITY";
|
|
12990
13000
|
entityType = "ACTIVITY" /* ACTIVITY */;
|
|
@@ -12993,9 +13003,9 @@ var mapBackendNotification = (backendNotification) => {
|
|
|
12993
13003
|
type = "TRAIL";
|
|
12994
13004
|
entityType = "TRAIL" /* TRAIL */;
|
|
12995
13005
|
break;
|
|
12996
|
-
case "
|
|
12997
|
-
type = "
|
|
12998
|
-
entityType = "
|
|
13006
|
+
case "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */:
|
|
13007
|
+
type = "RECOMMENDEDCLASS";
|
|
13008
|
+
entityType = "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */;
|
|
12999
13009
|
break;
|
|
13000
13010
|
default:
|
|
13001
13011
|
break;
|
|
@@ -13012,7 +13022,7 @@ var mapBackendNotification = (backendNotification) => {
|
|
|
13012
13022
|
entityId: backendNotification.entityId,
|
|
13013
13023
|
sender: backendNotification.sender,
|
|
13014
13024
|
activity: backendNotification.activity,
|
|
13015
|
-
|
|
13025
|
+
recommendedClass: backendNotification.recommendedClass,
|
|
13016
13026
|
actionLink: backendNotification.actionLink ?? null
|
|
13017
13027
|
};
|
|
13018
13028
|
};
|
|
@@ -13388,7 +13398,7 @@ var NotificationList = ({
|
|
|
13388
13398
|
groupedNotifications.map((group, idx) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col", children: [
|
|
13389
13399
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex items-end px-4 py-6 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h4", { className: "text-lg font-bold text-text-500 flex-grow", children: group.label }) }),
|
|
13390
13400
|
group.notifications.map((notification) => {
|
|
13391
|
-
const isGlobalNotification = !notification.entityType && !notification.entityId && !notification.activity && !notification.
|
|
13401
|
+
const isGlobalNotification = !notification.entityType && !notification.entityId && !notification.activity && !notification.recommendedClass;
|
|
13392
13402
|
let navigationHandler;
|
|
13393
13403
|
if (isGlobalNotification) {
|
|
13394
13404
|
navigationHandler = () => handleGlobalNotificationClick(notification);
|
|
@@ -13926,7 +13936,8 @@ var createUseNotifications = (apiClient) => {
|
|
|
13926
13936
|
case "ACTIVITY" /* ACTIVITY */:
|
|
13927
13937
|
window.location.href = `/atividades/${entityId}`;
|
|
13928
13938
|
break;
|
|
13929
|
-
case "
|
|
13939
|
+
case "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */:
|
|
13940
|
+
case "RECOMMENDEDCLASS":
|
|
13930
13941
|
window.location.href = `/painel/trilhas/${entityId}`;
|
|
13931
13942
|
break;
|
|
13932
13943
|
default:
|
|
@@ -13943,7 +13954,8 @@ var createUseNotifications = (apiClient) => {
|
|
|
13943
13954
|
switch (entityType.toUpperCase()) {
|
|
13944
13955
|
case "ACTIVITY" /* ACTIVITY */:
|
|
13945
13956
|
return "Ver atividade";
|
|
13946
|
-
case "
|
|
13957
|
+
case "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */:
|
|
13958
|
+
case "RECOMMENDEDCLASS":
|
|
13947
13959
|
return "Ver meta";
|
|
13948
13960
|
default:
|
|
13949
13961
|
return void 0;
|
|
@@ -26281,12 +26293,12 @@ var import_react83 = require("react");
|
|
|
26281
26293
|
var import_phosphor_react52 = require("phosphor-react");
|
|
26282
26294
|
|
|
26283
26295
|
// src/types/recommendedLessons.ts
|
|
26284
|
-
var
|
|
26285
|
-
var
|
|
26296
|
+
var getRecommendedClassStatusBadgeAction = (status) => getStatusBadgeAction(status);
|
|
26297
|
+
var RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS = [
|
|
26286
26298
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
26287
26299
|
{ id: "A_VENCER" /* A_VENCER */, name: "Ativa" }
|
|
26288
26300
|
];
|
|
26289
|
-
var
|
|
26301
|
+
var RECOMMENDED_CLASS_STATUS_OPTIONS = [
|
|
26290
26302
|
{ id: "A_VENCER" /* A_VENCER */, name: "A Vencer" },
|
|
26291
26303
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
26292
26304
|
{ id: "CONCLUIDA" /* CONCLUIDA */, name: "Conclu\xEDda" }
|
|
@@ -26326,35 +26338,35 @@ var formatDaysToComplete = (daysToComplete) => {
|
|
|
26326
26338
|
if (daysToComplete === 1) return "1 dia";
|
|
26327
26339
|
return `${daysToComplete} dias`;
|
|
26328
26340
|
};
|
|
26329
|
-
var
|
|
26341
|
+
var RECOMMENDED_CLASS_ACTIVITY_STATUS = {
|
|
26330
26342
|
PENDENTE: "PENDENTE",
|
|
26331
26343
|
CONCLUIDA: "CONCLUIDA",
|
|
26332
26344
|
EXPIRADA: "EXPIRADA"
|
|
26333
26345
|
};
|
|
26334
|
-
var
|
|
26335
|
-
|
|
26336
|
-
|
|
26337
|
-
return
|
|
26338
|
-
})(
|
|
26346
|
+
var RecommendedClassDraftType = /* @__PURE__ */ ((RecommendedClassDraftType2) => {
|
|
26347
|
+
RecommendedClassDraftType2["MODELO"] = "MODELO";
|
|
26348
|
+
RecommendedClassDraftType2["RASCUNHO"] = "RASCUNHO";
|
|
26349
|
+
return RecommendedClassDraftType2;
|
|
26350
|
+
})(RecommendedClassDraftType || {});
|
|
26339
26351
|
|
|
26340
26352
|
// src/hooks/useRecommendedLessons.ts
|
|
26341
26353
|
var import_react79 = require("react");
|
|
26342
26354
|
var import_zod5 = require("zod");
|
|
26343
26355
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
26344
|
-
var
|
|
26356
|
+
var recommendedClassSubjectSchema = import_zod5.z.object({
|
|
26345
26357
|
id: import_zod5.z.string().uuid(),
|
|
26346
26358
|
name: import_zod5.z.string()
|
|
26347
26359
|
}).nullable();
|
|
26348
|
-
var
|
|
26360
|
+
var recommendedClassCreatorSchema = import_zod5.z.object({
|
|
26349
26361
|
id: import_zod5.z.string().uuid(),
|
|
26350
26362
|
name: import_zod5.z.string()
|
|
26351
26363
|
}).nullable();
|
|
26352
|
-
var
|
|
26364
|
+
var recommendedClassStatsSchema = import_zod5.z.object({
|
|
26353
26365
|
totalStudents: import_zod5.z.number(),
|
|
26354
26366
|
completedCount: import_zod5.z.number(),
|
|
26355
26367
|
completionPercentage: import_zod5.z.number()
|
|
26356
26368
|
});
|
|
26357
|
-
var
|
|
26369
|
+
var recommendedClassBreakdownSchema = import_zod5.z.object({
|
|
26358
26370
|
classId: import_zod5.z.string().uuid(),
|
|
26359
26371
|
className: import_zod5.z.string(),
|
|
26360
26372
|
schoolId: import_zod5.z.string(),
|
|
@@ -26362,7 +26374,7 @@ var goalBreakdownSchema = import_zod5.z.object({
|
|
|
26362
26374
|
studentCount: import_zod5.z.number(),
|
|
26363
26375
|
completedCount: import_zod5.z.number()
|
|
26364
26376
|
});
|
|
26365
|
-
var
|
|
26377
|
+
var recommendedClassDataSchema = import_zod5.z.object({
|
|
26366
26378
|
id: import_zod5.z.string().uuid(),
|
|
26367
26379
|
title: import_zod5.z.string(),
|
|
26368
26380
|
startDate: import_zod5.z.string().nullable(),
|
|
@@ -26371,21 +26383,21 @@ var goalDataSchema = import_zod5.z.object({
|
|
|
26371
26383
|
progress: import_zod5.z.number(),
|
|
26372
26384
|
totalLessons: import_zod5.z.number()
|
|
26373
26385
|
});
|
|
26374
|
-
var
|
|
26375
|
-
|
|
26376
|
-
subject:
|
|
26377
|
-
creator:
|
|
26378
|
-
stats:
|
|
26379
|
-
breakdown: import_zod5.z.array(
|
|
26386
|
+
var recommendedClassHistoryItemSchema = import_zod5.z.object({
|
|
26387
|
+
recommendedClass: recommendedClassDataSchema,
|
|
26388
|
+
subject: recommendedClassSubjectSchema,
|
|
26389
|
+
creator: recommendedClassCreatorSchema,
|
|
26390
|
+
stats: recommendedClassStatsSchema,
|
|
26391
|
+
breakdown: import_zod5.z.array(recommendedClassBreakdownSchema)
|
|
26380
26392
|
});
|
|
26381
|
-
var
|
|
26393
|
+
var recommendedClassHistoryApiResponseSchema = import_zod5.z.object({
|
|
26382
26394
|
message: import_zod5.z.string(),
|
|
26383
26395
|
data: import_zod5.z.object({
|
|
26384
|
-
|
|
26396
|
+
recommendedClass: import_zod5.z.array(recommendedClassHistoryItemSchema),
|
|
26385
26397
|
total: import_zod5.z.number()
|
|
26386
26398
|
})
|
|
26387
26399
|
});
|
|
26388
|
-
var
|
|
26400
|
+
var determineRecommendedClassStatus = (finalDate, completionPercentage) => {
|
|
26389
26401
|
if (completionPercentage === 100) {
|
|
26390
26402
|
return "CONCLU\xCDDA" /* CONCLUIDA */;
|
|
26391
26403
|
}
|
|
@@ -26398,29 +26410,29 @@ var determineGoalStatus = (finalDate, completionPercentage) => {
|
|
|
26398
26410
|
}
|
|
26399
26411
|
return "ATIVA" /* ATIVA */;
|
|
26400
26412
|
};
|
|
26401
|
-
var
|
|
26413
|
+
var transformRecommendedClassToTableItem = (item) => {
|
|
26402
26414
|
const firstBreakdown = item.breakdown[0];
|
|
26403
26415
|
const schoolName = firstBreakdown?.schoolName || "-";
|
|
26404
26416
|
const className = firstBreakdown?.className || "-";
|
|
26405
26417
|
const classDisplay = item.breakdown.length > 1 ? `${item.breakdown.length} turmas` : className;
|
|
26406
26418
|
return {
|
|
26407
|
-
id: item.
|
|
26408
|
-
startDate: item.
|
|
26409
|
-
deadline: item.
|
|
26410
|
-
title: item.
|
|
26419
|
+
id: item.recommendedClass.id,
|
|
26420
|
+
startDate: item.recommendedClass.startDate ? (0, import_dayjs4.default)(item.recommendedClass.startDate).format("DD/MM") : "-",
|
|
26421
|
+
deadline: item.recommendedClass.finalDate ? (0, import_dayjs4.default)(item.recommendedClass.finalDate).format("DD/MM") : "-",
|
|
26422
|
+
title: item.recommendedClass.title,
|
|
26411
26423
|
school: schoolName,
|
|
26412
26424
|
year: "-",
|
|
26413
26425
|
// API doesn't provide year directly
|
|
26414
26426
|
subject: item.subject?.name || "-",
|
|
26415
26427
|
class: classDisplay,
|
|
26416
|
-
status:
|
|
26417
|
-
item.
|
|
26428
|
+
status: determineRecommendedClassStatus(
|
|
26429
|
+
item.recommendedClass.finalDate,
|
|
26418
26430
|
item.stats.completionPercentage
|
|
26419
26431
|
),
|
|
26420
26432
|
completionPercentage: item.stats.completionPercentage
|
|
26421
26433
|
};
|
|
26422
26434
|
};
|
|
26423
|
-
var
|
|
26435
|
+
var handleRecommendedClassFetchError = (error) => {
|
|
26424
26436
|
if (error instanceof import_zod5.z.ZodError) {
|
|
26425
26437
|
console.error("Erro ao validar dados de hist\xF3rico de aulas:", error);
|
|
26426
26438
|
return "Erro ao validar dados de hist\xF3rico de aulas";
|
|
@@ -26428,10 +26440,10 @@ var handleGoalFetchError = (error) => {
|
|
|
26428
26440
|
console.error("Erro ao carregar hist\xF3rico de aulas:", error);
|
|
26429
26441
|
return "Erro ao carregar hist\xF3rico de aulas";
|
|
26430
26442
|
};
|
|
26431
|
-
var createUseRecommendedLessonsHistory = (
|
|
26443
|
+
var createUseRecommendedLessonsHistory = (fetchRecommendedClassHistory) => {
|
|
26432
26444
|
return () => {
|
|
26433
26445
|
const [state, setState] = (0, import_react79.useState)({
|
|
26434
|
-
|
|
26446
|
+
recommendedClass: [],
|
|
26435
26447
|
loading: false,
|
|
26436
26448
|
error: null,
|
|
26437
26449
|
pagination: {
|
|
@@ -26441,21 +26453,21 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
26441
26453
|
totalPages: 0
|
|
26442
26454
|
}
|
|
26443
26455
|
});
|
|
26444
|
-
const
|
|
26456
|
+
const fetchRecommendedClass = (0, import_react79.useCallback)(
|
|
26445
26457
|
async (filters) => {
|
|
26446
26458
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26447
26459
|
try {
|
|
26448
|
-
const responseData = await
|
|
26449
|
-
const validatedData =
|
|
26450
|
-
const tableItems = validatedData.data.
|
|
26451
|
-
|
|
26460
|
+
const responseData = await fetchRecommendedClassHistory(filters);
|
|
26461
|
+
const validatedData = recommendedClassHistoryApiResponseSchema.parse(responseData);
|
|
26462
|
+
const tableItems = validatedData.data.recommendedClass.map(
|
|
26463
|
+
transformRecommendedClassToTableItem
|
|
26452
26464
|
);
|
|
26453
26465
|
const page = filters?.page || 1;
|
|
26454
26466
|
const limit = filters?.limit || 10;
|
|
26455
26467
|
const total = validatedData.data.total;
|
|
26456
26468
|
const totalPages = Math.ceil(total / limit);
|
|
26457
26469
|
setState({
|
|
26458
|
-
|
|
26470
|
+
recommendedClass: tableItems,
|
|
26459
26471
|
loading: false,
|
|
26460
26472
|
error: null,
|
|
26461
26473
|
pagination: {
|
|
@@ -26466,7 +26478,7 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
26466
26478
|
}
|
|
26467
26479
|
});
|
|
26468
26480
|
} catch (error) {
|
|
26469
|
-
const errorMessage =
|
|
26481
|
+
const errorMessage = handleRecommendedClassFetchError(error);
|
|
26470
26482
|
setState((prev) => ({
|
|
26471
26483
|
...prev,
|
|
26472
26484
|
loading: false,
|
|
@@ -26474,11 +26486,11 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
26474
26486
|
}));
|
|
26475
26487
|
}
|
|
26476
26488
|
},
|
|
26477
|
-
[
|
|
26489
|
+
[fetchRecommendedClassHistory]
|
|
26478
26490
|
);
|
|
26479
26491
|
return {
|
|
26480
26492
|
...state,
|
|
26481
|
-
|
|
26493
|
+
fetchRecommendedClass
|
|
26482
26494
|
};
|
|
26483
26495
|
};
|
|
26484
26496
|
};
|
|
@@ -26679,7 +26691,7 @@ var getSubjectOptions = (data) => {
|
|
|
26679
26691
|
name: subject.name
|
|
26680
26692
|
}));
|
|
26681
26693
|
};
|
|
26682
|
-
var
|
|
26694
|
+
var createRecommendedClassModelsFiltersConfig = (userData) => [
|
|
26683
26695
|
{
|
|
26684
26696
|
key: "content",
|
|
26685
26697
|
label: "CONTE\xDADO",
|
|
@@ -26695,7 +26707,7 @@ var createGoalModelsFiltersConfig = (userData) => [
|
|
|
26695
26707
|
];
|
|
26696
26708
|
|
|
26697
26709
|
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
26698
|
-
var
|
|
26710
|
+
var buildRecommendedClassModelsFiltersFromParams = (params) => {
|
|
26699
26711
|
const filters = {
|
|
26700
26712
|
page: params.page,
|
|
26701
26713
|
limit: params.limit
|
|
@@ -26709,7 +26721,7 @@ var buildGoalModelsFiltersFromParams = (params) => {
|
|
|
26709
26721
|
return filters;
|
|
26710
26722
|
};
|
|
26711
26723
|
|
|
26712
|
-
// src/hooks/
|
|
26724
|
+
// src/hooks/useRecommendedClassModels.ts
|
|
26713
26725
|
var import_react81 = require("react");
|
|
26714
26726
|
var import_zod7 = require("zod");
|
|
26715
26727
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
@@ -26725,10 +26737,10 @@ var createFetchErrorHandler = (validationErrorMessage, genericErrorMessage) => (
|
|
|
26725
26737
|
return genericErrorMessage;
|
|
26726
26738
|
};
|
|
26727
26739
|
|
|
26728
|
-
// src/hooks/
|
|
26729
|
-
var
|
|
26740
|
+
// src/hooks/useRecommendedClassModels.ts
|
|
26741
|
+
var recommendedClassModelResponseSchema = import_zod7.z.object({
|
|
26730
26742
|
id: import_zod7.z.string().uuid(),
|
|
26731
|
-
type: import_zod7.z.nativeEnum(
|
|
26743
|
+
type: import_zod7.z.nativeEnum(RecommendedClassDraftType),
|
|
26732
26744
|
title: import_zod7.z.string(),
|
|
26733
26745
|
description: import_zod7.z.string().nullable(),
|
|
26734
26746
|
creatorUserInstitutionId: import_zod7.z.string().uuid(),
|
|
@@ -26738,20 +26750,20 @@ var goalModelResponseSchema = import_zod7.z.object({
|
|
|
26738
26750
|
createdAt: import_zod7.z.string(),
|
|
26739
26751
|
updatedAt: import_zod7.z.string()
|
|
26740
26752
|
});
|
|
26741
|
-
var
|
|
26753
|
+
var recommendedClassModelsApiResponseSchema = import_zod7.z.object({
|
|
26742
26754
|
message: import_zod7.z.string(),
|
|
26743
26755
|
data: import_zod7.z.object({
|
|
26744
|
-
drafts: import_zod7.z.array(
|
|
26756
|
+
drafts: import_zod7.z.array(recommendedClassModelResponseSchema),
|
|
26745
26757
|
total: import_zod7.z.number()
|
|
26746
26758
|
})
|
|
26747
26759
|
});
|
|
26748
|
-
var
|
|
26760
|
+
var DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION = {
|
|
26749
26761
|
total: 0,
|
|
26750
26762
|
page: 1,
|
|
26751
26763
|
limit: 10,
|
|
26752
26764
|
totalPages: 0
|
|
26753
26765
|
};
|
|
26754
|
-
var
|
|
26766
|
+
var transformRecommendedClassModelToTableItem = (model, subjectsMap) => {
|
|
26755
26767
|
const subjectName = model.subjectId ? subjectsMap?.get(model.subjectId) || "" : "";
|
|
26756
26768
|
return {
|
|
26757
26769
|
id: model.id,
|
|
@@ -26761,26 +26773,26 @@ var transformGoalModelToTableItem = (model, subjectsMap) => {
|
|
|
26761
26773
|
subjectId: model.subjectId
|
|
26762
26774
|
};
|
|
26763
26775
|
};
|
|
26764
|
-
var
|
|
26776
|
+
var handleRecommendedClassModelFetchError = createFetchErrorHandler(
|
|
26765
26777
|
"Erro ao validar dados de modelos de aulas",
|
|
26766
26778
|
"Erro ao carregar modelos de aulas"
|
|
26767
26779
|
);
|
|
26768
|
-
var
|
|
26780
|
+
var createUseRecommendedClassModels = (fetchRecommendedClassModels, deleteRecommendedClassModel) => {
|
|
26769
26781
|
return () => {
|
|
26770
26782
|
const [state, setState] = (0, import_react81.useState)({
|
|
26771
26783
|
models: [],
|
|
26772
26784
|
loading: false,
|
|
26773
26785
|
error: null,
|
|
26774
|
-
pagination:
|
|
26786
|
+
pagination: DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION
|
|
26775
26787
|
});
|
|
26776
26788
|
const fetchModels = (0, import_react81.useCallback)(
|
|
26777
26789
|
async (filters, subjectsMap) => {
|
|
26778
26790
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26779
26791
|
try {
|
|
26780
|
-
const responseData = await
|
|
26781
|
-
const validatedData =
|
|
26792
|
+
const responseData = await fetchRecommendedClassModels(filters);
|
|
26793
|
+
const validatedData = recommendedClassModelsApiResponseSchema.parse(responseData);
|
|
26782
26794
|
const tableItems = validatedData.data.drafts.map(
|
|
26783
|
-
(model) =>
|
|
26795
|
+
(model) => transformRecommendedClassModelToTableItem(model, subjectsMap)
|
|
26784
26796
|
);
|
|
26785
26797
|
const limit = filters?.limit || 10;
|
|
26786
26798
|
const page = filters?.page || 1;
|
|
@@ -26798,7 +26810,7 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
26798
26810
|
}
|
|
26799
26811
|
});
|
|
26800
26812
|
} catch (error) {
|
|
26801
|
-
const errorMessage =
|
|
26813
|
+
const errorMessage = handleRecommendedClassModelFetchError(error);
|
|
26802
26814
|
setState((prev) => ({
|
|
26803
26815
|
...prev,
|
|
26804
26816
|
loading: false,
|
|
@@ -26806,19 +26818,19 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
26806
26818
|
}));
|
|
26807
26819
|
}
|
|
26808
26820
|
},
|
|
26809
|
-
[
|
|
26821
|
+
[fetchRecommendedClassModels]
|
|
26810
26822
|
);
|
|
26811
26823
|
const deleteModel = (0, import_react81.useCallback)(
|
|
26812
26824
|
async (id) => {
|
|
26813
26825
|
try {
|
|
26814
|
-
await
|
|
26826
|
+
await deleteRecommendedClassModel(id);
|
|
26815
26827
|
return true;
|
|
26816
26828
|
} catch (error) {
|
|
26817
26829
|
console.error("Erro ao deletar modelo:", error);
|
|
26818
26830
|
return false;
|
|
26819
26831
|
}
|
|
26820
26832
|
},
|
|
26821
|
-
[
|
|
26833
|
+
[deleteRecommendedClassModel]
|
|
26822
26834
|
);
|
|
26823
26835
|
return {
|
|
26824
26836
|
...state,
|
|
@@ -26827,27 +26839,27 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
26827
26839
|
};
|
|
26828
26840
|
};
|
|
26829
26841
|
};
|
|
26830
|
-
var
|
|
26842
|
+
var createRecommendedClassModelsHook = createUseRecommendedClassModels;
|
|
26831
26843
|
|
|
26832
26844
|
// src/components/RecommendedLessonsHistory/tabs/ModelsTab.tsx
|
|
26833
26845
|
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
26834
|
-
var
|
|
26846
|
+
var RECOMMENDED_CLASS_MODELS_CONFIG = {
|
|
26835
26847
|
entityName: "aula",
|
|
26836
26848
|
entityNamePlural: "aulas",
|
|
26837
|
-
testId: "
|
|
26849
|
+
testId: "recommendedClass-models-tab",
|
|
26838
26850
|
emptyStateTitle: "Crie modelos para agilizar suas aulas",
|
|
26839
26851
|
emptyStateDescription: "Salve modelos de aulas recomendadas para reutilizar e enviar rapidamente para suas turmas!",
|
|
26840
26852
|
searchPlaceholder: "Buscar modelo"
|
|
26841
26853
|
};
|
|
26842
|
-
var
|
|
26854
|
+
var RECOMMENDED_CLASS_COLUMNS_CONFIG = {
|
|
26843
26855
|
sendButtonLabel: "Enviar aula",
|
|
26844
26856
|
sendButtonAriaLabel: "Enviar aula",
|
|
26845
26857
|
deleteButtonAriaLabel: "Deletar modelo",
|
|
26846
26858
|
editButtonAriaLabel: "Editar modelo"
|
|
26847
26859
|
};
|
|
26848
|
-
var
|
|
26849
|
-
|
|
26850
|
-
|
|
26860
|
+
var RecommendedClassModelsTab = ({
|
|
26861
|
+
fetchRecommendedClassModels,
|
|
26862
|
+
deleteRecommendedClassModel,
|
|
26851
26863
|
onCreateModel,
|
|
26852
26864
|
onSendLesson,
|
|
26853
26865
|
onEditModel,
|
|
@@ -26859,8 +26871,8 @@ var GoalModelsTab = ({
|
|
|
26859
26871
|
}) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
26860
26872
|
ModelsTabBase,
|
|
26861
26873
|
{
|
|
26862
|
-
fetchModels:
|
|
26863
|
-
deleteModel:
|
|
26874
|
+
fetchModels: fetchRecommendedClassModels,
|
|
26875
|
+
deleteModel: deleteRecommendedClassModel,
|
|
26864
26876
|
onCreateModel,
|
|
26865
26877
|
onSend: onSendLesson,
|
|
26866
26878
|
onEditModel,
|
|
@@ -26869,17 +26881,17 @@ var GoalModelsTab = ({
|
|
|
26869
26881
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26870
26882
|
userFilterData,
|
|
26871
26883
|
subjectsMap,
|
|
26872
|
-
config:
|
|
26884
|
+
config: RECOMMENDED_CLASS_MODELS_CONFIG,
|
|
26873
26885
|
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
26874
26886
|
mapSubject,
|
|
26875
26887
|
send,
|
|
26876
26888
|
edit,
|
|
26877
26889
|
del,
|
|
26878
|
-
|
|
26890
|
+
RECOMMENDED_CLASS_COLUMNS_CONFIG
|
|
26879
26891
|
),
|
|
26880
|
-
createFiltersConfig:
|
|
26881
|
-
buildFiltersFromParams:
|
|
26882
|
-
createUseModels:
|
|
26892
|
+
createFiltersConfig: createRecommendedClassModelsFiltersConfig,
|
|
26893
|
+
buildFiltersFromParams: buildRecommendedClassModelsFiltersFromParams,
|
|
26894
|
+
createUseModels: createUseRecommendedClassModels
|
|
26883
26895
|
}
|
|
26884
26896
|
);
|
|
26885
26897
|
|
|
@@ -26891,7 +26903,7 @@ var getSubjectOptions2 = (data) => {
|
|
|
26891
26903
|
name: subject.name
|
|
26892
26904
|
}));
|
|
26893
26905
|
};
|
|
26894
|
-
var
|
|
26906
|
+
var createRecommendedClassDraftsFiltersConfig = (userData) => [
|
|
26895
26907
|
{
|
|
26896
26908
|
key: "content",
|
|
26897
26909
|
label: "CONTE\xDADO",
|
|
@@ -26906,34 +26918,34 @@ var createGoalDraftsFiltersConfig = (userData) => [
|
|
|
26906
26918
|
}
|
|
26907
26919
|
];
|
|
26908
26920
|
|
|
26909
|
-
// src/hooks/
|
|
26921
|
+
// src/hooks/useRecommendedClassDrafts.ts
|
|
26910
26922
|
var import_react82 = require("react");
|
|
26911
|
-
var
|
|
26923
|
+
var DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION = {
|
|
26912
26924
|
total: 0,
|
|
26913
26925
|
page: 1,
|
|
26914
26926
|
limit: 10,
|
|
26915
26927
|
totalPages: 0
|
|
26916
26928
|
};
|
|
26917
|
-
var
|
|
26929
|
+
var handleRecommendedClassDraftFetchError = createFetchErrorHandler(
|
|
26918
26930
|
"Erro ao validar dados de rascunhos de aulas",
|
|
26919
26931
|
"Erro ao carregar rascunhos de aulas"
|
|
26920
26932
|
);
|
|
26921
|
-
var
|
|
26933
|
+
var createUseRecommendedClassDrafts = (fetchRecommendedClassDrafts, deleteRecommendedClassDraft) => {
|
|
26922
26934
|
return () => {
|
|
26923
26935
|
const [state, setState] = (0, import_react82.useState)({
|
|
26924
26936
|
models: [],
|
|
26925
26937
|
loading: false,
|
|
26926
26938
|
error: null,
|
|
26927
|
-
pagination:
|
|
26939
|
+
pagination: DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION
|
|
26928
26940
|
});
|
|
26929
26941
|
const fetchModels = (0, import_react82.useCallback)(
|
|
26930
26942
|
async (filters, subjectsMap) => {
|
|
26931
26943
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26932
26944
|
try {
|
|
26933
|
-
const responseData = await
|
|
26934
|
-
const validatedData =
|
|
26945
|
+
const responseData = await fetchRecommendedClassDrafts(filters);
|
|
26946
|
+
const validatedData = recommendedClassModelsApiResponseSchema.parse(responseData);
|
|
26935
26947
|
const tableItems = validatedData.data.drafts.map(
|
|
26936
|
-
(draft) =>
|
|
26948
|
+
(draft) => transformRecommendedClassModelToTableItem(draft, subjectsMap)
|
|
26937
26949
|
);
|
|
26938
26950
|
const limit = filters?.limit || 10;
|
|
26939
26951
|
const page = filters?.page || 1;
|
|
@@ -26951,7 +26963,7 @@ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
|
26951
26963
|
}
|
|
26952
26964
|
});
|
|
26953
26965
|
} catch (error) {
|
|
26954
|
-
const errorMessage =
|
|
26966
|
+
const errorMessage = handleRecommendedClassDraftFetchError(error);
|
|
26955
26967
|
setState((prev) => ({
|
|
26956
26968
|
...prev,
|
|
26957
26969
|
loading: false,
|
|
@@ -26959,19 +26971,19 @@ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
|
26959
26971
|
}));
|
|
26960
26972
|
}
|
|
26961
26973
|
},
|
|
26962
|
-
[
|
|
26974
|
+
[fetchRecommendedClassDrafts]
|
|
26963
26975
|
);
|
|
26964
26976
|
const deleteModel = (0, import_react82.useCallback)(
|
|
26965
26977
|
async (id) => {
|
|
26966
26978
|
try {
|
|
26967
|
-
await
|
|
26979
|
+
await deleteRecommendedClassDraft(id);
|
|
26968
26980
|
return true;
|
|
26969
26981
|
} catch (error) {
|
|
26970
26982
|
console.error("Erro ao deletar rascunho:", error);
|
|
26971
26983
|
return false;
|
|
26972
26984
|
}
|
|
26973
26985
|
},
|
|
26974
|
-
[
|
|
26986
|
+
[deleteRecommendedClassDraft]
|
|
26975
26987
|
);
|
|
26976
26988
|
return {
|
|
26977
26989
|
...state,
|
|
@@ -26980,27 +26992,27 @@ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
|
26980
26992
|
};
|
|
26981
26993
|
};
|
|
26982
26994
|
};
|
|
26983
|
-
var
|
|
26995
|
+
var createRecommendedClassDraftsHook = createUseRecommendedClassDrafts;
|
|
26984
26996
|
|
|
26985
26997
|
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
26986
26998
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
26987
|
-
var
|
|
26999
|
+
var RECOMMENDED_CLASS_DRAFTS_CONFIG = {
|
|
26988
27000
|
entityName: "rascunho",
|
|
26989
27001
|
entityNamePlural: "rascunhos",
|
|
26990
|
-
testId: "
|
|
27002
|
+
testId: "recommendedClass-drafts-tab",
|
|
26991
27003
|
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
26992
27004
|
emptyStateDescription: "As aulas recomendadas que voc\xEA come\xE7ar a criar, aparecer\xE3o aqui automaticamente como rascunhos. Tudo \xE9 salvo enquanto voc\xEA cria, continue de onde parou quando quiser!",
|
|
26993
27005
|
searchPlaceholder: "Buscar rascunho"
|
|
26994
27006
|
};
|
|
26995
|
-
var
|
|
27007
|
+
var RECOMMENDED_CLASS_DRAFTS_COLUMNS_CONFIG = {
|
|
26996
27008
|
sendButtonLabel: "Enviar aula",
|
|
26997
27009
|
sendButtonAriaLabel: "Enviar rascunho",
|
|
26998
27010
|
deleteButtonAriaLabel: "Deletar rascunho",
|
|
26999
27011
|
editButtonAriaLabel: "Editar rascunho"
|
|
27000
27012
|
};
|
|
27001
|
-
var
|
|
27002
|
-
|
|
27003
|
-
|
|
27013
|
+
var RecommendedClassDraftsTab = ({
|
|
27014
|
+
fetchRecommendedClassDrafts,
|
|
27015
|
+
deleteRecommendedClassDraft,
|
|
27004
27016
|
onCreateDraft,
|
|
27005
27017
|
onSendDraft,
|
|
27006
27018
|
onEditDraft,
|
|
@@ -27012,8 +27024,8 @@ var GoalDraftsTab = ({
|
|
|
27012
27024
|
}) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
27013
27025
|
ModelsTabBase,
|
|
27014
27026
|
{
|
|
27015
|
-
fetchModels:
|
|
27016
|
-
deleteModel:
|
|
27027
|
+
fetchModels: fetchRecommendedClassDrafts,
|
|
27028
|
+
deleteModel: deleteRecommendedClassDraft,
|
|
27017
27029
|
onCreateModel: onCreateDraft,
|
|
27018
27030
|
onSend: onSendDraft,
|
|
27019
27031
|
onEditModel: onEditDraft,
|
|
@@ -27022,28 +27034,28 @@ var GoalDraftsTab = ({
|
|
|
27022
27034
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27023
27035
|
userFilterData,
|
|
27024
27036
|
subjectsMap,
|
|
27025
|
-
config:
|
|
27037
|
+
config: RECOMMENDED_CLASS_DRAFTS_CONFIG,
|
|
27026
27038
|
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
27027
27039
|
mapSubject,
|
|
27028
27040
|
send,
|
|
27029
27041
|
edit,
|
|
27030
27042
|
del,
|
|
27031
|
-
|
|
27043
|
+
RECOMMENDED_CLASS_DRAFTS_COLUMNS_CONFIG
|
|
27032
27044
|
),
|
|
27033
|
-
createFiltersConfig:
|
|
27034
|
-
buildFiltersFromParams:
|
|
27035
|
-
createUseModels:
|
|
27045
|
+
createFiltersConfig: createRecommendedClassDraftsFiltersConfig,
|
|
27046
|
+
buildFiltersFromParams: buildRecommendedClassModelsFiltersFromParams,
|
|
27047
|
+
createUseModels: createUseRecommendedClassDrafts
|
|
27036
27048
|
}
|
|
27037
27049
|
);
|
|
27038
27050
|
|
|
27039
27051
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
27040
27052
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
27041
|
-
var
|
|
27042
|
-
|
|
27043
|
-
|
|
27044
|
-
|
|
27045
|
-
return
|
|
27046
|
-
})(
|
|
27053
|
+
var RecommendedClassPageTab = /* @__PURE__ */ ((RecommendedClassPageTab2) => {
|
|
27054
|
+
RecommendedClassPageTab2["HISTORY"] = "history";
|
|
27055
|
+
RecommendedClassPageTab2["DRAFTS"] = "drafts";
|
|
27056
|
+
RecommendedClassPageTab2["MODELS"] = "models";
|
|
27057
|
+
return RecommendedClassPageTab2;
|
|
27058
|
+
})(RecommendedClassPageTab || {});
|
|
27047
27059
|
var extractFilterValue = (param) => {
|
|
27048
27060
|
if (!Array.isArray(param) || param.length === 0) return {};
|
|
27049
27061
|
return param.length === 1 ? { single: param[0] } : { multiple: param };
|
|
@@ -27104,7 +27116,7 @@ var getClassOptions = (data) => {
|
|
|
27104
27116
|
name: cls.name
|
|
27105
27117
|
}));
|
|
27106
27118
|
};
|
|
27107
|
-
var
|
|
27119
|
+
var createRecommendedClassFiltersConfig = (userData) => [
|
|
27108
27120
|
{
|
|
27109
27121
|
key: "academic",
|
|
27110
27122
|
label: "DADOS ACAD\xCAMICOS",
|
|
@@ -27179,12 +27191,12 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
27179
27191
|
key: "status",
|
|
27180
27192
|
label: "Status",
|
|
27181
27193
|
selectedIds: [],
|
|
27182
|
-
itens:
|
|
27194
|
+
itens: RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS
|
|
27183
27195
|
}
|
|
27184
27196
|
]
|
|
27185
27197
|
}
|
|
27186
27198
|
];
|
|
27187
|
-
var createTableColumns2 = (mapSubjectNameToEnum2,
|
|
27199
|
+
var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteRecommendedClass, onEditRecommendedClass) => [
|
|
27188
27200
|
{
|
|
27189
27201
|
key: "startDate",
|
|
27190
27202
|
label: "In\xEDcio",
|
|
@@ -27265,7 +27277,9 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27265
27277
|
Badge_default,
|
|
27266
27278
|
{
|
|
27267
27279
|
variant: "solid",
|
|
27268
|
-
action:
|
|
27280
|
+
action: getRecommendedClassStatusBadgeAction(
|
|
27281
|
+
status
|
|
27282
|
+
),
|
|
27269
27283
|
size: "small",
|
|
27270
27284
|
children: status
|
|
27271
27285
|
}
|
|
@@ -27296,11 +27310,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27296
27310
|
render: (_value, row) => {
|
|
27297
27311
|
const handleDelete = (e) => {
|
|
27298
27312
|
e.stopPropagation();
|
|
27299
|
-
|
|
27313
|
+
onDeleteRecommendedClass?.(row.id);
|
|
27300
27314
|
};
|
|
27301
27315
|
const handleEdit = (e) => {
|
|
27302
27316
|
e.stopPropagation();
|
|
27303
|
-
|
|
27317
|
+
onEditRecommendedClass?.(row.id);
|
|
27304
27318
|
};
|
|
27305
27319
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex justify-center gap-2", children: [
|
|
27306
27320
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
@@ -27333,11 +27347,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27333
27347
|
}
|
|
27334
27348
|
];
|
|
27335
27349
|
var RecommendedLessonsHistory = ({
|
|
27336
|
-
|
|
27350
|
+
fetchRecommendedClassHistory,
|
|
27337
27351
|
onCreateLesson,
|
|
27338
27352
|
onRowClick,
|
|
27339
|
-
|
|
27340
|
-
|
|
27353
|
+
onDeleteRecommendedClass,
|
|
27354
|
+
onEditRecommendedClass,
|
|
27341
27355
|
emptyStateImage,
|
|
27342
27356
|
noSearchImage,
|
|
27343
27357
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
@@ -27345,14 +27359,14 @@ var RecommendedLessonsHistory = ({
|
|
|
27345
27359
|
title = "Hist\xF3rico de aulas recomendadas",
|
|
27346
27360
|
createButtonText = "Criar aula",
|
|
27347
27361
|
searchPlaceholder = "Buscar aula",
|
|
27348
|
-
|
|
27349
|
-
|
|
27362
|
+
fetchRecommendedClassModels,
|
|
27363
|
+
deleteRecommendedClassModel,
|
|
27350
27364
|
onCreateModel,
|
|
27351
27365
|
onSendLesson,
|
|
27352
27366
|
onEditModel,
|
|
27353
27367
|
subjectsMap,
|
|
27354
|
-
|
|
27355
|
-
|
|
27368
|
+
fetchRecommendedClassDrafts,
|
|
27369
|
+
deleteRecommendedClassDraft,
|
|
27356
27370
|
onSendDraft,
|
|
27357
27371
|
onEditDraft,
|
|
27358
27372
|
defaultTab,
|
|
@@ -27374,35 +27388,39 @@ var RecommendedLessonsHistory = ({
|
|
|
27374
27388
|
},
|
|
27375
27389
|
[onTabChange]
|
|
27376
27390
|
);
|
|
27377
|
-
const
|
|
27378
|
-
|
|
27379
|
-
const
|
|
27391
|
+
const fetchRecommendedClassHistoryRef = (0, import_react83.useRef)(fetchRecommendedClassHistory);
|
|
27392
|
+
fetchRecommendedClassHistoryRef.current = fetchRecommendedClassHistory;
|
|
27393
|
+
const useRecommendedClassHistory = (0, import_react83.useMemo)(
|
|
27380
27394
|
() => createUseRecommendedLessonsHistory(
|
|
27381
|
-
(filters) =>
|
|
27395
|
+
(filters) => fetchRecommendedClassHistoryRef.current(filters)
|
|
27382
27396
|
),
|
|
27383
27397
|
[]
|
|
27384
27398
|
);
|
|
27385
27399
|
const {
|
|
27386
|
-
|
|
27400
|
+
recommendedClass,
|
|
27387
27401
|
loading,
|
|
27388
27402
|
error,
|
|
27389
27403
|
pagination,
|
|
27390
|
-
|
|
27391
|
-
} =
|
|
27404
|
+
fetchRecommendedClass
|
|
27405
|
+
} = useRecommendedClassHistory();
|
|
27392
27406
|
const initialFilterConfigs = (0, import_react83.useMemo)(
|
|
27393
|
-
() =>
|
|
27407
|
+
() => createRecommendedClassFiltersConfig(userFilterData),
|
|
27394
27408
|
[userFilterData]
|
|
27395
27409
|
);
|
|
27396
27410
|
const tableColumns = (0, import_react83.useMemo)(
|
|
27397
|
-
() => createTableColumns2(
|
|
27398
|
-
|
|
27411
|
+
() => createTableColumns2(
|
|
27412
|
+
mapSubjectNameToEnum2,
|
|
27413
|
+
onDeleteRecommendedClass,
|
|
27414
|
+
onEditRecommendedClass
|
|
27415
|
+
),
|
|
27416
|
+
[mapSubjectNameToEnum2, onDeleteRecommendedClass, onEditRecommendedClass]
|
|
27399
27417
|
);
|
|
27400
27418
|
const handleParamsChange = (0, import_react83.useCallback)(
|
|
27401
27419
|
(params) => {
|
|
27402
27420
|
const filters = buildFiltersFromParams(params);
|
|
27403
|
-
|
|
27421
|
+
fetchRecommendedClass(filters);
|
|
27404
27422
|
},
|
|
27405
|
-
[
|
|
27423
|
+
[fetchRecommendedClass]
|
|
27406
27424
|
);
|
|
27407
27425
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
27408
27426
|
"div",
|
|
@@ -27476,7 +27494,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27476
27494
|
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_jsx_runtime120.Fragment, { children: error ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27477
27495
|
TableProvider,
|
|
27478
27496
|
{
|
|
27479
|
-
data:
|
|
27497
|
+
data: recommendedClass,
|
|
27480
27498
|
headers: tableColumns,
|
|
27481
27499
|
loading,
|
|
27482
27500
|
variant: "borderless",
|
|
@@ -27543,11 +27561,11 @@ var RecommendedLessonsHistory = ({
|
|
|
27543
27561
|
}
|
|
27544
27562
|
}
|
|
27545
27563
|
) }) }),
|
|
27546
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
27547
|
-
|
|
27564
|
+
activeTab === "drafts" /* DRAFTS */ && fetchRecommendedClassDrafts && deleteRecommendedClassDraft && onCreateLesson && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27565
|
+
RecommendedClassDraftsTab,
|
|
27548
27566
|
{
|
|
27549
|
-
|
|
27550
|
-
|
|
27567
|
+
fetchRecommendedClassDrafts,
|
|
27568
|
+
deleteRecommendedClassDraft,
|
|
27551
27569
|
onCreateDraft: onCreateLesson,
|
|
27552
27570
|
onSendDraft,
|
|
27553
27571
|
onEditDraft,
|
|
@@ -27558,11 +27576,11 @@ var RecommendedLessonsHistory = ({
|
|
|
27558
27576
|
subjectsMap
|
|
27559
27577
|
}
|
|
27560
27578
|
),
|
|
27561
|
-
activeTab === "models" /* MODELS */ &&
|
|
27562
|
-
|
|
27579
|
+
activeTab === "models" /* MODELS */ && fetchRecommendedClassModels && deleteRecommendedClassModel && onCreateModel && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27580
|
+
RecommendedClassModelsTab,
|
|
27563
27581
|
{
|
|
27564
|
-
|
|
27565
|
-
|
|
27582
|
+
fetchRecommendedClassModels,
|
|
27583
|
+
deleteRecommendedClassModel,
|
|
27566
27584
|
onCreateModel,
|
|
27567
27585
|
onSendLesson,
|
|
27568
27586
|
onEditModel,
|
|
@@ -27637,8 +27655,8 @@ var LessonHeader = ({
|
|
|
27637
27655
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27638
27656
|
viewLessonLabel
|
|
27639
27657
|
}) => {
|
|
27640
|
-
const {
|
|
27641
|
-
const subjectName =
|
|
27658
|
+
const { recommendedClass, breakdown } = data;
|
|
27659
|
+
const subjectName = recommendedClass.lessons[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
27642
27660
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27643
27661
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
27644
27662
|
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
|
|
@@ -27650,18 +27668,18 @@ var LessonHeader = ({
|
|
|
27650
27668
|
size: "xl",
|
|
27651
27669
|
weight: "bold",
|
|
27652
27670
|
className: "text-text-950 lg:text-2xl",
|
|
27653
|
-
children:
|
|
27671
|
+
children: recommendedClass.title
|
|
27654
27672
|
}
|
|
27655
27673
|
),
|
|
27656
27674
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
|
|
27657
27675
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27658
27676
|
"In\xEDcio em ",
|
|
27659
|
-
formatDate(
|
|
27677
|
+
formatDate(recommendedClass.startDate)
|
|
27660
27678
|
] }),
|
|
27661
27679
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27662
27680
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27663
27681
|
"Prazo final ",
|
|
27664
|
-
formatDate(
|
|
27682
|
+
formatDate(recommendedClass.finalDate)
|
|
27665
27683
|
] }),
|
|
27666
27684
|
breakdown?.schoolName && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27667
27685
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
@@ -28210,7 +28228,7 @@ var StudentPerformanceModal = ({
|
|
|
28210
28228
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
28211
28229
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
28212
28230
|
var RecommendedLessonDetails = ({
|
|
28213
|
-
|
|
28231
|
+
recommendedClassId,
|
|
28214
28232
|
data,
|
|
28215
28233
|
loading = false,
|
|
28216
28234
|
error = null,
|
|
@@ -28232,13 +28250,16 @@ var RecommendedLessonDetails = ({
|
|
|
28232
28250
|
const [performanceError, setPerformanceError] = (0, import_react91.useState)(null);
|
|
28233
28251
|
const handleViewStudentPerformance = (0, import_react91.useCallback)(
|
|
28234
28252
|
async (studentId) => {
|
|
28235
|
-
if (!fetchStudentPerformance || !
|
|
28253
|
+
if (!fetchStudentPerformance || !recommendedClassId) return;
|
|
28236
28254
|
setPerformanceModalOpen(true);
|
|
28237
28255
|
setPerformanceLoading(true);
|
|
28238
28256
|
setPerformanceData(null);
|
|
28239
28257
|
setPerformanceError(null);
|
|
28240
28258
|
try {
|
|
28241
|
-
const result = await fetchStudentPerformance(
|
|
28259
|
+
const result = await fetchStudentPerformance(
|
|
28260
|
+
recommendedClassId,
|
|
28261
|
+
studentId
|
|
28262
|
+
);
|
|
28242
28263
|
setPerformanceData(result);
|
|
28243
28264
|
} catch (err) {
|
|
28244
28265
|
console.error("Error fetching student performance:", err);
|
|
@@ -28249,7 +28270,7 @@ var RecommendedLessonDetails = ({
|
|
|
28249
28270
|
setPerformanceLoading(false);
|
|
28250
28271
|
}
|
|
28251
28272
|
},
|
|
28252
|
-
[fetchStudentPerformance,
|
|
28273
|
+
[fetchStudentPerformance, recommendedClassId]
|
|
28253
28274
|
);
|
|
28254
28275
|
const handleClosePerformanceModal = (0, import_react91.useCallback)(() => {
|
|
28255
28276
|
setPerformanceModalOpen(false);
|
|
@@ -28259,18 +28280,18 @@ var RecommendedLessonDetails = ({
|
|
|
28259
28280
|
const defaultBreadcrumbs = (0, import_react91.useMemo)(
|
|
28260
28281
|
() => [
|
|
28261
28282
|
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
28262
|
-
{ label: data?.
|
|
28283
|
+
{ label: data?.recommendedClass.title || "Detalhes" }
|
|
28263
28284
|
],
|
|
28264
|
-
[data?.
|
|
28285
|
+
[data?.recommendedClass.title]
|
|
28265
28286
|
);
|
|
28266
28287
|
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
28267
28288
|
const displayStudents = (0, import_react91.useMemo)(() => {
|
|
28268
28289
|
if (!data?.details.students) return [];
|
|
28269
|
-
const deadline = data?.
|
|
28290
|
+
const deadline = data?.recommendedClass.finalDate;
|
|
28270
28291
|
return data.details.students.map(
|
|
28271
28292
|
(student) => transformStudentForDisplay(student, deadline)
|
|
28272
28293
|
);
|
|
28273
|
-
}, [data?.details.students, data?.
|
|
28294
|
+
}, [data?.details.students, data?.recommendedClass.finalDate]);
|
|
28274
28295
|
if (loading) {
|
|
28275
28296
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28276
28297
|
"div",
|
|
@@ -28398,7 +28419,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28398
28419
|
mapSubjectNameToEnum: mapSubjectNameToEnum2
|
|
28399
28420
|
} = config;
|
|
28400
28421
|
return () => {
|
|
28401
|
-
const
|
|
28422
|
+
const recommendedClassMapRef = (0, import_react92.useRef)(/* @__PURE__ */ new Map());
|
|
28402
28423
|
const [sendModalOpen, setSendModalOpen] = (0, import_react92.useState)(false);
|
|
28403
28424
|
const [selectedModel, setSelectedModel] = (0, import_react92.useState)(null);
|
|
28404
28425
|
const [sendModalLoading, setSendModalLoading] = (0, import_react92.useState)(false);
|
|
@@ -28417,60 +28438,63 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28417
28438
|
subjects.forEach((s) => map.set(s.id, s.name));
|
|
28418
28439
|
return map;
|
|
28419
28440
|
}, [userData]);
|
|
28420
|
-
const
|
|
28441
|
+
const fetchRecommendedClassHistory = (0, import_react92.useCallback)(
|
|
28421
28442
|
async (filters) => {
|
|
28422
28443
|
const params = buildQueryParams2(filters);
|
|
28423
28444
|
const response = await api.get(
|
|
28424
|
-
endpoints.
|
|
28445
|
+
endpoints.recommendedClassHistory,
|
|
28425
28446
|
{ params }
|
|
28426
28447
|
);
|
|
28427
|
-
const
|
|
28428
|
-
|
|
28429
|
-
|
|
28448
|
+
const recommendedClass = response.data.data.recommendedClass;
|
|
28449
|
+
recommendedClass.forEach((recommendedClass2) => {
|
|
28450
|
+
recommendedClassMapRef.current.set(
|
|
28451
|
+
recommendedClass2.recommendedClass.id,
|
|
28452
|
+
recommendedClass2
|
|
28453
|
+
);
|
|
28430
28454
|
});
|
|
28431
28455
|
return response.data;
|
|
28432
28456
|
},
|
|
28433
|
-
[api, endpoints.
|
|
28457
|
+
[api, endpoints.recommendedClassHistory]
|
|
28434
28458
|
);
|
|
28435
|
-
const
|
|
28459
|
+
const fetchRecommendedClassModels = (0, import_react92.useCallback)(
|
|
28436
28460
|
async (filters) => {
|
|
28437
28461
|
const params = buildQueryParams2({
|
|
28438
28462
|
...filters,
|
|
28439
28463
|
type: "MODELO" /* MODELO */
|
|
28440
28464
|
});
|
|
28441
28465
|
const response = await api.get(
|
|
28442
|
-
endpoints.
|
|
28466
|
+
endpoints.recommendedClassDrafts,
|
|
28443
28467
|
{ params }
|
|
28444
28468
|
);
|
|
28445
28469
|
return response.data;
|
|
28446
28470
|
},
|
|
28447
|
-
[api, endpoints.
|
|
28471
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28448
28472
|
);
|
|
28449
|
-
const
|
|
28473
|
+
const deleteRecommendedClassModel = (0, import_react92.useCallback)(
|
|
28450
28474
|
async (id) => {
|
|
28451
|
-
await api.delete(`${endpoints.
|
|
28475
|
+
await api.delete(`${endpoints.recommendedClassDrafts}/${id}`);
|
|
28452
28476
|
},
|
|
28453
|
-
[api, endpoints.
|
|
28477
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28454
28478
|
);
|
|
28455
|
-
const
|
|
28479
|
+
const fetchRecommendedClassDrafts = (0, import_react92.useCallback)(
|
|
28456
28480
|
async (filters) => {
|
|
28457
28481
|
const params = buildQueryParams2({
|
|
28458
28482
|
...filters,
|
|
28459
28483
|
type: "RASCUNHO" /* RASCUNHO */
|
|
28460
28484
|
});
|
|
28461
28485
|
const response = await api.get(
|
|
28462
|
-
endpoints.
|
|
28486
|
+
endpoints.recommendedClassDrafts,
|
|
28463
28487
|
{ params }
|
|
28464
28488
|
);
|
|
28465
28489
|
return response.data;
|
|
28466
28490
|
},
|
|
28467
|
-
[api, endpoints.
|
|
28491
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28468
28492
|
);
|
|
28469
|
-
const
|
|
28493
|
+
const deleteRecommendedClassDraft = (0, import_react92.useCallback)(
|
|
28470
28494
|
async (id) => {
|
|
28471
|
-
await api.delete(`${endpoints.
|
|
28495
|
+
await api.delete(`${endpoints.recommendedClassDrafts}/${id}`);
|
|
28472
28496
|
},
|
|
28473
|
-
[api, endpoints.
|
|
28497
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28474
28498
|
);
|
|
28475
28499
|
const handleCreateLesson = (0, import_react92.useCallback)(() => {
|
|
28476
28500
|
navigate(paths.createLesson);
|
|
@@ -28479,17 +28503,20 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28479
28503
|
navigate(paths.createModel);
|
|
28480
28504
|
}, []);
|
|
28481
28505
|
const handleRowClick = (0, import_react92.useCallback)((row) => {
|
|
28482
|
-
const originalData =
|
|
28506
|
+
const originalData = recommendedClassMapRef.current.get(row.id);
|
|
28483
28507
|
navigate(`${paths.lessonDetails}/${row.id}`, {
|
|
28484
|
-
state: {
|
|
28508
|
+
state: { recommendedClassData: originalData }
|
|
28485
28509
|
});
|
|
28486
28510
|
}, []);
|
|
28487
|
-
const
|
|
28511
|
+
const handleEditRecommendedClass = (0, import_react92.useCallback)((id) => {
|
|
28488
28512
|
navigate(`${paths.editLesson}/${id}/editar`);
|
|
28489
28513
|
}, []);
|
|
28490
|
-
const handleEditModel = (0, import_react92.useCallback)(
|
|
28491
|
-
|
|
28492
|
-
|
|
28514
|
+
const handleEditModel = (0, import_react92.useCallback)(
|
|
28515
|
+
(model) => {
|
|
28516
|
+
navigate(`${paths.editModel}${model.id}`);
|
|
28517
|
+
},
|
|
28518
|
+
[]
|
|
28519
|
+
);
|
|
28493
28520
|
const handleSendLesson = (0, import_react92.useCallback)(
|
|
28494
28521
|
(model) => {
|
|
28495
28522
|
setSelectedModel(model);
|
|
@@ -28518,7 +28545,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28518
28545
|
if (!selectedModel) return;
|
|
28519
28546
|
setSendModalLoading(true);
|
|
28520
28547
|
try {
|
|
28521
|
-
await api.post(endpoints.
|
|
28548
|
+
await api.post(endpoints.submitRecommendedClass, {
|
|
28522
28549
|
draftId: selectedModel.id,
|
|
28523
28550
|
students: formData.students,
|
|
28524
28551
|
startDate: `${formData.startDate}T${formData.startTime}:00`,
|
|
@@ -28530,7 +28557,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28530
28557
|
setSendModalLoading(false);
|
|
28531
28558
|
}
|
|
28532
28559
|
},
|
|
28533
|
-
[api, endpoints.
|
|
28560
|
+
[api, endpoints.submitRecommendedClass, selectedModel]
|
|
28534
28561
|
);
|
|
28535
28562
|
const handleSendModalClose = (0, import_react92.useCallback)(() => {
|
|
28536
28563
|
setSendModalOpen(false);
|
|
@@ -28544,17 +28571,17 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28544
28571
|
);
|
|
28545
28572
|
return {
|
|
28546
28573
|
historyProps: {
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
|
|
28574
|
+
fetchRecommendedClassHistory,
|
|
28575
|
+
fetchRecommendedClassModels,
|
|
28576
|
+
deleteRecommendedClassModel,
|
|
28550
28577
|
onCreateLesson: handleCreateLesson,
|
|
28551
28578
|
onCreateModel: handleCreateModel,
|
|
28552
28579
|
onRowClick: handleRowClick,
|
|
28553
|
-
|
|
28580
|
+
onEditRecommendedClass: handleEditRecommendedClass,
|
|
28554
28581
|
onEditModel: handleEditModel,
|
|
28555
28582
|
onSendLesson: handleSendLesson,
|
|
28556
|
-
|
|
28557
|
-
|
|
28583
|
+
fetchRecommendedClassDrafts,
|
|
28584
|
+
deleteRecommendedClassDraft,
|
|
28558
28585
|
onSendDraft: handleSendLesson,
|
|
28559
28586
|
onEditDraft: handleEditModel,
|
|
28560
28587
|
emptyStateImage,
|
|
@@ -28584,7 +28611,7 @@ var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
|
|
|
28584
28611
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
28585
28612
|
var import_react93 = require("react");
|
|
28586
28613
|
var import_zod8 = require("zod");
|
|
28587
|
-
var
|
|
28614
|
+
var recommendedClassLessonSubjectSchema = import_zod8.z.object({
|
|
28588
28615
|
id: import_zod8.z.string(),
|
|
28589
28616
|
name: import_zod8.z.string(),
|
|
28590
28617
|
color: import_zod8.z.string(),
|
|
@@ -28594,38 +28621,38 @@ var lessonContentSchema = import_zod8.z.object({
|
|
|
28594
28621
|
id: import_zod8.z.string(),
|
|
28595
28622
|
name: import_zod8.z.string()
|
|
28596
28623
|
});
|
|
28597
|
-
var
|
|
28624
|
+
var recommendedClassLessonSchema = import_zod8.z.object({
|
|
28598
28625
|
id: import_zod8.z.string(),
|
|
28599
28626
|
content: lessonContentSchema,
|
|
28600
28627
|
subtopic: lessonContentSchema,
|
|
28601
28628
|
topic: lessonContentSchema,
|
|
28602
|
-
subject:
|
|
28629
|
+
subject: recommendedClassLessonSubjectSchema
|
|
28603
28630
|
});
|
|
28604
|
-
var
|
|
28631
|
+
var recommendedClassLessonProgressSchema = import_zod8.z.object({
|
|
28605
28632
|
id: import_zod8.z.string(),
|
|
28606
28633
|
userId: import_zod8.z.string(),
|
|
28607
28634
|
lessonId: import_zod8.z.string(),
|
|
28608
28635
|
progress: import_zod8.z.number(),
|
|
28609
|
-
lesson:
|
|
28636
|
+
lesson: recommendedClassLessonSchema
|
|
28610
28637
|
});
|
|
28611
|
-
var
|
|
28612
|
-
|
|
28638
|
+
var recommendedClassLessonsItemSchema = import_zod8.z.object({
|
|
28639
|
+
recommendedClassId: import_zod8.z.string(),
|
|
28613
28640
|
supLessonsProgressId: import_zod8.z.string(),
|
|
28614
|
-
supLessonsProgress:
|
|
28641
|
+
supLessonsProgress: recommendedClassLessonProgressSchema
|
|
28615
28642
|
});
|
|
28616
|
-
var
|
|
28643
|
+
var recommendedClassMetadataSchema = import_zod8.z.object({
|
|
28617
28644
|
id: import_zod8.z.string(),
|
|
28618
28645
|
title: import_zod8.z.string(),
|
|
28619
28646
|
startDate: import_zod8.z.string(),
|
|
28620
28647
|
finalDate: import_zod8.z.string(),
|
|
28621
28648
|
progress: import_zod8.z.number(),
|
|
28622
|
-
|
|
28649
|
+
lessons: import_zod8.z.array(recommendedClassLessonsItemSchema)
|
|
28623
28650
|
});
|
|
28624
|
-
var
|
|
28651
|
+
var recommendedClassApiResponseSchema = import_zod8.z.object({
|
|
28625
28652
|
message: import_zod8.z.string(),
|
|
28626
|
-
data:
|
|
28653
|
+
data: recommendedClassMetadataSchema
|
|
28627
28654
|
});
|
|
28628
|
-
var
|
|
28655
|
+
var recommendedClassDetailStudentSchema = import_zod8.z.object({
|
|
28629
28656
|
userInstitutionId: import_zod8.z.string(),
|
|
28630
28657
|
userId: import_zod8.z.string(),
|
|
28631
28658
|
name: import_zod8.z.string(),
|
|
@@ -28634,29 +28661,29 @@ var goalDetailStudentSchema = import_zod8.z.object({
|
|
|
28634
28661
|
avgScore: import_zod8.z.number().nullable(),
|
|
28635
28662
|
daysToComplete: import_zod8.z.number().nullable()
|
|
28636
28663
|
});
|
|
28637
|
-
var
|
|
28664
|
+
var recommendedClassDetailAggregatedSchema = import_zod8.z.object({
|
|
28638
28665
|
completionPercentage: import_zod8.z.number(),
|
|
28639
28666
|
avgScore: import_zod8.z.number().nullable()
|
|
28640
28667
|
});
|
|
28641
|
-
var
|
|
28668
|
+
var recommendedClassDetailContentPerformanceItemSchema = import_zod8.z.object({
|
|
28642
28669
|
contentId: import_zod8.z.string(),
|
|
28643
28670
|
contentName: import_zod8.z.string(),
|
|
28644
28671
|
rate: import_zod8.z.number()
|
|
28645
28672
|
}).nullable();
|
|
28646
|
-
var
|
|
28647
|
-
best:
|
|
28648
|
-
worst:
|
|
28673
|
+
var recommendedClassDetailContentPerformanceSchema = import_zod8.z.object({
|
|
28674
|
+
best: recommendedClassDetailContentPerformanceItemSchema,
|
|
28675
|
+
worst: recommendedClassDetailContentPerformanceItemSchema
|
|
28649
28676
|
});
|
|
28650
|
-
var
|
|
28651
|
-
students: import_zod8.z.array(
|
|
28652
|
-
aggregated:
|
|
28653
|
-
contentPerformance:
|
|
28677
|
+
var recommendedClassDetailsDataSchema = import_zod8.z.object({
|
|
28678
|
+
students: import_zod8.z.array(recommendedClassDetailStudentSchema),
|
|
28679
|
+
aggregated: recommendedClassDetailAggregatedSchema,
|
|
28680
|
+
contentPerformance: recommendedClassDetailContentPerformanceSchema
|
|
28654
28681
|
});
|
|
28655
|
-
var
|
|
28682
|
+
var recommendedClassDetailsApiResponseSchema = import_zod8.z.object({
|
|
28656
28683
|
message: import_zod8.z.string(),
|
|
28657
|
-
data:
|
|
28684
|
+
data: recommendedClassDetailsDataSchema
|
|
28658
28685
|
});
|
|
28659
|
-
var
|
|
28686
|
+
var recommendedClassBreakdownSchema2 = import_zod8.z.object({
|
|
28660
28687
|
classId: import_zod8.z.string().uuid(),
|
|
28661
28688
|
className: import_zod8.z.string(),
|
|
28662
28689
|
schoolId: import_zod8.z.string(),
|
|
@@ -28664,14 +28691,14 @@ var goalBreakdownSchema2 = import_zod8.z.object({
|
|
|
28664
28691
|
studentCount: import_zod8.z.number(),
|
|
28665
28692
|
completedCount: import_zod8.z.number()
|
|
28666
28693
|
});
|
|
28667
|
-
var
|
|
28668
|
-
|
|
28669
|
-
breakdown: import_zod8.z.array(
|
|
28694
|
+
var historyRecommendedClassItemSchema = import_zod8.z.object({
|
|
28695
|
+
recommendedClass: import_zod8.z.object({ id: import_zod8.z.string().uuid() }),
|
|
28696
|
+
breakdown: import_zod8.z.array(recommendedClassBreakdownSchema2)
|
|
28670
28697
|
});
|
|
28671
28698
|
var historyApiResponseSchema = import_zod8.z.object({
|
|
28672
28699
|
message: import_zod8.z.string(),
|
|
28673
28700
|
data: import_zod8.z.object({
|
|
28674
|
-
|
|
28701
|
+
recommendedClass: import_zod8.z.array(historyRecommendedClassItemSchema),
|
|
28675
28702
|
total: import_zod8.z.number()
|
|
28676
28703
|
})
|
|
28677
28704
|
});
|
|
@@ -28702,23 +28729,23 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28702
28729
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
28703
28730
|
try {
|
|
28704
28731
|
const promises = [
|
|
28705
|
-
apiClient.
|
|
28706
|
-
apiClient.
|
|
28732
|
+
apiClient.fetchRecommendedClass(lessonId),
|
|
28733
|
+
apiClient.fetchRecommendedClassDetails(lessonId),
|
|
28707
28734
|
apiClient.fetchBreakdown ? apiClient.fetchBreakdown(lessonId) : Promise.resolve(null)
|
|
28708
28735
|
];
|
|
28709
|
-
const [
|
|
28710
|
-
const
|
|
28711
|
-
const validatedDetails =
|
|
28736
|
+
const [recommendedClassResponse, detailsResponse, historyResponse] = await Promise.all(promises);
|
|
28737
|
+
const validatedRecommendedClass = recommendedClassApiResponseSchema.parse(recommendedClassResponse);
|
|
28738
|
+
const validatedDetails = recommendedClassDetailsApiResponseSchema.parse(detailsResponse);
|
|
28712
28739
|
let breakdown;
|
|
28713
28740
|
if (historyResponse) {
|
|
28714
28741
|
const validatedHistory = historyApiResponseSchema.parse(historyResponse);
|
|
28715
|
-
const historyItem = validatedHistory.data.
|
|
28716
|
-
(g) => g.
|
|
28742
|
+
const historyItem = validatedHistory.data.recommendedClass.find(
|
|
28743
|
+
(g) => g.recommendedClass.id === lessonId
|
|
28717
28744
|
);
|
|
28718
28745
|
breakdown = historyItem?.breakdown[0];
|
|
28719
28746
|
}
|
|
28720
28747
|
const lessonData = {
|
|
28721
|
-
|
|
28748
|
+
recommendedClass: validatedRecommendedClass.data,
|
|
28722
28749
|
details: validatedDetails.data,
|
|
28723
28750
|
breakdown
|
|
28724
28751
|
};
|
|
@@ -29490,6 +29517,187 @@ var ActivitiesHistory = ({
|
|
|
29490
29517
|
);
|
|
29491
29518
|
};
|
|
29492
29519
|
|
|
29520
|
+
// src/hooks/useStudentsHighlight.ts
|
|
29521
|
+
var import_react98 = require("react");
|
|
29522
|
+
var import_zod11 = require("zod");
|
|
29523
|
+
var trendDirectionSchema = import_zod11.z.enum(["up", "down", "stable"]).nullable();
|
|
29524
|
+
var studentHighlightItemSchema = import_zod11.z.object({
|
|
29525
|
+
id: import_zod11.z.string().uuid(),
|
|
29526
|
+
name: import_zod11.z.string(),
|
|
29527
|
+
correctAnswers: import_zod11.z.number().min(0),
|
|
29528
|
+
incorrectAnswers: import_zod11.z.number().min(0),
|
|
29529
|
+
totalQuestions: import_zod11.z.number().min(0),
|
|
29530
|
+
trend: import_zod11.z.number().nullable(),
|
|
29531
|
+
trendDirection: trendDirectionSchema
|
|
29532
|
+
});
|
|
29533
|
+
var studentsHighlightApiResponseSchema = import_zod11.z.object({
|
|
29534
|
+
message: import_zod11.z.string(),
|
|
29535
|
+
data: import_zod11.z.object({
|
|
29536
|
+
topStudents: import_zod11.z.array(studentHighlightItemSchema),
|
|
29537
|
+
bottomStudents: import_zod11.z.array(studentHighlightItemSchema)
|
|
29538
|
+
})
|
|
29539
|
+
});
|
|
29540
|
+
var calculatePerformancePercentage = (correctAnswers, totalQuestions) => {
|
|
29541
|
+
if (totalQuestions === 0) {
|
|
29542
|
+
return 0;
|
|
29543
|
+
}
|
|
29544
|
+
return Math.round(correctAnswers / totalQuestions * 100);
|
|
29545
|
+
};
|
|
29546
|
+
var transformStudentHighlightItem = (item, position) => ({
|
|
29547
|
+
id: item.id,
|
|
29548
|
+
position,
|
|
29549
|
+
name: item.name,
|
|
29550
|
+
percentage: calculatePerformancePercentage(
|
|
29551
|
+
item.correctAnswers,
|
|
29552
|
+
item.totalQuestions
|
|
29553
|
+
),
|
|
29554
|
+
correctAnswers: item.correctAnswers,
|
|
29555
|
+
incorrectAnswers: item.incorrectAnswers,
|
|
29556
|
+
totalQuestions: item.totalQuestions,
|
|
29557
|
+
trend: item.trend,
|
|
29558
|
+
trendDirection: item.trendDirection
|
|
29559
|
+
});
|
|
29560
|
+
var handleStudentsHighlightFetchError = (error) => {
|
|
29561
|
+
if (error instanceof import_zod11.z.ZodError) {
|
|
29562
|
+
console.error("Erro ao validar dados de destaque de estudantes:", error);
|
|
29563
|
+
return "Erro ao validar dados de destaque de estudantes";
|
|
29564
|
+
}
|
|
29565
|
+
console.error("Erro ao carregar destaque de estudantes:", error);
|
|
29566
|
+
return "Erro ao carregar destaque de estudantes";
|
|
29567
|
+
};
|
|
29568
|
+
var initialState4 = {
|
|
29569
|
+
topStudents: [],
|
|
29570
|
+
bottomStudents: [],
|
|
29571
|
+
loading: false,
|
|
29572
|
+
error: null
|
|
29573
|
+
};
|
|
29574
|
+
var createUseStudentsHighlight = (fetchStudentsHighlightApi) => {
|
|
29575
|
+
return () => {
|
|
29576
|
+
const [state, setState] = (0, import_react98.useState)(initialState4);
|
|
29577
|
+
const fetchStudentsHighlight = (0, import_react98.useCallback)(
|
|
29578
|
+
async (filters) => {
|
|
29579
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
29580
|
+
try {
|
|
29581
|
+
const responseData = await fetchStudentsHighlightApi(filters);
|
|
29582
|
+
const validatedData = studentsHighlightApiResponseSchema.parse(responseData);
|
|
29583
|
+
const topStudents = validatedData.data.topStudents.map(
|
|
29584
|
+
(student, index) => transformStudentHighlightItem(student, index + 1)
|
|
29585
|
+
);
|
|
29586
|
+
const bottomStudents = validatedData.data.bottomStudents.map(
|
|
29587
|
+
(student, index) => transformStudentHighlightItem(student, index + 1)
|
|
29588
|
+
);
|
|
29589
|
+
setState({
|
|
29590
|
+
topStudents,
|
|
29591
|
+
bottomStudents,
|
|
29592
|
+
loading: false,
|
|
29593
|
+
error: null
|
|
29594
|
+
});
|
|
29595
|
+
} catch (error) {
|
|
29596
|
+
const errorMessage = handleStudentsHighlightFetchError(error);
|
|
29597
|
+
setState((prev) => ({
|
|
29598
|
+
...prev,
|
|
29599
|
+
loading: false,
|
|
29600
|
+
error: errorMessage
|
|
29601
|
+
}));
|
|
29602
|
+
}
|
|
29603
|
+
},
|
|
29604
|
+
[fetchStudentsHighlightApi]
|
|
29605
|
+
);
|
|
29606
|
+
const reset = (0, import_react98.useCallback)(() => {
|
|
29607
|
+
setState(initialState4);
|
|
29608
|
+
}, []);
|
|
29609
|
+
return {
|
|
29610
|
+
...state,
|
|
29611
|
+
fetchStudentsHighlight,
|
|
29612
|
+
reset
|
|
29613
|
+
};
|
|
29614
|
+
};
|
|
29615
|
+
};
|
|
29616
|
+
var createStudentsHighlightHook = createUseStudentsHighlight;
|
|
29617
|
+
|
|
29618
|
+
// src/hooks/useQuestionsData.ts
|
|
29619
|
+
var import_react99 = require("react");
|
|
29620
|
+
var import_zod12 = require("zod");
|
|
29621
|
+
var trendDirectionSchema2 = import_zod12.z.enum(["up", "down", "stable"]);
|
|
29622
|
+
var trendSchema = import_zod12.z.object({
|
|
29623
|
+
totalQuestions: import_zod12.z.number(),
|
|
29624
|
+
correctPercentage: import_zod12.z.number(),
|
|
29625
|
+
direction: trendDirectionSchema2
|
|
29626
|
+
}).nullable();
|
|
29627
|
+
var questionsDataApiResponseSchema = import_zod12.z.object({
|
|
29628
|
+
message: import_zod12.z.string(),
|
|
29629
|
+
data: import_zod12.z.object({
|
|
29630
|
+
totalQuestions: import_zod12.z.number().min(0),
|
|
29631
|
+
correctQuestions: import_zod12.z.number().min(0),
|
|
29632
|
+
incorrectQuestions: import_zod12.z.number().min(0),
|
|
29633
|
+
blankQuestions: import_zod12.z.number().min(0),
|
|
29634
|
+
correctPercentage: import_zod12.z.number().min(0).max(100),
|
|
29635
|
+
incorrectPercentage: import_zod12.z.number().min(0).max(100),
|
|
29636
|
+
blankPercentage: import_zod12.z.number().min(0).max(100),
|
|
29637
|
+
trend: trendSchema
|
|
29638
|
+
})
|
|
29639
|
+
});
|
|
29640
|
+
var transformQuestionsData = (apiData) => ({
|
|
29641
|
+
total: apiData.totalQuestions,
|
|
29642
|
+
corretas: apiData.correctQuestions,
|
|
29643
|
+
incorretas: apiData.incorrectQuestions,
|
|
29644
|
+
emBranco: apiData.blankQuestions,
|
|
29645
|
+
correctPercentage: apiData.correctPercentage,
|
|
29646
|
+
incorrectPercentage: apiData.incorrectPercentage,
|
|
29647
|
+
blankPercentage: apiData.blankPercentage,
|
|
29648
|
+
trend: apiData.trend
|
|
29649
|
+
});
|
|
29650
|
+
var handleQuestionsDataFetchError = (error) => {
|
|
29651
|
+
if (error instanceof import_zod12.z.ZodError) {
|
|
29652
|
+
console.error("Erro ao validar dados de quest\xF5es:", error);
|
|
29653
|
+
return "Erro ao validar dados de quest\xF5es";
|
|
29654
|
+
}
|
|
29655
|
+
console.error("Erro ao carregar dados de quest\xF5es:", error);
|
|
29656
|
+
return "Erro ao carregar dados de quest\xF5es";
|
|
29657
|
+
};
|
|
29658
|
+
var initialState5 = {
|
|
29659
|
+
data: null,
|
|
29660
|
+
loading: false,
|
|
29661
|
+
error: null
|
|
29662
|
+
};
|
|
29663
|
+
var createUseQuestionsData = (fetchQuestionsDataApi) => {
|
|
29664
|
+
return () => {
|
|
29665
|
+
const [state, setState] = (0, import_react99.useState)(initialState5);
|
|
29666
|
+
const fetchQuestionsData = (0, import_react99.useCallback)(
|
|
29667
|
+
async (filters) => {
|
|
29668
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
29669
|
+
try {
|
|
29670
|
+
const responseData = await fetchQuestionsDataApi(filters);
|
|
29671
|
+
const validatedData = questionsDataApiResponseSchema.parse(responseData);
|
|
29672
|
+
const transformedData = transformQuestionsData(validatedData.data);
|
|
29673
|
+
setState({
|
|
29674
|
+
data: transformedData,
|
|
29675
|
+
loading: false,
|
|
29676
|
+
error: null
|
|
29677
|
+
});
|
|
29678
|
+
} catch (error) {
|
|
29679
|
+
const errorMessage = handleQuestionsDataFetchError(error);
|
|
29680
|
+
setState((prev) => ({
|
|
29681
|
+
...prev,
|
|
29682
|
+
loading: false,
|
|
29683
|
+
error: errorMessage
|
|
29684
|
+
}));
|
|
29685
|
+
}
|
|
29686
|
+
},
|
|
29687
|
+
[fetchQuestionsDataApi]
|
|
29688
|
+
);
|
|
29689
|
+
const reset = (0, import_react99.useCallback)(() => {
|
|
29690
|
+
setState(initialState5);
|
|
29691
|
+
}, []);
|
|
29692
|
+
return {
|
|
29693
|
+
...state,
|
|
29694
|
+
fetchQuestionsData,
|
|
29695
|
+
reset
|
|
29696
|
+
};
|
|
29697
|
+
};
|
|
29698
|
+
};
|
|
29699
|
+
var createQuestionsDataHook = createUseQuestionsData;
|
|
29700
|
+
|
|
29493
29701
|
// src/utils/subjectMappers.ts
|
|
29494
29702
|
var SUBJECT_NAME_MAPPING = {
|
|
29495
29703
|
matem\u00E1tica: "Matem\xE1tica" /* MATEMATICA */,
|
|
@@ -29624,7 +29832,7 @@ var buildUserFilterData = (userData) => ({
|
|
|
29624
29832
|
});
|
|
29625
29833
|
|
|
29626
29834
|
// src/hooks/useChat.ts
|
|
29627
|
-
var
|
|
29835
|
+
var import_react100 = require("react");
|
|
29628
29836
|
var WS_STATES = {
|
|
29629
29837
|
CONNECTING: 0,
|
|
29630
29838
|
OPEN: 1,
|
|
@@ -29643,25 +29851,25 @@ function useChat({
|
|
|
29643
29851
|
reconnectInterval = 3e3,
|
|
29644
29852
|
maxReconnectAttempts = 5
|
|
29645
29853
|
}) {
|
|
29646
|
-
const [isConnected, setIsConnected] = (0,
|
|
29647
|
-
const [messages, setMessages] = (0,
|
|
29648
|
-
const [participants, setParticipants] = (0,
|
|
29649
|
-
const [error, setError] = (0,
|
|
29650
|
-
const wsRef = (0,
|
|
29651
|
-
const reconnectAttemptsRef = (0,
|
|
29652
|
-
const reconnectTimeoutRef = (0,
|
|
29854
|
+
const [isConnected, setIsConnected] = (0, import_react100.useState)(false);
|
|
29855
|
+
const [messages, setMessages] = (0, import_react100.useState)([]);
|
|
29856
|
+
const [participants, setParticipants] = (0, import_react100.useState)([]);
|
|
29857
|
+
const [error, setError] = (0, import_react100.useState)(null);
|
|
29858
|
+
const wsRef = (0, import_react100.useRef)(null);
|
|
29859
|
+
const reconnectAttemptsRef = (0, import_react100.useRef)(0);
|
|
29860
|
+
const reconnectTimeoutRef = (0, import_react100.useRef)(
|
|
29653
29861
|
null
|
|
29654
29862
|
);
|
|
29655
|
-
const isManualDisconnectRef = (0,
|
|
29656
|
-
const isConnectingRef = (0,
|
|
29657
|
-
const connectRef = (0,
|
|
29863
|
+
const isManualDisconnectRef = (0, import_react100.useRef)(false);
|
|
29864
|
+
const isConnectingRef = (0, import_react100.useRef)(false);
|
|
29865
|
+
const connectRef = (0, import_react100.useRef)(() => {
|
|
29658
29866
|
});
|
|
29659
|
-
const sendWsMessage = (0,
|
|
29867
|
+
const sendWsMessage = (0, import_react100.useCallback)((message) => {
|
|
29660
29868
|
if (wsRef.current?.readyState === WS_STATES.OPEN) {
|
|
29661
29869
|
wsRef.current.send(JSON.stringify(message));
|
|
29662
29870
|
}
|
|
29663
29871
|
}, []);
|
|
29664
|
-
const sendMessage = (0,
|
|
29872
|
+
const sendMessage = (0, import_react100.useCallback)(
|
|
29665
29873
|
(content) => {
|
|
29666
29874
|
const trimmedContent = content.trim();
|
|
29667
29875
|
if (!trimmedContent) return;
|
|
@@ -29672,12 +29880,12 @@ function useChat({
|
|
|
29672
29880
|
},
|
|
29673
29881
|
[sendWsMessage]
|
|
29674
29882
|
);
|
|
29675
|
-
const leave = (0,
|
|
29883
|
+
const leave = (0, import_react100.useCallback)(() => {
|
|
29676
29884
|
isManualDisconnectRef.current = true;
|
|
29677
29885
|
sendWsMessage({ type: "leave" });
|
|
29678
29886
|
wsRef.current?.close(1e3, "User left");
|
|
29679
29887
|
}, [sendWsMessage]);
|
|
29680
|
-
const handleMessage = (0,
|
|
29888
|
+
const handleMessage = (0, import_react100.useCallback)(
|
|
29681
29889
|
(event) => {
|
|
29682
29890
|
try {
|
|
29683
29891
|
const data = JSON.parse(event.data);
|
|
@@ -29745,7 +29953,7 @@ function useChat({
|
|
|
29745
29953
|
},
|
|
29746
29954
|
[onError]
|
|
29747
29955
|
);
|
|
29748
|
-
const connect = (0,
|
|
29956
|
+
const connect = (0, import_react100.useCallback)(() => {
|
|
29749
29957
|
if (isConnectingRef.current) {
|
|
29750
29958
|
return;
|
|
29751
29959
|
}
|
|
@@ -29799,12 +30007,12 @@ function useChat({
|
|
|
29799
30007
|
maxReconnectAttempts
|
|
29800
30008
|
]);
|
|
29801
30009
|
connectRef.current = connect;
|
|
29802
|
-
const reconnect = (0,
|
|
30010
|
+
const reconnect = (0, import_react100.useCallback)(() => {
|
|
29803
30011
|
isManualDisconnectRef.current = false;
|
|
29804
30012
|
reconnectAttemptsRef.current = 0;
|
|
29805
30013
|
connectRef.current();
|
|
29806
30014
|
}, []);
|
|
29807
|
-
(0,
|
|
30015
|
+
(0, import_react100.useEffect)(() => {
|
|
29808
30016
|
if (!roomId) {
|
|
29809
30017
|
return;
|
|
29810
30018
|
}
|
|
@@ -29848,15 +30056,15 @@ function createUseChat(baseWsUrl) {
|
|
|
29848
30056
|
}
|
|
29849
30057
|
|
|
29850
30058
|
// src/hooks/useChatRooms.ts
|
|
29851
|
-
var
|
|
30059
|
+
var import_react101 = require("react");
|
|
29852
30060
|
function useChatRooms({
|
|
29853
30061
|
apiClient
|
|
29854
30062
|
}) {
|
|
29855
|
-
const [rooms, setRooms] = (0,
|
|
29856
|
-
const [availableUsers, setAvailableUsers] = (0,
|
|
29857
|
-
const [loading, setLoading] = (0,
|
|
29858
|
-
const [error, setError] = (0,
|
|
29859
|
-
const fetchRooms = (0,
|
|
30063
|
+
const [rooms, setRooms] = (0, import_react101.useState)([]);
|
|
30064
|
+
const [availableUsers, setAvailableUsers] = (0, import_react101.useState)([]);
|
|
30065
|
+
const [loading, setLoading] = (0, import_react101.useState)(false);
|
|
30066
|
+
const [error, setError] = (0, import_react101.useState)(null);
|
|
30067
|
+
const fetchRooms = (0, import_react101.useCallback)(async () => {
|
|
29860
30068
|
setLoading(true);
|
|
29861
30069
|
setError(null);
|
|
29862
30070
|
try {
|
|
@@ -29872,7 +30080,7 @@ function useChatRooms({
|
|
|
29872
30080
|
setLoading(false);
|
|
29873
30081
|
}
|
|
29874
30082
|
}, [apiClient]);
|
|
29875
|
-
const fetchAvailableUsers = (0,
|
|
30083
|
+
const fetchAvailableUsers = (0, import_react101.useCallback)(async () => {
|
|
29876
30084
|
setLoading(true);
|
|
29877
30085
|
setError(null);
|
|
29878
30086
|
try {
|
|
@@ -29888,7 +30096,7 @@ function useChatRooms({
|
|
|
29888
30096
|
setLoading(false);
|
|
29889
30097
|
}
|
|
29890
30098
|
}, [apiClient]);
|
|
29891
|
-
const createRoom = (0,
|
|
30099
|
+
const createRoom = (0, import_react101.useCallback)(
|
|
29892
30100
|
async (participantIds) => {
|
|
29893
30101
|
setLoading(true);
|
|
29894
30102
|
setError(null);
|
|
@@ -29912,7 +30120,7 @@ function useChatRooms({
|
|
|
29912
30120
|
},
|
|
29913
30121
|
[apiClient, fetchRooms]
|
|
29914
30122
|
);
|
|
29915
|
-
const clearError = (0,
|
|
30123
|
+
const clearError = (0, import_react101.useCallback)(() => {
|
|
29916
30124
|
setError(null);
|
|
29917
30125
|
}, []);
|
|
29918
30126
|
return {
|
|
@@ -29946,8 +30154,8 @@ var CHAT_MESSAGE_TYPES = {
|
|
|
29946
30154
|
};
|
|
29947
30155
|
|
|
29948
30156
|
// src/components/Chat/Chat.tsx
|
|
29949
|
-
var
|
|
29950
|
-
var
|
|
30157
|
+
var import_react102 = require("react");
|
|
30158
|
+
var import_react103 = require("@phosphor-icons/react");
|
|
29951
30159
|
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
29952
30160
|
var RoomItem = ({
|
|
29953
30161
|
room,
|
|
@@ -29964,7 +30172,7 @@ var RoomItem = ({
|
|
|
29964
30172
|
isActive && "bg-primary-50 border-l-4 border-primary-500"
|
|
29965
30173
|
),
|
|
29966
30174
|
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-start gap-3 w-full", children: [
|
|
29967
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30175
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react103.UsersIcon, { size: 20, className: "text-primary-600" }) }),
|
|
29968
30176
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
29969
30177
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 truncate", children: room.name }),
|
|
29970
30178
|
room.lastMessage && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-500 truncate mt-1", children: [
|
|
@@ -30094,16 +30302,16 @@ function ChatContent({
|
|
|
30094
30302
|
onRoomChange,
|
|
30095
30303
|
onBackToList
|
|
30096
30304
|
}) {
|
|
30097
|
-
const [view, setView] = (0,
|
|
30098
|
-
const [selectedRoom, setSelectedRoom] = (0,
|
|
30305
|
+
const [view, setView] = (0, import_react102.useState)("list");
|
|
30306
|
+
const [selectedRoom, setSelectedRoom] = (0, import_react102.useState)(
|
|
30099
30307
|
null
|
|
30100
30308
|
);
|
|
30101
|
-
const [selectedUserIds, setSelectedUserIds] = (0,
|
|
30309
|
+
const [selectedUserIds, setSelectedUserIds] = (0, import_react102.useState)(
|
|
30102
30310
|
/* @__PURE__ */ new Set()
|
|
30103
30311
|
);
|
|
30104
|
-
const [messageInput, setMessageInput] = (0,
|
|
30105
|
-
const [showCreateModal, setShowCreateModal] = (0,
|
|
30106
|
-
const hasHandledInitialRoomRef = (0,
|
|
30312
|
+
const [messageInput, setMessageInput] = (0, import_react102.useState)("");
|
|
30313
|
+
const [showCreateModal, setShowCreateModal] = (0, import_react102.useState)(false);
|
|
30314
|
+
const hasHandledInitialRoomRef = (0, import_react102.useRef)(false);
|
|
30107
30315
|
const {
|
|
30108
30316
|
rooms,
|
|
30109
30317
|
availableUsers,
|
|
@@ -30131,10 +30339,10 @@ function ChatContent({
|
|
|
30131
30339
|
const getRoleLabel = () => {
|
|
30132
30340
|
return userRole === "TEACHER" /* TEACHER */ ? "Professor" : "Aluno";
|
|
30133
30341
|
};
|
|
30134
|
-
(0,
|
|
30342
|
+
(0, import_react102.useEffect)(() => {
|
|
30135
30343
|
fetchRooms();
|
|
30136
30344
|
}, [fetchRooms]);
|
|
30137
|
-
(0,
|
|
30345
|
+
(0, import_react102.useEffect)(() => {
|
|
30138
30346
|
if (hasHandledInitialRoomRef.current) {
|
|
30139
30347
|
return;
|
|
30140
30348
|
}
|
|
@@ -30156,7 +30364,7 @@ function ChatContent({
|
|
|
30156
30364
|
onBackToList?.();
|
|
30157
30365
|
}
|
|
30158
30366
|
}, [initialRoomId, rooms, roomsLoading, onBackToList]);
|
|
30159
|
-
const handleSelectRoom = (0,
|
|
30367
|
+
const handleSelectRoom = (0, import_react102.useCallback)(
|
|
30160
30368
|
(room) => {
|
|
30161
30369
|
setSelectedRoom(room);
|
|
30162
30370
|
setView("room");
|
|
@@ -30164,12 +30372,12 @@ function ChatContent({
|
|
|
30164
30372
|
},
|
|
30165
30373
|
[onRoomChange]
|
|
30166
30374
|
);
|
|
30167
|
-
const handleOpenCreateModal = (0,
|
|
30375
|
+
const handleOpenCreateModal = (0, import_react102.useCallback)(async () => {
|
|
30168
30376
|
await fetchAvailableUsers();
|
|
30169
30377
|
setSelectedUserIds(/* @__PURE__ */ new Set());
|
|
30170
30378
|
setShowCreateModal(true);
|
|
30171
30379
|
}, [fetchAvailableUsers]);
|
|
30172
|
-
const handleToggleUser = (0,
|
|
30380
|
+
const handleToggleUser = (0, import_react102.useCallback)((id) => {
|
|
30173
30381
|
setSelectedUserIds((prev) => {
|
|
30174
30382
|
const next = new Set(prev);
|
|
30175
30383
|
if (next.has(id)) {
|
|
@@ -30180,7 +30388,7 @@ function ChatContent({
|
|
|
30180
30388
|
return next;
|
|
30181
30389
|
});
|
|
30182
30390
|
}, []);
|
|
30183
|
-
const handleCreateRoom = (0,
|
|
30391
|
+
const handleCreateRoom = (0, import_react102.useCallback)(async () => {
|
|
30184
30392
|
if (selectedUserIds.size === 0) return;
|
|
30185
30393
|
const room = await createRoom(Array.from(selectedUserIds));
|
|
30186
30394
|
if (room) {
|
|
@@ -30189,12 +30397,12 @@ function ChatContent({
|
|
|
30189
30397
|
onRoomChange?.(room.id);
|
|
30190
30398
|
}
|
|
30191
30399
|
}, [selectedUserIds, createRoom, onRoomChange]);
|
|
30192
|
-
const handleSendMessage = (0,
|
|
30400
|
+
const handleSendMessage = (0, import_react102.useCallback)(() => {
|
|
30193
30401
|
if (!messageInput.trim()) return;
|
|
30194
30402
|
sendMessage(messageInput);
|
|
30195
30403
|
setMessageInput("");
|
|
30196
30404
|
}, [messageInput, sendMessage]);
|
|
30197
|
-
const handleBackToList = (0,
|
|
30405
|
+
const handleBackToList = (0, import_react102.useCallback)(() => {
|
|
30198
30406
|
setSelectedRoom(null);
|
|
30199
30407
|
setView("list");
|
|
30200
30408
|
onBackToList?.();
|
|
@@ -30247,7 +30455,7 @@ function ChatContent({
|
|
|
30247
30455
|
variant: "solid",
|
|
30248
30456
|
size: "small",
|
|
30249
30457
|
onClick: handleOpenCreateModal,
|
|
30250
|
-
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30458
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react103.PlusIcon, { size: 16 }),
|
|
30251
30459
|
children: "Nova conversa"
|
|
30252
30460
|
}
|
|
30253
30461
|
)
|
|
@@ -30287,7 +30495,7 @@ function ChatContent({
|
|
|
30287
30495
|
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex h-full", children: [
|
|
30288
30496
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 flex flex-col", children: [
|
|
30289
30497
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 border-b border-background-200 flex items-center gap-3", children: [
|
|
30290
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "link", size: "small", onClick: handleBackToList, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30498
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "link", size: "small", onClick: handleBackToList, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react103.XIcon, { size: 20 }) }),
|
|
30291
30499
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1", children: [
|
|
30292
30500
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-900", children: selectedRoom.name }),
|
|
30293
30501
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: isConnected ? "Conectado" : "Conectando..." })
|
|
@@ -30316,7 +30524,7 @@ function ChatContent({
|
|
|
30316
30524
|
variant: "solid",
|
|
30317
30525
|
onClick: handleSendMessage,
|
|
30318
30526
|
disabled: !messageInput.trim() || !isConnected,
|
|
30319
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react103.PaperPlaneTiltIcon, { size: 20 })
|
|
30320
30528
|
}
|
|
30321
30529
|
)
|
|
30322
30530
|
] }) })
|
|
@@ -30440,7 +30648,7 @@ var CalendarActivityStatus = /* @__PURE__ */ ((CalendarActivityStatus2) => {
|
|
|
30440
30648
|
})(CalendarActivityStatus || {});
|
|
30441
30649
|
|
|
30442
30650
|
// src/hooks/useSendActivity.ts
|
|
30443
|
-
var
|
|
30651
|
+
var import_react104 = require("react");
|
|
30444
30652
|
var import_dayjs8 = __toESM(require("dayjs"));
|
|
30445
30653
|
function transformToCategoryConfig(data) {
|
|
30446
30654
|
return [
|
|
@@ -30495,21 +30703,21 @@ function useSendActivity(config) {
|
|
|
30495
30703
|
onSuccess,
|
|
30496
30704
|
onError
|
|
30497
30705
|
} = config;
|
|
30498
|
-
const [isOpen, setIsOpen] = (0,
|
|
30499
|
-
const [selectedModel, setSelectedModel] = (0,
|
|
30706
|
+
const [isOpen, setIsOpen] = (0, import_react104.useState)(false);
|
|
30707
|
+
const [selectedModel, setSelectedModel] = (0, import_react104.useState)(
|
|
30500
30708
|
null
|
|
30501
30709
|
);
|
|
30502
|
-
const [categories, setCategories] = (0,
|
|
30503
|
-
const [isLoading, setIsLoading] = (0,
|
|
30504
|
-
const [isCategoriesLoading, setIsCategoriesLoading] = (0,
|
|
30505
|
-
const categoriesLoadedRef = (0,
|
|
30506
|
-
const initialData = (0,
|
|
30710
|
+
const [categories, setCategories] = (0, import_react104.useState)([]);
|
|
30711
|
+
const [isLoading, setIsLoading] = (0, import_react104.useState)(false);
|
|
30712
|
+
const [isCategoriesLoading, setIsCategoriesLoading] = (0, import_react104.useState)(false);
|
|
30713
|
+
const categoriesLoadedRef = (0, import_react104.useRef)(false);
|
|
30714
|
+
const initialData = (0, import_react104.useMemo)(() => {
|
|
30507
30715
|
if (!selectedModel) return void 0;
|
|
30508
30716
|
return {
|
|
30509
30717
|
title: selectedModel.title
|
|
30510
30718
|
};
|
|
30511
30719
|
}, [selectedModel]);
|
|
30512
|
-
const loadCategories = (0,
|
|
30720
|
+
const loadCategories = (0, import_react104.useCallback)(async () => {
|
|
30513
30721
|
if (categoriesLoadedRef.current) return;
|
|
30514
30722
|
setIsCategoriesLoading(true);
|
|
30515
30723
|
try {
|
|
@@ -30524,7 +30732,7 @@ function useSendActivity(config) {
|
|
|
30524
30732
|
setIsCategoriesLoading(false);
|
|
30525
30733
|
}
|
|
30526
30734
|
}, [fetchCategories, onError]);
|
|
30527
|
-
const openModal = (0,
|
|
30735
|
+
const openModal = (0, import_react104.useCallback)(
|
|
30528
30736
|
(model) => {
|
|
30529
30737
|
setSelectedModel(model);
|
|
30530
30738
|
setIsOpen(true);
|
|
@@ -30532,17 +30740,17 @@ function useSendActivity(config) {
|
|
|
30532
30740
|
},
|
|
30533
30741
|
[loadCategories]
|
|
30534
30742
|
);
|
|
30535
|
-
const closeModal = (0,
|
|
30743
|
+
const closeModal = (0, import_react104.useCallback)(() => {
|
|
30536
30744
|
setIsOpen(false);
|
|
30537
30745
|
setSelectedModel(null);
|
|
30538
30746
|
}, []);
|
|
30539
|
-
const onCategoriesChange = (0,
|
|
30747
|
+
const onCategoriesChange = (0, import_react104.useCallback)(
|
|
30540
30748
|
(updatedCategories) => {
|
|
30541
30749
|
setCategories(updatedCategories);
|
|
30542
30750
|
},
|
|
30543
30751
|
[]
|
|
30544
30752
|
);
|
|
30545
|
-
const handleSubmit = (0,
|
|
30753
|
+
const handleSubmit = (0, import_react104.useCallback)(
|
|
30546
30754
|
async (data) => {
|
|
30547
30755
|
if (!selectedModel) return;
|
|
30548
30756
|
setIsLoading(true);
|
|
@@ -30651,9 +30859,9 @@ function useSendActivity(config) {
|
|
|
30651
30859
|
CorrectActivityModal,
|
|
30652
30860
|
CreateActivity,
|
|
30653
30861
|
DEFAULT_ACTIVITIES_PAGINATION,
|
|
30654
|
-
DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
30655
|
-
DEFAULT_GOAL_MODELS_PAGINATION,
|
|
30656
30862
|
DEFAULT_MODELS_PAGINATION,
|
|
30863
|
+
DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION,
|
|
30864
|
+
DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION,
|
|
30657
30865
|
DIFFICULTY_LEVEL_ENUM,
|
|
30658
30866
|
DateTimeInput,
|
|
30659
30867
|
Divider,
|
|
@@ -30667,16 +30875,7 @@ function useSendActivity(config) {
|
|
|
30667
30875
|
EmptyState,
|
|
30668
30876
|
FileAttachment,
|
|
30669
30877
|
FilterModal,
|
|
30670
|
-
GOAL_ACTIVITY_STATUS,
|
|
30671
|
-
GOAL_FILTER_STATUS_OPTIONS,
|
|
30672
|
-
GOAL_STATUS_OPTIONS,
|
|
30673
30878
|
GeneralActivityStatus,
|
|
30674
|
-
GoalApiStatus,
|
|
30675
|
-
GoalBadgeActionType,
|
|
30676
|
-
GoalDisplayStatus,
|
|
30677
|
-
GoalDraftType,
|
|
30678
|
-
GoalDraftsTab,
|
|
30679
|
-
GoalPageTab,
|
|
30680
30879
|
IconButton,
|
|
30681
30880
|
IconRender,
|
|
30682
30881
|
IconRoundedButton,
|
|
@@ -30736,10 +30935,19 @@ function useSendActivity(config) {
|
|
|
30736
30935
|
QuizResultTitle,
|
|
30737
30936
|
QuizTitle,
|
|
30738
30937
|
QuizTrueOrFalse,
|
|
30938
|
+
RECOMMENDED_CLASS_ACTIVITY_STATUS,
|
|
30939
|
+
RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS,
|
|
30940
|
+
RECOMMENDED_CLASS_STATUS_OPTIONS,
|
|
30739
30941
|
Radio,
|
|
30740
30942
|
RadioGroup,
|
|
30741
30943
|
RadioGroupItem,
|
|
30742
30944
|
RankingCard,
|
|
30945
|
+
RecommendedClassApiStatus,
|
|
30946
|
+
RecommendedClassBadgeActionType,
|
|
30947
|
+
RecommendedClassDisplayStatus,
|
|
30948
|
+
RecommendedClassDraftType,
|
|
30949
|
+
RecommendedClassDraftsTab,
|
|
30950
|
+
RecommendedClassPageTab,
|
|
30743
30951
|
RecommendedLessonDetails,
|
|
30744
30952
|
RecommendedLessonsHistory,
|
|
30745
30953
|
STUDENT_ACTIVITY_STATUS,
|
|
@@ -30793,36 +31001,41 @@ function useSendActivity(config) {
|
|
|
30793
31001
|
activitiesHistoryApiResponseSchema,
|
|
30794
31002
|
activityModelsApiResponseSchema,
|
|
30795
31003
|
buildUserFilterData,
|
|
31004
|
+
calculatePerformancePercentage,
|
|
30796
31005
|
checkLessonAvailability,
|
|
30797
31006
|
cn,
|
|
30798
31007
|
convertActivityFiltersToQuestionsFilter,
|
|
30799
31008
|
createActivitiesHistoryHook,
|
|
30800
31009
|
createActivityFiltersDataHook,
|
|
30801
31010
|
createActivityModelsHook,
|
|
30802
|
-
createGoalDraftsHook,
|
|
30803
|
-
createGoalModelsHook,
|
|
30804
31011
|
createNotificationStore,
|
|
30805
31012
|
createNotificationsHook,
|
|
31013
|
+
createQuestionsDataHook,
|
|
30806
31014
|
createQuestionsListHook,
|
|
31015
|
+
createRecommendedClassDraftsHook,
|
|
31016
|
+
createRecommendedClassModelsHook,
|
|
30807
31017
|
createRecommendedLessonDetailsHook,
|
|
30808
31018
|
createRecommendedLessonsHistoryHook,
|
|
30809
31019
|
createRecommendedLessonsPageHook,
|
|
31020
|
+
createStudentsHighlightHook,
|
|
30810
31021
|
createUseActivitiesHistory,
|
|
30811
31022
|
createUseActivityFiltersData,
|
|
30812
31023
|
createUseActivityModels,
|
|
30813
31024
|
createUseChat,
|
|
30814
31025
|
createUseChatRooms,
|
|
30815
|
-
createUseGoalDrafts,
|
|
30816
|
-
createUseGoalModels,
|
|
30817
31026
|
createUseNotificationStore,
|
|
30818
31027
|
createUseNotifications,
|
|
31028
|
+
createUseQuestionsData,
|
|
30819
31029
|
createUseQuestionsList,
|
|
31030
|
+
createUseRecommendedClassDrafts,
|
|
31031
|
+
createUseRecommendedClassModels,
|
|
30820
31032
|
createUseRecommendedLessonDetails,
|
|
30821
31033
|
createUseRecommendedLessonsHistory,
|
|
30822
31034
|
createUseRecommendedLessonsPage,
|
|
31035
|
+
createUseStudentsHighlight,
|
|
30823
31036
|
createZustandAuthAdapter,
|
|
30824
31037
|
deriveStudentStatus,
|
|
30825
|
-
|
|
31038
|
+
determineRecommendedClassStatus,
|
|
30826
31039
|
formatDateToBrazilian,
|
|
30827
31040
|
formatDaysToComplete,
|
|
30828
31041
|
formatFileSize,
|
|
@@ -30837,8 +31050,8 @@ function useSendActivity(config) {
|
|
|
30837
31050
|
getChatWsUrl,
|
|
30838
31051
|
getClassOptionsFromUserData,
|
|
30839
31052
|
getDeviceType,
|
|
30840
|
-
getGoalStatusBadgeAction,
|
|
30841
31053
|
getQuestionStatusBadgeConfig,
|
|
31054
|
+
getRecommendedClassStatusBadgeAction,
|
|
30842
31055
|
getRootDomain,
|
|
30843
31056
|
getSchoolOptionsFromUserData,
|
|
30844
31057
|
getSchoolYearOptionsFromUserData,
|
|
@@ -30854,16 +31067,14 @@ function useSendActivity(config) {
|
|
|
30854
31067
|
getSubjectInfo,
|
|
30855
31068
|
getSubjectName,
|
|
30856
31069
|
getSubjectOptionsFromUserData,
|
|
30857
|
-
goalApiResponseSchema,
|
|
30858
|
-
goalDetailsApiResponseSchema,
|
|
30859
|
-
goalModelsApiResponseSchema,
|
|
30860
|
-
goalsHistoryApiResponseSchema,
|
|
30861
31070
|
handleActivityFetchError,
|
|
30862
|
-
handleGoalDraftFetchError,
|
|
30863
|
-
handleGoalFetchError,
|
|
30864
|
-
handleGoalModelFetchError,
|
|
30865
31071
|
handleLessonDetailsFetchError,
|
|
30866
31072
|
handleModelFetchError,
|
|
31073
|
+
handleQuestionsDataFetchError,
|
|
31074
|
+
handleRecommendedClassDraftFetchError,
|
|
31075
|
+
handleRecommendedClassFetchError,
|
|
31076
|
+
handleRecommendedClassModelFetchError,
|
|
31077
|
+
handleStudentsHighlightFetchError,
|
|
30867
31078
|
historyApiResponseSchema,
|
|
30868
31079
|
isChatUserInfoValid,
|
|
30869
31080
|
isDeadlinePassed,
|
|
@@ -30879,16 +31090,24 @@ function useSendActivity(config) {
|
|
|
30879
31090
|
mapSubjectEnumToName,
|
|
30880
31091
|
mapSubjectNameToEnum,
|
|
30881
31092
|
questionTypeLabels,
|
|
31093
|
+
questionsDataApiResponseSchema,
|
|
31094
|
+
recommendedClassApiResponseSchema,
|
|
31095
|
+
recommendedClassDetailsApiResponseSchema,
|
|
31096
|
+
recommendedClassHistoryApiResponseSchema,
|
|
31097
|
+
recommendedClassModelsApiResponseSchema,
|
|
30882
31098
|
renderSubjectCell,
|
|
30883
31099
|
studentActivityStatusSchema,
|
|
31100
|
+
studentsHighlightApiResponseSchema,
|
|
30884
31101
|
supportSchema,
|
|
30885
31102
|
syncDropdownState,
|
|
30886
31103
|
toggleArrayItem,
|
|
30887
31104
|
toggleSingleValue,
|
|
30888
31105
|
transformActivityToTableItem,
|
|
30889
|
-
transformGoalModelToTableItem,
|
|
30890
|
-
transformGoalToTableItem,
|
|
30891
31106
|
transformModelToTableItem,
|
|
31107
|
+
transformQuestionsData,
|
|
31108
|
+
transformRecommendedClassModelToTableItem,
|
|
31109
|
+
transformRecommendedClassToTableItem,
|
|
31110
|
+
transformStudentHighlightItem,
|
|
30892
31111
|
useActivityDetails,
|
|
30893
31112
|
useAlertFormStore,
|
|
30894
31113
|
useApiConfig,
|