Refactoring.

This commit is contained in:
John Livingston 2024-06-12 15:50:14 +02:00
parent a4a9f85956
commit 268c60d699
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
5 changed files with 14 additions and 13 deletions

View File

@ -473,6 +473,6 @@ livechat-image-file-input {
}
}
livechat-configuration-row {
livechat-configuration-section-header {
margin-top: 3rem;
}

View File

@ -251,11 +251,11 @@ export class ChannelConfigurationElement extends LivechatElement {
</p>
<form livechat-configuration-channel-options role="form" @submit=${this._saveConfig}>
<livechat-configuration-row
<livechat-configuration-section-header
.title=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_SLOW_MODE_LABEL)}
.description=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_SLOW_MODE_DESC, true)}
.helpPage=${'documentation/user/streamers/slow_mode'}>
</livechat-configuration-row>
</livechat-configuration-section-header>
<div class="form-group">
<label>
${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_SLOW_MODE_LABEL)}
@ -281,11 +281,11 @@ export class ChannelConfigurationElement extends LivechatElement {
${this._renderFeedback('peertube-livechat-slowmode-duration-feedback', 'slowMode.duration')}
</div>
<livechat-configuration-row
<livechat-configuration-section-header
.title=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_BOT_OPTIONS_TITLE)}
.description=${''}
.helpPage=${'documentation/user/streamers/channel'}>
</livechat-configuration-row>
</livechat-configuration-section-header>
<div class="form-group">
<label>
<input
@ -332,11 +332,11 @@ export class ChannelConfigurationElement extends LivechatElement {
${this._renderFeedback('peertube-livechat-bot-nickname-feedback', 'bot.nickname')}
</div>
<livechat-configuration-row
<livechat-configuration-section-header
.title=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_FORBIDDEN_WORDS_LABEL)}
.description=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_FORBIDDEN_WORDS_DESC)}
.helpPage=${'documentation/user/streamers/bot/forbidden_words'}>
</livechat-configuration-row>
</livechat-configuration-section-header>
<livechat-dynamic-table-form
.header=${tableHeaderList.forbiddenWords}
.schema=${tableSchema.forbiddenWords}
@ -353,11 +353,11 @@ export class ChannelConfigurationElement extends LivechatElement {
.formName=${'forbidden-words'}
></livechat-dynamic-table-form>
<livechat-configuration-row
<livechat-configuration-section-header
.title=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_QUOTE_LABEL)}
.description=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_QUOTE_DESC)}
.helpPage=${'documentation/user/streamers/bot/quotes'}>
</livechat-configuration-row>
</livechat-configuration-section-header>
<livechat-dynamic-table-form
.header=${tableHeaderList.quotes}
.schema=${tableSchema.quotes}
@ -374,11 +374,11 @@ export class ChannelConfigurationElement extends LivechatElement {
.formName=${'quote'}
></livechat-dynamic-table-form>
<livechat-configuration-row
<livechat-configuration-section-header
.title=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_COMMAND_LABEL)}
.description=${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_COMMAND_DESC)}
.helpPage=${'documentation/user/streamers/bot/commands'}>
</livechat-configuration-row>
</livechat-configuration-section-header>
<livechat-dynamic-table-form
.header=${tableHeaderList.commands}
.schema=${tableSchema.commands}

View File

@ -6,7 +6,7 @@ import { html } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import { LivechatElement } from './livechat'
@customElement('livechat-configuration-row')
@customElement('livechat-configuration-section-header')
export class ConfigurationRowElement extends LivechatElement {
@property({ attribute: false })
public override title: string = 'title'

View File

@ -197,6 +197,7 @@ export class DynamicTableFormElement extends LivechatElement {
this._updateLastRowId()
// Filter removed rows
// FIXME: seems buggy. Missing assignation?
this._rowsById.filter(rowById => this.rows.includes(rowById.row))
for (let i = 0; i < this.rows.length; i++) {

View File

@ -6,7 +6,7 @@
// Add here all your elements, the main JS file will import them all.
import './help-button'
import './dynamic-table-form'
import './configuration-row'
import './configuration-section-header'
import './tags-input'
import './image-file-input'
import './spinner'