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; margin-top: 3rem;
} }

View File

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

View File

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

View File

@ -197,6 +197,7 @@ export class DynamicTableFormElement extends LivechatElement {
this._updateLastRowId() this._updateLastRowId()
// Filter removed rows // Filter removed rows
// FIXME: seems buggy. Missing assignation?
this._rowsById.filter(rowById => this.rows.includes(rowById.row)) this._rowsById.filter(rowById => this.rows.includes(rowById.row))
for (let i = 0; i < this.rows.length; i++) { 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. // Add here all your elements, the main JS file will import them all.
import './help-button' import './help-button'
import './dynamic-table-form' import './dynamic-table-form'
import './configuration-row' import './configuration-section-header'
import './tags-input' import './tags-input'
import './image-file-input' import './image-file-input'
import './spinner' import './spinner'