Fix admin dashboard crash after removing upcoming events (drop Upcoming card); v2.15.2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
28fc822132
commit
ac1b06f945
4 files changed
+4
-20
No files matched your search
+1
-1
@@ -1900,7 +1900,7 @@ function PodcastWorkflowAdmin({ laneA, laneB }: { laneA: { title: string; season
|
||||
style={{
|
||||
display: 'block', width: '100%', textAlign: 'left', padding: '8px 10px', marginBottom: 6,
|
||||
border: `1px solid ${i.key === selectedKey ? '#8a6d2f' : 'var(--color-border, #e5e0d5)'}`,
|
||||
borderRadius: 6, background: 'transparent', cursor: 'pointer', color: 'inherit',
|
||||
borderRadius: 6, background: 'transparent', cursor: 'pointer', color: 'inherit', font: 'inherit',
|
||||
}}
|
||||
>
|
||||
<strong>{label(i)}</strong>
|
||||
|
||||
@@ -13,7 +13,6 @@ export interface DashboardData {
|
||||
lastActivityAt: string | null
|
||||
}
|
||||
latestEpisode: { available: boolean; title?: string; episode?: string; season?: string; publishedAt?: string | null; daysAgo?: number | null; stale?: boolean; staleAfterDays?: number }
|
||||
upcoming: { id: string; kind: string; type: string; title: string; date: string; startTime: string | null }[]
|
||||
nuggets: { uploadsThisWeek: number; latest: { hostName: string; episodeName: string; uploadedAt: string }[] }
|
||||
health: {
|
||||
resendConfigured: boolean
|
||||
@@ -73,11 +72,6 @@ function formatWhen(value: string | null | undefined) {
|
||||
return Number.isNaN(d.getTime()) ? '—' : d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' })
|
||||
}
|
||||
|
||||
function formatDay(value: string) {
|
||||
const d = new Date(`${value}T12:00:00`)
|
||||
return Number.isNaN(d.getTime()) ? value : d.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: 'numeric' })
|
||||
}
|
||||
|
||||
export function AdminDashboardExtras({ publishedAt, draftUpdatedAt, isDirty, onNavigate, onRequestPublish }: Props) {
|
||||
const [data, setData] = useState<DashboardData | null>(null)
|
||||
const [failed, setFailed] = useState(false)
|
||||
@@ -230,16 +224,6 @@ export function AdminDashboardExtras({ publishedAt, draftUpdatedAt, isDirty, onN
|
||||
{data.latestEpisode.stale && <div className="admin-dashboard-stale">No new episode in over {data.latestEpisode.staleAfterDays} days.</div>}
|
||||
</div>
|
||||
)}
|
||||
<h3 className="admin-dashboard-activity-heading" style={{ marginTop: '1rem' }}>Upcoming</h3>
|
||||
{data.upcoming.length === 0 ? <p className="admin-stats-note">Nothing scheduled.</p> : (
|
||||
<div className="admin-dashboard-feed">
|
||||
{data.upcoming.map(ev => (
|
||||
<div key={ev.id} className="admin-dashboard-feed-item admin-dashboard-row">
|
||||
<span>{ev.title}</span><span className="admin-dashboard-feed-date">{formatDay(ev.date)}{ev.startTime ? ` · ${ev.startTime}` : ''}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user