Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
494931c
updated PDF coversheet to always show the creator of the DMP
briri Oct 7, 2021
c86ad2b
Merge branch 'development' into pdf-coversheet-fix
johnpinto1 Oct 25, 2021
66b4866
minor fix for issue generating PDF when no options were specified
briri Oct 26, 2021
2d3fc80
Issue #2941 - Make the display of the phome number in the Plan
Nov 17, 2021
db783fc
Issue#dcc2983 - Fix for preventing adding a Contributor via Contributor
Nov 23, 2021
2c00cde
Issue#3069 - (DCC Issue 675) - Org Admin and Super Admin searches and
Dec 23, 2021
1173d60
Bug DCC Issues 592, 645 - Fix for Org Admins seeing deleted Plans for…
Jan 11, 2022
b2cded7
Issue DCC-674: Fix for broken CSV Download noticed because a nil
Jan 10, 2022
d5144d9
DCC Issue 679 - Fix for issue that Super Admins unable to create new
Jan 13, 2022
1512944
TEMP CHANGE FOR DCC 453 BUG
Jan 18, 2022
8df635f
DCC bug 453 - Unlike in previous version of the DMP Roadmap a API use…
Jan 19, 2022
b2eff34
DCC Bug 668 - Fix for issue of roles in a plan that does not have a
Jan 20, 2022
0ddec3d
updated PDF coversheet to always show the creator of the DMP
briri Oct 7, 2021
22c1d16
Merge branch 'pdf-coversheet-fix' of github.com:DMPRoadmap/roadmap in…
raycarrick-ed Jan 27, 2022
a4407e8
Merge pull request #3049 from DMPRoadmap/pdf-coversheet-fix
raycarrick-ed Jan 27, 2022
c9b2f8f
minor fix for issue generating PDF when no options were specified
briri Oct 26, 2021
3289408
Merge branch 'minor-bugs' of github.com:DMPRoadmap/roadmap into minor…
raycarrick-ed Jan 28, 2022
53012c3
update Gemfile.lock
raycarrick-ed Jan 31, 2022
816f127
updated PDF coversheet to always show the creator of the DMP
briri Oct 7, 2021
016701e
Merge branch 'development' of github.com:DMPRoadmap/roadmap into deve…
raycarrick-ed Jan 31, 2022
839cf31
Merge pull request #3101 from DMPRoadmap/update_dev
raycarrick-ed Jan 31, 2022
6adaf46
DCC Bug 668 - Fix for issue of roles in a plan that does not have a
Jan 20, 2022
476f00a
Merge branch 'bug_dcc_668-admin_not_able_to_see_plans' of github.com:…
raycarrick-ed Jan 31, 2022
fd2a453
Merge pull request #3095 from DMPRoadmap/bug_dcc_668-admin_not_able_t…
raycarrick-ed Jan 31, 2022
98b941b
TEMP CHANGE FOR DCC 453 BUG
Jan 18, 2022
5235099
DCC bug 453 - Unlike in previous version of the DMP Roadmap a API use…
Jan 19, 2022
f4ef640
Merge branch 'bug_dcc-453_api_not_providing_owner_email_anymore' of g…
raycarrick-ed Jan 31, 2022
147ea32
rubocop fixes
raycarrick-ed Jan 31, 2022
118ca72
Merge pull request #3094 from DMPRoadmap/bug_dcc-453_api_not_providin…
raycarrick-ed Jan 31, 2022
e7f7a10
Merge branch 'development' into minor-bugs
briri Jan 31, 2022
aa63017
Merge pull request #3054 from DMPRoadmap/minor-bugs
briri Jan 31, 2022
41a2791
Merge branch 'development' into Bug_2941-make-DMP-contributors-phone-…
briri Jan 31, 2022
7bca37c
Merge pull request #3067 from DMPRoadmap/Bug_2941-make-DMP-contributo…
briri Jan 31, 2022
7eb7398
Merge branch 'development' into bug_DCC2983-possible_to_add_contribut…
briri Jan 31, 2022
412868d
Merge branch 'development' into bug_dcc_592_and_645_deleted-private_p…
briri Jan 31, 2022
aa56797
Merge branch 'development' into bug-dcc-679-super-admins-unable-to-ad…
briri Jan 31, 2022
b419b18
DCC Issue 679 - Fix for issue that Super Admins unable to create new
Jan 13, 2022
fc6fcaa
Merge branch 'bug-dcc-679-super-admins-unable-to-add-new-organisation…
raycarrick-ed Feb 1, 2022
7e0f2e2
debugging
raycarrick-ed Feb 1, 2022
ce35995
undo debug - now working
raycarrick-ed Feb 1, 2022
60a88be
debugging failure
raycarrick-ed Feb 1, 2022
1be3a60
once more to debug
raycarrick-ed Feb 1, 2022
e2c4914
Remove prg has to have abbrev test
raycarrick-ed Feb 1, 2022
a053f9f
Merge pull request #3091 from DMPRoadmap/bug-dcc-679-super-admins-una…
raycarrick-ed Feb 1, 2022
1edafec
Bug DCC Issues 592, 645 - Fix for Org Admins seeing deleted Plans for…
Jan 11, 2022
a499b25
Merge branch 'bug_dcc_592_and_645_deleted-private_plans_visible_to_or…
raycarrick-ed Feb 1, 2022
7d9bd57
needs active role for org_admin_plans to work
raycarrick-ed Feb 1, 2022
001e52a
Merge pull request #3087 from DMPRoadmap/bug_dcc_592_and_645_deleted-…
raycarrick-ed Feb 1, 2022
230aa8d
fix merge conflict
raycarrick-ed Feb 1, 2022
b076ae6
Merge branch 'bug_dcc_674_csv_download_plans_fails_for_admins' of git…
raycarrick-ed Feb 1, 2022
6bcc6a2
rubocop fixes
raycarrick-ed Feb 1, 2022
08e862c
Merge pull request #3085 from DMPRoadmap/bug_dcc_674_csv_download_pla…
raycarrick-ed Feb 1, 2022
61e6d19
Issue#3069 - (DCC Issue 675) - Org Admin and Super Admin searches and
Dec 23, 2021
30d55ec
merge clashes
raycarrick-ed Feb 2, 2022
1c3b679
bad indenting and missing end
raycarrick-ed Feb 2, 2022
fb19b91
rubocop clean up
raycarrick-ed Feb 2, 2022
bcfec24
Merge pull request #3082 from DMPRoadmap/bug_3069_and_dcc_675_paged_r…
raycarrick-ed Feb 2, 2022
35fa595
Issue#dcc2983 - Fix for preventing adding a Contributor via Contributor
Nov 23, 2021
f236ce3
Merge branch 'bug_DCC2983-possible_to_add_contributor_without_a_name'…
raycarrick-ed Feb 2, 2022
d0f301b
clean up name_or_email_presence
raycarrick-ed Feb 2, 2022
b382292
Typo
raycarrick-ed Feb 2, 2022
f4920cf
rubocop
raycarrick-ed Feb 2, 2022
477b981
more rubcocop stuff
raycarrick-ed Feb 2, 2022
3df80e6
fix errors
raycarrick-ed Feb 2, 2022
ec68303
Merge pull request #3071 from DMPRoadmap/bug_DCC2983-possible_to_add_…
raycarrick-ed Feb 2, 2022
93c914f
fixed merge conflict in paginable/plans_controller.rb
briri Feb 2, 2022
d7a792f
Merge branch 'nicolasfranck-fix_issue_3069' into development
briri Feb 2, 2022
4970ddf
Merge branch 'development' of github.com:DMPRoadmap/roadmap into deve…
briri Feb 2, 2022
6238ca9
translation.io sync
raycarrick-ed Feb 10, 2022
2f068f8
DCC Bug #693 - Fix for pagination of plans retreived using the REST API
Feb 10, 2022
8c140f6
removed trailing 's' on sort_field placeholder in format command on p…
briri Feb 10, 2022
419ea19
Merge branch 'bug_dcc_693_EUR-API1-V0-Plans-Pagination' into development
briri Feb 10, 2022
0e2df4e
upgraded karma JS and bumped gem and JS dependencies
briri Feb 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 64 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.6)
actionpack (= 5.2.6)
actioncable (5.2.6.2)
actionpack (= 5.2.6.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
actionmailer (5.2.6.2)
actionpack (= 5.2.6.2)
actionview (= 5.2.6.2)
activejob (= 5.2.6.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
actionpack (5.2.6.2)
actionview (= 5.2.6.2)
activesupport (= 5.2.6.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.6)
activesupport (= 5.2.6)
actionview (5.2.6.2)
activesupport (= 5.2.6.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.6)
activesupport (= 5.2.6)
activejob (5.2.6.2)
activesupport (= 5.2.6.2)
globalid (>= 0.3.6)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
activemodel (5.2.6.2)
activesupport (= 5.2.6.2)
activerecord (5.2.6.2)
activemodel (= 5.2.6.2)
activesupport (= 5.2.6.2)
arel (>= 9.0)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
activestorage (5.2.6.2)
actionpack (= 5.2.6.2)
activerecord (= 5.2.6.2)
marcel (~> 1.0.0)
activesupport (5.2.6)
activesupport (5.2.6.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
annotate (3.1.1)
activerecord (>= 3.2, < 7.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
annotate_gem (0.0.14)
bundler (>= 1.1)
Expand All @@ -62,9 +62,9 @@ GEM
bindex (0.8.1)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.10.2)
bootsnap (1.10.3)
msgpack (~> 1.2)
brakeman (5.2.0)
brakeman (5.2.1)
builder (3.2.4)
bullet (7.0.1)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -131,7 +131,7 @@ GEM
dragonfly (~> 1.0)
fog-aws
erubi (1.10.0)
excon (0.90.0)
excon (0.91.0)
execjs (2.8.1)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -165,11 +165,10 @@ GEM
faraday-retry (1.0.3)
ffi (1.15.5)
flag_shih_tzu (0.3.23)
fog-aws (3.12.0)
fog-aws (3.13.0)
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-core (2.2.4)
builder
excon (~> 0.71)
Expand Down Expand Up @@ -218,9 +217,8 @@ GEM
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.8.11)
i18n (1.9.1)
concurrent-ruby (~> 1.0)
ipaddress (0.8.3)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
Expand All @@ -246,7 +244,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
locale (2.1.3)
loofah (2.13.0)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.8)
Expand Down Expand Up @@ -296,7 +294,7 @@ GEM
omniauth-orcid (2.1.1)
omniauth-oauth2 (~> 1.3)
ruby_dig (~> 0.0.2)
omniauth-rails_csrf_protection (1.0.0)
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth-shibboleth (1.3.0)
Expand All @@ -306,7 +304,7 @@ GEM
parallel (1.21.0)
parser (3.1.0.0)
ast (~> 2.4.1)
pg (1.3.0)
pg (1.3.2)
prime (0.1.2)
forwardable
singleton
Expand All @@ -317,9 +315,9 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
puma (5.6.0)
puma (5.6.2)
nio4r (~> 2.0)
pundit (2.1.1)
pundit (2.2.0)
activesupport (>= 3.0.0)
pundit-matchers (1.7.0)
rspec-rails (>= 3.0.0)
Expand All @@ -333,18 +331,18 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
rails (5.2.6.2)
actioncable (= 5.2.6.2)
actionmailer (= 5.2.6.2)
actionpack (= 5.2.6.2)
actionview (= 5.2.6.2)
activejob (= 5.2.6.2)
activemodel (= 5.2.6.2)
activerecord (= 5.2.6.2)
activestorage (= 5.2.6.2)
activesupport (= 5.2.6.2)
bundler (>= 1.3.0)
railties (= 5.2.6)
railties (= 5.2.6.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -355,39 +353,39 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
railties (5.2.6.2)
actionpack (= 5.2.6.2)
activesupport (= 5.2.6.2)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
recaptcha (5.8.1)
json
regexp_parser (2.2.0)
regexp_parser (2.2.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
rollbar (3.3.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.2)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (~> 3.11.0)
rspec-rails (5.1.0)
actionpack (>= 5.2)
activesupport (>= 5.2)
Expand All @@ -396,8 +394,8 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.3)
rubocop (1.25.0)
rspec-support (3.11.0)
rubocop (1.25.1)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -406,7 +404,7 @@ GEM
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
rubocop-ast (1.15.2)
parser (>= 3.0.1.1)
rubocop-i18n (3.0.0)
rubocop (~> 1.0)
Expand Down Expand Up @@ -467,7 +465,7 @@ GEM
thread_safe (0.3.6)
tilt (2.0.10)
tomparse (0.4.2)
translation (1.28)
translation (1.29)
gettext (~> 3.2, >= 3.2.5, <= 3.4.2)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/v0/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def index
plural_resource_name = "@#{resource_name.pluralize}"
resources = resource_class.where(query_params)
.page(page_params[:page])
.per(page_params[:page_size])
.per(page_params[:per_page])

instance_variable_set(plural_resource_name, resources)
respond_with instance_variable_get(plural_resource_name)
Expand Down Expand Up @@ -71,7 +71,7 @@ def query_params
#
# Returns Hash
def page_params
params.permit(:page, :page_size)
params.permit(:page, :per_page)
end

# The resource class based on the controller
Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/v0/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class PlansController < Api::V0::BaseController
include Paginable

before_action :authenticate
before_action :page_params, except: %i[heartbeat]

##
# Creates a new plan based on the information passed in JSON to the API
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/concerns/paginable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def refine_query(scope)
if @args[:page] != 'ALL'
# Can raise error if page is not a number
scope = scope.page(@args[:page])
.per(@args.fetch(:per_page, Rails.configuration.x.application.api_max_page_size))
end
scope
end
Expand All @@ -179,7 +180,7 @@ def sort_link_name(sort_field)
style="float: right; font-size: 1.2em;">

<span class="screen-reader-text">
#{format(_('Sort by %<sort_field>s'), sort_field: sort_field.split('.').first)}
#{format(_('Sort by %<sort_field>'), sort_field: sort_field.split('.').first)}
</span>
</i>
HTML
Expand Down
9 changes: 5 additions & 4 deletions app/controllers/paginable/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ def org_admin
end
# rubocop:enable Metrics/AbcSize

# GET /paginable/plans/org_admin/:page
def org_admin_other_user
# GET /paginable/users/:id/plans
def index
@user = User.find(params[:id])
authorize @user
raise Pundit::NotAuthorizedError unless current_user.present? && current_user.can_org_admin? && @user.present?

paginable_renderise(
partial: 'org_admin_other_user',
partial: 'index',
scope: Plan.active(@user),
query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
query_params: { sort_field: 'plans.updated_at', sort_direction: :desc },
format: :json
)
end
end
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/super_admin/orgs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def org_params
params.require(:org).permit(:name, :abbreviation, :logo, :managed,
:contact_email, :contact_name,
:remove_logo, :feedback_enabled, :feedback_msg,
:org_id, :org_name, :org_crosswalk)
:org_id, :org_name, :org_crosswalk,
:funder, :institution, :organisation)
end

def merge_params
Expand Down
11 changes: 5 additions & 6 deletions app/models/concerns/exportable_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ def prepare(user, coversheet = false)
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def prepare_coversheet
hash = {}
# name of owner and any co-owners
attribution = owner.present? ? [owner.name(false)] : []
roles.administrator.not_creator.each do |role|
attribution << role.user.name(false)
end
# Use the name of the DMP owner/creator OR the first Co-owner if there is no
# owner for some reason
attribution = roles.creator.first&.user&.name(false)
roles.administrator.not_creator.first&.user&.name(false) unless attribution.present?
hash[:attribution] = attribution

# Org name of plan owner's org
Expand Down Expand Up @@ -175,7 +174,7 @@ def show_section_for_csv(csv, phase, section, headings, unanswered, hash)
answer_text = ''
if answer.present?
answer_text += answer.question_options.pluck(:text).join(', ') if answer.question_options.any?
answer_text += answer.text if answer.answered?
answer_text += answer.text if answer.answered? && answer.text.present?
elsif unanswered
answer_text += _('Not Answered')
end
Expand Down
16 changes: 13 additions & 3 deletions app/models/contributor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,20 @@ def merge(other)

private

# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
def name_or_email_presence
return true unless name.blank? && email.blank?
errors.add(:name, _("can't be blank.")) if name.blank? && Rails.configuration.x.application.require_contributor_name
if email.blank? && Rails.configuration.x.application.require_contributor_email
errors.add(:email,
_("can't be blank."))
end

if name.blank? && email.blank? && errors.size.zero?
errors.add(:name, _("can't be blank if no email is provided."))
errors.add(:email, _("can't be blank if no name is provided."))
end

errors.add(:name, _("can't be blank if no email is provided"))
errors.add(:email, _("can't be blank if no name is provided"))
errors.size.zero?
end
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
end
Loading