Refactoring.
This commit is contained in:
parent
a4a9f85956
commit
268c60d699
@ -473,6 +473,6 @@ livechat-image-file-input {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
livechat-configuration-row {
|
livechat-configuration-section-header {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
|
@ -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}
|
||||||
|
@ -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'
|
@ -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++) {
|
||||||
|
@ -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'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user