Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge "integration" into deployment-portage #712

Merged
merged 21 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
13cabd4
Bump mysql2 from 0.5.5 to 0.5.6
dependabot[bot] Feb 9, 2024
38ff09e
Update CHANGELOG.md
aaronskiba Feb 12, 2024
e31c87c
Merge pull request #645 from portagenetwork/dependabot/bundler/deploy…
aaronskiba Feb 12, 2024
ed35c13
Edit Webmock allowed requests to get chromedriver
aaronskiba Feb 20, 2024
2254bb9
Update CHANGELOG.md
aaronskiba Feb 20, 2024
466d57a
Merge pull request #670 from portagenetwork/aaron/issues/669
aaronskiba Feb 21, 2024
630d882
Add terms & conditions checkbox to invitation form
aaronskiba Mar 5, 2024
1cbf600
Only submit invitation form if terms are accepted
aaronskiba Mar 5, 2024
de1e238
Update CHANGELOG.md
aaronskiba Mar 5, 2024
915e0f6
Edit 'rollbar' settings in Gemfile
aaronskiba Mar 7, 2024
8e4ba6f
Update CHANGELOG.md
aaronskiba Mar 7, 2024
0687420
Merge pull request #687 from portagenetwork/aaron/issues/686
aaronskiba Apr 8, 2024
d127444
Fix title sorting within template dropdown
aaronskiba Mar 27, 2024
039a398
Make rubocop happy
aaronskiba Mar 28, 2024
4b49e95
Code cleanup
aaronskiba Mar 27, 2024
d3da6de
Update CHANGELOG.md
aaronskiba Mar 27, 2024
0cc44e4
Put back `@templates` assignment
aaronskiba Apr 8, 2024
280d8f6
Merge pull request #706 from portagenetwork/aaron/issues/685
aaronskiba Apr 8, 2024
c0e2cb1
Merge pull request #684 from portagenetwork/aaron/issues/665
aaronskiba Apr 8, 2024
407c6ae
Merge branch 'deployment-portage' into integration
aaronskiba Apr 9, 2024
21588f7
Merge pull request #713 from portagenetwork/aaron/update-integration
aaronskiba Apr 9, 2024
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [Unreleased]

### Added

- Bump mysql2 from 0.5.5 to 0.5.6 [#645](https://github.com/portagenetwork/roadmap/pull/645)

- Added "Accept terms and conditions" checkbox to invitation form [#684](https://github.com/portagenetwork/roadmap/pull/684)

### Fixed

- Updated Webmock's allowed request list to enable fetching of chromedriver [#670](https://github.com/portagenetwork/roadmap/pull/670)

- Edit Gemfile config for 'rollbar' to enable app tracking on rollbar.com [#687](https://github.com/portagenetwork/roadmap/pull/687)

- Fxed ordering of templates within the "Create a new plan" template dropdown [#706](https://github.com/portagenetwork/roadmap/pull/706)

## [4.0.2+portage-4.0.2] - 2024-03-04

### Added
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ gem 'bootsnap', require: false
# Rollbar-gem is the SDK for Ruby apps and includes support for apps using
# Rails, Sinatra, Rack, plain Ruby, and other frameworks.
# https://github.com/rollbar/rollbar-gem
gem 'rollbar', group: :rollbar, require: false
gem 'rollbar'

# ======== #
# DATABASE #
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ GEM
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.6.0)
mysql2 (0.5.5)
mysql2 (0.5.6)
nap (1.1.0)
nenv (0.3.0)
nio4r (2.7.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def from_external_domain?
end

def configure_permitted_parameters
devise_parameter_sanitizer.permit(:accept_invitation, keys: %i[firstname surname org_id])
devise_parameter_sanitizer.permit(:accept_invitation, keys: %i[firstname surname org_id accept_terms])
end

def render_not_found(exception)
Expand Down
9 changes: 4 additions & 5 deletions app/controllers/template_options_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@ def index

org = org_from_params(params_in: { org_id: org_hash.to_json }) if org_hash.present?
funder = Org.find_by(name: Rails.application.config.default_funder_name)
# funder = org_from_params(params_in: { org_id: funder_hash.to_json }) if funder_hash.present?

@templates = []

return unless (org.present? && !org.new_record?) || (funder.present? && !funder.new_record?)
return unless funder.present? && !funder.new_record?

if org.present? && !org.new_record?
# Load the funder's template(s) minus the default template (that gets swapped
# in below if NO other templates are available)
@templates = Template.latest_customizable.where(org_id: funder.id, is_default: false).to_a
@templates = Template.latest_customizable.where(org_id: funder.id, is_default: false).sort_by(&:title).to_a
# Swap out any organisational cusotmizations of a funder template
@templates = @templates.map do |tmplt|
customization = Template.published
Expand All @@ -47,7 +45,8 @@ def index
# If the no funder was specified OR the funder matches the org
# if funder.blank? || funder.id == org&.id
# Retrieve the Org's templates
@templates << Template.published.organisationally_visible.where(org_id: org.id, customization_of: nil).to_a
@templates << Template.published.organisationally_visible.where(org_id: org.id,
customization_of: nil).sort_by(&:title).to_a
@templates = @templates.flatten.uniq
else
# if'No Primary Research Institution' checkbox is checked,
Expand All @@ -65,7 +64,7 @@ def index
# We want the default template to appear at the beggining of the list
@templates.unshift(customization)
end
@templates = @templates.uniq.sort_by(&:title)
@templates = @templates.uniq
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
Expand Down
9 changes: 9 additions & 0 deletions app/views/devise/invitations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
required: true
} %>
</div>
<div class="form-group">
<div class="checkbox">
<%= f.label(:accept_terms) do %>
<%= f.check_box(:accept_terms, "aria-required": true, required: true) %>
<%= _('I accept the') %>
<%= link_to _('terms and conditions'), terms_of_use_path %>
<% end %>
</div>
</div>
<%= f.button(_('Create account'), class: "btn btn-default", type: "submit") %>
<% end %>
</div>
Expand Down
3 changes: 1 addition & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@

# Allow Capybara to make localhost requests and also contact the
# google api chromedriver store
# add googlechromelabs.github.io and edgedl.me.gvt1.com to work with Chrome v116+
WebMock.disable_net_connect!(
allow_localhost: true,
allow: %w[chromedriver.storage.googleapis.com googlechromelabs.github.io edgedl.me.gvt1.com]
allow: %w[storage.googleapis.com googlechromelabs.github.io]
)
end

Expand Down
Loading