diff --git a/.env.sample b/.env.sample index a38897932a..9d4cb5a54b 100644 --- a/.env.sample +++ b/.env.sample @@ -47,8 +47,8 @@ export NODE_ENV=development # it's a good idea to use 1 to avoid race conditions when debugging. #export WEB_CONCURRENCY= #export RAILS_MAX_THREADS=5 -export WEB_CONCURRENCY=1 -export RAILS_MAX_THREADS=1 +#export WEB_CONCURRENCY=1 +#export RAILS_MAX_THREADS=1 # You'll always want to set POSTGRES_USER and POSTGRES_PASSWORD since the # postgres Docker image uses them for its default database user and password. diff --git a/Dockerfile b/Dockerfile index 4f4062a371..88f019fdb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ RUN apk add --no-cache \ nodejs \ tzdata \ yarn \ + less \ && addgroup --gid ${GID} ruby \ && adduser -u ${UID} -G ruby -D ruby \ && chown ruby:ruby -R /app \ @@ -35,13 +36,14 @@ ENV RAILS_ENV="${RAILS_ENV}" \ COPY --chown=ruby:ruby Gemfile* ./ RUN bundle install --jobs "$(nproc)" +RUN gem install rails + RUN echo "--modules-folder /node_modules" > .yarnrc COPY --chown=ruby:ruby package.json *yarn* ./ RUN yarn install -ENTRYPOINT ["/app/bin/docker-entrypoint-web"] EXPOSE 3000 diff --git a/Gemfile b/Gemfile index 526a001508..7de2ef3ea7 100644 --- a/Gemfile +++ b/Gemfile @@ -72,7 +72,7 @@ gem 'view_component', '~> 2.72' gem 'turnout' gem 'will_paginate', '~> 3.0' -gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git', branch: 'master' +gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git', branch: 'development' group :staging, :production, :appliance do @@ -119,3 +119,4 @@ end gem "net-ftp", "~> 0.2.0", require: false +gem "net-http" diff --git a/Gemfile.lock b/Gemfile.lock index 80d09a7c6f..a78e9f6b80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git - revision: fe929a4dd156920d60ecde9e8f9ef30a2cf5088e - branch: master + revision: 0c8cd2b377d88b66a979664d5b16e5068b6d4548 + branch: development specs: ontologies_api_client (2.2.0) activesupport @@ -158,7 +158,7 @@ GEM flamegraph (0.9.5) globalid (1.1.0) activesupport (>= 5.0) - graphql (2.0.16) + graphql (2.0.17) graphql-client (0.18.0) activesupport (>= 3.0) graphql @@ -218,6 +218,8 @@ GEM net-ftp (0.2.0) net-protocol time + net-http (0.3.2) + uri net-imap (0.3.4) date net-protocol @@ -233,12 +235,12 @@ GEM netrc (0.11.0) newrelic_rpm (8.16.0) nio4r (2.5.8) - nokogiri (1.14.1-x86_64-linux) + nokogiri (1.14.2-x86_64-linux) racc (~> 1.4) - oj (3.14.1) + oj (3.14.2) open_uri_redirections (0.2.1) parallel (1.22.1) - parser (3.2.0.0) + parser (3.2.1.0) ast (~> 2.4.1) popper_js (1.16.1) pry (0.14.2) @@ -275,8 +277,10 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - rails_autolink (1.1.7) - rails (> 3.1) + rails_autolink (1.1.8) + actionview (> 3.1) + activesupport (> 3.1) + railties (> 3.1) railties (7.0.3) actionpack (= 7.0.3) activesupport (= 7.0.3) @@ -292,7 +296,7 @@ GEM rdoc (6.3.3) recaptcha (5.9.0) json - regexp_parser (2.6.2) + regexp_parser (2.7.0) reline (0.3.2) io-console (~> 0.5) rest-client (2.1.0) @@ -318,7 +322,7 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.12.0) - rubocop (1.44.1) + rubocop (1.45.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -328,8 +332,8 @@ GEM rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.26.0) + parser (>= 3.2.1.0) ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) ruby_parser (3.19.2) @@ -374,7 +378,7 @@ GEM tilt (2.0.11) time (0.2.1) date - timeout (0.3.1) + timeout (0.3.2) turbo-rails (1.3.3) actionpack (>= 6.0.0) activejob (>= 6.0.0) @@ -390,6 +394,7 @@ GEM unf_ext unf_ext (0.0.8.2) unicode-display_width (2.4.2) + uri (0.12.0) view_component (2.82.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) @@ -410,7 +415,7 @@ GEM will_paginate (3.3.1) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS x86_64-linux @@ -446,6 +451,7 @@ DEPENDENCIES multi_json mysql2 (= 0.5.3) net-ftp (~> 0.2.0) + net-http newrelic_rpm oj ontologies_api_client! @@ -478,4 +484,4 @@ DEPENDENCIES will_paginate (~> 3.0) BUNDLED WITH - 2.3.23 + 2.3.15 diff --git a/app/assets/images/arrow-back.svg b/app/assets/images/arrow-back.svg new file mode 100644 index 0000000000..2237220b3f --- /dev/null +++ b/app/assets/images/arrow-back.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/check.svg b/app/assets/images/check.svg new file mode 100644 index 0000000000..d75aa16adb --- /dev/null +++ b/app/assets/images/check.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/assets/images/github-icon.svg b/app/assets/images/github-icon.svg new file mode 100644 index 0000000000..9ebf37cb4f --- /dev/null +++ b/app/assets/images/github-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/app/assets/images/green-check.svg b/app/assets/images/green-check.svg new file mode 100644 index 0000000000..ae048b09de --- /dev/null +++ b/app/assets/images/green-check.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/orcid.svg b/app/assets/images/orcid.svg new file mode 100644 index 0000000000..1f8c827df7 --- /dev/null +++ b/app/assets/images/orcid.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/app/assets/images/red-warning.svg b/app/assets/images/red-warning.svg new file mode 100644 index 0000000000..dea7593d68 --- /dev/null +++ b/app/assets/images/red-warning.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index c423cebb5a..f73139ead6 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,7 +13,6 @@ //= require bioportal //= require admin/licenses //= require bp_ajax_controller -//= require bp_ontology_viewer //= require bp_reviews //= require bp_notes //= require bp_ontolobridge @@ -32,7 +31,6 @@ //= require_tree ./components //= require ontologies //= require projects -//= require submissions //= require tooltipster.bundle.min //= require application_esbuild customElements.define('data-table-loader', DataTableLoader ); diff --git a/app/assets/javascripts/bp_notes.js b/app/assets/javascripts/bp_notes.js index eb400f1e87..61f9e8f447 100644 --- a/app/assets/javascripts/bp_notes.js +++ b/app/assets/javascripts/bp_notes.js @@ -1,348 +1,3 @@ -var ontNotesTable; -var ont_columns = { archived: 3, date: 7, subjectSort: 2 }; - - -NOTES_PROPOSAL_TYPES = { - "ProposalNewClass": "New Class Proposal", - "ProposalChangeHierarchy": "New Relationship Proposal", - "ProposalChangeProperty": "Change Property Value Proposal" -} - -function getUser() { - return jQuery(document).data().bp.user; -} - -function setupNotesFacebox() { - jQuery("a.notes_list_link").attr("rel", "facebox[.facebox_note]"); - jQuery("a.notes_list_link").each(function() { - if (!jQuery(this).data().faceboxInit) { - jQuery(this).facebox(); - jQuery(this).data().faceboxInit = true; - } - }) -} - -function setupNotesFaceboxSizing() { - jQuery(document).bind('afterReveal.facebox', function() { - jQuery("div.facebox_note").parents("div#facebox").width('850px'); - jQuery("div.facebox_note").width('820px'); - jQuery("div.facebox_note").parents("div#facebox").css("max-height", jQuery(window).height() - (jQuery("#facebox").offset().top - jQuery(window).scrollTop()) * 2 + "px"); - jQuery("div.facebox_note").parents("div#facebox").centerElement(); - }); -} - -function bindAddCommentClick() { - jQuery("a.add_comment").live('click', function(){ - var id = jQuery(this).attr("data-parent-id"); - var type = jQuery(this).attr("data-parent-type"); - addCommentBox(id, type, this); - }); -} - -function bindAddProposalClick() { - jQuery("a.add_proposal").live('click', function(){ - var id = jQuery(this).attr("data-parent-id"); - var type = jQuery(this).attr("data-parent-type"); - addProposalBox(id, type, this); - }); -} - -function bindReplyClick() { - jQuery("a.reply_reply").live('click', function(){ - addReplyBox(this); - jQuery(this).hide(); - }); -} - -function bindReplyCancelClick() { - jQuery(".reply .cancel, .create_note_form .cancel").live('click', function(){ - removeReplyBox(this); - }); -} - -function bindProposalChange() { - jQuery(".create_note_form .proposal_type").live('change', function(){ - var selector = jQuery(this); - proposalFields(selector.val(), selector.parent().children(".proposal_container")); - }); -} - -function bindReplySaveClick() { - jQuery(".reply .save, .create_note_form .save").live('click', function(){ - var user = getUser(); - var id = jQuery(this).data("parent_id"); - var type = jQuery(this).data("parent_type"); - var button = this; - var body = jQuery(this).closest(".reply_box").children(".reply_body").val(); - var subject = subjectForNote(button); - var ontology_id = jQuery(document).data().bp.ont_viewer.ontology_id; - jQuery(button).parent().children(".reply_status").html(""); - if (type === "class") { - id = {class: id, ontology: ontology_id}; - } - jQuery.ajax({ - type: "POST", - url: "/notes", - data: {parent: id, type: type, subject: subject, body: body, proposal: proposalMap(button), creator: user["id"]}, - success: function(data){ - var note = data; - var status = data[1]; - if (status && status >= 400) { - displayError(button); - } else { - addNoteOrReply(button, note); - removeReplyBox(button); - } - }, - error: function(){displayError(button);} - }); - }); -} - - -var displayError = function(button) { - jQuery(button).parent().children(".reply_status").html("Error, please try again"); -} - -function addCommentBox(id, type, button) { - var formContainer = jQuery(button).parents(".notes_list_container").children(".create_note_form"); - var commentSubject = jQuery("") - .attr("type", "text") - .attr("placeholder", "Subject") - .addClass("comment_subject") - .add("
"); - var commentFields = commentSubject.add(commentForm(id,type)); - var commentWrapper = jQuery("
").addClass("reply_box").append(commentFields); - formContainer.html(commentWrapper); - formContainer.show(); -} - -function addProposalBox(id, type, button) { - var formContainer = jQuery(button).parents(".notes_list_container").children(".create_note_form"); - var proposalForm = jQuery("
").addClass("reply_box"); - var select = jQuery("