Skip to content

feat: add draft-state banner and Save as Incomplete flow for NonReceived submissions#968

Merged
smarcet merged 1 commit into
masterfrom
feature/save-incomplete-submissions
Jun 15, 2026
Merged

feat: add draft-state banner and Save as Incomplete flow for NonReceived submissions#968
smarcet merged 1 commit into
masterfrom
feature/save-incomplete-submissions

Conversation

@romanetar

@romanetar romanetar commented Jun 10, 2026

Copy link
Copy Markdown

ref https://app.clickup.com/t/86ba3xg57

Summary by CodeRabbit

  • New Features

    • Users can save events as incomplete drafts via a "Save as Incomplete" action; a "Save & Mark Complete" option is also available.
    • Incomplete events show a draft warning banner listing missing required fields.
    • Localized confirmation is shown after saving drafts.
  • Documentation

    • Added localized labels and messaging for draft handling workflows.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90e0c57d-7440-4704-bb39-c168957670ae

📥 Commits

Reviewing files that changed from the base of the PR and between 4162b15 and 6a2d596.

📒 Files selected for processing (4)
  • src/actions/event-actions.js
  • src/components/forms/event-form.js
  • src/i18n/en.json
  • src/pages/events/edit-summit-event-page.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/i18n/en.json
  • src/components/forms/event-form.js
  • src/pages/events/edit-summit-event-page.js

📝 Walkthrough

Walkthrough

Adds “save as incomplete” draft support: a Redux thunk to persist drafts, EventForm helpers and UI to detect and save incomplete events, i18n strings, and EditSummitEventPage wiring to pass the draft-save handler into the form.

Changes

Draft Event Saving Feature

Layer / File(s) Summary
Redux action for saving event drafts
src/actions/event-actions.js
Introduces saveEventAsDraft async action that validates entity.id, normalizes the event, dispatches loading, issues a PUT to /events/{id}/draft, and shows a localized success message that reloads the page.
EventForm draft state UI and helpers
src/components/forms/event-form.js
Consolidates imports, binds handleSaveIncomplete in the constructor, adds handleSaveIncomplete, isNew, isComplete, and getMissingDraftFields; renders a draft-state warning banner and a conditional "Save as Incomplete" button that invokes the handler.
Internationalization strings for draft feature
src/i18n/en.json
Adds edit_event keys for draft labels, badge, missing-fields text, draft note, save button labels ("Save as Incomplete", "Save & Mark Complete"), and event_saved_as_draft success message.
EditSummitEventPage wiring
src/pages/events/edit-summit-event-page.js
Imports saveEventAsDraft, includes it in component props, passes it to EventForm as onSaveIncomplete, and adds it to the connect(..., mapDispatch) object.

Sequence Diagram

sequenceDiagram
  participant User
  participant EventForm
  participant handleSaveIncomplete
  participant saveEventAsDraft
  participant API
  User->>EventForm: View incomplete event form
  EventForm->>EventForm: getMissingDraftFields()
  EventForm->>EventForm: Render draft warning banner
  User->>EventForm: Click "Save as Incomplete"
  EventForm->>handleSaveIncomplete: handleSaveIncomplete(event)
  handleSaveIncomplete->>saveEventAsDraft: onSaveIncomplete(entity)
  saveEventAsDraft->>API: PUT /events/{id}/draft
  API-->>saveEventAsDraft: 200 OK
  saveEventAsDraft->>User: Show success message + reload
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested Reviewers

  • martinquiroga-exo
  • smarcet

Poem

🐰 I nibble on drafts, tuck progress away,

Bits of events in a soft clover bay,
Incomplete but kept, not lost to the night,
A button, a save — the form holds tight,
Reload, and hop back to finish the play.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a draft-state banner and 'Save as Incomplete' flow for NonReceived submissions, which directly aligns with the changeset across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/save-incomplete-submissions

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/actions/event-actions.js`:
- Around line 911-948: saveEventAsDraft calls the PUT draft endpoint using
entity.id without checking it; add an early guard in saveEventAsDraft to verify
entity.id is present and valid before building the URL and calling putRequest
(the function name is saveEventAsDraft and the URL uses currentSummit.id and
entity.id). If entity.id is missing, dispatch stopLoading or showMessage with a
clear error (reusing showMessage and T.translate keys), and return a rejected
Promise (or simply return) to avoid calling
putRequest/createAction(UPDATE_EVENT)/createAction(EVENT_UPDATED); only proceed
to normalizeEvent and call putRequest when entity.id exists.

In `@src/components/forms/event-form.js`:
- Around line 737-740: The isComplete() method assumes this.state.entity and its
fields exist; make the logic explicitly check for entity and defined
status/progress before comparing. Update isComplete to first guard that
this.state.entity is truthy and that entity.status and entity.progress are not
undefined (or use explicit comparisons like entity.status === "Received" &&
entity.progress === "COMPLETE" only after those checks) so the method clearly
documents intent and avoids issues if the entity shape changes.
- Around line 742-761: getMissingDraftFields currently uses inverted checks
("!entity.type_id || ...") which causes date and disclaimer validations to run
when no type is selected; change both conditionals to require a type and the
field applicability (use "entity.type_id &&
this.shouldShowField('allows_publishing_dates')" for the dates block and
"entity.type_id && this.isEventType(EVENT_TYPE_PRESENTATION)" for the disclaimer
block) so the method only validates those fields when a type is set and the UI
would show them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0301408-1a1b-4ada-8c20-1c0317b20913

📥 Commits

Reviewing files that changed from the base of the PR and between 415be12 and 4162b15.

📒 Files selected for processing (4)
  • src/actions/event-actions.js
  • src/components/forms/event-form.js
  • src/i18n/en.json
  • src/pages/events/edit-summit-event-page.js

Comment thread src/actions/event-actions.js
Comment thread src/components/forms/event-form.js
Comment thread src/components/forms/event-form.js
@romanetar romanetar force-pushed the feature/save-incomplete-submissions branch from 4162b15 to 6a2d596 Compare June 10, 2026 18:14
@romanetar romanetar requested a review from smarcet June 10, 2026 18:19

@smarcet smarcet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@smarcet smarcet merged commit 3373e88 into master Jun 15, 2026
9 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.

2 participants