Terms&Conditions (#18):
* new settings for instance's terms * new channel option for channel's terms
This commit is contained in:
@ -672,6 +672,7 @@ export class DynamicTableFormElement extends LivechatElement {
|
||||
const validationErrorTypes: ValidationErrorType[] | undefined =
|
||||
this.validation?.[`${this.validationPrefix}.${originalIndex}.${propertyName}`]
|
||||
|
||||
// FIXME: this code is duplicated in channel-configuration
|
||||
if (validationErrorTypes !== undefined && validationErrorTypes.length !== 0) {
|
||||
if (validationErrorTypes.includes(ValidationErrorType.Missing)) {
|
||||
errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_MISSING)}`)
|
||||
@ -688,6 +689,9 @@ export class DynamicTableFormElement extends LivechatElement {
|
||||
if (validationErrorTypes.includes(ValidationErrorType.Duplicate)) {
|
||||
errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_DUPLICATE)}`)
|
||||
}
|
||||
if (validationErrorTypes.includes(ValidationErrorType.TooLong)) {
|
||||
errorMessages.push(html`${ptTr(LOC_INVALID_VALUE_TOO_LONG)}`)
|
||||
}
|
||||
|
||||
return html`<div id="${inputId}-feedback" class="invalid-feedback">${errorMessages}</div>`
|
||||
} else {
|
||||
|
@ -7,7 +7,8 @@ export enum ValidationErrorType {
|
||||
WrongType,
|
||||
WrongFormat,
|
||||
NotInRange,
|
||||
Duplicate
|
||||
Duplicate,
|
||||
TooLong
|
||||
}
|
||||
|
||||
export class ValidationError extends Error {
|
||||
|
Reference in New Issue
Block a user