diff --git a/src/pages/admin/AdminBylaws.js b/src/pages/admin/AdminBylaws.js index 38c0d56..e66ece4 100644 --- a/src/pages/admin/AdminBylaws.js +++ b/src/pages/admin/AdminBylaws.js @@ -44,7 +44,7 @@ const AdminBylaws = () => { version: '', effective_date: '', document_url: '', - document_type: 'google_drive', + document_type: 'link', is_current: false }); const [submitting, setSubmitting] = useState(false); @@ -71,9 +71,10 @@ const AdminBylaws = () => { version: '', effective_date: new Date().toISOString().split('T')[0], document_url: '', - document_type: 'google_drive', + document_type: 'link', is_current: bylaws.length === 0 // Auto-check if this is the first bylaws }); + setUploadedFile(null); setDialogOpen(true); }; @@ -246,7 +247,7 @@ const AdminBylaws = () => {
Effective Date: {formatDate(currentBylaws.effective_date)} - Document Type: {currentBylaws.document_type === 'google_drive' ? 'Google Drive' : currentBylaws.document_type.toUpperCase()} + Document Type: {currentBylaws.document_type === 'upload' ? 'PDF Upload' : 'Link'}
) : ( @@ -363,14 +364,16 @@ const AdminBylaws = () => { @@ -391,6 +394,11 @@ const AdminBylaws = () => { Selected: {uploadedFile.name}

)} + {selectedBylaws && !uploadedFile && ( +

+ Current file will be kept if no new file is selected +

+ )} ) : (
@@ -399,12 +407,11 @@ const AdminBylaws = () => { id="document_url" value={formData.document_url} onChange={(e) => setFormData({ ...formData, document_url: e.target.value })} - placeholder="https://drive.google.com/file/d/..." + placeholder="https://docs.google.com/... or https://example.com/file.pdf" required />

- {formData.document_type === 'google_drive' && 'Paste the shareable link to your Google Drive file'} - {formData.document_type === 'pdf' && 'Paste the URL to your PDF file'} + Paste the shareable link to your document (Google Drive, Dropbox, PDF URL, etc.)

)} diff --git a/src/pages/admin/AdminFinancials.js b/src/pages/admin/AdminFinancials.js index 5787f7c..e79a2b7 100644 --- a/src/pages/admin/AdminFinancials.js +++ b/src/pages/admin/AdminFinancials.js @@ -42,7 +42,7 @@ const AdminFinancials = () => { year: new Date().getFullYear(), title: '', document_url: '', - document_type: 'google_drive' + document_type: 'link' }); const [submitting, setSubmitting] = useState(false); @@ -67,8 +67,9 @@ const AdminFinancials = () => { year: new Date().getFullYear(), title: '', document_url: '', - document_type: 'google_drive' + document_type: 'link' }); + setUploadedFile(null); setDialogOpen(true); }; @@ -274,14 +275,16 @@ const AdminFinancials = () => { @@ -302,6 +305,11 @@ const AdminFinancials = () => { Selected: {uploadedFile.name}

)} + {selectedReport && !uploadedFile && ( +

+ Current file will be kept if no new file is selected +

+ )} ) : (
@@ -310,12 +318,11 @@ const AdminFinancials = () => { id="document_url" value={formData.document_url} onChange={(e) => setFormData({ ...formData, document_url: e.target.value })} - placeholder="https://drive.google.com/file/d/..." + placeholder="https://docs.google.com/... or https://example.com/file.pdf" required />

- {formData.document_type === 'google_drive' && 'Paste the shareable link to your Google Drive file'} - {formData.document_type === 'pdf' && 'Paste the URL to your PDF file'} + Paste the shareable link to your document (Google Drive, Dropbox, PDF URL, etc.)

)} diff --git a/src/pages/admin/AdminNewsletters.js b/src/pages/admin/AdminNewsletters.js index 1e63c22..e6d807b 100644 --- a/src/pages/admin/AdminNewsletters.js +++ b/src/pages/admin/AdminNewsletters.js @@ -44,7 +44,7 @@ const AdminNewsletters = () => { description: '', published_date: '', document_url: '', - document_type: 'google_docs' + document_type: 'link' }); const [submitting, setSubmitting] = useState(false); @@ -70,8 +70,9 @@ const AdminNewsletters = () => { description: '', published_date: new Date().toISOString().split('T')[0], document_url: '', - document_type: 'google_docs' + document_type: 'link' }); + setUploadedFile(null); setDialogOpen(true); }; @@ -232,7 +233,7 @@ const AdminNewsletters = () => { {formatDate(newsletter.published_date)} - {newsletter.document_type === 'google_docs' ? 'Google Docs' : newsletter.document_type.toUpperCase()} + {newsletter.document_type === 'upload' ? 'PDF Upload' : 'Link'}