diff options
Diffstat (limited to 'client/src/app/shared/shared-custom-markup')
3 files changed, 7 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts index 208dba721..a12907055 100644 --- a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts +++ b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts | |||
@@ -10,6 +10,7 @@ import { | |||
10 | SimpleChanges, | 10 | SimpleChanges, |
11 | Type | 11 | Type |
12 | } from '@angular/core' | 12 | } from '@angular/core' |
13 | import { objectKeysTyped } from '@shared/core-utils' | ||
13 | 14 | ||
14 | @Injectable() | 15 | @Injectable() |
15 | export class DynamicElementService { | 16 | export class DynamicElementService { |
@@ -41,12 +42,12 @@ export class DynamicElementService { | |||
41 | setModel <T> (componentRef: ComponentRef<T>, attributes: Partial<T>) { | 42 | setModel <T> (componentRef: ComponentRef<T>, attributes: Partial<T>) { |
42 | const changes: SimpleChanges = {} | 43 | const changes: SimpleChanges = {} |
43 | 44 | ||
44 | for (const key of Object.keys(attributes)) { | 45 | for (const key of objectKeysTyped(attributes)) { |
45 | const previousValue = componentRef.instance[key] | 46 | const previousValue = componentRef.instance[key] |
46 | const newValue = attributes[key] | 47 | const newValue = attributes[key] |
47 | 48 | ||
48 | componentRef.instance[key] = newValue | 49 | componentRef.instance[key] = newValue |
49 | changes[key] = new SimpleChange(previousValue, newValue, previousValue === undefined) | 50 | changes[key as string] = new SimpleChange(previousValue, newValue, previousValue === undefined) |
50 | } | 51 | } |
51 | 52 | ||
52 | const component = componentRef.instance | 53 | const component = componentRef.instance |
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts index 21774b7aa..bd93929c9 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts | |||
@@ -2,6 +2,7 @@ import { finalize } from 'rxjs/operators' | |||
2 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 2 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
3 | import { AuthService, Notifier } from '@app/core' | 3 | import { AuthService, Notifier } from '@app/core' |
4 | import { FindInBulkService } from '@app/shared/shared-search' | 4 | import { FindInBulkService } from '@app/shared/shared-search' |
5 | import { objectKeysTyped } from '@shared/core-utils' | ||
5 | import { Video } from '../../shared-main' | 6 | import { Video } from '../../shared-main' |
6 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 7 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
7 | import { CustomMarkupComponent } from './shared' | 8 | import { CustomMarkupComponent } from './shared' |
@@ -47,7 +48,7 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI | |||
47 | 48 | ||
48 | ngOnInit () { | 49 | ngOnInit () { |
49 | if (this.onlyDisplayTitle) { | 50 | if (this.onlyDisplayTitle) { |
50 | for (const key of Object.keys(this.displayOptions)) { | 51 | for (const key of objectKeysTyped(this.displayOptions)) { |
51 | this.displayOptions[key] = false | 52 | this.displayOptions[key] = false |
52 | } | 53 | } |
53 | } | 54 | } |
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index 7c2e7db6a..81363be87 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { finalize } from 'rxjs/operators' | 1 | import { finalize } from 'rxjs/operators' |
2 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 2 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
3 | import { AuthService, Notifier } from '@app/core' | 3 | import { AuthService, Notifier } from '@app/core' |
4 | import { objectKeysTyped } from '@shared/core-utils' | ||
4 | import { VideoSortField } from '@shared/models' | 5 | import { VideoSortField } from '@shared/models' |
5 | import { Video, VideoService } from '../../shared-main' | 6 | import { Video, VideoService } from '../../shared-main' |
6 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 7 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
@@ -66,7 +67,7 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit | |||
66 | 67 | ||
67 | ngOnInit () { | 68 | ngOnInit () { |
68 | if (this.onlyDisplayTitle) { | 69 | if (this.onlyDisplayTitle) { |
69 | for (const key of Object.keys(this.displayOptions)) { | 70 | for (const key of objectKeysTyped(this.displayOptions)) { |
70 | this.displayOptions[key] = false | 71 | this.displayOptions[key] = false |
71 | } | 72 | } |
72 | } | 73 | } |