Enhance audience management features with new components and API integrations

- Added `AssignCoursesModal`, `AudienceMemberRow`, `AudienceTable`, and related components for improved audience management UI.
- Implemented audience invite actions including resend and revoke functionality.
- Updated audience API to support importing members and assigning courses.
- Refactored audience data handling to include status and invite management.
- Improved overall user experience with pagination and selection features in the audience table.
This commit is contained in:
Rotimi Best
2026-03-22 18:42:23 +01:00
parent e9c4082f89
commit 3919ff6c2f
157 changed files with 13183 additions and 872 deletions
+3
View File
@@ -18,6 +18,7 @@ export * from './teacher-student-joined';
export * from './teacher-student-buy-request';
export * from './student-prove-payment';
export * from './teacher-course-welcome';
export * from './student-org-invite';
import type { newsfeedCommentEmail, newsfeedPostEmail } from './newsfeed';
@@ -28,6 +29,7 @@ import type { onPasswordResetEmail } from './on-password-reset';
import type { studentCourseInviteEmail } from './student-course-invite';
import type { studentCourseWelcomeEmail } from './student-course-welcome';
import type { studentProvePaymentEmail } from './student-prove-payment';
import type { studentOrgInviteEmail } from './student-org-invite';
import type { teacherCourseWelcomeEmail } from './teacher-course-welcome';
import type { teacherStudentBuyRequestEmail } from './teacher-student-buy-request';
import type { teacherStudentJoinedEmail } from './teacher-student-joined';
@@ -54,4 +56,5 @@ export type EmailSchemas = {
teacherStudentBuyRequest: typeof teacherStudentBuyRequestEmail.template.schema;
studentProvePayment: typeof studentProvePaymentEmail.template.schema;
teacherCourseWelcome: typeof teacherCourseWelcomeEmail.template.schema;
studentOrgInvite: typeof studentOrgInviteEmail.template.schema;
};
@@ -0,0 +1,33 @@
import * as z from 'zod';
import { defineEmail } from '../send';
import { getDefaultTemplate } from '../templates';
export const studentOrgInviteEmail = defineEmail({
id: 'studentOrgInvite',
subject: 'You have been invited to join as a student',
schema: z.object({
email: z.string().email(),
orgName: z.string().min(1),
inviteLink: z.url(),
expiresAt: z.string().min(1),
courseNames: z.string().optional()
}),
render: (fields) => {
const courseLine = fields.courseNames
? `<p>You have been given access to: <strong>${fields.courseNames}</strong>.</p>`
: '';
const content = `
<p>Hi there,</p>
<p>You have been invited to join <strong>${fields.orgName}</strong> as a student.</p>
${courseLine}
<p>This invite expires on ${fields.expiresAt} (UTC).</p>
<div>
<a class="button" href="${fields.inviteLink}">Accept Invitation</a>
</div>
`;
return getDefaultTemplate(content);
}
});
+9 -8
View File
@@ -2,18 +2,19 @@ import { env } from '../config/env';
export const EMAIL_IDS = [
'forgotPassword',
'welcome',
'verifyEmail',
'onPasswordReset',
'inviteTeacher',
'newsfeedPost',
'newsfeedComment',
'studentCourseWelcome',
'newsfeedPost',
'onPasswordReset',
'studentCourseInvite',
'teacherStudentJoined',
'teacherStudentBuyRequest',
'studentCourseWelcome',
'studentOrgInvite',
'studentProvePayment',
'teacherCourseWelcome'
'teacherCourseWelcome',
'teacherStudentBuyRequest',
'teacherStudentJoined',
'verifyEmail',
'welcome'
] as const;
const DEFAULT_EMAIL_FROM = '"Best from ClassroomIO" <notify@mail.classroomio.com>';