Skip to content

release 20260302#349

Merged
marcbon merged 14 commits intomasterfrom
develop
Mar 2, 2026
Merged

release 20260302#349
marcbon merged 14 commits intomasterfrom
develop

Conversation

@marcbon
Copy link
Collaborator

@marcbon marcbon commented Mar 2, 2026

  • bug form allowed media

d-beezee and others added 14 commits February 11, 2026 10:36
- table_net_gross: scope to first .wallet-table to avoid matching the new expired attribution table (7+5=12 headers)
- manual payment: reset count in beforeEach to avoid cross-test accumulation
fix: align wallet E2E tests to current UI structure
Fills in the previously empty BUGFORM_UPLOAD_TXT_VIDEO_IMAGE key
(shown in BugForm when autoApprove=1 and minimumMedia > 1) in all
four locales, and translates the video/image validation error messages
that were left in English in the it/es/fr files.

- en: BUGFORM_UPLOAD_TXT_VIDEO_IMAGE filled in
- it: BUGFORM_UPLOAD_TXT_VIDEO_IMAGE + error messages in Italian
- es: BUGFORM_UPLOAD_TXT_VIDEO_IMAGE + error messages in Spanish
- fr: BUGFORM_UPLOAD_TXT_VIDEO_IMAGE + error messages in French
The store was previously created inline inside <Provider store={setupStore()}>,
which created a new store instance on every App render. Moving it to module
scope makes the reference stable.

In non-production environments (development + test), the store is also
exposed on window.__store to allow E2E tests to dispatch Redux actions
directly without going through the UI upload flow.
The uploadFiles helper was failing because:
1. It called setInputFiles before the BugForm was mounted (campaign data
   not yet in Redux), causing uploadMedia to bail out at the
   `if (!campaign.data) return` guard.
2. React 17's synthetic event delegation does not fire on events
   dispatched via CDP (setInputFiles) or page.evaluate, so react-dropzone's
   onAccepted callback was never triggered regardless of the approach
   (setInputFiles, DragEvent, native input override).

Fix: wait for "Upload files" to be visible (guarantees the form is mounted
and campaign data is loaded), then inject the media list directly into the
Redux store via window.__store.dispatch instead of simulating the upload UI.
This is reliable because:
- The FileDropzone and FileList useEffect hooks react to mediaList changes
  via useSelector, so Formik's media field is updated automatically.
- The yup has-video / has-image validators close over mediaList from Redux,
  so they receive the correct data when the form is submitted.
- Replace redundant <Trans> with t() in the standard message branch:
  removes the tOptions prop (redundant with count), aligns defaultValue
  with the actual EN translation
- Fix French singular form for BUGFORM_UPLOAD_TXT and
  BUGFORM_UPLOAD_ERROR_MINIMUMFILES ("médias" → "média"; plural _plural
  variant with "médias" is kept for count > 1)
feat(UN-2378): media type constraints for autoApprove campaigns in BugForm
@marcbon marcbon merged commit f659e6d into master Mar 2, 2026
8 checks passed
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.

4 participants