[MWPW-199709] Conditionally hide Register CTA in C2 GNAV based on registration status - #191
Open
maagrawal16 wants to merge 6 commits into
Open
[MWPW-199709] Conditionally hide Register CTA in C2 GNAV based on registration status#191maagrawal16 wants to merge 6 commits into
maagrawal16 wants to merge 6 commits into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
bandana147
approved these changes
Aug 20, 2026
maagrawal16
force-pushed
the
MWPW-199709
branch
from
September 2, 2026 13:23
a414e8b to
4d393f3
Compare
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.
Added first-class support in the C2 GNAV library for hiding a CTA (e.g. MAX'26's "Register" button) once the visitor is confirmed registered for the event.
How it works
#_hide-when-registeredto the CTA's link href in DA, the same lightweight convention as the existing#_blanksuffix. No new authoring UI.primaryCTA/secondaryCTAstrip the suffix (keeping the real URL clean) and stamp adata-feds-hide-when-registeredmarker on the anchor.initEventRegistrationGatingconsumes the events platform's registration signal and removes the CTA's wrapper (<li>or.feds-product-entry-cta, falling back to the link itself) whenisRegisteredis true.Registration signal — event-driven
Verified against da-events
registration-cache.js: the platform dispatchesregistration:resolvedonwindow(detail{ isRegistered, inPersonAttendee }) before it assignswindow.events. GNAV can render on either side of that, so the gating uses a race-free check-else-listen:window.eventsalready exists, callgetRegistrationStatus()directly;registration:resolvedand readevent.detail.Because the event fires before
window.eventsis assigned, a synchronous "iswindow.eventsthere?" check that sees nothing proves the event hasn't fired yet, so the{ once: true }listener will catch it.Scope / safety
event-codemetadata — non-event pages (the vast majority of adobe.com using this shared GNAV) short-circuit after metadata read and never touchwindow.events.Files
src/Utils/Utils.ts—getRegistrationGateAttrshelper +HIDE_WHEN_REGISTERED_SUFFIXsrc/Components/CTA/Render.ts— stamps thedata-feds-hide-when-registeredmarkersrc/types/adobe-window.d.ts— types thewindow.eventsglobalsrc/PostRendering/EventRegistration.ts— the event-driven gating logic (new)src/Main.ts— wiresinitEventRegistrationGatingintopostRenderingTasksdist/main.js/dist/main.js.map— rebuilt bundletest/Utils/RegistrationGate.test.js,test/Components/CTA/Render.test.js,test/PostRendering/EventRegistration.test.jsTesting
vevent+max2025-registered@adobetest.com(provided by hnv@adobe.com): Register CTA is hidden.maagrawal@adobe.com(my own LDAP): Register CTA remains visible.Test pages:
Dark: https://main--da-events-fg-pink--adobecom.aem.page/max/2026/drafts/maagrawal/c2-gnav-test-dark?fedsbranch=MWPW-199709
Light: https://main--da-events-fg-pink--adobecom.aem.page/max/2026/drafts/maagrawal/c2-gnav-test-light?fedsbranch=MWPW-199709