diff --git a/app/assets/javascripts/results/result_texts.js b/app/assets/javascripts/results/result_texts.js index 55df6bb43..814d48b41 100644 --- a/app/assets/javascripts/results/result_texts.js +++ b/app/assets/javascripts/results/result_texts.js @@ -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\\]]' diff --git a/app/javascript/vue/protocol/container.vue b/app/javascript/vue/protocol/container.vue index 1259a32b9..a1aba2a7a 100644 --- a/app/javascript/vue/protocol/container.vue +++ b/app/javascript/vue/protocol/container.vue @@ -76,7 +76,7 @@ :objectId="parseInt(protocol.id)" :fieldName="'protocol[description]'" :lastUpdated="protocol.attributes.updated_at" - :characterLimit="100000" + :characterLimit="1000000" @update="updateDescription" /> diff --git a/app/javascript/vue/protocol/step_elements/text.vue b/app/javascript/vue/protocol/step_elements/text.vue index 6d2357f50..a6216d47d 100644 --- a/app/javascript/vue/protocol/step_elements/text.vue +++ b/app/javascript/vue/protocol/step_elements/text.vue @@ -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" diff --git a/app/javascript/vue/shared/tinymce.vue b/app/javascript/vue/shared/tinymce.vue index 8640fc092..890d97bd9 100644 --- a/app/javascript/vue/shared/tinymce.vue +++ b/app/javascript/vue/shared/tinymce.vue @@ -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 diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index e4306993a..a31ba97ff 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 95dbdda2a..9fca81cf0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: