Skip to content

Commit

Permalink
📦 ⬆️ @songhay/player-video-you-tube, issue #54
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanWilhite committed Sep 21, 2019
1 parent 55a7798 commit 4a5f3be
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Songhay.Dashboard/Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Songhay.Dashboard/Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@material/dialog": "^1.1.1",
"@material/typography": "^1.0.0",
"@songhay/core": "0.0.2",
"@songhay/player-video-you-tube": "0.0.3",
"@songhay/player-video-you-tube": "0.0.4",
"aspnet-prerendering": "^3.0.1",
"core-js": "^2.6.9",
"lodash": "^4.17.15",
Expand Down
6 changes: 4 additions & 2 deletions Songhay.Dashboard/Client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { ReactiveFormsModule } from '@angular/forms';
import { MaterialModule } from './material.module';
import { RoutingModule } from './routing.module';

import { YOU_TUBE_OPTIONS } from './models/you-tube-options';

import { AmazonDataStore } from './services/amazon-data.store';
import { DashboardDataStore } from './services/dashboard-data.store';
import { SocialDataStore } from './services/social-data.store';
Expand Down Expand Up @@ -39,7 +41,7 @@ import { TweetedLinksBuilderComponent } from './components/social/tweeted-links-
MaterialModule,
ReactiveFormsModule,
RoutingModule,
YouTubeModule
YouTubeModule.forRoot(YOU_TUBE_OPTIONS)
],
declarations: [
AppComponent,
Expand All @@ -62,4 +64,4 @@ import { TweetedLinksBuilderComponent } from './components/social/tweeted-links-
],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule { }
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { of } from 'rxjs';

import { NO_ERRORS_SCHEMA } from '@angular/core';

import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { YouTubeDataServiceMock } from '@songhay/player-video-you-tube';

import { DashboardDataStore } from 'src/app/services/dashboard-data.store';
import { YouTubeDataService } from '@songhay/player-video-you-tube';
Expand All @@ -13,6 +14,12 @@ describe(DashboardComponent.name, () => {
DashboardDataStore.name,
['loadAppData']
);

const ytDataService = {
loadChannel: () => {},
channelLoaded: of({})
};

let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;

Expand All @@ -26,7 +33,7 @@ describe(DashboardComponent.name, () => {
},
{
provide: YouTubeDataService,
useClass: YouTubeDataServiceMock
useValue: ytDataService
}
],
schemas: [NO_ERRORS_SCHEMA]
Expand Down
40 changes: 40 additions & 0 deletions Songhay.Dashboard/Client/src/app/models/you-tube-options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
YouTubeOptions,
YouTubeCssOptionUtility
} from '@songhay/player-video-you-tube';

export const YOU_TUBE_OPTIONS: YouTubeOptions = {
youTubeCssOptions: YouTubeCssOptionUtility
.getDefaultOptions()
.map(i => {
switch (i.variableName) {
case '--thumbs-header-link-color':
return {
variableName: i.variableName,
variableValue: '#6eff93'
};

case '--thumbs-set-header-color':
return {
variableName: i.variableName,
variableValue: '#6eff93'
};

case '--thumbs-set-header-position':
return {
variableName: i.variableName,
variableValue: 'static'
};

case '--thumbs-set-padding-top':
return {
variableName: i.variableName,
variableValue: '0'
};

default:
return i;
}
}),
youTubeSpritesUri: 'assets/svg/sprites.svg'
};
2 changes: 1 addition & 1 deletion Songhay.Dashboard/Client/src/app/routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const routes: Routes = [
{ path: 'dash/tools', component: StudioToolsComponent },
{ path: 'affiliates/amazon/products/images', component: AmazonProductImagesComponent },
{ path: 'social/twitter/builder', component: TweetedLinksBuilderComponent },
{ path: YouTubeRoutePaths.root + YouTubeRoutePaths.uploads, loadChildren: './you-tube-lib.module#YouTubeLibModule' }
{ path: `${YouTubeRoutePaths.root}/${YouTubeRoutePaths.uploads}`, loadChildren: './you-tube-lib.module#YouTubeLibModule' }
];

@NgModule({
Expand Down
12 changes: 7 additions & 5 deletions Songhay.Dashboard/Client/src/app/you-tube-lib.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { NgModule } from '@angular/core';
import {
YouTubeModule
} from '@songhay/player-video-you-tube';

import { YouTubeModule, YouTubeOptions } from '@songhay/player-video-you-tube';

import { YOU_TUBE_OPTIONS } from './models/you-tube-options';

@NgModule({
declarations: [],
imports: [YouTubeModule],
exports: [YouTubeModule]
imports: [YouTubeModule.forRoot(YOU_TUBE_OPTIONS)],
exports: [YouTubeModule],
providers: [{ provide: YouTubeOptions, useValue: YOU_TUBE_OPTIONS }]
})
export class YouTubeLibModule {}

0 comments on commit 4a5f3be

Please sign in to comment.