-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dialog about playlist details
- Loading branch information
Showing
8 changed files
with
110 additions
and
1 deletion.
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
24 changes: 24 additions & 0 deletions
24
src/app/home/recent-playlists/playlist-info/playlist-info.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<h2 mat-dialog-title>Playlist details</h2> | ||
<mat-dialog-content class="mat-typography"> | ||
<mat-form-field class="full-width"> | ||
<mat-label>Title</mat-label> | ||
<input matInput [value]="playlist.title" disabled="true" /> | ||
</mat-form-field> | ||
<mat-form-field class="full-width" *ngIf="playlist.url"> | ||
<mat-label>Added from the URL</mat-label> | ||
<input matInput [value]="playlist.url" disabled="true" /> | ||
</mat-form-field> | ||
<mat-form-field class="full-width"> | ||
<mat-label>Import date</mat-label> | ||
<input matInput [value]="playlist.importDate | date" disabled="true" /> | ||
</mat-form-field> | ||
<mat-form-field class="full-width"> | ||
<mat-label>Number of channels</mat-label> | ||
<input matInput [value]="playlist.count" disabled="true" /> | ||
</mat-form-field> | ||
</mat-dialog-content> | ||
<mat-dialog-actions align="end"> | ||
<button mat-button mat-dialog-close cdkFocusInitial color="primary"> | ||
CLOSE | ||
</button> | ||
</mat-dialog-actions> |
Empty file.
34 changes: 34 additions & 0 deletions
34
src/app/home/recent-playlists/playlist-info/playlist-info.component.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { MockModule } from 'ng-mocks'; | ||
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
|
||
import { PlaylistInfoComponent } from './playlist-info.component'; | ||
|
||
describe('PlaylistInfoComponent', () => { | ||
let component: PlaylistInfoComponent; | ||
let fixture: ComponentFixture<PlaylistInfoComponent>; | ||
|
||
beforeEach( | ||
waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
MockModule(MatDialogModule), | ||
MockModule(MatFormFieldModule), | ||
], | ||
declarations: [PlaylistInfoComponent], | ||
providers: [{ provide: MAT_DIALOG_DATA, useValue: {} }], | ||
}).compileComponents(); | ||
}) | ||
); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(PlaylistInfoComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
src/app/home/recent-playlists/playlist-info/playlist-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { Playlist } from '../../playlist.interface'; | ||
|
||
@Component({ | ||
selector: 'app-playlist-info', | ||
templateUrl: './playlist-info.component.html', | ||
styleUrls: ['./playlist-info.component.scss'], | ||
}) | ||
export class PlaylistInfoComponent { | ||
/** Playlist object */ | ||
playlist: Playlist; | ||
|
||
/** | ||
* Creates an instance of the component and injects the selected playlist from the parent component | ||
* @param data playlist object to show | ||
*/ | ||
constructor(@Inject(MAT_DIALOG_DATA) playlist: Playlist) { | ||
this.playlist = playlist; | ||
} | ||
} |
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