From ddf5d7dbf5a532030cc0e128e5d61c0fdc48c990 Mon Sep 17 00:00:00 2001 From: romanetar Date: Thu, 18 Jun 2026 20:03:56 +0200 Subject: [PATCH] feat(events): differentiate draft-incomplete vs draft-complete UI for presentations --- src/components/forms/event-form.js | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/components/forms/event-form.js b/src/components/forms/event-form.js index ced53818e..caa9b7882 100644 --- a/src/components/forms/event-form.js +++ b/src/components/forms/event-form.js @@ -747,6 +747,11 @@ class EventForm extends React.Component { ); } + isDraftComplete() { + const { entity } = this.state; + return entity?.status === "NonReceived" && entity?.progress === "COMPLETE"; + } + getMissingDraftFields() { const { entity } = this.state; const missing = []; @@ -754,16 +759,7 @@ class EventForm extends React.Component { if (!entity.title) missing.push("Title"); if (!entity.type_id) missing.push("Activity Type"); if (!entity.track_id) missing.push("Activity Category"); - - if (!entity.type_id || this.shouldShowField("allows_publishing_dates")) { - if (!entity.start_date) missing.push("Start Date"); - if (!entity.end_date) missing.push("End Date"); - if (!entity.duration) missing.push("Duration"); - } - - if (!entity.type_id || this.isEventType(EVENT_TYPE_PRESENTATION)) { - if (!entity.disclaimer_accepted) missing.push("Disclaimer Accepted"); - } + if (!entity.speakers?.length) missing.push("Speakers"); return missing; } @@ -1085,15 +1081,17 @@ class EventForm extends React.Component { { label: "Submission", value: "Submission" } ]; + const showDraftUI = + this.isPresentation() && !this.isNew() && !this.isComplete(); const missingDraftFields = - !this.isPresentation() || this.isNew() || this.isComplete() - ? [] - : this.getMissingDraftFields(); + showDraftUI && !this.isDraftComplete() + ? this.getMissingDraftFields() + : []; return (
- {this.isPresentation() && !this.isNew() && !this.isComplete() && ( + {showDraftUI && (
this.triggerFormSubmit(ev, false)} className="btn btn-primary pull-right" - value={T.translate("edit_event.save_and_mark_complete")} + value={T.translate( + showDraftUI && !this.isDraftComplete() + ? "edit_event.save_and_mark_complete" + : "general.save" + )} /> - {this.isPresentation() && - !this.isNew() && - !this.isComplete() && ( - - )} + {showDraftUI && !this.isDraftComplete() && ( + + )}
)}