diff --git a/assets/styles/style.scss b/assets/styles/style.scss
index 50b73f4e..00d0ca85 100644
--- a/assets/styles/style.scss
+++ b/assets/styles/style.scss
@@ -47,7 +47,7 @@
}
.peertube-plugin-livechat-buttons-cloned {
- // Hidding buttons when cloned by the ConverseJS mini-muc-head plugin.
+ // Hiding buttons when cloned by the ConverseJS mini-muc-head plugin.
display: none;
}
diff --git a/client/common/configuration/elements/channel-configuration.ts b/client/common/configuration/elements/channel-configuration.ts
index a0232251..e083a7a6 100644
--- a/client/common/configuration/elements/channel-configuration.ts
+++ b/client/common/configuration/elements/channel-configuration.ts
@@ -3,16 +3,15 @@ import { html, LitElement } from 'lit'
import { customElement, property, state } from 'lit/decorators.js'
import { ptTr } from '../directives/translation'
import './dynamic-table-form'
-import './plugin-configuration-row'
+import './configuration-row'
import './help-button'
import { Task } from '@lit/task';
import type { ChannelConfiguration } from 'shared/lib/types'
import { ChannelDetailsService } from '../services/channel-details'
import { provide } from '@lit/context'
-import { getGlobalStyleSheets } from '../../global-styles'
import { channelConfigurationContext, channelDetailsServiceContext, registerClientOptionsContext } from '../contexts/channel'
-@customElement('channel-configuration')
+@customElement('livechat-channel-configuration')
export class ChannelConfigurationElement extends LitElement {
@provide({ context: registerClientOptionsContext })
@@ -29,16 +28,16 @@ export class ChannelConfigurationElement extends LitElement {
@provide({ context: channelDetailsServiceContext })
private _channelDetailsService: ChannelDetailsService | undefined
- static styles = [
- ...getGlobalStyleSheets()
- ];
+ protected createRenderRoot = (): HTMLElement | DocumentFragment => {
+ return this
+ }
@state()
public _formStatus: boolean | any = undefined
private _asyncTaskRender = new Task(this, {
- task: async ([registerClientOptions], {signal}) => {
+ task: async ([registerClientOptions], { signal }) => {
if (this.registerClientOptions) {
this._channelDetailsService = new ChannelDetailsService(this.registerClientOptions)
this._channelConfiguration = await this._channelDetailsService.fetchConfiguration(this.channelId ?? 0)
@@ -50,18 +49,18 @@ export class ChannelConfigurationElement extends LitElement {
});
private _saveConfig = () => {
- if(this._channelDetailsService && this._channelConfiguration) {
+ if (this._channelDetailsService && this._channelConfiguration) {
this._channelDetailsService.saveOptions(this._channelConfiguration.channel.id, this._channelConfiguration.configuration)
- .then((value) => {
- this._formStatus = { success: true }
- console.log(`Configuration has been updated`)
- this.requestUpdate('_formStatus')
- })
- .catch((error) => {
- this._formStatus = error
- console.log(`An error occurred : ${JSON.stringify(this._formStatus)}`)
- this.requestUpdate('_formStatus')
- });
+ .then((value) => {
+ this._formStatus = { success: true }
+ console.log(`Configuration has been updated`)
+ this.requestUpdate('_formStatus')
+ })
+ .catch((error) => {
+ this._formStatus = error
+ console.log(`An error occurred : ${JSON.stringify(this._formStatus)}`)
+ this.requestUpdate('_formStatus')
+ });
}
}
@@ -181,142 +180,178 @@ export class ChannelConfigurationElement extends LitElement {
${this._channelConfiguration?.channel.displayName}
${this._channelConfiguration?.channel.name}
-
${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_DESC)}