Skip to content

BulkFixTimezoneShiftButton: confirm before firing - #44

Merged
buzz-code merged 1 commit into
mainfrom
claude/fix-timezone-shift-confirm
Sep 2, 2026
Merged

buzz-code merged 1 commit into
mainfrom
claude/fix-timezone-shift-confirm

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Addresses a Copilot review finding on buzz-code/react-admin-nestjs#167 (submodule bump PR for #43): the button fired immediately on click with no confirmation, for a bulk action that can shift already-correct data the wrong way if run on the wrong rows.

Change

Pass children to BulkActionButton — this switches it to dialog mode (BulkRequestButton/ActionOrDialogButton), showing a warning with the selected-row count and requiring an explicit confirm click before the action fires.

Testing

  • cd client && yarn test — 31/32 suites passing (1 pre-existing skip, unrelated)
  • cd client && yarn build — clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn


Generated by Claude Code

Copilot AI lite review requested due to automatic review settings September 2, 2026 09:01
Addresses a Copilot review finding on buzz-code/react-admin-nestjs#167:
the button fired immediately on click, no confirmation, for an action
that can corrupt already-correct data if run on the wrong rows. Passing
children to BulkActionButton switches it to dialog mode (via
BulkRequestButton/ActionOrDialogButton), so it now shows a warning with
the selected-row count and requires an explicit confirm click.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn
@buzz-code
buzz-code force-pushed the claude/fix-timezone-shift-confirm branch from d50daf3 to 85a6782 Compare September 2, 2026 09:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Non-admin users can end up with an “empty” bulk actions toolbar because the self-hiding button is still counted as a truthy bulk action element.

Pull request overview

Adds a confirmation step for the admin-only bulk action that fixes createdAt/updatedAt timezone-shifted rows, reducing the risk of accidentally shifting already-correct data when the wrong rows are selected.

Changes:

  • Introduces BulkFixTimezoneShiftButton which provides warning/confirmation dialog content before executing the fixTimezoneShift bulk action.
  • Auto-detects timestamped resources in CommonList (via list data) and conditionally offers the bulk action button on those lists.
File summaries
File Description
components/crudContainers/CommonList.jsx Adds auto-detection of timestamp columns and injects the bulk timezone-fix action into bulk actions.
components/crudContainers/BulkFixTimezoneShiftButton.jsx New bulk-action button that renders confirmation dialog content and restricts visibility to admins.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@buzz-code
buzz-code merged commit 601a197 into main Sep 2, 2026
buzz-code pushed a commit to buzz-code/react-admin-nestjs that referenced this pull request Sep 2, 2026
Picks up:
- buzz-code/nra-server#46: cache the Intl.DateTimeFormat instance in
  fixTimezoneShift (was constructed fresh up to 3x per date column per
  row)
- buzz-code/nra-client#44: BulkFixTimezoneShiftButton now confirms
  before firing (was immediate on click)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn
buzz-code added a commit to buzz-code/react-admin-nestjs that referenced this pull request Sep 2, 2026
…167)

* Bump client/shared and server/shared: admin-only timezone-fix action

Picks up:
- buzz-code/nra-server#45: generic admin-only 'fixTimezoneShift' doAction
  on BaseEntityService, correcting createdAt/updatedAt for rows written
  before the mysql connection was pinned to UTC (nra-server#44)
- buzz-code/nra-client#43: matching admin-only bulk action button,
  auto-offered on any list whose rows carry createdAt/updatedAt

No per-entity wiring needed on either side - every list backed by
BaseEntityService with createdAt/updatedAt (att_report, klass, student,
teacher, ...) picks this up automatically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn

* Bump client/shared and server/shared: address Copilot review findings

Picks up:
- buzz-code/nra-server#46: cache the Intl.DateTimeFormat instance in
  fixTimezoneShift (was constructed fresh up to 3x per date column per
  row)
- buzz-code/nra-client#44: BulkFixTimezoneShiftButton now confirms
  before firing (was immediate on click)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

3 participants