webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.29k stars 601 forks source link

feat(app-file-manager): add file thumbnail and action config #4095

Closed Pavel910 closed 4 months ago

Pavel910 commented 4 months ago

Changes

This PR removes the old FileManagerFileTypePlugin in favor of the config API. This allows us to have more control over individual actions and thumbnails (in Grid and File Details independently).

With this PR we also register Webiny Version widget (in the main navigation) as a regular menu item, so it will be possible to remove it via AddMenu component decorator.

Examples

<FileManagerViewConfig>
    {/* Grid config */}
    <Browser.Grid.Item.Thumbnail type={"*/*"} element={<DefaultRenderer />} />
    <Browser.Grid.Item.Action name={"download"} element={<GridDownload />} />
    {/* File details config */}
    <FileDetails.Preview.Thumbnail type={"*/*"} element={<DefaultRenderer />} />
    <FileDetails.Action name={"copyUrl"} element={<FileDetailsCopyUrl />} />
</FileManagerViewConfig>

How Has This Been Tested?

Manually.

Documentation

Pending. Need to update existing FileTypePlugin docs with this new API.

Pavel910 commented 4 months ago

LGTM, just a question re a potentially outdated comment. 🤔

Removed the outdated comments, they're no longer needed.