question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update Idea Hub widget footer based on selected tab

See original GitHub issue

Feature 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 and getDraftPostIdeas via the hasFinishedResolution and getErrorForSelector selectors.
    • WrappedFooter should be a variable, with null as an initial value instead of a function. The reason being we are passing a function as the value to the Footer prop of Widget which implies the prop is not null. Thus, even if the function returns null, an empty footer will be displayed.
    • Depending on the value of activeTab,
      • if it’s new-ideas, check if there are any errors for the getNewIdeas selector and if it has finished resolving, to assign WrapperFooter the Footer component, passing on the activeTab as value to the tab prop and footerText prop set to the translatable Updated every 2-3 days string.
      • if it’s saved-ideas or draft-ideas, check if there are any errors for the getSavedIdeas or getDraftPostIdeas selectors and if they have finished resolving to assign WrapperFooter the Footer component.
    • In all instances where the Footer component is used in the above bullet points, the tab prop should be the activeTab value.

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:closed
  • Created 2 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aaemnnosttvcommented, Aug 24, 2021

@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.

1reaction
eugene-manuilovcommented, Aug 19, 2021

Yes, i can take care of it in this ticket.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found