Show unassigned instead of dashes for missing admin values.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8df2eae342
commit
ab8d487016
|
|
@ -236,7 +236,7 @@ export function DynamicTableBuilder({
|
|||
key={`preview-c-${ri}-${ci}`}
|
||||
className="border border-grayScale-100 px-3 py-2 text-sm"
|
||||
>
|
||||
{cell || <span className="text-grayScale-300">—</span>}
|
||||
{cell || <span className="text-grayScale-300">unassigned</span>}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -187,9 +187,9 @@ function DetailsTab({
|
|||
<div className="space-y-0 divide-y divide-grayScale-100">
|
||||
{[
|
||||
{ k: "Type", v: formatNotificationTypeLabel(notification.type) },
|
||||
{ k: "Channel", v: notification.delivery_channel || "—" },
|
||||
{ k: "Channel", v: notification.delivery_channel || "unassigned" },
|
||||
{ k: "Status", v: notification.is_read ? "Read" : "Unread" },
|
||||
{ k: "Delivery", v: notification.delivery_status || "—" },
|
||||
{ k: "Delivery", v: notification.delivery_status || "unassigned" },
|
||||
...(notification.receiver_type
|
||||
? [{ k: "Receiver", v: notification.receiver_type }]
|
||||
: []),
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@ function teamMemberToProfile(
|
|||
return {
|
||||
kind: "team",
|
||||
id: member.id,
|
||||
name: [member.first_name, member.last_name].filter(Boolean).join(" ") || "—",
|
||||
email: member.email || "—",
|
||||
name: [member.first_name, member.last_name].filter(Boolean).join(" ") || "unassigned",
|
||||
email: member.email || "unassigned",
|
||||
roleLabel: formatTeamRoleLabel(member.team_role),
|
||||
status: member.status || "—",
|
||||
status: member.status || "unassigned",
|
||||
emailVerified: Boolean(member.email_verified),
|
||||
createdAt: member.created_at,
|
||||
}
|
||||
|
|
@ -81,17 +81,17 @@ function userToProfile(user: UserProfileData): ActorProfile {
|
|||
return {
|
||||
kind: "user",
|
||||
id: user.id,
|
||||
name: [user.first_name, user.last_name].filter(Boolean).join(" ") || "—",
|
||||
email: user.email || "—",
|
||||
name: [user.first_name, user.last_name].filter(Boolean).join(" ") || "unassigned",
|
||||
email: user.email || "unassigned",
|
||||
roleLabel: user.role
|
||||
? user.role.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
|
||||
: "—",
|
||||
status: user.status || "—",
|
||||
: "unassigned",
|
||||
status: user.status || "unassigned",
|
||||
emailVerified: Boolean(user.email_verified),
|
||||
country: user.country || "—",
|
||||
region: user.region || "—",
|
||||
country: user.country || "unassigned",
|
||||
region: user.region || "unassigned",
|
||||
lastLogin: user.last_login,
|
||||
subscriptionStatus: user.subscription_status?.trim() || "—",
|
||||
subscriptionStatus: user.subscription_status?.trim() || "unassigned",
|
||||
createdAt: user.created_at,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export function formatVersionStatus(status: string): string {
|
|||
}
|
||||
|
||||
export function formatAppVersionCreatedAt(raw: string): string {
|
||||
if (!raw) return "—"
|
||||
if (!raw) return "unassigned"
|
||||
const normalized = raw.replace(" +0000 UTC", "Z").replace(/^(\d{4}-\d{2}-\d{2}) /, "$1T")
|
||||
const d = new Date(normalized)
|
||||
if (Number.isNaN(d.getTime())) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,19 @@
|
|||
export const NOT_ASSIGNED_LABEL = "Not assigned"
|
||||
export const UNASSIGNED_LABEL = "unassigned"
|
||||
|
||||
/** @deprecated Prefer UNASSIGNED_LABEL */
|
||||
export const NOT_ASSIGNED_LABEL = UNASSIGNED_LABEL
|
||||
|
||||
const LEGACY_EMPTY_LABELS = new Set(["—", "-", "Not assigned", "not assigned"])
|
||||
|
||||
export function displayValue(value: string | null | undefined): string {
|
||||
const trimmed = value?.trim()
|
||||
return trimmed ? trimmed : NOT_ASSIGNED_LABEL
|
||||
if (!trimmed || LEGACY_EMPTY_LABELS.has(trimmed) || trimmed === UNASSIGNED_LABEL) {
|
||||
return UNASSIGNED_LABEL
|
||||
}
|
||||
return trimmed
|
||||
}
|
||||
|
||||
export function isUnassignedLabel(value: string | null | undefined): boolean {
|
||||
const trimmed = value?.trim()
|
||||
return !trimmed || trimmed === UNASSIGNED_LABEL || LEGACY_EMPTY_LABELS.has(trimmed)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export function renderEmailTemplatePreview(
|
|||
|
||||
export function formatEmailTemplateDate(raw: string | null | undefined) {
|
||||
if (raw == null || String(raw).trim() === "") {
|
||||
return "—"
|
||||
return "unassigned"
|
||||
}
|
||||
const text = String(raw)
|
||||
const parsed = new Date(text)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function faqStatusLabel(status: FAQStatus | string): string {
|
|||
|
||||
export function formatFaqDate(raw: string | null | undefined): string {
|
||||
if (raw == null || String(raw).trim() === "") {
|
||||
return "—"
|
||||
return "unassigned"
|
||||
}
|
||||
const text = String(raw)
|
||||
const parsed = new Date(text)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export function getNotificationLevelBadge(level: string) {
|
|||
|
||||
export function formatNotificationTimestamp(ts: string) {
|
||||
const date = new Date(ts)
|
||||
if (Number.isNaN(date.getTime())) return "—"
|
||||
if (Number.isNaN(date.getTime())) return "unassigned"
|
||||
const now = new Date()
|
||||
const diffMs = now.getTime() - date.getTime()
|
||||
const diffMin = Math.floor(diffMs / 60_000)
|
||||
|
|
@ -83,7 +83,7 @@ export function formatNotificationTypeLabel(type: string) {
|
|||
|
||||
export function formatNotificationDateTime(ts: string) {
|
||||
const date = new Date(ts)
|
||||
if (Number.isNaN(date.getTime())) return "—"
|
||||
if (Number.isNaN(date.getTime())) return "unassigned"
|
||||
return date.toLocaleString(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export function formatPaymentAmount(payment: Pick<Payment, "amount" | "currency"
|
|||
}
|
||||
|
||||
export function formatPaymentDate(iso: string | null | undefined): string {
|
||||
if (!iso) return "—"
|
||||
if (!iso) return "unassigned"
|
||||
const d = new Date(iso)
|
||||
if (Number.isNaN(d.getTime())) return iso
|
||||
return d.toLocaleString(undefined, {
|
||||
|
|
@ -27,7 +27,7 @@ export function formatPaymentStatus(status: string): string {
|
|||
}
|
||||
|
||||
export function formatPaymentMethod(method: string): string {
|
||||
if (!method) return "—"
|
||||
if (!method) return "unassigned"
|
||||
return method.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ export function mapPersonaToCard(persona: PersonaListItem): PersonaCardModel {
|
|||
}
|
||||
|
||||
export function formatPersonaDate(dateStr: string | null | undefined): string {
|
||||
if (!dateStr?.trim()) return "—"
|
||||
if (!dateStr?.trim()) return "unassigned"
|
||||
const d = new Date(dateStr)
|
||||
if (Number.isNaN(d.getTime())) return dateStr
|
||||
return d.toLocaleDateString(undefined, {
|
||||
|
|
@ -106,7 +106,7 @@ export function personaStatusLabel(isActive: boolean): string {
|
|||
|
||||
export function personaGenderLabel(gender: string | null | undefined): string {
|
||||
const value = gender?.trim()
|
||||
return value ? value : "—"
|
||||
return value ? value : "unassigned"
|
||||
}
|
||||
|
||||
export function unwrapPersonasList(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export function formatAverageStars(value: number): string {
|
|||
|
||||
export function formatRatingDate(dateStr: string): string {
|
||||
const d = new Date(dateStr)
|
||||
if (Number.isNaN(d.getTime())) return dateStr || "—"
|
||||
if (Number.isNaN(d.getTime())) return dateStr || "unassigned"
|
||||
return d.toLocaleDateString(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
|
|
@ -17,7 +17,7 @@ export function formatRatingDate(dateStr: string): string {
|
|||
|
||||
export function formatRatingDateTime(dateStr: string): string {
|
||||
const d = new Date(dateStr)
|
||||
if (Number.isNaN(d.getTime())) return dateStr || "—"
|
||||
if (Number.isNaN(d.getTime())) return dateStr || "unassigned"
|
||||
return d.toLocaleString(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ export function formatAdminPaymentMethod(method: string | null | undefined): str
|
|||
const value = String(method ?? "").trim().toUpperCase()
|
||||
if (value === "ADMIN_GRANT") return "Admin grant"
|
||||
if (value === "ADMIN_EXTEND") return "Admin extend"
|
||||
if (!value) return "—"
|
||||
if (!value) return "unassigned"
|
||||
return method!.trim()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { VerifyInvitationData } from "../types/teamInvitation.types"
|
||||
|
||||
export function formatTeamRoleLabel(role: string | undefined): string {
|
||||
if (!role) return "—"
|
||||
if (!role) return "unassigned"
|
||||
return role.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import { ProfileAvatarUpload } from "../components/profile/ProfileAvatarUpload";
|
|||
import { PersonaProfilePictureUploadField } from "./personas/components/PersonaProfilePictureUploadField";
|
||||
|
||||
function formatDate(dateStr: string | null | undefined): string {
|
||||
if (!dateStr) return "—";
|
||||
if (!dateStr) return "unassigned";
|
||||
const date = new Date(dateStr);
|
||||
if (Number.isNaN(date.getTime())) return dateStr;
|
||||
return date.toLocaleDateString(undefined, {
|
||||
|
|
@ -37,7 +37,7 @@ function formatDate(dateStr: string | null | undefined): string {
|
|||
}
|
||||
|
||||
function formatDateTime(dateStr: string | null | undefined): string {
|
||||
if (!dateStr) return "—";
|
||||
if (!dateStr) return "unassigned";
|
||||
const date = new Date(dateStr);
|
||||
if (Number.isNaN(date.getTime())) return dateStr;
|
||||
return date.toLocaleString(undefined, {
|
||||
|
|
@ -51,7 +51,7 @@ function formatDateTime(dateStr: string | null | undefined): string {
|
|||
|
||||
function formatRoleLabel(role: string): string {
|
||||
const value = role.trim();
|
||||
if (!value) return "—";
|
||||
if (!value) return "unassigned";
|
||||
return value
|
||||
.split("_")
|
||||
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
|
||||
|
|
@ -60,7 +60,7 @@ function formatRoleLabel(role: string): string {
|
|||
|
||||
function displayValue(value: string | null | undefined): string {
|
||||
const trimmed = value?.trim();
|
||||
return trimmed ? trimmed : "—";
|
||||
return trimmed ? trimmed : "unassigned";
|
||||
}
|
||||
|
||||
function FieldGroup({
|
||||
|
|
|
|||
|
|
@ -606,16 +606,16 @@ export function AddNewLessonPage() {
|
|||
<div className="flex items-center justify-between px-4 py-3 text-sm">
|
||||
<span className="text-grayScale-500">Description</span>
|
||||
<span className="max-w-[55%] truncate text-right font-medium text-grayScale-800">
|
||||
{lessonDescription || "—"}
|
||||
{lessonDescription || "unassigned"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between px-4 py-3 text-sm">
|
||||
<span className="text-grayScale-500">Intro video URL</span>
|
||||
<span className="max-w-[55%] truncate text-right font-medium text-grayScale-800">{introVideoUrl || "—"}</span>
|
||||
<span className="max-w-[55%] truncate text-right font-medium text-grayScale-800">{introVideoUrl || "unassigned"}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between px-4 py-3 text-sm">
|
||||
<span className="text-grayScale-500">Sub-module</span>
|
||||
<span className="font-medium text-grayScale-800">{subModuleId ?? "—"}</span>
|
||||
<span className="font-medium text-grayScale-800">{subModuleId ?? "unassigned"}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ export function CourseDetailPage() {
|
|||
(!loading && !course
|
||||
? "This course could not be loaded."
|
||||
: !course?.description?.trim() && course
|
||||
? "—"
|
||||
? "unassigned"
|
||||
: "");
|
||||
|
||||
return (
|
||||
|
|
@ -787,7 +787,7 @@ export function CourseDetailPage() {
|
|||
<p className="text-[12px] font-medium leading-snug text-grayScale-400 line-clamp-3">
|
||||
{module.description?.trim()
|
||||
? module.description
|
||||
: "—"}
|
||||
: "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ export function CourseManagementPage() {
|
|||
list.map((row, index) => ({
|
||||
id: Number(row.id),
|
||||
name: row.name?.trim() || `Unit ${row.id}`,
|
||||
description: row.description?.trim() || "—",
|
||||
description: row.description?.trim() || "unassigned",
|
||||
thumbnail: row.thumbnail?.trim() || "",
|
||||
sortOrder: Number(row.sort_order ?? 0),
|
||||
publishStatus: row.publish_status ?? null,
|
||||
|
|
@ -466,7 +466,7 @@ export function CourseManagementPage() {
|
|||
try {
|
||||
const existing = units.find((u) => u.id === editingUnitId);
|
||||
const preservedDescription =
|
||||
existing?.description && existing.description !== "—"
|
||||
existing?.description && existing.description !== "unassigned"
|
||||
? existing.description
|
||||
: null;
|
||||
const minioThumbnail = await resolveThumbnailToMinioUrl(editThumbnail);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export function CourseModuleDetailPage() {
|
|||
[lessonPracticeChoice],
|
||||
);
|
||||
const [moduleTitle, setModuleTitle] = useState("Module");
|
||||
const [moduleDescription, setModuleDescription] = useState("—");
|
||||
const [moduleDescription, setModuleDescription] = useState("unassigned");
|
||||
const [modulePublishStatus, setModulePublishStatus] = useState<
|
||||
PracticePublishStatus | string | null
|
||||
>(null);
|
||||
|
|
@ -173,17 +173,17 @@ export function CourseModuleDetailPage() {
|
|||
const row = list.find((m) => Number(m.id) === parsedModuleId);
|
||||
if (row) {
|
||||
setModuleTitle(row.name?.trim() || `Module ${parsedModuleId}`);
|
||||
setModuleDescription(row.description?.trim() || "—");
|
||||
setModuleDescription(row.description?.trim() || "unassigned");
|
||||
setModulePublishStatus(row.publish_status ?? null);
|
||||
} else {
|
||||
setModuleTitle(`Module ${parsedModuleId}`);
|
||||
setModuleDescription("—");
|
||||
setModuleDescription("unassigned");
|
||||
setModulePublishStatus(null);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setModuleTitle(`Module ${parsedModuleId}`);
|
||||
setModuleDescription("—");
|
||||
setModuleDescription("unassigned");
|
||||
}
|
||||
}, [parsedModuleId, parsedUnitId]);
|
||||
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ export function CoursesPage() {
|
|||
</TableCell>
|
||||
<TableCell>
|
||||
<p className="max-w-md truncate text-sm text-grayScale-600" title={sub.description || undefined}>
|
||||
{sub.description?.trim() ? sub.description : "—"}
|
||||
{sub.description?.trim() ? sub.description : "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="hidden xl:table-cell tabular-nums text-sm text-grayScale-600">
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function formatTableDate(dateStr: string) {
|
|||
}
|
||||
|
||||
function formatVideoDuration(seconds: number) {
|
||||
if (!Number.isFinite(seconds) || seconds < 0) return "—"
|
||||
if (!Number.isFinite(seconds) || seconds < 0) return "unassigned"
|
||||
const m = Math.floor(seconds / 60)
|
||||
const s = Math.floor(seconds % 60)
|
||||
return m > 0 ? `${m}:${s.toString().padStart(2, "0")}` : `${s}s`
|
||||
|
|
@ -526,12 +526,12 @@ export function HumanLanguageSubModulePage() {
|
|||
<TableCell>{questionSetStatusBadge(item.status)}</TableCell>
|
||||
<TableCell>
|
||||
<p className="max-w-[280px] truncate text-sm text-grayScale-600">
|
||||
{item.description?.trim() ? item.description : "—"}
|
||||
{item.description?.trim() ? item.description : "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="hidden lg:table-cell">
|
||||
<p className="max-w-[140px] truncate text-sm text-grayScale-600">
|
||||
{item.persona?.trim() ? item.persona : "—"}
|
||||
{item.persona?.trim() ? item.persona : "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="hidden md:table-cell">
|
||||
|
|
@ -673,7 +673,7 @@ export function HumanLanguageSubModulePage() {
|
|||
<TableCell>{lessonStatusBadge(lesson.is_active)}</TableCell>
|
||||
<TableCell>
|
||||
<p className="max-w-[280px] truncate text-sm text-grayScale-600">
|
||||
{lesson.description?.trim() ? lesson.description : "—"}
|
||||
{lesson.description?.trim() ? lesson.description : "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="hidden lg:table-cell">
|
||||
|
|
@ -985,7 +985,7 @@ export function HumanLanguageSubModulePage() {
|
|||
</TableCell>
|
||||
<TableCell>
|
||||
<p className="max-w-[280px] truncate text-sm text-grayScale-600">
|
||||
{v.description?.trim() ? v.description : "—"}
|
||||
{v.description?.trim() ? v.description : "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="hidden sm:table-cell">
|
||||
|
|
@ -1031,7 +1031,7 @@ export function HumanLanguageSubModulePage() {
|
|||
</a>
|
||||
</Button>
|
||||
) : (
|
||||
<span className="text-sm text-grayScale-400">—</span>
|
||||
<span className="text-sm text-grayScale-400">unassigned</span>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
|
|
|||
|
|
@ -817,7 +817,7 @@ export function InitialAssessmentPage() {
|
|||
>
|
||||
{(() => {
|
||||
const value = String(q.difficultyLevel ?? "").trim()
|
||||
if (!value || value === "—" || value === "-") return "unassigned"
|
||||
if (!value || value === "unassigned" || value === "-") return "unassigned"
|
||||
return value.toLowerCase()
|
||||
})()}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -732,7 +732,7 @@ export function LearnEnglishPage() {
|
|||
<p className="mt-2 text-sm leading-relaxed text-grayScale-500 line-clamp-4">
|
||||
{program.description?.trim()
|
||||
? program.description
|
||||
: "—"}
|
||||
: "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
|
|
|
|||
|
|
@ -157,15 +157,15 @@ export function ModuleDetailPage() {
|
|||
|
||||
const displayModuleDescription = (() => {
|
||||
if (hasNavName) {
|
||||
return navState?.moduleDescription?.trim() || "—";
|
||||
return navState?.moduleDescription?.trim() || "unassigned";
|
||||
}
|
||||
if (!moduleListResolved) {
|
||||
return "Loading…";
|
||||
}
|
||||
if (loadedModuleDescription !== null) {
|
||||
return loadedModuleDescription.trim() || "—";
|
||||
return loadedModuleDescription.trim() || "unassigned";
|
||||
}
|
||||
return "—";
|
||||
return "unassigned";
|
||||
})();
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -994,7 +994,7 @@ export function PracticeDetailsPage() {
|
|||
<div>
|
||||
<p className="text-xs font-bold uppercase tracking-wider text-grayScale-500">Story</p>
|
||||
<p className="mt-1.5 whitespace-pre-wrap text-sm leading-relaxed text-grayScale-700">
|
||||
{practice.story_description?.trim() || "—"}
|
||||
{practice.story_description?.trim() || "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
{quickTipParts.length > 0 && (
|
||||
|
|
|
|||
|
|
@ -647,7 +647,7 @@ export function PracticeQuestionsPage() {
|
|||
Points: {question.points ?? 0}
|
||||
</span>
|
||||
<span className="rounded-md bg-grayScale-100 px-2 py-1">
|
||||
Difficulty: {question.difficulty_level || "—"}
|
||||
Difficulty: {question.difficulty_level || "unassigned"}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ export function ProgramCoursesPage() {
|
|||
{course.name}
|
||||
</h3>
|
||||
<p className="mt-2 text-[13px] leading-relaxed text-grayScale-500 line-clamp-2">
|
||||
{course.description?.trim() ? course.description : "—"}
|
||||
{course.description?.trim() ? course.description : "unassigned"}
|
||||
</p>
|
||||
|
||||
<div className="my-6 grid grid-cols-3 gap-4 border-y border-grayScale-50 py-4">
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export function ProgramDetailPage() {
|
|||
list.map((row) => ({
|
||||
id: Number(row.id),
|
||||
name: row.name?.trim() || `Course ${row.id}`,
|
||||
description: row.description?.trim() || "—",
|
||||
description: row.description?.trim() || "unassigned",
|
||||
thumbnail: row.thumbnail?.trim() || null,
|
||||
sortOrder: Number(row.sort_order ?? 0),
|
||||
publishStatus: row.publish_status ?? null,
|
||||
|
|
@ -310,7 +310,7 @@ export function ProgramDetailPage() {
|
|||
{
|
||||
id: row.id,
|
||||
name: row.name ?? name,
|
||||
description: row.description?.trim() || "—",
|
||||
description: row.description?.trim() || "unassigned",
|
||||
thumbnail: row.thumbnail?.trim() || null,
|
||||
sortOrder: Number(row.sort_order ?? 0),
|
||||
unitsCount: Number(row.units_count ?? 0),
|
||||
|
|
@ -393,7 +393,7 @@ export function ProgramDetailPage() {
|
|||
const minioThumbnail = await resolveThumbnailToMinioUrl(editThumbnail);
|
||||
const existing = createdCourses.find((c) => c.id === editingCourseId);
|
||||
const preservedDescription =
|
||||
existing?.description && existing.description !== "—"
|
||||
existing?.description && existing.description !== "unassigned"
|
||||
? existing.description
|
||||
: null;
|
||||
const response = await updateExamPrepCatalogCourse(editingCourseId, {
|
||||
|
|
@ -409,7 +409,7 @@ export function ProgramDetailPage() {
|
|||
? {
|
||||
...course,
|
||||
name: row?.name ?? name,
|
||||
description: row?.description?.trim() || preservedDescription || "—",
|
||||
description: row?.description?.trim() || preservedDescription || "unassigned",
|
||||
thumbnail: row?.thumbnail?.trim() || null,
|
||||
sortOrder: Number(row?.sort_order ?? sortOrderNum),
|
||||
unitsCount: Number(row?.units_count ?? course.unitsCount ?? 0),
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ export function QuestionsPage() {
|
|||
)}
|
||||
</TableCell>
|
||||
<TableCell className="hidden py-3.5 text-sm text-grayScale-500 md:table-cell">
|
||||
{question.status || "—"}
|
||||
{question.status || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="py-3.5 text-sm font-semibold text-grayScale-600">
|
||||
{question.points ?? 0}
|
||||
|
|
@ -696,10 +696,10 @@ export function QuestionsPage() {
|
|||
<div className="grid grid-cols-1 gap-3 text-sm sm:grid-cols-2">
|
||||
<p><span className="font-medium">ID:</span> {detailData.id}</p>
|
||||
<p><span className="font-medium">Type:</span> {typeLabels[detailData.question_type] || detailData.question_type}</p>
|
||||
<p><span className="font-medium">Difficulty:</span> {detailData.difficulty_level || "—"}</p>
|
||||
<p><span className="font-medium">Difficulty:</span> {detailData.difficulty_level || "unassigned"}</p>
|
||||
<p><span className="font-medium">Points:</span> {detailData.points ?? 0}</p>
|
||||
<p><span className="font-medium">Status:</span> {detailData.status || "—"}</p>
|
||||
<p><span className="font-medium">Created:</span> {detailData.created_at || "—"}</p>
|
||||
<p><span className="font-medium">Status:</span> {detailData.status || "unassigned"}</p>
|
||||
<p><span className="font-medium">Created:</span> {detailData.created_at || "unassigned"}</p>
|
||||
</div>
|
||||
{detailData.explanation ? (
|
||||
<div>
|
||||
|
|
@ -755,7 +755,7 @@ export function QuestionsPage() {
|
|||
: (answer as { acceptable_answer?: string }).acceptable_answer || ""
|
||||
return (
|
||||
<p key={`${value}-${index}`} className="rounded-md border border-grayScale-200 bg-grayScale-50 px-2 py-1">
|
||||
{value || "—"}
|
||||
{value || "unassigned"}
|
||||
</p>
|
||||
)
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -1498,13 +1498,13 @@ export function SpeakingPage() {
|
|||
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs">
|
||||
<span className="rounded-md bg-brand-100 px-2 py-0.5 font-medium text-brand-800">AUDIO</span>
|
||||
<span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600">
|
||||
Difficulty: {question.difficulty_level || "—"}
|
||||
Difficulty: {question.difficulty_level || "unassigned"}
|
||||
</span>
|
||||
<span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600">
|
||||
Points: {question.points ?? 0}
|
||||
</span>
|
||||
<span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600">
|
||||
Status: {question.status || "—"}
|
||||
Status: {question.status || "unassigned"}
|
||||
</span>
|
||||
</div>
|
||||
{question.image_url && imagePreviewByQuestionId[question.id] ? (
|
||||
|
|
@ -1788,19 +1788,19 @@ export function SpeakingPage() {
|
|||
<div className="grid grid-cols-1 gap-3 text-sm sm:grid-cols-2">
|
||||
<div>
|
||||
<p className="text-xs font-medium text-grayScale-500">Status</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.status || "—"}</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.status || "unassigned"}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs font-medium text-grayScale-500">Points</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.points ?? "—"}</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.points ?? "unassigned"}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs font-medium text-grayScale-500">Difficulty</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.difficulty_level || "—"}</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.difficulty_level || "unassigned"}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs font-medium text-grayScale-500">Type</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.question_type || "—"}</p>
|
||||
<p className="mt-1 text-grayScale-700">{selectedQuestionDetail.question_type || "unassigned"}</p>
|
||||
</div>
|
||||
</div>
|
||||
{selectedQuestionDetail.audio_correct_answer_text ? (
|
||||
|
|
@ -2440,11 +2440,11 @@ export function SpeakingPage() {
|
|||
<div className="rounded-xl border border-grayScale-200 bg-white p-5 shadow-sm">
|
||||
<h3 className="mb-3 text-sm font-semibold uppercase tracking-wide text-grayScale-500">Practice</h3>
|
||||
<div className="grid grid-cols-1 gap-3 text-sm text-grayScale-600 sm:grid-cols-2">
|
||||
<p><span className="font-medium">Title:</span> {setTitle || "—"}</p>
|
||||
<p><span className="font-medium">Course ID:</span> {subCourseId || "—"}</p>
|
||||
<p className="sm:col-span-2"><span className="font-medium">Description:</span> {setDescription || "—"}</p>
|
||||
<p><span className="font-medium">Title:</span> {setTitle || "unassigned"}</p>
|
||||
<p><span className="font-medium">Course ID:</span> {subCourseId || "unassigned"}</p>
|
||||
<p className="sm:col-span-2"><span className="font-medium">Description:</span> {setDescription || "unassigned"}</p>
|
||||
<p className="sm:col-span-2 break-all">
|
||||
<span className="font-medium">Intro video URL:</span> {introVideoUrl.trim() || "—"}
|
||||
<span className="font-medium">Intro video URL:</span> {introVideoUrl.trim() || "unassigned"}
|
||||
</p>
|
||||
<p><span className="font-medium">Status:</span> {setStatus}</p>
|
||||
</div>
|
||||
|
|
@ -2467,27 +2467,27 @@ export function SpeakingPage() {
|
|||
<p><span className="font-medium text-grayScale-700">Status:</span> {setStatus}</p>
|
||||
<p className="sm:col-span-2">
|
||||
<span className="font-medium text-grayScale-700">Voice Prompt:</span>{" "}
|
||||
{draft.voicePrompt.trim() || "—"}
|
||||
{draft.voicePrompt.trim() || "unassigned"}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<span className="font-medium text-grayScale-700">Sample Answer Voice Prompt:</span>{" "}
|
||||
{draft.sampleAnswerVoicePrompt.trim() || "—"}
|
||||
{draft.sampleAnswerVoicePrompt.trim() || "unassigned"}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<span className="font-medium text-grayScale-700">Image URL:</span>{" "}
|
||||
{draft.imageUrl.trim() || "—"}
|
||||
{draft.imageUrl.trim() || "unassigned"}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<span className="font-medium text-grayScale-700">Audio Correct Answer Text:</span>{" "}
|
||||
{draft.audioCorrectAnswerText.trim() || "—"}
|
||||
{draft.audioCorrectAnswerText.trim() || "unassigned"}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<span className="font-medium text-grayScale-700">Tips:</span>{" "}
|
||||
{draft.tips.trim() || "—"}
|
||||
{draft.tips.trim() || "unassigned"}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<span className="font-medium text-grayScale-700">Explanation:</span>{" "}
|
||||
{draft.explanation.trim() || "—"}
|
||||
{draft.explanation.trim() || "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-2 flex flex-wrap gap-3">
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ export function SubModuleContentPage() {
|
|||
day: "numeric",
|
||||
year: "numeric",
|
||||
})
|
||||
: "—"}
|
||||
: "unassigned"}
|
||||
</span>
|
||||
<div className="flex gap-0.5" onClick={(e) => e.stopPropagation()}>
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ export function UnitManagementPage() {
|
|||
list.map((row, index) => ({
|
||||
id: Number(row.id),
|
||||
name: row.name?.trim() || `Module ${row.id}`,
|
||||
description: row.description?.trim() || "—",
|
||||
description: row.description?.trim() || "unassigned",
|
||||
thumbnail: row.thumbnail?.trim() || "",
|
||||
icon: row.icon?.trim() || "",
|
||||
sortOrder: Number(row.sort_order ?? 0),
|
||||
|
|
@ -524,7 +524,7 @@ export function UnitManagementPage() {
|
|||
try {
|
||||
const existing = modules.find((m) => m.id === editingModuleId);
|
||||
const preservedDescription =
|
||||
existing?.description && existing.description !== "—"
|
||||
existing?.description && existing.description !== "unassigned"
|
||||
? existing.description
|
||||
: null;
|
||||
const minioThumbnail = await resolveToMinioUrl(editThumbnail);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export function AddNewPracticeReviewStep({
|
|||
.map((q) => q.tips?.trim() ?? "")
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
return tips || "—";
|
||||
return tips || "unassigned";
|
||||
}, [practiceDescription, questions]);
|
||||
|
||||
const thumbnailKind =
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useRef, useState, type ReactNode } from "react"
|
||||
import { cn } from "../../../lib/utils"
|
||||
|
||||
const PLACEHOLDER_VALUES = new Set(["—", "-", "Loading…", "Loading..."])
|
||||
const PLACEHOLDER_VALUES = new Set(["unassigned", "—", "-", "Not assigned", "Loading…", "Loading..."])
|
||||
|
||||
type ContentPageDescriptionProps = {
|
||||
children: ReactNode
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export function QuestionTypeCard({
|
|||
onCreatePractice,
|
||||
deleteDisabled,
|
||||
}: QuestionTypeDefinitionCardModel) {
|
||||
const statusLabel = (status || "—").toString()
|
||||
const statusLabel = (status || "unassigned").toString()
|
||||
const isActive = statusLabel.toUpperCase() === "ACTIVE"
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import type {
|
|||
} from "../../../types/questionTypeDefinition.types"
|
||||
|
||||
function formatDate(iso?: string): string {
|
||||
if (!iso) return "—"
|
||||
if (!iso) return "unassigned"
|
||||
const d = new Date(iso)
|
||||
return Number.isNaN(d.getTime()) ? iso : d.toLocaleString()
|
||||
}
|
||||
|
|
@ -234,7 +234,7 @@ export function QuestionTypeDefinitionPracticesDialog({
|
|||
publishStatusClass(practice.publish_status),
|
||||
)}
|
||||
>
|
||||
{practice.publish_status || "—"}
|
||||
{practice.publish_status || "unassigned"}
|
||||
</Badge>
|
||||
<Badge variant="secondary" className="font-mono text-[10px] uppercase tracking-wider">
|
||||
{practice.matching_question_count} matching question
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ export function PracticeSequentialReview({
|
|||
</div>
|
||||
<div className="rounded-xl border border-grayScale-200 bg-white px-5 py-4 shadow-sm">
|
||||
<p className="text-sm leading-relaxed text-grayScale-600">
|
||||
{guidanceText.trim() || "—"}
|
||||
{guidanceText.trim() || "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -303,7 +303,7 @@ export function PracticeSequentialReview({
|
|||
Text prompt
|
||||
</p>
|
||||
<p className="text-sm leading-relaxed text-grayScale-800">
|
||||
{question.questionText.trim() || "—"}
|
||||
{question.questionText.trim() || "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
{question.voicePrompt.trim() ? (
|
||||
|
|
@ -358,7 +358,7 @@ export function PracticeSequentialReview({
|
|||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-xs text-grayScale-400">—</p>
|
||||
<p className="text-xs text-grayScale-400">unassigned</p>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export function ReviewStep({
|
|||
const guidanceText =
|
||||
formData.tips?.trim() ||
|
||||
(!isLessonPractice ? formData.description?.trim() : "") ||
|
||||
"—";
|
||||
"unassigned";
|
||||
|
||||
const thumbnailUrl = isLessonPractice
|
||||
? null
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ export function SelectPracticeToAttachStep({
|
|||
publishStatusClass(practice.publish_status),
|
||||
)}
|
||||
>
|
||||
{(practice.publish_status || "—").toString()}
|
||||
{(practice.publish_status || "unassigned").toString()}
|
||||
</span>
|
||||
{alreadyLinked ? (
|
||||
<span className="text-[11px] font-semibold text-brand-600">
|
||||
|
|
|
|||
|
|
@ -131,11 +131,11 @@ export function QuestionTypeReviewPublishStep({
|
|||
</div>
|
||||
<div className="sm:col-span-2">
|
||||
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Description</dt>
|
||||
<dd className="font-medium text-grayScale-800 dark:text-grayScale-500 mt-1">{payload.description || "—"}</dd>
|
||||
<dd className="font-medium text-grayScale-800 dark:text-grayScale-500 mt-1">{payload.description || "unassigned"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Groups</dt>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{groupName || "—"}</dd>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{groupName || "unassigned"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Status</dt>
|
||||
|
|
@ -143,15 +143,15 @@ export function QuestionTypeReviewPublishStep({
|
|||
</div>
|
||||
<div>
|
||||
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Runtime type</dt>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{runtime ?? "—"}</dd>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{runtime ?? "unassigned"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Stimulus kinds</dt>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{payload.stimulus_component_kinds.join(", ") || "—"}</dd>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{payload.stimulus_component_kinds.join(", ") || "unassigned"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Response kinds</dt>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{payload.response_component_kinds.join(", ") || "—"}</dd>
|
||||
<dd className="font-medium text-grayScale-900 dark:text-grayScale-600 mt-1">{payload.response_component_kinds.join(", ") || "unassigned"}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
|
|
|
|||
|
|
@ -118,13 +118,13 @@ export function QuestionTypeValidatePreviewStep({
|
|||
<div>
|
||||
<dt className="text-[11px] font-bold uppercase text-grayScale-400">Stimulus kinds</dt>
|
||||
<dd className="mt-1 font-medium text-grayScale-800">
|
||||
{payload.stimulus_component_kinds.join(", ") || "—"}
|
||||
{payload.stimulus_component_kinds.join(", ") || "unassigned"}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-[11px] font-bold uppercase text-grayScale-400">Response kinds</dt>
|
||||
<dd className="mt-1 font-medium text-grayScale-800">
|
||||
{payload.response_component_kinds.join(", ") || "—"}
|
||||
{payload.response_component_kinds.join(", ") || "unassigned"}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -132,7 +132,7 @@ export function QuestionTypeValidatePreviewStep({
|
|||
<dd className="mt-1 font-medium text-grayScale-800">
|
||||
{payload.stimulus_schema.length
|
||||
? payload.stimulus_schema.map((r) => r.label).join(" · ")
|
||||
: "—"}
|
||||
: "unassigned"}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -140,7 +140,7 @@ export function QuestionTypeValidatePreviewStep({
|
|||
<dd className="mt-1 font-medium text-grayScale-800">
|
||||
{payload.response_schema.length
|
||||
? payload.response_schema.map((r) => r.label).join(" · ")
|
||||
: "—"}
|
||||
: "unassigned"}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ export function ReviewPublishStep({
|
|||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-grayScale-400 text-sm">—</p>
|
||||
<p className="text-grayScale-400 text-sm">unassigned</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ export function ReviewPublishStep({
|
|||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-grayScale-400 text-sm">—</p>
|
||||
<p className="text-grayScale-400 text-sm">unassigned</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -176,7 +176,7 @@ export function ReviewPublishStep({
|
|||
Title
|
||||
</span>
|
||||
<p className="text-[15px] font-medium text-grayScale-900">
|
||||
{formData.title || "—"}
|
||||
{formData.title || "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ export function ReviewPublishStep({
|
|||
<p className="text-[15px] font-medium text-grayScale-900">
|
||||
{formData.sortOrder.trim() !== ""
|
||||
? formData.sortOrder.trim()
|
||||
: "—"}
|
||||
: "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ export function ReviewPublishStep({
|
|||
className="text-[14px] text-grayScale-600 leading-relaxed max-w-4xl"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html:
|
||||
formData.description || "<p class='text-grayScale-400'>—</p>",
|
||||
formData.description || "<p class='text-grayScale-400'>unassigned</p>",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ export function FaqsPage() {
|
|||
{faq.category ? (
|
||||
<Badge variant="secondary">{faq.category}</Badge>
|
||||
) : (
|
||||
<span className="text-xs text-grayScale-400">—</span>
|
||||
<span className="text-xs text-grayScale-400">unassigned</span>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="text-center text-sm text-grayScale-600">
|
||||
|
|
|
|||
|
|
@ -127,10 +127,10 @@ export function FaqForm({
|
|||
Preview
|
||||
</p>
|
||||
<p className="mt-2 text-sm font-medium text-grayScale-900">
|
||||
{draft.question || "—"}
|
||||
{draft.question || "unassigned"}
|
||||
</p>
|
||||
<p className="mt-1 whitespace-pre-wrap text-xs leading-relaxed text-grayScale-600">
|
||||
{draft.answer || "—"}
|
||||
{draft.answer || "unassigned"}
|
||||
</p>
|
||||
{(draft.category || draft.display_order) && (
|
||||
<div className="mt-2.5 flex items-center gap-2 text-[11px] text-grayScale-400">
|
||||
|
|
@ -149,10 +149,10 @@ export function FaqForm({
|
|||
Preview
|
||||
</p>
|
||||
<p className="mt-2 text-sm font-medium text-grayScale-900">
|
||||
{draft.question || "—"}
|
||||
{draft.question || "unassigned"}
|
||||
</p>
|
||||
<p className="mt-1 whitespace-pre-wrap text-xs leading-relaxed text-grayScale-600">
|
||||
{draft.answer || "—"}
|
||||
{draft.answer || "unassigned"}
|
||||
</p>
|
||||
{(draft.category || draft.display_order) && (
|
||||
<div className="mt-2.5 flex items-center gap-2 text-[11px] text-grayScale-400">
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ function getRelativeTime(dateStr: string): string {
|
|||
|
||||
function formatRoleLabel(role: string | null | undefined): string {
|
||||
const r = String(role ?? "").trim();
|
||||
if (!r) return "—";
|
||||
if (!r) return "unassigned";
|
||||
return r
|
||||
.split("_")
|
||||
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
||||
|
|
@ -532,7 +532,7 @@ export function IssuesPage() {
|
|||
</div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm font-medium text-grayScale-600 truncate">
|
||||
{issue.subject?.trim() ? issue.subject : "—"}
|
||||
{issue.subject?.trim() ? issue.subject : "unassigned"}
|
||||
</p>
|
||||
<p className="text-xs text-grayScale-400 truncate mt-0.5">
|
||||
{issue.description?.trim() ? issue.description : "No description"}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ function recipientLabel(notification: Notification): string {
|
|||
if (notification.reciever) {
|
||||
parts.push(notification.reciever)
|
||||
}
|
||||
return parts.length > 0 ? parts.join(" · ") : "—"
|
||||
return parts.length > 0 ? parts.join(" · ") : "unassigned"
|
||||
}
|
||||
|
||||
export function AllNotificationsPage() {
|
||||
|
|
@ -355,14 +355,14 @@ export function AllNotificationsPage() {
|
|||
</TableCell>
|
||||
<TableCell className="max-w-[260px]">
|
||||
<p className="truncate text-sm font-medium text-grayScale-700">
|
||||
{getNotificationTitle(notification) || "—"}
|
||||
{getNotificationTitle(notification) || "unassigned"}
|
||||
</p>
|
||||
<p className="truncate text-xs text-grayScale-400">
|
||||
{getNotificationMessage(notification) || "—"}
|
||||
{getNotificationMessage(notification) || "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="text-xs capitalize text-grayScale-600">
|
||||
{channelLabel(notification.delivery_channel) || "—"}
|
||||
{channelLabel(notification.delivery_channel) || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="hidden text-xs text-grayScale-600 md:table-cell">
|
||||
{formatNotificationTypeLabel(notification.type)}
|
||||
|
|
@ -372,7 +372,7 @@ export function AllNotificationsPage() {
|
|||
variant={getNotificationLevelBadge(notification.level)}
|
||||
className="text-[10px]"
|
||||
>
|
||||
{notification.level || "—"}
|
||||
{notification.level || "unassigned"}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
|
|
@ -381,7 +381,7 @@ export function AllNotificationsPage() {
|
|||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell className="hidden text-xs capitalize text-grayScale-500 sm:table-cell">
|
||||
{notification.delivery_status || "—"}
|
||||
{notification.delivery_status || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="hidden text-xs text-grayScale-500 sm:table-cell">
|
||||
{formatNotificationTimestamp(notification.timestamp)}
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@ export function NotificationsPage() {
|
|||
<div>
|
||||
<p className="text-xs font-medium text-grayScale-500">Channels used</p>
|
||||
<p className="mt-1 text-xl font-semibold text-grayScale-700">
|
||||
{Array.from(new Set(notifications.map((n) => n.delivery_channel))).length || "—"}
|
||||
{Array.from(new Set(notifications.map((n) => n.delivery_channel))).length || "unassigned"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid h-11 w-11 shrink-0 place-items-center rounded-xl bg-brand-100/60 text-brand-600">
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export function ScheduledNotificationsPage() {
|
|||
if (job.target_raw?.emails?.length) {
|
||||
return `${job.target_raw.emails.length} email(s)`
|
||||
}
|
||||
return "—"
|
||||
return "unassigned"
|
||||
}
|
||||
|
||||
const activeFilterCount = countActiveFilters([
|
||||
|
|
@ -261,7 +261,7 @@ export function ScheduledNotificationsPage() {
|
|||
<TableCell>{channelLabel(job.channel)}</TableCell>
|
||||
<TableCell className="max-w-[240px]">
|
||||
<p className="truncate text-sm font-medium text-grayScale-700">
|
||||
{job.title || "—"}
|
||||
{job.title || "unassigned"}
|
||||
</p>
|
||||
<p className="truncate text-xs text-grayScale-400">{job.message}</p>
|
||||
{job.channel === "email" && job.email_template_slug ? (
|
||||
|
|
|
|||
|
|
@ -177,9 +177,9 @@ export function BulkSendSummaryPanel({ summary, onDismiss }: BulkSendSummaryPane
|
|||
Content
|
||||
</p>
|
||||
<p className="mt-1 truncate text-sm font-medium text-grayScale-800">
|
||||
{summary.titlePreview || "—"}
|
||||
{summary.titlePreview || "unassigned"}
|
||||
</p>
|
||||
<p className="truncate text-xs text-grayScale-500">{summary.messagePreview || "—"}</p>
|
||||
<p className="truncate text-xs text-grayScale-500">{summary.messagePreview || "unassigned"}</p>
|
||||
{!isImmediate && summary.emailTemplateSlug ? (
|
||||
<p className="mt-1 text-[10px] text-grayScale-400">
|
||||
Template: {summary.emailTemplateSlug}
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ export function PaymentsPage() {
|
|||
<td className="whitespace-nowrap px-3 py-2.5 sm:px-4">
|
||||
<p className="font-semibold text-grayScale-900">#{payment.id}</p>
|
||||
<p className="mt-0.5 max-w-[140px] truncate font-mono text-[11px] text-grayScale-500">
|
||||
{payment.transaction_id || payment.session_id || "—"}
|
||||
{payment.transaction_id || payment.session_id || "unassigned"}
|
||||
</p>
|
||||
</td>
|
||||
<td className="px-3 py-2.5 sm:px-4">
|
||||
|
|
@ -716,11 +716,11 @@ export function PaymentsPage() {
|
|||
<div className="mt-5 space-y-0 divide-y divide-grayScale-100">
|
||||
{[
|
||||
{ k: "Customer", v: paymentCustomerName(selected) },
|
||||
{ k: "Email", v: selected.user_email || "—" },
|
||||
{ k: "Email", v: selected.user_email || "unassigned" },
|
||||
{ k: "Plan", v: selected.plan_name || `Plan #${selected.plan_id}` },
|
||||
{ k: "Category", v: formatPaymentPlanCategory(selected.plan_category) },
|
||||
{ k: "Transaction", v: selected.transaction_id || "—", mono: true },
|
||||
{ k: "Session", v: selected.session_id || "—", mono: true },
|
||||
{ k: "Transaction", v: selected.transaction_id || "unassigned", mono: true },
|
||||
{ k: "Session", v: selected.session_id || "unassigned", mono: true },
|
||||
{ k: "Subscription", v: `#${selected.subscription_id}` },
|
||||
{ k: "Paid", v: formatPaymentDate(selected.paid_at ?? selected.created_at) },
|
||||
...(selected.expires_at ? [{ k: "Expires", v: formatPaymentDate(selected.expires_at) }] : []),
|
||||
|
|
|
|||
|
|
@ -388,10 +388,10 @@ export function TeamManagementPage() {
|
|||
</span>
|
||||
</TableCell>
|
||||
<TableCell className="hidden md:table-cell text-sm text-grayScale-600">
|
||||
{member.department || "—"}
|
||||
{member.department || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="hidden lg:table-cell text-sm text-grayScale-600">
|
||||
{member.job_title || "—"}
|
||||
{member.job_title || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="hidden sm:table-cell">
|
||||
{member.last_login ? (
|
||||
|
|
@ -406,7 +406,7 @@ export function TeamManagementPage() {
|
|||
) : (
|
||||
<div>
|
||||
<div className="text-sm text-grayScale-600">Never</div>
|
||||
<div className="text-xs text-grayScale-400">—</div>
|
||||
<div className="text-xs text-grayScale-400">unassigned</div>
|
||||
</div>
|
||||
)}
|
||||
</TableCell>
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ export function ActivityLogListPanel({
|
|||
</div>
|
||||
<div>
|
||||
<p className="text-2xl font-bold text-grayScale-600">
|
||||
{logs[0]?.created_at ? getRelativeActivityTime(logs[0].created_at) : "—"}
|
||||
{logs[0]?.created_at ? getRelativeActivityTime(logs[0].created_at) : "unassigned"}
|
||||
</p>
|
||||
<p className="text-xs text-grayScale-400">Latest on this page</p>
|
||||
</div>
|
||||
|
|
@ -450,7 +450,7 @@ export function ActivityLogListPanel({
|
|||
scrollable ? "whitespace-nowrap" : "max-w-[280px] truncate",
|
||||
)}
|
||||
>
|
||||
{log.message || "—"}
|
||||
{log.message || "unassigned"}
|
||||
</p>
|
||||
</TableCell>
|
||||
{showActorColumn ? (
|
||||
|
|
@ -583,7 +583,7 @@ export function ActivityLogListPanel({
|
|||
icon={<Shield className="h-4 w-4" />}
|
||||
label="Role"
|
||||
value={
|
||||
selectedLog.actor_role ? formatRoleLabel(selectedLog.actor_role) : "—"
|
||||
selectedLog.actor_role ? formatRoleLabel(selectedLog.actor_role) : "unassigned"
|
||||
}
|
||||
/>
|
||||
<DetailItem
|
||||
|
|
@ -601,13 +601,13 @@ export function ActivityLogListPanel({
|
|||
<DetailItem
|
||||
icon={<Globe className="h-4 w-4" />}
|
||||
label="IP address"
|
||||
value={selectedLog.ip_address || "—"}
|
||||
value={selectedLog.ip_address || "unassigned"}
|
||||
/>
|
||||
<DetailItem
|
||||
icon={<Monitor className="h-4 w-4" />}
|
||||
label="User agent"
|
||||
value={
|
||||
selectedLog.user_agent ? truncateUA(selectedLog.user_agent) : "—"
|
||||
selectedLog.user_agent ? truncateUA(selectedLog.user_agent) : "unassigned"
|
||||
}
|
||||
title={selectedLog.user_agent ?? undefined}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -542,21 +542,21 @@ export function DeletionRequestsPage() {
|
|||
{item.first_name} {item.last_name}
|
||||
</p>
|
||||
<p className="text-xs text-grayScale-500">{item.email}</p>
|
||||
<p className="text-xs text-grayScale-500">{item.phone_number || "—"}</p>
|
||||
<p className="text-xs text-grayScale-500">{item.phone_number || "unassigned"}</p>
|
||||
</TableCell>
|
||||
<TableCell className="py-3.5">
|
||||
<p className="text-sm text-grayScale-700">{item.role || "—"}</p>
|
||||
<p className="text-xs text-grayScale-500">{item.status || "—"}</p>
|
||||
<p className="text-sm text-grayScale-700">{item.role || "unassigned"}</p>
|
||||
<p className="text-xs text-grayScale-500">{item.status || "unassigned"}</p>
|
||||
</TableCell>
|
||||
<TableCell className="hidden py-3.5 text-sm text-grayScale-600 md:table-cell">
|
||||
{item.deletion_requested_at || "—"}
|
||||
{item.deletion_requested_at || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="hidden py-3.5 text-sm text-grayScale-600 md:table-cell">
|
||||
{item.deletion_scheduled_at || "—"}
|
||||
{item.deletion_scheduled_at || "unassigned"}
|
||||
</TableCell>
|
||||
<TableCell className="py-3.5">
|
||||
<Badge className={stateBadge[item.deletion_state] || "bg-grayScale-200 text-grayScale-600"}>
|
||||
{item.deletion_state || "—"}
|
||||
{item.deletion_state || "unassigned"}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ function formatDateTime(value?: string | null, emptyLabel = NOT_ASSIGNED_LABEL):
|
|||
|
||||
function formatActivityOccurredAt(iso: string): string {
|
||||
const d = new Date(iso);
|
||||
if (Number.isNaN(d.getTime())) return "—";
|
||||
if (Number.isNaN(d.getTime())) return "unassigned";
|
||||
|
||||
const now = new Date();
|
||||
const startToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ import { EXPORT_PERMISSIONS, EXPORT_ROUTES } from "../../lib/csv-export"
|
|||
import { usersExportQuery } from "../../lib/csvExportFilters"
|
||||
|
||||
function formatJoinedAt(iso: string): string {
|
||||
if (!iso?.trim()) return "—"
|
||||
if (!iso?.trim()) return "unassigned"
|
||||
const d = new Date(iso)
|
||||
if (Number.isNaN(d.getTime())) return "—"
|
||||
if (Number.isNaN(d.getTime())) return "unassigned"
|
||||
return d.toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" })
|
||||
}
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ export function UsersListPage() {
|
|||
const hasPhone = Boolean(phone?.trim())
|
||||
const hasEmail = Boolean(email?.trim())
|
||||
if (!hasPhone && !hasEmail) {
|
||||
return <span className="text-grayScale-400">—</span>
|
||||
return <span className="text-grayScale-400">unassigned</span>
|
||||
}
|
||||
return (
|
||||
<div className="space-y-1 text-sm text-grayScale-600">
|
||||
|
|
@ -406,7 +406,7 @@ export function UsersListPage() {
|
|||
) : userSummary ? (
|
||||
formatSummaryNum(userSummary.total_users)
|
||||
) : (
|
||||
"—"
|
||||
"unassigned"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -426,7 +426,7 @@ export function UsersListPage() {
|
|||
) : activeUsersTotal !== null ? (
|
||||
formatSummaryNum(activeUsersTotal)
|
||||
) : (
|
||||
"—"
|
||||
"unassigned"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -446,7 +446,7 @@ export function UsersListPage() {
|
|||
) : userSummary ? (
|
||||
formatSummaryNum(userSummary.new_month)
|
||||
) : (
|
||||
"—"
|
||||
"unassigned"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -665,15 +665,15 @@ export function UsersListPage() {
|
|||
<TableCell className="hidden md:table-cell align-top">
|
||||
{renderContactDetails(u.phoneNumber, u.email)}
|
||||
</TableCell>
|
||||
<TableCell className="hidden md:table-cell text-grayScale-500">{u.country || "-"}</TableCell>
|
||||
<TableCell className="hidden md:table-cell text-grayScale-500">{u.region || "-"}</TableCell>
|
||||
<TableCell className="hidden md:table-cell text-grayScale-500">{u.country || "unassigned"}</TableCell>
|
||||
<TableCell className="hidden md:table-cell text-grayScale-500">{u.region || "unassigned"}</TableCell>
|
||||
<TableCell className="hidden md:table-cell text-sm text-grayScale-500 whitespace-nowrap">
|
||||
{formatJoinedAt(u.createdAt)}
|
||||
</TableCell>
|
||||
<TableCell className="hidden lg:table-cell align-top text-sm text-grayScale-600">
|
||||
<span
|
||||
className={cn(
|
||||
u.subscriptionStatus === "—" ||
|
||||
u.subscriptionStatus === "unassigned" ||
|
||||
u.subscriptionStatus.toLowerCase() === "unsubscribed"
|
||||
? "text-grayScale-400"
|
||||
: undefined,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ type ExtendSubscriptionDialogProps = {
|
|||
}
|
||||
|
||||
function formatDateTime(value?: string | null): string {
|
||||
if (!value?.trim()) return "—"
|
||||
if (!value?.trim()) return "unassigned"
|
||||
const parsed = new Date(value)
|
||||
if (Number.isNaN(parsed.getTime())) return "—"
|
||||
if (Number.isNaN(parsed.getTime())) return "unassigned"
|
||||
return parsed.toLocaleString(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export const mapUserApiToUser = (u: UserApiDTO): User => ({
|
|||
country: u.country ?? "",
|
||||
lastLogin: null,
|
||||
status: u.status,
|
||||
subscriptionStatus: u.subscription_status?.trim() ? u.subscription_status.trim() : "—",
|
||||
subscriptionStatus: u.subscription_status?.trim() ? u.subscription_status.trim() : "unassigned",
|
||||
createdAt: u.created_at ?? "",
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user