Guest import - #365
Conversation
For some reason, they were preventing me from using the banner component in a server component.
WalkthroughAdds UUID public identifiers to events and exposes guest summary, data, and import endpoints. The backend resolves guest sessions, reports conflicts, and transfers events and participations according to submitted choices. The frontend adds guest-import login, settings, review, loading, and conflict-resolution pages, along with API types and routes. Settings navigation, dialogs, client-component boundaries, guest-mode messaging, and login redirect suppression are also updated. 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 |
There was a problem hiding this comment.
Actionable comments posted: 11
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9e1d4743-7644-47e5-88c9-e69876e657b8
📒 Files selected for processing (37)
backend/api/docs/utils.pybackend/api/event/utils.pybackend/api/guest_import/serializers.pybackend/api/guest_import/urls.pybackend/api/guest_import/utils.pybackend/api/guest_import/views.pybackend/api/migrations/0034_userevent_public_id.pybackend/api/migrations/0035_populate_public_id.pybackend/api/migrations/0036_apply_unique_constraint.pybackend/api/models.pybackend/api/urls.pyfrontend/src/app/(auth)/login/page.tsxfrontend/src/app/dashboard/page-client.tsxfrontend/src/app/guest-import/import/loading.tsxfrontend/src/app/guest-import/import/page-client.tsxfrontend/src/app/guest-import/import/page.tsxfrontend/src/app/guest-import/layout.tsxfrontend/src/app/guest-import/login/page-client.tsxfrontend/src/app/guest-import/login/page.tsxfrontend/src/app/settings/(submenus)/guest-import/page.tsxfrontend/src/app/settings/loading.tsxfrontend/src/components/layout/message-page.tsxfrontend/src/features/account/setting-dialogs/change-password/main-dialog.tsxfrontend/src/features/account/setting-dialogs/delete-account.tsxfrontend/src/features/account/settings/sidebar-nav.tsxfrontend/src/features/drawer/components/base.tsxfrontend/src/features/guest-import/components/guest-summary.tsxfrontend/src/features/guest-import/constants.tsfrontend/src/features/selector/components/drawer.tsxfrontend/src/features/system-feedback/dialog/components/base.tsxfrontend/src/features/system-feedback/dialog/components/confirmation.tsxfrontend/src/features/system-feedback/dialog/components/form.tsxfrontend/src/features/system-feedback/dialog/props.tsfrontend/src/features/system-feedback/toast/context.tsfrontend/src/lib/utils/api/endpoints.tsfrontend/src/lib/utils/api/types.tsfrontend/src/middleware.ts
💤 Files with no reviewable changes (1)
- frontend/src/features/account/setting-dialogs/change-password/main-dialog.tsx
This PR adds functionality for importing guest data into an account.
New Endpoints
There are 3 new endpoints to support this feature.
/guest-import/get-summary/- Returns counts of events and availabilities belonging to the guest on the request./guest-import/get-data/- Returns data about each event and availability a guest has submitted, along with any conflicts./guest-import/import-data/- Given conflict resolutions, imports the guest data into the account.Conflicts happen when a user has added availability to an event both as a guest and from their account. They can only choose one to keep, and the other is deleted upon importing. This information is also explained to the user on the import page.
New Pages
/settings/guest-import/- Shows the user a summary of their guest data (if any is found), with a link to the import page./guest-import/login/- Shows upon logging in if guest data is found, displays a summary and the option to import the data (which brings them to the import page)./guest-import/import/- Gives the user a chance to review the data they are importing and resolve any conflicts.The login-triggered page has an option for "don't show this again", which saves a value to local storage if checked.
guest-importwas also added to the reserved keywords list, making it forbidden as a URL code.public_idColumn Added toUserEventEvents will eventually lose their URL codes when we implement archiving. In preparation for this, I added a
public_idfield to be able to identify events without a URL code. Thispublic_idis just a UUID that auto-populates when creating an event, the same as the one onUserSessionandEventParticipant."use client";Directive AddedThe drawer, dialog, and toast components didn't have this directive on them, which for some reason didn't let me use a
Bannercomponent in a server component.FormDialogUpdatesOne change is the same one that was made to the
ConfirmationDialog, where it will automatically convert to a drawer if used on mobile. This removed a few redundantasNestedDrawerprops.The other change is an added
submitDisabledprop, which disables the submit button.MessagePageChildren SupportThe
childrenprop was added to theMessagePage, so any content could be displayed inside the layout.