Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## DMPTool Releases

### v5.48
- Update `template.customize?` method to allow any funder (instead of funder_only)
- Added bitwise documentation to the `Org` model to help with debugging

### v5.47
- Fix issue with ROR migration script
- Update all gem dependencies
Expand Down
68 changes: 34 additions & 34 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
airbrussh (1.5.3)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
airbrussh (1.6.0)
sshkit (>= 1.6.1, != 1.7.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
Expand All @@ -100,37 +100,37 @@ GEM
bundler (>= 1.1)
anyway_config (2.7.2)
ruby-next-core (~> 1.0)
api-pagination (6.0.0)
api-pagination (7.0.0)
ast (2.4.3)
autoprefixer-rails (10.4.21.0)
execjs (~> 2)
aws-eventstream (1.4.0)
aws-partitions (1.1183.0)
aws-sdk-core (3.237.0)
aws-partitions (1.1190.0)
aws-sdk-core (3.239.2)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.117.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-kms (1.118.0)
aws-sdk-core (~> 3, >= 3.239.1)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.203.1)
aws-sdk-s3 (1.206.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sdk-ssm (1.206.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-ssm (1.207.0)
aws-sdk-core (~> 3, >= 3.239.1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.3.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-arm64-darwin)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
bcrypt_pbkdf (1.1.2)
bcrypt_pbkdf (1.1.2-arm64-darwin)
bcrypt_pbkdf (1.1.2-x86_64-darwin)
benchmark (0.5.0)
better_errors (2.10.1)
erubi (>= 1.0.0)
Expand All @@ -152,17 +152,17 @@ GEM
bullet (8.1.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
bundle-audit (0.1.0)
bundle-audit (0.2.0)
bundler-audit
bundler-audit (0.9.2)
bundler (>= 1.2.0, < 3)
bundler-audit (0.9.3)
bundler (>= 1.2.0)
thor (~> 1.0)
capistrano (3.19.2)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (2.1.1)
capistrano-bundler (2.2.0)
capistrano (~> 3.1)
capistrano-git-with-submodules (2.0.6)
capistrano (~> 3.7)
Expand Down Expand Up @@ -198,7 +198,7 @@ GEM
coderay (1.1.3)
colored2 (3.1.2)
concurrent-ruby (1.3.5)
connection_pool (2.5.4)
connection_pool (3.0.2)
contact_us (1.2.0)
rails (>= 4.2.0)
cork (0.3.0)
Expand Down Expand Up @@ -252,9 +252,9 @@ GEM
diff-lcs (1.6.2)
doorkeeper (5.8.2)
railties (>= 5)
dotenv (3.1.8)
dotenv-rails (3.1.8)
dotenv (= 3.1.8)
dotenv (3.2.0)
dotenv-rails (3.2.0)
dotenv (= 3.2.0)
railties (>= 6.1)
dragonfly (1.4.1)
addressable (~> 2.3)
Expand All @@ -268,15 +268,15 @@ GEM
ed25519 (1.4.0)
erb (6.0.0)
erubi (1.13.1)
excon (1.3.1)
excon (1.3.2)
logger
execjs (2.10.0)
factory_bot (6.5.6)
activesupport (>= 6.1.0)
factory_bot_rails (6.5.1)
factory_bot (~> 6.5)
railties (>= 6.1.0)
faker (3.5.2)
faker (3.5.3)
i18n (>= 1.8.11, < 2)
faraday (2.14.0)
faraday-net_http (>= 2.0, < 3.5)
Expand Down Expand Up @@ -369,7 +369,7 @@ GEM
jmespath (1.6.2)
jsbundling-rails (1.3.1)
railties (>= 6.0.0)
json (2.16.0)
json (2.17.1)
json_schemer (2.4.0)
bigdecimal
hana (~> 1.3)
Expand Down Expand Up @@ -430,11 +430,11 @@ GEM
nokogiri (~> 1)
rake
mini_mime (1.1.5)
minitest (5.26.1)
minitest (5.26.2)
mocha (2.8.2)
ruby2_keywords (>= 0.0.5)
msgpack (1.8.0)
multi_json (1.17.0)
multi_json (1.18.0)
multi_xml (0.7.2)
bigdecimal (~> 3.1)
mysql2 (0.5.7)
Expand Down Expand Up @@ -502,7 +502,7 @@ GEM
omniauth-orcid (2.1.1)
omniauth-oauth2 (~> 1.3)
ruby_dig (~> 0.0.2)
omniauth-rails_csrf_protection (1.0.2)
omniauth-rails_csrf_protection (2.0.0)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth-shibboleth (1.3.0)
Expand Down Expand Up @@ -537,7 +537,7 @@ GEM
psych (5.2.6)
date
stringio
public_suffix (6.0.2)
public_suffix (7.0.0)
puma (7.1.0)
nio4r (~> 2.0)
pundit (2.5.2)
Expand Down Expand Up @@ -565,7 +565,7 @@ GEM
rack (>= 3.0.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rackup (2.3.1)
rack (>= 3)
rails (7.2.3)
actioncable (= 7.2.3)
Expand Down Expand Up @@ -608,7 +608,7 @@ GEM
rb-inotify (0.11.1)
ffi (~> 1.0)
rchardet (1.10.0)
rdoc (6.15.1)
rdoc (6.16.1)
erb
psych (>= 4.0.0)
tsort
Expand Down Expand Up @@ -663,7 +663,7 @@ GEM
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.34.0)
rubocop-rails (2.34.2)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
Expand Down Expand Up @@ -720,7 +720,7 @@ GEM
net-sftp (>= 2.1.2)
net-ssh (>= 2.8.0)
ostruct
stringio (3.1.8)
stringio (3.1.9)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
text (1.3.1)
Expand Down Expand Up @@ -771,7 +771,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.37)
yard (0.9.38)
yard-tomdoc (0.7.1)
tomparse (>= 0.4.0)
yard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TemplateCustomizationsController < ApplicationController
def create
@template = Template.find(params[:template_id])
authorize(@template, :customize?)

if @template.customize?(current_user.org)
begin
@customisation = @template.customize!(current_user.org)
Expand Down
21 changes: 21 additions & 0 deletions app/models/org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,27 @@ class Org < ApplicationRecord
column: 'org_type',
check_for_column: !Rails.env.test?

# -----------------------------------------------------
# Bitwise key
# -----------------------------------------------------
# 01 - institution
# 02 - funder
# 03 - institution + funder
# 04 - organisation
# 05 - institution + organisation
# 06 - funder + organisation
# 07 - institution + organisation + funder
# 08 - research_institute
# 09 - institution + research_institute
# 10 - funder + research_institute
# 11 - institution + funder + research_institute
# 12 - organisation + research_institute
# 13 - institution + organisation + research_institute
# 14 - funder + organisation + research_institute
# 15 - institution + funder + organisation + research_institute
# etc.


# The default Org is the one whose guidance is auto-attached to
# plans when a plan is created
def self.default_orgs
Expand Down
4 changes: 2 additions & 2 deletions app/models/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def generate_version?
# Determines whether or not a customization for the customizing_org passed
# should be generated
def customize?(customizing_org)
if customizing_org.is_a?(Org) && (org.funder_only? || is_default)
if customizing_org.is_a?(Org) && (org.funder? || is_default)
return !Template.unarchived.exists?(customization_of: family_id,
org: customizing_org)
end
Expand Down Expand Up @@ -485,7 +485,7 @@ def customize!(customizing_org)
raise ArgumentError, _('customize! requires an organisation target') unless customizing_org.is_a?(Org)

# Assume self has org associated
raise ArgumentError, _('customize! requires a template from a funder') if !org.funder_only? && !is_default
raise ArgumentError, _('customize! requires a template from a funder') if !org.funder? && !is_default

args = {
attributes: {
Expand Down
11 changes: 10 additions & 1 deletion public/tinymce/skins/oxide/content.inline.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion public/tinymce/skins/oxide/content.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/tinymce/skins/oxide/skin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/tinymce/skins/oxide/skin.shadowdom.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading