Skip to content

feat: add media library file reuse - #1045

Open
aryaanpanwar50 wants to merge 1 commit into
firecmsco:mainfrom
aryaanpanwar50:feat/media-library-file-reuse
Open

aryaanpanwar50 wants to merge 1 commit into
firecmsco:mainfrom
aryaanpanwar50:feat/media-library-file-reuse

Conversation

@aryaanpanwar50

Copy link
Copy Markdown

Summary

File upload fields could only upload new files; they did not provide a way to choose an existing file from the media library.

Add a media picker that lets users reuse uploaded files across records. The file remains in Storage, and each record stores its path or URL. Removing a file from a record does not delete the shared file.

The library loads assets in pages and displays previews as they become available. Files uploaded through FireCMS are registered in the media catalog.

Related to #409.

Testing

Added 9 focused tests covering selection, duplicate handling, catalog registration, preview loading, and Storage bucket resolution. All 9 passed.

Verified with the Firebase emulator that deleting one of two records referencing the same image leaves the image and the other record intact.

Manually checked the picker and image previews. The example and Media Manager type checks passed.

The complete flow has not been tested with an automated browser test.

Limitations

Files uploaded outside FireCMS or before catalog registration was added are not automatically indexed.

The library does not track every record using a file. Deleting a file from the library can break existing references.

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