Commit 590591f
FORMS-26813 : Show custom acceptMessage for unsupported file type in File Attachment (#1943)
* Fix custom accept error message not shown for unsupported file type in file input
The file-input widget's invalidMessage() looked up
constraintMessages.invalidMimeType for the unsupported-file-type alert,
but invalidMimeType is not an authorable constraint message key - the
schema only exposes constraintMessages.accept (backed by the
acceptMessage dialog property). As a result the custom message
authors configure for file type validation was always ignored in
favor of the generic fallback string, while the analogous
maxFileSize custom message worked correctly since its key matched.
Updated both the webpack source (ui.frontend) and the apps clientlib
copy (ui.af.apps) to read constraintMessages.accept, and added a
Cypress assertion mirroring the existing maxFileSize custom-message
test.
* FORMS-26813 : populate sample.afe fixture so the unsupported-type test reaches the mime-type (accept) check instead of the empty-file check
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* FORMS-26813 : use existing sample.svg fixture on fileinput3 for the unsupported-type test
Point the accept test at fileinput3 (accept=[application/pdf]) and upload sample.svg
(an image, unsupported there) instead of populating a sample.afe placeholder. svg is
non-empty so it passes the empty-file check and reaches the mime-type (accept) check.
Matches the release/650 backport (#1940).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Farha Haroon <fharoon@adobe.com>
Co-authored-by: Mayank Jindal <mayankjindal@adobe.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 040f877 commit 590591f
4 files changed
Lines changed: 13 additions & 2 deletions
File tree
- it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv4/basic
- ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/fileinput/v4/fileinput/clientlibs/site/js
- ui.frontend/src/view
- ui.tests/test-module/specs/fileinput
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
275 | 285 | | |
276 | 286 | | |
277 | 287 | | |
| |||
0 commit comments