diff --git a/CHANGELOG.md b/CHANGELOG.md index 39f1ca7e..b6cdafa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ ### New features -* #233: new option to [mute anonymous users](https://livingston.frama.io/peertube-plugin-livechat/fr/documentation/user/streamers/moderation/). +* #233: new option to [mute anonymous users](https://livingston.frama.io/peertube-plugin-livechat/documentation/user/streamers/moderation/). +* #18: terms & conditions. You can configure terms&conditions on your instance that will be shown to each joining users. Streamers can also add [terms&conditions in their channels options](https://livingston.frama.io/peertube-plugin-livechat/documentation/user/streamers/terms/). + +### Minor changes and fixes + +* Fix #449: Remove the constraint for custom emojis shortnames to have ":" at the beginning and at the end. ## 10.1.2 @@ -51,7 +56,7 @@ ### New features -* #177: streamer's task/to-do lists: streamers, and their room's moderators, can handle task lists directly. This can be used to handle viewers questions, moderation actions, ... More info in the [tasks documentation](https://livingston.frama.io/peertube-plugin-livechat/fr/documentation/user/streamers/tasks/). +* #177: streamer's task/to-do lists: streamers, and their room's moderators, can handle task lists directly. This can be used to handle viewers questions, moderation actions, ... More info in the [tasks documentation](https://livingston.frama.io/peertube-plugin-livechat/documentation/user/streamers/tasks/). * #385: new way of managing chat access rights. Now streamers are owner of their chat rooms. Peertube admins/moderators are not by default, so that their identities are not leaking. But they have a button to promote as chat room owner, if they need to take action. Please note that there is a migration script that will remove all Peertube admins/moderators affiliations (unless they are video/channel's owner). They can get this access back using the button. * #385: the slow mode duration on the channel option page is now a default value for new rooms. Streamers can change the value room per room in the room's configuration. diff --git a/client/@types/global.d.ts b/client/@types/global.d.ts index d398383c..1398da00 100644 --- a/client/@types/global.d.ts +++ b/client/@types/global.d.ts @@ -83,6 +83,8 @@ declare const LOC_LIVECHAT_CONFIGURATION_CHANNEL_BOT_NICKNAME: string declare const LOC_LIVECHAT_CONFIGURATION_CHANNEL_FOR_MORE_INFO: string declare const LOC_LIVECHAT_CONFIGURATION_CHANNEL_MUTE_ANONYMOUS_LABEL: string declare const LOC_LIVECHAT_CONFIGURATION_CHANNEL_MUTE_ANONYMOUS_DESC: string +declare const LOC_LIVECHAT_CONFIGURATION_CHANNEL_TERMS_LABEL: string +declare const LOC_LIVECHAT_CONFIGURATION_CHANNEL_TERMS_DESC: string declare const LOC_VALIDATION_ERROR: string declare const LOC_TOO_MANY_ENTRIES: string @@ -93,6 +95,7 @@ declare const LOC_INVALID_VALUE_WRONG_FORMAT: string declare const LOC_INVALID_VALUE_NOT_IN_RANGE: string declare const LOC_INVALID_VALUE_FILE_TOO_BIG: string declare const LOC_INVALID_VALUE_DUPLICATE: string +declare const LOC_INVALID_VALUE_TOO_LONG: string declare const LOC_CHATROOM_NOT_ACCESSIBLE: string diff --git a/client/common/configuration/elements/channel-configuration.ts b/client/common/configuration/elements/channel-configuration.ts index a5e5bb14..7e6edd66 100644 --- a/client/common/configuration/elements/channel-configuration.ts +++ b/client/common/configuration/elements/channel-configuration.ts @@ -14,6 +14,7 @@ import { customElement, property, state } from 'lit/decorators.js' import { ptTr } from '../../lib/directives/translation' import { Task } from '@lit/task' import { provide } from '@lit/context' +import { channelTermsMaxLength } from 'shared/lib/constants' @customElement('livechat-channel-configuration') export class ChannelConfigurationElement extends LivechatElement { @@ -51,6 +52,10 @@ export class ChannelConfigurationElement extends LivechatElement { }) } + public termsMaxLength (): number { + return channelTermsMaxLength + } + /** * Resets the form by reloading data from backend. */ @@ -120,7 +125,11 @@ export class ChannelConfigurationElement extends LivechatElement { const validationErrorTypes: ValidationErrorType[] | undefined = this.validationError?.properties[`${propertyName}`] ?? undefined + // FIXME: this code is duplicated in dymamic table form if (validationErrorTypes && validationErrorTypes.length !== 0) { + if (validationErrorTypes.includes(ValidationErrorType.Missing)) { + errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_MISSING)}`) + } if (validationErrorTypes.includes(ValidationErrorType.WrongType)) { errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_WRONG_TYPE)}`) } @@ -130,6 +139,9 @@ export class ChannelConfigurationElement extends LivechatElement { if (validationErrorTypes.includes(ValidationErrorType.NotInRange)) { errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_NOT_IN_RANGE)}`) } + if (validationErrorTypes.includes(ValidationErrorType.TooLong)) { + errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_TOO_LONG)}`) + } return html`