refactor: update media handling configuration and improve upload acceptance
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 25s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 8s
Test Suite / playwright-tests (push) Failing after 1m45s
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 25s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 8s
Test Suite / playwright-tests (push) Failing after 1m45s
- Modified .env.example to include SHINKAN_MEDIA_HOST and MEDIA_ROOT for better media path management. - Updated docker-compose files to utilize SHINKAN_MEDIA_HOST for volume mounts, ensuring consistent media directory handling across environments. - Enhanced ExerciseFormPage and MediaLibraryPage to specify accepted media types explicitly, improving compatibility and user experience during uploads.
This commit is contained in:
1 parent
ceef6f09e2
commit
c921f0dd8f
5 files changed
+30
-20
No files matched your search
@@ -45,6 +45,10 @@ const MEDIA_KIND_OPTIONS = [
|
||||
{ value: 'other', label: 'Sonstiges' },
|
||||
]
|
||||
|
||||
/** Kein image/*/video/* — WebKit (iOS Safari) ist damit oft kaputt; alles explizit. */
|
||||
const MEDIA_UPLOAD_ACCEPT =
|
||||
'image/jpeg,image/png,image/gif,image/heic,image/heif,video/mp4,video/quicktime,application/pdf,.jpg,.jpeg,.png,.gif,.heic,.heif,.mp4,.mov,.pdf'
|
||||
|
||||
const LC_STATUS_LABELS = {
|
||||
active: 'Aktiv',
|
||||
trash_soft: 'Papierkorb (1)',
|
||||
@@ -474,12 +478,13 @@ export default function MediaLibraryPage() {
|
||||
const selCount = selected.size
|
||||
|
||||
const onBulkArchiveFiles = async (e) => {
|
||||
const fl = e.target.files
|
||||
const input = e.target
|
||||
const fl = input.files
|
||||
if (!fl?.length) return
|
||||
const list = Array.from(fl)
|
||||
e.target.value = ''
|
||||
if (uploadVis === 'club' && !Number(uploadClubId)) {
|
||||
window.alert('Bitte einen Verein für die Sichtbarkeit „Verein“ wählen.')
|
||||
input.value = ''
|
||||
return
|
||||
}
|
||||
setUploadBusy(true)
|
||||
@@ -502,6 +507,7 @@ export default function MediaLibraryPage() {
|
||||
} catch (err) {
|
||||
window.alert(err.message || String(err))
|
||||
} finally {
|
||||
input.value = ''
|
||||
setUploadBusy(false)
|
||||
}
|
||||
}
|
||||
@@ -624,7 +630,7 @@ export default function MediaLibraryPage() {
|
||||
ref={bulkFileInputRef}
|
||||
type="file"
|
||||
className="media-library__sr-file"
|
||||
accept="image/*,video/*,application/pdf"
|
||||
accept={MEDIA_UPLOAD_ACCEPT}
|
||||
multiple
|
||||
onChange={onBulkArchiveFiles}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user