Skip to content

Fix Schedule At DatePicker showing Invalid Date and resetting on poll#593

Merged
xIrusux merged 2 commits into2.4from
560-fix-calendar
Apr 8, 2026
Merged

Fix Schedule At DatePicker showing Invalid Date and resetting on poll#593
xIrusux merged 2 commits into2.4from
560-fix-calendar

Conversation

@xIrusux
Copy link
Copy Markdown
Contributor

@xIrusux xIrusux commented Apr 8, 2026

Summary

Fixes the "Schedule At" DatePicker in the execution tab:

  • Invalid Date display: After selecting a date, the DatePicker showed "Invalid Date" because the studio-ui-bundle's toDayJs() doesn't receive the outputFormat for parsing DD-MM-YYYY HH:mm strings. Worked around by converting scheduledAt to/from ISO-8601 in the data-importer's transformers — ISO strings are natively parseable by dayjs.
  • Date selection reset on polling: The checkImportProgress polling (every 5s) caused the DatePicker's unconfirmed selection to reset. Fixed by extracting polling/progress logic into an isolated ExecutionStatus child component so poll-driven re-renders don't propagate to form fields.
  • RTK Query tag cascade: All endpoints shared a single Bundle Data Importer tag, so any mutation (start import, cancel, save, upload) would invalidate all queries including configGet — causing background refetches that could destroy form state. Fixed by overriding all endpoint tags to [] in the enhanced API slice.

Changes

  • transformers.ts — Added scheduledAtToForm() / scheduledAtToBackend() conversion between backend DD-MM-YYYY HH:mm and ISO-8601
  • execution-tab.tsx — Removed outputFormat from DatePicker, simplified to stateless form fields + ExecutionStatus child
  • execution-status.tsx — New component: extracted polling, optimistic state, mutations, progress bar from ExecutionTab
  • data-importer-api-slice-enhanced.ts — Overrode all endpoint tags to [] to prevent cross-endpoint cache invalidation; added 3 hook re-exports for the execution-status component

The studio-ui-bundle DatePicker calls toDayJs(value) without passing the
outputFormat, so DD-MM-YYYY HH:mm strings cannot be parsed — resulting in
'Invalid Date' display after selection.

Since we cannot modify the studio-ui-bundle, this works around the bug by:
- Converting scheduledAt between backend format (DD-MM-YYYY HH:mm) and
  ISO-8601 in the transformers, since ISO strings are natively parseable
  by dayjs without a format hint
- Removing outputFormat from the DatePicker so fromDayJs() produces ISO
  strings via value.format()
- Isolating RTK Query tags to prevent mutations from triggering background
  refetches that would destroy form state
- Extracting polling/progress logic into an ExecutionStatus child component
  so poll-driven re-renders don't reset the DatePicker's unconfirmed
  selection
@xIrusux xIrusux requested a review from markus-moser April 8, 2026 15:58
@xIrusux xIrusux self-assigned this Apr 8, 2026
Use outputFormat that dayjs can parse natively without a format hint,
so toDayJs() in the studio-ui-bundle still works without modification.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@xIrusux xIrusux merged commit 220e209 into 2.4 Apr 8, 2026
3 of 8 checks passed
@xIrusux xIrusux deleted the 560-fix-calendar branch April 8, 2026 16:23
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants