From 84c7cde6e81426a42e7aa29187b473bc89f1c8f6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Feb 2019 11:24:07 +0100 Subject: Update E2E tests --- .../core/notification/user-notification-socket.service.ts | 15 +++++++++------ .../src/app/shared/video/video-thumbnail.component.scss | 4 ++-- .../app/videos/+video-edit/shared/video-edit.component.ts | 11 +++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) (limited to 'client/src') diff --git a/client/src/app/core/notification/user-notification-socket.service.ts b/client/src/app/core/notification/user-notification-socket.service.ts index 493f03e35..3f22da476 100644 --- a/client/src/app/core/notification/user-notification-socket.service.ts +++ b/client/src/app/core/notification/user-notification-socket.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core' +import { Injectable, NgZone } from '@angular/core' import { environment } from '../../../environments/environment' import { UserNotification as UserNotificationServer } from '../../../../../shared' import { Subject } from 'rxjs' @@ -13,7 +13,8 @@ export class UserNotificationSocket { private socket: SocketIOClient.Socket constructor ( - private auth: AuthService + private auth: AuthService, + private ngZone: NgZone ) {} dispatch (type: NotificationEvent, notification?: UserNotificationServer) { @@ -32,10 +33,12 @@ export class UserNotificationSocket { // FIXME: import('..') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function const io: typeof import ('socket.io-client') = (await import('socket.io-client') as any).default - this.socket = io(environment.apiUrl + '/user-notifications', { - query: { accessToken: this.auth.getAccessToken() } - }) + this.ngZone.runOutsideAngular(() => { + this.socket = io(environment.apiUrl + '/user-notifications', { + query: { accessToken: this.auth.getAccessToken() } + }) - this.socket.on('new-notification', (n: UserNotificationServer) => this.dispatch('new', n)) + this.socket.on('new-notification', (n: UserNotificationServer) => this.dispatch('new', n)) + }) } } diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/video/video-thumbnail.component.scss index e57baba5c..b9fd9182f 100644 --- a/client/src/app/shared/video/video-thumbnail.component.scss +++ b/client/src/app/shared/video/video-thumbnail.component.scss @@ -54,8 +54,8 @@ $play-overlay-width: 18px; transition: all $play-overlay-transition; - border-top: calc(#{$play-overlay-height} / 2) solid transparent; - border-bottom: calc(#{$play-overlay-height} / 2) solid transparent; + border-top: ($play-overlay-height / 2) solid transparent; + border-bottom: ($play-overlay-height / 2) solid transparent; border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95); diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index c7ebcec25..c80efd802 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' +import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' import { ActivatedRoute, Router } from '@angular/router' import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared' @@ -62,7 +62,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { private router: Router, private notifier: Notifier, private serverService: ServerService, - private i18nPrimengCalendarService: I18nPrimengCalendarService + private i18nPrimengCalendarService: I18nPrimengCalendarService, + private ngZone: NgZone ) { this.tagValidators = this.videoValidatorsService.VIDEO_TAGS.VALIDATORS this.tagValidatorsMessages = this.videoValidatorsService.VIDEO_TAGS.MESSAGES @@ -132,9 +133,11 @@ export class VideoEditComponent implements OnInit, OnDestroy { this.videoLicences = this.serverService.getVideoLicences() this.videoLanguages = this.serverService.getVideoLanguages() - this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute - this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) + + this.ngZone.runOutsideAngular(() => { + this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute + }) } ngOnDestroy () { -- cgit v1.2.3