Эх сурвалжийг харах

chore: show Force Reprocess All button for editors and admins

TranscodeTasksPanel button now checks canManage (ADMIN | EDITOR in project)
instead of only globalRole ADMIN. Editors can also force-reset stuck jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kingkong 1 сар өмнө
parent
commit
f100cee2ec

+ 2 - 2
src/app/(dashboard)/projects/[projectId]/page.tsx

@@ -196,12 +196,12 @@ export default function ProjectDetailPage() {
   const isOwner = project?.ownerId === user?.id;
   const isOwner = project?.ownerId === user?.id;
   const isAdmin = user?.globalRole === 'ADMIN';
   const isAdmin = user?.globalRole === 'ADMIN';
 
 
-  // Poll workspace-wide stuck job count every 30s (only for admins)
+  // Poll workspace-wide stuck job count every 30s (admins can use it; badge shows for canManage)
   useEffect(() => {
   useEffect(() => {
     if (!isAdmin || !token) return;
     if (!isAdmin || !token) return;
     let cancelled = false;
     let cancelled = false;
     async function fetchStuckCount() {
     async function fetchStuckCount() {
-      const t = token as string; // guarded above
+      const t = token as string;
       try {
       try {
         const data = await assetsApi.getStuckCount(t);
         const data = await assetsApi.getStuckCount(t);
         if (!cancelled) setGlobalStuckCount(data.count ?? 0);
         if (!cancelled) setGlobalStuckCount(data.count ?? 0);

+ 2 - 2
src/components/transcode/TranscodeTasksPanel.tsx

@@ -296,8 +296,8 @@ export function TranscodeTasksPanel({ assets, canManage, isAdmin, onDelete, onCa
         ))}
         ))}
       </div>
       </div>
 
 
-      {/* Admin: Force Reprocess All */}
-      {isAdmin && (
+      {/* Admin / Editor: Force Reprocess All */}
+      {canManage && (
         <div className="flex justify-end mb-4">
         <div className="flex justify-end mb-4">
           <button
           <button
             onClick={onReprocessAll}
             onClick={onReprocessAll}