-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(content-playlists): bulk delete of playlists
- Loading branch information
1 parent
418f7fc
commit 25a877a
Showing
23 changed files
with
561 additions
and
240 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
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
4 changes: 3 additions & 1 deletion
4
src/applications/content-playlists-app/content-playlists.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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { PlaylistsStore } from './playlists/playlists-store/playlists-store.service'; | ||
|
||
@Component({ | ||
selector: 'kPlaylists', | ||
templateUrl: './content-playlists.component.html', | ||
styleUrls: ['./content-playlists.component.scss'] | ||
styleUrls: ['./content-playlists.component.scss'], | ||
providers: [PlaylistsStore] | ||
}) | ||
export class ContentPlaylistsComponent {} | ||
|
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
19 changes: 18 additions & 1 deletion
19
...lications/content-playlists-app/playlist/playlist-content/playlist-content.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 +1,18 @@ | ||
<h1>{{'applications.content.playlistDetails.sections.content' | translate}}</h1> | ||
<k-area-blocker [showLoader]="" [message]=""> | ||
<div class="kContentDetails"> | ||
<div class="kPlaylistsTableFilters"> | ||
<button | ||
pButton | ||
type="button" | ||
label="{{'applications.content.playlists.addEntry' | translate}}" | ||
class="kButtonBranded kAddPlaylistBtn"></button> | ||
<span | ||
class="kSelectedPlaylistsNum" | ||
*ngIf="(_playlistStore.entries$ | async)?.totalCount"> | ||
{{(_playlistStore.entries$ | async)?.totalCount}} {{'applications.content.playlists.playlists' | translate}}</span> | ||
</div> | ||
<kPlaylistEntriesTable | ||
class="kPlaylistEntriesTable" | ||
[entries]="(_playlistStore.entries$ | async)?.items"></kPlaylistEntriesTable> | ||
</div> | ||
</k-area-blocker> |
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,23 @@ | ||
@import 'app-theme/_variables.scss'; | ||
|
||
.kContentDetails { | ||
width: 100%; | ||
|
||
.kPlaylistsTableFilters { | ||
width: 100%; | ||
height: 66px; | ||
background-color: white; | ||
flex: 0 0 auto; | ||
align-items: center; | ||
display: flex; | ||
|
||
.kAddPlaylistBtn { | ||
margin-left: 14px; | ||
height: 36px; | ||
} | ||
|
||
.kSelectedPlaylistsNum{ | ||
padding-left: 16px; | ||
} | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...ntent-playlists-app/playlist/playlist-entries-table/playlist-entries-table.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,51 @@ | ||
<k-area-blocker kFillHeight | ||
[showLoader]="" | ||
[message]=""> | ||
<div class="kPlaylistEntriesTable" [class.noResults]="!_entries.length"> | ||
<p-dataTable | ||
#dataTable | ||
[value]="_entries" | ||
scrollable="true" | ||
scrollHeight="100%" | ||
dataKey="id" | ||
[rowTrackBy]="rowTrackBy"> | ||
<p-column [style]="{'width':'44px', 'padding-left': '14px'}" selectionMode="multiple"></p-column> | ||
<p-column field="thumbnailUrl" header="{{'applications.content.table.thumbnail' | translate}}" [style]="{'width':'100px'}"> | ||
<ng-template let-col let-entry="rowData" pTemplate="body"> | ||
<div class="kThumbnailHolder"> | ||
<img src="{{entry[col.field]}}" onError="this.onerror=null;this.style.display='none'"> | ||
</div> | ||
</ng-template> | ||
</p-column> | ||
<p-column field="name" header="{{'applications.content.table.name' | translate}}" [sortable]="'custom'"> | ||
<ng-template let-col let-entry="rowData" pTemplate="body"> | ||
<span class="kTitle">{{entry[col.field]}}</span> | ||
</ng-template> | ||
</p-column> | ||
<p-column field="mediaType" header="{{'applications.content.table.type' | translate}}" [sortable]="'custom'" | ||
[style]="{'width':'80px', 'text-align': 'center'}"> | ||
<ng-template let-col let-entry="rowData" pTemplate="body"> | ||
<div [kTooltip]="entry[col.field]">{{entry[col.field]}}</div> | ||
</ng-template> | ||
</p-column> | ||
<p-column field="createdAt" header="Created On" [sortable]="true" [style]="{'width':'140px'}"> | ||
<ng-template let-col let-entry="rowData" pTemplate="body"> | ||
<span>{{entry[col.field] | kDate}}</span> | ||
</ng-template> | ||
</p-column> | ||
|
||
<p-column field="duration" header="{{'applications.content.table.duration' | translate}}" [sortable]="'custom'" [style]="{'width':'104px'}"> | ||
<ng-template let-col let-entry="rowData" pTemplate="body"> | ||
<span>{{entry[col.field]}}</span> | ||
</ng-template> | ||
</p-column> | ||
<p-column header="" [style]="{'overflow':'visible', 'width':'80px'}"> | ||
<ng-template let-col let-entry="rowData" pTemplate="body"> | ||
<div class="kEntriesTableActions"> | ||
<button type="button" pButton icon="kIconmore"></button> | ||
</div> | ||
</ng-template> | ||
</p-column> | ||
</p-dataTable> | ||
</div> | ||
</k-area-blocker> |
44 changes: 44 additions & 0 deletions
44
...ntent-playlists-app/playlist/playlist-entries-table/playlist-entries-table.component.scss
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,44 @@ | ||
@import 'app-theme/_variables.scss'; | ||
|
||
.kPlaylistEntriesTable { | ||
background-color: white; | ||
overflow-y: hidden; | ||
position: absolute; | ||
padding: 0px; | ||
|
||
.kThumbnailHolder { | ||
overflow: hidden; | ||
position: relative; | ||
width: 80px; | ||
height: 46px; | ||
background-color: $kGrayscale6; | ||
white-space: nowrap; | ||
text-align: center; | ||
border-radius: 3px; | ||
cursor: pointer; | ||
|
||
img { | ||
position:absolute; | ||
left: -100%; | ||
right: -100%; | ||
top: -100%; | ||
bottom: -100%; | ||
margin: auto; | ||
width: 80px; | ||
height: auto; | ||
border-radius: 3px; | ||
} | ||
} | ||
|
||
.kEntriesTableActions { | ||
width: 100%; | ||
text-align: center; | ||
button { | ||
color: grey !important; | ||
background-color: rgba(0, 0, 0, 0) !important; | ||
border: none !important; | ||
font-size: 16px !important; | ||
outline: 0; | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...content-playlists-app/playlist/playlist-entries-table/playlist-entries-table.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,60 @@ | ||
import { Component, Input, Output, EventEmitter, AfterViewInit, OnInit, OnDestroy, ViewChild, ChangeDetectorRef } from '@angular/core'; | ||
import { ISubscription } from 'rxjs/Subscription'; | ||
import { MenuItem, DataTable, Menu } from 'primeng/primeng'; | ||
import { AppLocalization } from '@kaltura-ng/kaltura-common'; | ||
import { AreaBlockerMessage } from '@kaltura-ng/kaltura-ui'; | ||
import { KalturaMediaType } from 'kaltura-typescript-client/types/KalturaMediaType'; | ||
import { KalturaMediaEntry } from 'kaltura-typescript-client/types/KalturaMediaEntry'; | ||
import { KalturaEntryStatus } from 'kaltura-typescript-client/types/KalturaEntryStatus'; | ||
import { PlaylistStore } from "../playlist-store.service"; | ||
|
||
@Component({ | ||
selector: 'kPlaylistEntriesTable', | ||
templateUrl: './playlist-entries-table.component.html', | ||
styleUrls: ['./playlist-entries-table.component.scss'] | ||
}) | ||
export class PlaylistEntriesTableComponent implements AfterViewInit, OnInit, OnDestroy { | ||
public _entries: any[] = []; | ||
private _deferredEntries : any[]; | ||
public _deferredLoading = true; | ||
public rowTrackBy: Function = (index: number, item: any) => {return item.id}; | ||
|
||
@Input() set entries(data: any[]) { | ||
if (!this._deferredLoading) { | ||
this._entries = []; | ||
this.cdRef.detectChanges(); | ||
this._entries = data; | ||
this.cdRef.detectChanges(); | ||
} else { | ||
this._deferredEntries = data | ||
} | ||
} | ||
|
||
constructor( | ||
private appLocalization: AppLocalization, | ||
public playlistStore: PlaylistStore, | ||
private cdRef: ChangeDetectorRef | ||
) {} | ||
ngOnInit() { | ||
/*this.playlistStore.entries$ | ||
.subscribe(response => { | ||
});*/ | ||
} | ||
|
||
ngAfterViewInit() { | ||
if (this._deferredLoading) { | ||
// use timeout to allow the DOM to render before setting the data to the datagrid. This prevents the screen from hanging during datagrid rendering of the data. | ||
setTimeout(()=> { | ||
this._deferredLoading = false; | ||
this._entries = this._deferredEntries; | ||
this._deferredEntries = null; | ||
}, 0); | ||
} | ||
} | ||
|
||
ngOnDestroy() { | ||
|
||
} | ||
} | ||
|
6 changes: 2 additions & 4 deletions
6
...cations/content-playlists-app/playlist/playlist-metadata/playlist-metadata.component.scss
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.