Skip to content

Fix | Minimum Speaker Requirement not Enforced#86

Open
matiasperrone-exo wants to merge 2 commits into
masterfrom
fix/minimum-speaker-requirement-not-enforced
Open

Fix | Minimum Speaker Requirement not Enforced#86
matiasperrone-exo wants to merge 2 commits into
masterfrom
fix/minimum-speaker-requirement-not-enforced

Conversation

@matiasperrone-exo
Copy link
Copy Markdown

@matiasperrone-exo matiasperrone-exo commented Apr 7, 2026

Task:

Ref: https://app.clickup.com/t/86b7pq79y

Summary of Changes

Problem

The speaker validation on the presentation speakers form only checked whether at least one speaker existed, ignoring the min_speakers and max_speakers constraints configured on the event type.

Changes

src/components/presentation-speakers-form.js

  • Replaced the simplistic boolean validSpeaker check with proper min/max validation using entity.type.min_speakers and entity.type.max_speakers.
  • Added context-aware error messages that vary based on the constraint type:
    • Range (min ≠ max, finite max) → "between {min} and {max}"
    • Minimum only (infinite max) → "at least {min}"
    • Exact match (min = max, >1) → "add {min} speakers"
    • Exactly one (min = max = 1) → "add one speaker"
  • Made the missing_speaker error message use the tenant-configurable speaker label instead of a hardcoded string.
  • Removed unused getMarketingValue import.
  • Refactored early-return pattern for cleaner control flow.

src/i18n/en.json

  • Replaced the single add_speaker error key with four granular keys: add_speakers, add_only_one_speaker, add_exact_number_of_speakers, add_min_number_speakers.
  • Updated missing_speaker to accept a {speaker} parameter.

src/i18n/zh.json

  • Added a new errors block with Chinese translations matching all the new English error keys.
  • Removed the now-unused add_speaker_error key.

@matiasperrone-exo matiasperrone-exo self-assigned this Apr 7, 2026
@matiasperrone-exo matiasperrone-exo force-pushed the fix/minimum-speaker-requirement-not-enforced branch 6 times, most recently from 2cf0e6f to 9001af0 Compare April 7, 2026 21:24
@matiasperrone-exo matiasperrone-exo marked this pull request as ready for review April 7, 2026 21:26
@matiasperrone-exo matiasperrone-exo marked this pull request as draft April 7, 2026 21:26
Comment thread src/components/presentation-speakers-form.js Outdated
Comment thread src/components/presentation-speakers-form.js Outdated
Comment thread src/components/presentation-speakers-form.js Outdated
@matiasperrone-exo matiasperrone-exo marked this pull request as ready for review April 8, 2026 16:51
Copy link
Copy Markdown

@santipalenque santipalenque left a comment

Choose a reason for hiding this comment

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

LGTM

@matiasperrone-exo matiasperrone-exo force-pushed the fix/minimum-speaker-requirement-not-enforced branch 2 times, most recently from c470048 to 57bc593 Compare April 8, 2026 18:42
Copy link
Copy Markdown

@martinquiroga-exo martinquiroga-exo left a comment

Choose a reason for hiding this comment

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

@matiasperrone-exo please see comments

Comment thread src/components/presentation-speakers-form.js
Comment thread src/components/presentation-speakers-form.js
Comment thread src/components/presentation-speakers-form.js Outdated
@matiasperrone-exo
Copy link
Copy Markdown
Author

@martinquiroga-exo please review

@matiasperrone-exo matiasperrone-exo force-pushed the fix/minimum-speaker-requirement-not-enforced branch from 57bc593 to 091d0b1 Compare April 10, 2026 19:35
@matiasperrone-exo matiasperrone-exo force-pushed the fix/minimum-speaker-requirement-not-enforced branch from 091d0b1 to 264de14 Compare April 10, 2026 19:38
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