-
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.
fix(studio): support studio v7 FEV-1579
- Loading branch information
Showing
13 changed files
with
167 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="kStudio"> | ||
<iframe *ngIf="studioUrl" frameborder="0" [src]="studioUrl | safe"></iframe> | ||
</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,10 @@ | ||
@import "app-theme/_variables.scss"; | ||
|
||
.kStudio{ | ||
height: $contentArea; | ||
iframe{ | ||
width: 100%; | ||
height: 900px; | ||
} | ||
} | ||
|
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,45 @@ | ||
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { AppAuthentication, BrowserService } from 'app-shared/kmc-shell'; | ||
import { AppEventsService } from 'app-shared/kmc-shared'; | ||
import { serverConfig } from 'config/server'; | ||
import { KalturaLogger } from '@kaltura-ng/kaltura-logger'; | ||
import { PlayersUpdatedEvent } from 'app-shared/kmc-shared/events'; | ||
import { KMCPermissionsService } from 'app-shared/kmc-shared/kmc-permissions'; | ||
import { StudioV7MainViewService } from 'app-shared/kmc-shared/kmc-views'; | ||
|
||
@Component({ | ||
selector: 'kStudioV7', | ||
templateUrl: './studio-v7.component.html', | ||
styleUrls: ['./studio-v7.component.scss'] | ||
}) | ||
export class StudioV7Component implements OnInit, OnDestroy { | ||
|
||
public studioUrl = ''; | ||
|
||
constructor( | ||
private _appEvents: AppEventsService, private logger: KalturaLogger, | ||
private _studioV7MainView: StudioV7MainViewService) { | ||
} | ||
|
||
ngOnInit() { | ||
if (this._studioV7MainView.viewEntered()) { | ||
window['kmc'] = { | ||
'preview_embed': { | ||
'updateList': (isPlaylist: boolean) => { | ||
this._updatePlayers(isPlaylist); | ||
} | ||
} | ||
}; | ||
this.studioUrl = serverConfig.externalApps.studioV7.uri; | ||
} | ||
} | ||
|
||
_updatePlayers(isPlaylist): void { | ||
this._appEvents.publish(new PlayersUpdatedEvent(isPlaylist)); | ||
} | ||
|
||
ngOnDestroy() { | ||
this.studioUrl = ''; | ||
window['kmc'] = null; | ||
} | ||
} |
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
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
56 changes: 56 additions & 0 deletions
56
src/shared/kmc-shared/kmc-views/main-views/studio-v7-main-view.service.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,56 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { KMCPermissions, KMCPermissionsService } from '../../kmc-permissions'; | ||
import { KalturaLogger } from '@kaltura-ng/kaltura-logger'; | ||
import { KmcMainViewBaseService, ViewMetadata } from '../kmc-main-view-base.service'; | ||
import { Router } from '@angular/router'; | ||
import { serverConfig } from 'config/server'; | ||
import { BrowserService } from 'app-shared/kmc-shell/providers/browser.service'; | ||
import { AppLocalization } from '@kaltura-ng/mc-shared'; | ||
import { Title } from '@angular/platform-browser'; | ||
import { ContextualHelpService } from 'app-shared/kmc-shared/contextual-help/contextual-help.service'; | ||
|
||
@Injectable() | ||
export class StudioV7MainViewService extends KmcMainViewBaseService { | ||
|
||
|
||
constructor(logger: KalturaLogger, | ||
browserService: BrowserService, | ||
router: Router, | ||
private _appPermissions: KMCPermissionsService, | ||
private _appLocalization: AppLocalization, | ||
titleService: Title, | ||
contextualHelpService: ContextualHelpService) { | ||
super(logger.subLogger('StudioV7MainViewService'), browserService, router, titleService, contextualHelpService); | ||
} | ||
|
||
isAvailable(): boolean { | ||
const isViewPermitted = this._appPermissions.hasAnyPermissions([ | ||
KMCPermissions.STUDIO_BASE, | ||
KMCPermissions.STUDIO_ADD_UICONF, | ||
KMCPermissions.STUDIO_UPDATE_UICONF, | ||
KMCPermissions.STUDIO_DELETE_UICONF, | ||
KMCPermissions.STUDIO_DELETE_UICONF, | ||
]); | ||
const studioHtmlIsAvailable = !!serverConfig.externalApps.studioV7; | ||
const studioHtmlIsPermitted = this._appPermissions.hasPermission(KMCPermissions.FEATURE_V7_STUDIO_PERMISSION); | ||
|
||
this._logger.info(`handle isAvailable action by user`, | ||
{ isViewPermitted, studioHtmlIsAvailable, studioHtmlIsPermitted }); | ||
|
||
return isViewPermitted && studioHtmlIsAvailable && studioHtmlIsPermitted; | ||
} | ||
|
||
getRoutePath(): string { | ||
return 'studio/v7'; | ||
} | ||
|
||
getViewMetadata(): ViewMetadata { | ||
return { | ||
viewKey: 'studio-v7', | ||
title: this._appLocalization.get('app.titles.studioV7PageTitle'), | ||
menu: this._appLocalization.get('app.titles.studio7MenuTitle') | ||
}; | ||
} | ||
} | ||
|
||
|