Skip to content

Commit dfe09ee

Browse files
Merge branch 'development' into research-outputs-csv
2 parents f089114 + afe989e commit dfe09ee

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
### Added
44

55
- Added CHANGELOG.md and Danger Github Action [#3257](https://github.com/DMPRoadmap/roadmap/issues/3257)
6-
6+
- Added validation with custom error message in research_output.rb to ensure a user does not enter a very large value as 'Anticipated file size'. [#3161] (https://github.com/DMPRoadmap/roadmap/issues/3161)
77
### Fixed
88

99
- Updated the CSV export so that it now includes research outputs
10+
- Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated.
1011

1112
### Changed

app/javascript/src/answers/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ $(() => {
180180
} else {
181181
// Sets the editor mode for each editor to readonly
182182
Tinymce.findEditorsByClassName(editorClass).forEach((editor) => {
183-
editor.setMode('readonly');
183+
editor.mode.set('readonly');
184184
});
185185
}
186186

app/javascript/src/orgs/adminEdit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ $(() => {
1010
const editor = Tinymce.findEditorById('org_feedback_msg');
1111
if (isObject(editor)) {
1212
if ($('#org_feedback_enabled_true').is(':checked')) {
13-
editor.setMode('code');
13+
editor.mode.set('design');
1414
} else {
15-
editor.setMode('readonly');
15+
editor.mode.set('readonly');
1616
}
1717
}
1818
};

app/models/research_output.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class ResearchOutput < ApplicationRecord
6464
allow_nil: true, allow_blank: true,
6565
message: UNIQUENESS_MESSAGE }
6666

67+
validates_numericality_of :byte_size, greater_than: 0, less_than_or_equal_to: 2**63,
68+
message: '(Anticipated file size) is too large. Please enter a smaller value.'
6769
# Ensure presence of the :output_type_description if the user selected 'other'
6870
validates_presence_of :output_type_description, if: -> { other? }, message: PRESENCE_MESSAGE
6971

0 commit comments

Comments
 (0)