Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
41 changes: 29 additions & 12 deletions test/core/workflow/workflow-acrobat/action-binder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2931,23 +2931,20 @@ describe('ActionBinder', () => {
});

describe('image-to-pdf verbs onboarding', () => {
const NEW_IMAGE_VERBS = [
'image-to-pdf',
'bmp-to-pdf',
'gif-to-pdf',
'tiff-to-pdf',
'indd-to-pdf',
'psd-to-pdf',
'ai-to-pdf',
const IMAGE_VERBS = ['image-to-pdf', 'bmp-to-pdf', 'gif-to-pdf', 'tiff-to-pdf'];
const ADOBE_DESIGN_VERBS = [
{ verb: 'psd-to-pdf', filetypeKey: 'allowed-filetypes-psd-only' },
{ verb: 'ai-to-pdf', filetypeKey: 'allowed-filetypes-ai-only' },
{ verb: 'indd-to-pdf', filetypeKey: 'allowed-filetypes-indd-only' },
];

NEW_IMAGE_VERBS.forEach((verb) => {
IMAGE_VERBS.forEach((verb) => {
it(`should have correct limits configuration for ${verb} in LIMITS_MAP`, () => {
const verbLimits = ActionBinder.LIMITS_MAP[verb];
expect(verbLimits).to.exist;
expect(verbLimits).to.deep.equal([
'hybrid',
'allowed-filetypes-all',
'allowed-filetypes-no-adobe-design',
'allowed-filetypes-heic',
'max-filesize-100-mb',
]);
Expand All @@ -2961,8 +2958,28 @@ describe('ActionBinder', () => {
expect(ActionBinder.LIMITS_MAP[verb]).to.include('allowed-filetypes-heic');
});

it(`should allow all file types for ${verb}`, () => {
expect(ActionBinder.LIMITS_MAP[verb]).to.include('allowed-filetypes-all');
it(`should use no-adobe-design file types for ${verb}`, () => {
expect(ActionBinder.LIMITS_MAP[verb]).to.include('allowed-filetypes-no-adobe-design');
});

it(`should have max-filesize-100-mb for ${verb}`, () => {
expect(ActionBinder.LIMITS_MAP[verb]).to.include('max-filesize-100-mb');
});
});

ADOBE_DESIGN_VERBS.forEach(({ verb, filetypeKey }) => {
it(`should have correct limits configuration for ${verb} in LIMITS_MAP`, () => {
const verbLimits = ActionBinder.LIMITS_MAP[verb];
expect(verbLimits).to.exist;
expect(verbLimits).to.deep.equal(['hybrid', filetypeKey, 'max-filesize-100-mb']);
});

it(`should configure ${verb} as hybrid mode`, () => {
expect(ActionBinder.LIMITS_MAP[verb][0]).to.equal('hybrid');
});

it(`should restrict ${verb} to its own format via ${filetypeKey}`, () => {
expect(ActionBinder.LIMITS_MAP[verb]).to.include(filetypeKey);
});

it(`should have max-filesize-100-mb for ${verb}`, () => {
Expand Down
28 changes: 14 additions & 14 deletions unitylibs/core/workflow/workflow-acrobat/action-binder.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ export default class ActionBinder {
'pdf-to-ppt': ['hybrid', 'allowed-filetypes-pdf-only', 'max-filesize-250-mb'],
'pdf-to-image': ['hybrid', 'allowed-filetypes-pdf-only', 'max-filesize-100-mb'],
'pdf-to-png': ['hybrid', 'allowed-filetypes-pdf-only', 'max-filesize-100-mb'],
createpdf: ['hybrid', 'allowed-filetypes-all', 'max-filesize-100-mb'],
'word-to-pdf': ['hybrid', 'allowed-filetypes-all', 'max-filesize-100-mb'],
'excel-to-pdf': ['hybrid', 'allowed-filetypes-all', 'max-filesize-100-mb'],
'ppt-to-pdf': ['hybrid', 'allowed-filetypes-all', 'max-filesize-100-mb'],
'jpg-to-pdf': ['hybrid', 'allowed-filetypes-all', 'max-filesize-100-mb'],
'png-to-pdf': ['hybrid', 'allowed-filetypes-all', 'max-filesize-100-mb'],
createpdf: ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'word-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'excel-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'ppt-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'jpg-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'png-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'combine-pdf': ['hybrid', 'page-limit-500', 'allowed-filetypes-all', 'max-filesize-100-mb', 'max-numfiles-100'],
'rotate-pages': ['hybrid', 'page-limit-500', 'allowed-filetypes-pdf-only', 'max-filesize-100-mb', 'max-numfiles-100'],
'protect-pdf': ['single'],
Expand All @@ -75,14 +75,14 @@ export default class ActionBinder {
'chat-pdf-student': ['hybrid', 'allowed-filetypes-pdf-word-ppt-txt', 'page-limit-600', 'max-numfiles-10', 'max-filesize-100-mb'],
'summarize-pdf': ['single', 'allowed-filetypes-pdf-word-ppt-txt', 'page-limit-600', 'max-filesize-100-mb'],
'pdf-ai': ['hybrid', 'allowed-filetypes-pdf-word-ppt-txt', 'page-limit-600', 'max-numfiles-10', 'max-filesize-100-mb'],
'heic-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb', 'max-numfiles-100'],
'image-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'bmp-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'gif-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'tiff-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'indd-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'psd-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'ai-to-pdf': ['hybrid', 'allowed-filetypes-all', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'heic-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb', 'max-numfiles-100'],
'image-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'bmp-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'gif-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'tiff-to-pdf': ['hybrid', 'allowed-filetypes-no-adobe-design', 'allowed-filetypes-heic', 'max-filesize-100-mb'],
'indd-to-pdf': ['hybrid', 'allowed-filetypes-indd-only', 'max-filesize-100-mb'],
'psd-to-pdf': ['hybrid', 'allowed-filetypes-psd-only', 'max-filesize-100-mb'],
'ai-to-pdf': ['hybrid', 'allowed-filetypes-ai-only', 'max-filesize-100-mb'],
'quiz-maker': ['hybrid', 'allowed-filetypes-study-spaces', 'page-limit-600', 'max-numfiles-100', 'max-filesize-100-mb'],
'flashcard-maker': ['hybrid', 'allowed-filetypes-study-spaces', 'page-limit-600', 'max-numfiles-100', 'max-filesize-100-mb'],
'mindmap-maker': ['hybrid', 'allowed-filetypes-study-spaces', 'page-limit-600', 'max-numfiles-100', 'max-filesize-100-mb'],
Expand Down
35 changes: 35 additions & 0 deletions unitylibs/core/workflow/workflow-acrobat/limits.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,41 @@
"image/tiff"
]
},
"allowed-filetypes-no-adobe-design": {
"allowedFileTypes": [
"application/pdf",
"application/msword",
"application/xml",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-powerpoint",
"application/mspowerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/x-tika-ooxml",
"application/vnd.ms-excel",
"application/msexcel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/x-tika-msworks-spreadsheet",
"application/vnd.adobe.form.fillsign",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Ruchika4
Do we want "application/vnd.adobe.form.fillsign" in no-adobe-design?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hi @vipu0303 , requirements called out .ai, .indd and .psd adobe files only hence they were only removed for no-adobe-design from already existing list of allowed file types. I will talk to Andy to get confirmation and we can handle that in a separate PR if needed. Please let me know if any concern.

"application/rtf",
"image/jpeg",
"image/png",
"image/bmp",
"image/gif",
"image/tiff",
"message/rfc822",
"text/plain",
"text/rtf"
]
},
"allowed-filetypes-psd-only": {
"allowedFileTypes": ["image/vnd.adobe.photoshop"]
},
"allowed-filetypes-ai-only": {
"allowedFileTypes": ["application/illustrator"]
},
"allowed-filetypes-indd-only": {
"allowedFileTypes": ["application/x-indesign"]
},
"allowed-filetypes-heic": {
"allowedFileTypes": ["image/heic"]
},
Expand Down
Loading