diff --git a/client/common/configuration/elements/templates/channel-configuration.ts b/client/common/configuration/elements/templates/channel-configuration.ts index d9fd69ff..fb7d5df2 100644 --- a/client/common/configuration/elements/templates/channel-configuration.ts +++ b/client/common/configuration/elements/templates/channel-configuration.ts @@ -129,8 +129,8 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ
@@ -164,7 +164,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ
@@ -220,7 +220,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ @@ -241,7 +241,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ > @@ -262,7 +262,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ > diff --git a/client/common/configuration/register.ts b/client/common/configuration/register.ts index ce26119d..2dc36d88 100644 --- a/client/common/configuration/register.ts +++ b/client/common/configuration/register.ts @@ -28,9 +28,14 @@ async function registerConfiguration (clientOptions: RegisterClientOptions): Pro route: 'livechat/configuration/channel', onMount: async ({ rootEl }) => { const urlParams = new URLSearchParams(window.location.search) - const channelId = urlParams.get('channelId') ?? '' - render(html``, rootEl) + const channelId = parseInt(urlParams.get('channelId') ?? '') + if (isNaN(channelId)) { throw new Error('Invalid channelId parameter') } + render(html` + + `, rootEl) } }) @@ -38,7 +43,8 @@ async function registerConfiguration (clientOptions: RegisterClientOptions): Pro route: 'livechat/configuration/emojis', onMount: async ({ rootEl }) => { const urlParams = new URLSearchParams(window.location.search) - const channelId = urlParams.get('channelId') ?? '' + const channelId = parseInt(urlParams.get('channelId') ?? '') + if (isNaN(channelId)) { throw new Error('Invalid channelId parameter') } render(html` +// SPDX-FileCopyrightText: 2024 John Livingston // // SPDX-License-Identifier: AGPL-3.0-only +import { ptTr } from '../directives/translation' import { html } from 'lit' import { customElement, property } from 'lit/decorators.js' import { LivechatElement } from './livechat' @@ -9,21 +11,28 @@ import { LivechatElement } from './livechat' @customElement('livechat-configuration-section-header') export class ConfigurationSectionHeaderElement extends LivechatElement { @property({ attribute: false }) - public override title: string = 'title' + public label: string | ReturnType = '???' @property({ attribute: false }) - public description: string = 'Here\'s a description' + public description?: string | ReturnType @property({ attribute: false }) - public helpPage: string = 'documentation' + public helpPage?: string protected override render = (): unknown => { return html`

- ${this.title} - + ${this.label} + ${ + this.helpPage === undefined + ? '' + : html`` + }

-

${this.description}

- ` + ${ + this.description === undefined + ? '' + : html`

${this.description}

` + }` } }