From 170726f523ff48f89da45473fc53ca54784f43dd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 25 Apr 2018 16:56:13 +0200 Subject: [PATCH] Implement video channel views --- .../src/app/+account/account.component.scss | 46 ------------ client/src/app/+account/index.ts | 3 - .../account-about.component.html | 0 .../account-about.component.scss | 0 .../account-about/account-about.component.ts | 0 .../account-video-channels.component.html | 0 .../account-video-channels.component.scss | 0 .../account-video-channels.component.ts | 2 +- .../account-videos.component.scss | 0 .../account-videos.component.ts | 0 .../accounts-routing.module.ts} | 10 +-- .../accounts.component.html} | 8 +-- .../src/app/+accounts/accounts.component.scss | 6 ++ .../accounts.component.ts} | 7 +- .../accounts.module.ts} | 12 ++-- client/src/app/+accounts/index.ts | 3 + client/src/app/+video-channels/index.ts | 3 + .../video-channel-about.component.html | 12 ++++ .../video-channel-about.component.scss | 8 +++ .../video-channel-about.component.ts | 32 +++++++++ .../video-channel-videos.component.scss | 3 + .../video-channel-videos.component.ts | 71 +++++++++++++++++++ .../video-channels-routing.module.ts | 45 ++++++++++++ .../video-channels.component.html | 23 ++++++ .../video-channels.component.scss | 6 ++ .../video-channels.component.ts | 24 +++++++ .../+video-channels/video-channels.module.ts | 26 +++++++ client/src/app/app-routing.module.ts | 8 ++- .../video-channel/video-channel.service.ts | 15 +++- .../video/video-miniature.component.html | 4 +- client/src/app/shared/video/video.service.ts | 25 +++++++ .../+video-watch/video-watch.component.html | 2 +- client/src/sass/include/_mixins.scss | 44 ++++++++++++ server/tests/api/check-params/videos.ts | 2 +- server/tests/api/videos/multiple-servers.ts | 8 +-- 35 files changed, 375 insertions(+), 83 deletions(-) delete mode 100644 client/src/app/+account/account.component.scss delete mode 100644 client/src/app/+account/index.ts rename client/src/app/{+account => +accounts}/account-about/account-about.component.html (100%) rename client/src/app/{+account => +accounts}/account-about/account-about.component.scss (100%) rename client/src/app/{+account => +accounts}/account-about/account-about.component.ts (100%) rename client/src/app/{+account => +accounts}/account-video-channels/account-video-channels.component.html (100%) rename client/src/app/{+account => +accounts}/account-video-channels/account-video-channels.component.scss (100%) rename client/src/app/{+account => +accounts}/account-video-channels/account-video-channels.component.ts (92%) rename client/src/app/{+account => +accounts}/account-videos/account-videos.component.scss (100%) rename client/src/app/{+account => +accounts}/account-videos/account-videos.component.ts (100%) rename client/src/app/{+account/account-routing.module.ts => +accounts/accounts-routing.module.ts} (84%) rename client/src/app/{+account/account.component.html => +accounts/accounts.component.html} (71%) create mode 100644 client/src/app/+accounts/accounts.component.scss rename client/src/app/{+account/account.component.ts => +accounts/accounts.component.ts} (77%) rename client/src/app/{+account/account.module.ts => +accounts/accounts.module.ts} (70%) create mode 100644 client/src/app/+accounts/index.ts create mode 100644 client/src/app/+video-channels/index.ts create mode 100644 client/src/app/+video-channels/video-channel-about/video-channel-about.component.html create mode 100644 client/src/app/+video-channels/video-channel-about/video-channel-about.component.scss create mode 100644 client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts create mode 100644 client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.scss create mode 100644 client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts create mode 100644 client/src/app/+video-channels/video-channels-routing.module.ts create mode 100644 client/src/app/+video-channels/video-channels.component.html create mode 100644 client/src/app/+video-channels/video-channels.component.scss create mode 100644 client/src/app/+video-channels/video-channels.component.ts create mode 100644 client/src/app/+video-channels/video-channels.module.ts diff --git a/client/src/app/+account/account.component.scss b/client/src/app/+account/account.component.scss deleted file mode 100644 index c7b8f038f..000000000 --- a/client/src/app/+account/account.component.scss +++ /dev/null @@ -1,46 +0,0 @@ -@import '_variables'; -@import '_mixins'; - -.sub-menu { - height: 160px; - display: flex; - flex-direction: column; - align-items: start; - - .account { - display: flex; - margin-top: 20px; - margin-bottom: 20px; - - img { - @include avatar(80px); - - margin-right: 20px; - } - - .account-info { - display: flex; - flex-direction: column; - justify-content: center; - - .account-display-name { - font-size: 23px; - font-weight: $font-bold; - } - - .account-followers { - font-size: 15px; - } - } - } - - .links { - margin-top: 0; - margin-bottom: 10px; - - a { - margin-top: 0; - margin-bottom: 0; - } - } -} \ No newline at end of file diff --git a/client/src/app/+account/index.ts b/client/src/app/+account/index.ts deleted file mode 100644 index dc56ffdbd..000000000 --- a/client/src/app/+account/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './account-routing.module' -export * from './account.component' -export * from './account.module' diff --git a/client/src/app/+account/account-about/account-about.component.html b/client/src/app/+accounts/account-about/account-about.component.html similarity index 100% rename from client/src/app/+account/account-about/account-about.component.html rename to client/src/app/+accounts/account-about/account-about.component.html diff --git a/client/src/app/+account/account-about/account-about.component.scss b/client/src/app/+accounts/account-about/account-about.component.scss similarity index 100% rename from client/src/app/+account/account-about/account-about.component.scss rename to client/src/app/+accounts/account-about/account-about.component.scss diff --git a/client/src/app/+account/account-about/account-about.component.ts b/client/src/app/+accounts/account-about/account-about.component.ts similarity index 100% rename from client/src/app/+account/account-about/account-about.component.ts rename to client/src/app/+accounts/account-about/account-about.component.ts diff --git a/client/src/app/+account/account-video-channels/account-video-channels.component.html b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html similarity index 100% rename from client/src/app/+account/account-video-channels/account-video-channels.component.html rename to client/src/app/+accounts/account-video-channels/account-video-channels.component.html diff --git a/client/src/app/+account/account-video-channels/account-video-channels.component.scss b/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss similarity index 100% rename from client/src/app/+account/account-video-channels/account-video-channels.component.scss rename to client/src/app/+accounts/account-video-channels/account-video-channels.component.scss diff --git a/client/src/app/+account/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts similarity index 92% rename from client/src/app/+account/account-video-channels/account-video-channels.component.ts rename to client/src/app/+accounts/account-video-channels/account-video-channels.component.ts index 8915eb622..4c5782f9d 100644 --- a/client/src/app/+account/account-video-channels/account-video-channels.component.ts +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts @@ -26,7 +26,7 @@ export class AccountVideoChannelsComponent implements OnInit { // Parent get the account for us this.accountService.accountLoaded .do(account => this.account = account) - .flatMap(account => this.videoChannelService.getVideoChannels(account.id)) + .flatMap(account => this.videoChannelService.listAccountVideoChannels(account.id)) .map(res => res.data) .subscribe(videoChannels => this.videoChannels = videoChannels) } diff --git a/client/src/app/+account/account-videos/account-videos.component.scss b/client/src/app/+accounts/account-videos/account-videos.component.scss similarity index 100% rename from client/src/app/+account/account-videos/account-videos.component.scss rename to client/src/app/+accounts/account-videos/account-videos.component.scss diff --git a/client/src/app/+account/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts similarity index 100% rename from client/src/app/+account/account-videos/account-videos.component.ts rename to client/src/app/+accounts/account-videos/account-videos.component.ts diff --git a/client/src/app/+account/account-routing.module.ts b/client/src/app/+accounts/accounts-routing.module.ts similarity index 84% rename from client/src/app/+account/account-routing.module.ts rename to client/src/app/+accounts/accounts-routing.module.ts index f72d8373f..ffe606b43 100644 --- a/client/src/app/+account/account-routing.module.ts +++ b/client/src/app/+accounts/accounts-routing.module.ts @@ -1,15 +1,15 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' import { MetaGuard } from '@ngx-meta/core' -import { AccountComponent } from './account.component' +import { AccountsComponent } from './accounts.component' import { AccountVideosComponent } from './account-videos/account-videos.component' import { AccountAboutComponent } from './account-about/account-about.component' import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' -const accountRoutes: Routes = [ +const accountsRoutes: Routes = [ { path: ':accountId', - component: AccountComponent, + component: AccountsComponent, canActivateChild: [ MetaGuard ], children: [ { @@ -49,7 +49,7 @@ const accountRoutes: Routes = [ ] @NgModule({ - imports: [ RouterModule.forChild(accountRoutes) ], + imports: [ RouterModule.forChild(accountsRoutes) ], exports: [ RouterModule ] }) -export class AccountRoutingModule {} +export class AccountsRoutingModule {} diff --git a/client/src/app/+account/account.component.html b/client/src/app/+accounts/accounts.component.html similarity index 71% rename from client/src/app/+account/account.component.html rename to client/src/app/+accounts/accounts.component.html index d0e99edda..549676e5a 100644 --- a/client/src/app/+account/account.component.html +++ b/client/src/app/+accounts/accounts.component.html @@ -1,12 +1,12 @@
- + By {{ video.by }} Account avatar diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss index cbf9b566a..c43bd9803 100644 --- a/client/src/sass/include/_mixins.scss +++ b/client/src/sass/include/_mixins.scss @@ -320,4 +320,48 @@ color: $orange-color; font-weight: $font-bold; font-size: 13px; +} + +@mixin sub-menu-with-actor { + height: 160px; + display: flex; + flex-direction: column; + align-items: start; + + .actor { + display: flex; + margin-top: 20px; + margin-bottom: 20px; + + img { + @include avatar(80px); + + margin-right: 20px; + } + + .actor-info { + display: flex; + flex-direction: column; + justify-content: center; + + .actor-display-name { + font-size: 23px; + font-weight: $font-bold; + } + + .actor-followers { + font-size: 15px; + } + } + } + + .links { + margin-top: 0; + margin-bottom: 10px; + + a { + margin-top: 0; + margin-bottom: 0; + } + } } \ No newline at end of file diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 850ad12e0..499a4fc94 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -140,7 +140,7 @@ describe('Test videos API validator', function () { let path: string before(async function () { - path = '/api/v1/accounts/' + accountUUID + '/video-channels/' + channelUUID + '/videos' + path = '/api/v1/video-channels/' + channelUUID + '/videos' }) it('Should fail with a bad start pagination', async function () { diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 6238cdc08..e462a2d47 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -47,7 +47,6 @@ describe('Test multiple servers', function () { let servers: ServerInfo[] = [] const toRemove = [] let videoUUID = '' - let accountId: number let videoChannelId: number before(async function () { @@ -58,17 +57,12 @@ describe('Test multiple servers', function () { // Get the access tokens await setAccessTokensToServers(servers) - { - const res = await getAccountsList(servers[0].url) - accountId = res.body.data[0].id - } - { const videoChannel = { name: 'my channel', description: 'super channel' } - await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, accountId, videoChannel) + await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, videoChannel) const channelRes = await getVideoChannelsList(servers[ 0 ].url, 0, 1) videoChannelId = channelRes.body.data[ 0 ].id } -- 2.41.0