From 66dc59076413b9a4aa0899d3192b0bdf03ee654d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Apr 2018 15:11:12 +0200 Subject: Add ability to click on the account in watch page --- client/src/app/header/header.component.ts | 9 ++++++--- client/src/app/videos/+video-watch/video-watch.component.html | 7 +++++-- client/src/app/videos/+video-watch/video-watch.component.scss | 5 +++++ client/src/app/videos/video-list/video-search.component.ts | 3 +-- package.json | 2 +- server/controllers/api/videos/index.ts | 2 +- server/models/video/video.ts | 2 +- yarn.lock | 8 ++++---- 8 files changed, 24 insertions(+), 14 deletions(-) diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts index 6b0ee67ff..42de2dd92 100644 --- a/client/src/app/header/header.component.ts +++ b/client/src/app/header/header.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core' -import { Router } from '@angular/router' +import { Router, NavigationEnd } from '@angular/router' import { getParameterByName } from '../shared/misc/utils' @Component({ @@ -14,8 +14,11 @@ export class HeaderComponent implements OnInit { constructor (private router: Router) {} ngOnInit () { - const searchQuery = getParameterByName('search', window.location.href) - if (searchQuery) this.searchValue = searchQuery + this.router.events + .filter(e => e instanceof NavigationEnd) + .map(() => getParameterByName('search', window.location.href)) + .filter(searchQuery => !!searchQuery) + .subscribe(searchQuery => this.searchValue = searchQuery) } doSearch () { diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.html index 52e3e429a..91e590094 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.html +++ b/client/src/app/videos/+video-watch/video-watch.component.html @@ -22,8 +22,11 @@
- By {{ video.by }} - Account avatar + + By {{ video.by }} + Account avatar + +
diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss index 8a3e2584b..3ebeccd4b 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.scss +++ b/client/src/app/videos/+video-watch/video-watch.component.scss @@ -73,6 +73,11 @@ align-items: center; font-size: 13px; + a { + color: black; + display: inline-block; + } + img { @include avatar(18px); diff --git a/client/src/app/videos/video-list/video-search.component.ts b/client/src/app/videos/video-list/video-search.component.ts index ef9afa757..46a9dd48e 100644 --- a/client/src/app/videos/video-list/video-search.component.ts +++ b/client/src/app/videos/video-list/video-search.component.ts @@ -7,7 +7,6 @@ import { Subscription } from 'rxjs/Subscription' import { AuthService } from '../../core/auth' import { AbstractVideoList } from '../../shared/video/abstract-video-list' import { VideoService } from '../../shared/video/video.service' -import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' @Component({ selector: 'my-videos-search', @@ -64,6 +63,6 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O } generateSyndicationList () { - throw new Error('Method not implemented.') + throw new Error('Search does not support syndication.') } } diff --git a/package.json b/package.json index e3007bea9..6a6275fb9 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "safe-buffer": "^5.0.1", "scripty": "^1.5.0", "sequelize": "4.37.6", - "sequelize-typescript": "^0.6.1", + "sequelize-typescript": "0.6.4-beta.0", "sharp": "^0.20.0", "uuid": "^3.1.0", "validator": "^9.0.0", diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 244099015..b4cd67158 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -418,7 +418,7 @@ async function removeVideo (req: express.Request, res: express.Response) { } async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) { - const resultList = await VideoModel.searchAndPopulateAccountAndServerAndTags( + const resultList = await VideoModel.searchAndPopulateAccountAndServer( req.query.search, req.query.start, req.query.count, diff --git a/server/models/video/video.ts b/server/models/video/video.ts index ffb9725b4..a7923b477 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -696,7 +696,7 @@ export class VideoModel extends Model { }) } - static async searchAndPopulateAccountAndServerAndTags (value: string, start: number, count: number, sort: string) { + static async searchAndPopulateAccountAndServer (value: string, start: number, count: number, sort: string) { const query: IFindOptions = { offset: start, limit: count, diff --git a/yarn.lock b/yarn.lock index 2b445860f..73488620a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4585,7 +4585,7 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -pfeed@^1.1.2: +pfeed@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.5.tgz#6d0ab54209c60b45de03a15efaab7be867a3f71a" dependencies: @@ -5408,9 +5408,9 @@ send@0.16.2: range-parser "~1.2.0" statuses "~1.4.0" -sequelize-typescript@^0.6.1: - version "0.6.3" - resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.3.tgz#567ef7d12193c16aac7ee85e5d321e8980fb817d" +sequelize-typescript@0.6.4-beta.0: + version "0.6.4-beta.0" + resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.4-beta.0.tgz#c36e4bfc030dd59b1211967ecace243601b2242e" dependencies: "@types/bluebird" "3.5.18" "@types/node" "6.0.41" -- cgit v1.2.3