From 2daf20288ae99cdbd2b0bc1e797f7e190d15cdc5 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Mon, 2 Nov 2026 13:09:40 +0300 Subject: [PATCH] Redesign makeup academy admin and align content and analytics workflows --- README.md | 4 +- index.html | 3 +- package-lock.json | 20 +- package.json | 6 +- scripts/learning-integration.test.mjs | 120 +++ src/App.tsx | 3 +- src/api/analytics.api.ts | 4 +- src/api/courses.api.ts | 237 +++--- src/api/initial-assessment.api.ts | 20 +- src/api/notifications.api.ts | 15 +- src/api/payments.api.ts | 4 +- src/api/subscription-plans.api.ts | 7 +- src/components/SearchHighlight.shared.ts | 5 + src/components/SearchHighlight.tsx | 5 +- .../AnalyticsTimeRangeFilter.shared.ts | 54 ++ .../analytics/AnalyticsTimeRangeFilter.tsx | 78 +- .../SubscriptionRevenueVisuals.shared.ts | 27 + .../analytics/SubscriptionRevenueVisuals.tsx | 336 ++------ .../DynamicTableBuilder.tsx | 10 +- .../PracticeQuestionEditorFields.shared.ts | 65 ++ .../PracticeQuestionEditorFields.tsx | 83 +- .../dashboard/DashboardProfileRail.tsx | 53 ++ src/components/dashboard/RevenueTrendCard.tsx | 15 +- src/components/dashboard/StatCard.tsx | 6 +- src/components/filters/AdminFiltersPanel.tsx | 13 +- .../NotificationDetailDialog.tsx | 22 +- .../PlatformAudienceFilterPanel.tsx | 8 +- src/components/sidebar/Sidebar.tsx | 2 +- src/components/sidebar/SidebarLogo.tsx | 3 +- .../topbar/NotificationDropdown.tsx | 52 +- src/components/topbar/Topbar.tsx | 227 +++--- src/components/ui/badge.tsx | 1 + src/components/ui/button.shared.ts | 29 + src/components/ui/button.tsx | 34 +- src/components/ui/input.tsx | 4 +- src/components/ui/select.tsx | 6 +- src/components/ui/sensitive-value.shared.ts | 27 + src/components/ui/sensitive-value.tsx | 35 +- src/components/ui/table.tsx | 4 +- src/components/ui/textarea.tsx | 4 +- src/contexts/ThemeContext.shared.ts | 32 + src/contexts/ThemeContext.tsx | 28 +- src/hooks/usePracticeListSelection.ts | 9 +- src/hooks/usePracticeParentTitles.ts | 52 +- src/index.css | 281 ++++++- src/layouts/AppLayout.tsx | 4 +- src/lib/activityLogDisplay.ts | 10 +- src/lib/analytics.ts | 10 +- src/lib/apiResponse.ts | 15 + src/lib/csvExportFilters.ts | 13 +- src/lib/displayValue.shared.ts | 18 + src/lib/displayValue.tsx | 18 +- src/lib/examPrepPracticeEditPath.ts | 97 +-- src/lib/fetchAllOffsetPages.ts | 6 +- src/lib/fetchAllPractices.ts | 30 +- src/lib/learnEnglishPracticeEditPath.ts | 97 +-- src/lib/practiceDynamicQuestionPayload.ts | 19 +- src/lib/practiceFullMapper.ts | 15 +- src/lib/questionBankDisplay.ts | 3 +- src/lib/subscriptionPlans.ts | 9 +- src/lib/typeToConfirm.shared.ts | 5 + src/lib/typeToConfirm.tsx | 17 +- src/lib/userProfileFieldDisplay.ts | 42 +- src/pages/DashboardPage.tsx | 142 ++-- src/pages/ProfilePage.tsx | 17 +- src/pages/SettingsPage.tsx | 76 +- src/pages/analytics/AnalyticsPage.tsx | 121 +-- src/pages/auth/LoginPage.tsx | 63 +- .../content-management/AddNewLessonPage.tsx | 736 ------------------ .../content-management/AddNewPracticePage.tsx | 29 +- .../content-management/AddPracticeFlow.tsx | 40 +- .../content-management/AddQuestionPage.tsx | 25 +- .../content-management/AllCoursesPage.tsx | 58 +- .../content-management/AttachPracticeFlow.tsx | 14 +- .../AttachProgramPracticeFlow.tsx | 8 +- .../ContentOverviewPage.tsx | 100 +-- .../content-management/CourseCategoryPage.tsx | 33 +- .../content-management/CourseDetailPage.tsx | 86 +- .../CourseFlowBuilderPage.tsx | 75 +- .../CourseManagementPage.tsx | 86 +- .../CourseModuleDetailPage.tsx | 66 +- src/pages/content-management/CoursesPage.tsx | 54 +- .../content-management/EditPracticeFlow.tsx | 60 +- .../HumanLanguageHierarchyPage.tsx | 45 +- .../HumanLanguageSubModulePage.tsx | 2 +- .../InitialAssessmentPage.tsx | 14 +- .../content-management/LearnEnglishPage.tsx | 2 +- .../LessonPracticesPage.tsx | 47 +- .../content-management/ModuleDetailPage.tsx | 70 +- .../content-management/NewContentPage.tsx | 6 +- .../content-management/ProgramCoursesPage.tsx | 65 +- .../content-management/ProgramDetailPage.tsx | 91 ++- .../ProgramTypeSelectionPage.tsx | 20 +- .../QuestionTypeLibraryPage.tsx | 26 +- src/pages/content-management/SpeakingPage.tsx | 44 +- .../SubCourseContentPage.tsx | 21 +- .../AccessTierConfirmDialog.shared.ts | 22 + .../components/AccessTierConfirmDialog.tsx | 23 +- .../CatalogCoursePracticesPanel.tsx | 48 +- .../components/ContentHierarchyList.shared.ts | 7 + .../components/ContentHierarchyList.tsx | 45 +- .../components/ContentPageDescription.tsx | 9 +- .../components/CreatePracticeWizard.tsx | 18 +- .../components/ExamPrepAssessmentsPanel.tsx | 2 +- .../ExamPrepContentHierarchyList.tsx | 29 +- .../components/ModulePracticeCard.tsx | 10 +- .../PublishStatusConfirmDialog.shared.ts | 22 + .../components/PublishStatusConfirmDialog.tsx | 23 +- .../components/QuestionTypeCard.tsx | 14 +- .../QuestionTypeDefinitionPracticesDialog.tsx | 10 +- .../QuestionTypeGroupSelect.shared.ts | 11 + .../components/QuestionTypeGroupSelect.tsx | 27 +- .../components/UnitPracticesPanel.tsx | 48 +- .../components/VideoCard.tsx | 29 +- .../AttachPracticeReviewStep.tsx | 23 +- .../practice-steps/AttachPracticeStep1.tsx | 13 +- .../components/practice-steps/ContextStep.tsx | 4 +- .../PracticeSequentialReview.tsx | 6 +- .../ProgramAttachReviewStep.tsx | 6 +- .../practice-steps/ProgramAttachStep1.tsx | 11 +- .../practice-steps/QuestionsStep.tsx | 69 +- .../practice-steps/ScenarioStep.tsx | 19 +- .../SelectPracticeToAttachStep.tsx | 17 +- .../components/practice-steps/VoicePrompt.tsx | 58 +- .../mapQuestionsForPracticeReview.ts | 4 +- .../QuestionTypeConfigStep.tsx | 15 +- .../question-type-steps/componentKindUi.ts | 4 +- .../video-steps/ReviewPublishStep.tsx | 10 +- .../video-steps/VideoDetailStep.tsx | 2 +- .../notifications/AllNotificationsPage.tsx | 21 +- .../notifications/CreateEmailTemplatePage.tsx | 14 +- .../notifications/CreateNotificationPage.tsx | 74 +- .../notifications/EmailTemplateDetailPage.tsx | 13 +- .../notifications/EmailTemplatesPage.tsx | 9 +- src/pages/notifications/NotificationsPage.tsx | 196 +---- .../ScheduledNotificationsPage.tsx | 13 +- .../EmailTemplateCreateForm.shared.ts | 42 + .../components/EmailTemplateCreateForm.tsx | 44 +- .../EmailTemplateEditForm.shared.ts | 26 + .../components/EmailTemplateEditForm.tsx | 26 +- .../components/EmailTemplatePreviewPanel.tsx | 2 +- src/pages/payments/PaymentsPage.tsx | 47 +- src/pages/personas/PersonasPage.tsx | 14 +- .../components/CreatePersonaDialog.tsx | 13 +- .../personas/components/EditPersonaDialog.tsx | 13 +- .../personas/components/PersonaForm.shared.ts | 57 ++ src/pages/personas/components/PersonaForm.tsx | 59 +- src/pages/ratings/AppReviewsPage.tsx | 9 +- src/pages/role-management/RolesListPage.tsx | 60 +- src/pages/settings/AppVersionsTab.tsx | 27 +- src/pages/settings/SubscriptionPlansTab.tsx | 2 +- .../CreateAppVersionDialog.shared.ts | 31 + .../components/CreateAppVersionDialog.tsx | 30 +- .../CreateSubscriptionPlanDialog.shared.ts | 31 + .../CreateSubscriptionPlanDialog.tsx | 34 +- .../components/EditAppVersionDialog.tsx | 6 +- src/pages/team/TeamMemberDetailPage.tsx | 18 +- .../components/ActivityLogListPanel.tsx | 21 +- .../user-log/components/ActorHoverCard.tsx | 12 +- src/pages/user-log/components/ActorLabel.tsx | 31 +- .../user-management/DeletionRequestsPage.tsx | 19 +- src/pages/user-management/UserDetailPage.tsx | 50 +- src/pages/user-management/UsersListPage.tsx | 36 +- .../components/UserSubscriptionsSection.tsx | 2 +- src/types/auth.types.ts | 11 +- src/types/course.types.ts | 6 +- src/types/notification.types.ts | 24 +- src/types/subscription.types.ts | 2 +- tailwind.config.js | 27 +- 169 files changed, 2936 insertions(+), 3717 deletions(-) create mode 100644 src/components/SearchHighlight.shared.ts create mode 100644 src/components/analytics/AnalyticsTimeRangeFilter.shared.ts create mode 100644 src/components/analytics/SubscriptionRevenueVisuals.shared.ts create mode 100644 src/components/content-management/PracticeQuestionEditorFields.shared.ts create mode 100644 src/components/dashboard/DashboardProfileRail.tsx create mode 100644 src/components/ui/button.shared.ts create mode 100644 src/components/ui/sensitive-value.shared.ts create mode 100644 src/contexts/ThemeContext.shared.ts create mode 100644 src/lib/apiResponse.ts create mode 100644 src/lib/displayValue.shared.ts create mode 100644 src/lib/typeToConfirm.shared.ts delete mode 100644 src/pages/content-management/AddNewLessonPage.tsx create mode 100644 src/pages/content-management/components/AccessTierConfirmDialog.shared.ts create mode 100644 src/pages/content-management/components/ContentHierarchyList.shared.ts create mode 100644 src/pages/content-management/components/PublishStatusConfirmDialog.shared.ts create mode 100644 src/pages/content-management/components/QuestionTypeGroupSelect.shared.ts create mode 100644 src/pages/notifications/components/EmailTemplateCreateForm.shared.ts create mode 100644 src/pages/notifications/components/EmailTemplateEditForm.shared.ts create mode 100644 src/pages/personas/components/PersonaForm.shared.ts create mode 100644 src/pages/settings/components/CreateAppVersionDialog.shared.ts create mode 100644 src/pages/settings/components/CreateSubscriptionPlanDialog.shared.ts diff --git a/README.md b/README.md index afd627a..3fcf3fe 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,9 @@ Backend must set `TEAM_INVITE_BASE_URL` / `TEAM_PASSWORD_RESET_BASE_URL` to this | Script | Command | Description | |--------|---------|-------------| | Dev | `npm run dev` | Vite HMR | -| Build | `npm run build` | Production bundle (`vite build`) | +| Build | `npm run build` | Type check and create the production bundle | +| Type check | `npm run typecheck` | Check application and tooling TypeScript | +| Learning tests | `npm run test:learning` | API normalization and pagination regression tests | | Preview | `npm run preview` | Serve production build locally | | Lint | `npm run lint` | ESLint | diff --git a/index.html b/index.html index 70137bb..c6f89b5 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,8 @@ - Rezina Admin + + Rezina Academy | Makeup Artistry Admin