From 57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Jul 2018 16:17:54 +0200 Subject: Begin advanced search --- .../videos/video-list/video-search.component.ts | 77 ---------------------- 1 file changed, 77 deletions(-) delete mode 100644 client/src/app/videos/video-list/video-search.component.ts (limited to 'client/src/app/videos/video-list/video-search.component.ts') diff --git a/client/src/app/videos/video-list/video-search.component.ts b/client/src/app/videos/video-list/video-search.component.ts deleted file mode 100644 index 33ed3f00e..000000000 --- a/client/src/app/videos/video-list/video-search.component.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' -import { Location } from '@angular/common' -import { RedirectService } from '@app/core' -import { immutableAssign } from '@app/shared/misc/utils' -import { NotificationsService } from 'angular2-notifications' -import { Subscription } from 'rxjs' -import { AuthService } from '../../core/auth' -import { AbstractVideoList } from '../../shared/video/abstract-video-list' -import { VideoService } from '../../shared/video/video.service' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { ScreenService } from '@app/shared/misc/screen.service' - -@Component({ - selector: 'my-videos-search', - styleUrls: [ '../../shared/video/abstract-video-list.scss' ], - templateUrl: '../../shared/video/abstract-video-list.html' -}) -export class VideoSearchComponent extends AbstractVideoList implements OnInit, OnDestroy { - titlePage: string - currentRoute = '/videos/search' - loadOnInit = false - - protected otherRouteParams = { - search: '' - } - private subActivatedRoute: Subscription - - constructor ( - protected router: Router, - protected route: ActivatedRoute, - protected notificationsService: NotificationsService, - protected authService: AuthService, - protected location: Location, - protected i18n: I18n, - protected screenService: ScreenService, - private videoService: VideoService, - private redirectService: RedirectService - ) { - super() - - this.titlePage = i18n('Search') - } - - ngOnInit () { - super.ngOnInit() - - this.subActivatedRoute = this.route.queryParams.subscribe( - queryParams => { - const querySearch = queryParams['search'] - - if (!querySearch) return this.redirectService.redirectToHomepage() - if (this.otherRouteParams.search === querySearch) return - - this.otherRouteParams.search = querySearch - this.reloadVideos() - }, - - err => this.notificationsService.error('Error', err.text) - ) - } - - ngOnDestroy () { - super.ngOnDestroy() - - if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() - } - - getVideosObservable (page: number) { - const newPagination = immutableAssign(this.pagination, { currentPage: page }) - return this.videoService.searchVideos(this.otherRouteParams.search, newPagination, this.sort) - } - - generateSyndicationList () { - throw new Error('Search does not support syndication.') - } -} -- cgit v1.2.3