analytica-frontend-lib 1.2.85 → 1.2.87
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/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/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/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/index.d.ts +14 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +359 -288
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +329 -262
- 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/lessonAvailability.d.ts +33 -0
- package/dist/types/lessonAvailability.d.ts.map +1 -0
- 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/dist/utils/lessonAvailabilityUtils.d.ts +45 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts.map +1 -0
- 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,21 +101,13 @@ __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,
|
|
117
108
|
ImageUpload: () => ImageUpload,
|
|
118
109
|
Input: () => Input_default,
|
|
110
|
+
LESSON_AVAILABILITY: () => LESSON_AVAILABILITY,
|
|
119
111
|
LatexRenderer: () => LatexRenderer_default,
|
|
120
112
|
LessonPreview: () => LessonPreview,
|
|
121
113
|
LoadingModal: () => loadingModal_default,
|
|
@@ -169,10 +161,19 @@ __export(src_exports, {
|
|
|
169
161
|
QuizResultTitle: () => QuizResultTitle,
|
|
170
162
|
QuizTitle: () => QuizTitle,
|
|
171
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,
|
|
172
167
|
Radio: () => Radio_default,
|
|
173
168
|
RadioGroup: () => RadioGroup,
|
|
174
169
|
RadioGroupItem: () => RadioGroupItem,
|
|
175
170
|
RankingCard: () => RankingCard,
|
|
171
|
+
RecommendedClassApiStatus: () => GenericApiStatus,
|
|
172
|
+
RecommendedClassBadgeActionType: () => BadgeActionType,
|
|
173
|
+
RecommendedClassDisplayStatus: () => GenericDisplayStatus,
|
|
174
|
+
RecommendedClassDraftType: () => RecommendedClassDraftType,
|
|
175
|
+
RecommendedClassDraftsTab: () => RecommendedClassDraftsTab,
|
|
176
|
+
RecommendedClassPageTab: () => RecommendedClassPageTab,
|
|
176
177
|
RecommendedLessonDetails: () => RecommendedLessonDetails_default,
|
|
177
178
|
RecommendedLessonsHistory: () => RecommendedLessonsHistory,
|
|
178
179
|
STUDENT_ACTIVITY_STATUS: () => STUDENT_ACTIVITY_STATUS,
|
|
@@ -226,16 +227,17 @@ __export(src_exports, {
|
|
|
226
227
|
activitiesHistoryApiResponseSchema: () => activitiesHistoryApiResponseSchema,
|
|
227
228
|
activityModelsApiResponseSchema: () => activityModelsApiResponseSchema,
|
|
228
229
|
buildUserFilterData: () => buildUserFilterData,
|
|
230
|
+
checkLessonAvailability: () => checkLessonAvailability,
|
|
229
231
|
cn: () => cn,
|
|
230
232
|
convertActivityFiltersToQuestionsFilter: () => convertActivityFiltersToQuestionsFilter,
|
|
231
233
|
createActivitiesHistoryHook: () => createActivitiesHistoryHook,
|
|
232
234
|
createActivityFiltersDataHook: () => createActivityFiltersDataHook,
|
|
233
235
|
createActivityModelsHook: () => createActivityModelsHook,
|
|
234
|
-
createGoalDraftsHook: () => createGoalDraftsHook,
|
|
235
|
-
createGoalModelsHook: () => createGoalModelsHook,
|
|
236
236
|
createNotificationStore: () => createNotificationStore,
|
|
237
237
|
createNotificationsHook: () => createNotificationsHook,
|
|
238
238
|
createQuestionsListHook: () => createQuestionsListHook,
|
|
239
|
+
createRecommendedClassDraftsHook: () => createRecommendedClassDraftsHook,
|
|
240
|
+
createRecommendedClassModelsHook: () => createRecommendedClassModelsHook,
|
|
239
241
|
createRecommendedLessonDetailsHook: () => createRecommendedLessonDetailsHook,
|
|
240
242
|
createRecommendedLessonsHistoryHook: () => createRecommendedLessonsHistoryHook,
|
|
241
243
|
createRecommendedLessonsPageHook: () => createRecommendedLessonsPageHook,
|
|
@@ -244,17 +246,17 @@ __export(src_exports, {
|
|
|
244
246
|
createUseActivityModels: () => createUseActivityModels,
|
|
245
247
|
createUseChat: () => createUseChat,
|
|
246
248
|
createUseChatRooms: () => createUseChatRooms,
|
|
247
|
-
createUseGoalDrafts: () => createUseGoalDrafts,
|
|
248
|
-
createUseGoalModels: () => createUseGoalModels,
|
|
249
249
|
createUseNotificationStore: () => createUseNotificationStore,
|
|
250
250
|
createUseNotifications: () => createUseNotifications,
|
|
251
251
|
createUseQuestionsList: () => createUseQuestionsList,
|
|
252
|
+
createUseRecommendedClassDrafts: () => createUseRecommendedClassDrafts,
|
|
253
|
+
createUseRecommendedClassModels: () => createUseRecommendedClassModels,
|
|
252
254
|
createUseRecommendedLessonDetails: () => createUseRecommendedLessonDetails,
|
|
253
255
|
createUseRecommendedLessonsHistory: () => createUseRecommendedLessonsHistory,
|
|
254
256
|
createUseRecommendedLessonsPage: () => createUseRecommendedLessonsPage,
|
|
255
257
|
createZustandAuthAdapter: () => createZustandAuthAdapter,
|
|
256
258
|
deriveStudentStatus: () => deriveStudentStatus,
|
|
257
|
-
|
|
259
|
+
determineRecommendedClassStatus: () => determineRecommendedClassStatus,
|
|
258
260
|
formatDateToBrazilian: () => formatDateToBrazilian,
|
|
259
261
|
formatDaysToComplete: () => formatDaysToComplete,
|
|
260
262
|
formatFileSize: () => formatFileSize,
|
|
@@ -269,8 +271,8 @@ __export(src_exports, {
|
|
|
269
271
|
getChatWsUrl: () => getChatWsUrl,
|
|
270
272
|
getClassOptionsFromUserData: () => getClassOptionsFromUserData,
|
|
271
273
|
getDeviceType: () => getDeviceType,
|
|
272
|
-
getGoalStatusBadgeAction: () => getGoalStatusBadgeAction,
|
|
273
274
|
getQuestionStatusBadgeConfig: () => getQuestionStatusBadgeConfig,
|
|
275
|
+
getRecommendedClassStatusBadgeAction: () => getRecommendedClassStatusBadgeAction,
|
|
274
276
|
getRootDomain: () => getRootDomain,
|
|
275
277
|
getSchoolOptionsFromUserData: () => getSchoolOptionsFromUserData,
|
|
276
278
|
getSchoolYearOptionsFromUserData: () => getSchoolYearOptionsFromUserData,
|
|
@@ -286,20 +288,18 @@ __export(src_exports, {
|
|
|
286
288
|
getSubjectInfo: () => getSubjectInfo,
|
|
287
289
|
getSubjectName: () => getSubjectName,
|
|
288
290
|
getSubjectOptionsFromUserData: () => getSubjectOptionsFromUserData,
|
|
289
|
-
goalApiResponseSchema: () => goalApiResponseSchema,
|
|
290
|
-
goalDetailsApiResponseSchema: () => goalDetailsApiResponseSchema,
|
|
291
|
-
goalModelsApiResponseSchema: () => goalModelsApiResponseSchema,
|
|
292
|
-
goalsHistoryApiResponseSchema: () => goalsHistoryApiResponseSchema,
|
|
293
291
|
handleActivityFetchError: () => handleActivityFetchError,
|
|
294
|
-
handleGoalDraftFetchError: () => handleGoalDraftFetchError,
|
|
295
|
-
handleGoalFetchError: () => handleGoalFetchError,
|
|
296
|
-
handleGoalModelFetchError: () => handleGoalModelFetchError,
|
|
297
292
|
handleLessonDetailsFetchError: () => handleLessonDetailsFetchError,
|
|
298
293
|
handleModelFetchError: () => handleModelFetchError,
|
|
294
|
+
handleRecommendedClassDraftFetchError: () => handleRecommendedClassDraftFetchError,
|
|
295
|
+
handleRecommendedClassFetchError: () => handleRecommendedClassFetchError,
|
|
296
|
+
handleRecommendedClassModelFetchError: () => handleRecommendedClassModelFetchError,
|
|
299
297
|
historyApiResponseSchema: () => historyApiResponseSchema,
|
|
300
298
|
isChatUserInfoValid: () => isChatUserInfoValid,
|
|
301
299
|
isDeadlinePassed: () => isDeadlinePassed,
|
|
302
300
|
isFormValid: () => isFormValid,
|
|
301
|
+
isLessonExpired: () => isLessonExpired,
|
|
302
|
+
isLessonNotYetAvailable: () => isLessonNotYetAvailable,
|
|
303
303
|
isStepValid: () => isStepValid,
|
|
304
304
|
mapActivityStatusToDisplay: () => mapActivityStatusToDisplay,
|
|
305
305
|
mapApiStatusToInternal: () => mapApiStatusToInternal,
|
|
@@ -309,6 +309,10 @@ __export(src_exports, {
|
|
|
309
309
|
mapSubjectEnumToName: () => mapSubjectEnumToName,
|
|
310
310
|
mapSubjectNameToEnum: () => mapSubjectNameToEnum,
|
|
311
311
|
questionTypeLabels: () => questionTypeLabels,
|
|
312
|
+
recommendedClassApiResponseSchema: () => recommendedClassApiResponseSchema,
|
|
313
|
+
recommendedClassDetailsApiResponseSchema: () => recommendedClassDetailsApiResponseSchema,
|
|
314
|
+
recommendedClassHistoryApiResponseSchema: () => recommendedClassHistoryApiResponseSchema,
|
|
315
|
+
recommendedClassModelsApiResponseSchema: () => recommendedClassModelsApiResponseSchema,
|
|
312
316
|
renderSubjectCell: () => renderSubjectCell,
|
|
313
317
|
studentActivityStatusSchema: () => studentActivityStatusSchema,
|
|
314
318
|
supportSchema: () => supportSchema,
|
|
@@ -316,9 +320,9 @@ __export(src_exports, {
|
|
|
316
320
|
toggleArrayItem: () => toggleArrayItem,
|
|
317
321
|
toggleSingleValue: () => toggleSingleValue,
|
|
318
322
|
transformActivityToTableItem: () => transformActivityToTableItem,
|
|
319
|
-
transformGoalModelToTableItem: () => transformGoalModelToTableItem,
|
|
320
|
-
transformGoalToTableItem: () => transformGoalToTableItem,
|
|
321
323
|
transformModelToTableItem: () => transformModelToTableItem,
|
|
324
|
+
transformRecommendedClassModelToTableItem: () => transformRecommendedClassModelToTableItem,
|
|
325
|
+
transformRecommendedClassToTableItem: () => transformRecommendedClassToTableItem,
|
|
322
326
|
useActivityDetails: () => useActivityDetails,
|
|
323
327
|
useAlertFormStore: () => useAlertFormStore,
|
|
324
328
|
useApiConfig: () => useApiConfig,
|
|
@@ -12970,7 +12974,7 @@ var import_middleware3 = require("zustand/middleware");
|
|
|
12970
12974
|
var NotificationEntityType = /* @__PURE__ */ ((NotificationEntityType2) => {
|
|
12971
12975
|
NotificationEntityType2["ACTIVITY"] = "ACTIVITY";
|
|
12972
12976
|
NotificationEntityType2["TRAIL"] = "TRAIL";
|
|
12973
|
-
NotificationEntityType2["
|
|
12977
|
+
NotificationEntityType2["RECOMMENDEDCLASS"] = "RECOMMENDEDCLASS";
|
|
12974
12978
|
return NotificationEntityType2;
|
|
12975
12979
|
})(NotificationEntityType || {});
|
|
12976
12980
|
|
|
@@ -12979,8 +12983,7 @@ var mapBackendNotification = (backendNotification) => {
|
|
|
12979
12983
|
let type = "GENERAL";
|
|
12980
12984
|
let entityType = null;
|
|
12981
12985
|
if (backendNotification.entityType) {
|
|
12982
|
-
|
|
12983
|
-
switch (backendEntityType) {
|
|
12986
|
+
switch (backendNotification.entityType.toUpperCase()) {
|
|
12984
12987
|
case "ACTIVITY" /* ACTIVITY */:
|
|
12985
12988
|
type = "ACTIVITY";
|
|
12986
12989
|
entityType = "ACTIVITY" /* ACTIVITY */;
|
|
@@ -12989,9 +12992,9 @@ var mapBackendNotification = (backendNotification) => {
|
|
|
12989
12992
|
type = "TRAIL";
|
|
12990
12993
|
entityType = "TRAIL" /* TRAIL */;
|
|
12991
12994
|
break;
|
|
12992
|
-
case "
|
|
12993
|
-
type = "
|
|
12994
|
-
entityType = "
|
|
12995
|
+
case "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */:
|
|
12996
|
+
type = "RECOMMENDEDCLASS";
|
|
12997
|
+
entityType = "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */;
|
|
12995
12998
|
break;
|
|
12996
12999
|
default:
|
|
12997
13000
|
break;
|
|
@@ -13008,7 +13011,7 @@ var mapBackendNotification = (backendNotification) => {
|
|
|
13008
13011
|
entityId: backendNotification.entityId,
|
|
13009
13012
|
sender: backendNotification.sender,
|
|
13010
13013
|
activity: backendNotification.activity,
|
|
13011
|
-
|
|
13014
|
+
recommendedClass: backendNotification.recommendedClass,
|
|
13012
13015
|
actionLink: backendNotification.actionLink ?? null
|
|
13013
13016
|
};
|
|
13014
13017
|
};
|
|
@@ -13384,7 +13387,7 @@ var NotificationList = ({
|
|
|
13384
13387
|
groupedNotifications.map((group, idx) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col", children: [
|
|
13385
13388
|
/* @__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 }) }),
|
|
13386
13389
|
group.notifications.map((notification) => {
|
|
13387
|
-
const isGlobalNotification = !notification.entityType && !notification.entityId && !notification.activity && !notification.
|
|
13390
|
+
const isGlobalNotification = !notification.entityType && !notification.entityId && !notification.activity && !notification.recommendedClass;
|
|
13388
13391
|
let navigationHandler;
|
|
13389
13392
|
if (isGlobalNotification) {
|
|
13390
13393
|
navigationHandler = () => handleGlobalNotificationClick(notification);
|
|
@@ -13922,7 +13925,8 @@ var createUseNotifications = (apiClient) => {
|
|
|
13922
13925
|
case "ACTIVITY" /* ACTIVITY */:
|
|
13923
13926
|
window.location.href = `/atividades/${entityId}`;
|
|
13924
13927
|
break;
|
|
13925
|
-
case "
|
|
13928
|
+
case "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */:
|
|
13929
|
+
case "RECOMMENDEDCLASS":
|
|
13926
13930
|
window.location.href = `/painel/trilhas/${entityId}`;
|
|
13927
13931
|
break;
|
|
13928
13932
|
default:
|
|
@@ -13939,7 +13943,8 @@ var createUseNotifications = (apiClient) => {
|
|
|
13939
13943
|
switch (entityType.toUpperCase()) {
|
|
13940
13944
|
case "ACTIVITY" /* ACTIVITY */:
|
|
13941
13945
|
return "Ver atividade";
|
|
13942
|
-
case "
|
|
13946
|
+
case "RECOMMENDEDCLASS" /* RECOMMENDEDCLASS */:
|
|
13947
|
+
case "RECOMMENDEDCLASS":
|
|
13943
13948
|
return "Ver meta";
|
|
13944
13949
|
default:
|
|
13945
13950
|
return void 0;
|
|
@@ -23480,6 +23485,53 @@ var LessonPreview = ({
|
|
|
23480
23485
|
] });
|
|
23481
23486
|
};
|
|
23482
23487
|
|
|
23488
|
+
// src/types/lessonAvailability.ts
|
|
23489
|
+
var LESSON_AVAILABILITY = {
|
|
23490
|
+
/** Lesson is available for access */
|
|
23491
|
+
DISPONIVEL: "DISPONIVEL",
|
|
23492
|
+
/** Lesson has not started yet (current date < startDate) */
|
|
23493
|
+
NAO_INICIADA: "NAO_INICIADA",
|
|
23494
|
+
/** Lesson has expired (current date > finalDate) */
|
|
23495
|
+
EXPIRADA: "EXPIRADA"
|
|
23496
|
+
};
|
|
23497
|
+
|
|
23498
|
+
// src/utils/lessonAvailabilityUtils.ts
|
|
23499
|
+
var isDateInPast = (dateString) => {
|
|
23500
|
+
const date = new Date(dateString);
|
|
23501
|
+
const now = /* @__PURE__ */ new Date();
|
|
23502
|
+
return now > date;
|
|
23503
|
+
};
|
|
23504
|
+
var isDateInFuture = (dateString) => {
|
|
23505
|
+
const date = new Date(dateString);
|
|
23506
|
+
const now = /* @__PURE__ */ new Date();
|
|
23507
|
+
return now < date;
|
|
23508
|
+
};
|
|
23509
|
+
var checkLessonAvailability = (startDate, finalDate) => {
|
|
23510
|
+
const start = startDate ? new Date(startDate) : null;
|
|
23511
|
+
const end = finalDate ? new Date(finalDate) : null;
|
|
23512
|
+
let status = LESSON_AVAILABILITY.DISPONIVEL;
|
|
23513
|
+
if (startDate && isDateInFuture(startDate)) {
|
|
23514
|
+
status = LESSON_AVAILABILITY.NAO_INICIADA;
|
|
23515
|
+
} else if (finalDate && isDateInPast(finalDate)) {
|
|
23516
|
+
status = LESSON_AVAILABILITY.EXPIRADA;
|
|
23517
|
+
}
|
|
23518
|
+
return {
|
|
23519
|
+
status,
|
|
23520
|
+
startDate: start,
|
|
23521
|
+
endDate: end,
|
|
23522
|
+
formattedStartDate: startDate ? formatDateToBrazilian(startDate) : null,
|
|
23523
|
+
formattedEndDate: finalDate ? formatDateToBrazilian(finalDate) : null
|
|
23524
|
+
};
|
|
23525
|
+
};
|
|
23526
|
+
var isLessonNotYetAvailable = (startDate) => {
|
|
23527
|
+
if (!startDate) return false;
|
|
23528
|
+
return isDateInFuture(startDate);
|
|
23529
|
+
};
|
|
23530
|
+
var isLessonExpired = (finalDate) => {
|
|
23531
|
+
if (!finalDate) return false;
|
|
23532
|
+
return isDateInPast(finalDate);
|
|
23533
|
+
};
|
|
23534
|
+
|
|
23483
23535
|
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
23484
23536
|
var import_react71 = require("react");
|
|
23485
23537
|
var import_phosphor_react48 = require("phosphor-react");
|
|
@@ -26230,12 +26282,12 @@ var import_react83 = require("react");
|
|
|
26230
26282
|
var import_phosphor_react52 = require("phosphor-react");
|
|
26231
26283
|
|
|
26232
26284
|
// src/types/recommendedLessons.ts
|
|
26233
|
-
var
|
|
26234
|
-
var
|
|
26285
|
+
var getRecommendedClassStatusBadgeAction = (status) => getStatusBadgeAction(status);
|
|
26286
|
+
var RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS = [
|
|
26235
26287
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
26236
26288
|
{ id: "A_VENCER" /* A_VENCER */, name: "Ativa" }
|
|
26237
26289
|
];
|
|
26238
|
-
var
|
|
26290
|
+
var RECOMMENDED_CLASS_STATUS_OPTIONS = [
|
|
26239
26291
|
{ id: "A_VENCER" /* A_VENCER */, name: "A Vencer" },
|
|
26240
26292
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
26241
26293
|
{ id: "CONCLUIDA" /* CONCLUIDA */, name: "Conclu\xEDda" }
|
|
@@ -26275,35 +26327,35 @@ var formatDaysToComplete = (daysToComplete) => {
|
|
|
26275
26327
|
if (daysToComplete === 1) return "1 dia";
|
|
26276
26328
|
return `${daysToComplete} dias`;
|
|
26277
26329
|
};
|
|
26278
|
-
var
|
|
26330
|
+
var RECOMMENDED_CLASS_ACTIVITY_STATUS = {
|
|
26279
26331
|
PENDENTE: "PENDENTE",
|
|
26280
26332
|
CONCLUIDA: "CONCLUIDA",
|
|
26281
26333
|
EXPIRADA: "EXPIRADA"
|
|
26282
26334
|
};
|
|
26283
|
-
var
|
|
26284
|
-
|
|
26285
|
-
|
|
26286
|
-
return
|
|
26287
|
-
})(
|
|
26335
|
+
var RecommendedClassDraftType = /* @__PURE__ */ ((RecommendedClassDraftType2) => {
|
|
26336
|
+
RecommendedClassDraftType2["MODELO"] = "MODELO";
|
|
26337
|
+
RecommendedClassDraftType2["RASCUNHO"] = "RASCUNHO";
|
|
26338
|
+
return RecommendedClassDraftType2;
|
|
26339
|
+
})(RecommendedClassDraftType || {});
|
|
26288
26340
|
|
|
26289
26341
|
// src/hooks/useRecommendedLessons.ts
|
|
26290
26342
|
var import_react79 = require("react");
|
|
26291
26343
|
var import_zod5 = require("zod");
|
|
26292
26344
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
26293
|
-
var
|
|
26345
|
+
var recommendedClassSubjectSchema = import_zod5.z.object({
|
|
26294
26346
|
id: import_zod5.z.string().uuid(),
|
|
26295
26347
|
name: import_zod5.z.string()
|
|
26296
26348
|
}).nullable();
|
|
26297
|
-
var
|
|
26349
|
+
var recommendedClassCreatorSchema = import_zod5.z.object({
|
|
26298
26350
|
id: import_zod5.z.string().uuid(),
|
|
26299
26351
|
name: import_zod5.z.string()
|
|
26300
26352
|
}).nullable();
|
|
26301
|
-
var
|
|
26353
|
+
var recommendedClassStatsSchema = import_zod5.z.object({
|
|
26302
26354
|
totalStudents: import_zod5.z.number(),
|
|
26303
26355
|
completedCount: import_zod5.z.number(),
|
|
26304
26356
|
completionPercentage: import_zod5.z.number()
|
|
26305
26357
|
});
|
|
26306
|
-
var
|
|
26358
|
+
var recommendedClassBreakdownSchema = import_zod5.z.object({
|
|
26307
26359
|
classId: import_zod5.z.string().uuid(),
|
|
26308
26360
|
className: import_zod5.z.string(),
|
|
26309
26361
|
schoolId: import_zod5.z.string(),
|
|
@@ -26311,7 +26363,7 @@ var goalBreakdownSchema = import_zod5.z.object({
|
|
|
26311
26363
|
studentCount: import_zod5.z.number(),
|
|
26312
26364
|
completedCount: import_zod5.z.number()
|
|
26313
26365
|
});
|
|
26314
|
-
var
|
|
26366
|
+
var recommendedClassDataSchema = import_zod5.z.object({
|
|
26315
26367
|
id: import_zod5.z.string().uuid(),
|
|
26316
26368
|
title: import_zod5.z.string(),
|
|
26317
26369
|
startDate: import_zod5.z.string().nullable(),
|
|
@@ -26320,21 +26372,21 @@ var goalDataSchema = import_zod5.z.object({
|
|
|
26320
26372
|
progress: import_zod5.z.number(),
|
|
26321
26373
|
totalLessons: import_zod5.z.number()
|
|
26322
26374
|
});
|
|
26323
|
-
var
|
|
26324
|
-
|
|
26325
|
-
subject:
|
|
26326
|
-
creator:
|
|
26327
|
-
stats:
|
|
26328
|
-
breakdown: import_zod5.z.array(
|
|
26375
|
+
var recommendedClassHistoryItemSchema = import_zod5.z.object({
|
|
26376
|
+
recommendedClass: recommendedClassDataSchema,
|
|
26377
|
+
subject: recommendedClassSubjectSchema,
|
|
26378
|
+
creator: recommendedClassCreatorSchema,
|
|
26379
|
+
stats: recommendedClassStatsSchema,
|
|
26380
|
+
breakdown: import_zod5.z.array(recommendedClassBreakdownSchema)
|
|
26329
26381
|
});
|
|
26330
|
-
var
|
|
26382
|
+
var recommendedClassHistoryApiResponseSchema = import_zod5.z.object({
|
|
26331
26383
|
message: import_zod5.z.string(),
|
|
26332
26384
|
data: import_zod5.z.object({
|
|
26333
|
-
|
|
26385
|
+
recommendedClass: import_zod5.z.array(recommendedClassHistoryItemSchema),
|
|
26334
26386
|
total: import_zod5.z.number()
|
|
26335
26387
|
})
|
|
26336
26388
|
});
|
|
26337
|
-
var
|
|
26389
|
+
var determineRecommendedClassStatus = (finalDate, completionPercentage) => {
|
|
26338
26390
|
if (completionPercentage === 100) {
|
|
26339
26391
|
return "CONCLU\xCDDA" /* CONCLUIDA */;
|
|
26340
26392
|
}
|
|
@@ -26347,29 +26399,29 @@ var determineGoalStatus = (finalDate, completionPercentage) => {
|
|
|
26347
26399
|
}
|
|
26348
26400
|
return "ATIVA" /* ATIVA */;
|
|
26349
26401
|
};
|
|
26350
|
-
var
|
|
26402
|
+
var transformRecommendedClassToTableItem = (item) => {
|
|
26351
26403
|
const firstBreakdown = item.breakdown[0];
|
|
26352
26404
|
const schoolName = firstBreakdown?.schoolName || "-";
|
|
26353
26405
|
const className = firstBreakdown?.className || "-";
|
|
26354
26406
|
const classDisplay = item.breakdown.length > 1 ? `${item.breakdown.length} turmas` : className;
|
|
26355
26407
|
return {
|
|
26356
|
-
id: item.
|
|
26357
|
-
startDate: item.
|
|
26358
|
-
deadline: item.
|
|
26359
|
-
title: item.
|
|
26408
|
+
id: item.recommendedClass.id,
|
|
26409
|
+
startDate: item.recommendedClass.startDate ? (0, import_dayjs4.default)(item.recommendedClass.startDate).format("DD/MM") : "-",
|
|
26410
|
+
deadline: item.recommendedClass.finalDate ? (0, import_dayjs4.default)(item.recommendedClass.finalDate).format("DD/MM") : "-",
|
|
26411
|
+
title: item.recommendedClass.title,
|
|
26360
26412
|
school: schoolName,
|
|
26361
26413
|
year: "-",
|
|
26362
26414
|
// API doesn't provide year directly
|
|
26363
26415
|
subject: item.subject?.name || "-",
|
|
26364
26416
|
class: classDisplay,
|
|
26365
|
-
status:
|
|
26366
|
-
item.
|
|
26417
|
+
status: determineRecommendedClassStatus(
|
|
26418
|
+
item.recommendedClass.finalDate,
|
|
26367
26419
|
item.stats.completionPercentage
|
|
26368
26420
|
),
|
|
26369
26421
|
completionPercentage: item.stats.completionPercentage
|
|
26370
26422
|
};
|
|
26371
26423
|
};
|
|
26372
|
-
var
|
|
26424
|
+
var handleRecommendedClassFetchError = (error) => {
|
|
26373
26425
|
if (error instanceof import_zod5.z.ZodError) {
|
|
26374
26426
|
console.error("Erro ao validar dados de hist\xF3rico de aulas:", error);
|
|
26375
26427
|
return "Erro ao validar dados de hist\xF3rico de aulas";
|
|
@@ -26377,10 +26429,10 @@ var handleGoalFetchError = (error) => {
|
|
|
26377
26429
|
console.error("Erro ao carregar hist\xF3rico de aulas:", error);
|
|
26378
26430
|
return "Erro ao carregar hist\xF3rico de aulas";
|
|
26379
26431
|
};
|
|
26380
|
-
var createUseRecommendedLessonsHistory = (
|
|
26432
|
+
var createUseRecommendedLessonsHistory = (fetchRecommendedClassHistory) => {
|
|
26381
26433
|
return () => {
|
|
26382
26434
|
const [state, setState] = (0, import_react79.useState)({
|
|
26383
|
-
|
|
26435
|
+
recommendedClass: [],
|
|
26384
26436
|
loading: false,
|
|
26385
26437
|
error: null,
|
|
26386
26438
|
pagination: {
|
|
@@ -26390,21 +26442,21 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
26390
26442
|
totalPages: 0
|
|
26391
26443
|
}
|
|
26392
26444
|
});
|
|
26393
|
-
const
|
|
26445
|
+
const fetchRecommendedClass = (0, import_react79.useCallback)(
|
|
26394
26446
|
async (filters) => {
|
|
26395
26447
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26396
26448
|
try {
|
|
26397
|
-
const responseData = await
|
|
26398
|
-
const validatedData =
|
|
26399
|
-
const tableItems = validatedData.data.
|
|
26400
|
-
|
|
26449
|
+
const responseData = await fetchRecommendedClassHistory(filters);
|
|
26450
|
+
const validatedData = recommendedClassHistoryApiResponseSchema.parse(responseData);
|
|
26451
|
+
const tableItems = validatedData.data.recommendedClass.map(
|
|
26452
|
+
transformRecommendedClassToTableItem
|
|
26401
26453
|
);
|
|
26402
26454
|
const page = filters?.page || 1;
|
|
26403
26455
|
const limit = filters?.limit || 10;
|
|
26404
26456
|
const total = validatedData.data.total;
|
|
26405
26457
|
const totalPages = Math.ceil(total / limit);
|
|
26406
26458
|
setState({
|
|
26407
|
-
|
|
26459
|
+
recommendedClass: tableItems,
|
|
26408
26460
|
loading: false,
|
|
26409
26461
|
error: null,
|
|
26410
26462
|
pagination: {
|
|
@@ -26415,7 +26467,7 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
26415
26467
|
}
|
|
26416
26468
|
});
|
|
26417
26469
|
} catch (error) {
|
|
26418
|
-
const errorMessage =
|
|
26470
|
+
const errorMessage = handleRecommendedClassFetchError(error);
|
|
26419
26471
|
setState((prev) => ({
|
|
26420
26472
|
...prev,
|
|
26421
26473
|
loading: false,
|
|
@@ -26423,11 +26475,11 @@ var createUseRecommendedLessonsHistory = (fetchGoalsHistory) => {
|
|
|
26423
26475
|
}));
|
|
26424
26476
|
}
|
|
26425
26477
|
},
|
|
26426
|
-
[
|
|
26478
|
+
[fetchRecommendedClassHistory]
|
|
26427
26479
|
);
|
|
26428
26480
|
return {
|
|
26429
26481
|
...state,
|
|
26430
|
-
|
|
26482
|
+
fetchRecommendedClass
|
|
26431
26483
|
};
|
|
26432
26484
|
};
|
|
26433
26485
|
};
|
|
@@ -26628,7 +26680,7 @@ var getSubjectOptions = (data) => {
|
|
|
26628
26680
|
name: subject.name
|
|
26629
26681
|
}));
|
|
26630
26682
|
};
|
|
26631
|
-
var
|
|
26683
|
+
var createRecommendedClassModelsFiltersConfig = (userData) => [
|
|
26632
26684
|
{
|
|
26633
26685
|
key: "content",
|
|
26634
26686
|
label: "CONTE\xDADO",
|
|
@@ -26644,7 +26696,7 @@ var createGoalModelsFiltersConfig = (userData) => [
|
|
|
26644
26696
|
];
|
|
26645
26697
|
|
|
26646
26698
|
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
26647
|
-
var
|
|
26699
|
+
var buildRecommendedClassModelsFiltersFromParams = (params) => {
|
|
26648
26700
|
const filters = {
|
|
26649
26701
|
page: params.page,
|
|
26650
26702
|
limit: params.limit
|
|
@@ -26658,7 +26710,7 @@ var buildGoalModelsFiltersFromParams = (params) => {
|
|
|
26658
26710
|
return filters;
|
|
26659
26711
|
};
|
|
26660
26712
|
|
|
26661
|
-
// src/hooks/
|
|
26713
|
+
// src/hooks/useRecommendedClassModels.ts
|
|
26662
26714
|
var import_react81 = require("react");
|
|
26663
26715
|
var import_zod7 = require("zod");
|
|
26664
26716
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
@@ -26674,10 +26726,10 @@ var createFetchErrorHandler = (validationErrorMessage, genericErrorMessage) => (
|
|
|
26674
26726
|
return genericErrorMessage;
|
|
26675
26727
|
};
|
|
26676
26728
|
|
|
26677
|
-
// src/hooks/
|
|
26678
|
-
var
|
|
26729
|
+
// src/hooks/useRecommendedClassModels.ts
|
|
26730
|
+
var recommendedClassModelResponseSchema = import_zod7.z.object({
|
|
26679
26731
|
id: import_zod7.z.string().uuid(),
|
|
26680
|
-
type: import_zod7.z.nativeEnum(
|
|
26732
|
+
type: import_zod7.z.nativeEnum(RecommendedClassDraftType),
|
|
26681
26733
|
title: import_zod7.z.string(),
|
|
26682
26734
|
description: import_zod7.z.string().nullable(),
|
|
26683
26735
|
creatorUserInstitutionId: import_zod7.z.string().uuid(),
|
|
@@ -26687,20 +26739,20 @@ var goalModelResponseSchema = import_zod7.z.object({
|
|
|
26687
26739
|
createdAt: import_zod7.z.string(),
|
|
26688
26740
|
updatedAt: import_zod7.z.string()
|
|
26689
26741
|
});
|
|
26690
|
-
var
|
|
26742
|
+
var recommendedClassModelsApiResponseSchema = import_zod7.z.object({
|
|
26691
26743
|
message: import_zod7.z.string(),
|
|
26692
26744
|
data: import_zod7.z.object({
|
|
26693
|
-
drafts: import_zod7.z.array(
|
|
26745
|
+
drafts: import_zod7.z.array(recommendedClassModelResponseSchema),
|
|
26694
26746
|
total: import_zod7.z.number()
|
|
26695
26747
|
})
|
|
26696
26748
|
});
|
|
26697
|
-
var
|
|
26749
|
+
var DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION = {
|
|
26698
26750
|
total: 0,
|
|
26699
26751
|
page: 1,
|
|
26700
26752
|
limit: 10,
|
|
26701
26753
|
totalPages: 0
|
|
26702
26754
|
};
|
|
26703
|
-
var
|
|
26755
|
+
var transformRecommendedClassModelToTableItem = (model, subjectsMap) => {
|
|
26704
26756
|
const subjectName = model.subjectId ? subjectsMap?.get(model.subjectId) || "" : "";
|
|
26705
26757
|
return {
|
|
26706
26758
|
id: model.id,
|
|
@@ -26710,26 +26762,26 @@ var transformGoalModelToTableItem = (model, subjectsMap) => {
|
|
|
26710
26762
|
subjectId: model.subjectId
|
|
26711
26763
|
};
|
|
26712
26764
|
};
|
|
26713
|
-
var
|
|
26765
|
+
var handleRecommendedClassModelFetchError = createFetchErrorHandler(
|
|
26714
26766
|
"Erro ao validar dados de modelos de aulas",
|
|
26715
26767
|
"Erro ao carregar modelos de aulas"
|
|
26716
26768
|
);
|
|
26717
|
-
var
|
|
26769
|
+
var createUseRecommendedClassModels = (fetchRecommendedClassModels, deleteRecommendedClassModel) => {
|
|
26718
26770
|
return () => {
|
|
26719
26771
|
const [state, setState] = (0, import_react81.useState)({
|
|
26720
26772
|
models: [],
|
|
26721
26773
|
loading: false,
|
|
26722
26774
|
error: null,
|
|
26723
|
-
pagination:
|
|
26775
|
+
pagination: DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION
|
|
26724
26776
|
});
|
|
26725
26777
|
const fetchModels = (0, import_react81.useCallback)(
|
|
26726
26778
|
async (filters, subjectsMap) => {
|
|
26727
26779
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26728
26780
|
try {
|
|
26729
|
-
const responseData = await
|
|
26730
|
-
const validatedData =
|
|
26781
|
+
const responseData = await fetchRecommendedClassModels(filters);
|
|
26782
|
+
const validatedData = recommendedClassModelsApiResponseSchema.parse(responseData);
|
|
26731
26783
|
const tableItems = validatedData.data.drafts.map(
|
|
26732
|
-
(model) =>
|
|
26784
|
+
(model) => transformRecommendedClassModelToTableItem(model, subjectsMap)
|
|
26733
26785
|
);
|
|
26734
26786
|
const limit = filters?.limit || 10;
|
|
26735
26787
|
const page = filters?.page || 1;
|
|
@@ -26747,7 +26799,7 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
26747
26799
|
}
|
|
26748
26800
|
});
|
|
26749
26801
|
} catch (error) {
|
|
26750
|
-
const errorMessage =
|
|
26802
|
+
const errorMessage = handleRecommendedClassModelFetchError(error);
|
|
26751
26803
|
setState((prev) => ({
|
|
26752
26804
|
...prev,
|
|
26753
26805
|
loading: false,
|
|
@@ -26755,19 +26807,19 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
26755
26807
|
}));
|
|
26756
26808
|
}
|
|
26757
26809
|
},
|
|
26758
|
-
[
|
|
26810
|
+
[fetchRecommendedClassModels]
|
|
26759
26811
|
);
|
|
26760
26812
|
const deleteModel = (0, import_react81.useCallback)(
|
|
26761
26813
|
async (id) => {
|
|
26762
26814
|
try {
|
|
26763
|
-
await
|
|
26815
|
+
await deleteRecommendedClassModel(id);
|
|
26764
26816
|
return true;
|
|
26765
26817
|
} catch (error) {
|
|
26766
26818
|
console.error("Erro ao deletar modelo:", error);
|
|
26767
26819
|
return false;
|
|
26768
26820
|
}
|
|
26769
26821
|
},
|
|
26770
|
-
[
|
|
26822
|
+
[deleteRecommendedClassModel]
|
|
26771
26823
|
);
|
|
26772
26824
|
return {
|
|
26773
26825
|
...state,
|
|
@@ -26776,27 +26828,27 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
26776
26828
|
};
|
|
26777
26829
|
};
|
|
26778
26830
|
};
|
|
26779
|
-
var
|
|
26831
|
+
var createRecommendedClassModelsHook = createUseRecommendedClassModels;
|
|
26780
26832
|
|
|
26781
26833
|
// src/components/RecommendedLessonsHistory/tabs/ModelsTab.tsx
|
|
26782
26834
|
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
26783
|
-
var
|
|
26835
|
+
var RECOMMENDED_CLASS_MODELS_CONFIG = {
|
|
26784
26836
|
entityName: "aula",
|
|
26785
26837
|
entityNamePlural: "aulas",
|
|
26786
|
-
testId: "
|
|
26838
|
+
testId: "recommendedClass-models-tab",
|
|
26787
26839
|
emptyStateTitle: "Crie modelos para agilizar suas aulas",
|
|
26788
26840
|
emptyStateDescription: "Salve modelos de aulas recomendadas para reutilizar e enviar rapidamente para suas turmas!",
|
|
26789
26841
|
searchPlaceholder: "Buscar modelo"
|
|
26790
26842
|
};
|
|
26791
|
-
var
|
|
26843
|
+
var RECOMMENDED_CLASS_COLUMNS_CONFIG = {
|
|
26792
26844
|
sendButtonLabel: "Enviar aula",
|
|
26793
26845
|
sendButtonAriaLabel: "Enviar aula",
|
|
26794
26846
|
deleteButtonAriaLabel: "Deletar modelo",
|
|
26795
26847
|
editButtonAriaLabel: "Editar modelo"
|
|
26796
26848
|
};
|
|
26797
|
-
var
|
|
26798
|
-
|
|
26799
|
-
|
|
26849
|
+
var RecommendedClassModelsTab = ({
|
|
26850
|
+
fetchRecommendedClassModels,
|
|
26851
|
+
deleteRecommendedClassModel,
|
|
26800
26852
|
onCreateModel,
|
|
26801
26853
|
onSendLesson,
|
|
26802
26854
|
onEditModel,
|
|
@@ -26808,8 +26860,8 @@ var GoalModelsTab = ({
|
|
|
26808
26860
|
}) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
26809
26861
|
ModelsTabBase,
|
|
26810
26862
|
{
|
|
26811
|
-
fetchModels:
|
|
26812
|
-
deleteModel:
|
|
26863
|
+
fetchModels: fetchRecommendedClassModels,
|
|
26864
|
+
deleteModel: deleteRecommendedClassModel,
|
|
26813
26865
|
onCreateModel,
|
|
26814
26866
|
onSend: onSendLesson,
|
|
26815
26867
|
onEditModel,
|
|
@@ -26818,17 +26870,17 @@ var GoalModelsTab = ({
|
|
|
26818
26870
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26819
26871
|
userFilterData,
|
|
26820
26872
|
subjectsMap,
|
|
26821
|
-
config:
|
|
26873
|
+
config: RECOMMENDED_CLASS_MODELS_CONFIG,
|
|
26822
26874
|
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
26823
26875
|
mapSubject,
|
|
26824
26876
|
send,
|
|
26825
26877
|
edit,
|
|
26826
26878
|
del,
|
|
26827
|
-
|
|
26879
|
+
RECOMMENDED_CLASS_COLUMNS_CONFIG
|
|
26828
26880
|
),
|
|
26829
|
-
createFiltersConfig:
|
|
26830
|
-
buildFiltersFromParams:
|
|
26831
|
-
createUseModels:
|
|
26881
|
+
createFiltersConfig: createRecommendedClassModelsFiltersConfig,
|
|
26882
|
+
buildFiltersFromParams: buildRecommendedClassModelsFiltersFromParams,
|
|
26883
|
+
createUseModels: createUseRecommendedClassModels
|
|
26832
26884
|
}
|
|
26833
26885
|
);
|
|
26834
26886
|
|
|
@@ -26840,7 +26892,7 @@ var getSubjectOptions2 = (data) => {
|
|
|
26840
26892
|
name: subject.name
|
|
26841
26893
|
}));
|
|
26842
26894
|
};
|
|
26843
|
-
var
|
|
26895
|
+
var createRecommendedClassDraftsFiltersConfig = (userData) => [
|
|
26844
26896
|
{
|
|
26845
26897
|
key: "content",
|
|
26846
26898
|
label: "CONTE\xDADO",
|
|
@@ -26855,34 +26907,34 @@ var createGoalDraftsFiltersConfig = (userData) => [
|
|
|
26855
26907
|
}
|
|
26856
26908
|
];
|
|
26857
26909
|
|
|
26858
|
-
// src/hooks/
|
|
26910
|
+
// src/hooks/useRecommendedClassDrafts.ts
|
|
26859
26911
|
var import_react82 = require("react");
|
|
26860
|
-
var
|
|
26912
|
+
var DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION = {
|
|
26861
26913
|
total: 0,
|
|
26862
26914
|
page: 1,
|
|
26863
26915
|
limit: 10,
|
|
26864
26916
|
totalPages: 0
|
|
26865
26917
|
};
|
|
26866
|
-
var
|
|
26918
|
+
var handleRecommendedClassDraftFetchError = createFetchErrorHandler(
|
|
26867
26919
|
"Erro ao validar dados de rascunhos de aulas",
|
|
26868
26920
|
"Erro ao carregar rascunhos de aulas"
|
|
26869
26921
|
);
|
|
26870
|
-
var
|
|
26922
|
+
var createUseRecommendedClassDrafts = (fetchRecommendedClassDrafts, deleteRecommendedClassDraft) => {
|
|
26871
26923
|
return () => {
|
|
26872
26924
|
const [state, setState] = (0, import_react82.useState)({
|
|
26873
26925
|
models: [],
|
|
26874
26926
|
loading: false,
|
|
26875
26927
|
error: null,
|
|
26876
|
-
pagination:
|
|
26928
|
+
pagination: DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION
|
|
26877
26929
|
});
|
|
26878
26930
|
const fetchModels = (0, import_react82.useCallback)(
|
|
26879
26931
|
async (filters, subjectsMap) => {
|
|
26880
26932
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26881
26933
|
try {
|
|
26882
|
-
const responseData = await
|
|
26883
|
-
const validatedData =
|
|
26934
|
+
const responseData = await fetchRecommendedClassDrafts(filters);
|
|
26935
|
+
const validatedData = recommendedClassModelsApiResponseSchema.parse(responseData);
|
|
26884
26936
|
const tableItems = validatedData.data.drafts.map(
|
|
26885
|
-
(draft) =>
|
|
26937
|
+
(draft) => transformRecommendedClassModelToTableItem(draft, subjectsMap)
|
|
26886
26938
|
);
|
|
26887
26939
|
const limit = filters?.limit || 10;
|
|
26888
26940
|
const page = filters?.page || 1;
|
|
@@ -26900,7 +26952,7 @@ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
|
26900
26952
|
}
|
|
26901
26953
|
});
|
|
26902
26954
|
} catch (error) {
|
|
26903
|
-
const errorMessage =
|
|
26955
|
+
const errorMessage = handleRecommendedClassDraftFetchError(error);
|
|
26904
26956
|
setState((prev) => ({
|
|
26905
26957
|
...prev,
|
|
26906
26958
|
loading: false,
|
|
@@ -26908,19 +26960,19 @@ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
|
26908
26960
|
}));
|
|
26909
26961
|
}
|
|
26910
26962
|
},
|
|
26911
|
-
[
|
|
26963
|
+
[fetchRecommendedClassDrafts]
|
|
26912
26964
|
);
|
|
26913
26965
|
const deleteModel = (0, import_react82.useCallback)(
|
|
26914
26966
|
async (id) => {
|
|
26915
26967
|
try {
|
|
26916
|
-
await
|
|
26968
|
+
await deleteRecommendedClassDraft(id);
|
|
26917
26969
|
return true;
|
|
26918
26970
|
} catch (error) {
|
|
26919
26971
|
console.error("Erro ao deletar rascunho:", error);
|
|
26920
26972
|
return false;
|
|
26921
26973
|
}
|
|
26922
26974
|
},
|
|
26923
|
-
[
|
|
26975
|
+
[deleteRecommendedClassDraft]
|
|
26924
26976
|
);
|
|
26925
26977
|
return {
|
|
26926
26978
|
...state,
|
|
@@ -26929,27 +26981,27 @@ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
|
26929
26981
|
};
|
|
26930
26982
|
};
|
|
26931
26983
|
};
|
|
26932
|
-
var
|
|
26984
|
+
var createRecommendedClassDraftsHook = createUseRecommendedClassDrafts;
|
|
26933
26985
|
|
|
26934
26986
|
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
26935
26987
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
26936
|
-
var
|
|
26988
|
+
var RECOMMENDED_CLASS_DRAFTS_CONFIG = {
|
|
26937
26989
|
entityName: "rascunho",
|
|
26938
26990
|
entityNamePlural: "rascunhos",
|
|
26939
|
-
testId: "
|
|
26991
|
+
testId: "recommendedClass-drafts-tab",
|
|
26940
26992
|
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
26941
26993
|
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!",
|
|
26942
26994
|
searchPlaceholder: "Buscar rascunho"
|
|
26943
26995
|
};
|
|
26944
|
-
var
|
|
26996
|
+
var RECOMMENDED_CLASS_DRAFTS_COLUMNS_CONFIG = {
|
|
26945
26997
|
sendButtonLabel: "Enviar aula",
|
|
26946
26998
|
sendButtonAriaLabel: "Enviar rascunho",
|
|
26947
26999
|
deleteButtonAriaLabel: "Deletar rascunho",
|
|
26948
27000
|
editButtonAriaLabel: "Editar rascunho"
|
|
26949
27001
|
};
|
|
26950
|
-
var
|
|
26951
|
-
|
|
26952
|
-
|
|
27002
|
+
var RecommendedClassDraftsTab = ({
|
|
27003
|
+
fetchRecommendedClassDrafts,
|
|
27004
|
+
deleteRecommendedClassDraft,
|
|
26953
27005
|
onCreateDraft,
|
|
26954
27006
|
onSendDraft,
|
|
26955
27007
|
onEditDraft,
|
|
@@ -26961,8 +27013,8 @@ var GoalDraftsTab = ({
|
|
|
26961
27013
|
}) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
26962
27014
|
ModelsTabBase,
|
|
26963
27015
|
{
|
|
26964
|
-
fetchModels:
|
|
26965
|
-
deleteModel:
|
|
27016
|
+
fetchModels: fetchRecommendedClassDrafts,
|
|
27017
|
+
deleteModel: deleteRecommendedClassDraft,
|
|
26966
27018
|
onCreateModel: onCreateDraft,
|
|
26967
27019
|
onSend: onSendDraft,
|
|
26968
27020
|
onEditModel: onEditDraft,
|
|
@@ -26971,28 +27023,28 @@ var GoalDraftsTab = ({
|
|
|
26971
27023
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26972
27024
|
userFilterData,
|
|
26973
27025
|
subjectsMap,
|
|
26974
|
-
config:
|
|
27026
|
+
config: RECOMMENDED_CLASS_DRAFTS_CONFIG,
|
|
26975
27027
|
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
26976
27028
|
mapSubject,
|
|
26977
27029
|
send,
|
|
26978
27030
|
edit,
|
|
26979
27031
|
del,
|
|
26980
|
-
|
|
27032
|
+
RECOMMENDED_CLASS_DRAFTS_COLUMNS_CONFIG
|
|
26981
27033
|
),
|
|
26982
|
-
createFiltersConfig:
|
|
26983
|
-
buildFiltersFromParams:
|
|
26984
|
-
createUseModels:
|
|
27034
|
+
createFiltersConfig: createRecommendedClassDraftsFiltersConfig,
|
|
27035
|
+
buildFiltersFromParams: buildRecommendedClassModelsFiltersFromParams,
|
|
27036
|
+
createUseModels: createUseRecommendedClassDrafts
|
|
26985
27037
|
}
|
|
26986
27038
|
);
|
|
26987
27039
|
|
|
26988
27040
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
26989
27041
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
26990
|
-
var
|
|
26991
|
-
|
|
26992
|
-
|
|
26993
|
-
|
|
26994
|
-
return
|
|
26995
|
-
})(
|
|
27042
|
+
var RecommendedClassPageTab = /* @__PURE__ */ ((RecommendedClassPageTab2) => {
|
|
27043
|
+
RecommendedClassPageTab2["HISTORY"] = "history";
|
|
27044
|
+
RecommendedClassPageTab2["DRAFTS"] = "drafts";
|
|
27045
|
+
RecommendedClassPageTab2["MODELS"] = "models";
|
|
27046
|
+
return RecommendedClassPageTab2;
|
|
27047
|
+
})(RecommendedClassPageTab || {});
|
|
26996
27048
|
var extractFilterValue = (param) => {
|
|
26997
27049
|
if (!Array.isArray(param) || param.length === 0) return {};
|
|
26998
27050
|
return param.length === 1 ? { single: param[0] } : { multiple: param };
|
|
@@ -27053,7 +27105,7 @@ var getClassOptions = (data) => {
|
|
|
27053
27105
|
name: cls.name
|
|
27054
27106
|
}));
|
|
27055
27107
|
};
|
|
27056
|
-
var
|
|
27108
|
+
var createRecommendedClassFiltersConfig = (userData) => [
|
|
27057
27109
|
{
|
|
27058
27110
|
key: "academic",
|
|
27059
27111
|
label: "DADOS ACAD\xCAMICOS",
|
|
@@ -27128,12 +27180,12 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
27128
27180
|
key: "status",
|
|
27129
27181
|
label: "Status",
|
|
27130
27182
|
selectedIds: [],
|
|
27131
|
-
itens:
|
|
27183
|
+
itens: RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS
|
|
27132
27184
|
}
|
|
27133
27185
|
]
|
|
27134
27186
|
}
|
|
27135
27187
|
];
|
|
27136
|
-
var createTableColumns2 = (mapSubjectNameToEnum2,
|
|
27188
|
+
var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteRecommendedClass, onEditRecommendedClass) => [
|
|
27137
27189
|
{
|
|
27138
27190
|
key: "startDate",
|
|
27139
27191
|
label: "In\xEDcio",
|
|
@@ -27214,7 +27266,9 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27214
27266
|
Badge_default,
|
|
27215
27267
|
{
|
|
27216
27268
|
variant: "solid",
|
|
27217
|
-
action:
|
|
27269
|
+
action: getRecommendedClassStatusBadgeAction(
|
|
27270
|
+
status
|
|
27271
|
+
),
|
|
27218
27272
|
size: "small",
|
|
27219
27273
|
children: status
|
|
27220
27274
|
}
|
|
@@ -27245,11 +27299,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27245
27299
|
render: (_value, row) => {
|
|
27246
27300
|
const handleDelete = (e) => {
|
|
27247
27301
|
e.stopPropagation();
|
|
27248
|
-
|
|
27302
|
+
onDeleteRecommendedClass?.(row.id);
|
|
27249
27303
|
};
|
|
27250
27304
|
const handleEdit = (e) => {
|
|
27251
27305
|
e.stopPropagation();
|
|
27252
|
-
|
|
27306
|
+
onEditRecommendedClass?.(row.id);
|
|
27253
27307
|
};
|
|
27254
27308
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex justify-center gap-2", children: [
|
|
27255
27309
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
@@ -27282,11 +27336,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27282
27336
|
}
|
|
27283
27337
|
];
|
|
27284
27338
|
var RecommendedLessonsHistory = ({
|
|
27285
|
-
|
|
27339
|
+
fetchRecommendedClassHistory,
|
|
27286
27340
|
onCreateLesson,
|
|
27287
27341
|
onRowClick,
|
|
27288
|
-
|
|
27289
|
-
|
|
27342
|
+
onDeleteRecommendedClass,
|
|
27343
|
+
onEditRecommendedClass,
|
|
27290
27344
|
emptyStateImage,
|
|
27291
27345
|
noSearchImage,
|
|
27292
27346
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
@@ -27294,14 +27348,14 @@ var RecommendedLessonsHistory = ({
|
|
|
27294
27348
|
title = "Hist\xF3rico de aulas recomendadas",
|
|
27295
27349
|
createButtonText = "Criar aula",
|
|
27296
27350
|
searchPlaceholder = "Buscar aula",
|
|
27297
|
-
|
|
27298
|
-
|
|
27351
|
+
fetchRecommendedClassModels,
|
|
27352
|
+
deleteRecommendedClassModel,
|
|
27299
27353
|
onCreateModel,
|
|
27300
27354
|
onSendLesson,
|
|
27301
27355
|
onEditModel,
|
|
27302
27356
|
subjectsMap,
|
|
27303
|
-
|
|
27304
|
-
|
|
27357
|
+
fetchRecommendedClassDrafts,
|
|
27358
|
+
deleteRecommendedClassDraft,
|
|
27305
27359
|
onSendDraft,
|
|
27306
27360
|
onEditDraft,
|
|
27307
27361
|
defaultTab,
|
|
@@ -27323,35 +27377,39 @@ var RecommendedLessonsHistory = ({
|
|
|
27323
27377
|
},
|
|
27324
27378
|
[onTabChange]
|
|
27325
27379
|
);
|
|
27326
|
-
const
|
|
27327
|
-
|
|
27328
|
-
const
|
|
27380
|
+
const fetchRecommendedClassHistoryRef = (0, import_react83.useRef)(fetchRecommendedClassHistory);
|
|
27381
|
+
fetchRecommendedClassHistoryRef.current = fetchRecommendedClassHistory;
|
|
27382
|
+
const useRecommendedClassHistory = (0, import_react83.useMemo)(
|
|
27329
27383
|
() => createUseRecommendedLessonsHistory(
|
|
27330
|
-
(filters) =>
|
|
27384
|
+
(filters) => fetchRecommendedClassHistoryRef.current(filters)
|
|
27331
27385
|
),
|
|
27332
27386
|
[]
|
|
27333
27387
|
);
|
|
27334
27388
|
const {
|
|
27335
|
-
|
|
27389
|
+
recommendedClass,
|
|
27336
27390
|
loading,
|
|
27337
27391
|
error,
|
|
27338
27392
|
pagination,
|
|
27339
|
-
|
|
27340
|
-
} =
|
|
27393
|
+
fetchRecommendedClass
|
|
27394
|
+
} = useRecommendedClassHistory();
|
|
27341
27395
|
const initialFilterConfigs = (0, import_react83.useMemo)(
|
|
27342
|
-
() =>
|
|
27396
|
+
() => createRecommendedClassFiltersConfig(userFilterData),
|
|
27343
27397
|
[userFilterData]
|
|
27344
27398
|
);
|
|
27345
27399
|
const tableColumns = (0, import_react83.useMemo)(
|
|
27346
|
-
() => createTableColumns2(
|
|
27347
|
-
|
|
27400
|
+
() => createTableColumns2(
|
|
27401
|
+
mapSubjectNameToEnum2,
|
|
27402
|
+
onDeleteRecommendedClass,
|
|
27403
|
+
onEditRecommendedClass
|
|
27404
|
+
),
|
|
27405
|
+
[mapSubjectNameToEnum2, onDeleteRecommendedClass, onEditRecommendedClass]
|
|
27348
27406
|
);
|
|
27349
27407
|
const handleParamsChange = (0, import_react83.useCallback)(
|
|
27350
27408
|
(params) => {
|
|
27351
27409
|
const filters = buildFiltersFromParams(params);
|
|
27352
|
-
|
|
27410
|
+
fetchRecommendedClass(filters);
|
|
27353
27411
|
},
|
|
27354
|
-
[
|
|
27412
|
+
[fetchRecommendedClass]
|
|
27355
27413
|
);
|
|
27356
27414
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
27357
27415
|
"div",
|
|
@@ -27425,7 +27483,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27425
27483
|
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)(
|
|
27426
27484
|
TableProvider,
|
|
27427
27485
|
{
|
|
27428
|
-
data:
|
|
27486
|
+
data: recommendedClass,
|
|
27429
27487
|
headers: tableColumns,
|
|
27430
27488
|
loading,
|
|
27431
27489
|
variant: "borderless",
|
|
@@ -27492,11 +27550,11 @@ var RecommendedLessonsHistory = ({
|
|
|
27492
27550
|
}
|
|
27493
27551
|
}
|
|
27494
27552
|
) }) }),
|
|
27495
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
27496
|
-
|
|
27553
|
+
activeTab === "drafts" /* DRAFTS */ && fetchRecommendedClassDrafts && deleteRecommendedClassDraft && onCreateLesson && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27554
|
+
RecommendedClassDraftsTab,
|
|
27497
27555
|
{
|
|
27498
|
-
|
|
27499
|
-
|
|
27556
|
+
fetchRecommendedClassDrafts,
|
|
27557
|
+
deleteRecommendedClassDraft,
|
|
27500
27558
|
onCreateDraft: onCreateLesson,
|
|
27501
27559
|
onSendDraft,
|
|
27502
27560
|
onEditDraft,
|
|
@@ -27507,11 +27565,11 @@ var RecommendedLessonsHistory = ({
|
|
|
27507
27565
|
subjectsMap
|
|
27508
27566
|
}
|
|
27509
27567
|
),
|
|
27510
|
-
activeTab === "models" /* MODELS */ &&
|
|
27511
|
-
|
|
27568
|
+
activeTab === "models" /* MODELS */ && fetchRecommendedClassModels && deleteRecommendedClassModel && onCreateModel && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27569
|
+
RecommendedClassModelsTab,
|
|
27512
27570
|
{
|
|
27513
|
-
|
|
27514
|
-
|
|
27571
|
+
fetchRecommendedClassModels,
|
|
27572
|
+
deleteRecommendedClassModel,
|
|
27515
27573
|
onCreateModel,
|
|
27516
27574
|
onSendLesson,
|
|
27517
27575
|
onEditModel,
|
|
@@ -27586,8 +27644,8 @@ var LessonHeader = ({
|
|
|
27586
27644
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27587
27645
|
viewLessonLabel
|
|
27588
27646
|
}) => {
|
|
27589
|
-
const {
|
|
27590
|
-
const subjectName =
|
|
27647
|
+
const { recommendedClass, breakdown } = data;
|
|
27648
|
+
const subjectName = recommendedClass.lessons[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
27591
27649
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27592
27650
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
27593
27651
|
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: [
|
|
@@ -27599,18 +27657,18 @@ var LessonHeader = ({
|
|
|
27599
27657
|
size: "xl",
|
|
27600
27658
|
weight: "bold",
|
|
27601
27659
|
className: "text-text-950 lg:text-2xl",
|
|
27602
|
-
children:
|
|
27660
|
+
children: recommendedClass.title
|
|
27603
27661
|
}
|
|
27604
27662
|
),
|
|
27605
27663
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
|
|
27606
27664
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27607
27665
|
"In\xEDcio em ",
|
|
27608
|
-
formatDate(
|
|
27666
|
+
formatDate(recommendedClass.startDate)
|
|
27609
27667
|
] }),
|
|
27610
27668
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27611
27669
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27612
27670
|
"Prazo final ",
|
|
27613
|
-
formatDate(
|
|
27671
|
+
formatDate(recommendedClass.finalDate)
|
|
27614
27672
|
] }),
|
|
27615
27673
|
breakdown?.schoolName && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27616
27674
|
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
@@ -28159,7 +28217,7 @@ var StudentPerformanceModal = ({
|
|
|
28159
28217
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
28160
28218
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
28161
28219
|
var RecommendedLessonDetails = ({
|
|
28162
|
-
|
|
28220
|
+
recommendedClassId,
|
|
28163
28221
|
data,
|
|
28164
28222
|
loading = false,
|
|
28165
28223
|
error = null,
|
|
@@ -28181,13 +28239,16 @@ var RecommendedLessonDetails = ({
|
|
|
28181
28239
|
const [performanceError, setPerformanceError] = (0, import_react91.useState)(null);
|
|
28182
28240
|
const handleViewStudentPerformance = (0, import_react91.useCallback)(
|
|
28183
28241
|
async (studentId) => {
|
|
28184
|
-
if (!fetchStudentPerformance || !
|
|
28242
|
+
if (!fetchStudentPerformance || !recommendedClassId) return;
|
|
28185
28243
|
setPerformanceModalOpen(true);
|
|
28186
28244
|
setPerformanceLoading(true);
|
|
28187
28245
|
setPerformanceData(null);
|
|
28188
28246
|
setPerformanceError(null);
|
|
28189
28247
|
try {
|
|
28190
|
-
const result = await fetchStudentPerformance(
|
|
28248
|
+
const result = await fetchStudentPerformance(
|
|
28249
|
+
recommendedClassId,
|
|
28250
|
+
studentId
|
|
28251
|
+
);
|
|
28191
28252
|
setPerformanceData(result);
|
|
28192
28253
|
} catch (err) {
|
|
28193
28254
|
console.error("Error fetching student performance:", err);
|
|
@@ -28198,7 +28259,7 @@ var RecommendedLessonDetails = ({
|
|
|
28198
28259
|
setPerformanceLoading(false);
|
|
28199
28260
|
}
|
|
28200
28261
|
},
|
|
28201
|
-
[fetchStudentPerformance,
|
|
28262
|
+
[fetchStudentPerformance, recommendedClassId]
|
|
28202
28263
|
);
|
|
28203
28264
|
const handleClosePerformanceModal = (0, import_react91.useCallback)(() => {
|
|
28204
28265
|
setPerformanceModalOpen(false);
|
|
@@ -28208,18 +28269,18 @@ var RecommendedLessonDetails = ({
|
|
|
28208
28269
|
const defaultBreadcrumbs = (0, import_react91.useMemo)(
|
|
28209
28270
|
() => [
|
|
28210
28271
|
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
28211
|
-
{ label: data?.
|
|
28272
|
+
{ label: data?.recommendedClass.title || "Detalhes" }
|
|
28212
28273
|
],
|
|
28213
|
-
[data?.
|
|
28274
|
+
[data?.recommendedClass.title]
|
|
28214
28275
|
);
|
|
28215
28276
|
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
28216
28277
|
const displayStudents = (0, import_react91.useMemo)(() => {
|
|
28217
28278
|
if (!data?.details.students) return [];
|
|
28218
|
-
const deadline = data?.
|
|
28279
|
+
const deadline = data?.recommendedClass.finalDate;
|
|
28219
28280
|
return data.details.students.map(
|
|
28220
28281
|
(student) => transformStudentForDisplay(student, deadline)
|
|
28221
28282
|
);
|
|
28222
|
-
}, [data?.details.students, data?.
|
|
28283
|
+
}, [data?.details.students, data?.recommendedClass.finalDate]);
|
|
28223
28284
|
if (loading) {
|
|
28224
28285
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28225
28286
|
"div",
|
|
@@ -28347,7 +28408,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28347
28408
|
mapSubjectNameToEnum: mapSubjectNameToEnum2
|
|
28348
28409
|
} = config;
|
|
28349
28410
|
return () => {
|
|
28350
|
-
const
|
|
28411
|
+
const recommendedClassMapRef = (0, import_react92.useRef)(/* @__PURE__ */ new Map());
|
|
28351
28412
|
const [sendModalOpen, setSendModalOpen] = (0, import_react92.useState)(false);
|
|
28352
28413
|
const [selectedModel, setSelectedModel] = (0, import_react92.useState)(null);
|
|
28353
28414
|
const [sendModalLoading, setSendModalLoading] = (0, import_react92.useState)(false);
|
|
@@ -28366,60 +28427,63 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28366
28427
|
subjects.forEach((s) => map.set(s.id, s.name));
|
|
28367
28428
|
return map;
|
|
28368
28429
|
}, [userData]);
|
|
28369
|
-
const
|
|
28430
|
+
const fetchRecommendedClassHistory = (0, import_react92.useCallback)(
|
|
28370
28431
|
async (filters) => {
|
|
28371
28432
|
const params = buildQueryParams2(filters);
|
|
28372
28433
|
const response = await api.get(
|
|
28373
|
-
endpoints.
|
|
28434
|
+
endpoints.recommendedClassHistory,
|
|
28374
28435
|
{ params }
|
|
28375
28436
|
);
|
|
28376
|
-
const
|
|
28377
|
-
|
|
28378
|
-
|
|
28437
|
+
const recommendedClass = response.data.data.recommendedClass;
|
|
28438
|
+
recommendedClass.forEach((recommendedClass2) => {
|
|
28439
|
+
recommendedClassMapRef.current.set(
|
|
28440
|
+
recommendedClass2.recommendedClass.id,
|
|
28441
|
+
recommendedClass2
|
|
28442
|
+
);
|
|
28379
28443
|
});
|
|
28380
28444
|
return response.data;
|
|
28381
28445
|
},
|
|
28382
|
-
[api, endpoints.
|
|
28446
|
+
[api, endpoints.recommendedClassHistory]
|
|
28383
28447
|
);
|
|
28384
|
-
const
|
|
28448
|
+
const fetchRecommendedClassModels = (0, import_react92.useCallback)(
|
|
28385
28449
|
async (filters) => {
|
|
28386
28450
|
const params = buildQueryParams2({
|
|
28387
28451
|
...filters,
|
|
28388
28452
|
type: "MODELO" /* MODELO */
|
|
28389
28453
|
});
|
|
28390
28454
|
const response = await api.get(
|
|
28391
|
-
endpoints.
|
|
28455
|
+
endpoints.recommendedClassDrafts,
|
|
28392
28456
|
{ params }
|
|
28393
28457
|
);
|
|
28394
28458
|
return response.data;
|
|
28395
28459
|
},
|
|
28396
|
-
[api, endpoints.
|
|
28460
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28397
28461
|
);
|
|
28398
|
-
const
|
|
28462
|
+
const deleteRecommendedClassModel = (0, import_react92.useCallback)(
|
|
28399
28463
|
async (id) => {
|
|
28400
|
-
await api.delete(`${endpoints.
|
|
28464
|
+
await api.delete(`${endpoints.recommendedClassDrafts}/${id}`);
|
|
28401
28465
|
},
|
|
28402
|
-
[api, endpoints.
|
|
28466
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28403
28467
|
);
|
|
28404
|
-
const
|
|
28468
|
+
const fetchRecommendedClassDrafts = (0, import_react92.useCallback)(
|
|
28405
28469
|
async (filters) => {
|
|
28406
28470
|
const params = buildQueryParams2({
|
|
28407
28471
|
...filters,
|
|
28408
28472
|
type: "RASCUNHO" /* RASCUNHO */
|
|
28409
28473
|
});
|
|
28410
28474
|
const response = await api.get(
|
|
28411
|
-
endpoints.
|
|
28475
|
+
endpoints.recommendedClassDrafts,
|
|
28412
28476
|
{ params }
|
|
28413
28477
|
);
|
|
28414
28478
|
return response.data;
|
|
28415
28479
|
},
|
|
28416
|
-
[api, endpoints.
|
|
28480
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28417
28481
|
);
|
|
28418
|
-
const
|
|
28482
|
+
const deleteRecommendedClassDraft = (0, import_react92.useCallback)(
|
|
28419
28483
|
async (id) => {
|
|
28420
|
-
await api.delete(`${endpoints.
|
|
28484
|
+
await api.delete(`${endpoints.recommendedClassDrafts}/${id}`);
|
|
28421
28485
|
},
|
|
28422
|
-
[api, endpoints.
|
|
28486
|
+
[api, endpoints.recommendedClassDrafts]
|
|
28423
28487
|
);
|
|
28424
28488
|
const handleCreateLesson = (0, import_react92.useCallback)(() => {
|
|
28425
28489
|
navigate(paths.createLesson);
|
|
@@ -28428,17 +28492,20 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28428
28492
|
navigate(paths.createModel);
|
|
28429
28493
|
}, []);
|
|
28430
28494
|
const handleRowClick = (0, import_react92.useCallback)((row) => {
|
|
28431
|
-
const originalData =
|
|
28495
|
+
const originalData = recommendedClassMapRef.current.get(row.id);
|
|
28432
28496
|
navigate(`${paths.lessonDetails}/${row.id}`, {
|
|
28433
|
-
state: {
|
|
28497
|
+
state: { recommendedClassData: originalData }
|
|
28434
28498
|
});
|
|
28435
28499
|
}, []);
|
|
28436
|
-
const
|
|
28500
|
+
const handleEditRecommendedClass = (0, import_react92.useCallback)((id) => {
|
|
28437
28501
|
navigate(`${paths.editLesson}/${id}/editar`);
|
|
28438
28502
|
}, []);
|
|
28439
|
-
const handleEditModel = (0, import_react92.useCallback)(
|
|
28440
|
-
|
|
28441
|
-
|
|
28503
|
+
const handleEditModel = (0, import_react92.useCallback)(
|
|
28504
|
+
(model) => {
|
|
28505
|
+
navigate(`${paths.editModel}${model.id}`);
|
|
28506
|
+
},
|
|
28507
|
+
[]
|
|
28508
|
+
);
|
|
28442
28509
|
const handleSendLesson = (0, import_react92.useCallback)(
|
|
28443
28510
|
(model) => {
|
|
28444
28511
|
setSelectedModel(model);
|
|
@@ -28467,7 +28534,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28467
28534
|
if (!selectedModel) return;
|
|
28468
28535
|
setSendModalLoading(true);
|
|
28469
28536
|
try {
|
|
28470
|
-
await api.post(endpoints.
|
|
28537
|
+
await api.post(endpoints.submitRecommendedClass, {
|
|
28471
28538
|
draftId: selectedModel.id,
|
|
28472
28539
|
students: formData.students,
|
|
28473
28540
|
startDate: `${formData.startDate}T${formData.startTime}:00`,
|
|
@@ -28479,7 +28546,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28479
28546
|
setSendModalLoading(false);
|
|
28480
28547
|
}
|
|
28481
28548
|
},
|
|
28482
|
-
[api, endpoints.
|
|
28549
|
+
[api, endpoints.submitRecommendedClass, selectedModel]
|
|
28483
28550
|
);
|
|
28484
28551
|
const handleSendModalClose = (0, import_react92.useCallback)(() => {
|
|
28485
28552
|
setSendModalOpen(false);
|
|
@@ -28493,17 +28560,17 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28493
28560
|
);
|
|
28494
28561
|
return {
|
|
28495
28562
|
historyProps: {
|
|
28496
|
-
|
|
28497
|
-
|
|
28498
|
-
|
|
28563
|
+
fetchRecommendedClassHistory,
|
|
28564
|
+
fetchRecommendedClassModels,
|
|
28565
|
+
deleteRecommendedClassModel,
|
|
28499
28566
|
onCreateLesson: handleCreateLesson,
|
|
28500
28567
|
onCreateModel: handleCreateModel,
|
|
28501
28568
|
onRowClick: handleRowClick,
|
|
28502
|
-
|
|
28569
|
+
onEditRecommendedClass: handleEditRecommendedClass,
|
|
28503
28570
|
onEditModel: handleEditModel,
|
|
28504
28571
|
onSendLesson: handleSendLesson,
|
|
28505
|
-
|
|
28506
|
-
|
|
28572
|
+
fetchRecommendedClassDrafts,
|
|
28573
|
+
deleteRecommendedClassDraft,
|
|
28507
28574
|
onSendDraft: handleSendLesson,
|
|
28508
28575
|
onEditDraft: handleEditModel,
|
|
28509
28576
|
emptyStateImage,
|
|
@@ -28533,7 +28600,7 @@ var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
|
|
|
28533
28600
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
28534
28601
|
var import_react93 = require("react");
|
|
28535
28602
|
var import_zod8 = require("zod");
|
|
28536
|
-
var
|
|
28603
|
+
var recommendedClassLessonSubjectSchema = import_zod8.z.object({
|
|
28537
28604
|
id: import_zod8.z.string(),
|
|
28538
28605
|
name: import_zod8.z.string(),
|
|
28539
28606
|
color: import_zod8.z.string(),
|
|
@@ -28543,38 +28610,38 @@ var lessonContentSchema = import_zod8.z.object({
|
|
|
28543
28610
|
id: import_zod8.z.string(),
|
|
28544
28611
|
name: import_zod8.z.string()
|
|
28545
28612
|
});
|
|
28546
|
-
var
|
|
28613
|
+
var recommendedClassLessonSchema = import_zod8.z.object({
|
|
28547
28614
|
id: import_zod8.z.string(),
|
|
28548
28615
|
content: lessonContentSchema,
|
|
28549
28616
|
subtopic: lessonContentSchema,
|
|
28550
28617
|
topic: lessonContentSchema,
|
|
28551
|
-
subject:
|
|
28618
|
+
subject: recommendedClassLessonSubjectSchema
|
|
28552
28619
|
});
|
|
28553
|
-
var
|
|
28620
|
+
var recommendedClassLessonProgressSchema = import_zod8.z.object({
|
|
28554
28621
|
id: import_zod8.z.string(),
|
|
28555
28622
|
userId: import_zod8.z.string(),
|
|
28556
28623
|
lessonId: import_zod8.z.string(),
|
|
28557
28624
|
progress: import_zod8.z.number(),
|
|
28558
|
-
lesson:
|
|
28625
|
+
lesson: recommendedClassLessonSchema
|
|
28559
28626
|
});
|
|
28560
|
-
var
|
|
28561
|
-
|
|
28627
|
+
var recommendedClassLessonsItemSchema = import_zod8.z.object({
|
|
28628
|
+
recommendedClassId: import_zod8.z.string(),
|
|
28562
28629
|
supLessonsProgressId: import_zod8.z.string(),
|
|
28563
|
-
supLessonsProgress:
|
|
28630
|
+
supLessonsProgress: recommendedClassLessonProgressSchema
|
|
28564
28631
|
});
|
|
28565
|
-
var
|
|
28632
|
+
var recommendedClassMetadataSchema = import_zod8.z.object({
|
|
28566
28633
|
id: import_zod8.z.string(),
|
|
28567
28634
|
title: import_zod8.z.string(),
|
|
28568
28635
|
startDate: import_zod8.z.string(),
|
|
28569
28636
|
finalDate: import_zod8.z.string(),
|
|
28570
28637
|
progress: import_zod8.z.number(),
|
|
28571
|
-
|
|
28638
|
+
lessons: import_zod8.z.array(recommendedClassLessonsItemSchema)
|
|
28572
28639
|
});
|
|
28573
|
-
var
|
|
28640
|
+
var recommendedClassApiResponseSchema = import_zod8.z.object({
|
|
28574
28641
|
message: import_zod8.z.string(),
|
|
28575
|
-
data:
|
|
28642
|
+
data: recommendedClassMetadataSchema
|
|
28576
28643
|
});
|
|
28577
|
-
var
|
|
28644
|
+
var recommendedClassDetailStudentSchema = import_zod8.z.object({
|
|
28578
28645
|
userInstitutionId: import_zod8.z.string(),
|
|
28579
28646
|
userId: import_zod8.z.string(),
|
|
28580
28647
|
name: import_zod8.z.string(),
|
|
@@ -28583,29 +28650,29 @@ var goalDetailStudentSchema = import_zod8.z.object({
|
|
|
28583
28650
|
avgScore: import_zod8.z.number().nullable(),
|
|
28584
28651
|
daysToComplete: import_zod8.z.number().nullable()
|
|
28585
28652
|
});
|
|
28586
|
-
var
|
|
28653
|
+
var recommendedClassDetailAggregatedSchema = import_zod8.z.object({
|
|
28587
28654
|
completionPercentage: import_zod8.z.number(),
|
|
28588
28655
|
avgScore: import_zod8.z.number().nullable()
|
|
28589
28656
|
});
|
|
28590
|
-
var
|
|
28657
|
+
var recommendedClassDetailContentPerformanceItemSchema = import_zod8.z.object({
|
|
28591
28658
|
contentId: import_zod8.z.string(),
|
|
28592
28659
|
contentName: import_zod8.z.string(),
|
|
28593
28660
|
rate: import_zod8.z.number()
|
|
28594
28661
|
}).nullable();
|
|
28595
|
-
var
|
|
28596
|
-
best:
|
|
28597
|
-
worst:
|
|
28662
|
+
var recommendedClassDetailContentPerformanceSchema = import_zod8.z.object({
|
|
28663
|
+
best: recommendedClassDetailContentPerformanceItemSchema,
|
|
28664
|
+
worst: recommendedClassDetailContentPerformanceItemSchema
|
|
28598
28665
|
});
|
|
28599
|
-
var
|
|
28600
|
-
students: import_zod8.z.array(
|
|
28601
|
-
aggregated:
|
|
28602
|
-
contentPerformance:
|
|
28666
|
+
var recommendedClassDetailsDataSchema = import_zod8.z.object({
|
|
28667
|
+
students: import_zod8.z.array(recommendedClassDetailStudentSchema),
|
|
28668
|
+
aggregated: recommendedClassDetailAggregatedSchema,
|
|
28669
|
+
contentPerformance: recommendedClassDetailContentPerformanceSchema
|
|
28603
28670
|
});
|
|
28604
|
-
var
|
|
28671
|
+
var recommendedClassDetailsApiResponseSchema = import_zod8.z.object({
|
|
28605
28672
|
message: import_zod8.z.string(),
|
|
28606
|
-
data:
|
|
28673
|
+
data: recommendedClassDetailsDataSchema
|
|
28607
28674
|
});
|
|
28608
|
-
var
|
|
28675
|
+
var recommendedClassBreakdownSchema2 = import_zod8.z.object({
|
|
28609
28676
|
classId: import_zod8.z.string().uuid(),
|
|
28610
28677
|
className: import_zod8.z.string(),
|
|
28611
28678
|
schoolId: import_zod8.z.string(),
|
|
@@ -28613,14 +28680,14 @@ var goalBreakdownSchema2 = import_zod8.z.object({
|
|
|
28613
28680
|
studentCount: import_zod8.z.number(),
|
|
28614
28681
|
completedCount: import_zod8.z.number()
|
|
28615
28682
|
});
|
|
28616
|
-
var
|
|
28617
|
-
|
|
28618
|
-
breakdown: import_zod8.z.array(
|
|
28683
|
+
var historyRecommendedClassItemSchema = import_zod8.z.object({
|
|
28684
|
+
recommendedClass: import_zod8.z.object({ id: import_zod8.z.string().uuid() }),
|
|
28685
|
+
breakdown: import_zod8.z.array(recommendedClassBreakdownSchema2)
|
|
28619
28686
|
});
|
|
28620
28687
|
var historyApiResponseSchema = import_zod8.z.object({
|
|
28621
28688
|
message: import_zod8.z.string(),
|
|
28622
28689
|
data: import_zod8.z.object({
|
|
28623
|
-
|
|
28690
|
+
recommendedClass: import_zod8.z.array(historyRecommendedClassItemSchema),
|
|
28624
28691
|
total: import_zod8.z.number()
|
|
28625
28692
|
})
|
|
28626
28693
|
});
|
|
@@ -28651,23 +28718,23 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28651
28718
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
28652
28719
|
try {
|
|
28653
28720
|
const promises = [
|
|
28654
|
-
apiClient.
|
|
28655
|
-
apiClient.
|
|
28721
|
+
apiClient.fetchRecommendedClass(lessonId),
|
|
28722
|
+
apiClient.fetchRecommendedClassDetails(lessonId),
|
|
28656
28723
|
apiClient.fetchBreakdown ? apiClient.fetchBreakdown(lessonId) : Promise.resolve(null)
|
|
28657
28724
|
];
|
|
28658
|
-
const [
|
|
28659
|
-
const
|
|
28660
|
-
const validatedDetails =
|
|
28725
|
+
const [recommendedClassResponse, detailsResponse, historyResponse] = await Promise.all(promises);
|
|
28726
|
+
const validatedRecommendedClass = recommendedClassApiResponseSchema.parse(recommendedClassResponse);
|
|
28727
|
+
const validatedDetails = recommendedClassDetailsApiResponseSchema.parse(detailsResponse);
|
|
28661
28728
|
let breakdown;
|
|
28662
28729
|
if (historyResponse) {
|
|
28663
28730
|
const validatedHistory = historyApiResponseSchema.parse(historyResponse);
|
|
28664
|
-
const historyItem = validatedHistory.data.
|
|
28665
|
-
(g) => g.
|
|
28731
|
+
const historyItem = validatedHistory.data.recommendedClass.find(
|
|
28732
|
+
(g) => g.recommendedClass.id === lessonId
|
|
28666
28733
|
);
|
|
28667
28734
|
breakdown = historyItem?.breakdown[0];
|
|
28668
28735
|
}
|
|
28669
28736
|
const lessonData = {
|
|
28670
|
-
|
|
28737
|
+
recommendedClass: validatedRecommendedClass.data,
|
|
28671
28738
|
details: validatedDetails.data,
|
|
28672
28739
|
breakdown
|
|
28673
28740
|
};
|
|
@@ -30600,9 +30667,9 @@ function useSendActivity(config) {
|
|
|
30600
30667
|
CorrectActivityModal,
|
|
30601
30668
|
CreateActivity,
|
|
30602
30669
|
DEFAULT_ACTIVITIES_PAGINATION,
|
|
30603
|
-
DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
30604
|
-
DEFAULT_GOAL_MODELS_PAGINATION,
|
|
30605
30670
|
DEFAULT_MODELS_PAGINATION,
|
|
30671
|
+
DEFAULT_RECOMMENDED_CLASS_DRAFTS_PAGINATION,
|
|
30672
|
+
DEFAULT_RECOMMENDED_CLASS_MODELS_PAGINATION,
|
|
30606
30673
|
DIFFICULTY_LEVEL_ENUM,
|
|
30607
30674
|
DateTimeInput,
|
|
30608
30675
|
Divider,
|
|
@@ -30616,21 +30683,13 @@ function useSendActivity(config) {
|
|
|
30616
30683
|
EmptyState,
|
|
30617
30684
|
FileAttachment,
|
|
30618
30685
|
FilterModal,
|
|
30619
|
-
GOAL_ACTIVITY_STATUS,
|
|
30620
|
-
GOAL_FILTER_STATUS_OPTIONS,
|
|
30621
|
-
GOAL_STATUS_OPTIONS,
|
|
30622
30686
|
GeneralActivityStatus,
|
|
30623
|
-
GoalApiStatus,
|
|
30624
|
-
GoalBadgeActionType,
|
|
30625
|
-
GoalDisplayStatus,
|
|
30626
|
-
GoalDraftType,
|
|
30627
|
-
GoalDraftsTab,
|
|
30628
|
-
GoalPageTab,
|
|
30629
30687
|
IconButton,
|
|
30630
30688
|
IconRender,
|
|
30631
30689
|
IconRoundedButton,
|
|
30632
30690
|
ImageUpload,
|
|
30633
30691
|
Input,
|
|
30692
|
+
LESSON_AVAILABILITY,
|
|
30634
30693
|
LatexRenderer,
|
|
30635
30694
|
LessonPreview,
|
|
30636
30695
|
LoadingModal,
|
|
@@ -30684,10 +30743,19 @@ function useSendActivity(config) {
|
|
|
30684
30743
|
QuizResultTitle,
|
|
30685
30744
|
QuizTitle,
|
|
30686
30745
|
QuizTrueOrFalse,
|
|
30746
|
+
RECOMMENDED_CLASS_ACTIVITY_STATUS,
|
|
30747
|
+
RECOMMENDED_CLASS_FILTER_STATUS_OPTIONS,
|
|
30748
|
+
RECOMMENDED_CLASS_STATUS_OPTIONS,
|
|
30687
30749
|
Radio,
|
|
30688
30750
|
RadioGroup,
|
|
30689
30751
|
RadioGroupItem,
|
|
30690
30752
|
RankingCard,
|
|
30753
|
+
RecommendedClassApiStatus,
|
|
30754
|
+
RecommendedClassBadgeActionType,
|
|
30755
|
+
RecommendedClassDisplayStatus,
|
|
30756
|
+
RecommendedClassDraftType,
|
|
30757
|
+
RecommendedClassDraftsTab,
|
|
30758
|
+
RecommendedClassPageTab,
|
|
30691
30759
|
RecommendedLessonDetails,
|
|
30692
30760
|
RecommendedLessonsHistory,
|
|
30693
30761
|
STUDENT_ACTIVITY_STATUS,
|
|
@@ -30741,16 +30809,17 @@ function useSendActivity(config) {
|
|
|
30741
30809
|
activitiesHistoryApiResponseSchema,
|
|
30742
30810
|
activityModelsApiResponseSchema,
|
|
30743
30811
|
buildUserFilterData,
|
|
30812
|
+
checkLessonAvailability,
|
|
30744
30813
|
cn,
|
|
30745
30814
|
convertActivityFiltersToQuestionsFilter,
|
|
30746
30815
|
createActivitiesHistoryHook,
|
|
30747
30816
|
createActivityFiltersDataHook,
|
|
30748
30817
|
createActivityModelsHook,
|
|
30749
|
-
createGoalDraftsHook,
|
|
30750
|
-
createGoalModelsHook,
|
|
30751
30818
|
createNotificationStore,
|
|
30752
30819
|
createNotificationsHook,
|
|
30753
30820
|
createQuestionsListHook,
|
|
30821
|
+
createRecommendedClassDraftsHook,
|
|
30822
|
+
createRecommendedClassModelsHook,
|
|
30754
30823
|
createRecommendedLessonDetailsHook,
|
|
30755
30824
|
createRecommendedLessonsHistoryHook,
|
|
30756
30825
|
createRecommendedLessonsPageHook,
|
|
@@ -30759,17 +30828,17 @@ function useSendActivity(config) {
|
|
|
30759
30828
|
createUseActivityModels,
|
|
30760
30829
|
createUseChat,
|
|
30761
30830
|
createUseChatRooms,
|
|
30762
|
-
createUseGoalDrafts,
|
|
30763
|
-
createUseGoalModels,
|
|
30764
30831
|
createUseNotificationStore,
|
|
30765
30832
|
createUseNotifications,
|
|
30766
30833
|
createUseQuestionsList,
|
|
30834
|
+
createUseRecommendedClassDrafts,
|
|
30835
|
+
createUseRecommendedClassModels,
|
|
30767
30836
|
createUseRecommendedLessonDetails,
|
|
30768
30837
|
createUseRecommendedLessonsHistory,
|
|
30769
30838
|
createUseRecommendedLessonsPage,
|
|
30770
30839
|
createZustandAuthAdapter,
|
|
30771
30840
|
deriveStudentStatus,
|
|
30772
|
-
|
|
30841
|
+
determineRecommendedClassStatus,
|
|
30773
30842
|
formatDateToBrazilian,
|
|
30774
30843
|
formatDaysToComplete,
|
|
30775
30844
|
formatFileSize,
|
|
@@ -30784,8 +30853,8 @@ function useSendActivity(config) {
|
|
|
30784
30853
|
getChatWsUrl,
|
|
30785
30854
|
getClassOptionsFromUserData,
|
|
30786
30855
|
getDeviceType,
|
|
30787
|
-
getGoalStatusBadgeAction,
|
|
30788
30856
|
getQuestionStatusBadgeConfig,
|
|
30857
|
+
getRecommendedClassStatusBadgeAction,
|
|
30789
30858
|
getRootDomain,
|
|
30790
30859
|
getSchoolOptionsFromUserData,
|
|
30791
30860
|
getSchoolYearOptionsFromUserData,
|
|
@@ -30801,20 +30870,18 @@ function useSendActivity(config) {
|
|
|
30801
30870
|
getSubjectInfo,
|
|
30802
30871
|
getSubjectName,
|
|
30803
30872
|
getSubjectOptionsFromUserData,
|
|
30804
|
-
goalApiResponseSchema,
|
|
30805
|
-
goalDetailsApiResponseSchema,
|
|
30806
|
-
goalModelsApiResponseSchema,
|
|
30807
|
-
goalsHistoryApiResponseSchema,
|
|
30808
30873
|
handleActivityFetchError,
|
|
30809
|
-
handleGoalDraftFetchError,
|
|
30810
|
-
handleGoalFetchError,
|
|
30811
|
-
handleGoalModelFetchError,
|
|
30812
30874
|
handleLessonDetailsFetchError,
|
|
30813
30875
|
handleModelFetchError,
|
|
30876
|
+
handleRecommendedClassDraftFetchError,
|
|
30877
|
+
handleRecommendedClassFetchError,
|
|
30878
|
+
handleRecommendedClassModelFetchError,
|
|
30814
30879
|
historyApiResponseSchema,
|
|
30815
30880
|
isChatUserInfoValid,
|
|
30816
30881
|
isDeadlinePassed,
|
|
30817
30882
|
isFormValid,
|
|
30883
|
+
isLessonExpired,
|
|
30884
|
+
isLessonNotYetAvailable,
|
|
30818
30885
|
isStepValid,
|
|
30819
30886
|
mapActivityStatusToDisplay,
|
|
30820
30887
|
mapApiStatusToInternal,
|
|
@@ -30824,6 +30891,10 @@ function useSendActivity(config) {
|
|
|
30824
30891
|
mapSubjectEnumToName,
|
|
30825
30892
|
mapSubjectNameToEnum,
|
|
30826
30893
|
questionTypeLabels,
|
|
30894
|
+
recommendedClassApiResponseSchema,
|
|
30895
|
+
recommendedClassDetailsApiResponseSchema,
|
|
30896
|
+
recommendedClassHistoryApiResponseSchema,
|
|
30897
|
+
recommendedClassModelsApiResponseSchema,
|
|
30827
30898
|
renderSubjectCell,
|
|
30828
30899
|
studentActivityStatusSchema,
|
|
30829
30900
|
supportSchema,
|
|
@@ -30831,9 +30902,9 @@ function useSendActivity(config) {
|
|
|
30831
30902
|
toggleArrayItem,
|
|
30832
30903
|
toggleSingleValue,
|
|
30833
30904
|
transformActivityToTableItem,
|
|
30834
|
-
transformGoalModelToTableItem,
|
|
30835
|
-
transformGoalToTableItem,
|
|
30836
30905
|
transformModelToTableItem,
|
|
30906
|
+
transformRecommendedClassModelToTableItem,
|
|
30907
|
+
transformRecommendedClassToTableItem,
|
|
30837
30908
|
useActivityDetails,
|
|
30838
30909
|
useAlertFormStore,
|
|
30839
30910
|
useApiConfig,
|