Skip to content

Commit

Permalink
Restrict filters to images (#57)
Browse files Browse the repository at this point in the history
* Restrict filters to images only
* With directories

---------

Co-authored-by: Satya Deep Maheshwari <satyam@adobe.com>
Co-authored-by: tmathern <60901087+tmathern@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 26, 2023
1 parent 380f068 commit 245cb7a
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions blocks/aem-asset-selector/aem-asset-selector-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,64 @@ 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: 'Directories',
value: 'directory',
},
{
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',
value: 'image/gif',
},
{
label: 'WEBP',
value: 'image/webp',
},
],
columns: 2,
},
],
header: 'Mime Types',
groupKey: 'MimeTypeGroup',
},
],
};

if (cfg['repository-id']) {
Expand All @@ -436,6 +494,9 @@ export async function renderAssetSelectorWithImsFlow(cfg) {
if (cfg['ims-org-id']) {
assetSelectorProps.imsOrg = cfg['ims-org-id'];
}
if (cfg['ims-token']) {
assetSelectorProps.imsToken = cfg['ims-token'];
}

// eslint-disable-next-line no-undef
PureJSSelectors.renderAssetSelectorWithAuthFlow(getAssetSelector(), assetSelectorProps);
Expand Down

0 comments on commit 245cb7a

Please sign in to comment.