Add conditional additional settings to the hero block#600
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #600 +/- ##
==========================================
+ Coverage 62.65% 62.66% +0.01%
==========================================
Files 387 387
Lines 40949 40983 +34
Branches 5235 5238 +3
==========================================
+ Hits 25657 25684 +27
- Misses 13682 13689 +7
Partials 1610 1610
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
15574ef to
2c7d9a6
Compare
fceb647 to
6f009c0
Compare
fc4782e to
a620c42
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a620c42607
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| data = getattr(root, 'value', root) | ||
| if data.get('layout') not in _LAYOUTS_WITH_ADDITIONAL_SETTINGS: | ||
| return None | ||
| return data.get('additional_settings') |
There was a problem hiding this comment.
Preserve defaults for existing small-image heroes
When a page already contains a front_page_hero saved before this migration with layout='small_image', the stored StreamField JSON has no additional_settings key because the migration only alters the block schema. This resolver therefore returns null for a layout that now exposes additional settings, so existing heroes do not receive the new defaults such as fit_image=True unless every page is manually resaved or the resolver/data migration synthesizes the default settings.
Useful? React with 👍 / 👎.
Description
Screenshots/Videos (if applicable)
Screen recording in Drive
Related issue
Asana ticket
Requirements, dependencies and related PRs
kausaltech/kausal-backend-common#92
✅ Pre-Merge Checklist
Type of Change
Testing
Manual testing instructions
If feature requires manual testing by reviewer, you can provide instructions here.Internationalization & Accessibility
Integrations (if applicable)
If there are model changes to models which use any of the features below, verify the new models work together with the features.
For example, when adding a new model, verify the new model instances are copied when copying a plan.
Dependencies