Skip to content

Commit

Permalink
Merge pull request #214 from OPIDoR/dmpopidor-dev
Browse files Browse the repository at this point in the history
Merge dmpopidor-dev
  • Loading branch information
benjaminfaure authored May 9, 2022
2 parents eef511d + 0b45f21 commit 12c860a
Show file tree
Hide file tree
Showing 15 changed files with 484 additions and 441 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

**Attention** Cette liste de changements concerne les déploiements sur nos serveurs de test en interne.

## 04/05/2022
- Ajout d'un message concernant les contributeurs lorsque l'on utilise l'import RDA
- Correction du problème de création de ResourceReference présent dans EthicalIssues lors de l'import RDA (issue gitbucket 372)
- Export RDA : `ethical_issues_exist` prend la valeur Oui/Yes lorsqu'au moins un produit de recherche est concerné
- Liste des plans Administrateur : Retrait des plans privé, tous les plans affichés devraient être accessibles (issue gitbucket 362)

## 28/04/2022
- Retrait de la possibilité de création de nouvel organisme depuis le formulaire de création de compte par invitation (issue gitbucket 377)
- La personne contact est désormais bien copiée lors de la copie d'un plan créé à partir d'un modèle classique (issue gitbucket 361)
Expand Down
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GEM
api-pagination (4.8.2)
arel (9.0.0)
ast (2.4.2)
autoprefixer-rails (10.4.2.0)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
bcrypt (3.1.17)
better_errors (2.9.1)
Expand All @@ -64,7 +64,7 @@ GEM
debug_inspector (>= 0.0.1)
bootsnap (1.11.1)
msgpack (~> 1.2)
brakeman (5.2.2)
brakeman (5.2.3)
builder (3.2.4)
bullet (7.0.1)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -133,7 +133,7 @@ GEM
ecma-re-validator (0.4.0)
regexp_parser (~> 2.2)
erubi (1.10.0)
excon (0.92.2)
excon (0.92.3)
execjs (2.8.1)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
Expand All @@ -142,7 +142,7 @@ GEM
railties (>= 5.0.0)
faker (2.20.0)
i18n (>= 1.8.11, < 2)
faraday (2.2.0)
faraday (2.3.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.2)
Expand Down Expand Up @@ -207,7 +207,7 @@ GEM
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.6.1)
json_schemer (0.2.20)
json_schemer (0.2.21)
ecma-re-validator (~> 0.3)
hana (~> 1.3)
regexp_parser (~> 2.0)
Expand Down Expand Up @@ -235,7 +235,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
locale (2.1.3)
loofah (2.16.0)
loofah (2.17.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.8)
Expand All @@ -257,13 +257,13 @@ GEM
msgpack (1.5.1)
multi_json (1.15.0)
multi_xml (0.6.0)
mysql2 (0.5.3)
mysql2 (0.5.4)
nenv (0.3.0)
nio4r (2.5.8)
nokogiri (1.13.4)
nokogiri (1.13.6)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.4-x86_64-linux)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -387,12 +387,12 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.28.2)
rubocop (1.29.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.17.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
Expand Down Expand Up @@ -491,7 +491,7 @@ GEM
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
wicked_pdf (2.6.0)
wicked_pdf (2.6.2)
activesupport
wkhtmltopdf-binary (0.12.6.5)
xpath (3.2.0)
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/dmpopidor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,10 @@ header .main-nav {
}
}

.rda-message {
display: none;
}

/*
* ACCESSIBILITY
*/
Expand Down
8 changes: 8 additions & 0 deletions app/javascript/src/plans/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ $(() => {
$('body').on('click', '.plan-import', () => {
toggleSpinner(true);
});
$('body').on('change', '#import-format input:radio[name="import[format]"]', (e) => {
const $rdaMessage = $('.rda-message');
if ($(e.target).val() === 'rda') {
$rdaMessage.show();
} else {
$rdaMessage.hide();
}
});
});
15 changes: 15 additions & 0 deletions app/models/dmpopidor/org.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Dmpopidor
# Customized code for Org model
module Org
def org_admin_plans
combined_plan_ids = affiliated_plan_ids.flatten.uniq

::Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids)
.where.not(visibility: ::Plan.visibilities[:privately_visible])
.where.not(visibility: ::Plan.visibilities[:is_test])
.where(roles: { active: true })
end
end
end
8 changes: 8 additions & 0 deletions app/models/org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ class Org < ApplicationRecord
extend FeedbacksHelper
include FlagShihTzu
include Identifiable
# --------------------------------
# Start DMP OPIDoR Customization
# SEE app/models/dmpopidor/org.rb
# --------------------------------
prepend Dmpopidor::Org
# --------------------------------
# End DMP OPIDoR Customization
# --------------------------------

extend Dragonfly::Model::Validations
validates_with OrgLinksValidator
Expand Down
4 changes: 2 additions & 2 deletions app/services/import/converters/rda_to_standard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ def convert_research_output(research_output, full_dmp)
},
'ethicalIssues' => {
'description' => full_dmp['ethical_issues_description'],
'ressourceReference' => {
'resourceReference' => [{
'docIdentifier' => full_dmp['ethical_issues_report']
}
}]
},
'dataCollection' => convert_technical_ressource(dataset['technical_ressource'])
}
Expand Down
27 changes: 14 additions & 13 deletions app/views/branded/plans/import.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@

<%= form_with url: import_plans_path, method: :post, local: true do |f| %>
<div class="row">
<div class="col-md-12">
<div id="import-format">
<ul>
<li class="checkbox">
<%= f.radio_button "import[format]", "standard", checked: true %>
<%= f.label 'import[format]', _('Standard'), value: "standard" %>
</li>
<li class="checkbox">
<%= f.radio_button "import[format]", "rda"%>
<%= f.label 'import[format]', _('RDA Commons Standards'), value: "rda" %>
</li>
</ul>
<div class="col-md-12">
<div id="import-format">
<ul>
<li class="checkbox">
<%= f.radio_button "import[format]", "standard", checked: true %>
<%= f.label 'import[format]', _('Standard'), value: "standard" %>
</li>
<li class="checkbox">
<%= f.radio_button "import[format]", "rda"%>
<%= f.label 'import[format]', _('RDA Commons Standards'), value: "rda" %>
</li>
</ul>
</div>
<span class="red rda-message"><%= _("After using the import, you will have to set the role for each contributor created.")%></span>
</div>
</div>
</div>

<h2><%= _('Structured template') %></h2>
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ json.dataset research_outputs do |research_output|
json.title technical_resource.data["title"]
end

ethical_issues_exist.push("#{dataset_title} : #{dataset.research_output_description.data['hasEthicalIssues']}")
ethical_issues_exist.push(dataset.research_output_description.data['hasEthicalIssues'])
if dataset.ethical_issues.present?
# rubocop:disable Layout/LineLength
ethical_issues_description.push(exportable_description("#{dataset_title} : #{dataset.ethical_issues.data['description']}"))
Expand All @@ -115,6 +115,9 @@ json.dataset research_outputs do |research_output|
end
end
# rubocop:enable Metrics/BlockLength
json.ethical_issues_exist ethical_issues_exist.join(" / ")
json.ethical_issues_description ethical_issues_description.join(" / ")
json.ethical_issues_report ethical_issues_report.join(" / ")
intersect = %w[Yes Oui] & ethical_issues_exist
I18n.with_locale @plan.template.locale do
json.ethical_issues_exist intersect.empty? ? _('No') : _('Yes')
json.ethical_issues_description ethical_issues_description.join(" / ")
json.ethical_issues_report ethical_issues_report.join(" / ")
end
22 changes: 14 additions & 8 deletions config/locale/client.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: DMPOPIDoR 1.0\n"
"Report-Msgid-Bugs-To: contact@translation.io\n"
"POT-Creation-Date: 2022-04-29 08:50+0200\n"
"PO-Revision-Date: 2022-04-29 08:50+0200\n"
"POT-Creation-Date: 2022-05-05 11:08+0200\n"
"PO-Revision-Date: 2022-05-05 11:08+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
Expand Down Expand Up @@ -1047,15 +1047,15 @@ msgstr ""
msgid "already assigned a value"
msgstr ""

#: ../../app/models/org.rb:46
#: ../../app/models/org.rb:54
msgid "Feedback email message"
msgstr ""

#: ../../app/models/org.rb:131
#: ../../app/models/org.rb:139
msgid "must be one of the following formats: jpeg, jpg, png, gif, bmp"
msgstr ""

#: ../../app/models/org.rb:136
#: ../../app/models/org.rb:144
msgid "can't be larger than 500KB"
msgstr ""

Expand Down Expand Up @@ -3066,15 +3066,21 @@ msgstr ""
msgid "Standard"
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:27
#: ../../app/views/branded/plans/import.html.erb:24
msgid ""
"After using the import, you will have to set the role for each contributor cre"
"ated."
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:28
msgid "Structured template"
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:37
#: ../../app/views/branded/plans/import.html.erb:38
msgid "File"
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:45
#: ../../app/views/branded/plans/import.html.erb:46
msgid "Import"
msgstr ""

Expand Down
Binary file modified config/locale/en_GB/LC_MESSAGES/client.mo
Binary file not shown.
22 changes: 14 additions & 8 deletions config/locale/en_GB/client.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: DMPOPIDoR 1.0\n"
"Report-Msgid-Bugs-To: contact@translation.io\n"
"POT-Creation-Date: 2022-04-29 08:50+0200\n"
"PO-Revision-Date: 2022-04-29 08:50+0200\n"
"POT-Creation-Date: 2022-05-05 11:08+0200\n"
"PO-Revision-Date: 2022-05-05 11:08+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: English\n"
"Language: en_GB\n"
Expand Down Expand Up @@ -1048,15 +1048,15 @@ msgstr ""
msgid "already assigned a value"
msgstr ""

#: ../../app/models/org.rb:46
#: ../../app/models/org.rb:54
msgid "Feedback email message"
msgstr ""

#: ../../app/models/org.rb:131
#: ../../app/models/org.rb:139
msgid "must be one of the following formats: jpeg, jpg, png, gif, bmp"
msgstr ""

#: ../../app/models/org.rb:136
#: ../../app/models/org.rb:144
msgid "can't be larger than 500KB"
msgstr ""

Expand Down Expand Up @@ -3067,15 +3067,21 @@ msgstr ""
msgid "Standard"
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:27
#: ../../app/views/branded/plans/import.html.erb:24
msgid ""
"After using the import, you will have to set the role for each contributor cre"
"ated."
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:28
msgid "Structured template"
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:37
#: ../../app/views/branded/plans/import.html.erb:38
msgid "File"
msgstr ""

#: ../../app/views/branded/plans/import.html.erb:45
#: ../../app/views/branded/plans/import.html.erb:46
msgid "Import"
msgstr ""

Expand Down
Binary file modified config/locale/fr_FR/LC_MESSAGES/client.mo
Binary file not shown.
24 changes: 16 additions & 8 deletions config/locale/fr_FR/client.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: DMPOPIDoR 1.0\n"
"Report-Msgid-Bugs-To: contact@translation.io\n"
"POT-Creation-Date: 2022-04-29 08:50+0200\n"
"PO-Revision-Date: 2022-04-29 08:50+0200\n"
"POT-Creation-Date: 2022-05-05 11:08+0200\n"
"PO-Revision-Date: 2022-05-05 11:08+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: French\n"
"Language: fr_FR\n"
Expand Down Expand Up @@ -1099,15 +1099,15 @@ msgstr "doit être unique"
msgid "already assigned a value"
msgstr "a déjà une valeur attribuée"

#: ../../app/models/org.rb:46
#: ../../app/models/org.rb:54
msgid "Feedback email message"
msgstr "Message du mail de l'assistance conseil"

#: ../../app/models/org.rb:131
#: ../../app/models/org.rb:139
msgid "must be one of the following formats: jpeg, jpg, png, gif, bmp"
msgstr "doit être dans l'un des formats suivants : jpeg, jpg, png, gif, bmp"

#: ../../app/models/org.rb:136
#: ../../app/models/org.rb:144
msgid "can't be larger than 500KB"
msgstr "ne peut peser plus de 500ko"

Expand Down Expand Up @@ -3279,15 +3279,23 @@ msgstr "Budget général"
msgid "Standard"
msgstr "Standard"

#: ../../app/views/branded/plans/import.html.erb:27
#: ../../app/views/branded/plans/import.html.erb:24
msgid ""
"After using the import, you will have to set the role for each contributor cre"
"ated."
msgstr ""
"Après avoir utilisé l'import, vous devrez définir le rôle de chaque contribute"
"ur créé."

#: ../../app/views/branded/plans/import.html.erb:28
msgid "Structured template"
msgstr "Modèle structuré"

#: ../../app/views/branded/plans/import.html.erb:37
#: ../../app/views/branded/plans/import.html.erb:38
msgid "File"
msgstr "Fichier"

#: ../../app/views/branded/plans/import.html.erb:45
#: ../../app/views/branded/plans/import.html.erb:46
msgid "Import"
msgstr "Importer"

Expand Down
Loading

0 comments on commit 12c860a

Please sign in to comment.