Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict filters to images #57

Merged
merged 4 commits into from
Aug 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions blocks/aem-asset-selector/aem-asset-selector-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,56 @@ export async function renderAssetSelectorWithImsFlow(cfg) {
hideTreeNav: true,
runningInUnifiedShell: false,
noWrap: true,
filterSchema: [
{
header: 'File Type',
groupKey: 'TopGroup',
fields: [
{
element: 'checkbox',
name: 'type',
defaultValue: ['image/*'],
readOnly: true,
options: [
{
label: 'Images',
value: 'image/*',
},
],
},
],
},
{
fields:
[
{
element: 'checkbox',
name: 'type',
options: [
{
label: 'JPG',
value: 'image/jpeg',
},
{
label: 'PNG',
value: 'image/png',
},
{
label: 'TIFF',
value: 'image/tiff',
},
{
label: 'GIF',
tmathern marked this conversation as resolved.
Show resolved Hide resolved
value: 'image/gif',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also add webp here once we've tested it works with getting high res assets (canvas supports it, we just didn't have the assets to test and I don't have enough permissions to add assets...).

},
],
columns: 2,
},
],
header: 'Mime Types',
groupKey: 'MimeTypeGroup',
},
],
};

if (cfg['repository-id']) {
Expand Down