Skip to content

implement staff video upload functionality#162

Draft
usmanpm wants to merge 2 commits intoarbisoft:devfrom
usmanpm:UY-fe-staff-video-upload
Draft

implement staff video upload functionality#162
usmanpm wants to merge 2 commits intoarbisoft:devfrom
usmanpm:UY-fe-staff-video-upload

Conversation

@usmanpm
Copy link
Copy Markdown

@usmanpm usmanpm commented Apr 30, 2026

🚀 Description

Implement comprehensive staff video upload functionality with progress tracking, form validation, and auto-publishing workflow.

📌 Summary

This PR adds the ability for staff users to upload videos through a streamlined interface, including file selection, real-time upload progress, metadata entry (title, presenters, date, description, tags, playlists, thumbnail), and automatic publishing after upload completion.

🔧 Changes Implemented

  • ✅ Added useVideoUpload hook for handling video file uploads with progress tracking and error handling
  • ✅ Refactored upload form into modular components (TitleField, PresenterField, etc.) for better maintainability
  • ✅ Integrated new API endpoints for video asset upload, event creation, tag management, and user search
  • ✅ Updated authentication models to include staff status checking
  • ✅ Modified middleware to protect /upload-video route and redirect non-staff users
  • ✅ Enhanced video picker with drag-and-drop, file validation, and improved UX
  • ✅ Added thumbnail upload functionality with preview and auto-generated options
  • ✅ Implemented auto-publishing workflow that queues form submission until upload completes
  • ✅ Updated video detail styling for better presentation
  • ✅ Added view count incrementation for video assets

🛠️ How It Works?

  1. Staff users access the upload page (protected route)
  2. Video file is selected via drag-and-drop or file picker with format/size validation
  3. Upload begins immediately with real-time progress display
  4. While uploading, users fill out metadata form (disabled until upload complete)
  5. Upon upload completion, form auto-submits to create the event/video
  6. Success redirects to the new video detail page
  7. Thumbnail can be uploaded or auto-generated during publishing

✅ Checklist Before Merging

  • Tested video upload with various file formats (MP4, MOV, AVI, WebM) and sizes
  • Verified form validation and error handling for all fields
  • Confirmed auto-publishing workflow functions correctly
  • Tested thumbnail upload and preview functionality
  • Ensured authentication and route protection work for staff/non-staff users
  • Validated API integrations and error responses

📸 Screenshots (if applicable)

(Add screenshots of upload interface, progress states, form fields, and success states)

🔗 Related Issues

None

📢 Notes for Reviewers

  • The upload uses XMLHttpRequest for progress tracking instead of fetch
  • Form submission is queued until video upload completes to ensure asset ID availability
  • Scroll handling prevents form scrolling from interfering with page scroll
  • Tag creation allows new tags to be added on-the-fly during form entry
  • Presenter search uses user API with debounced queries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant