-
Notifications
You must be signed in to change notification settings - Fork 63
Make isNewHeaderEnabled
a computed so that it's updated
#1892
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/1892 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add .value
to its usages in the <script>
section. I can't review those parts as they haven't changed.
Size Change: -1.43 kB (0%) Total Size: 814 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@obulat LGTM!
@zackkrida it could make sense to make the isOn
be a computed property, but wouldn't components using it still need to put the value inside a computed
call?
I just realised that this might break the "feature" that flags toggled using |
Which change might break the query param feature, @dhruvkb ? The one in this PR, or Zack's suggestion about returning a computed from isOn? |
The one in this PR. |
What should the behavior be when you open the preferences and uncheck the checkbox that was previously set using a query param? 🤔
My personal preference would be the second option, but maybe it's because I can only see this used in the current situation, and not for the future feature flag. We wanted the query parameter for a flag feature to be able to show the feature to the stakeholders (e.g. on staging) without having them set up the app locally. It should be possible to revert the flag state using the UI in such a case. I wonder if we should add the feature flags to the routing: if the flag is set, the query is always shown in the URL. This way, it will always be synced with the cookie state, and you would be able to update the flag value both on the preferences page, and by changing the query param. |
Based on the high urgency of this PR, the following reviewers are being gently reminded to review this PR: @zackkrida Excluding weekend1 days, this PR was updated 2 day(s) ago. PRs labelled with high urgency are expected to be reviewed within 2 weekday(s)2. @obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings. Footnotes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes
Fixes #1891 by @obulat
Description
This PR makes
isNewHeaderEnabled
a computed so that it's updated when you check thenew_header
checkbox on the Preferences page.Testing Instructions
Go to the Preferences page (http://localhost:8443/preferences) and check the
new_header
flag. You should see the header updated immediately (it should now have internal links).You can also try the staging to see that the header there is not updated until you reload the page.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin