Update Idea Hub widget footer based on selected tab
See original GitHub issueFeature Description
In #3773 we moved the Idea Hub widget footer into the widget itself (rather than in the “body” of the component).
This brought the widget to be more consistent with others but left a few things to be addressed.
Other related points were raised in the bug bash which can be addressed here as well.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
The following changes all apply to the Idea Hub dashboard widget
- The “Updated every 2-3 days” text in the footer should only be displayed on the tab for new ideas as these are the only ideas that are refreshed from the API
- The footer should not be displayed for zero-idea states – except on the new ideas tab (as the previously mentioned message is still relevant)
- Pagination in the footer should not be shown for zero-idea states (only applies to new ideas per above)
- The height of the widget should not change based on the selected tab (#3723)
- The “This may take 24 hours” text should be removed in all cases
- The following changes/exceptions only apply to the zero total ideas state (no new/saved/draft ideas)
- The widget tabs should not be displayed at all (as is currently)
- The widget footer should not be displayed at all
Implementation Brief
- Once https://github.com/google/site-kit-wp/issues/3832 has been merged.
- Using
assets/js/modules/idea-hub/components/dashboard/DashboardIdeasWidget/index.js
,- Check if selectors have been resolved and there are no errors for each of the following selectors:
getNewIdeas
,getSavedIdeas
andgetDraftPostIdeas
via thehasFinishedResolution
andgetErrorForSelector
selectors. WrappedFooter
should be a variable, withnull
as an initial value instead of a function. The reason being we are passing a function as the value to theFooter
prop ofWidget
which implies the prop is not null. Thus, even if the function returnsnull
, an empty footer will be displayed.- Depending on the value of
activeTab
,- if it’s
new-ideas
, check if there are any errors for thegetNewIdeas
selector and if it has finished resolving, to assignWrapperFooter
theFooter
component, passing on theactiveTab
as value to thetab
prop andfooterText
prop set to the translatableUpdated every 2-3 days
string. - if it’s
saved-ideas
ordraft-ideas
, check if there are any errors for thegetSavedIdeas
orgetDraftPostIdeas
selectors and if they have finished resolving to assignWrapperFooter
theFooter
component.
- if it’s
- In all instances where the
Footer
component is used in the above bullet points, thetab
prop should be theactiveTab
value.
- Check if selectors have been resolved and there are no errors for each of the following selectors:
Test Coverage
- No new tests to be added.
Visual Regression Changes
- N/A
QA Brief
- Go to the dashboard and verify the following:
Updated every 2-3 days
is shown only for the new ideas tab- the footer should be hidden for saved ideas and draft ideas tabs if there is no ideas for those lists
- the
This may take 24 hours
message is deleted when there are no ideas in the new ideas list
- Double check that requirements from AC are met in the Idea Hub widget.
Changelog entry
- Show correct footer information based on Idea Hub tab.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Convert useHash to useQueryParam in Idea Hub · Issue #3886
There's no reason to change the URL based on the Idea Hub tab—the main design for hash routes is to be able to...
Read more >Sample Footer widget - Product Documentation | ServiceNow
The Sample Footer widget is an example of a footer you can use in your portal. You can use this base system widget...
Read more >How to Create A Header & Footer in WordPress + Examples
See how to customize your WordPress header & footer areas, including Sticky Header, stunning header-footer blocks and more using Elementor.
Read more >Take Part in the New UI Preview for Your JetBrains IDE
Update : The beta version of the new UI is available to all users in the 2022.3 release. Go to Settings | Appearance...
Read more >How To Edit the Footer in WordPress Using Every Method ...
All that's required is to go to the Theme Customizer > Widgets. Then, choose the widget area that reflects where you want the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@wpdarren @tofumatt – it works correctly on tabs that are in a non-zero state, the height is not preserved in the zero state. I did not test all tabs in each state but I’m guessing this is the problem.
https://user-images.githubusercontent.com/1621608/130648456-6a1b68d6-8a21-49ba-a3eb-67949a32df6f.mp4
The problem is that the footer isn’t being rendered at all in this case (as intended visually) but this affects the height since there is one footer for the widget and 3 separate content areas.
I’ll see what I can do here.
Yes, i can take care of it in this ticket.