fix(promocode): clarify Apply-to-all scope (Audience: All only)#926
Closed
caseylocker wants to merge 2 commits into
Closed
fix(promocode): clarify Apply-to-all scope (Audience: All only)#926caseylocker wants to merge 2 commits into
caseylocker wants to merge 2 commits into
Conversation
Backend tightens canBeAppliedTo() so the implicit "apply to all" branch only covers Audience = All ticket types (see companion API SDS). This change updates the admin copy so the checkbox label and a new helper-text row name the restriction explicitly. WithInvitation, WithoutInvitation, and WithPromoCode ticket types must be opted in via the picker after saving. No JS logic change — the apply_to_all_tix flag is and remains UI-only. Refs: ClickUp 86b9vrpxp; companion summit-api branch feat/promo-code-apply-to-all-audience-restriction
The `edit_promocode.apply_to_all_tix` i18n key is also rendered by speakers-promo-code-spec-form.js under the AUTO_GENERATED_SPEAKERS_DISCOUNT_CODE branch (a discount-code path). The label update from the prior commit lands there too, so the same helper row belongs beneath that checkbox to keep the admin clarity consistent across both forms. Spec line citations updated to reflect the actual en.json position. Refs: ClickUp 86b9vrpxp; Codex review of a694ada.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The backend tightens
canBeAppliedTo()so the implicit "apply to all" branch only coversAudience = Allticket types (see companion summit-api PR). This change updates the admin copy so the checkbox label and a new helper-text row name the restriction explicitly. WithInvitation, WithoutInvitation, and WithPromoCode ticket types must be opted in via the picker after saving.No JS logic change — the
apply_to_all_tixflag is and remains UI-only (deleted before send atsrc/actions/promocode-actions.js:160and re-derived fromticket_types_rules.length === 0atsrc/reducers/promocodes/promocode-reducer.js:179).doc/promo-code-apply-to-all-audience-restriction.mdWhat changed
src/i18n/en.json—apply_to_all_tixrewritten to "Apply to all ticket types (Audience: All)"; newapply_to_all_tix_helperkey.src/components/forms/promocode-form/forms/discount-base-pc-form.js— added<small className="form-text text-muted">helper row beneath the checkbox.src/components/forms/speakers-promo-code-spec-form.js— same i18n key is rendered under theAUTO_GENERATED_SPEAKERS_DISCOUNT_CODEbranch; added the matching helper row there.src/components/forms/promocode-form/__tests__/promocode-form.integration.test.js— 7 new test cases (6 discount-code classes × label/helper assertions + one helper-renders-when-unchecked case).doc/promo-code-apply-to-all-audience-restriction.md— dedicated spec.AC5 wording note
The ClickUp acceptance criterion #5 says "submitting
apply_to_all_ticket_types = trueresolves to Audience = All only, regardless of frontend." No such payload field is sent —apply_to_all_tixis a UI-only flag and is stripped before the API call. The actual enforcement is on the backend at the entity level (canBeAppliedTo). See the companion summit-api PR. A hostile client cannot bypass — there's no field to forge.Test plan
yarn test --watchAll=false src/components/forms/promocode-form/__tests__/promocode-form.integration.test.js— 38/38 passyarn test --watchAll=false --testPathPatterns="promocode|promo-code|methods"— 97/97 passNotes
actions.test.js,dropbox-sync-actions.test.js,edit-sponsor-page.test.js) — same failures present onorigin/masterbaseline.