Idea Hub Saved and Drafts tabs show number even when 0
See original GitHub issueBug Description
Per the original design, the Idea Hub widget tab labels for “Saved” and “Drafts” should only include the number indicator if there are any applicable ideas, i.e. not if there are 0 saved ideas or 0 draft ideas respectively.
This is currently incorrect, as the check for whether to add the indicator is >=0
rather than >0
.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The number of ideas on the Idea Hub widget tab labels for saved and draft ideas should only display if the respective value is greater than 0.
Implementation Brief
- Change the check for
savedIdeas?.length >= 0
tosavedIdeas?.length > 0
and the check forsavedIdeas?.length === undefined
tosavedIdeas?.length === 0 || savedIdeas?.length === undefined
in https://github.com/google/site-kit-wp/blob/develop/assets/js/modules/idea-hub/components/dashboard/DashboardIdeasWidget/index.js#L257-L272 - Do the same for the
draftIdeas?.length
check in the same component.
Test Coverage
- None.
Visual Regression Changes
- No changes expected, but if there are VRTs for this component they’ll need updating.
QA Brief
- There should no longer be (0) in the Draft and Saved tabs of Idea Hub Dashboard Widget if there’s no Draft or Saved Ideas respectively.
- There should be (#) when there is idea in the respective tab. ie: http://sitekit.10uplabs.com/wp-admin/admin.php?page=googlesitekit-dashboard&gskNew=8
Changelog entry
- Fix counts on Idea Hub widget tab labels to only show up if greater than zero.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
White box with word “DRAFT” at lower left… - Apple Community
Another option is to open the draft from your Draft Mail folder - and then close/delete the draft.
Read more >Alma 2022 Release Notes - Ex Libris Knowledge Center
This saves the manual work required to change the call number type to match the one used in the items' new location.
Read more >Drafts do not save when adding or editing a page unless you ...
When adding a new page, even when you close the window, it does not prompt if you want to leave the page, and...
Read more >Zimbra Web Client User Guide (Advanced Client)
From the Mail tab, click the gear icon in the Mail Folders heading in the Navigation pane ... Automatically save drafts of messages...
Read more >How to use Zapier to automate Notion
Zapier can help you turn your Notion workspace into a central hub for your most important information. Here are a few ideas to...
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
(Technically we could check for
! savedIdeas?.length
oversavedIdeas?.length === 0 || savedIdeas?.length === undefined
, but I find the explicitness of the latter to be a lot more helpful when reading the code—it communicates intent a lot more clearly, so I went with it in the IB.)QA Update ✅
Verified:
There is no longer be (0) in the Draft and Saved tabs of Idea Hub Dashboard Widget if there’s no Draft or Saved Ideas
There is a number when there is idea in the respective tab.