Raise character limit for rich text fields and reword limit text error [SCI-7959] (#5221)

This commit is contained in:
ajugo 2023-04-05 15:34:48 +02:00 committed by GitHub
parent 80b25f695e
commit 3ad1d384ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 12 deletions

View file

@ -83,7 +83,6 @@
var data = xhr.responseJSON;
var $el;
$form.renderFormErrors('result', data);
TinyMCE.highlight();
if (data['result_text.text']) {
$el = $form.find(
'textarea[name=result\\[result_text_attributes\\]\\[text\\]]'

View file

@ -76,7 +76,7 @@
:objectId="parseInt(protocol.id)"
:fieldName="'protocol[description]'"
:lastUpdated="protocol.attributes.updated_at"
:characterLimit="100000"
:characterLimit="1000000"
@update="updateDescription"
/>
</div>

View file

@ -26,7 +26,7 @@
:objectId="element.attributes.orderable.id"
:fieldName="'step_text[text]'"
:lastUpdated="element.attributes.orderable.updated_at"
:characterLimit="100000"
:characterLimit="1000000"
@update="update"
@editingDisabled="disableEditMode"
@editingEnabled="enableEditMode"

View file

@ -101,14 +101,8 @@
error() {
if(this.characterLimit && this.characterCount > this.characterLimit) {
return(
this.i18n.t(
'inline_edit.errors.over_limit',
{
attribute: this.i18n.t('general.text.name'),
limit: this.numberWithSpaces(this.characterLimit)
}
)
)
this.i18n.t('errors.general_text_too_long')
);
}
return false

View file

@ -18,7 +18,7 @@ class Constants
# Max characters for long text fields
TEXT_MAX_LENGTH = 10000
# Max characters for rich text fields (in html format)
RICH_TEXT_MAX_LENGTH = 100000
RICH_TEXT_MAX_LENGTH = 1000000
# Max characters for color field (given in HEX format)
COLOR_MAX_LENGTH = 7
# Max characters for text in dropdown list element

View file

@ -158,16 +158,22 @@ en:
invalid: "Invalid step order."
name:
taken: "This protocol template name has to be unique inside a team (this includes the archive)."
description:
too_long: 'Text is too long'
step:
attributes:
step_orderable_element_order:
invalid: "Invalid step element order"
description:
too_long: 'Text is too long'
my_module:
attributes:
my_module_status_id:
not_correct_order: "Status can be changed only on next or previous status."
position:
not_unique: "X and Y position has already been taken by another task in the experiment."
description:
too_long: 'Text is too long'
my_module_status:
attributes:
next_status:
@ -211,12 +217,24 @@ en:
disabled: 'Webhooks are disabled'
url:
not_valid: 'Not valid URL'
result_text:
attributes:
text:
too_long: 'Text is too long'
step_text:
attributes:
text:
too_long: 'Text is too long'
system_notification:
attributes:
modal_body: 'Text is too long'
connection:
attributes:
output_id:
creates_cycle: "mustn't create cycle"
errors:
general: "Something went wrong."
general_text_too_long: 'Text is too long'
storage:
limit_reached: "Storage limit has been reached."
helpers: