Skip to content

Commit 043c3f5

Browse files
Merge branch 'development' into webpacker_migration
2 parents 7f72e6a + 68ac8a7 commit 043c3f5

9 files changed

Lines changed: 36 additions & 13 deletions

File tree

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ insert_final_newline = true
1111

1212
# Matches multiple files with brace expansion notation
1313
# Set default charset
14-
[*.{js,rb,erb}]
14+
[*.{js,scss,rb,erb}]
1515
charset = utf-8
1616
indent_style = space
17-
indent_size = 2
17+
indent_size = 2

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# Changelog
22

3-
### Added
3+
### 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)
7+
- Added popover for org profile page and added explanation for public plan
78
### Fixed
89

10+
- Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated.
11+
912
### Changed
1013

14+
- Added scss files to EditorConfig
15+
- Change csv file name for statistics from 'Completed' to 'Created'
16+
1117
#### Removed webpacker gem
1218

1319
As Webpacker is no longer maintained by the Rails community, we have replaced it by `jsbundling-rails` and `cssbundling-rails` for the Javascript & CSS compilation.

app/controllers/usage_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ def yearly_plans
8484
plan_data(args: default_query_args)
8585
sep = sep_param
8686
send_data(CSV.generate(col_sep: sep) do |csv|
87-
csv << [_('Month'), _('No. Completed Plans')]
87+
csv << [_('Month'), _('No. Created Plans')]
8888
total = 0
8989
@plans_per_month.each do |data|
9090
csv << [data.date.strftime('%b-%y'), data.count]
9191
total += data.count
9292
end
9393
csv << [_('Total'), total]
94-
end, filename: 'completed_plans.csv')
94+
end, filename: 'created_plans.csv')
9595
end
9696
# rubocop:enable Metrics/AbcSize
9797

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

app/views/orgs/_profile_form.html.erb

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<%
44
shared_links_tooltip = _('Links will be displayed next to your organisation\'s logo')
55
org_config_info_tooltip = _('This information can only be changed by a system administrator. Contact the Help Desk if you have questions or to request changes.')
6+
org_types_tooltip = _(
7+
'This information can only be changed by a system administrator. Contact %{support_email} if you have questions or to request changes.' % { support_email: Rails.configuration.x.organisation.email}
8+
)
69
%>
710

811
<%= form_for(org, url: url, html: { multipart: true, method: method,
@@ -136,7 +139,13 @@
136139
<div class="row">
137140
<% if current_user.can_super_admin? %>
138141
<fieldset class="col-xs-8">
139-
<legend><%= _('Organisation Types') %></legend>
142+
<legend>
143+
<%= _('Organisation Types') %>
144+
&nbsp; <a href="#" aria-label="<%= _('Text') %>" data-toggle="tooltip" data-placement="right" title="<%= org_types_tooltip %>">
145+
<i class="fas fa-question-circle fa-reverse" ></i>
146+
<em class="sr-only"></em>
147+
</a>
148+
</legend>
140149
<div class="checkbox">
141150
<%= f.label :funder do %>
142151
<%= f.check_box :funder, { class: 'org_types', value: org.funder? }, "true", "false" %>
@@ -159,7 +168,13 @@
159168
<% else %>
160169
<div class="col-xs-8">
161170
<dl>
162-
<dt><%= _('Organisation type(s)') %></dt>
171+
<dt>
172+
<%= _('Organisation type(s)') %>
173+
&nbsp; <a href="#" aria-label="<%= _('Text') %>" data-toggle="tooltip" data-placement="right" title="<%= org_types_tooltip %>">
174+
<i class="fas fa-question-circle fa-reverse" ></i>
175+
<em class="sr-only"></em>
176+
</a>
177+
</dt>
163178
<dd><%= org.org_type_to_s %></dd>
164179
</dl>
165180
</div>

app/views/plans/_share_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<%= f.radio_button :visibility, :publicly_visible,
3535
data: { url: visibility_plan_path(@plan),
3636
remote: true, method: :post } %>
37-
<%= _('Public: anyone can view') %>
37+
<%= _('Public: anyone can view or download from the Public DMPs page') %>
3838
<% end %>
3939
</div>
4040
</div>

spec/controllers/usage_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
get :yearly_plans
9393
end
9494
it 'assigns the correct csv data' do
95-
expected = "Month,No. Completed Plans\n" \
95+
expected = "Month,No. Created Plans\n" \
9696
"#{@date.strftime('%b-%y')},#{@plan_stat.count}\n" \
9797
"Total,#{@plan_stat.count}\n"
9898
expect(response.content_type).to eq('text/csv')

0 commit comments

Comments
 (0)