Show unassigned instead of dashes for missing admin values.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-08-01 00:20:40 -07:00
parent 8df2eae342
commit ab8d487016
56 changed files with 172 additions and 159 deletions

View File

@ -236,7 +236,7 @@ export function DynamicTableBuilder({
key={`preview-c-${ri}-${ci}`} key={`preview-c-${ri}-${ci}`}
className="border border-grayScale-100 px-3 py-2 text-sm" 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> </td>
))} ))}
</tr> </tr>

View File

@ -187,9 +187,9 @@ function DetailsTab({
<div className="space-y-0 divide-y divide-grayScale-100"> <div className="space-y-0 divide-y divide-grayScale-100">
{[ {[
{ k: "Type", v: formatNotificationTypeLabel(notification.type) }, { 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: "Status", v: notification.is_read ? "Read" : "Unread" },
{ k: "Delivery", v: notification.delivery_status || "—" }, { k: "Delivery", v: notification.delivery_status || "unassigned" },
...(notification.receiver_type ...(notification.receiver_type
? [{ k: "Receiver", v: notification.receiver_type }] ? [{ k: "Receiver", v: notification.receiver_type }]
: []), : []),

View File

@ -68,10 +68,10 @@ function teamMemberToProfile(
return { return {
kind: "team", kind: "team",
id: member.id, id: member.id,
name: [member.first_name, member.last_name].filter(Boolean).join(" ") || "—", name: [member.first_name, member.last_name].filter(Boolean).join(" ") || "unassigned",
email: member.email || "—", email: member.email || "unassigned",
roleLabel: formatTeamRoleLabel(member.team_role), roleLabel: formatTeamRoleLabel(member.team_role),
status: member.status || "—", status: member.status || "unassigned",
emailVerified: Boolean(member.email_verified), emailVerified: Boolean(member.email_verified),
createdAt: member.created_at, createdAt: member.created_at,
} }
@ -81,17 +81,17 @@ function userToProfile(user: UserProfileData): ActorProfile {
return { return {
kind: "user", kind: "user",
id: user.id, id: user.id,
name: [user.first_name, user.last_name].filter(Boolean).join(" ") || "—", name: [user.first_name, user.last_name].filter(Boolean).join(" ") || "unassigned",
email: user.email || "—", email: user.email || "unassigned",
roleLabel: user.role roleLabel: user.role
? user.role.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()) ? user.role.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
: "—", : "unassigned",
status: user.status || "—", status: user.status || "unassigned",
emailVerified: Boolean(user.email_verified), emailVerified: Boolean(user.email_verified),
country: user.country || "—", country: user.country || "unassigned",
region: user.region || "—", region: user.region || "unassigned",
lastLogin: user.last_login, lastLogin: user.last_login,
subscriptionStatus: user.subscription_status?.trim() || "—", subscriptionStatus: user.subscription_status?.trim() || "unassigned",
createdAt: user.created_at, createdAt: user.created_at,
} }
} }

View File

@ -58,7 +58,7 @@ export function formatVersionStatus(status: string): string {
} }
export function formatAppVersionCreatedAt(raw: 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 normalized = raw.replace(" +0000 UTC", "Z").replace(/^(\d{4}-\d{2}-\d{2}) /, "$1T")
const d = new Date(normalized) const d = new Date(normalized)
if (Number.isNaN(d.getTime())) { if (Number.isNaN(d.getTime())) {

View File

@ -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 { export function displayValue(value: string | null | undefined): string {
const trimmed = value?.trim() 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)
} }

View File

@ -35,7 +35,7 @@ export function renderEmailTemplatePreview(
export function formatEmailTemplateDate(raw: string | null | undefined) { export function formatEmailTemplateDate(raw: string | null | undefined) {
if (raw == null || String(raw).trim() === "") { if (raw == null || String(raw).trim() === "") {
return "—" return "unassigned"
} }
const text = String(raw) const text = String(raw)
const parsed = new Date(text) const parsed = new Date(text)

View File

@ -15,7 +15,7 @@ export function faqStatusLabel(status: FAQStatus | string): string {
export function formatFaqDate(raw: string | null | undefined): string { export function formatFaqDate(raw: string | null | undefined): string {
if (raw == null || String(raw).trim() === "") { if (raw == null || String(raw).trim() === "") {
return "—" return "unassigned"
} }
const text = String(raw) const text = String(raw)
const parsed = new Date(text) const parsed = new Date(text)

View File

@ -55,7 +55,7 @@ export function getNotificationLevelBadge(level: string) {
export function formatNotificationTimestamp(ts: string) { export function formatNotificationTimestamp(ts: string) {
const date = new Date(ts) const date = new Date(ts)
if (Number.isNaN(date.getTime())) return "—" if (Number.isNaN(date.getTime())) return "unassigned"
const now = new Date() const now = new Date()
const diffMs = now.getTime() - date.getTime() const diffMs = now.getTime() - date.getTime()
const diffMin = Math.floor(diffMs / 60_000) const diffMin = Math.floor(diffMs / 60_000)
@ -83,7 +83,7 @@ export function formatNotificationTypeLabel(type: string) {
export function formatNotificationDateTime(ts: string) { export function formatNotificationDateTime(ts: string) {
const date = new Date(ts) const date = new Date(ts)
if (Number.isNaN(date.getTime())) return "—" if (Number.isNaN(date.getTime())) return "unassigned"
return date.toLocaleString(undefined, { return date.toLocaleString(undefined, {
year: "numeric", year: "numeric",
month: "short", month: "short",

View File

@ -10,7 +10,7 @@ export function formatPaymentAmount(payment: Pick<Payment, "amount" | "currency"
} }
export function formatPaymentDate(iso: string | null | undefined): string { export function formatPaymentDate(iso: string | null | undefined): string {
if (!iso) return "—" if (!iso) return "unassigned"
const d = new Date(iso) const d = new Date(iso)
if (Number.isNaN(d.getTime())) return iso if (Number.isNaN(d.getTime())) return iso
return d.toLocaleString(undefined, { return d.toLocaleString(undefined, {
@ -27,7 +27,7 @@ export function formatPaymentStatus(status: string): string {
} }
export function formatPaymentMethod(method: 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()) return method.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
} }

View File

@ -90,7 +90,7 @@ export function mapPersonaToCard(persona: PersonaListItem): PersonaCardModel {
} }
export function formatPersonaDate(dateStr: string | null | undefined): string { export function formatPersonaDate(dateStr: string | null | undefined): string {
if (!dateStr?.trim()) return "—" if (!dateStr?.trim()) return "unassigned"
const d = new Date(dateStr) const d = new Date(dateStr)
if (Number.isNaN(d.getTime())) return dateStr if (Number.isNaN(d.getTime())) return dateStr
return d.toLocaleDateString(undefined, { return d.toLocaleDateString(undefined, {
@ -106,7 +106,7 @@ export function personaStatusLabel(isActive: boolean): string {
export function personaGenderLabel(gender: string | null | undefined): string { export function personaGenderLabel(gender: string | null | undefined): string {
const value = gender?.trim() const value = gender?.trim()
return value ? value : "—" return value ? value : "unassigned"
} }
export function unwrapPersonasList( export function unwrapPersonasList(

View File

@ -7,7 +7,7 @@ export function formatAverageStars(value: number): string {
export function formatRatingDate(dateStr: string): string { export function formatRatingDate(dateStr: string): string {
const d = new Date(dateStr) const d = new Date(dateStr)
if (Number.isNaN(d.getTime())) return dateStr || "—" if (Number.isNaN(d.getTime())) return dateStr || "unassigned"
return d.toLocaleDateString(undefined, { return d.toLocaleDateString(undefined, {
year: "numeric", year: "numeric",
month: "short", month: "short",
@ -17,7 +17,7 @@ export function formatRatingDate(dateStr: string): string {
export function formatRatingDateTime(dateStr: string): string { export function formatRatingDateTime(dateStr: string): string {
const d = new Date(dateStr) const d = new Date(dateStr)
if (Number.isNaN(d.getTime())) return dateStr || "—" if (Number.isNaN(d.getTime())) return dateStr || "unassigned"
return d.toLocaleString(undefined, { return d.toLocaleString(undefined, {
year: "numeric", year: "numeric",
month: "short", month: "short",

View File

@ -39,6 +39,6 @@ export function formatAdminPaymentMethod(method: string | null | undefined): str
const value = String(method ?? "").trim().toUpperCase() const value = String(method ?? "").trim().toUpperCase()
if (value === "ADMIN_GRANT") return "Admin grant" if (value === "ADMIN_GRANT") return "Admin grant"
if (value === "ADMIN_EXTEND") return "Admin extend" if (value === "ADMIN_EXTEND") return "Admin extend"
if (!value) return "—" if (!value) return "unassigned"
return method!.trim() return method!.trim()
} }

View File

@ -1,7 +1,7 @@
import type { VerifyInvitationData } from "../types/teamInvitation.types" import type { VerifyInvitationData } from "../types/teamInvitation.types"
export function formatTeamRoleLabel(role: string | undefined): string { 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()) return role.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
} }

View File

@ -26,7 +26,7 @@ import { ProfileAvatarUpload } from "../components/profile/ProfileAvatarUpload";
import { PersonaProfilePictureUploadField } from "./personas/components/PersonaProfilePictureUploadField"; import { PersonaProfilePictureUploadField } from "./personas/components/PersonaProfilePictureUploadField";
function formatDate(dateStr: string | null | undefined): string { function formatDate(dateStr: string | null | undefined): string {
if (!dateStr) return "—"; if (!dateStr) return "unassigned";
const date = new Date(dateStr); const date = new Date(dateStr);
if (Number.isNaN(date.getTime())) return dateStr; if (Number.isNaN(date.getTime())) return dateStr;
return date.toLocaleDateString(undefined, { return date.toLocaleDateString(undefined, {
@ -37,7 +37,7 @@ function formatDate(dateStr: string | null | undefined): string {
} }
function formatDateTime(dateStr: string | null | undefined): string { function formatDateTime(dateStr: string | null | undefined): string {
if (!dateStr) return "—"; if (!dateStr) return "unassigned";
const date = new Date(dateStr); const date = new Date(dateStr);
if (Number.isNaN(date.getTime())) return dateStr; if (Number.isNaN(date.getTime())) return dateStr;
return date.toLocaleString(undefined, { return date.toLocaleString(undefined, {
@ -51,7 +51,7 @@ function formatDateTime(dateStr: string | null | undefined): string {
function formatRoleLabel(role: string): string { function formatRoleLabel(role: string): string {
const value = role.trim(); const value = role.trim();
if (!value) return "—"; if (!value) return "unassigned";
return value return value
.split("_") .split("_")
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase()) .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 { function displayValue(value: string | null | undefined): string {
const trimmed = value?.trim(); const trimmed = value?.trim();
return trimmed ? trimmed : "—"; return trimmed ? trimmed : "unassigned";
} }
function FieldGroup({ function FieldGroup({

View File

@ -606,16 +606,16 @@ export function AddNewLessonPage() {
<div className="flex items-center justify-between px-4 py-3 text-sm"> <div className="flex items-center justify-between px-4 py-3 text-sm">
<span className="text-grayScale-500">Description</span> <span className="text-grayScale-500">Description</span>
<span className="max-w-[55%] truncate text-right font-medium text-grayScale-800"> <span className="max-w-[55%] truncate text-right font-medium text-grayScale-800">
{lessonDescription || "—"} {lessonDescription || "unassigned"}
</span> </span>
</div> </div>
<div className="flex items-center justify-between px-4 py-3 text-sm"> <div className="flex items-center justify-between px-4 py-3 text-sm">
<span className="text-grayScale-500">Intro video URL</span> <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>
<div className="flex items-center justify-between px-4 py-3 text-sm"> <div className="flex items-center justify-between px-4 py-3 text-sm">
<span className="text-grayScale-500">Sub-module</span> <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> </div>
</div> </div>

View File

@ -490,7 +490,7 @@ export function CourseDetailPage() {
(!loading && !course (!loading && !course
? "This course could not be loaded." ? "This course could not be loaded."
: !course?.description?.trim() && course : !course?.description?.trim() && course
? "—" ? "unassigned"
: ""); : "");
return ( return (
@ -787,7 +787,7 @@ export function CourseDetailPage() {
<p className="text-[12px] font-medium leading-snug text-grayScale-400 line-clamp-3"> <p className="text-[12px] font-medium leading-snug text-grayScale-400 line-clamp-3">
{module.description?.trim() {module.description?.trim()
? module.description ? module.description
: "—"} : "unassigned"}
</p> </p>
</div> </div>
</div> </div>

View File

@ -166,7 +166,7 @@ export function CourseManagementPage() {
list.map((row, index) => ({ list.map((row, index) => ({
id: Number(row.id), id: Number(row.id),
name: row.name?.trim() || `Unit ${row.id}`, name: row.name?.trim() || `Unit ${row.id}`,
description: row.description?.trim() || "—", description: row.description?.trim() || "unassigned",
thumbnail: row.thumbnail?.trim() || "", thumbnail: row.thumbnail?.trim() || "",
sortOrder: Number(row.sort_order ?? 0), sortOrder: Number(row.sort_order ?? 0),
publishStatus: row.publish_status ?? null, publishStatus: row.publish_status ?? null,
@ -466,7 +466,7 @@ export function CourseManagementPage() {
try { try {
const existing = units.find((u) => u.id === editingUnitId); const existing = units.find((u) => u.id === editingUnitId);
const preservedDescription = const preservedDescription =
existing?.description && existing.description !== "—" existing?.description && existing.description !== "unassigned"
? existing.description ? existing.description
: null; : null;
const minioThumbnail = await resolveThumbnailToMinioUrl(editThumbnail); const minioThumbnail = await resolveThumbnailToMinioUrl(editThumbnail);

View File

@ -79,7 +79,7 @@ export function CourseModuleDetailPage() {
[lessonPracticeChoice], [lessonPracticeChoice],
); );
const [moduleTitle, setModuleTitle] = useState("Module"); const [moduleTitle, setModuleTitle] = useState("Module");
const [moduleDescription, setModuleDescription] = useState("—"); const [moduleDescription, setModuleDescription] = useState("unassigned");
const [modulePublishStatus, setModulePublishStatus] = useState< const [modulePublishStatus, setModulePublishStatus] = useState<
PracticePublishStatus | string | null PracticePublishStatus | string | null
>(null); >(null);
@ -173,17 +173,17 @@ export function CourseModuleDetailPage() {
const row = list.find((m) => Number(m.id) === parsedModuleId); const row = list.find((m) => Number(m.id) === parsedModuleId);
if (row) { if (row) {
setModuleTitle(row.name?.trim() || `Module ${parsedModuleId}`); setModuleTitle(row.name?.trim() || `Module ${parsedModuleId}`);
setModuleDescription(row.description?.trim() || "—"); setModuleDescription(row.description?.trim() || "unassigned");
setModulePublishStatus(row.publish_status ?? null); setModulePublishStatus(row.publish_status ?? null);
} else { } else {
setModuleTitle(`Module ${parsedModuleId}`); setModuleTitle(`Module ${parsedModuleId}`);
setModuleDescription("—"); setModuleDescription("unassigned");
setModulePublishStatus(null); setModulePublishStatus(null);
} }
} catch (error) { } catch (error) {
console.error(error); console.error(error);
setModuleTitle(`Module ${parsedModuleId}`); setModuleTitle(`Module ${parsedModuleId}`);
setModuleDescription("—"); setModuleDescription("unassigned");
} }
}, [parsedModuleId, parsedUnitId]); }, [parsedModuleId, parsedUnitId]);

View File

@ -415,7 +415,7 @@ export function CoursesPage() {
</TableCell> </TableCell>
<TableCell> <TableCell>
<p className="max-w-md truncate text-sm text-grayScale-600" title={sub.description || undefined}> <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> </p>
</TableCell> </TableCell>
<TableCell className="hidden xl:table-cell tabular-nums text-sm text-grayScale-600"> <TableCell className="hidden xl:table-cell tabular-nums text-sm text-grayScale-600">

View File

@ -44,7 +44,7 @@ function formatTableDate(dateStr: string) {
} }
function formatVideoDuration(seconds: number) { 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 m = Math.floor(seconds / 60)
const s = Math.floor(seconds % 60) const s = Math.floor(seconds % 60)
return m > 0 ? `${m}:${s.toString().padStart(2, "0")}` : `${s}s` return m > 0 ? `${m}:${s.toString().padStart(2, "0")}` : `${s}s`
@ -526,12 +526,12 @@ export function HumanLanguageSubModulePage() {
<TableCell>{questionSetStatusBadge(item.status)}</TableCell> <TableCell>{questionSetStatusBadge(item.status)}</TableCell>
<TableCell> <TableCell>
<p className="max-w-[280px] truncate text-sm text-grayScale-600"> <p className="max-w-[280px] truncate text-sm text-grayScale-600">
{item.description?.trim() ? item.description : "—"} {item.description?.trim() ? item.description : "unassigned"}
</p> </p>
</TableCell> </TableCell>
<TableCell className="hidden lg:table-cell"> <TableCell className="hidden lg:table-cell">
<p className="max-w-[140px] truncate text-sm text-grayScale-600"> <p className="max-w-[140px] truncate text-sm text-grayScale-600">
{item.persona?.trim() ? item.persona : "—"} {item.persona?.trim() ? item.persona : "unassigned"}
</p> </p>
</TableCell> </TableCell>
<TableCell className="hidden md:table-cell"> <TableCell className="hidden md:table-cell">
@ -673,7 +673,7 @@ export function HumanLanguageSubModulePage() {
<TableCell>{lessonStatusBadge(lesson.is_active)}</TableCell> <TableCell>{lessonStatusBadge(lesson.is_active)}</TableCell>
<TableCell> <TableCell>
<p className="max-w-[280px] truncate text-sm text-grayScale-600"> <p className="max-w-[280px] truncate text-sm text-grayScale-600">
{lesson.description?.trim() ? lesson.description : "—"} {lesson.description?.trim() ? lesson.description : "unassigned"}
</p> </p>
</TableCell> </TableCell>
<TableCell className="hidden lg:table-cell"> <TableCell className="hidden lg:table-cell">
@ -985,7 +985,7 @@ export function HumanLanguageSubModulePage() {
</TableCell> </TableCell>
<TableCell> <TableCell>
<p className="max-w-[280px] truncate text-sm text-grayScale-600"> <p className="max-w-[280px] truncate text-sm text-grayScale-600">
{v.description?.trim() ? v.description : "—"} {v.description?.trim() ? v.description : "unassigned"}
</p> </p>
</TableCell> </TableCell>
<TableCell className="hidden sm:table-cell"> <TableCell className="hidden sm:table-cell">
@ -1031,7 +1031,7 @@ export function HumanLanguageSubModulePage() {
</a> </a>
</Button> </Button>
) : ( ) : (
<span className="text-sm text-grayScale-400">—</span> <span className="text-sm text-grayScale-400">unassigned</span>
)} )}
</TableCell> </TableCell>
</TableRow> </TableRow>

View File

@ -817,7 +817,7 @@ export function InitialAssessmentPage() {
> >
{(() => { {(() => {
const value = String(q.difficultyLevel ?? "").trim() const value = String(q.difficultyLevel ?? "").trim()
if (!value || value === "—" || value === "-") return "unassigned" if (!value || value === "unassigned" || value === "-") return "unassigned"
return value.toLowerCase() return value.toLowerCase()
})()} })()}
</span> </span>

View File

@ -732,7 +732,7 @@ export function LearnEnglishPage() {
<p className="mt-2 text-sm leading-relaxed text-grayScale-500 line-clamp-4"> <p className="mt-2 text-sm leading-relaxed text-grayScale-500 line-clamp-4">
{program.description?.trim() {program.description?.trim()
? program.description ? program.description
: "—"} : "unassigned"}
</p> </p>
</div> </div>
<Link <Link

View File

@ -157,15 +157,15 @@ export function ModuleDetailPage() {
const displayModuleDescription = (() => { const displayModuleDescription = (() => {
if (hasNavName) { if (hasNavName) {
return navState?.moduleDescription?.trim() || "—"; return navState?.moduleDescription?.trim() || "unassigned";
} }
if (!moduleListResolved) { if (!moduleListResolved) {
return "Loading…"; return "Loading…";
} }
if (loadedModuleDescription !== null) { if (loadedModuleDescription !== null) {
return loadedModuleDescription.trim() || "—"; return loadedModuleDescription.trim() || "unassigned";
} }
return "—"; return "unassigned";
})(); })();
useEffect(() => { useEffect(() => {

View File

@ -994,7 +994,7 @@ export function PracticeDetailsPage() {
<div> <div>
<p className="text-xs font-bold uppercase tracking-wider text-grayScale-500">Story</p> <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"> <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> </p>
</div> </div>
{quickTipParts.length > 0 && ( {quickTipParts.length > 0 && (

View File

@ -647,7 +647,7 @@ export function PracticeQuestionsPage() {
Points: {question.points ?? 0} Points: {question.points ?? 0}
</span> </span>
<span className="rounded-md bg-grayScale-100 px-2 py-1"> <span className="rounded-md bg-grayScale-100 px-2 py-1">
Difficulty: {question.difficulty_level || "—"} Difficulty: {question.difficulty_level || "unassigned"}
</span> </span>
</div> </div>
</div> </div>

View File

@ -759,7 +759,7 @@ export function ProgramCoursesPage() {
{course.name} {course.name}
</h3> </h3>
<p className="mt-2 text-[13px] leading-relaxed text-grayScale-500 line-clamp-2"> <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> </p>
<div className="my-6 grid grid-cols-3 gap-4 border-y border-grayScale-50 py-4"> <div className="my-6 grid grid-cols-3 gap-4 border-y border-grayScale-50 py-4">

View File

@ -116,7 +116,7 @@ export function ProgramDetailPage() {
list.map((row) => ({ list.map((row) => ({
id: Number(row.id), id: Number(row.id),
name: row.name?.trim() || `Course ${row.id}`, name: row.name?.trim() || `Course ${row.id}`,
description: row.description?.trim() || "—", description: row.description?.trim() || "unassigned",
thumbnail: row.thumbnail?.trim() || null, thumbnail: row.thumbnail?.trim() || null,
sortOrder: Number(row.sort_order ?? 0), sortOrder: Number(row.sort_order ?? 0),
publishStatus: row.publish_status ?? null, publishStatus: row.publish_status ?? null,
@ -310,7 +310,7 @@ export function ProgramDetailPage() {
{ {
id: row.id, id: row.id,
name: row.name ?? name, name: row.name ?? name,
description: row.description?.trim() || "—", description: row.description?.trim() || "unassigned",
thumbnail: row.thumbnail?.trim() || null, thumbnail: row.thumbnail?.trim() || null,
sortOrder: Number(row.sort_order ?? 0), sortOrder: Number(row.sort_order ?? 0),
unitsCount: Number(row.units_count ?? 0), unitsCount: Number(row.units_count ?? 0),
@ -393,7 +393,7 @@ export function ProgramDetailPage() {
const minioThumbnail = await resolveThumbnailToMinioUrl(editThumbnail); const minioThumbnail = await resolveThumbnailToMinioUrl(editThumbnail);
const existing = createdCourses.find((c) => c.id === editingCourseId); const existing = createdCourses.find((c) => c.id === editingCourseId);
const preservedDescription = const preservedDescription =
existing?.description && existing.description !== "—" existing?.description && existing.description !== "unassigned"
? existing.description ? existing.description
: null; : null;
const response = await updateExamPrepCatalogCourse(editingCourseId, { const response = await updateExamPrepCatalogCourse(editingCourseId, {
@ -409,7 +409,7 @@ export function ProgramDetailPage() {
? { ? {
...course, ...course,
name: row?.name ?? name, name: row?.name ?? name,
description: row?.description?.trim() || preservedDescription || "—", description: row?.description?.trim() || preservedDescription || "unassigned",
thumbnail: row?.thumbnail?.trim() || null, thumbnail: row?.thumbnail?.trim() || null,
sortOrder: Number(row?.sort_order ?? sortOrderNum), sortOrder: Number(row?.sort_order ?? sortOrderNum),
unitsCount: Number(row?.units_count ?? course.unitsCount ?? 0), unitsCount: Number(row?.units_count ?? course.unitsCount ?? 0),

View File

@ -523,7 +523,7 @@ export function QuestionsPage() {
)} )}
</TableCell> </TableCell>
<TableCell className="hidden py-3.5 text-sm text-grayScale-500 md:table-cell"> <TableCell className="hidden py-3.5 text-sm text-grayScale-500 md:table-cell">
{question.status || "—"} {question.status || "unassigned"}
</TableCell> </TableCell>
<TableCell className="py-3.5 text-sm font-semibold text-grayScale-600"> <TableCell className="py-3.5 text-sm font-semibold text-grayScale-600">
{question.points ?? 0} {question.points ?? 0}
@ -696,10 +696,10 @@ export function QuestionsPage() {
<div className="grid grid-cols-1 gap-3 text-sm sm:grid-cols-2"> <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">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">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">Points:</span> {detailData.points ?? 0}</p>
<p><span className="font-medium">Status:</span> {detailData.status || "—"}</p> <p><span className="font-medium">Status:</span> {detailData.status || "unassigned"}</p>
<p><span className="font-medium">Created:</span> {detailData.created_at || "—"}</p> <p><span className="font-medium">Created:</span> {detailData.created_at || "unassigned"}</p>
</div> </div>
{detailData.explanation ? ( {detailData.explanation ? (
<div> <div>
@ -755,7 +755,7 @@ export function QuestionsPage() {
: (answer as { acceptable_answer?: string }).acceptable_answer || "" : (answer as { acceptable_answer?: string }).acceptable_answer || ""
return ( return (
<p key={`${value}-${index}`} className="rounded-md border border-grayScale-200 bg-grayScale-50 px-2 py-1"> <p key={`${value}-${index}`} className="rounded-md border border-grayScale-200 bg-grayScale-50 px-2 py-1">
{value || "—"} {value || "unassigned"}
</p> </p>
) )
})} })}

View File

@ -1498,13 +1498,13 @@ export function SpeakingPage() {
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs"> <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-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"> <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>
<span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600"> <span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600">
Points: {question.points ?? 0} Points: {question.points ?? 0}
</span> </span>
<span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600"> <span className="rounded-md bg-grayScale-100 px-2 py-1 text-grayScale-600">
Status: {question.status || "—"} Status: {question.status || "unassigned"}
</span> </span>
</div> </div>
{question.image_url && imagePreviewByQuestionId[question.id] ? ( {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 className="grid grid-cols-1 gap-3 text-sm sm:grid-cols-2">
<div> <div>
<p className="text-xs font-medium text-grayScale-500">Status</p> <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>
<div> <div>
<p className="text-xs font-medium text-grayScale-500">Points</p> <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>
<div> <div>
<p className="text-xs font-medium text-grayScale-500">Difficulty</p> <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>
<div> <div>
<p className="text-xs font-medium text-grayScale-500">Type</p> <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>
</div> </div>
{selectedQuestionDetail.audio_correct_answer_text ? ( {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"> <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> <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"> <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">Title:</span> {setTitle || "unassigned"}</p>
<p><span className="font-medium">Course ID:</span> {subCourseId || "—"}</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 || "—"}</p> <p className="sm:col-span-2"><span className="font-medium">Description:</span> {setDescription || "unassigned"}</p>
<p className="sm:col-span-2 break-all"> <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>
<p><span className="font-medium">Status:</span> {setStatus}</p> <p><span className="font-medium">Status:</span> {setStatus}</p>
</div> </div>
@ -2467,27 +2467,27 @@ export function SpeakingPage() {
<p><span className="font-medium text-grayScale-700">Status:</span> {setStatus}</p> <p><span className="font-medium text-grayScale-700">Status:</span> {setStatus}</p>
<p className="sm:col-span-2"> <p className="sm:col-span-2">
<span className="font-medium text-grayScale-700">Voice Prompt:</span>{" "} <span className="font-medium text-grayScale-700">Voice Prompt:</span>{" "}
{draft.voicePrompt.trim() || "—"} {draft.voicePrompt.trim() || "unassigned"}
</p> </p>
<p className="sm:col-span-2"> <p className="sm:col-span-2">
<span className="font-medium text-grayScale-700">Sample Answer Voice Prompt:</span>{" "} <span className="font-medium text-grayScale-700">Sample Answer Voice Prompt:</span>{" "}
{draft.sampleAnswerVoicePrompt.trim() || "—"} {draft.sampleAnswerVoicePrompt.trim() || "unassigned"}
</p> </p>
<p className="sm:col-span-2"> <p className="sm:col-span-2">
<span className="font-medium text-grayScale-700">Image URL:</span>{" "} <span className="font-medium text-grayScale-700">Image URL:</span>{" "}
{draft.imageUrl.trim() || "—"} {draft.imageUrl.trim() || "unassigned"}
</p> </p>
<p className="sm:col-span-2"> <p className="sm:col-span-2">
<span className="font-medium text-grayScale-700">Audio Correct Answer Text:</span>{" "} <span className="font-medium text-grayScale-700">Audio Correct Answer Text:</span>{" "}
{draft.audioCorrectAnswerText.trim() || "—"} {draft.audioCorrectAnswerText.trim() || "unassigned"}
</p> </p>
<p className="sm:col-span-2"> <p className="sm:col-span-2">
<span className="font-medium text-grayScale-700">Tips:</span>{" "} <span className="font-medium text-grayScale-700">Tips:</span>{" "}
{draft.tips.trim() || "—"} {draft.tips.trim() || "unassigned"}
</p> </p>
<p className="sm:col-span-2"> <p className="sm:col-span-2">
<span className="font-medium text-grayScale-700">Explanation:</span>{" "} <span className="font-medium text-grayScale-700">Explanation:</span>{" "}
{draft.explanation.trim() || "—"} {draft.explanation.trim() || "unassigned"}
</p> </p>
</div> </div>
<div className="mt-2 flex flex-wrap gap-3"> <div className="mt-2 flex flex-wrap gap-3">

View File

@ -625,7 +625,7 @@ export function SubModuleContentPage() {
day: "numeric", day: "numeric",
year: "numeric", year: "numeric",
}) })
: "—"} : "unassigned"}
</span> </span>
<div className="flex gap-0.5" onClick={(e) => e.stopPropagation()}> <div className="flex gap-0.5" onClick={(e) => e.stopPropagation()}>
<button <button

View File

@ -209,7 +209,7 @@ export function UnitManagementPage() {
list.map((row, index) => ({ list.map((row, index) => ({
id: Number(row.id), id: Number(row.id),
name: row.name?.trim() || `Module ${row.id}`, name: row.name?.trim() || `Module ${row.id}`,
description: row.description?.trim() || "—", description: row.description?.trim() || "unassigned",
thumbnail: row.thumbnail?.trim() || "", thumbnail: row.thumbnail?.trim() || "",
icon: row.icon?.trim() || "", icon: row.icon?.trim() || "",
sortOrder: Number(row.sort_order ?? 0), sortOrder: Number(row.sort_order ?? 0),
@ -524,7 +524,7 @@ export function UnitManagementPage() {
try { try {
const existing = modules.find((m) => m.id === editingModuleId); const existing = modules.find((m) => m.id === editingModuleId);
const preservedDescription = const preservedDescription =
existing?.description && existing.description !== "—" existing?.description && existing.description !== "unassigned"
? existing.description ? existing.description
: null; : null;
const minioThumbnail = await resolveToMinioUrl(editThumbnail); const minioThumbnail = await resolveToMinioUrl(editThumbnail);

View File

@ -67,7 +67,7 @@ export function AddNewPracticeReviewStep({
.map((q) => q.tips?.trim() ?? "") .map((q) => q.tips?.trim() ?? "")
.filter(Boolean) .filter(Boolean)
.join(" "); .join(" ");
return tips || "—"; return tips || "unassigned";
}, [practiceDescription, questions]); }, [practiceDescription, questions]);
const thumbnailKind = const thumbnailKind =

View File

@ -1,7 +1,7 @@
import { useEffect, useRef, useState, type ReactNode } from "react" import { useEffect, useRef, useState, type ReactNode } from "react"
import { cn } from "../../../lib/utils" import { cn } from "../../../lib/utils"
const PLACEHOLDER_VALUES = new Set(["—", "-", "Loading…", "Loading..."]) const PLACEHOLDER_VALUES = new Set(["unassigned", "—", "-", "Not assigned", "Loading…", "Loading..."])
type ContentPageDescriptionProps = { type ContentPageDescriptionProps = {
children: ReactNode children: ReactNode

View File

@ -33,7 +33,7 @@ export function QuestionTypeCard({
onCreatePractice, onCreatePractice,
deleteDisabled, deleteDisabled,
}: QuestionTypeDefinitionCardModel) { }: QuestionTypeDefinitionCardModel) {
const statusLabel = (status || "—").toString() const statusLabel = (status || "unassigned").toString()
const isActive = statusLabel.toUpperCase() === "ACTIVE" const isActive = statusLabel.toUpperCase() === "ACTIVE"
return ( return (

View File

@ -27,7 +27,7 @@ import type {
} from "../../../types/questionTypeDefinition.types" } from "../../../types/questionTypeDefinition.types"
function formatDate(iso?: string): string { function formatDate(iso?: string): string {
if (!iso) return "—" if (!iso) return "unassigned"
const d = new Date(iso) const d = new Date(iso)
return Number.isNaN(d.getTime()) ? iso : d.toLocaleString() return Number.isNaN(d.getTime()) ? iso : d.toLocaleString()
} }
@ -234,7 +234,7 @@ export function QuestionTypeDefinitionPracticesDialog({
publishStatusClass(practice.publish_status), publishStatusClass(practice.publish_status),
)} )}
> >
{practice.publish_status || "—"} {practice.publish_status || "unassigned"}
</Badge> </Badge>
<Badge variant="secondary" className="font-mono text-[10px] uppercase tracking-wider"> <Badge variant="secondary" className="font-mono text-[10px] uppercase tracking-wider">
{practice.matching_question_count} matching question {practice.matching_question_count} matching question

View File

@ -278,7 +278,7 @@ export function PracticeSequentialReview({
</div> </div>
<div className="rounded-xl border border-grayScale-200 bg-white px-5 py-4 shadow-sm"> <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"> <p className="text-sm leading-relaxed text-grayScale-600">
{guidanceText.trim() || "—"} {guidanceText.trim() || "unassigned"}
</p> </p>
</div> </div>
</div> </div>
@ -303,7 +303,7 @@ export function PracticeSequentialReview({
Text prompt Text prompt
</p> </p>
<p className="text-sm leading-relaxed text-grayScale-800"> <p className="text-sm leading-relaxed text-grayScale-800">
{question.questionText.trim() || "—"} {question.questionText.trim() || "unassigned"}
</p> </p>
</div> </div>
{question.voicePrompt.trim() ? ( {question.voicePrompt.trim() ? (
@ -358,7 +358,7 @@ export function PracticeSequentialReview({
/> />
</div> </div>
) : ( ) : (
<p className="text-xs text-grayScale-400">—</p> <p className="text-xs text-grayScale-400">unassigned</p>
)} )}
</div> </div>
))} ))}

View File

@ -96,7 +96,7 @@ export function ReviewStep({
const guidanceText = const guidanceText =
formData.tips?.trim() || formData.tips?.trim() ||
(!isLessonPractice ? formData.description?.trim() : "") || (!isLessonPractice ? formData.description?.trim() : "") ||
"—"; "unassigned";
const thumbnailUrl = isLessonPractice const thumbnailUrl = isLessonPractice
? null ? null

View File

@ -254,7 +254,7 @@ export function SelectPracticeToAttachStep({
publishStatusClass(practice.publish_status), publishStatusClass(practice.publish_status),
)} )}
> >
{(practice.publish_status || "—").toString()} {(practice.publish_status || "unassigned").toString()}
</span> </span>
{alreadyLinked ? ( {alreadyLinked ? (
<span className="text-[11px] font-semibold text-brand-600"> <span className="text-[11px] font-semibold text-brand-600">

View File

@ -131,11 +131,11 @@ export function QuestionTypeReviewPublishStep({
</div> </div>
<div className="sm:col-span-2"> <div className="sm:col-span-2">
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Description</dt> <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>
<div> <div>
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Groups</dt> <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>
<div> <div>
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Status</dt> <dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Status</dt>
@ -143,15 +143,15 @@ export function QuestionTypeReviewPublishStep({
</div> </div>
<div> <div>
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Runtime type</dt> <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>
<div> <div>
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Stimulus kinds</dt> <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>
<div> <div>
<dt className="text-grayScale-400 font-semibold uppercase text-[11px] tracking-wide">Response kinds</dt> <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> </div>
</dl> </dl>

View File

@ -118,13 +118,13 @@ export function QuestionTypeValidatePreviewStep({
<div> <div>
<dt className="text-[11px] font-bold uppercase text-grayScale-400">Stimulus kinds</dt> <dt className="text-[11px] font-bold uppercase text-grayScale-400">Stimulus kinds</dt>
<dd className="mt-1 font-medium text-grayScale-800"> <dd className="mt-1 font-medium text-grayScale-800">
{payload.stimulus_component_kinds.join(", ") || "—"} {payload.stimulus_component_kinds.join(", ") || "unassigned"}
</dd> </dd>
</div> </div>
<div> <div>
<dt className="text-[11px] font-bold uppercase text-grayScale-400">Response kinds</dt> <dt className="text-[11px] font-bold uppercase text-grayScale-400">Response kinds</dt>
<dd className="mt-1 font-medium text-grayScale-800"> <dd className="mt-1 font-medium text-grayScale-800">
{payload.response_component_kinds.join(", ") || "—"} {payload.response_component_kinds.join(", ") || "unassigned"}
</dd> </dd>
</div> </div>
<div> <div>
@ -132,7 +132,7 @@ export function QuestionTypeValidatePreviewStep({
<dd className="mt-1 font-medium text-grayScale-800"> <dd className="mt-1 font-medium text-grayScale-800">
{payload.stimulus_schema.length {payload.stimulus_schema.length
? payload.stimulus_schema.map((r) => r.label).join(" · ") ? payload.stimulus_schema.map((r) => r.label).join(" · ")
: "—"} : "unassigned"}
</dd> </dd>
</div> </div>
<div> <div>
@ -140,7 +140,7 @@ export function QuestionTypeValidatePreviewStep({
<dd className="mt-1 font-medium text-grayScale-800"> <dd className="mt-1 font-medium text-grayScale-800">
{payload.response_schema.length {payload.response_schema.length
? payload.response_schema.map((r) => r.label).join(" · ") ? payload.response_schema.map((r) => r.label).join(" · ")
: "—"} : "unassigned"}
</dd> </dd>
</div> </div>
</dl> </dl>

View File

@ -115,7 +115,7 @@ export function ReviewPublishStep({
</div> </div>
</div> </div>
) : ( ) : (
<p className="text-grayScale-400 text-sm">—</p> <p className="text-grayScale-400 text-sm">unassigned</p>
)} )}
</div> </div>
@ -148,7 +148,7 @@ export function ReviewPublishStep({
</p> </p>
</div> </div>
) : ( ) : (
<p className="text-grayScale-400 text-sm">—</p> <p className="text-grayScale-400 text-sm">unassigned</p>
)} )}
</div> </div>
</div> </div>
@ -176,7 +176,7 @@ export function ReviewPublishStep({
Title Title
</span> </span>
<p className="text-[15px] font-medium text-grayScale-900"> <p className="text-[15px] font-medium text-grayScale-900">
{formData.title || "—"} {formData.title || "unassigned"}
</p> </p>
</div> </div>
@ -187,7 +187,7 @@ export function ReviewPublishStep({
<p className="text-[15px] font-medium text-grayScale-900"> <p className="text-[15px] font-medium text-grayScale-900">
{formData.sortOrder.trim() !== "" {formData.sortOrder.trim() !== ""
? formData.sortOrder.trim() ? formData.sortOrder.trim()
: "—"} : "unassigned"}
</p> </p>
</div> </div>
@ -199,7 +199,7 @@ export function ReviewPublishStep({
className="text-[14px] text-grayScale-600 leading-relaxed max-w-4xl" className="text-[14px] text-grayScale-600 leading-relaxed max-w-4xl"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: __html:
formData.description || "<p class='text-grayScale-400'>—</p>", formData.description || "<p class='text-grayScale-400'>unassigned</p>",
}} }}
/> />
</div> </div>

View File

@ -339,7 +339,7 @@ export function FaqsPage() {
{faq.category ? ( {faq.category ? (
<Badge variant="secondary">{faq.category}</Badge> <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>
<TableCell className="text-center text-sm text-grayScale-600"> <TableCell className="text-center text-sm text-grayScale-600">

View File

@ -127,10 +127,10 @@ export function FaqForm({
Preview Preview
</p> </p>
<p className="mt-2 text-sm font-medium text-grayScale-900"> <p className="mt-2 text-sm font-medium text-grayScale-900">
{draft.question || "—"} {draft.question || "unassigned"}
</p> </p>
<p className="mt-1 whitespace-pre-wrap text-xs leading-relaxed text-grayScale-600"> <p className="mt-1 whitespace-pre-wrap text-xs leading-relaxed text-grayScale-600">
{draft.answer || "—"} {draft.answer || "unassigned"}
</p> </p>
{(draft.category || draft.display_order) && ( {(draft.category || draft.display_order) && (
<div className="mt-2.5 flex items-center gap-2 text-[11px] text-grayScale-400"> <div className="mt-2.5 flex items-center gap-2 text-[11px] text-grayScale-400">
@ -149,10 +149,10 @@ export function FaqForm({
Preview Preview
</p> </p>
<p className="mt-2 text-sm font-medium text-grayScale-900"> <p className="mt-2 text-sm font-medium text-grayScale-900">
{draft.question || "—"} {draft.question || "unassigned"}
</p> </p>
<p className="mt-1 whitespace-pre-wrap text-xs leading-relaxed text-grayScale-600"> <p className="mt-1 whitespace-pre-wrap text-xs leading-relaxed text-grayScale-600">
{draft.answer || "—"} {draft.answer || "unassigned"}
</p> </p>
{(draft.category || draft.display_order) && ( {(draft.category || draft.display_order) && (
<div className="mt-2.5 flex items-center gap-2 text-[11px] text-grayScale-400"> <div className="mt-2.5 flex items-center gap-2 text-[11px] text-grayScale-400">

View File

@ -178,7 +178,7 @@ function getRelativeTime(dateStr: string): string {
function formatRoleLabel(role: string | null | undefined): string { function formatRoleLabel(role: string | null | undefined): string {
const r = String(role ?? "").trim(); const r = String(role ?? "").trim();
if (!r) return "—"; if (!r) return "unassigned";
return r return r
.split("_") .split("_")
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()) .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
@ -532,7 +532,7 @@ export function IssuesPage() {
</div> </div>
<div className="min-w-0"> <div className="min-w-0">
<p className="text-sm font-medium text-grayScale-600 truncate"> <p className="text-sm font-medium text-grayScale-600 truncate">
{issue.subject?.trim() ? issue.subject : "—"} {issue.subject?.trim() ? issue.subject : "unassigned"}
</p> </p>
<p className="text-xs text-grayScale-400 truncate mt-0.5"> <p className="text-xs text-grayScale-400 truncate mt-0.5">
{issue.description?.trim() ? issue.description : "No description"} {issue.description?.trim() ? issue.description : "No description"}

View File

@ -72,7 +72,7 @@ function recipientLabel(notification: Notification): string {
if (notification.reciever) { if (notification.reciever) {
parts.push(notification.reciever) parts.push(notification.reciever)
} }
return parts.length > 0 ? parts.join(" · ") : "—" return parts.length > 0 ? parts.join(" · ") : "unassigned"
} }
export function AllNotificationsPage() { export function AllNotificationsPage() {
@ -355,14 +355,14 @@ export function AllNotificationsPage() {
</TableCell> </TableCell>
<TableCell className="max-w-[260px]"> <TableCell className="max-w-[260px]">
<p className="truncate text-sm font-medium text-grayScale-700"> <p className="truncate text-sm font-medium text-grayScale-700">
{getNotificationTitle(notification) || "—"} {getNotificationTitle(notification) || "unassigned"}
</p> </p>
<p className="truncate text-xs text-grayScale-400"> <p className="truncate text-xs text-grayScale-400">
{getNotificationMessage(notification) || "—"} {getNotificationMessage(notification) || "unassigned"}
</p> </p>
</TableCell> </TableCell>
<TableCell className="text-xs capitalize text-grayScale-600"> <TableCell className="text-xs capitalize text-grayScale-600">
{channelLabel(notification.delivery_channel) || "—"} {channelLabel(notification.delivery_channel) || "unassigned"}
</TableCell> </TableCell>
<TableCell className="hidden text-xs text-grayScale-600 md:table-cell"> <TableCell className="hidden text-xs text-grayScale-600 md:table-cell">
{formatNotificationTypeLabel(notification.type)} {formatNotificationTypeLabel(notification.type)}
@ -372,7 +372,7 @@ export function AllNotificationsPage() {
variant={getNotificationLevelBadge(notification.level)} variant={getNotificationLevelBadge(notification.level)}
className="text-[10px]" className="text-[10px]"
> >
{notification.level || "—"} {notification.level || "unassigned"}
</Badge> </Badge>
</TableCell> </TableCell>
<TableCell> <TableCell>
@ -381,7 +381,7 @@ export function AllNotificationsPage() {
</Badge> </Badge>
</TableCell> </TableCell>
<TableCell className="hidden text-xs capitalize text-grayScale-500 sm:table-cell"> <TableCell className="hidden text-xs capitalize text-grayScale-500 sm:table-cell">
{notification.delivery_status || "—"} {notification.delivery_status || "unassigned"}
</TableCell> </TableCell>
<TableCell className="hidden text-xs text-grayScale-500 sm:table-cell"> <TableCell className="hidden text-xs text-grayScale-500 sm:table-cell">
{formatNotificationTimestamp(notification.timestamp)} {formatNotificationTimestamp(notification.timestamp)}

View File

@ -520,7 +520,7 @@ export function NotificationsPage() {
<div> <div>
<p className="text-xs font-medium text-grayScale-500">Channels used</p> <p className="text-xs font-medium text-grayScale-500">Channels used</p>
<p className="mt-1 text-xl font-semibold text-grayScale-700"> <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> </p>
</div> </div>
<div className="grid h-11 w-11 shrink-0 place-items-center rounded-xl bg-brand-100/60 text-brand-600"> <div className="grid h-11 w-11 shrink-0 place-items-center rounded-xl bg-brand-100/60 text-brand-600">

View File

@ -133,7 +133,7 @@ export function ScheduledNotificationsPage() {
if (job.target_raw?.emails?.length) { if (job.target_raw?.emails?.length) {
return `${job.target_raw.emails.length} email(s)` return `${job.target_raw.emails.length} email(s)`
} }
return "—" return "unassigned"
} }
const activeFilterCount = countActiveFilters([ const activeFilterCount = countActiveFilters([
@ -261,7 +261,7 @@ export function ScheduledNotificationsPage() {
<TableCell>{channelLabel(job.channel)}</TableCell> <TableCell>{channelLabel(job.channel)}</TableCell>
<TableCell className="max-w-[240px]"> <TableCell className="max-w-[240px]">
<p className="truncate text-sm font-medium text-grayScale-700"> <p className="truncate text-sm font-medium text-grayScale-700">
{job.title || "—"} {job.title || "unassigned"}
</p> </p>
<p className="truncate text-xs text-grayScale-400">{job.message}</p> <p className="truncate text-xs text-grayScale-400">{job.message}</p>
{job.channel === "email" && job.email_template_slug ? ( {job.channel === "email" && job.email_template_slug ? (

View File

@ -177,9 +177,9 @@ export function BulkSendSummaryPanel({ summary, onDismiss }: BulkSendSummaryPane
Content Content
</p> </p>
<p className="mt-1 truncate text-sm font-medium text-grayScale-800"> <p className="mt-1 truncate text-sm font-medium text-grayScale-800">
{summary.titlePreview || "—"} {summary.titlePreview || "unassigned"}
</p> </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 ? ( {!isImmediate && summary.emailTemplateSlug ? (
<p className="mt-1 text-[10px] text-grayScale-400"> <p className="mt-1 text-[10px] text-grayScale-400">
Template: {summary.emailTemplateSlug} Template: {summary.emailTemplateSlug}

View File

@ -518,7 +518,7 @@ export function PaymentsPage() {
<td className="whitespace-nowrap px-3 py-2.5 sm:px-4"> <td className="whitespace-nowrap px-3 py-2.5 sm:px-4">
<p className="font-semibold text-grayScale-900">#{payment.id}</p> <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"> <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> </p>
</td> </td>
<td className="px-3 py-2.5 sm:px-4"> <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"> <div className="mt-5 space-y-0 divide-y divide-grayScale-100">
{[ {[
{ k: "Customer", v: paymentCustomerName(selected) }, { 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: "Plan", v: selected.plan_name || `Plan #${selected.plan_id}` },
{ k: "Category", v: formatPaymentPlanCategory(selected.plan_category) }, { k: "Category", v: formatPaymentPlanCategory(selected.plan_category) },
{ k: "Transaction", v: selected.transaction_id || "—", mono: true }, { k: "Transaction", v: selected.transaction_id || "unassigned", mono: true },
{ k: "Session", v: selected.session_id || "—", mono: true }, { k: "Session", v: selected.session_id || "unassigned", mono: true },
{ k: "Subscription", v: `#${selected.subscription_id}` }, { k: "Subscription", v: `#${selected.subscription_id}` },
{ k: "Paid", v: formatPaymentDate(selected.paid_at ?? selected.created_at) }, { k: "Paid", v: formatPaymentDate(selected.paid_at ?? selected.created_at) },
...(selected.expires_at ? [{ k: "Expires", v: formatPaymentDate(selected.expires_at) }] : []), ...(selected.expires_at ? [{ k: "Expires", v: formatPaymentDate(selected.expires_at) }] : []),

View File

@ -388,10 +388,10 @@ export function TeamManagementPage() {
</span> </span>
</TableCell> </TableCell>
<TableCell className="hidden md:table-cell text-sm text-grayScale-600"> <TableCell className="hidden md:table-cell text-sm text-grayScale-600">
{member.department || "—"} {member.department || "unassigned"}
</TableCell> </TableCell>
<TableCell className="hidden lg:table-cell text-sm text-grayScale-600"> <TableCell className="hidden lg:table-cell text-sm text-grayScale-600">
{member.job_title || "—"} {member.job_title || "unassigned"}
</TableCell> </TableCell>
<TableCell className="hidden sm:table-cell"> <TableCell className="hidden sm:table-cell">
{member.last_login ? ( {member.last_login ? (
@ -406,7 +406,7 @@ export function TeamManagementPage() {
) : ( ) : (
<div> <div>
<div className="text-sm text-grayScale-600">Never</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> </div>
)} )}
</TableCell> </TableCell>

View File

@ -281,7 +281,7 @@ export function ActivityLogListPanel({
</div> </div>
<div> <div>
<p className="text-2xl font-bold text-grayScale-600"> <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>
<p className="text-xs text-grayScale-400">Latest on this page</p> <p className="text-xs text-grayScale-400">Latest on this page</p>
</div> </div>
@ -450,7 +450,7 @@ export function ActivityLogListPanel({
scrollable ? "whitespace-nowrap" : "max-w-[280px] truncate", scrollable ? "whitespace-nowrap" : "max-w-[280px] truncate",
)} )}
> >
{log.message || "—"} {log.message || "unassigned"}
</p> </p>
</TableCell> </TableCell>
{showActorColumn ? ( {showActorColumn ? (
@ -583,7 +583,7 @@ export function ActivityLogListPanel({
icon={<Shield className="h-4 w-4" />} icon={<Shield className="h-4 w-4" />}
label="Role" label="Role"
value={ value={
selectedLog.actor_role ? formatRoleLabel(selectedLog.actor_role) : "—" selectedLog.actor_role ? formatRoleLabel(selectedLog.actor_role) : "unassigned"
} }
/> />
<DetailItem <DetailItem
@ -601,13 +601,13 @@ export function ActivityLogListPanel({
<DetailItem <DetailItem
icon={<Globe className="h-4 w-4" />} icon={<Globe className="h-4 w-4" />}
label="IP address" label="IP address"
value={selectedLog.ip_address || "—"} value={selectedLog.ip_address || "unassigned"}
/> />
<DetailItem <DetailItem
icon={<Monitor className="h-4 w-4" />} icon={<Monitor className="h-4 w-4" />}
label="User agent" label="User agent"
value={ value={
selectedLog.user_agent ? truncateUA(selectedLog.user_agent) : "—" selectedLog.user_agent ? truncateUA(selectedLog.user_agent) : "unassigned"
} }
title={selectedLog.user_agent ?? undefined} title={selectedLog.user_agent ?? undefined}
/> />

View File

@ -542,21 +542,21 @@ export function DeletionRequestsPage() {
{item.first_name} {item.last_name} {item.first_name} {item.last_name}
</p> </p>
<p className="text-xs text-grayScale-500">{item.email}</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>
<TableCell className="py-3.5"> <TableCell className="py-3.5">
<p className="text-sm text-grayScale-700">{item.role || "—"}</p> <p className="text-sm text-grayScale-700">{item.role || "unassigned"}</p>
<p className="text-xs text-grayScale-500">{item.status || "—"}</p> <p className="text-xs text-grayScale-500">{item.status || "unassigned"}</p>
</TableCell> </TableCell>
<TableCell className="hidden py-3.5 text-sm text-grayScale-600 md:table-cell"> <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>
<TableCell className="hidden py-3.5 text-sm text-grayScale-600 md:table-cell"> <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>
<TableCell className="py-3.5"> <TableCell className="py-3.5">
<Badge className={stateBadge[item.deletion_state] || "bg-grayScale-200 text-grayScale-600"}> <Badge className={stateBadge[item.deletion_state] || "bg-grayScale-200 text-grayScale-600"}>
{item.deletion_state || "—"} {item.deletion_state || "unassigned"}
</Badge> </Badge>
</TableCell> </TableCell>
</TableRow> </TableRow>

View File

@ -102,7 +102,7 @@ function formatDateTime(value?: string | null, emptyLabel = NOT_ASSIGNED_LABEL):
function formatActivityOccurredAt(iso: string): string { function formatActivityOccurredAt(iso: string): string {
const d = new Date(iso); const d = new Date(iso);
if (Number.isNaN(d.getTime())) return "—"; if (Number.isNaN(d.getTime())) return "unassigned";
const now = new Date(); const now = new Date();
const startToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime(); const startToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();

View File

@ -28,9 +28,9 @@ import { EXPORT_PERMISSIONS, EXPORT_ROUTES } from "../../lib/csv-export"
import { usersExportQuery } from "../../lib/csvExportFilters" import { usersExportQuery } from "../../lib/csvExportFilters"
function formatJoinedAt(iso: string): string { function formatJoinedAt(iso: string): string {
if (!iso?.trim()) return "—" if (!iso?.trim()) return "unassigned"
const d = new Date(iso) 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" }) return d.toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" })
} }
@ -365,7 +365,7 @@ export function UsersListPage() {
const hasPhone = Boolean(phone?.trim()) const hasPhone = Boolean(phone?.trim())
const hasEmail = Boolean(email?.trim()) const hasEmail = Boolean(email?.trim())
if (!hasPhone && !hasEmail) { if (!hasPhone && !hasEmail) {
return <span className="text-grayScale-400">—</span> return <span className="text-grayScale-400">unassigned</span>
} }
return ( return (
<div className="space-y-1 text-sm text-grayScale-600"> <div className="space-y-1 text-sm text-grayScale-600">
@ -406,7 +406,7 @@ export function UsersListPage() {
) : userSummary ? ( ) : userSummary ? (
formatSummaryNum(userSummary.total_users) formatSummaryNum(userSummary.total_users)
) : ( ) : (
"—" "unassigned"
)} )}
</p> </p>
</div> </div>
@ -426,7 +426,7 @@ export function UsersListPage() {
) : activeUsersTotal !== null ? ( ) : activeUsersTotal !== null ? (
formatSummaryNum(activeUsersTotal) formatSummaryNum(activeUsersTotal)
) : ( ) : (
"—" "unassigned"
)} )}
</p> </p>
</div> </div>
@ -446,7 +446,7 @@ export function UsersListPage() {
) : userSummary ? ( ) : userSummary ? (
formatSummaryNum(userSummary.new_month) formatSummaryNum(userSummary.new_month)
) : ( ) : (
"—" "unassigned"
)} )}
</p> </p>
</div> </div>
@ -665,15 +665,15 @@ export function UsersListPage() {
<TableCell className="hidden md:table-cell align-top"> <TableCell className="hidden md:table-cell align-top">
{renderContactDetails(u.phoneNumber, u.email)} {renderContactDetails(u.phoneNumber, u.email)}
</TableCell> </TableCell>
<TableCell className="hidden md:table-cell text-grayScale-500">{u.country || "-"}</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 || "-"}</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"> <TableCell className="hidden md:table-cell text-sm text-grayScale-500 whitespace-nowrap">
{formatJoinedAt(u.createdAt)} {formatJoinedAt(u.createdAt)}
</TableCell> </TableCell>
<TableCell className="hidden lg:table-cell align-top text-sm text-grayScale-600"> <TableCell className="hidden lg:table-cell align-top text-sm text-grayScale-600">
<span <span
className={cn( className={cn(
u.subscriptionStatus === "—" || u.subscriptionStatus === "unassigned" ||
u.subscriptionStatus.toLowerCase() === "unsubscribed" u.subscriptionStatus.toLowerCase() === "unsubscribed"
? "text-grayScale-400" ? "text-grayScale-400"
: undefined, : undefined,

View File

@ -17,9 +17,9 @@ type ExtendSubscriptionDialogProps = {
} }
function formatDateTime(value?: string | null): string { function formatDateTime(value?: string | null): string {
if (!value?.trim()) return "—" if (!value?.trim()) return "unassigned"
const parsed = new Date(value) const parsed = new Date(value)
if (Number.isNaN(parsed.getTime())) return "—" if (Number.isNaN(parsed.getTime())) return "unassigned"
return parsed.toLocaleString(undefined, { return parsed.toLocaleString(undefined, {
month: "short", month: "short",
day: "numeric", day: "numeric",

View File

@ -77,7 +77,7 @@ export const mapUserApiToUser = (u: UserApiDTO): User => ({
country: u.country ?? "", country: u.country ?? "",
lastLogin: null, lastLogin: null,
status: u.status, 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 ?? "", createdAt: u.created_at ?? "",
}) })