Skip to content

fix: hide navigation header if there is nothing underneath #1024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from

Conversation

itssharmasandeep
Copy link
Contributor

Description

Please include a summary of the change, motivation and context.

Testing

Local testing done.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@itssharmasandeep itssharmasandeep requested a review from a team as a code owner July 26, 2021 11:54
@itssharmasandeep itssharmasandeep changed the title fix: hide navigation header if there is nothing below that fix: hide navigation header if there is nothing underneath Jul 26, 2021
@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #1024 (d19e8a8) into main (e68fd39) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1024      +/-   ##
==========================================
+ Coverage   85.06%   85.07%   +0.01%     
==========================================
  Files         820      820              
  Lines       16863    16878      +15     
  Branches     2190     2195       +5     
==========================================
+ Hits        14344    14359      +15     
  Misses       2488     2488              
  Partials       31       31              
Impacted Files Coverage Δ
...onents/src/navigation/navigation-list.component.ts 90.00% <100.00%> (+6.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e68fd39...d19e8a8. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions
Copy link

Unit Test Results

    4 files  ±0  262 suites  ±0   17m 24s ⏱️ - 2m 33s
946 tests +1  946 ✔️ +1  0 💤 ±0  0 ❌ ±0 
953 runs  +1  953 ✔️ +1  0 💤 ±0  0 ❌ ±0 

Results for commit d19e8a8. ± Comparison against base commit e68fd39.

},
{
type: NavItemType.Link,
icon: 'icon',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this show up since there is not feature flag applied?

@@ -87,6 +91,26 @@ export class NavigationListComponent {
return this.collapsed ? IconType.TriangleRight : IconType.TriangleLeft;
}

public shouldShowHeader(index: number): Observable<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use htMemoize

return isEmpty(features.flat())
? of(false)
: combineLatest(
features
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to check feature flag state every time. One resolution per browser refresh is enough. Then we can just share the same result throughout (till another browser refresh)

@itssharmasandeep
Copy link
Contributor Author

closing this, please check #1035 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants