Skip to content

[MWPW-200290]Restrict accepted file types and fix redirect mapping for adobe file format verbs#142

Open
Ruchika4 wants to merge 3 commits into
stagefrom
MWPW-200290
Open

[MWPW-200290]Restrict accepted file types and fix redirect mapping for adobe file format verbs#142
Ruchika4 wants to merge 3 commits into
stagefrom
MWPW-200290

Conversation

@Ruchika4

@Ruchika4 Ruchika4 commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Restricts accepted file types for frictionless verbs to match the approved verb-to-format matrix.
Screenshot 2026-07-11 at 8 57 22 PM

Key changes in verb-widget.js:

  • Added COMMON_TO_PDF_FILES — the shared set for most to-PDF verbs: image formats (jpg/jpeg/png/heic/tif/tiff/bmp/gif) + office docs (doc/docx/ppt/pptx/xls/xlsx/rtf/txt/text). Removes previously accepted specialty formats (PSD, AI, INDD) and legacy types (xml, form) from these verbs.
  • Added CREATEPDF_FILESCOMMON_TO_PDF_FILES + .psd/.ai/.indd, used by createpdf which accepts all formats per spec.
  • psd-to-pdf, ai-to-pdf, indd-to-pdf now accept only their respective single format (.psd, .ai, .indd) instead of the full file list.
  • Updated verbRedirMap: psd-to-pdf, ai-to-pdf, indd-to-pdf now redirect to createpdf instead of jpgtopdf.
  • No changes to verbs outside the matrix (compress-pdf, summarize-pdf, ocr-pdf, chat-pdf, pdf-to-*, etc.).
  • Updated verbRedirMap to redirect psd-to-pdf, ai-to-pdf, and indd-to-pdf to the createpdf endpoint instead of jpgtopdf, aligning the redirect destination with the Convert PDF flow.

Verbs and their new accepted types:

Verb Accepted formats
createpdf All: images + office + PSD/AI/INDD + HEIC
jpg-to-pdf, png-to-pdf, word-to-pdf, excel-to-pdf, ppt-to-pdf Images + office docs + HEIC (no PSD/AI/INDD)
image-to-pdf, bmp-to-pdf, gif-to-pdf, tiff-to-pdf Images + office docs + HEIC (no PSD/AI/INDD)
psd-to-pdf .psd only
ai-to-pdf .ai only
indd-to-pdf .indd only

Tests updated (verb-widget-ios-accept.test.js):

  • Removed image-to-pdf, bmp-to-pdf, gif-to-pdf, tiff-to-pdf from IOS_UNKNOWN_VERBS — they no longer carry iOS-unknown extensions so the file picker no longer falls back to accept="*/*" on iOS.
  • Updated psd-to-pdf desktop test: now asserts .psd is present and .pdf is absent.
  • Updated jpg-to-pdf iOS test: now asserts specific types are present (.jpg, .heic) and specialty formats are absent.

Test plan

  • On a verb page (e.g. /acrobat/online/jpg-to-pdf), open the file picker and verify only the expected types are selectable (no PSD/AI/INDD options visible).
  • On /acrobat/online/psd-to-pdf, verify the file picker only accepts .psd.
  • On /acrobat/online/ai-to-pdf, verify the file picker only accepts .ai.
  • On /acrobat/online/indd-to-pdf, verify the file picker only accepts .indd.
  • On /acrobat/online/convert-pdf, verify all formats including PSD/AI/INDD and HEIC are accepted.
  • On an iOS device, verify psd-to-pdf / ai-to-pdf / indd-to-pdf still show accept="*/*" (specialty formats trigger the iOS fallback), while jpg-to-pdf and image verbs now show specific types. This was added because on iPhone ai, psd and indd formats were not getting detected hence all file types were allowed in file selector. It is the current behavior too.
  • Redirect update after file upload for ai-to-pdf, psd-to-pdf and indd-to-pdf to createpdf (same as convert-pdf verb) will be tested once unity changes are also ready.
  • Run unit tests: npm run wtr:file -- ./test/blocks/verb-widget/verb-widget-ios-accept.test.js

Test URLs:

Resolves: MWPW-200290
MWPW-200292
MWPW-200305

@aem-code-sync

aem-code-sync Bot commented Jul 12, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Jul 12, 2026

Copy link
Copy Markdown

@codecov-commenter

codecov-commenter commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.26%. Comparing base (690414d) to head (6cc9aed).

Additional details and impacted files
@@            Coverage Diff             @@
##            stage     #142      +/-   ##
==========================================
- Coverage   81.44%   80.26%   -1.18%     
==========================================
  Files          45       45              
  Lines        9594     9599       +5     
==========================================
- Hits         7814     7705     -109     
- Misses       1780     1894     +114     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants