-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust stream constructions and remove most template function calls (#29
) * refactor: adjust stream constructions and remove most template call * feat: update getPlaylistsWithRouteUrl selector Co-authored-by: Trung Vo <[email protected]>
- Loading branch information
Showing
18 changed files
with
127 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { Component } from '@angular/core'; | ||
import { NavigationEnd, Router } from '@angular/router'; | ||
import { filter } from 'rxjs/operators'; | ||
import { environment } from '../environments/environment'; | ||
import { GoogleAnalyticsService } from './google-analytics.service'; | ||
|
||
@Component({ | ||
selector: 'angular-spotify-root', | ||
template: `<router-outlet></router-outlet>`, | ||
template: ` <router-outlet></router-outlet>`, | ||
styleUrls: ['./app.component.scss'] | ||
}) | ||
export class AppComponent { | ||
constructor(private router: Router, private googleAnalytics: GoogleAnalyticsService) { | ||
if (environment.production) { | ||
this.router.events.subscribe(this.handleGoogleAnalytics); | ||
this.router.events | ||
.pipe(filter((event) => event instanceof NavigationEnd)) | ||
.subscribe((navigationEndEvent) => { | ||
this.googleAnalytics.sendPageView( | ||
(navigationEndEvent as NavigationEnd).urlAfterRedirects | ||
); | ||
}); | ||
} | ||
} | ||
|
||
handleGoogleAnalytics = (event: any): void => { | ||
// eslint-disable-line | ||
if (event instanceof NavigationEnd) { | ||
this.googleAnalytics.sendPageView(event.urlAfterRedirects); | ||
} | ||
}; | ||
} |
3 changes: 2 additions & 1 deletion
3
libs/web/auth/ui/unauthorized-modal/src/lib/unauthorized-modal.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletions
18
libs/web/home/ui/featured-playlists/src/lib/featured-playlists.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<ng-container *ngIf="featuredPlaylists$ | async as data"> | ||
<h2 class="mt-8 mb-4 text-2xl text-white">{{ data.message }}</h2> | ||
<div class="common-grid"> | ||
<as-media *ngFor="let playlist of data.playlists.items" | ||
[title]="playlist.name" | ||
[description]="playlist.description" | ||
[imageUrl]="playlist.images[0]?.url!" | ||
[uri]="playlist.uri" | ||
[routerUrl]="getPlaylistRouteUrl(playlist)" | ||
(togglePlay)="togglePlay($event, playlist.uri)"> | ||
<as-media | ||
*ngFor="let playlist of data.playlists.items" | ||
[title]="playlist.name" | ||
[description]="playlist.description" | ||
[imageUrl]="playlist.images[0]?.url!" | ||
[uri]="playlist.uri" | ||
[routerUrl]="playlist.routeUrl" | ||
(togglePlay)="togglePlay($event, playlist.uri)" | ||
> | ||
</as-media> | ||
</div> | ||
</ng-container> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
libs/web/playlist/data-access/src/lib/store/playlists/playlists.selector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
libs/web/shared/ui/track-current-info/src/lib/track-current-info.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
libs/web/shell/ui/album-art-overlay/src/lib/album-art-overlay.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<div id="bg-overlay" | ||
*ngIf="albumBackgroundImage$ | async as bgUrl" | ||
[style.background-image]="bgUrl"> | ||
</div> | ||
<div | ||
id="bg-overlay" | ||
*ngIf="albumBackgroundImage$ | async as bgUrl" | ||
[style.background-image]="bgUrl" | ||
></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
libs/web/shell/ui/nav-bar-playlist/src/lib/nav-playlist/nav-playlist.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.