-
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.
Merge branch 'dev' of https://github.com/kaltura/kmc-ng into dev
- Loading branch information
Showing
47 changed files
with
2,695 additions
and
1,216 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,3 +1,5 @@ | ||
<router-outlet></router-outlet> | ||
|
||
<k-area-blocker [showLoader]="_isBusy" [message]="_blockerMessage"> | ||
<router-outlet></router-outlet> | ||
</k-area-blocker> | ||
<!--router-outlet></router-outlet--> | ||
<p-confirmDialog header="Confirmation" [closeOnEscape]="false" width="425"></p-confirmDialog> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
<div #main> | ||
<div #appMenu> | ||
<div> | ||
<div> | ||
<div #appMenu> | ||
<kKMCAppMenu></kKMCAppMenu> | ||
</div> | ||
</div> | ||
<div> | ||
<div> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</div> | ||
<router-outlet></router-outlet> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
width: 100% | ||
} |
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
20 changes: 20 additions & 0 deletions
20
src/applications/content-entries-app/entries/bulk-actions/bulk-actions.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,20 @@ | ||
<div class="kBulkActions"> | ||
<button pButton icon="kIcontrash" class="kButtonDanger kBulkDeleteBtn"></button> | ||
<button class="kButtonDefault kBulkActionsBtn" icon="kIcondropdown_arrow_bottom" iconPos="right" pButton label="{{'applications.content.entries.bulkActions' | translate}}" (click)="menu.toggle($event)"></button> | ||
</div> | ||
|
||
<p-tieredMenu #menu [model]="_bulkActionsMenu" [popup]="true" [styleClass]="menu" class="kOverrideFAIcons"></p-tieredMenu> | ||
|
||
|
||
<kPopupWidget #bulkActionsPopup [popupWidth]="_bulkWindowWidth" [popupHeight]="_bulkWindowHeight" [modal]="true"> | ||
<ng-template> | ||
<div [ngSwitch]="_bulkAction"> | ||
<kBulkScheduling *ngSwitchCase="'setScheduling'" [parentPopupWidget]="bulkActionsPopup" (schedulingChanged)="onSchedulingChanged($event)"></kBulkScheduling> | ||
<kBulkAddTags *ngSwitchCase="'addTags'" [parentPopupWidget]="bulkActionsPopup" (addTagsChanged)="onAddTagsChanged($event)"></kBulkAddTags> | ||
<kBulkRemoveTags *ngSwitchCase="'removeTags'" [selectedEntries]="selectedEntries" [parentPopupWidget]="bulkActionsPopup" (removeTagsChanged)="onRemoveTagsChanged($event)"></kBulkRemoveTags> | ||
<kCategoriesSelector *ngSwitchCase="'addToCategories'" [parentPopupWidget]="bulkActionsPopup" (valueChange)="onAddToCategoriesChanged($event)" [buttonLabel]="'applications.content.bulkActions.apply' | translate"></kCategoriesSelector> | ||
<kBulkChangeOwner *ngSwitchCase="'changeOwner'" [parentPopupWidget]="bulkActionsPopup" (ownerChanged)="onOwnerChanged($event)"></kBulkChangeOwner> | ||
</div> | ||
</ng-template> | ||
</kPopupWidget> | ||
|
13 changes: 13 additions & 0 deletions
13
src/applications/content-entries-app/entries/bulk-actions/bulk-actions.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,13 @@ | ||
.kBulkActions{ | ||
display: flex; | ||
align-items: center; | ||
.kBulkDeleteBtn{ | ||
margin-right: 10px; | ||
width: 44px; | ||
font-size: 18px; | ||
} | ||
.kBulkActionsBtn{ | ||
font-weight: 400; | ||
font-size: 15px; | ||
} | ||
} |
138 changes: 138 additions & 0 deletions
138
src/applications/content-entries-app/entries/bulk-actions/bulk-actions.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,138 @@ | ||
import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, ViewChild } from '@angular/core'; | ||
import { MenuItem } from 'primeng/primeng'; | ||
import { AppLocalization } from '@kaltura-ng/kaltura-common'; | ||
import { PopupWidgetComponent } from '@kaltura-ng/kaltura-ui/popup-widget/popup-widget.component'; | ||
import { BrowserService } from "app-shared/kmc-shell/providers/browser.service"; | ||
|
||
import { SchedulingParams } from './services' | ||
import { BulkSchedulingService, BulkAddTagsService, BulkRemoveTagsService, BulkAddCategoriesService, EntryCategoryItem, BulkChangeOwnerService } from './services'; | ||
import { KalturaMediaEntry } from "kaltura-typescript-client/types/KalturaMediaEntry"; | ||
import { BulkActionBaseService } from "./services/bulk-action-base.service"; | ||
import { environment } from 'app-environment'; | ||
import { KalturaUser } from 'kaltura-typescript-client/types/KalturaUser'; | ||
|
||
@Component({ | ||
selector: 'kBulkActions', | ||
templateUrl: './bulk-actions.component.html', | ||
styleUrls: ['./bulk-actions.component.scss'] | ||
}) | ||
export class BulkActionsComponent implements OnInit, OnDestroy { | ||
|
||
public _bulkActionsMenu: MenuItem[] = []; | ||
public _bulkWindowWidth = 500; | ||
public _bulkWindowHeight = 500; | ||
public _bulkAction: string = ""; | ||
|
||
@Input() selectedEntries: KalturaMediaEntry[]; | ||
|
||
@Output() onBulkChange = new EventEmitter<{reload: boolean}>(); | ||
|
||
@ViewChild('bulkActionsPopup') public bulkActionsPopup: PopupWidgetComponent; | ||
|
||
constructor(private _appLocalization: AppLocalization, private _browserService : BrowserService, | ||
private _bulkSchedulingService: BulkSchedulingService, | ||
private _bulkAddTagsService: BulkAddTagsService, | ||
private _bulkRemoveTagsService: BulkRemoveTagsService, | ||
private _bulkAddCategoriesService: BulkAddCategoriesService, | ||
private _bulkChangeOwnerService: BulkChangeOwnerService) { | ||
|
||
} | ||
|
||
ngOnInit(){ | ||
this._bulkActionsMenu = this.getBulkActionItems(); | ||
} | ||
|
||
ngOnDestroy(){ | ||
|
||
} | ||
|
||
openBulkActionWindow(action: string, popupWidth: number, popupHeight: number){ | ||
this._bulkAction = action; | ||
this._bulkWindowWidth = popupWidth; | ||
this._bulkWindowHeight = popupHeight; | ||
// use timeout to allow data binding of popup dimensions to update before opening the popup | ||
setTimeout(() => { | ||
this.bulkActionsPopup.open(); | ||
}, 0); | ||
} | ||
|
||
// set scheduling changes | ||
onSchedulingChanged(schedulingParams: SchedulingParams): void{ | ||
this.executeService(this._bulkSchedulingService, schedulingParams); | ||
} | ||
|
||
// add tags changed | ||
onAddTagsChanged(tags: string[]): void{ | ||
this.executeService(this._bulkAddTagsService, tags); | ||
} | ||
|
||
// remove tags changed | ||
onRemoveTagsChanged(tags: string[]): void{ | ||
this.executeService(this._bulkRemoveTagsService, tags); | ||
} | ||
|
||
// add to categories changed | ||
onAddToCategoriesChanged(categories: EntryCategoryItem[]): void{ | ||
this.executeService(this._bulkAddCategoriesService, categories); | ||
} | ||
|
||
// owner changed | ||
onOwnerChanged(owners: KalturaUser[]): void{ | ||
if (owners && owners.length){ | ||
this.executeService(this._bulkChangeOwnerService, owners[0]); | ||
} | ||
} | ||
|
||
private executeService(service: BulkActionBaseService<any>, data: any, reloadEntries: boolean = true ): void{ | ||
this._bulkAction = ""; | ||
|
||
const execute = () => { | ||
this._browserService.setAppStatus({isBusy: true, errorMessage: null}); | ||
service.execute(this.selectedEntries, data).subscribe( | ||
result => { | ||
this._browserService.setAppStatus({isBusy: false, errorMessage: null}); | ||
this.onBulkChange.emit({reload: reloadEntries}); | ||
}, | ||
error => { | ||
this._browserService.setAppStatus({isBusy: false, errorMessage: this._appLocalization.get('applications.content.bulkActions.error')}); | ||
} | ||
); | ||
} | ||
|
||
if (this.selectedEntries.length > environment.modules.contentEntries.bulkActionsLimit){ | ||
this._browserService.confirm( | ||
{ | ||
header: this._appLocalization.get('applications.content.bulkActions.note'), | ||
message: this._appLocalization.get('applications.content.bulkActions.confirm', {"0": this.selectedEntries.length}), | ||
accept: () => { | ||
execute(); | ||
} | ||
} | ||
); | ||
}else{ | ||
execute(); | ||
} | ||
} | ||
|
||
getBulkActionItems(): MenuItem[]{ | ||
return [ | ||
{ label: this._appLocalization.get('applications.content.bulkActions.setScheduling'), command: (event) => { this.openBulkActionWindow("setScheduling", 500, 500) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.setAccessControl'), command: (event) => { this.openBulkActionWindow("setAccessControl", 500, 500) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addRemoveTags'), items: [ | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addTags'), command: (event) => { this.openBulkActionWindow("addTags", 500, 500) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.removeTags'), command: (event) => { this.openBulkActionWindow("removeTags", 500, 500) } }] | ||
}, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addRemoveCategories'), items: [ | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addToCategories'), command: (event) => { this.openBulkActionWindow("addToCategories", 560, 586) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.removeFromCategories'), command: (event) => { this.openBulkActionWindow("removeFromCategories", 500, 500) } }] | ||
}, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addToNewCategoryPlaylist'), items: [ | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addToNewCategory'), command: (event) => { this.openBulkActionWindow("addToNewCategory", 500, 500) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.addToNewPlaylist'), command: (event) => { this.openBulkActionWindow("addToNewPlaylist", 500, 500) } }] | ||
}, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.changeOwner'), command: (event) => { this.openBulkActionWindow("changeOwner", 500, 500) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.download'), command: (event) => { this.openBulkActionWindow("download", 500, 500) } }, | ||
{ label: this._appLocalization.get('applications.content.bulkActions.delete'), command: (event) => { this.openBulkActionWindow("delete", 500, 500) } } | ||
]; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...nt-entries-app/entries/bulk-actions/components/bulk-add-tags/bulk-add-tags.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,20 @@ | ||
<k-area-blocker [showLoader]="_loading" [message]="_sectionBlockerMessage"> | ||
<div class="kContent kOverrideFAIcons"> | ||
<span class="kTitle">{{'applications.content.bulkActions.addTags' | translate}}</span> | ||
<div class="kTags"> | ||
<span class="kLabel">{{'applications.content.bulkActions.addTagsLabel' | translate}}</span> | ||
<kAutoComplete [(ngModel)]="tags" | ||
suggestionItemField="item" | ||
suggestionSelectableField="isSelectable" | ||
[multiple]="true" | ||
[limitToSuggestions]="false" | ||
[minLength]="3" | ||
[suggestionsProvider]="_tagsProvider" | ||
(completeMethod)="_searchTags($event)"> | ||
</kAutoComplete> | ||
</div> | ||
<div class="kFooter"> | ||
<button type="button" class="kButtonBranded" pButton label="{{'applications.content.bulkActions.apply' | translate}}" (click)="_apply()"></button> | ||
</div> | ||
</div> | ||
</k-area-blocker> |
47 changes: 47 additions & 0 deletions
47
...nt-entries-app/entries/bulk-actions/components/bulk-add-tags/bulk-add-tags.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,47 @@ | ||
@import "app-theme/_variables.scss"; | ||
|
||
.kTitle{ | ||
color: $kGrayscale1; | ||
font-size: 24px; | ||
font-weight: 700; | ||
text-align: center; | ||
border-bottom: 1px solid $kGrayscale4; | ||
height: 78px; | ||
line-height: 78px; | ||
} | ||
.kContent{ | ||
display: flex; | ||
flex-direction: column; | ||
height: 500px; | ||
.kLabel{ | ||
display: block; | ||
margin-bottom: 8px; | ||
} | ||
.kTags{ | ||
padding: 12px; | ||
height: 330px; | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
} | ||
} | ||
.kFooter{ | ||
position: absolute; | ||
bottom: 0px; | ||
display: flex; | ||
width: 100%; | ||
height: 66px; | ||
border-top: 1px solid $kGrayscale4; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
:host /deep/ kautocomplete ul.ui-autocomplete-multiple-container.ui-inputtext{ | ||
padding: 0px; | ||
.ui-autocomplete-input-token{ | ||
padding: 0px; | ||
input{ | ||
height: 34px; | ||
padding-left: 4px; | ||
width: 472px; | ||
} | ||
} | ||
} |
Oops, something went wrong.