From dffd5d127f49eb63d2b2b3133aec75ec1d7e4dcb Mon Sep 17 00:00:00 2001 From: BO41 Date: Tue, 16 Oct 2018 01:04:50 +0200 Subject: update tslint config and fix member ordering (#1279) --- client/src/app/search/search.component.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index 911d56843..ecffcafc1 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -1,6 +1,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { AuthService, RedirectService } from '@app/core' +import { AuthService } from '@app/core' import { NotificationsService } from 'angular2-notifications' import { forkJoin, Subscription } from 'rxjs' import { SearchService } from '@app/search/search.service' @@ -40,7 +40,6 @@ export class SearchComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private router: Router, private metaService: MetaService, - private redirectService: RedirectService, private notificationsService: NotificationsService, private searchService: SearchService, private authService: AuthService -- cgit v1.2.3 From 244b4ae3973bc1511464a08158a123767f83179c Mon Sep 17 00:00:00 2001 From: BO41 Date: Thu, 18 Oct 2018 09:08:59 +0200 Subject: NoImplicitAny flag true (#1157) this enables the `noImplicitAny` flag in the Typescript compiler > When the noImplicitAny flag is true and the TypeScript compiler cannot infer the type, it still generates the JavaScript files, but it also reports an error. Many seasoned developers prefer this stricter setting because type checking catches more unintentional errors at compile time. closes: #1131 replaces #1137 --- client/src/app/search/advanced-search.model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.ts index 033fa9bba..1d6c89282 100644 --- a/client/src/app/search/advanced-search.model.ts +++ b/client/src/app/search/advanced-search.model.ts @@ -53,7 +53,7 @@ export class AdvancedSearch { } containsValues () { - const obj = this.toUrlObject() + const obj: any = this.toUrlObject() for (const k of Object.keys(obj)) { if (k === 'sort') continue // Exception @@ -113,7 +113,7 @@ export class AdvancedSearch { size () { let acc = 0 - const obj = this.toUrlObject() + const obj: any = this.toUrlObject() for (const k of Object.keys(obj)) { if (k === 'sort') continue // Exception -- cgit v1.2.3 From c199c427d4ae586339822320f20f512a7a19dc3f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Oct 2018 14:35:31 +0200 Subject: Better typings --- client/src/app/search/advanced-search.model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.ts index 1d6c89282..033fa9bba 100644 --- a/client/src/app/search/advanced-search.model.ts +++ b/client/src/app/search/advanced-search.model.ts @@ -53,7 +53,7 @@ export class AdvancedSearch { } containsValues () { - const obj: any = this.toUrlObject() + const obj = this.toUrlObject() for (const k of Object.keys(obj)) { if (k === 'sort') continue // Exception @@ -113,7 +113,7 @@ export class AdvancedSearch { size () { let acc = 0 - const obj: any = this.toUrlObject() + const obj = this.toUrlObject() for (const k of Object.keys(obj)) { if (k === 'sort') continue // Exception -- cgit v1.2.3 From f107470e50236e2a073f3f7dbab87c79e8364b56 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 19 Nov 2018 17:36:20 +0100 Subject: Fix search title --- client/src/app/search/search.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index ecffcafc1..3d17e6d96 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -146,7 +146,8 @@ export class SearchComponent implements OnInit, OnDestroy { } private updateTitle () { - this.metaService.setTitle(this.i18n('Search') + ' ' + this.currentSearch) + const suffix = this.currentSearch ? ' ' + this.currentSearch : '' + this.metaService.setTitle(this.i18n('Search') + suffix) } private updateUrlFromAdvancedSearch () { -- cgit v1.2.3 From f8b2c1b4f509c037b9650cca2c5befd21f056df3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Dec 2018 16:04:34 +0100 Subject: Refractor notification service Shorter name and use primeng component --- client/src/app/search/search-filters.component.ts | 6 +----- client/src/app/search/search.component.ts | 11 ++++------- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/search/search-filters.component.ts index 8d7f84ac1..3fdc6df35 100644 --- a/client/src/app/search/search-filters.component.ts +++ b/client/src/app/search/search-filters.component.ts @@ -1,10 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' -import { ActivatedRoute } from '@angular/router' -import { RedirectService, ServerService } from '@app/core' -import { NotificationsService } from 'angular2-notifications' -import { SearchService } from '@app/search/search.service' +import { ServerService } from '@app/core' import { I18n } from '@ngx-translate/i18n-polyfill' -import { MetaService } from '@ngx-meta/core' import { AdvancedSearch } from '@app/search/advanced-search.model' import { VideoConstant } from '../../../../shared' diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index 3d17e6d96..474b72824 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -1,7 +1,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { AuthService } from '@app/core' -import { NotificationsService } from 'angular2-notifications' +import { AuthService, Notifier } from '@app/core' import { forkJoin, Subscription } from 'rxjs' import { SearchService } from '@app/search/search.service' import { ComponentPagination } from '@app/shared/rest/component-pagination.model' @@ -40,7 +39,7 @@ export class SearchComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private router: Router, private metaService: MetaService, - private notificationsService: NotificationsService, + private notifier: Notifier, private searchService: SearchService, private authService: AuthService ) { } @@ -68,7 +67,7 @@ export class SearchComponent implements OnInit, OnDestroy { this.search() }, - err => this.notificationsService.error('Error', err.text) + err => this.notifier.error(err.text) ) } @@ -112,9 +111,7 @@ export class SearchComponent implements OnInit, OnDestroy { this.firstSearch = false }, - error => { - this.notificationsService.error(this.i18n('Error'), error.message) - } + err => this.notifier.error(err.message) ) } -- cgit v1.2.3 From 033bc0efc2ab2c517b4d7d53d09930b85f092b50 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 Jan 2019 16:58:33 +0100 Subject: Fix NSFW blur on search --- client/src/app/search/search.component.html | 2 +- client/src/app/search/search.component.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/search.component.html b/client/src/app/search/search.component.html index 3a87ea1de..82a5f0f26 100644 --- a/client/src/app/search/search.component.html +++ b/client/src/app/search/search.component.html @@ -48,7 +48,7 @@
- +
{{ result.name }} diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index 474b72824..c4a4b1fde 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -1,6 +1,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { AuthService, Notifier } from '@app/core' +import { AuthService, Notifier, ServerService } from '@app/core' import { forkJoin, Subscription } from 'rxjs' import { SearchService } from '@app/search/search.service' import { ComponentPagination } from '@app/shared/rest/component-pagination.model' @@ -41,7 +41,8 @@ export class SearchComponent implements OnInit, OnDestroy { private metaService: MetaService, private notifier: Notifier, private searchService: SearchService, - private authService: AuthService + private authService: AuthService, + private serverService: ServerService ) { } ngOnInit () { @@ -75,6 +76,10 @@ export class SearchComponent implements OnInit, OnDestroy { if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() } + isVideoBlur (video: Video) { + return video.isVideoNSFWForUser(this.authService.getUser(), this.serverService.getConfig()) + } + isVideoChannel (d: VideoChannel | Video): d is VideoChannel { return d instanceof VideoChannel } -- cgit v1.2.3 From 457bb213b273a9b206cc5654eb085cede4e916ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 16 Jan 2019 16:05:40 +0100 Subject: Refactor how we use icons Inject them in an angular component so we can easily change their color --- client/src/app/search/search.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/search') diff --git a/client/src/app/search/search.component.scss b/client/src/app/search/search.component.scss index 3e074621b..6de13d276 100644 --- a/client/src/app/search/search.component.scss +++ b/client/src/app/search/search.component.scss @@ -87,10 +87,10 @@ text-overflow: ellipsis; white-space: nowrap; font-size: 14px; - color: #585858; + color: $grey-foreground-color; &:hover { - color: #303030; + color: $grey-foreground-hover-color; } } } -- cgit v1.2.3