changed checklist order and added what is next when collaped.
This commit is contained in:
@@ -213,8 +213,8 @@ const DEFAULT_PODCAST_CHECKLIST_TASKS = [
|
|||||||
{ id: 'verify_script', label: 'Verify Script', phase: 'pre' },
|
{ id: 'verify_script', label: 'Verify Script', phase: 'pre' },
|
||||||
{ id: 'read_script', label: 'Read Script', phase: 'pre' },
|
{ id: 'read_script', label: 'Read Script', phase: 'pre' },
|
||||||
{ id: 'record', label: 'Record', phase: 'pre' },
|
{ id: 'record', label: 'Record', phase: 'pre' },
|
||||||
{ id: 'edit', label: 'Edit', phase: 'pre' },
|
|
||||||
{ id: 'mix', label: 'Mix', phase: 'pre' },
|
{ id: 'mix', label: 'Mix', phase: 'pre' },
|
||||||
|
{ id: 'edit', label: 'Edit', phase: 'pre' },
|
||||||
{ id: 'video_script', label: 'Run Video Conversion Script', phase: 'pre' },
|
{ id: 'video_script', label: 'Run Video Conversion Script', phase: 'pre' },
|
||||||
{ id: 'post_spotify', label: 'Post on Spotify', phase: 'pre' },
|
{ id: 'post_spotify', label: 'Post on Spotify', phase: 'pre' },
|
||||||
{ id: 'update_website', label: 'Update Website', phase: 'post' },
|
{ id: 'update_website', label: 'Update Website', phase: 'post' },
|
||||||
|
|||||||
+29
-2
@@ -1974,7 +1974,29 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
|
|||||||
questionPage * QUESTION_PAGE_SIZE,
|
questionPage * QUESTION_PAGE_SIZE,
|
||||||
(questionPage + 1) * QUESTION_PAGE_SIZE,
|
(questionPage + 1) * QUESTION_PAGE_SIZE,
|
||||||
)
|
)
|
||||||
const checklistTasksSorted = [...podcastChecklist.tasks].sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }))
|
const checklistTaskOrder = [
|
||||||
|
'verify_script',
|
||||||
|
'read_script',
|
||||||
|
'record',
|
||||||
|
'mix',
|
||||||
|
'edit',
|
||||||
|
'video_script',
|
||||||
|
'post_spotify',
|
||||||
|
'update_website',
|
||||||
|
'send_email',
|
||||||
|
]
|
||||||
|
const checklistTaskOrderIndex = new Map(checklistTaskOrder.map((id, index) => [id, index]))
|
||||||
|
const checklistTasksSorted = [...podcastChecklist.tasks].sort((a, b) => {
|
||||||
|
const aIndex = checklistTaskOrderIndex.get(a.id)
|
||||||
|
const bIndex = checklistTaskOrderIndex.get(b.id)
|
||||||
|
const aKnown = typeof aIndex === 'number'
|
||||||
|
const bKnown = typeof bIndex === 'number'
|
||||||
|
|
||||||
|
if (aKnown && bKnown) return aIndex - bIndex
|
||||||
|
if (aKnown && !bKnown) return -1
|
||||||
|
if (!aKnown && bKnown) return 1
|
||||||
|
return a.label.localeCompare(b.label, undefined, { sensitivity: 'base' })
|
||||||
|
})
|
||||||
const checklistPreTasks = checklistTasksSorted.filter(task => task.phase === 'pre')
|
const checklistPreTasks = checklistTasksSorted.filter(task => task.phase === 'pre')
|
||||||
const checklistPostTasks = checklistTasksSorted.filter(task => task.phase === 'post')
|
const checklistPostTasks = checklistTasksSorted.filter(task => task.phase === 'post')
|
||||||
const checklistEpisodesSorted = [...podcastChecklist.episodes].sort((a, b) => {
|
const checklistEpisodesSorted = [...podcastChecklist.episodes].sort((a, b) => {
|
||||||
@@ -2739,6 +2761,7 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
|
|||||||
{checklistEpisodesSorted.map(episode => {
|
{checklistEpisodesSorted.map(episode => {
|
||||||
const doneCount = checklistTasksSorted.reduce((count, task) => count + (episode.tasks[task.id] ? 1 : 0), 0)
|
const doneCount = checklistTasksSorted.reduce((count, task) => count + (episode.tasks[task.id] ? 1 : 0), 0)
|
||||||
const totalCount = checklistTasksSorted.length
|
const totalCount = checklistTasksSorted.length
|
||||||
|
const nextTask = checklistTasksSorted.find(task => !episode.tasks[task.id])
|
||||||
const episodeLabelParts = [episode.series?.trim()]
|
const episodeLabelParts = [episode.series?.trim()]
|
||||||
if (episode.episodeNumber !== null) {
|
if (episode.episodeNumber !== null) {
|
||||||
episodeLabelParts.push(String(episode.episodeNumber))
|
episodeLabelParts.push(String(episode.episodeNumber))
|
||||||
@@ -2753,7 +2776,11 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
|
|||||||
<summary className="admin-collapsible-summary">
|
<summary className="admin-collapsible-summary">
|
||||||
<div>
|
<div>
|
||||||
<strong>{episodeLabel}</strong>
|
<strong>{episodeLabel}</strong>
|
||||||
<p>{totalCount > 0 ? `${doneCount}/${totalCount} tasks completed` : 'No tasks assigned yet'}</p>
|
<p>
|
||||||
|
{totalCount > 0
|
||||||
|
? `${doneCount}/${totalCount} tasks completed • Next: ${nextTask?.label ?? 'All done'}`
|
||||||
|
: 'No tasks assigned yet'}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span className="admin-collapsible-hint">Expand to edit</span>
|
<span className="admin-collapsible-hint">Expand to edit</span>
|
||||||
</summary>
|
</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user