From 02c01341f4dae30ec6b81fcb644952393d73c4a8 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 5 Aug 2020 00:50:07 +0200 Subject: add ng-select for templatable select options - create select-tags component to replace ngx-chips - create select-options to factorize option selection in forms - create select-channel to simplify channel selection - refactor tags validation --- client/src/app/helpers/utils.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'client/src/app/helpers/utils.ts') diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts index 825b6ca96..aa37fdd46 100644 --- a/client/src/app/helpers/utils.ts +++ b/client/src/app/helpers/utils.ts @@ -16,7 +16,10 @@ function getParameterByName (name: string, url: string) { return decodeURIComponent(results[2].replace(/\+/g, ' ')) } -function populateAsyncUserVideoChannels (authService: AuthService, channel: { id: number, label: string, support?: string }[]) { +function populateAsyncUserVideoChannels ( + authService: AuthService, + channel: { id: number, label: string, support?: string, avatarPath?: string, recent?: boolean }[] +) { return new Promise(res => { authService.userInformationLoaded .subscribe( @@ -27,7 +30,12 @@ function populateAsyncUserVideoChannels (authService: AuthService, channel: { id const videoChannels = user.videoChannels if (Array.isArray(videoChannels) === false) return - videoChannels.forEach(c => channel.push({ id: c.id, label: c.displayName, support: c.support })) + videoChannels.forEach(c => channel.push({ + id: c.id, + label: c.displayName, + support: c.support, + avatarPath: c.avatar?.path + })) return res() } -- cgit v1.2.3