Skip to content

feat: make page header configurable to persist active tab #1147

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

Merged
merged 8 commits into from
Sep 27, 2021

Conversation

jake-bassett
Copy link
Contributor

Description

This allows consumers of the page header to provide a unique persitanceId that will turn on saving the active tab to browser storage.

@jake-bassett jake-bassett requested a review from a team as a code owner September 23, 2021 22:42
@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #1147 (7178a90) into main (aca64c2) will decrease coverage by 0.02%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1147      +/-   ##
==========================================
- Coverage   85.05%   85.02%   -0.03%     
==========================================
  Files         829      829              
  Lines       17152    17175      +23     
  Branches     2228     2233       +5     
==========================================
+ Hits        14588    14603      +15     
- Misses       2533     2540       +7     
- Partials       31       32       +1     
Impacted Files Coverage Δ
...rc/tabs/navigable/navigable-tab-group.component.ts 40.90% <60.00%> (+0.90%) ⬆️
...omponents/src/header/page/page-header.component.ts 78.12% <72.00%> (-21.88%) ⬇️

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 aca64c2...7178a90. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

) {}

public ngOnInit(): void {
this.getPreferences().subscribe(preferences => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to unsubscribe this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@@ -57,7 +68,8 @@ export class NavigableTabGroupComponent implements AfterContentInit {
public ngAfterContentInit(): void {
this.activeTab$ = merge(this.navigationService.navigation$, this.tabs.changes).pipe(
startWith(undefined),
map(() => this.findActiveTab())
map(() => this.findActiveTab()),
tap(activeTab => this.tabChange.emit(activeTab?.path))
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this would emit duplicate events. May be we can put distinctUntilChanged operator before the tap.

@github-actions

This comment has been minimized.

@jake-bassett jake-bassett merged commit 1e04e81 into main Sep 27, 2021
@jake-bassett jake-bassett deleted the optionally-persist-page-header-active-tab branch September 27, 2021 23:29
@github-actions
Copy link

Unit Test Results

    4 files  ±0  270 suites  ±0   18m 38s ⏱️ +52s
968 tests ±0  968 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
975 runs  ±0  975 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 1e04e81. ± Comparison against base commit aca64c2.

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