-
-
Notifications
You must be signed in to change notification settings - Fork 80
Fixed conversion of early visibility format #1471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes update how node visibility is handled across multiple modules. Modifications in the Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
- Exteneded tests for '', 'status:free', 'status:paid', and 'status:-free+status:-paid' to cover all bases. - Checked `showOnEmail` and `emailOnly` combos to make sure visibility migration works solid.
- changed util functions to always return new objects rather than modify by ref
- renamed `usesOldVisibilityFormat` to `isOldVisibilityFormat` to better represent fn intent
- updated `isOldVisibilityFormat` to handle missing `web/email.memberSegment` properties in case there have been previous incorrect migrations
- extracted "is visibility active" logic to new `isVisibilityRestricted` util function and expanded to cover all old formats
- updated `migrateOldVisibilityFormat` to handle the older `{emailOnly}` format and to correctly migrate the incorrect NQL filters used in older formats
- expanded tests to cover all old formats and NQL filters
- added `yarn test:no-coverage` to `kg-default-nodes` to get cleaner test output when desired during development
ref https://linear.app/ghost/issue/ONC-801/
Early iterations of convent visibility used a
visibilityformat that our format conversion did not support. This could result in HTML cards created from these early iterations not rendering in emails.usesOldVisibilityFormattoisOldVisibilityFormatto better represent fn intentisOldVisibilityFormatto handle missingweb/email.memberSegmentproperties in case there have been previous incorrect migrationsisVisibilityRestrictedutil function and expanded to cover all old formatsmigrateOldVisibilityFormatto handle the older{emailOnly}format and to correctly migrate the incorrect NQL filters used in older formatskg-lexical-html-rendererto assert HTML card does now get rendered in email when using the old visibility formatyarn test:no-coveragetokg-default-nodesto get cleaner test output when desired during development