PROBLEM: - Upload form was minimal, not using full backend capabilities - Missing: recipients, departments, acknowledgement requirement - No folder indication when uploading to specific folder SOLUTION - BACKEND: - Added 'acknowledgement_required' field to DocumentWriteSerializer - Now accepts: sent_to_all, department_ids, recipient_ids, acknowledgement_required SOLUTION - FRONTEND: Extended DocumentUploadForm with enterprise-grade features: NEW FIELDS: 1. Sent to All Toggle - Checkbox to send document to all employees - When checked, hides recipients/departments selection 2. Recipients Section (when sent_to_all = false) - Multi-select for departments (with Building2 icon) - Multi-select for specific employees (with Users icon) - Live loading from API - Validation: requires at least one department OR recipient - Helper text for Ctrl/Cmd multi-select 3. Acknowledgement Required - Checkbox to require recipients to acknowledge reading - Clear explanation of what it means UX IMPROVEMENTS: - Folder indicator: shows when uploading to specific folder - Visual sections with dividers and headers - Icons for each field type - Warning when no recipients selected (amber alert) - Better validation messages - Reset all new fields on successful upload API CLIENT: - Updated createDocument signature to include acknowledgement_required - Properly serializes checkbox values as strings DATA LOADING: - useEffect loads departments and employees on mount - Loading states during fetch - Handles empty lists gracefully VALIDATION: - Requires file and title (unchanged) - NEW: When sent_to_all=false, requires departments OR recipients - Shows user-friendly error messages BENEFITS: - Full feature parity with backend capabilities - Professional document management workflow - Granular control over document distribution - Acknowledgement tracking from upload stage - Better UX with progressive disclosure
This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.