diff --git a/Gemfile b/Gemfile index 04d3af4f56..9a054e9889 100644 --- a/Gemfile +++ b/Gemfile @@ -54,7 +54,7 @@ gem 'will_paginate', '~> 3.1' gem 'yaml_db' gem 'rails_autolink' gem 'rfc-822' -gem 'nokogiri', '~> 1.16.2' +gem 'nokogiri', '~> 1.16' #necessary for newer hashie dependency, original api_smith is no longer active gem 'api_smith', git: 'https://github.com/youroute/api_smith.git', ref: '1fb428cebc17b9afab25ac9f809bde87b0ec315b' gem 'rdf-virtuoso', '>= 0.2.0' diff --git a/Gemfile.lock b/Gemfile.lock index e945af4076..37af32fac1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,40 +51,40 @@ GEM remote: https://rubygems.org/ specs: RedCloth (4.3.3) - actioncable (6.1.7.7) - actionpack (= 6.1.7.7) - activesupport (= 6.1.7.7) + actioncable (6.1.7.8) + actionpack (= 6.1.7.8) + activesupport (= 6.1.7.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.7) - actionpack (= 6.1.7.7) - activejob (= 6.1.7.7) - activerecord (= 6.1.7.7) - activestorage (= 6.1.7.7) - activesupport (= 6.1.7.7) + actionmailbox (6.1.7.8) + actionpack (= 6.1.7.8) + activejob (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) mail (>= 2.7.1) - actionmailer (6.1.7.7) - actionpack (= 6.1.7.7) - actionview (= 6.1.7.7) - activejob (= 6.1.7.7) - activesupport (= 6.1.7.7) + actionmailer (6.1.7.8) + actionpack (= 6.1.7.8) + actionview (= 6.1.7.8) + activejob (= 6.1.7.8) + activesupport (= 6.1.7.8) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.7) - actionview (= 6.1.7.7) - activesupport (= 6.1.7.7) + actionpack (6.1.7.8) + actionview (= 6.1.7.8) + activesupport (= 6.1.7.8) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.7) - actionpack (= 6.1.7.7) - activerecord (= 6.1.7.7) - activestorage (= 6.1.7.7) - activesupport (= 6.1.7.7) + actiontext (6.1.7.8) + actionpack (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) nokogiri (>= 1.8.5) - actionview (6.1.7.7) - activesupport (= 6.1.7.7) + actionview (6.1.7.8) + activesupport (= 6.1.7.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -94,14 +94,14 @@ GEM activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (6.1.7.7) - activesupport (= 6.1.7.7) + activejob (6.1.7.8) + activesupport (= 6.1.7.8) globalid (>= 0.3.6) - activemodel (6.1.7.7) - activesupport (= 6.1.7.7) - activerecord (6.1.7.7) - activemodel (= 6.1.7.7) - activesupport (= 6.1.7.7) + activemodel (6.1.7.8) + activesupport (= 6.1.7.8) + activerecord (6.1.7.8) + activemodel (= 6.1.7.8) + activesupport (= 6.1.7.8) activerecord-import (1.3.0) activerecord (>= 4.2) activerecord-session_store (2.0.0) @@ -110,14 +110,14 @@ GEM multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 3) railties (>= 5.2.4.1) - activestorage (6.1.7.7) - actionpack (= 6.1.7.7) - activejob (= 6.1.7.7) - activerecord (= 6.1.7.7) - activesupport (= 6.1.7.7) + activestorage (6.1.7.8) + actionpack (= 6.1.7.8) + activejob (= 6.1.7.8) + activerecord (= 6.1.7.8) + activesupport (= 6.1.7.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.7) + activesupport (6.1.7.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -198,7 +198,7 @@ GEM execjs coffee-script-source (1.12.2) commonmarker (0.23.10) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.1) connection_pool (2.3.0) countries (5.2.0) unaccent (~> 0.3) @@ -322,7 +322,7 @@ GEM httpclient (2.8.3) httpi (1.1.1) rack - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) i18n-js (3.9.0) i18n (>= 0.6.6) @@ -460,7 +460,7 @@ GEM nokogiri (~> 1) rake mini_mime (1.1.5) - mini_portile2 (2.8.5) + mini_portile2 (2.8.7) minitest (5.20.0) minitest-reporters (1.5.0) ansi @@ -492,7 +492,7 @@ GEM net-protocol netrc (0.11.0) nio4r (2.7.0) - nokogiri (1.16.2) + nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) nori (1.1.5) @@ -566,8 +566,8 @@ GEM puma (5.6.8) nio4r (~> 2.0) pyu-ruby-sasl (0.0.3.3) - racc (1.7.3) - rack (2.2.8.1) + racc (1.8.0) + rack (2.2.9) rack-attack (6.6.0) rack (>= 1.0, < 3) rack-cors (1.1.1) @@ -584,20 +584,20 @@ GEM rack rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.7) - actioncable (= 6.1.7.7) - actionmailbox (= 6.1.7.7) - actionmailer (= 6.1.7.7) - actionpack (= 6.1.7.7) - actiontext (= 6.1.7.7) - actionview (= 6.1.7.7) - activejob (= 6.1.7.7) - activemodel (= 6.1.7.7) - activerecord (= 6.1.7.7) - activestorage (= 6.1.7.7) - activesupport (= 6.1.7.7) + rails (6.1.7.8) + actioncable (= 6.1.7.8) + actionmailbox (= 6.1.7.8) + actionmailer (= 6.1.7.8) + actionpack (= 6.1.7.8) + actiontext (= 6.1.7.8) + actionview (= 6.1.7.8) + activejob (= 6.1.7.8) + activemodel (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) bundler (>= 1.15.0) - railties (= 6.1.7.7) + railties (= 6.1.7.8) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -625,9 +625,9 @@ GEM json require_all (~> 3.0) ruby-progressbar - railties (6.1.7.7) - actionpack (= 6.1.7.7) - activesupport (= 6.1.7.7) + railties (6.1.7.8) + actionpack (= 6.1.7.8) + activesupport (= 6.1.7.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -728,7 +728,8 @@ GEM netrc (~> 0.8) reverse_markdown (2.1.1) nokogiri - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rfc-822 (0.4.1) rmagick (5.3.0) pkg-config (~> 1.4) @@ -861,6 +862,7 @@ GEM sqlite3 (1.4.2) stackprof (0.2.25) stringio (3.0.1.1) + strscan (3.1.0) sunspot (2.6.0) pr_geohash (~> 1.0) rsolr (>= 1.1.1, < 3) @@ -950,7 +952,7 @@ GEM rails (>= 3.0) rake (>= 0.8.7) yard (0.9.36) - zeitwerk (2.6.13) + zeitwerk (2.6.15) zip-container (4.0.2) rubyzip (~> 2.0.0) @@ -1028,7 +1030,7 @@ DEPENDENCIES my_responds_to_parent! mysql2 net-ftp - nokogiri (~> 1.16.2) + nokogiri (~> 1.16) omniauth (~> 2.1.0) omniauth-github omniauth-rails_csrf_protection diff --git a/app/assets/javascripts/single_page/dynamic_table.js.erb b/app/assets/javascripts/single_page/dynamic_table.js.erb index ae1a9cc598..63627432bc 100644 --- a/app/assets/javascripts/single_page/dynamic_table.js.erb +++ b/app/assets/javascripts/single_page/dynamic_table.js.erb @@ -48,7 +48,7 @@ function sanitizeData(data) { const objectInputTemp = '' + ''; const typeaheadSamplesUrl = "<%= typeahead_samples_path(linked_sample_type_id: '_LINKED_') %>"; @@ -86,11 +86,12 @@ const handleSelect = (e) => { } c["render"] = function(data_, type, full, meta) { - sanitizedData = sanitizeData(data_); + let sanitizedData = sanitizeData(data_); + let data; if(c.linked_sample_type){ data = sanitizedData && Array.isArray(sanitizedData) ? sanitizedData : [sanitizedData]; data = data[0]?.id ? data : []; - return inputObjectsInput(c, data, options, linkedSamplesUrl); + return registeredSamplesObjectsInput(c, data, options, linkedSamplesUrl); } else if(c.is_cv_list && sanitizedData !== "#HIDDEN"){ data = sanitizedData && Array.isArray(sanitizedData) ? sanitizedData : [sanitizedData]; data = data.map((e) => { @@ -569,7 +570,7 @@ function retrieveLinkedSamples(url){ return linkedSamples; } -function inputObjectsInput(column, data, options, url){ +function registeredSamplesObjectsInput(column, data, options, url){ const existingOptions = data.map((e) => { isHiddenInput = (e.title == '#HIDDEN'); if (isHiddenInput) { @@ -584,7 +585,6 @@ function inputObjectsInput(column, data, options, url){ const typeaheadTemplate = 'typeahead/single_pages_samples' const objectInputName = data.map((e) => e.id).join('-') + '-' + crypto.randomUUID(); - const unLinkedSamples = data.reduce(function(filtered, sample) { if(!column.linkedSampleIds.includes(parseInt(sample.id)) && sample.title != '#HIDDEN'){ filtered.push(sample); @@ -593,7 +593,7 @@ function inputObjectsInput(column, data, options, url){ }, []); const hasUnlinkedSamples = unLinkedSamples.length > 0 ? true : false; - const hasMultipleInputs = column.multi_link ? 'multiple="multiple"' : '' + const hasMultipleInputs = column.multi_link ? '100' : '1' const extraClass = hasUnlinkedSamples ? 'select2__error' : ''; const titleText = hasUnlinkedSamples ? `Sample(s) '${unLinkedSamples.map(uls => uls.title).join(', ')}' not recognised as input. Please correct this issue!` : ''; setTimeout(ObjectsInput.init); @@ -605,7 +605,7 @@ function inputObjectsInput(column, data, options, url){ .replace('_OPTIONS_', existingOptions) .replace('_EXTRACLASS_', extraClass) .replace('_TITLE_', titleText) - .replace('_MULTIPLE?_', hasMultipleInputs) + .replace('_LIMIT?_', hasMultipleInputs) .replace('_ALLOW_FREE_TEXT_', false); } } @@ -629,7 +629,7 @@ function cvListObjectsInput(column, data, options, url){ .replace('_OPTIONS_', existingOptions) .replace('_EXTRACLASS_', extraClass) .replace('_TITLE_', titleText) - .replace('_MULTIPLE?_', 'multiple="multiple"') + .replace('_LIMIT?_', '') .replace('_ALLOW_FREE_TEXT_', allowNewItems); } } diff --git a/app/assets/javascripts/templates.js b/app/assets/javascripts/templates.js index 4b0c733526..0947bfa8d1 100644 --- a/app/assets/javascripts/templates.js +++ b/app/assets/javascripts/templates.js @@ -222,6 +222,7 @@ const applyTemplate = () => { $j('#template_level').val(data.level); $j('#template_parent_id').val(data.template_id); + const appliedToSampleType = $j('#template_level')[0] === undefined || $j('#template_level')[0] === null; // Make sure default sorted attributes are added to the table Templates.table.order([9, "asc"]).draw(); $j.each(Templates.table.rows().data(), (i, row) => { @@ -239,24 +240,25 @@ const applyTemplate = () => { row[7] === "Registered Sample List" && row[1].includes("Input") && row[11] === null; - const isInherited = row[14] !== "undefined" || row[14] !== null; const isRequired = row[0] ? "checked" : ""; newRow = $j(newRow.replace(/replace-me/g, index)); $j(newRow).find('[data-attr="required"]').prop("checked", row[0]); + if (appliedToSampleType) $j(newRow).find('[data-attr="required"]').addClass("disabled"); + $j(newRow).find(".sample-type-is-title").prop("checked", row[8]); + if (appliedToSampleType) $j(newRow).find('.sample-type-is-title').addClass("disabled"); $j(newRow).find('[data-attr="title"]').val(row[1]); - $j(newRow).find('[data-attr="title"]').addClass("disabled"); + if (appliedToSampleType) $j(newRow).find('[data-attr="title"]').addClass("disabled"); $j(newRow).find('[data-attr="description"]').val(row[2]); $j(newRow).find('[data-attr="type"]').val(row[3]); - $j(newRow).find('[data-attr="type"]').addClass("disabled"); + if (appliedToSampleType) $j(newRow).find('[data-attr="type"]').addClass("disabled"); $j(newRow).find('[data-attr="cv_id"]').val(row[4]); - $j(newRow).find('[data-attr="cv_id"]').parent().addClass("disabled"); + if (appliedToSampleType) $j(newRow).find('[data-attr="cv_id"]').parent().addClass("disabled"); $j(newRow).find('[data-attr="allow_cv_free_text"]').prop("checked", row[5]); - $j(newRow) - .find('[data-attr="allow_cv_free_text"]') - .addClass("disabled"); + if (appliedToSampleType) $j(newRow) + .find('[data-attr="allow_cv_free_text"]') + .addClass("disabled"); $j(newRow).find('[data-attr="unit"]').val(row[6]); - $j(newRow).find('[data-attr="unit"]').addClass("disabled"); - $j(newRow).find(".sample-type-is-title").prop("checked", row[8]); + if (appliedToSampleType) $j(newRow).find('[data-attr="unit"]').addClass("disabled"); $j(newRow).find('[data-attr="pid"]').val(row[9]); $j(newRow).find('[data-attr="isa_tag_id"]').val(row[11]); $j(newRow).find('[data-attr="isa_tag_title"]').val(row[11]); @@ -265,7 +267,10 @@ const applyTemplate = () => { .addClass("disabled"); $j(newRow).find('[data-attr="template_attribute_id"]').val(row[14]); // In case of a sample type $j(newRow).find('[data-attr="parent_attribute_id"]').val(row[14]); // In case of a template - if (isRequired) { + + // Hide the remove button if the attribute is required and it is applied to a sample type. + // Template attributes should always be removeable + if (isRequired && appliedToSampleType) { $j(newRow).find('label.btn.btn-danger').addClass("hidden"); } @@ -293,9 +298,12 @@ const applyTemplate = () => { const template_id_tag = $j(`#isa_study${suffix}template_parent_id`); if (template_id_tag) $j(template_id_tag).val(id); + // Removes the hidden from the new attribute button + $j(`${attribute_table} ${addAttributeRow}`).find('#add-attribute').removeClass("hidden"); + SampleTypes.recalculatePositions(); SampleTypes.bindSortable(); - $j(".sample-type-attribute-type").trigger("change", [false]); + $j(".sample-type-attribute-type").trigger("change", [false]); }; // Shows the modal form diff --git a/app/assets/javascripts/upload.js b/app/assets/javascripts/upload.js index e5a0c8c213..c4a2b1eec9 100644 --- a/app/assets/javascripts/upload.js +++ b/app/assets/javascripts/upload.js @@ -69,6 +69,7 @@ $j(document).ready(function () { filenameInput.val(''); $j('[data-role="seek-url-checker-msg-success"]', field).hide(); $j('[data-role="seek-url-checker-msg-too-big"]', field).hide(); + $j('[role="seek-url-checker-remind-to-add-file"]',field).hide(); pending.append(HandlebarsTemplates['upload/remote_file'](remoteFile)); } }; @@ -92,6 +93,7 @@ $j(document).ready(function () { var result = field.find('[data-role="seek-url-checker-result"]'); var copyDialog = $j('[data-role="seek-url-checker-msg-success"]', field); var tooBig = $j('[data-role="seek-url-checker-msg-too-big"]', field); + var addReminder = $j('[role="seek-url-checker-remind-to-add-file"]',field); var submitUrl = function () { result.html('').spinner('add'); @@ -111,6 +113,7 @@ $j(document).ready(function () { checker.trigger('urlChecked', [info]); if (info.allow_copy) { copyDialog.show(); + addReminder.show(); } else { tooBig.show(); } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6d98f1920e..6e2bc08abc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -42,6 +42,8 @@ class ApplicationController < ActionController::Base include FairSignposting helper :all + helper_method %i[current_person is_condensed_view page_and_sort_params controller_model + displaying_single_page? display_isa_graph? safe_class_lookup] layout Seek::Config.main_layout @@ -118,7 +120,7 @@ def page_and_sort_params params.permit(:page, :sort, :order, :view, :table_cols, permitted_filter_params) end - helper_method :page_and_sort_params + def controller_model begin @@ -127,7 +129,6 @@ def controller_model end end - helper_method :controller_model def self.api_actions(*actions) @api_actions ||= [] @@ -233,7 +234,8 @@ def find_and_authorize_requested_item case privilege when :publish, :manage, :edit, :download, :delete if current_user.nil? - flash[:error] = "You are not authorized to #{privilege} this #{name.humanize}, you may need to login first." + flash[:error] = +"You are not authorized to #{privilege} this #{name.humanize}, you may need to login first." else flash[:error] = "You are not authorized to #{privilege} this #{name.humanize}." end @@ -289,14 +291,16 @@ def render_not_found_error(e) def render_unknown_attribute_error(e) respond_to do |format| - format.json { render json: { errors: [{ title: 'Unknown attribute', details: e.message }] }, status: :unprocessable_entity } + format.json { + render json: { errors: [{ title: 'Unknown attribute', details: e.message }] }, status: :unprocessable_entity } format.all { render plain: e.message, status: :unprocessable_entity } end end def render_not_implemented_error(e) respond_to do |format| - format.json { render json: { errors: [{ title: 'Not implemented', details: e.message }] }, status: :not_implemented } + format.json { + render json: { errors: [{ title: 'Not implemented', details: e.message }] }, status: :not_implemented } format.all { render plain: e.message, status: :not_implemented } end end @@ -318,8 +322,6 @@ def is_condensed_view? (!params.has_key?(:view) && session.has_key?(:view) && !session[:view].nil? && session[:view]!="default") end - helper_method :is_condensed_view - def log_event # FIXME: why is needed to wrap in this block when the around filter already does ? @@ -382,7 +384,8 @@ def log_event user_agent: user_agent, data: activity_loggable.title) end - when *Seek::Util.authorized_types.map { |t| t.name.underscore.pluralize.split('/').last } + ["sample_types"] # TODO: Find a nicer way of doing this... + when *Seek::Util.authorized_types.map { |t| + t.name.underscore.pluralize.split('/').last } + ["sample_types"] # TODO: Find a nicer way of doing this... action = 'create' if action == 'create_metadata' || action == 'create_from_template' action = 'update' if action == 'create_version' action = 'inline_view' if action == 'explore' @@ -530,7 +533,8 @@ def rdf_enabled? return unless request.format.rdf? unless Seek::Util.rdf_capable_types.include?(controller_model) respond_to do |format| - format.rdf { render plain: 'This resource does not support RDF', status: :not_acceptable, content_type: 'text/plain' } + format.rdf { + render plain: 'This resource does not support RDF', status: :not_acceptable, content_type: 'text/plain' } end end end @@ -606,9 +610,11 @@ def relationify_collection(collection) def determine_extended_metadata_keys(asset = nil) keys = [] if asset - type_id = params.dig(controller_name.singularize.to_sym, asset, :extended_metadata_attributes, :extended_metadata_type_id) + type_id = params.dig(controller_name.singularize.to_sym, asset, :extended_metadata_attributes, + :extended_metadata_type_id) else - type_id = params.dig(controller_name.singularize.to_sym, :extended_metadata_attributes, :extended_metadata_type_id) + type_id = params.dig(controller_name.singularize.to_sym, :extended_metadata_attributes, + :extended_metadata_type_id) end if type_id.present? metadata_type = ExtendedMetadataType.find(type_id) @@ -650,14 +656,10 @@ def displaying_single_page? @single_page || false end - helper_method :displaying_single_page? - def display_isa_graph? !displaying_single_page? end - helper_method :display_isa_graph? - def creator_related_params [:other_creators, @@ -677,6 +679,4 @@ def creator_related_params def safe_class_lookup(class_name, raise: true) Seek::Util.lookup_class(class_name, raise: raise) end - - helper_method :safe_class_lookup end diff --git a/app/controllers/assays_controller.rb b/app/controllers/assays_controller.rb index 140b5c0dd6..4aa210b8b5 100644 --- a/app/controllers/assays_controller.rb +++ b/app/controllers/assays_controller.rb @@ -171,15 +171,11 @@ def fix_assay_linkage_when_deleting_assays return unless @assay.is_isa_json_compliant? return unless @assay.has_linked_child_assay? - previous_assay_linked_st_id = @assay.previous_linked_sample_type&.id + previous_st = @assay.sample_type&.previous_linked_sample_type + next_st = @assay.sample_type&.next_linked_sample_types&.first + return unless previous_st && next_st - next_assay = @assay.next_linked_child_assay - - next_assay_st_attr = next_assay.sample_type&.sample_attributes&.detect(&:input_attribute?) - - return unless next_assay && previous_assay_linked_st_id && next_assay_st_attr - - next_assay_st_attr.update(linked_sample_type_id: previous_assay_linked_st_id) + next_st.sample_attributes.detect(&:input_attribute?).update_column(:linked_sample_type_id, previous_st&.id) end def rearrange_assay_positions_at_destroy diff --git a/app/controllers/data_files_controller.rb b/app/controllers/data_files_controller.rb index d42906f834..6143dfcee1 100644 --- a/app/controllers/data_files_controller.rb +++ b/app/controllers/data_files_controller.rb @@ -169,6 +169,7 @@ def extract_samples SampleDataPersistJob.new(@data_file, @sample_type, User.current_user, assay_ids: params["assay_ids"]).queue_job flash[:notice] = 'Started creating extracted samples' else + @data_file.sample_persistence_task.destroy if @data_file.sample_persistence_task&.success? SampleDataExtractionJob.new(@data_file, @sample_type).queue_job end diff --git a/app/controllers/isa_assays_controller.rb b/app/controllers/isa_assays_controller.rb index 8681f2a23f..d6c12551dd 100644 --- a/app/controllers/isa_assays_controller.rb +++ b/app/controllers/isa_assays_controller.rb @@ -5,47 +5,71 @@ class IsaAssaysController < ApplicationController before_action :set_up_instance_variable before_action :find_requested_item, only: %i[edit update] before_action :initialize_isa_assay, only: :create - before_action :fix_assay_linkage_for_new_assays, only: :create after_action :rearrange_assay_positions_create_isa_assay, only: :create + after_action :fix_assay_linkage_for_new_assays, only: :create def new - if params[:is_assay_stream] - @isa_assay = IsaAssay.new({ assay: { assay_class_id: AssayClass.assay_stream.id } }) - else - @isa_assay = IsaAssay.new({ assay: { assay_class_id: AssayClass.experimental.id } }) - end + study = Study.find(params[:study_id]) + new_position = + if params[:is_assay_stream] || params[:source_assay_id].nil? # If first assay is of class assay stream + study.assay_streams.any? ? study.assay_streams.map(&:position).max + 1 : 0 + elsif params[:source_assay_id] == params[:assay_stream_id] # If first assay in the stream + 0 + else + Assay.find(params[:source_assay_id]).position + 1 + end + + source_assay = Assay.find(params[:source_assay_id]) if params[:source_assay_id] + input_sample_type_id = + if params[:is_assay_stream] || source_assay&.is_assay_stream? + study.sample_types.second.id + else + source_assay&.sample_type&.id + end + + @isa_assay = + if params[:is_assay_stream] + IsaAssay.new({ assay: { assay_class_id: AssayClass.assay_stream.id, + study_id: study.id, + position: new_position }, + input_sample_type_id: }) + else + IsaAssay.new({ assay: { assay_class_id: AssayClass.experimental.id, + assay_stream_id: params[:assay_stream_id], + study_id: study.id, + position: new_position }, + input_sample_type_id: }) + end + respond_to(&:html) end def create if @isa_assay.save - redirect_to single_page_path(id: @isa_assay.assay.projects.first, item_type: 'assay', - item_id: @isa_assay.assay, notice: 'The ISA assay was created successfully!') + flash[:notice] = "The #{t('isa_assay')} was successfully created.
".html_safe + respond_to do |format| + format.html do + redirect_to single_page_path(id: @isa_assay.assay.projects.first, item_type: 'assay', + item_id: @isa_assay.assay) + end + format.json { render json: @isa_assay, include: [params[:include]] } + end else respond_to do |format| - format.html { render action: 'new' } + format.html { render action: 'new', status: :unprocessable_entity } format.json { render json: json_api_errors(@isa_assay), status: :unprocessable_entity } end end end def edit - # let edit the assay if the sample_type is not authorized - if @isa_assay.assay.is_assay_stream? - @isa_assay.sample_type = nil - else - @isa_assay.sample_type = nil unless requested_item_authorized?(@isa_assay.sample_type) - end - - respond_to do |format| - format.html - end + respond_to(&:html) end def update @isa_assay.assay.attributes = isa_assay_params[:assay] # update the sample_type - unless @isa_assay.assay.is_assay_stream? + unless @isa_assay&.assay&.is_assay_stream? if requested_item_authorized?(@isa_assay.sample_type) @isa_assay.sample_type.update(isa_assay_params[:sample_type]) @isa_assay.sample_type.resolve_inconsistencies @@ -53,6 +77,7 @@ def update end if @isa_assay.save + flash[:notice] = "The #{t('isa_assay')} was successfully updated.
".html_safe redirect_to single_page_path(id: @isa_assay.assay.projects.first, item_type: 'assay', item_id: @isa_assay.assay.id) else @@ -68,23 +93,18 @@ def update def fix_assay_linkage_for_new_assays return unless @isa_assay.assay.is_isa_json_compliant? return if @isa_assay.assay.is_assay_stream? # Should not fix anything when creating an assay stream + return unless @isa_assay.sample_type.present? # Just to be sure previous_sample_type = SampleType.find(params[:isa_assay][:input_sample_type_id]) - previous_assay = previous_sample_type.assays.first + next_sample_types = previous_sample_type.next_linked_sample_types + next_sample_types.delete @isa_assay.sample_type + next_sample_type = next_sample_types.first - # In case an assay is inserted right at the beginning of an assay stream, - # the next assay is the current first one in the assay stream. - next_assay = previous_assay.nil? ? @isa_assay.assay.assay_stream.next_linked_child_assay : previous_assay.next_linked_child_assay + # In case an assay is inserted right at the end of an assay stream, + # there is no next sample type and also no linkage to fix + return if next_sample_type.nil? - # In case no next assay (an assay was appended to the end of the stream), assay linkage does not have to be fixed. - return unless next_assay - - next_assay_input_attribute_id = next_assay.sample_type.sample_attributes.detect(&:input_attribute?).id - return unless next_assay_input_attribute_id - - # Add link of next assay sample type to currently created assay sample type - updated_lsai = @isa_assay.assay.sample_type.linked_sample_attribute_ids.push(next_assay_input_attribute_id) - @isa_assay.assay.sample_type.update(linked_sample_attribute_ids: updated_lsai) + next_sample_type.sample_attributes.detect(&:input_attribute?).update_column(:linked_sample_type_id, @isa_assay.sample_type.id) end def rearrange_assay_positions_create_isa_assay @@ -176,20 +196,29 @@ def set_up_instance_variable end def find_requested_item - if params[:is_assay_stream] - @isa_assay = IsaAssay.new({ assay: { assay_class_id: AssayClass.assay_stream.id } }) + @isa_assay = IsaAssay.new + @isa_assay.populate(params[:id]) + + if @isa_assay.assay.nil? + @isa_assay.errors.add(:assay, "The #{t('isa_assay')} was not found.") else - @isa_assay = IsaAssay.new({ assay: { assay_class_id: AssayClass.experimental.id } }) + @isa_assay.errors.add(:assay, "You are not authorized to edit this #{t('isa_assay')}.") unless requested_item_authorized?(@isa_assay.assay) end - @isa_assay.populate(params[:id]) # Should not deal with sample type if assay has assay_class assay stream - return if @isa_assay.assay.is_assay_stream? - - if @isa_assay.sample_type.nil? || !requested_item_authorized?(@isa_assay.assay) - flash[:error] = "You are not authorized to edit this #{t('isa_assay')}" - flash[:error] = 'Resource not found.' if @isa_assay.sample_type.nil? + unless @isa_assay.assay&.is_assay_stream? + if @isa_assay.sample_type.nil? + @isa_assay.errors.add(:sample_type, 'Sample type not found.') + else + @isa_assay.errors.add(:sample_type, "You are not authorized to edit this assay's #{t('sample_type')}.") unless requested_item_authorized?(@isa_assay.sample_type) + end + end + if @isa_assay.errors.any? + error_messages = @isa_assay.errors.map do |error| + "
  • [#{error.attribute.to_s}]: #{error.message}
  • " + end.join('') + flash[:error] = "".html_safe redirect_to single_page_path(id: @isa_assay.assay.projects.first, item_type: 'assay', item_id: @isa_assay.assay) end diff --git a/app/controllers/isa_studies_controller.rb b/app/controllers/isa_studies_controller.rb index a060bf16bc..791575e4d2 100644 --- a/app/controllers/isa_studies_controller.rb +++ b/app/controllers/isa_studies_controller.rb @@ -6,7 +6,7 @@ class IsaStudiesController < ApplicationController before_action :find_requested_item, only: %i[edit update] def new - @isa_study = IsaStudy.new + @isa_study = IsaStudy.new({ study: { investigation_id: params[:investigation_id] } }) end def create @@ -36,12 +36,7 @@ def create end def edit - @isa_study.source = nil unless requested_item_authorized?(@isa_study.source) - @isa_study.sample_collection = nil unless requested_item_authorized?(@isa_study.sample_collection) - - respond_to do |format| - format.html - end + respond_to(&:html) end def update @@ -132,8 +127,20 @@ def set_up_instance_variable def find_requested_item @isa_study = IsaStudy.new @isa_study.populate(params[:id]) - unless requested_item_authorized?(@isa_study.study) - flash[:error] = "You are not authorized to edit this #{t('isa_study')}" + + @isa_study.errors.add(:study, "The #{t('isa_study')} was not found.") if @isa_study.study.nil? + @isa_study.errors.add(:study, "You are not authorized to edit this #{t('isa_study')}.") unless requested_item_authorized?(@isa_study.study) + + @isa_study.errors.add(:sample_type, "'Study source' #{t('sample_type')} not found.") if @isa_study.source.nil? + @isa_study.errors.add(:sample_type, "You are not authorized to edit the 'study source' #{t('sample_type')}.") unless requested_item_authorized?(@isa_study.source) + @isa_study.errors.add(:sample_type, "'Study sample' #{t('sample_type')} not found.") if @isa_study.sample_collection.nil? + @isa_study.errors.add(:sample_type, "You are not authorized to edit the 'study sample' #{t('sample_type')}.") unless requested_item_authorized?(@isa_study.sample_collection) + + if @isa_study.errors.any? + error_messages = @isa_study.errors.map do |error| + "
  • [#{error.attribute.to_s}]: #{error.message}
  • " + end.join('') + flash[:error] = "".html_safe redirect_to single_page_path(id: @isa_study.study.projects.first, item_type: 'study', item_id: @isa_study.study) end diff --git a/app/controllers/models_controller.rb b/app/controllers/models_controller.rb index f004947c25..4b3929b9ca 100644 --- a/app/controllers/models_controller.rb +++ b/app/controllers/models_controller.rb @@ -37,9 +37,9 @@ def compare_versions json = compare @blob1.filepath, @blob2.filepath, ["reportHtml", "crnJson", "json", "SBML"] @crn = JSON.parse(json)["crnJson"] @comparison_html = JSON.parse(json)["reportHtml"] - rescue StandardError => e + rescue Exception => e raise e unless Rails.env.production? - flash.now[:error]="there was an error trying to compare the two versions - #{e.message}" + flash.now[:error]="there was an error trying to compare the two versions - #{e.message.gsub(/[\s\S]*STDERR:/,'')}" end else flash.now[:error]="One of the version files could not be found, or you are not authorized to examine it" diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e864a5b2d0..cc7b6080e8 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -543,77 +543,206 @@ def order_investigations def publish_to_csh @project = Project.find(params[:id]) - data = @project.to_json - #host = Seek::Config.site_base_host - #url = host + '/projects' - project_attributes_json= ProjectSerializer.new(@project).to_json #Project.find(params[:id]) - - @user_current=current_person - user_json=@user_current.to_json - project_attributes_json_parse=JSON.parse(project_attributes_json) - - meta_data=JSON.parse(@project.to_json(only:[:created_at,:updated_at, :uuid])) - meta_data=meta_data.transform_keys { |key| key == "created_at" ? "created" : key } - meta_data=meta_data.transform_keys { |key| key == "updated_at" ? "modified" : key } + project_attributes_json = ProjectSerializer.new(@project).to_json + + @user_current = current_person + special_characters = { + '\\u0026' => '__AMP__', + '\\u003c' => '__LT__', + '\\u003e' => '__GT__', + '\\u0022' => '__QUOTE__' + } + + # Replace special characters with placeholders + special_characters.each do |char, placeholder| + project_attributes_json.gsub!(char, placeholder) + end + project_attributes_json_parse = JSON.parse(project_attributes_json) + + meta_data = JSON.parse(@project.to_json(only:[:created_at,:updated_at, :uuid])) + meta_data = meta_data.transform_keys { |key| key == 'created_at' ? 'created' : key } + meta_data = meta_data.transform_keys { |key| key == 'updated_at' ? 'modified' : key } meta_data['api_version'] = ActiveModel::Serializer.config.api_version.to_s meta_data['base_url'] = Seek::Config.site_base_host meta_data = {meta: meta_data} - selected_keys = ["project_administrators", "pals", "asset_housekeepers", "asset_gatekeepers", "organisms", - "human_diseases", "people", "institutions", "programmes", "investigations", "studies", - "assays", "data_files", "project_relationships_json_files", "file_templates", "placeholders", - "models", "sops", "publications", "presentations", "events", "documents", "workflows", "collections"] + selected_keys = %w[project_administrators pals asset_housekeepers asset_gatekeepers organisms human_diseases people + institutions programmes investigations studies assays data_files project_relationships_json_files + file_templates placeholders models sops publications presentations events documents workflows + collections] project_relationships_json_parse = project_attributes_json_parse.select { |key, _| selected_keys.include?(key) } project_relationships_json = {relationships: project_relationships_json_parse} - for item in selected_keys do + selected_keys.each do |item| project_attributes_json_parse.delete(item) end project_attributes_json = {attributes: project_attributes_json_parse} - attributes_selected_json_parse=project_attributes_json.merge(project_relationships_json) - attributes_selected_json_parse=attributes_selected_json_parse.merge(meta_data) - attributes_selected_json_parse['id']=@project.id.to_s - attributes_selected_json_parse['type']="projects" - attributes_selected_json_parse['jsonapi']= { "version" => "1.0" } - attributes_selected_json_parse['links']= { "self" => "/projects/"+@project.id.to_s} + attributes_selected_json_parse = project_attributes_json.merge(project_relationships_json) + attributes_selected_json_parse = attributes_selected_json_parse.merge(meta_data) + attributes_selected_json_parse['id'] = @project.id.to_s + attributes_selected_json_parse['type'] = 'projects' + attributes_selected_json_parse['jsonapi'] = { 'version' => '1.0' } + attributes_selected_json_parse['links'] = { 'self' => "/projects/#{@project.id}"} user_attributes_selected_json_parse = {data: attributes_selected_json_parse} - password=Seek::Config.n4h_password + password = Seek::Config.n4h_password url = Seek::Config.n4h_url.blank? ? nil : Seek::Config.n4h_url authorization_url = Seek::Config.n4h_authorization_url.blank? ? nil : Seek::Config.n4h_authorization_url username = Seek::Config.n4h_username.blank? ? nil : Seek::Config.n4h_username - url_publish=Seek::Config.n4h_publish_url.blank? ? nil : Seek::Config.n4h_publish_url#"https://csh.nfdi4health.de/api/resource/" - endpoints = Nfdi4Health::Client.new(authorization_url) - endpoints.send_transforming_api(user_attributes_selected_json_parse.to_json,url) + url_publish = Seek::Config.n4h_publish_url.blank? ? nil : Seek::Config.n4h_publish_url + begin + endpoints = Nfdi4Health::Client.new() + endpoints.send_transforming_api(user_attributes_selected_json_parse.to_json, url) + rescue RestClient::ExceptionWithResponse => e + flash[:error] = if e.response + "HTTP Status: #{e.response.code} - #{e.response.body}" + else + "RestClient::ExceptionWithResponse occurred without a response: #{e.message}" + end +respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + + return + rescue RestClient::RequestTimeout => e + flash[:error] = 'Request Timeout: The server took too long to respond.' + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue SocketError => e + flash[:error] = 'Network Error: Please check your internet connection.' + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue StandardError => e + flash[:error] = "An unexpected error occurred: #{e.message}" + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + end + # Convert placeholders back to special characters in the final JSON + final_json_string = endpoints.to_json + special_characters.each do |char, placeholder| + final_json_string.gsub!(placeholder, char) + end + + project_transformed_hash = JSON.parse(JSON.parse(final_json_string)['transformed']) + - project_transformed_hash=JSON.parse(JSON.parse(endpoints.to_json)['transformed']) project_transformed_update_hash = project_transformed_hash#{data: project_transformed_hash } - current_person_json=current_person.to_json - current_person_json_parsed=JSON.parse(current_person_json) - selected_keys = ["first_name", "last_name","email"] + current_person_json = current_person.to_json + current_person_json_parsed = JSON.parse(current_person_json) + selected_keys = ['first_name', 'last_name','email'] current_person_json_parsed_filtered = current_person_json_parsed.select { |key, _| selected_keys.include?(key) } sender_part = {sender: current_person_json_parsed_filtered } - sender_project_merged=sender_part.merge(project_transformed_update_hash) - - endpoints.get_token(authorization_url,username,password) - token_respond_hash=JSON.parse(endpoints.to_json) - access_token=token_respond_hash['token'] - access_token_hash=JSON.parse(access_token) - one_time_token=access_token_hash['access_token'] - endpoints.publish_csh(sender_project_merged.to_json,url_publish,one_time_token) - identifier=JSON.parse(JSON.parse(endpoints.to_json)["endpoint"])["resource"]["identifier"] + sender_project_merged = sender_part.merge(project_transformed_update_hash) + begin + endpoints.get_token(authorization_url,username,password) + rescue RestClient::ExceptionWithResponse => e + flash[:error] = endpoints.handle_restclient_error(e,"get_token") + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue RestClient::RequestTimeout + flash[:error] = "Request Timeout: The server took too long to respond." + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue SocketError + flash[:error] = "Network Error: Please check your internet connection." + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue StandardError => e + flash[:error] = "An unexpected error occurred: #{e.message}" + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + end + token_respond_hash = JSON.parse(endpoints.to_json) + access_token = token_respond_hash['token'] + access_token_hash = JSON.parse(access_token) + one_time_token = access_token_hash['access_token'] + begin + endpoints.publish_csh(sender_project_merged.to_json,url_publish,one_time_token) + rescue RestClient::ExceptionWithResponse => e + flash[:error] = endpoints.handle_restclient_error(e,"publish_csh") + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue RestClient::RequestTimeout + flash[:error] = "Request Timeout: The server took too long to respond." + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue SocketError + flash[:error] = "Network Error: Please check your internet connection." + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + rescue StandardError => e + flash[:error] = "An unexpected error occurred: #{e.message}" + respond_to do |format| + format.html { redirect_to(@project) } + format.rdf { render template: 'rdf/show' } + format.json { render json: { error: flash[:error] }, status: :unprocessable_entity } + end + return + end + if !JSON.parse(JSON.parse(endpoints.to_json)['endpoint'])['resource'].nil? + identifier = JSON.parse(JSON.parse(endpoints.to_json)['endpoint'])['resource']['identifier'] + if !project_transformed_update_hash['resource']['identifier'].nil? + flash[:notice] ="#{t('project')} was successfully updated with ID #{identifier}." + else + flash[:notice] ="#{t('project')} was successfully published with ID #{identifier}." + em = @project.extended_metadata + jem = JSON.parse(em.json_metadata) + jem['Resource_identifier_Project'] = identifier + em.update_column(:json_metadata, jem.to_json) + end + else + flash[:notice] = JSON.parse(JSON.parse(endpoints.to_json)['endpoint']) + end - flash[:notice] = "#{t('project')} was successfully published with ID #{identifier}." respond_to do |format| - #@project.reload - #flash[:notice] = "#{t('project')} was successfully published." format.html { redirect_to(@project) } - #format.html { render(params[:only_content] ? { layout: false } : {})} # show.html.erb format.rdf { render template: 'rdf/show' } format.json { render json: @project, include: [params[:include]] } end @@ -771,11 +900,11 @@ def respond_create_project_request requester = @message_log.sender if params['accept_request']=='1' - if params['institution']['id'] - @institution = Institution.find(params['institution']['id']) - else - @institution = Institution.new(params.require(:institution).permit([:title, :web_page, :city, :country])) - end + @institution = if params['institution']['id'] + Institution.find(params['institution']['id']) + else + Institution.new(params.require(:institution).permit([:title, :web_page, :city, :country])) + end @project = Project.new(params.require(:project).permit([:title, :web_page, :description])) @project.programme = @programme @@ -832,11 +961,11 @@ def respond_import_project_request # @programme already populated in before_filter when checking permissions make_programme_admin = @programme&.new_record? - if params['institution']['id'] - @institution = Institution.find(params['institution']['id']) - else - @institution = Institution.new(params.require(:institution).permit([:title, :web_page, :city, :country])) - end + @institution = if params['institution']['id'] + Institution.find(params['institution']['id']) + else + Institution.new(params.require(:institution).permit([:title, :web_page, :city, :country])) + end @project = Project.new(params.require(:project).permit([:title, :web_page, :description])) @project.programme = @programme @@ -1153,11 +1282,11 @@ def check_message_log_programme_permissions return unless @programme || params['programme'] unless @programme - if params['programme']['id'] - @programme = Programme.find(params['programme']['id']) - else - @programme = Programme.new(params.require(:programme).permit([:title])) - end + @programme = if params['programme']['id'] + Programme.find(params['programme']['id']) + else + Programme.new(params.require(:programme).permit([:title])) + end end if @programme.new_record? diff --git a/app/controllers/single_pages_controller.rb b/app/controllers/single_pages_controller.rb index e25a7db2c6..b3015c123d 100644 --- a/app/controllers/single_pages_controller.rb +++ b/app/controllers/single_pages_controller.rb @@ -47,7 +47,7 @@ def dynamic_table_data rescue Exception => e render json: { status: :unprocessable_entity, error: e.message } end - + def download_samples_excel sample_ids, sample_type_id, study_id, assay_id = Rails.cache.read(params[:uuid]).values_at(:sample_ids, :sample_type_id, :study_id, :assay_id) @@ -94,7 +94,10 @@ def download_samples_excel rescue StandardError => e flash[:error] = e.message respond_to do |format| - format.html { redirect_to single_page_path(@project.id) } + format.html do + redirect_to single_page_path(id: @project.id, item_type: @assay.nil? ? 'study' : 'assay', + item_id: @assay.nil? ? @study.id : @assay.id) + end format.json do render json: { parameters: { sample_ids:, sample_type_id:, study_id: }, errors: e }, status: :bad_request end @@ -244,7 +247,7 @@ def get_spreadsheet_data(samples_sheet) next if sample_cells.all? { |cell| (cell&.value == '' || cell&.value.nil?) } sample_cells.map do |cell| - cell&.value + cell&.value unless cell&.value == '' end.drop(1) end.compact @@ -334,7 +337,7 @@ def separate_unauthorized_samples(existing_excel_samples, db_samples, authorized is_changed = false db_sample.map do |k, v| - unless ees[k] == v + unless ees[k] == v || %w[id uuid].include?(k) is_changed = true break end diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 908b9e0b27..921d1fc863 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -94,7 +94,7 @@ def populate_template dir = Seek::Config.append_filestore_path('source_types') if Dir.exist?(dir) - `rm #{dir}/*` + FileUtils.rm_f(Dir.glob("#{dir}/*")) else FileUtils.mkdir_p(dir) end @@ -172,7 +172,7 @@ def set_status elsif File.exist?(resultfile) res = File.read(resultfile) @status = res - `rm #{resultfile}` + FileUtils.rm_f(resultfile) else @status = 'not_started' end @@ -187,12 +187,12 @@ def resultfile end def running! - `touch #{lockfile}` + FileUtils.touch(lockfile) set_status end def done! - `rm -f #{lockfile}` + FileUtils.rm_f(lockfile) end def running? diff --git a/app/forms/isa_assay.rb b/app/forms/isa_assay.rb index 7c6679d4b3..7e90b8751f 100644 --- a/app/forms/isa_assay.rb +++ b/app/forms/isa_assay.rb @@ -21,7 +21,7 @@ def save if valid? if @assay.new_record? && !@assay.is_assay_stream? # connect the sample type multi link attribute to the last sample type of the assay's study - input_attribute = @sample_type.sample_attributes.detect(&:seek_sample_multi?) + input_attribute = @sample_type.sample_attributes.detect(&:input_attribute?) input_attribute.linked_sample_type_id = @input_sample_type_id title = SampleType.find(@input_sample_type_id).sample_attributes.detect(&:is_title).title input_attribute.title = "Input (#{title})" diff --git a/app/helpers/data_files_helper.rb b/app/helpers/data_files_helper.rb index 67d9d12f46..917fe91da2 100644 --- a/app/helpers/data_files_helper.rb +++ b/app/helpers/data_files_helper.rb @@ -3,6 +3,10 @@ def authorised_data_files(projects = nil) authorised_assets(DataFile, projects) end + def authorised_assay_assets(data_file) + data_file.assay_assets.where(assay_id: authorised_assays.collect(&:id)) + end + def split_into_two(ahash = {}) return [{}, {}] if ahash.nil? return [ahash, {}] if ahash.length < 2 diff --git a/app/helpers/samples_helper.rb b/app/helpers/samples_helper.rb index a4ec9bdf26..5b64323f74 100644 --- a/app/helpers/samples_helper.rb +++ b/app/helpers/samples_helper.rb @@ -81,6 +81,8 @@ def sample_form_field(attribute, element_name, value, limit = 1) value = [value] unless value.is_a?(Array) value.compact.each do |v| id = v[:id] + next if id.blank? # Skip value if there is no ID + title = v[:title] title = 'Hidden' unless Sample.find(id).can_view? existing_objects << str.new(id, title) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 1960662ebf..39824e8ed8 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -3,7 +3,7 @@ module SearchHelper def search_type_options - [['All', '']] | Seek::Util.searchable_types.collect { |c| [(c.name.underscore.humanize == 'Sop' ? t('sop') : c.name.underscore.humanize.pluralize), c.name.underscore.pluralize] } + [['All', '']] | Seek::Util.searchable_types.collect { |c| [(c.name.underscore.humanize == 'Sop' ? t('sop') : t(c.name.underscore).humanize.pluralize), c.name.underscore.pluralize] } end def external_search_tooltip_text diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index 703b72c9fc..5b994523fa 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -59,7 +59,7 @@ def queue_job(priority = nil, delay = default_delay) end def report_exception(exception, message = nil, data = {}) - data.merge!({job_class: self.class.name}) + data.merge!({job_class: self.class.name, arguments: arguments.inspect}) message ||= "Error executing job for #{self.class.name}" Seek::Errors::ExceptionForwarder.send_notification(exception, data: data) Rails.logger.error(message) diff --git a/app/jobs/auth_lookup_maintenance_job.rb b/app/jobs/auth_lookup_maintenance_job.rb new file mode 100644 index 0000000000..14c4d73fcd --- /dev/null +++ b/app/jobs/auth_lookup_maintenance_job.rb @@ -0,0 +1,39 @@ +class AuthLookupMaintenanceJob < ApplicationJob + RUN_PERIOD = 8.hours.freeze + + queue_as QueueNames::AUTH_LOOKUP + queue_with_priority 3 + + def perform + check_authlookup_consistency + end + + # checks lookup_table_consistent? on each type for each user, and if not triggers a job to repopulate for that user + def check_authlookup_consistency + found_types = [].to_set + + Seek::Util.authorized_types.each do |type| + #skip if there are any items of this type queued + next if AuthLookupUpdateQueue.where(item_type: type.name).any? + + items_for_queue = [].to_set + + User.where.not(person_id: nil).to_a.push(nil).each do |user| + + # skip if this user or person is queued up + next if user && AuthLookupUpdateQueue.where(item: user).or(AuthLookupUpdateQueue.where(item: user.person)).any? + + next if type.lookup_table_consistent?(user) + + items_for_queue.merge(type.items_missing_from_authlookup(user)) + found_types << type + end + AuthLookupUpdateQueue.enqueue(items_for_queue.to_a) unless items_for_queue.empty? + end + + found_types.each(&:remove_invalid_auth_lookup_entries) + end + + + +end \ No newline at end of file diff --git a/app/jobs/regular_maintenance_job.rb b/app/jobs/regular_maintenance_job.rb index 139fe3c52a..d42afdf85e 100644 --- a/app/jobs/regular_maintenance_job.rb +++ b/app/jobs/regular_maintenance_job.rb @@ -20,7 +20,6 @@ def perform clean_git_repositories resend_activation_emails remove_unregistered_users - check_authlookup_consistency end private @@ -73,26 +72,4 @@ def resend_activation_emails end end - # checks lookup_table_consistent? on each type for each user, and if not triggers a job to repopulate for that user - # if not already queued - def check_authlookup_consistency - found_types = [].to_set - items_for_queue = [].to_set - User.where.not(person_id: nil).to_a.push(nil).each do |user| - - # will only deal with 1 type per user per run - found = Seek::Util.authorized_types.find do |type| - !type.lookup_table_consistent?(user) - end - - next unless found.present? - - found_types << found - missing = found.items_missing_from_authlookup(user) - items_for_queue.merge(missing) - end - - found_types.each(&:remove_invalid_auth_lookup_entries) - AuthLookupUpdateQueue.enqueue(items_for_queue.to_a) unless items_for_queue.empty? - end end diff --git a/app/jobs/reindexing_job.rb b/app/jobs/reindexing_job.rb index ff45e69e65..a19281775e 100644 --- a/app/jobs/reindexing_job.rb +++ b/app/jobs/reindexing_job.rb @@ -25,7 +25,7 @@ def gather_items end def follow_on_job? - ReindexingQueue.any? + Seek::Config.solr_enabled && ReindexingQueue.any? end def timelimit diff --git a/app/jobs/user_auth_lookup_update_job.rb b/app/jobs/user_auth_lookup_update_job.rb index 957c9320f0..6ea614771d 100644 --- a/app/jobs/user_auth_lookup_update_job.rb +++ b/app/jobs/user_auth_lookup_update_job.rb @@ -2,11 +2,21 @@ class UserAuthLookupUpdateJob < ApplicationJob queue_as QueueNames::AUTH_LOOKUP queue_with_priority 0 + BATCH_SIZE = 8000 - def perform(user, type) - type.constantize.includes(policy: :permissions).find_each do |item| + # needs longer, otherwise the samples can time out + def timelimit + 30.minutes + end + + def perform(user, type, offset = 0) + type.constantize.offset(offset).limit(BATCH_SIZE).includes(policy: :permissions).each do |item| item.update_lookup_table(user) end + + offset += BATCH_SIZE + + self.class.perform_later(user, type, offset) if offset < type.constantize.count end end diff --git a/app/models/git/repository.rb b/app/models/git/repository.rb index 4d5d52f106..0d7a072a05 100644 --- a/app/models/git/repository.rb +++ b/app/models/git/repository.rb @@ -44,13 +44,14 @@ def remote_refs refs[:branches] << h end - git_base.tags.each do |tag| + git_base.tags.to_a.sort_by do |tag| + tag.target.time + end.reverse.each do |tag| h = { name: tag.name, ref: tag.canonical_name, sha: tag.target.oid } refs[:tags] << h end refs[:branches] = refs[:branches].sort_by { |x| [x[:default] ? 0 : 1, x[:name].downcase] } - refs[:tags] = refs[:tags].sort_by { |x| x[:name] } refs end diff --git a/app/models/reindexing_queue.rb b/app/models/reindexing_queue.rb index e01186c0cd..40a988713c 100644 --- a/app/models/reindexing_queue.rb +++ b/app/models/reindexing_queue.rb @@ -1,7 +1,13 @@ class ReindexingQueue < ApplicationRecord include ResourceQueue + def self.enqueue(*items, priority: DEFAULT_PRIORITY, queue_job: true) + return unless Seek::Config.solr_enabled + super(items, priority: priority, queue_job: queue_job) + end + def self.job_class ReindexingJob end + end diff --git a/app/models/sample_attribute.rb b/app/models/sample_attribute.rb index 740f673e21..9740e0c3fe 100644 --- a/app/models/sample_attribute.rb +++ b/app/models/sample_attribute.rb @@ -11,7 +11,7 @@ class SampleAttribute < ApplicationRecord auto_strip_attributes :pid validates :sample_type, presence: true - validates :pid, format: { with: URI::regexp, allow_blank: true, allow_nil: true, message: 'not a valid URI' } + validates :pid, format: { with: URI::ABS_URI, allow_blank: true, allow_nil: true, message: 'not a valid URI' } validate :validate_against_editing_constraints, if: -> { sample_type.present? } before_save :store_accessor_name @@ -64,7 +64,14 @@ def template_column_definition def short_pid return '' unless pid.present? - URI.parse(pid).fragment || pid.gsub(/.*\//,'') || pid + begin + URI.parse(pid).fragment || pid.gsub(/.*\//,'') || pid + rescue URI::InvalidURIError + # likely a space that managed to pass through earlier uri validation + fixed_pid = pid.gsub(' ','-') + URI.parse(fixed_pid).fragment || fixed_pid.gsub(/.*\//,'') || fixed_pid + end + end def linked_extended_metadata_type diff --git a/app/models/sample_controlled_vocab_term.rb b/app/models/sample_controlled_vocab_term.rb index 4f1791e66f..092c85a9a5 100644 --- a/app/models/sample_controlled_vocab_term.rb +++ b/app/models/sample_controlled_vocab_term.rb @@ -1,7 +1,7 @@ class SampleControlledVocabTerm < ApplicationRecord belongs_to :sample_controlled_vocab, inverse_of: :sample_controlled_vocab_terms - validates :label, presence: true, length: { maximum: 500 } + validates :label, presence: true, length: { maximum: 500 }, uniqueness: { scope: :sample_controlled_vocab_id } before_validation :truncate_label diff --git a/app/models/sample_type.rb b/app/models/sample_type.rb index d64709da02..b7ba82c750 100644 --- a/app/models/sample_type.rb +++ b/app/models/sample_type.rb @@ -128,7 +128,13 @@ def self.can_create? def can_edit?(user = User.current_user) return false if user.nil? || user.person.nil? || !Seek::Config.samples_enabled return true if user.is_admin? - contributor == user.person || projects.detect { |project| project.can_manage?(user) }.present? + + # Make the ISA JSON compliant sample types editable when a user is a project member instead of a project admin + if is_isa_json_compliant? + contributor == user.person || projects.detect { |project| project.has_member? user.person }.present? + else + contributor == user.person || projects.detect { |project| project.can_manage?(user) }.present? + end end def can_delete?(user = User.current_user) diff --git a/app/models/template.rb b/app/models/template.rb index de1beeaf88..12131d9518 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -24,8 +24,7 @@ def can_edit?(user = User.current_user) end def self.can_create? - can = User.logged_in_and_member? && Seek::Config.samples_enabled - can && User.current_user.is_admin_or_project_administrator? + super && Seek::Config.samples_enabled && User.current_user.is_admin_or_project_administrator? end def resolve_inconsistencies diff --git a/app/models/user.rb b/app/models/user.rb index ed0e487e03..6d0f25e762 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -67,7 +67,7 @@ class User < ApplicationRecord delegate :is_admin_or_project_administrator?, to: :person, allow_nil: true delegate :is_programme_administrator?, to: :person, allow_nil: true - after_commit :queue_update_auth_table, on: :create + after_save_commit :queue_update_auth_table after_destroy :queue_auth_lookup_delete_job @@ -336,7 +336,9 @@ def email_available? end def queue_update_auth_table - AuthLookupUpdateQueue.enqueue(self) + if saved_changes.keys.include?("person_id") + AuthLookupUpdateQueue.enqueue(self, priority: 1) + end end def queue_auth_lookup_delete_job diff --git a/app/serializers/base_serializer.rb b/app/serializers/base_serializer.rb index 46c6a3a7af..d77b6f05ec 100644 --- a/app/serializers/base_serializer.rb +++ b/app/serializers/base_serializer.rb @@ -121,8 +121,6 @@ def BaseSerializer.permits policy end end - - attribute :extended_attributes, if: -> { object.respond_to?(:extended_metadata) && object.extended_metadata&.enabled? } do { extended_metadata_type_id: object.extended_metadata.extended_metadata_type_id.to_s, attribute_map: object.extended_metadata.data.to_hash } diff --git a/app/views/assays/show.html.erb b/app/views/assays/show.html.erb index fabd8c63f9..e0c12ee449 100644 --- a/app/views/assays/show.html.erb +++ b/app/views/assays/show.html.erb @@ -160,7 +160,7 @@ <%= tab_pane('related-items') do %> <%= render partial: 'general/items_related_to', object: @assay %> <% end %> - <% if Seek::Config.isa_json_compliance_enabled && @assay.is_isa_json_compliant? %> + <% if Seek::Config.isa_json_compliance_enabled && @assay.is_isa_json_compliant? && !@assay.is_assay_stream? %> <%= tab_pane('assay_design') do %> <%= render :partial=>"isa_assays/assay_design", locals: { assay: @assay} -%> <%= render partial: 'single_pages/change_batch_persmission_modal' %> diff --git a/app/views/assets/_asset_buttons.html.erb b/app/views/assets/_asset_buttons.html.erb index 9d26ddbc7f..cba08d71d2 100644 --- a/app/views/assets/_asset_buttons.html.erb +++ b/app/views/assets/_asset_buttons.html.erb @@ -33,7 +33,7 @@ <% if can_download_asset?(asset, params[:code]) -%> <% if asset.is_a?(Workflow) %> <% if display_asset.is_git_versioned? || asset.content_blob&.file_exists? %> - <%= button_link_to('Download RO Crate', 'ro_crate_file', ro_crate_workflow_path(asset, version: version, code: params[:code]), + <%= button_link_to('Download RO-Crate', 'ro_crate_file', ro_crate_workflow_path(asset, version: version, code: params[:code]), 'data-tooltip' => tooltip("The Workflow RO-Crate is a package containing the workflow definition, its metadata and supporting resources like test data")) %> <% if asset.can_run? %> <%= button_link_to("Run on Galaxy", 'run_galaxy', display_asset.run_url) %> diff --git a/app/views/assets/_upload.html.erb b/app/views/assets/_upload.html.erb index 17c61999ec..6257a80bcb 100644 --- a/app/views/assets/_upload.html.erb +++ b/app/views/assets/_upload.html.erb @@ -85,7 +85,11 @@ <% if batch %>
    - <%= button_link_to 'Add', 'new', '#', 'data-role' => 'seek-upload-field-add-remote' %> + +
    +
    + <%= button_link_to 'Add', 'new', '#', 'data-role' => 'seek-upload-field-add-remote' %>
    <%= content_tag :script, existing_objects.map { |o| { text: "#{o.url.blank? ? o.original_filename : o.url} (original)", id: o.id } }.to_json.html_safe, diff --git a/app/views/data_files/confirm_extraction.html.erb b/app/views/data_files/confirm_extraction.html.erb index c163b63d65..66bc8d2084 100644 --- a/app/views/data_files/confirm_extraction.html.erb +++ b/app/views/data_files/confirm_extraction.html.erb @@ -56,11 +56,11 @@ <%= hidden_field_tag(:sample_type_id, @sample_type.id) if @sample_type %> <%= hidden_field_tag(:confirm, 'true') %> - <% if @data_file.assay_assets.any? %> + <% if authorised_assays.intersect?(@data_file.assays) %>

    Link to assays

    This data file is linked to the following assays. Check the corresponding checkbox to also link the above samples to that assay. - <% @data_file.assay_assets.each do |aa| %> + <% authorised_assay_assets(@data_file).each do |aa| %>
    - <% if show_extended_metadata %> + <%# Show extended metadata is assay is of class assay_stream %> + <% if is_assay_stream %> <%= render partial: 'extended_metadata/extended_metadata_type_selection', locals:{f:assay_fields, resource:@isa_assay.assay} %> <%= render partial: 'extended_metadata/extended_metadata_attribute_input', locals:{f:assay_fields,resource:@isa_assay.assay, parent_resource: "isa_assay"} %> <% end %> - + <%= assay_fields.hidden_field :study_id %> <% if is_assay_stream %>
    <%= assay_fields.label "Assay position" -%>
    - <%= assay_fields.number_field :position, rows: 5, class: "form-control", value: assay_position %> + <%= assay_fields.number_field :position, rows: 5, class: "form-control" %>
    <% else %> <% end %> - <%= assay_fields.hidden_field :assay_stream_id, value: assay_stream_id -%> - <%= assay_fields.hidden_field :assay_class_id, value: assay_class_id -%> + <%= assay_fields.hidden_field :assay_stream_id -%> + <%= assay_fields.hidden_field :assay_class_id -%> - <% unless is_assay_stream %> + <% if is_assay_stream %> + <% if User.current_user -%> + <%= render partial: 'assets/manage_specific_attributes', locals:{f:assay_fields} if show_form_manage_specific_attributes? %> + <% end %> + <% else %> <% if User.current_user -%> <%= render partial: 'assets/manage_specific_attributes', locals:{f:assay_fields} if show_form_manage_specific_attributes? %> <%= assay_fields.fancy_multiselect(:sops, other_projects_checkbox: true, name: "isa_assay[assay][sop_ids]")%> @@ -93,7 +55,7 @@ <% end -%> <% end -%> -<%= f.hidden_field :input_sample_type_id, value: input_sample_type_id -%> +<%= f.hidden_field :input_sample_type_id -%> <% unless is_assay_stream %> <%= folding_panel("Define #{t(:sample_type)} for #{t(:assay)}") do %> @@ -106,7 +68,8 @@ <%= render partial: 'projects/implicit_project_selector', locals: { action: action, select_id: '#isa_assay_assay_study_id', - parents: Study.authorized_for('edit') } %> + parents: Study.authorized_for('edit'), + skip_on_page_load: true} %> diff --git a/app/views/isa_studies/_buttons.html.erb b/app/views/isa_studies/_buttons.html.erb index 47466814c3..55d68466fb 100644 --- a/app/views/isa_studies/_buttons.html.erb +++ b/app/views/isa_studies/_buttons.html.erb @@ -48,7 +48,7 @@ uploadExcel||="studySampleUploadExcel()" if (res?.status == "unprocessable_entity"){ alert(res?.error) } else { - $j('#change-batch-permission-modal').modal('show').focus(); + $j('#change-batch-permission-modal').modal({backdrop: 'static', keyboard: false}).focus(); $j('#change-batch-permission').html(res); ObjectsInput.init(); } diff --git a/app/views/isa_studies/_form.html.erb b/app/views/isa_studies/_form.html.erb index 0a752e8d0d..673537af2c 100644 --- a/app/views/isa_studies/_form.html.erb +++ b/app/views/isa_studies/_form.html.erb @@ -23,10 +23,6 @@ <% end %> - -
    <%= study_fields.label "Study position" -%>
    <%= study_fields.number_field :position, :rows => 5, :class=>"form-control" -%> @@ -81,15 +77,8 @@ } $j(document).ready(function () { - const urlSearchParams = new URLSearchParams(window.location.search); - const params = Object.fromEntries(urlSearchParams.entries()); - const investigation_id = params["investigation_id"] - // Prevent setting the hidden field on redirect (query string parameters are missing) - if(investigation_id) { - $j("#isa_study_study_investigation_id").val(investigation_id); - $j("#study_investigation_id").val(investigation_id).change(); + if (templates.length > 0) { + Templates.init($j('#template-attributes')); } - - Templates.init($j('#template-attributes')); }); diff --git a/app/views/models/simulate.html.erb b/app/views/models/simulate.html.erb index 46e51245e5..2c181ade9b 100644 --- a/app/views/models/simulate.html.erb +++ b/app/views/models/simulate.html.erb @@ -1,4 +1,4 @@ -<% content_for(:buttons) { button_link_to("Back to #{t('model')}", 'back', model_path(@model,:version=>@display_model.version)) } %> +<% content_for(:buttons) { button_link_to("Back to #{t('model')}", 'back', model_path(@model,:version=>@display_model.version, :code=>params[:code])) } %> <%= render :partial => "general/item_title",:locals=>{:item=>@model,:title_postfix=>" - JWS Online #{t('model')} Simulation"} %> diff --git a/app/views/projects/_buttons.html.erb b/app/views/projects/_buttons.html.erb index 3c61ecc857..836c939262 100644 --- a/app/views/projects/_buttons.html.erb +++ b/app/views/projects/_buttons.html.erb @@ -63,21 +63,16 @@ <%= order_icon(item,current_user, order_investigations_project_path(item), item.investigations, 'investigation') %> <% end %> - <% if Seek::Config.n4h_enabled %> + <% if Seek::Config.n4h_enabled && item.extended_metadata != nil %>
  • <%= image_tag_for_key('publish', publish_to_csh_project_path(item), "Publish to NFDI4Health GCHSH", nil, "Publish to NFDI4Health GCHSH") -%>
  • <% else %> - <% explanation = "The 'Publish to NFDI4Health GCHSH' item for #{text_for_resource(item).pluralize.downcase} in Server admin panel was deactivated by the admin." %> + <% explanation = "Your project does not include metadata, or The 'Publish to NFDI4Health GCHSH' item for #{text_for_resource(item).pluralize.downcase} in Server admin panel was deactivated by the admin." %>
  • <%= image('publish', {:alt=>"Publish", :class=>"disabled"}) %> Publish to NFDI4Health GCHSH
  • <% end %> - - - - - <% if admin_logged_in? || item.can_manage? -%> <%= delete_icon(item,current_user,"Any members will also be removed from the #{t('project')}, are you sure?") %> <% end -%> diff --git a/app/views/projects/_project_selector.html.erb b/app/views/projects/_project_selector.html.erb index 5d12d5efd5..27a1ae2efc 100644 --- a/app/views/projects/_project_selector.html.erb +++ b/app/views/projects/_project_selector.html.erb @@ -6,6 +6,7 @@ <% allow_nil ||= false allow_all ||= false + allow_only_administered ||= false resource ||= nil selected_projects = resource ? resource.projects : [] @@ -13,13 +14,14 @@ possible_projects = Project.all else possible_projects = [] - possible_projects |= User.current_user.person.current_projects + possible_projects |= current_person.current_projects if resource possible_projects |= resource.projects possible_projects |= resource.contributor.current_projects if resource.respond_to?(:contributor) && resource.contributor end end + possible_projects = possible_projects.select { |p| current_person.is_project_administrator? p } if allow_only_administered possible_projects = possible_projects - selected_projects possible_projects_json, selected_projects_json = [possible_projects, selected_projects].map do |projects| diff --git a/app/views/sample_controlled_vocabs/_term_form_row.html.erb b/app/views/sample_controlled_vocabs/_term_form_row.html.erb index aa600c85a7..ffb2edf3b5 100644 --- a/app/views/sample_controlled_vocabs/_term_form_row.html.erb +++ b/app/views/sample_controlled_vocabs/_term_form_row.html.erb @@ -1,5 +1,8 @@ - <%= text_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][label]", term.label %> + + <%= hidden_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][id]", term.id %> + <%= text_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][label]", term.label %> + <%= text_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][iri]", term.iri %> <%= text_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][parent_iri]", term.parent_iri %> diff --git a/app/views/sample_controlled_vocabs/_term_form_row_disabled.html.erb b/app/views/sample_controlled_vocabs/_term_form_row_disabled.html.erb index 2be8514245..a331b87914 100644 --- a/app/views/sample_controlled_vocabs/_term_form_row_disabled.html.erb +++ b/app/views/sample_controlled_vocabs/_term_form_row_disabled.html.erb @@ -8,6 +8,7 @@ %> + <%= hidden_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][id]", term.id %> <%= hidden_field_tag "sample_controlled_vocab[sample_controlled_vocab_terms_attributes][#{index}][label]", term.label %>
    <%= term.label %>
    diff --git a/app/views/sample_types/_sample_attribute_form.html.erb b/app/views/sample_types/_sample_attribute_form.html.erb index acb98013d0..7af118b931 100644 --- a/app/views/sample_types/_sample_attribute_form.html.erb +++ b/app/views/sample_types/_sample_attribute_form.html.erb @@ -47,13 +47,13 @@
    <%= hidden_field_tag "#{field_name_prefix}[required]", '0' %> - <%= check_box_tag "#{field_name_prefix}[required]", '1', required, disabled: !allow_required, data: { attr: "required" } %> + <%= check_box_tag "#{field_name_prefix}[required]", '1', required, class: "#{ allow_required ? '' : 'disabled' }", data: { attr: "required" } %>
    <%= hidden_field_tag "#{field_name_prefix}[is_title]", '0' %> - <%= check_box_tag "#{field_name_prefix}[is_title]", '1', is_title, class:'sample-type-is-title',disabled: seek_sample_multi || !allow_required %> + <%= check_box_tag "#{field_name_prefix}[is_title]", '1', is_title, class: "sample-type-is-title #{ allow_required ? '' : 'disabled' }"%>
    diff --git a/app/views/single_pages/_duplicate_samples_panel.html.erb b/app/views/single_pages/_duplicate_samples_panel.html.erb index b05064fdd6..6a623a4286 100644 --- a/app/views/single_pages/_duplicate_samples_panel.html.erb +++ b/app/views/single_pages/_duplicate_samples_panel.html.erb @@ -1,8 +1,9 @@ <% unless @possible_duplicates.nil? or @possible_duplicates.compact.none? %> - <%= folding_panel("Possible Duplicates #{@possible_duplicates.size}", true, :id => "duplicate-samples-panel", :body_options => {:id => "duplicate-samples-panel-content"}, - :help_text => "These new samples have been matched to already existing samples.") do %> + <%= folding_panel("Possible Duplicates #{@possible_duplicates.size}", true, :id => "duplicate-samples-panel", :body_options => { :id => "duplicate-samples-panel-content" }, + :help_text => "These new samples have been matched to already existing samples.") do %>
    + <% for key in @possible_duplicates[0].keys %> @@ -11,56 +12,64 @@ <% end %> <% end %> + + <% for dupl_sample in @possible_duplicates %> - ' > - - <% dupl_sample.map do |key, val| %> - <% val = '' if key =='id' %> - <% unless %w[uuid duplicate].include?(key) %> - <% if @multiple_input_fields.include?(key)%> - - <% elsif @cv_list_fields.include?(key) %> - - <% elsif @registered_sample_fields.include?(key) %> - - <% else %> - + '> + + <% dupl_sample.map do |key, val| %> + <% val = '' if key == 'id' %> + <% unless %w[uuid duplicate].include?(key) %> + <% if @multiple_input_fields.include?(key) %> + + <% elsif @cv_list_fields.include?(key) %> + + <% elsif @registered_sample_fields.include?(key) %> + + <% else %> + + <% end %> <% end %> <% end %> - <% end %> ' class="danger"> <% dupl_sample['duplicate'].map do |key, val| %> <% unless %w[uuid duplicate].include?(key) %> - <% if @multiple_input_fields.include?(key)%> + <% if @multiple_input_fields.include?(key) %> <% elsif @cv_list_fields.include?(key) %> <% elsif @registered_sample_fields.include?(key) %> - + <% else %> - + <% end %> <% end %> <% end %> - + <% end %> +
    - <% val.each do |sub_sample| %> - ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> - <% end %> - - <% val.each do |cv_term| %> - <%= cv_term %> - <% end %> - ' data-attr_type="seek-sample"><%= val['title'] %>' ><%= val %>
    + + <% val.each do |sub_sample| %> + ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> + <% end %> + + <% val.each do |cv_term| %> + <%= cv_term %> + <% end %> + + ' data-attr_type="seek-sample"><%= val['title'] %> + '><%= val %>
    <% val.each do |sub_sample| %> - '><%= sub_sample['title'] %> + '><%= sub_sample['title'] %> <% end %> <% val.each do |cv_term| %> - <%= cv_term %> + <%= cv_term %> <% end %> '><%= val['title'] %>'><%= val['title'] %><%= val%><%= val %>
    <% end %> diff --git a/app/views/single_pages/_new_samples_panel.html.erb b/app/views/single_pages/_new_samples_panel.html.erb index 1b163ec3da..4fd18ae27b 100644 --- a/app/views/single_pages/_new_samples_panel.html.erb +++ b/app/views/single_pages/_new_samples_panel.html.erb @@ -1,8 +1,9 @@ <% unless @new_samples.nil? or @new_samples.compact.none? %> - <%= folding_panel("New Samples #{@new_samples.size}", true, :id => "new-samples-panel", :body_options => {:id => "new-samples-panel-content"}, - :help_text => "These samples have been detected as new samples and will be created.") do %> + <%= folding_panel("New Samples #{@new_samples.size}", true, :id => "new-samples-panel", :body_options => { :id => "new-samples-panel-content" }, + :help_text => "These samples have been detected as new samples and will be created.") do %>
    + <% for key in @new_samples[0].keys %> @@ -11,36 +12,42 @@ <% end %> <% end %> + + <% for new_sample in @new_samples %> <% new_sample_id = UUID.generate %> - - <% new_sample.map do |key, val| %> - <% val = '' if key =='id' %> + + <% new_sample.map do |key, val| %> + <% val = '' if key == 'id' %> <% unless key == 'uuid' %> - <% if @multiple_input_fields.include?(key)%> - <% elsif @cv_list_fields.include?(key) %> - <% elsif @registered_sample_fields.include?(key) %> - <% else %> - + <% end %> <% end %> <% end %> <% end %> +
    + + <% if @multiple_input_fields.include?(key) %> + <% val.each do |sub_sample| %> - ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> + ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> <% end %> + <% val.each do |cv_term| %> - <%= cv_term %> + <%= cv_term %> <% end %> - ' data-attr_type="seek-sample"><%= val['title'] %> + + ' data-attr_type="seek-sample"><%= val['title'] %> <%= val %><%= val %>
    <% end %> diff --git a/app/views/single_pages/_unauthorized_samples_panel.html.erb b/app/views/single_pages/_unauthorized_samples_panel.html.erb index 8ad35705d2..4d69e2a741 100644 --- a/app/views/single_pages/_unauthorized_samples_panel.html.erb +++ b/app/views/single_pages/_unauthorized_samples_panel.html.erb @@ -1,15 +1,17 @@ <% unless @unauthorized_samples.nil? or @unauthorized_samples.compact.none? %> <% @can_upload = false %> <% errors.append("There are unauthorized samples present in the spreadsheet.") %> - <%= folding_panel("Unauthorized Samples", false, :id => "unauthorized-samples-panel", :body_options => {:id => "unauthorized-samples-panel-content"}, - :help_text => "Sample the current user does not have permission to edit them.") do %> + <%= folding_panel("Unauthorized Samples", false, :id => "unauthorized-samples-panel", :body_options => { :id => "unauthorized-samples-panel-content" }, + :help_text => "Sample the current user does not have permission to edit them.") do %>

    - You don't have permission to edit the samples listed below. Please contact the submitter of these samples or revert the changes in the spreadsheet to its original values. + You don't have permission to edit the samples listed below. Please contact the submitter of these samples or + revert the changes in the spreadsheet to its original values.

    + <% for key in @unauthorized_samples[0].keys %> <% unless key == 'uuid' %> @@ -17,6 +19,8 @@ <% end %> <% end %> + + <% for unauthorized_sample in @unauthorized_samples %> ' class=""> <% unauthorized_sample.map do |key, val| %> @@ -24,7 +28,7 @@ <% if @multiple_input_fields.include?(key) %> <% else %> @@ -34,6 +38,7 @@ <% end %> <% end %> +
    <% val.each do |sub_sample| %> - '><%= sub_sample['title'] %> + '><%= sub_sample['title'] %> <% end %>
    <% end %> diff --git a/app/views/single_pages/_update_samples_panel.html.erb b/app/views/single_pages/_update_samples_panel.html.erb index 4349edd71b..1d339a2bba 100644 --- a/app/views/single_pages/_update_samples_panel.html.erb +++ b/app/views/single_pages/_update_samples_panel.html.erb @@ -1,8 +1,9 @@ <% unless @update_samples.nil? or @update_samples.compact.none? %> - <%= folding_panel("Samples to Update #{@update_samples.size}", true, :id => "existing-samples-panel", :body_options => {:id => "existing-samples-panel-content"}, - :help_text => "These samples were detected existing samples and will be updated.") do %> + <%= folding_panel("Samples to Update #{@update_samples.size}", true, :id => "existing-samples-panel", :body_options => { :id => "existing-samples-panel-content" }, + :help_text => "These samples were detected existing samples and will be updated.") do %>
    + <% for key in @update_samples[0].keys %> @@ -11,38 +12,43 @@ <% end %> <% end %> + + <% for update_sample in @update_samples %> - ' > + '> <% db_sample = @authorized_db_samples.select { |s| s['id'] == update_sample['id'] }.first %> - + <% update_sample.map do |key, val| %> <% unless key == 'uuid' %> - <% if @multiple_input_fields.include?(key)%> - <% elsif @cv_list_fields.include?(key) %> - <% elsif @registered_sample_fields.include?(key) %> - <% else %> - + <% end %> <% end %> <% end %> - ' > + '> <% db_sample.map do |key, val| %> <% unless key == 'uuid' %> - <% if @multiple_input_fields.include?(key)%> + <% if @multiple_input_fields.include?(key) %> <% end %> +
    + ' > + <% if @multiple_input_fields.include?(key) %> + '> <% val.each do |sub_sample| %> ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> <% end %> ' > + '> <% val.each do |cv_term| %> <%= cv_term %> <% end %> '> + '> ' data-attr_type="seek-sample"><%= val['title'] %> ' ><%= val %>'><%= val %>
    <% val.each do |sub_sample| %> '><%= sub_sample['title'] %> @@ -63,6 +69,7 @@ <% end %>
    <% end %> diff --git a/app/views/single_pages/sample_sharing_bulk_change_preview.html.erb b/app/views/single_pages/sample_sharing_bulk_change_preview.html.erb index c0f86b7e72..75ef3baced 100644 --- a/app/views/single_pages/sample_sharing_bulk_change_preview.html.erb +++ b/app/views/single_pages/sample_sharing_bulk_change_preview.html.erb @@ -73,4 +73,7 @@ }); } + $j('#add-person-permission-modal').on('click', '[data-dismiss="modal"]', function(e){e.stopPropagation();}); + $j('#add-project-permission-modal').on('click', '[data-dismiss="modal"]', function(e){e.stopPropagation();}); + $j('#add-programme-permission-modal').on('click', '[data-dismiss="modal"]', function(e){e.stopPropagation();}); \ No newline at end of file diff --git a/app/views/single_pages/sample_upload_content.html.erb b/app/views/single_pages/sample_upload_content.html.erb index 139062d970..b8b1f51dc2 100644 --- a/app/views/single_pages/sample_upload_content.html.erb +++ b/app/views/single_pages/sample_upload_content.html.erb @@ -9,7 +9,7 @@
    <%# General information panel %> - <%= render partial: 'general_panel' %> + <%= render partial: 'general_panel', locals: {errors: } %> <%# New Samples panel %> <%= render partial: 'new_samples_panel' %> @@ -21,7 +21,7 @@ <%= render partial: 'duplicate_samples_panel' %> <%# Panel for Sample with wrong permissions %> - <%= render partial: 'unauthorized_samples_panel' %> + <%= render partial: 'unauthorized_samples_panel', locals: {errors: } %>
    <% unless @can_upload %> diff --git a/app/views/templates/_form.html.erb b/app/views/templates/_form.html.erb index d7acd30e54..82d74be6c4 100644 --- a/app/views/templates/_form.html.erb +++ b/app/views/templates/_form.html.erb @@ -15,7 +15,7 @@ <%= f.text_area :description, class: "form-control rich-text-edit", rows: 5, id: "template-description" -%>
    - <%= render partial: "projects/project_selector", locals: { resource: @template } -%> + <%= render partial: "projects/project_selector", locals: { resource: @template, allow_only_administered: true } -%> <%= render partial: 'assets/manage_specific_attributes', locals:{f:f} if show_form_manage_specific_attributes? %> @@ -27,12 +27,6 @@

    Template Information

    - <% if @template.new_record? %> -
    - -
    - <% end %> -
    <%= f.label :level, 'ISA Level' %> <%= f.text_field :level, { class: 'form-control', readonly: true } %> @@ -61,7 +55,13 @@ To ensure compliance with the original template, please do not modify the existing ISA-tags and attributes in the form below. You can always add new attributes.
    - + <% if @template.new_record? %> +
    + +
    + <% end %> + +
    @@ -85,7 +85,7 @@ <% if @template.children.none? %> <% end %> diff --git a/config/schedule.rb b/config/schedule.rb index 0718d9b395..ba8c045099 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -47,6 +47,10 @@ def offset(off_hours) runner "RegularMaintenanceJob.perform_later" end +every AuthLookupMaintenanceJob::RUN_PERIOD, at: offset(1) do + runner "AuthLookupMaintenanceJob.perform_later" +end + every LifeMonitorStatusJob::PERIOD, at: offset(2) do runner "LifeMonitorStatusJob.perform_later" end diff --git a/config/version.yml b/config/version.yml index 9fe2f4b4c9..4de024972d 100644 --- a/config/version.yml +++ b/config/version.yml @@ -9,4 +9,4 @@ major: 1 minor: 15 -patch: 0-pre +patch: 1 diff --git a/db/seeds/019_MDS_3_3_Study_gen.seeds.rb b/db/seeds/019_MDS_3_3_Study_gen.seeds.rb index bfe2ec2e66..a4c930bb25 100644 --- a/db/seeds/019_MDS_3_3_Study_gen.seeds.rb +++ b/db/seeds/019_MDS_3_3_Study_gen.seeds.rb @@ -526,7 +526,7 @@ def create_sample_controlled_vocab_terms_attributes(array) unless ExtendedMetadataType.where(title:'Nfdi4Health MDS 3.3', supported_type:'Study').any? emt = ExtendedMetadataType.new(title: 'Nfdi4Health MDS 3.3', supported_type:'Study') - emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_identifier_Project', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Unique identifier of the resource used for identification within the NFDI4Health.', label: 'ID of the Project(*)') + emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_identifier_Study', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Unique identifier of the resource used for identification within the NFDI4Health.', label: 'ID of the Project(*)') emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_Study', sample_attribute_type: SampleAttributeType.where(title:'Linked Extended Metadata').first , linked_extended_metadata_type: ExtendedMetadataType.where(title:'Resource_classification_Study', supported_type:'ExtendedMetadata').first, label: 'Resource classification(*)' ) emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_Study', sample_attribute_type: SampleAttributeType.where(title:'Linked Extended Metadata (multiple)').first , linked_extended_metadata_type: ExtendedMetadataType.where(title:'Resource_titles_Study', supported_type:'ExtendedMetadata').first, label: 'Title(s)/name(s) of the Study' ) emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_Study', sample_attribute_type: SampleAttributeType.where(title:'Linked Extended Metadata (multiple)').first , linked_extended_metadata_type: ExtendedMetadataType.where(title:'Resource_acronyms_Study', supported_type:'ExtendedMetadata').first, label: 'Acronym(s) of the Study' ) diff --git a/db/seeds/020_MDS_3_3_Investigation_gen.seeds.rb b/db/seeds/020_MDS_3_3_Investigation_gen.seeds.rb index cbed714231..b1b409257c 100644 --- a/db/seeds/020_MDS_3_3_Investigation_gen.seeds.rb +++ b/db/seeds/020_MDS_3_3_Investigation_gen.seeds.rb @@ -526,7 +526,7 @@ def create_sample_controlled_vocab_terms_attributes(array) unless ExtendedMetadataType.where(title:'Nfdi4Health MDS 3.3', supported_type:'Investigation').any? emt = ExtendedMetadataType.new(title: 'Nfdi4Health MDS 3.3', supported_type:'Investigation') - emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_identifier_Project', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Unique identifier of the resource used for identification within the NFDI4Health.', label: 'ID of the Project(*)') + emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_identifier_Investigation', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Unique identifier of the resource used for identification within the NFDI4Health.', label: 'ID of the Project(*)') emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_Investigation', sample_attribute_type: SampleAttributeType.where(title:'Linked Extended Metadata').first , linked_extended_metadata_type: ExtendedMetadataType.where(title:'Resource_classification_Investigation', supported_type:'ExtendedMetadata').first, label: 'Resource classification(*)' ) emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_Investigation', sample_attribute_type: SampleAttributeType.where(title:'Linked Extended Metadata (multiple)').first , linked_extended_metadata_type: ExtendedMetadataType.where(title:'Resource_titles_Investigation', supported_type:'ExtendedMetadata').first, label: 'Title(s)/name(s) of the Investigation' ) emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_Investigation', sample_attribute_type: SampleAttributeType.where(title:'Linked Extended Metadata (multiple)').first , linked_extended_metadata_type: ExtendedMetadataType.where(title:'Resource_acronyms_Investigation', supported_type:'ExtendedMetadata').first, label: 'Acronym(s) of the Investigation' ) diff --git a/docker-compose-relative-root.yml b/docker-compose-relative-root.yml index c9f214cbbf..7576847289 100644 --- a/docker-compose-relative-root.yml +++ b/docker-compose-relative-root.yml @@ -14,7 +14,7 @@ services: seek: # The SEEK application #build: . - image: fairdom/seek:main + image: fairdom/seek:1.15 container_name: seek command: docker/entrypoint.sh @@ -43,7 +43,7 @@ services: seek_workers: # The SEEK delayed job workers #build: . - image: fairdom/seek:main + image: fairdom/seek:1.15 container_name: seek-workers command: docker/start_workers.sh restart: always diff --git a/docker-compose-virtuoso.yml b/docker-compose-virtuoso.yml index 626485b5a5..8a3d78f05c 100644 --- a/docker-compose-virtuoso.yml +++ b/docker-compose-virtuoso.yml @@ -12,7 +12,7 @@ services: seek: # The SEEK application #build: . - image: fairdom/seek:main + image: fairdom/seek:1.15 container_name: seek command: docker/entrypoint.sh restart: always @@ -39,7 +39,7 @@ services: seek_workers: # The SEEK delayed job workers #build: . - image: fairdom/seek:main + image: fairdom/seek:1.15 container_name: seek-workers command: docker/start_workers.sh restart: always diff --git a/docker-compose-with-email.yml b/docker-compose-with-email.yml index 19beb35095..51685ce1d0 100644 --- a/docker-compose-with-email.yml +++ b/docker-compose-with-email.yml @@ -14,7 +14,7 @@ services: seek: # The SEEK application #build: . - image: fairdom/seek:main + image: fairdom/seek:1.15 container_name: seek command: docker/entrypoint.sh @@ -43,7 +43,7 @@ services: seek_workers: # The SEEK delayed job workers #build: . - image: fairdom/seek:main + image: fairdom/seek:1.15 container_name: seek-workers command: docker/start_workers.sh restart: always diff --git a/docker-compose.yml b/docker-compose.yml index e7dec9dd7e..c9dd6960b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: seek: # The SEEK application #build: . - image: fairdom/seek:1.15-dev + image: fairdom/seek:1.15 container_name: seek command: docker/entrypoint.sh @@ -42,7 +42,7 @@ services: seek_workers: # The SEEK delayed job workers #build: . - image: fairdom/seek:1.15-dev + image: fairdom/seek:1.15 container_name: seek-workers command: docker/start_workers.sh restart: always diff --git a/lib/nfdi4health/csh_client.rb b/lib/nfdi4health/csh_client.rb index 2b44a5ce3d..5a96a0fc93 100644 --- a/lib/nfdi4health/csh_client.rb +++ b/lib/nfdi4health/csh_client.rb @@ -4,24 +4,17 @@ module Nfdi4Health class Client attr_accessor :transformed - def initialize(endpoint) - #@endpoint = RestClient::Resource.new(endpoint) - - - end def publish_csh(project_transformed,url,token) content_length = project_transformed.bytesize - headers = { content_type: 'application/json',Content_Length: content_length ,Host: 'csh.nfdi4health.de', Authorization: "Bearer " + token + headers = { content_type: 'application/json',Content_Length: content_length ,Host: 'csh.nfdi4health.de', Authorization: 'Bearer ' + token } @endpoint = RestClient::Request.execute(method: :post, url: url, payload: project_transformed, headers: headers) end def send_transforming_api(project,url) - #raise project.inspect @transformed = RestClient::Request.execute(method: :post, url: url,payload: project, headers: { content_type: :json, accept: :json }).body - #@endpoint['publish'].post(project, content_type: 'application/json') end @@ -44,6 +37,58 @@ def get_token(url,user,password) ) end - + def handle_restclient_error(e, name_server) + case name_server + when 'get_token' + case e.response.code + when 400 + 'Token:CODE400- Bad Request: The server could not understand the request.' + when 401 + 'Token:CODE401- Unauthorized: Access is denied due to invalid credentials.' + when 403 + 'Token:CODE403- Forbidden: You do not have the necessary permissions to access this resource.' + when 404 + 'Token:CODE404- Not Found: The requested resource could not be found.' + when 500 + 'Token:CODE500- Internal Server Error: The server encountered an error and could not complete your request.' + else + "An unexpected error occurred: #{e.response}" + end + when 'send_transforming_api' + case e.response.code + when 400 + 'Transorm:CODE400- Bad Request: The server could not understand the request.' + when 401 + 'Transorm:CODE401- Unauthorized: Access is denied due to invalid credentials.' + when 403 + 'Transorm:CODE403- Forbidden: You do not have the necessary permissions to access this resource.' + when 404 + 'Transorm:CODE404- Not Found: The requested resource could not be found.' + when 500 + 'Transorm:CODE500- Internal Server Error: The server encountered an error and could not complete your request.' + else + "An unexpected error occurred: #{e.response}" + end + when 'publish_csh' + case e.response.code + when 200 + 'pub_csh:CODE200- No new draft version created because uploaded resource contains no changes' + when 400 + 'pub_csh:CODE400- Bad Request: The server could not understand the request.' + when 401 + 'pub_csh:CODE401- Not allowed to edit resource. User must either be the original creator of the resource or have been added as a collaborator.' + when 403 + 'pub_csh:CODE403- Forbidden: You do not have the necessary permissions to access this resource.' + when 404 + 'pub_csh:CODE404- Not Found: The requested resource could not be found.' + when 422 + JSON.parse(JSON.parse(e.response.to_json))["error"]["message"] + when 500 + 'pub_csh:CODE500- Internal Server Error: The server encountered an error and could not complete your request.' + else + "An unexpected error occurred: #{e.response}" + end + end + end end end diff --git a/lib/ro_crate/workflow_crate.rb b/lib/ro_crate/workflow_crate.rb index f222760f23..3672b3245d 100644 --- a/lib/ro_crate/workflow_crate.rb +++ b/lib/ro_crate/workflow_crate.rb @@ -50,7 +50,7 @@ def main_workflow_cwl=(entity) end def test_suites - ((mentions || []) | (about || [])).select { |entity| entity.has_type?('TestSuite') } + (Array(mentions) | Array(about)).select { |entity| entity.has_type?('TestSuite') } end def find_entry(path) diff --git a/lib/scrapers/github_scraper.rb b/lib/scrapers/github_scraper.rb index 4b8e6c42eb..53058767bd 100644 --- a/lib/scrapers/github_scraper.rb +++ b/lib/scrapers/github_scraper.rb @@ -73,7 +73,7 @@ def create_resources(repositories) end tags = [tag] else - tags = repo.remote_refs[:tags]&.map { |t| t[:name] } || [] + tags = all_tags(repo) if tags.empty? output.puts " No tags found to register" next @@ -175,5 +175,9 @@ def latest_tag(repo) tag end + + def all_tags(repo) + repo.remote_refs[:tags]&.map { |t| t[:name] } || [] + end end end diff --git a/lib/scrapers/nfcore_scraper.rb b/lib/scrapers/nfcore_scraper.rb index a85ba76619..3adace4899 100644 --- a/lib/scrapers/nfcore_scraper.rb +++ b/lib/scrapers/nfcore_scraper.rb @@ -5,6 +5,7 @@ class NfcoreScraper < GithubScraper def list_repositories repos = JSON.parse(RestClient.get('https://nf-co.re/pipelines.json'))['remote_workflows'] + repos.reject! { |r| r['archived'] || r['disabled'] } @nfcore_pipelines = {} # Store repo metadata from pipelines.json to fetch main branch name and topics later repos.each do |r| r['clone_url'] = "https://github.com/#{r['full_name']}.git" @@ -22,6 +23,14 @@ def topics(repo) @nfcore_pipelines.dig(repo.remote, 'topics') || [] end + def latest_tag(repo) + all_tags(repo).last + end + + def all_tags(repo) + (@nfcore_pipelines.dig(repo.remote, 'releases') || []).sort_by { |t| Date.parse(t['published_at']) }.map { |t| t['tag_name'] } - ['dev'] + end + def workflow_wizard(repo, tag) GitWorkflowWizard.new(workflow_class: WorkflowClass.find_by_key('nextflow'), params: { diff --git a/lib/seek/acts_as_asset.rb b/lib/seek/acts_as_asset.rb index 1c5de8cb75..e8abef8742 100644 --- a/lib/seek/acts_as_asset.rb +++ b/lib/seek/acts_as_asset.rb @@ -23,6 +23,10 @@ def is_downloadable_asset? is_asset? && is_downloadable? end + def contains_downloadable_items? + respond_to?(:all_content_blobs) && all_content_blobs.compact.any?(&:is_downloadable?) || is_git_versioned? + end + def have_misc_links? self.class.have_misc_links? end diff --git a/lib/seek/acts_as_asset/content_blobs.rb b/lib/seek/acts_as_asset/content_blobs.rb index 6ff53183ba..2ddc88cc24 100644 --- a/lib/seek/acts_as_asset/content_blobs.rb +++ b/lib/seek/acts_as_asset/content_blobs.rb @@ -10,11 +10,6 @@ module ClassMethods end module InstanceMethods - - def contains_downloadable_items? - all_content_blobs.compact.any?(&:is_downloadable?) - end - def all_content_blobs if self.respond_to?(:content_blobs) content_blobs diff --git a/lib/seek/config.rb b/lib/seek/config.rb index 2f6df9fe27..a363d1986e 100644 --- a/lib/seek/config.rb +++ b/lib/seek/config.rb @@ -336,6 +336,10 @@ def templates_enabled isa_json_compliance_enabled end + def strains_enabled + organisms_enabled + end + def omniauth_elixir_aai_config if omniauth_elixir_aai_legacy_mode { diff --git a/lib/seek/content_extraction.rb b/lib/seek/content_extraction.rb index b5e4190731..5168e878d8 100644 --- a/lib/seek/content_extraction.rb +++ b/lib/seek/content_extraction.rb @@ -69,7 +69,6 @@ def extract_text_from_pdf Docsplit.extract_text(pdf_filepath, output: converted_storage_directory) unless File.exist?(txt_filepath) File.read(txt_filepath) rescue Docsplit::ExtractionFailed => e - extract_text_from_pdf if double_check_mime_type Rails.logger.error("Problem with extracting text from pdf #{id} #{e}") '' end @@ -78,11 +77,7 @@ def extract_text_from_pdf def to_csv(sheet = 1, trim = false) return '' unless is_excel? - begin - spreadsheet_to_csv(filepath, sheet, trim, Seek::Config.jvm_memory_allocation) - rescue SysMODB::SpreadsheetExtractionException - to_csv(sheet, trim) if double_check_mime_type - end + spreadsheet_to_csv(filepath, sheet, trim, Seek::Config.jvm_memory_allocation) end def extract_csv() @@ -90,34 +85,11 @@ def extract_csv() end def to_spreadsheet_xml - begin - spreadsheet_to_xml(filepath, Seek::Config.jvm_memory_allocation) - rescue SysMODB::SpreadsheetExtractionException=>e - if double_check_mime_type - to_spreadsheet_xml - else - raise e - end - end + spreadsheet_to_xml(filepath, Seek::Config.jvm_memory_allocation) end private - # checks the type using mime magic, and updates if found to be different. This is to help cases where extraction - # fails due to the mime type being incorrectly set - # - # @return boolean - the mime type was changed - def double_check_mime_type - suggested_type = mime_magic_content_type - if suggested_type && suggested_type != content_type - update_column(:content_type, suggested_type) - true - else - false - end - end - - # filters special characters, keeping alphanumeric characters, hyphen ('-'), underscore('_') and newlines def filter_text_content(content) content.gsub(/[^-_0-9a-z \n]/i, ' ') diff --git a/lib/seek/isa_templates/template_attributes_schema_test.json b/lib/seek/isa_templates/template_attributes_schema_test.json new file mode 100644 index 0000000000..23528693ba --- /dev/null +++ b/lib/seek/isa_templates/template_attributes_schema_test.json @@ -0,0 +1,99 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "ISA tempalte attribute schema", + "description": "JSON-schema representing an ISA template attribute in DataHub", + "type": "object", + "properties": { + "iri": { + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { "type": "string" }, + "description": { "type": "string" }, + "required": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "ontology": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "version": { + "anyOf": [{ "type": "string" }, { "type": "number" }] + }, + "description": { "type": "string" }, + "rootTermURI": { "type": "string", "format": "uri" } + } + }, + { + "type": "null" + } + ] + }, + "dataType": { + "type": "string", + "enum": [ + "String attribute type 1", + "Sample multi attribute type 1" + ] + }, + "CVList": { + "anyOf": [ + { + "type": "array" + }, + { + "type": "null" + } + ] + }, + "isaTag": { + "anyOf": [ + { + "type": "string", + "enum": [ + "source", + "sample", + "protocol", + "source_characteristic", + "sample_characteristic", + "other_material", + "other_material_characteristic", + "data_file", + "data_file_comment", + "parameter_value" + ] + }, + { + "type": "null" + } + ] + }, + "title": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false +} diff --git a/lib/seek/isa_templates/template_extractor.rb b/lib/seek/isa_templates/template_extractor.rb index d0eb8d6f2c..4f11d633db 100644 --- a/lib/seek/isa_templates/template_extractor.rb +++ b/lib/seek/isa_templates/template_extractor.rb @@ -4,25 +4,24 @@ module Seek module IsaTemplates module TemplateExtractor def self.extract_templates - `touch #{resultfile}` + FileUtils.touch(resultfile) result = StringIO.new - seed_isa_tags disable_authorization_checks do client = Ebi::OlsClient.new project = Project.find_or_create_by(title: 'Default Project') directory = Seek::Config.append_filestore_path('source_types') - directory_files = Dir.exist?(directory) ? Dir.glob("#{directory}/*.json") : [] - raise '' if directory_files == [] + @directory_files = Dir.exist?(directory) ? Dir.glob("#{directory}/*.json") : [] + raise '' if @directory_files == [] - directory_files.each do |filename| - puts filename + @directory_files.each do |filename| next if File.extname(filename) != '.json' + @errors = [] file = File.read(filename) res = check_json_file(file) - raise res if res.present? + @errors.append res if res.present? data_hash = JSON.parse(file) data_hash['data'].each do |item| @@ -35,8 +34,9 @@ def self.extract_templates result << add_log(template_details, 'Created') end - template = Template.create(template_details.merge({ projects: [project], policy: Policy.public_policy })) + template = Template.new(template_details.merge({ projects: [project], policy: Policy.public_policy })) + current_template_attributes = [] item['data'].each_with_index do |attribute, j| is_ontology = attribute['ontology'].present? is_cv = attribute['CVList'].present? @@ -56,7 +56,7 @@ def self.extract_templates begin terms = client.all_descendants(attribute['ontology']['name'], attribute['ontology']['rootTermURI']) - rescue Exception => e + rescue StandardError => e scv.save(validate: false) next end @@ -87,29 +87,35 @@ def self.extract_templates p scv.errors if (is_ontology || is_cv) && !scv.save(validate: false) - template_attribute_details = { title: attribute['name'], template_id: template.id } - - TemplateAttribute.create(template_attribute_details.merge({ - is_title: attribute['title'] || 0, - isa_tag_id: get_isa_tag_id(attribute['isaTag']), - short_name: attribute['short_name'], - required: attribute['required'], - description: attribute['description'], - sample_controlled_vocab_id: scv&.id, - pid: attribute['pid'], - sample_attribute_type_id: get_sample_attribute_type(attribute['dataType']), - allow_cv_free_text: attribute['ontology'].present? - })) + ta = TemplateAttribute.new(is_title: (attribute['title'] || 0), + isa_tag_id: get_isa_tag_id(attribute['isaTag']), + short_name: attribute['short_name'], + required: attribute['required'], + description: attribute['description'], + sample_controlled_vocab_id: scv&.id, + pid: attribute['pid'], + sample_attribute_type_id: get_sample_attribute_type(attribute['dataType']), + allow_cv_free_text: attribute['ontology'].present?, + title: attribute['name']) + + current_template_attributes.append ta end + template.template_attributes << current_template_attributes + template.save! unless @errors.present? end + + # Remove the file after processing end end + raise "".html_safe if @errors.present? + write_result(result.string) - rescue Exception => e - puts e + rescue StandardError => e write_result("error(s): #{e}") + raise e ensure - `rm -f #{lockfile}` + FileUtils.rm_f(lockfile) + FileUtils.rm_f(@directory_files) unless @directory_files.blank? end def self.init_template(metadata) @@ -148,8 +154,13 @@ def self.check_json_file(file) end def self.valid_isa_json?(json) - definitions_path = - File.join(Rails.root, 'lib', 'seek', 'isa_templates', 'template_schema.json') + # read the schema file depending on the environment + definitions_path = if Rails.env.test? + File.join(Rails.root, 'lib', 'seek', 'isa_templates', 'template_schema_test.json') + else + File.join(Rails.root, 'lib', 'seek', 'isa_templates', 'template_schema.json') + end + if File.readable?(definitions_path) JSON::Validator.fully_validate_json(definitions_path, json) else @@ -158,8 +169,10 @@ def self.valid_isa_json?(json) end def self.get_sample_attribute_type(title) - sa = SampleAttributeType.find_by(title: title) - raise "Could not find a Sample Attribute named '#{title}'" if sa.nil? + sa = SampleAttributeType.find_by(title:) + @errors.append "
  • Could not find a Sample Attribute Type named '#{title}'
  • " if sa.nil? + + return if sa.nil? sa.id end @@ -167,8 +180,8 @@ def self.get_sample_attribute_type(title) def self.get_isa_tag_id(title) return nil if title.blank? - it = IsaTag.find_by(title: title) - raise "Could not find an ISA Tag named '#{title}'" if it.nil? + it = IsaTag.find_by(title:) + @errors.append "
  • Could not find an ISA Tag named '#{title}'
  • " if it.nil? it.id end diff --git a/lib/seek/isa_templates/template_schema_test.json b/lib/seek/isa_templates/template_schema_test.json new file mode 100644 index 0000000000..192bab0760 --- /dev/null +++ b/lib/seek/isa_templates/template_schema_test.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "ISA template schema", + "description": "JSON-schema representing an ISA template in DataHub", + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "metadata": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "group": { "type": "string" }, + "group_order": { "type": "number" }, + "temporary_name": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "version": { "anyOf": [{ "type": "string" }, { "type": "number" }] }, + "isa_config": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "isa_measurement_type": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "isa_technology_type": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "isa_protocol_type": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "repo_schema_id": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "organism": { "type": "string" }, + "level": { "type": "string" } + }, + "additionalProperties": false + }, + "data": { + "type": "array", + "items": { + "$ref": "template_attributes_schema_test.json#" + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false +} diff --git a/lib/seek/samples/extractor.rb b/lib/seek/samples/extractor.rb index ba1222931a..4675091846 100644 --- a/lib/seek/samples/extractor.rb +++ b/lib/seek/samples/extractor.rb @@ -24,14 +24,18 @@ def persist(user = User.current_user) if samples.any? Sample.transaction do + #copy policy and trigger callbacks samples.each do |sample| + policy = @data_file.policy.deep_copy + policy.save(validate: false) + sample.policy = policy sample.run_callbacks(:save) { false } sample.run_callbacks(:create) { false } end last_id = Sample.last.try(:id) || 0 sample_type = samples.first.sample_type - project_ids = samples.first.project_ids + project_ids = samples.first.project_ids Sample.import(samples, validate: false, batch_size: 2000) SampleTypeUpdateJob.new(sample_type, false).queue_job diff --git a/lib/seek/samples/sample_type_editing_constraints.rb b/lib/seek/samples/sample_type_editing_constraints.rb index 39f5a64cd7..d5c35aa78d 100644 --- a/lib/seek/samples/sample_type_editing_constraints.rb +++ b/lib/seek/samples/sample_type_editing_constraints.rb @@ -22,6 +22,7 @@ def samples? def allow_required?(attr) if attr.is_a?(SampleAttribute) return true if attr.new_record? + return false if inherited?(attr) attr = attr.accessor_name end diff --git a/lib/seek/versioned_resource.rb b/lib/seek/versioned_resource.rb index 4bf7ab5794..31979c487e 100644 --- a/lib/seek/versioned_resource.rb +++ b/lib/seek/versioned_resource.rb @@ -59,12 +59,6 @@ def attributions_objects end end - # assumes all versioned resources are also taggable - - def contains_downloadable_items? - all_content_blobs.compact.any?(&:is_downloadable?) - end - def all_content_blobs blobs = [] blobs << content_blob if respond_to?(:content_blob) diff --git a/lib/tasks/seek_upgrades.rake b/lib/tasks/seek_upgrades.rake index ebd435c9ef..769e95aed1 100644 --- a/lib/tasks/seek_upgrades.rake +++ b/lib/tasks/seek_upgrades.rake @@ -11,9 +11,6 @@ namespace :seek do decouple_extracted_samples_policies decouple_extracted_samples_projects link_sample_datafile_attributes - strip_sample_attribute_pids - rename_registered_sample_multiple_attribute_type - remove_ontology_attribute_type db:seed:007_sample_attribute_types db:seed:001_create_controlled_vocabs db:seed:017_minimal_starter_isa_templates @@ -55,53 +52,6 @@ namespace :seek do end end - task(rename_registered_sample_multiple_attribute_type: [:environment]) do - attr = SampleAttributeType.find_by(title:'Registered Sample (multiple)') - if attr - puts "..... Renaming sample attribute type 'Registered Sample (multiple)' to 'Registered Sample List'." - attr.update_column(:title, 'Registered Sample List') - end - end - - task(strip_sample_attribute_pids: [:environment]) do - puts '..... Stripping Sample Attribute PIds ...' - n = 0 - SampleAttribute.where('pid is NOT NULL AND pid !=?','').each do |attribute| - new_pid = attribute.pid.strip - if attribute.pid != new_pid - attribute.update_column(:pid, new_pid) - n += 1 - end - end - puts "..... Finished stripping #{n} Sample Attribute PIds." - end - - task(remove_ontology_attribute_type: [:environment]) do - ontology_attr_type = SampleAttributeType.find_by(title:'Ontology') - cv_attr_type = SampleAttributeType.find_by(title:'Controlled Vocabulary') - if ontology_attr_type - puts '..... Removing the Ontology sample attribute type ...' - if cv_attr_type - if ontology_attr_type.sample_attributes.any? - puts "..... Moving #{ontology_attr_type.sample_attributes.count} sample attributes to Controlled Vocabulary" - ontology_attr_type.sample_attributes.each do |attr_type| - attr_type.update_column(:sample_attribute_type_id, cv_attr_type.id) - end - end - if ontology_attr_type.isa_template_attributes.any? - puts "..... Moving #{ontology_attr_type.isa_template_attributes.count} template attributes to Controlled Vocabulary" - ontology_attr_type.isa_template_attributes.each do |attr_type| - attr_type.update_column(:sample_attribute_type_id, cv_attr_type.id) - end - end - - ontology_attr_type.destroy - else - puts '..... Target Controlled Vocabulary attribute type not found' - end - end - end - task(decouple_extracted_samples_policies: [:environment]) do puts '..... creating independent policies for extracted samples (this can take a while if there are many samples) ...' affected_samples = [] @@ -112,16 +62,17 @@ namespace :seek do Permission.skip_callback :commit, :after, :queue_rdf_generation_job disable_authorization_checks do - - Sample.includes(:originating_data_file).find_each do |sample| - # check if the sample was extracted from a datafile and their policies are linked - if sample.extracted? && sample.policy_id == sample.originating_data_file&.policy_id - policy = sample.policy.deep_copy - policy.save - sample.update_column(:policy_id, policy.id) - putc('.') - affected_samples << sample + Sample.includes(:originating_data_file).in_batches(of: 250) do |batch| + batch.each do |sample| + # check if the sample was extracted from a datafile and their policies are linked + if sample.extracted? && sample.policy_id == sample.originating_data_file&.policy_id + policy = sample.policy.deep_copy + policy.save + sample.update_column(:policy_id, policy.id) + affected_samples << sample + end end + putc('.') end end puts "..... finished creating independent policies of #{affected_samples.count} extracted samples" @@ -134,24 +85,27 @@ namespace :seek do task(decouple_extracted_samples_projects: [:environment]) do puts '..... copying project ids for extracted samples...' - decoupled = 0 + decoupled_count = 0 hash_array = [] disable_authorization_checks do - Sample.find_each do |sample| - # check if the sample was extracted from a datafile and their projects are linked - if sample.extracted? && sample.project_ids.empty? - sample.originating_data_file.project_ids.each do |project_id| - hash_array << { project_id: project_id, sample_id: sample.id } + Sample.includes(:originating_data_file).where.missing(:projects).in_batches(of: 250) do |batch| + batch.each do |sample| + # check if the sample was extracted from a datafile and their projects are linked + if sample.extracted? && sample.project_ids.empty? + sample.originating_data_file.project_ids.each do |project_id| + hash_array << { project_id: project_id, sample_id: sample.id } + end + decoupled_count += 1 end - decoupled += 1 end + putc('.') end unless hash_array.empty? class ProjectsSample < ActiveRecord::Base; end; ProjectsSample.insert_all(hash_array) end end - puts " ... finished copying project ids of #{decoupled.to_s} extracted samples" + puts " ... finished copying project ids of #{decoupled_count.to_s} extracted samples" end task(link_sample_datafile_attributes: [:environment]) do diff --git a/public/api/examples/assayPatch.json b/public/api/examples/assayPatch.json index 3466c4d3eb..f6d0c2c436 100644 --- a/public/api/examples/assayPatch.json +++ b/public/api/examples/assayPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "assays", - "id": "52", + "id": "112", "attributes": { "title": "A Maximal Assay", "assay_class": { @@ -20,7 +20,7 @@ "permissions": [ { "resource": { - "id": "343", + "id": "1115", "type": "projects" }, "access": "manage" @@ -34,14 +34,14 @@ "relationships": { "study": { "data": { - "id": "57", + "id": "143", "type": "studies" } }, "publications": { "data": [ { - "id": "24", + "id": "46", "type": "publications" } ] @@ -49,7 +49,7 @@ "organisms": { "data": [ { - "id": "13", + "id": "64", "type": "organisms" } ] @@ -57,7 +57,7 @@ "sops": { "data": [ { - "id": "22", + "id": "80", "type": "sops" } ] @@ -65,7 +65,7 @@ "data_files": { "data": [ { - "id": "18", + "id": "58", "type": "data_files" } ] @@ -73,7 +73,7 @@ "documents": { "data": [ { - "id": "32", + "id": "103", "type": "documents" } ] @@ -81,7 +81,7 @@ "creators": { "data": [ { - "id": "328", + "id": "951", "type": "people" } ] diff --git a/public/api/examples/assayPatchResponse.json b/public/api/examples/assayPatchResponse.json index a1417956d6..43ed4935e0 100644 --- a/public/api/examples/assayPatchResponse.json +++ b/public/api/examples/assayPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "52", + "id": "112", "type": "assays", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "343", + "id": "1115", "type": "projects" }, "access": "manage" @@ -43,10 +43,10 @@ ], "creators": [ { - "profile": "/people/328", + "profile": "/people/951", "family_name": "Last", - "given_name": "Person272", - "affiliation": "An Institution: 330", + "given_name": "Person763", + "affiliation": "An Institution: 978", "orcid": null } ] @@ -55,7 +55,7 @@ "creators": { "data": [ { - "id": "328", + "id": "951", "type": "people" } ] @@ -63,7 +63,7 @@ "submitter": { "data": [ { - "id": "328", + "id": "951", "type": "people" } ] @@ -71,7 +71,7 @@ "organisms": { "data": [ { - "id": "13", + "id": "64", "type": "organisms" } ] @@ -84,7 +84,7 @@ "people": { "data": [ { - "id": "328", + "id": "951", "type": "people" } ] @@ -92,31 +92,36 @@ "projects": { "data": [ { - "id": "343", + "id": "1115", "type": "projects" } ] }, "investigation": { "data": { - "id": "59", + "id": "152", "type": "investigations" } }, "study": { "data": { - "id": "57", + "id": "143", "type": "studies" } }, "data_files": { "data": [ { - "id": "18", + "id": "58", "type": "data_files" } ] }, + "samples": { + "data": [ + + ] + }, "models": { "data": [ @@ -125,7 +130,7 @@ "sops": { "data": [ { - "id": "22", + "id": "80", "type": "sops" } ] @@ -133,7 +138,7 @@ "publications": { "data": [ { - "id": "24", + "id": "46", "type": "publications" } ] @@ -146,21 +151,21 @@ "documents": { "data": [ { - "id": "32", + "id": "103", "type": "documents" } ] } }, "links": { - "self": "/assays/52" + "self": "/assays/112" }, "meta": { - "created": "2022-06-07T14:13:12.000Z", - "modified": "2022-06-07T14:13:13.000Z", + "created": "2024-06-20T12:31:34.000Z", + "modified": "2024-06-20T12:31:35.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "e3d848d0-c899-013a-0f7e-0a81884ed284" + "uuid": "f44538c0-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/assayPost.json b/public/api/examples/assayPost.json index 073cdc1b1f..85876b0998 100644 --- a/public/api/examples/assayPost.json +++ b/public/api/examples/assayPost.json @@ -19,7 +19,7 @@ "permissions": [ { "resource": { - "id": "293", + "id": "1053", "type": "projects" }, "access": "manage" @@ -33,14 +33,14 @@ "relationships": { "study": { "data": { - "id": "40", + "id": "124", "type": "studies" } }, "publications": { "data": [ { - "id": "19", + "id": "41", "type": "publications" } ] @@ -48,7 +48,7 @@ "organisms": { "data": [ { - "id": "8", + "id": "59", "type": "organisms" } ] @@ -56,7 +56,7 @@ "sops": { "data": [ { - "id": "17", + "id": "75", "type": "sops" } ] @@ -64,15 +64,23 @@ "data_files": { "data": [ { - "id": "13", + "id": "53", "type": "data_files" } ] }, + "samples": { + "data": [ + { + "id": "33", + "type": "samples" + } + ] + }, "documents": { "data": [ { - "id": "27", + "id": "98", "type": "documents" } ] @@ -80,7 +88,7 @@ "creators": { "data": [ { - "id": "283", + "id": "894", "type": "people" } ] diff --git a/public/api/examples/assayPostResponse.json b/public/api/examples/assayPostResponse.json index e52bd6c88b..a65046b0e2 100644 --- a/public/api/examples/assayPostResponse.json +++ b/public/api/examples/assayPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "38", + "id": "96", "type": "assays", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "293", + "id": "1053", "type": "projects" }, "access": "manage" @@ -43,10 +43,10 @@ ], "creators": [ { - "profile": "/people/283", + "profile": "/people/894", "family_name": "Last", - "given_name": "Person232", - "affiliation": "An Institution: 285", + "given_name": "Person711", + "affiliation": "An Institution: 921", "orcid": null } ] @@ -55,7 +55,7 @@ "creators": { "data": [ { - "id": "283", + "id": "894", "type": "people" } ] @@ -63,7 +63,7 @@ "submitter": { "data": [ { - "id": "283", + "id": "894", "type": "people" } ] @@ -71,7 +71,7 @@ "organisms": { "data": [ { - "id": "8", + "id": "59", "type": "organisms" } ] @@ -84,7 +84,7 @@ "people": { "data": [ { - "id": "283", + "id": "894", "type": "people" } ] @@ -92,31 +92,39 @@ "projects": { "data": [ { - "id": "293", + "id": "1053", "type": "projects" } ] }, "investigation": { "data": { - "id": "42", + "id": "133", "type": "investigations" } }, "study": { "data": { - "id": "40", + "id": "124", "type": "studies" } }, "data_files": { "data": [ { - "id": "13", + "id": "53", "type": "data_files" } ] }, + "samples": { + "data": [ + { + "id": "33", + "type": "samples" + } + ] + }, "models": { "data": [ @@ -125,7 +133,7 @@ "sops": { "data": [ { - "id": "17", + "id": "75", "type": "sops" } ] @@ -133,7 +141,7 @@ "publications": { "data": [ { - "id": "19", + "id": "41", "type": "publications" } ] @@ -146,21 +154,21 @@ "documents": { "data": [ { - "id": "27", + "id": "98", "type": "documents" } ] } }, "links": { - "self": "/assays/38" + "self": "/assays/96" }, "meta": { - "created": "2022-06-07T14:13:05.000Z", - "modified": "2022-06-07T14:13:05.000Z", + "created": "2024-06-20T12:31:26.000Z", + "modified": "2024-06-20T12:31:26.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "df811940-c899-013a-0f7e-0a81884ed284" + "uuid": "ef4bb210-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/assayResponse.json b/public/api/examples/assayResponse.json index e9d4c60663..3630ca5fd6 100644 --- a/public/api/examples/assayResponse.json +++ b/public/api/examples/assayResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "51", + "id": "111", "type": "assays", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "20", + "id": "45", "label": "Slack", "url": "http://www.slack.com/" } @@ -41,7 +41,7 @@ ], "creators": [ { - "profile": "/people/326", + "profile": "/people/949", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -53,7 +53,7 @@ "creators": { "data": [ { - "id": "326", + "id": "949", "type": "people" } ] @@ -61,7 +61,7 @@ "submitter": { "data": [ { - "id": "315", + "id": "935", "type": "people" } ] @@ -69,7 +69,7 @@ "organisms": { "data": [ { - "id": "12", + "id": "63", "type": "organisms" } ] @@ -82,11 +82,11 @@ "people": { "data": [ { - "id": "315", + "id": "935", "type": "people" }, { - "id": "326", + "id": "949", "type": "people" } ] @@ -94,35 +94,43 @@ "projects": { "data": [ { - "id": "329", + "id": "1098", "type": "projects" } ] }, "investigation": { "data": { - "id": "57", + "id": "150", "type": "investigations" } }, "study": { "data": { - "id": "55", + "id": "141", "type": "studies" } }, "data_files": { "data": [ { - "id": "17", + "id": "57", "type": "data_files" } ] }, + "samples": { + "data": [ + { + "id": "37", + "type": "samples" + } + ] + }, "models": { "data": [ { - "id": "41", + "id": "45", "type": "models" } ] @@ -130,7 +138,7 @@ "sops": { "data": [ { - "id": "21", + "id": "79", "type": "sops" } ] @@ -138,7 +146,7 @@ "publications": { "data": [ { - "id": "23", + "id": "45", "type": "publications" } ] @@ -151,21 +159,21 @@ "documents": { "data": [ { - "id": "31", + "id": "102", "type": "documents" } ] } }, "links": { - "self": "/assays/51" + "self": "/assays/111" }, "meta": { - "created": "2022-06-07T14:13:12.000Z", - "modified": "2022-06-07T14:13:12.000Z", + "created": "2024-06-20T12:31:33.000Z", + "modified": "2024-06-20T12:31:33.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "e37d2a60-c899-013a-0f7e-0a81884ed284" + "uuid": "f3ebed40-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/collectionItemPatch.json b/public/api/examples/collectionItemPatch.json index bef43c7614..845fa6a37d 100644 --- a/public/api/examples/collectionItemPatch.json +++ b/public/api/examples/collectionItemPatch.json @@ -1,6 +1,6 @@ { "data": { - "id": "20", + "id": "33", "type": "collection_items", "attributes": { "comment": "A fine addition to the collection indeed!!!", @@ -9,7 +9,7 @@ "relationships": { "asset": { "data": { - "id": "53", + "id": "50", "type": "sops" } } diff --git a/public/api/examples/collectionItemPatchResponse.json b/public/api/examples/collectionItemPatchResponse.json index 8c7dd92180..9b8d221c0f 100644 --- a/public/api/examples/collectionItemPatchResponse.json +++ b/public/api/examples/collectionItemPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "20", + "id": "33", "type": "collection_items", "attributes": { "comment": "A fine addition to the collection indeed!!!", @@ -9,13 +9,13 @@ "relationships": { "collection": { "data": { - "id": "15", + "id": "41", "type": "collections" } }, "asset": { "data": { - "id": "53", + "id": "50", "type": "sops" }, "meta": { @@ -24,11 +24,11 @@ } }, "links": { - "self": "/collections/15/items/20" + "self": "/collections/41/items/33" }, "meta": { - "created": "2022-06-07T14:14:29.000Z", - "modified": "2022-06-07T14:14:29.000Z", + "created": "2024-06-20T12:30:50.000Z", + "modified": "2024-06-20T12:30:50.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } diff --git a/public/api/examples/collectionItemPost.json b/public/api/examples/collectionItemPost.json index a129761c6c..83c02a7644 100644 --- a/public/api/examples/collectionItemPost.json +++ b/public/api/examples/collectionItemPost.json @@ -8,7 +8,7 @@ "relationships": { "asset": { "data": { - "id": "50", + "id": "47", "type": "sops" } } diff --git a/public/api/examples/collectionItemPostResponse.json b/public/api/examples/collectionItemPostResponse.json index 1bb374a938..37e89fbe48 100644 --- a/public/api/examples/collectionItemPostResponse.json +++ b/public/api/examples/collectionItemPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "14", + "id": "27", "type": "collection_items", "attributes": { "comment": "A fine addition to the collection indeed", @@ -9,13 +9,13 @@ "relationships": { "collection": { "data": { - "id": "9", + "id": "35", "type": "collections" } }, "asset": { "data": { - "id": "50", + "id": "47", "type": "sops" }, "meta": { @@ -24,11 +24,11 @@ } }, "links": { - "self": "/collections/9/items/14" + "self": "/collections/35/items/27" }, "meta": { - "created": "2022-06-07T14:14:27.000Z", - "modified": "2022-06-07T14:14:27.000Z", + "created": "2024-06-20T12:30:48.000Z", + "modified": "2024-06-20T12:30:48.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } diff --git a/public/api/examples/collectionItemResponse.json b/public/api/examples/collectionItemResponse.json index b1b2b74a5b..b3e80b4ea4 100644 --- a/public/api/examples/collectionItemResponse.json +++ b/public/api/examples/collectionItemResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "19", + "id": "32", "type": "collection_items", "attributes": { "comment": "A document", @@ -9,13 +9,13 @@ "relationships": { "collection": { "data": { - "id": "14", + "id": "40", "type": "collections" } }, "asset": { "data": { - "id": "65", + "id": "71", "type": "documents" }, "meta": { @@ -24,11 +24,11 @@ } }, "links": { - "self": "/collections/14/items/19" + "self": "/collections/40/items/32" }, "meta": { - "created": "2022-06-07T14:14:29.000Z", - "modified": "2022-06-07T14:14:29.000Z", + "created": "2024-06-20T12:30:49.000Z", + "modified": "2024-06-20T12:30:49.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } diff --git a/public/api/examples/collectionItemsResponse.json b/public/api/examples/collectionItemsResponse.json index 1102918a63..c17c177333 100644 --- a/public/api/examples/collectionItemsResponse.json +++ b/public/api/examples/collectionItemsResponse.json @@ -6,7 +6,7 @@ "version": "1.0" }, "links": { - "self": "/collections/10/items" + "self": "/collections/36/items" }, "meta": { "base_url": "http://localhost:3000", diff --git a/public/api/examples/collectionPatch.json b/public/api/examples/collectionPatch.json index a2fc8b0a26..d1d57b7b5d 100644 --- a/public/api/examples/collectionPatch.json +++ b/public/api/examples/collectionPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "collections", - "id": "8", + "id": "99", "attributes": { "title": "A Maximally Patched Collection", "description": "A collection of very interesting things", @@ -17,7 +17,7 @@ "permissions": [ { "resource": { - "id": "36", + "id": "1022251137", "type": "projects" }, "access": "edit" @@ -29,7 +29,7 @@ "creators": { "data": [ { - "id": "35", + "id": "1039987079", "type": "people" } ] @@ -37,7 +37,7 @@ "projects": { "data": [ { - "id": "36", + "id": "1022251137", "type": "projects" } ] diff --git a/public/api/examples/collectionPatchResponse.json b/public/api/examples/collectionPatchResponse.json index 6fb7cf131d..dc32c5fdb5 100644 --- a/public/api/examples/collectionPatchResponse.json +++ b/public/api/examples/collectionPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "8", + "id": "99", "type": "collections", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "36", + "id": "1022251137", "type": "projects" }, "access": "edit" @@ -26,14 +26,14 @@ "tag2", "tag3" ], - "created_at": "2022-06-07T14:12:25.000Z", - "updated_at": "2022-06-07T14:12:25.000Z", + "created_at": "2024-06-20T12:35:48.000Z", + "updated_at": "2024-06-20T12:35:48.000Z", "creators": [ { - "profile": "/people/35", + "profile": "/people/1039987079", "family_name": "Last", - "given_name": "Person29", - "affiliation": "An Institution: 35", + "given_name": "Person2213", + "affiliation": "An Institution: 2720", "orcid": null } ], @@ -43,7 +43,7 @@ "creators": { "data": [ { - "id": "35", + "id": "1039987079", "type": "people" } ] @@ -51,7 +51,7 @@ "submitter": { "data": [ { - "id": "34", + "id": "1039987078", "type": "people" } ] @@ -59,11 +59,11 @@ "people": { "data": [ { - "id": "34", + "id": "1039987078", "type": "people" }, { - "id": "35", + "id": "1039987079", "type": "people" } ] @@ -71,7 +71,7 @@ "projects": { "data": [ { - "id": "36", + "id": "1022251137", "type": "projects" } ] @@ -88,15 +88,15 @@ } }, "links": { - "self": "/collections/8", - "items": "/collections/8/items" + "self": "/collections/99", + "items": "/collections/99/items" }, "meta": { - "created": "2022-06-07T14:12:25.000Z", - "modified": "2022-06-07T14:12:25.000Z", + "created": "2024-06-20T12:35:48.000Z", + "modified": "2024-06-20T12:35:48.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "c79a7a60-c899-013a-0f7e-0a81884ed284" + "uuid": "8b7d87d0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/collectionPost.json b/public/api/examples/collectionPost.json index 11b1bf5ed8..ed55d2b4c2 100644 --- a/public/api/examples/collectionPost.json +++ b/public/api/examples/collectionPost.json @@ -15,7 +15,7 @@ "permissions": [ { "resource": { - "id": "2", + "id": "1022251103", "type": "projects" }, "access": "edit" @@ -27,7 +27,7 @@ "creators": { "data": [ { - "id": "3", + "id": "1039987047", "type": "people" } ] @@ -35,7 +35,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022251103", "type": "projects" } ] diff --git a/public/api/examples/collectionPostResponse.json b/public/api/examples/collectionPostResponse.json index 0deeccff3a..f73ba93a54 100644 --- a/public/api/examples/collectionPostResponse.json +++ b/public/api/examples/collectionPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "2", + "id": "93", "type": "collections", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "2", + "id": "1022251103", "type": "projects" }, "access": "edit" @@ -25,14 +25,14 @@ "tag1", "tag2" ], - "created_at": "2022-06-07T14:12:20.000Z", - "updated_at": "2022-06-07T14:12:20.000Z", + "created_at": "2024-06-20T12:35:44.000Z", + "updated_at": "2024-06-20T12:35:43.000Z", "creators": [ { - "profile": "/people/3", + "profile": "/people/1039987047", "family_name": "Last", - "given_name": "Person2", - "affiliation": "An Institution: 3", + "given_name": "Person2186", + "affiliation": "An Institution: 2688", "orcid": null } ], @@ -42,7 +42,7 @@ "creators": { "data": [ { - "id": "3", + "id": "1039987047", "type": "people" } ] @@ -50,7 +50,7 @@ "submitter": { "data": [ { - "id": "2", + "id": "1039987046", "type": "people" } ] @@ -58,11 +58,11 @@ "people": { "data": [ { - "id": "2", + "id": "1039987046", "type": "people" }, { - "id": "3", + "id": "1039987047", "type": "people" } ] @@ -70,7 +70,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022251103", "type": "projects" } ] @@ -87,15 +87,15 @@ } }, "links": { - "self": "/collections/2", - "items": "/collections/2/items" + "self": "/collections/93", + "items": "/collections/93/items" }, "meta": { - "created": "2022-06-07T14:12:20.000Z", - "modified": "2022-06-07T14:12:20.000Z", + "created": "2024-06-20T12:35:44.000Z", + "modified": "2024-06-20T12:35:43.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "c4b5aef0-c899-013a-0f7e-0a81884ed284" + "uuid": "89110560-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/collectionResponse.json b/public/api/examples/collectionResponse.json index bbe1695446..e5dcfabfdc 100644 --- a/public/api/examples/collectionResponse.json +++ b/public/api/examples/collectionResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "7", + "id": "98", "type": "collections", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "2", + "id": "175", "label": "Slack", "url": "http://www.slack.com/" } @@ -26,11 +26,11 @@ "Collection-tag4", "Collection-tag5" ], - "created_at": "2022-06-07T14:12:23.000Z", - "updated_at": "2022-06-07T14:12:24.000Z", + "created_at": "2024-06-20T12:35:46.000Z", + "updated_at": "2024-06-20T12:35:47.000Z", "creators": [ { - "profile": "/people/25", + "profile": "/people/1039987069", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -43,7 +43,7 @@ "creators": { "data": [ { - "id": "25", + "id": "1039987069", "type": "people" } ] @@ -51,7 +51,7 @@ "submitter": { "data": [ { - "id": "26", + "id": "1039987070", "type": "people" } ] @@ -59,11 +59,11 @@ "people": { "data": [ { - "id": "25", + "id": "1039987069", "type": "people" }, { - "id": "26", + "id": "1039987070", "type": "people" } ] @@ -71,7 +71,7 @@ "projects": { "data": [ { - "id": "28", + "id": "1022251129", "type": "projects" } ] @@ -79,7 +79,7 @@ "publications": { "data": [ { - "id": "2", + "id": "195", "type": "publications" } ] @@ -87,47 +87,47 @@ "items": { "data": [ { - "id": "7", + "id": "52", "type": "collection_items" }, { - "id": "8", + "id": "53", "type": "collection_items" }, { - "id": "9", + "id": "54", "type": "collection_items" }, { - "id": "10", + "id": "55", "type": "collection_items" }, { - "id": "11", + "id": "56", "type": "collection_items" }, { - "id": "12", + "id": "57", "type": "collection_items" } ] } }, "links": { - "self": "/collections/7", - "items": "/collections/7/items" + "self": "/collections/98", + "items": "/collections/98/items" }, "meta": { - "created": "2022-06-07T14:12:23.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:46.000Z", + "modified": "2024-06-20T12:35:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "c6ba22b0-c899-013a-0f7e-0a81884ed284" + "uuid": "8ab16a00-112f-013d-1f9d-0a81884ed284" } }, "included": [ { - "id": "7", + "id": "52", "type": "collection_items", "attributes": { "comment": "Readme!", @@ -136,13 +136,13 @@ "relationships": { "collection": { "data": { - "id": "7", + "id": "98", "type": "collections" } }, "asset": { "data": { - "id": "9", + "id": "222", "type": "documents" }, "meta": { @@ -151,17 +151,17 @@ } }, "links": { - "self": "/collections/7/items/7" + "self": "/collections/98/items/52" }, "meta": { - "created": "2022-06-07T14:12:24.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:46.000Z", + "modified": "2024-06-20T12:35:46.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } }, { - "id": "8", + "id": "53", "type": "collection_items", "attributes": { "comment": "Secret info", @@ -170,23 +170,23 @@ "relationships": { "collection": { "data": { - "id": "7", + "id": "98", "type": "collections" } } }, "links": { - "self": "/collections/7/items/8" + "self": "/collections/98/items/53" }, "meta": { - "created": "2022-06-07T14:12:24.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:47.000Z", + "modified": "2024-06-20T12:35:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } }, { - "id": "9", + "id": "54", "type": "collection_items", "attributes": { "comment": "The protocol", @@ -195,13 +195,13 @@ "relationships": { "collection": { "data": { - "id": "7", + "id": "98", "type": "collections" } }, "asset": { "data": { - "id": "2", + "id": "1055250447", "type": "sops" }, "meta": { @@ -210,17 +210,17 @@ } }, "links": { - "self": "/collections/7/items/9" + "self": "/collections/98/items/54" }, "meta": { - "created": "2022-06-07T14:12:24.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:47.000Z", + "modified": "2024-06-20T12:35:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } }, { - "id": "10", + "id": "55", "type": "collection_items", "attributes": { "comment": "Data 1", @@ -229,13 +229,13 @@ "relationships": { "collection": { "data": { - "id": "7", + "id": "98", "type": "collections" } }, "asset": { "data": { - "id": "4", + "id": "883654321", "type": "data_files" }, "meta": { @@ -244,17 +244,17 @@ } }, "links": { - "self": "/collections/7/items/10" + "self": "/collections/98/items/55" }, "meta": { - "created": "2022-06-07T14:12:24.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:47.000Z", + "modified": "2024-06-20T12:35:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } }, { - "id": "11", + "id": "56", "type": "collection_items", "attributes": { "comment": "Data 2", @@ -263,13 +263,13 @@ "relationships": { "collection": { "data": { - "id": "7", + "id": "98", "type": "collections" } }, "asset": { "data": { - "id": "5", + "id": "883654322", "type": "data_files" }, "meta": { @@ -278,17 +278,17 @@ } }, "links": { - "self": "/collections/7/items/11" + "self": "/collections/98/items/56" }, "meta": { - "created": "2022-06-07T14:12:24.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:47.000Z", + "modified": "2024-06-20T12:35:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } }, { - "id": "12", + "id": "57", "type": "collection_items", "attributes": { "comment": "Bad data", @@ -297,17 +297,17 @@ "relationships": { "collection": { "data": { - "id": "7", + "id": "98", "type": "collections" } } }, "links": { - "self": "/collections/7/items/12" + "self": "/collections/98/items/57" }, "meta": { - "created": "2022-06-07T14:12:24.000Z", - "modified": "2022-06-07T14:12:24.000Z", + "created": "2024-06-20T12:35:47.000Z", + "modified": "2024-06-20T12:35:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } diff --git a/public/api/examples/collectionsResponse.json b/public/api/examples/collectionsResponse.json index fe3130f636..4a8a9ec210 100644 --- a/public/api/examples/collectionsResponse.json +++ b/public/api/examples/collectionsResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "5", + "id": "96", "type": "collections", "attributes": { "title": "A Maximal Collection" }, "links": { - "self": "/collections/5" + "self": "/collections/96" } }, { - "id": "4", + "id": "95", "type": "collections", "attributes": { "title": "A Minimal Collection" }, "links": { - "self": "/collections/4" + "self": "/collections/95" } } ], diff --git a/public/api/examples/contentBlobResponse.json b/public/api/examples/contentBlobResponse.json index 4a2a2d5c33..12930d2eec 100644 --- a/public/api/examples/contentBlobResponse.json +++ b/public/api/examples/contentBlobResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "316", + "id": "1050453050", "type": "content_blobs", "attributes": { "original_filename": "min file", @@ -13,21 +13,21 @@ "relationships": { "asset": { "data": { - "id": "45", + "id": "1055250487", "type": "sops" } } }, "links": { - "self": "/sops/45/content_blobs/316", - "download": "/sops/45/content_blobs/316/download" + "self": "/sops/1055250487/content_blobs/1050453050", + "download": "/sops/1055250487/content_blobs/1050453050/download" }, "meta": { - "created": "2022-06-07T14:14:09.000Z", - "modified": "2022-06-07T14:14:09.000Z", + "created": "2024-06-20T12:38:35.000Z", + "modified": "2024-06-20T12:38:35.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "05bf37b0-c89a-013a-0f7e-0a81884ed284" + "uuid": "ef445e70-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/dataFilePatch.json b/public/api/examples/dataFilePatch.json index c90f8242ec..23f645ef1f 100644 --- a/public/api/examples/dataFilePatch.json +++ b/public/api/examples/dataFilePatch.json @@ -1,7 +1,7 @@ { "data": { "type": "data_files", - "id": "1", + "id": "883654311", "attributes": { "title": "A Maximally Patched Data File", "description": "Study of the Human Genome", @@ -29,7 +29,7 @@ "permissions": [ { "resource": { - "id": "2", + "id": "1022251011", "type": "projects" }, "access": "edit" @@ -41,7 +41,7 @@ "creators": { "data": [ { - "id": "3", + "id": "1039986955", "type": "people" } ] @@ -49,7 +49,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022251011", "type": "projects" } ] @@ -57,7 +57,7 @@ "assays": { "data": [ { - "id": "1", + "id": "1035386688", "type": "assays" } ] @@ -65,7 +65,7 @@ "publications": { "data": [ { - "id": "1", + "id": "191", "type": "publications" } ] @@ -73,7 +73,7 @@ "events": { "data": [ { - "id": "1", + "id": "1025618717", "type": "events" } ] @@ -81,7 +81,7 @@ "workflows": { "data": [ { - "id": "1", + "id": "133", "type": "workflows" } ] diff --git a/public/api/examples/dataFilePatchResponse.json b/public/api/examples/dataFilePatchResponse.json index 8b92aa5350..431a0b809f 100644 --- a/public/api/examples/dataFilePatchResponse.json +++ b/public/api/examples/dataFilePatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "1", + "id": "883654311", "type": "data_files", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "2", + "id": "1022251011", "type": "projects" }, "access": "edit" @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/data_files/1?version=1", + "url": "http://localhost:3000/data_files/883654311?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2023-03-07T10:50:32.823Z", - "updated_at": "2023-03-07T10:50:33.024Z", + "created_at": "2024-06-20T12:35:31.000Z", + "updated_at": "2024-06-20T12:35:31.000Z", "doi": null, "content_blobs": [ { @@ -47,16 +47,16 @@ "md5sum": "565ae8a7a743c3bfd9f15c69647f5b8b", "sha1sum": "b9d2148740050b7f37975edd0fb97faa508ff767", "content_type": "application/pdf", - "link": "http://localhost:3000/data_files/1/content_blobs/1", + "link": "http://localhost:3000/data_files/883654311/content_blobs/1050452689", "size": 8827 } ], "creators": [ { - "profile": "/people/3", + "profile": "/people/1039986955", "family_name": "Last", - "given_name": "Person185", - "affiliation": "An Institution: 218", + "given_name": "Person2117", + "affiliation": "An Institution: 2596", "orcid": null } ], @@ -78,7 +78,7 @@ "creators": { "data": [ { - "id": "3", + "id": "1039986955", "type": "people" } ] @@ -86,7 +86,7 @@ "submitter": { "data": [ { - "id": "2", + "id": "1039986954", "type": "people" } ] @@ -94,11 +94,11 @@ "people": { "data": [ { - "id": "2", + "id": "1039986954", "type": "people" }, { - "id": "3", + "id": "1039986955", "type": "people" } ] @@ -106,7 +106,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022251011", "type": "projects" } ] @@ -114,7 +114,7 @@ "investigations": { "data": [ { - "id": "1", + "id": "973654842", "type": "investigations" } ] @@ -122,7 +122,7 @@ "studies": { "data": [ { - "id": "1", + "id": "1060384900", "type": "studies" } ] @@ -130,7 +130,7 @@ "assays": { "data": [ { - "id": "1", + "id": "1035386688", "type": "assays" } ] @@ -138,7 +138,7 @@ "publications": { "data": [ { - "id": "1", + "id": "191", "type": "publications" } ] @@ -146,7 +146,7 @@ "events": { "data": [ { - "id": "1", + "id": "1025618717", "type": "events" } ] @@ -154,7 +154,7 @@ "workflows": { "data": [ { - "id": "1", + "id": "133", "type": "workflows" } ] @@ -167,14 +167,14 @@ } }, "links": { - "self": "/data_files/1?version=1" + "self": "/data_files/883654311?version=1" }, "meta": { - "created": "2023-03-07T10:50:32.812Z", - "modified": "2023-03-07T10:50:33.002Z", + "created": "2024-06-20T12:35:31.000Z", + "modified": "2024-06-20T12:35:31.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "cebc2810-9f03-013b-15cf-0a81884ed284" + "uuid": "819648d0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/dataFilePost.json b/public/api/examples/dataFilePost.json index 5be85c6e5c..1540713c63 100644 --- a/public/api/examples/dataFilePost.json +++ b/public/api/examples/dataFilePost.json @@ -33,7 +33,7 @@ "permissions": [ { "resource": { - "id": "2", + "id": "1022250976", "type": "projects" }, "access": "edit" @@ -45,7 +45,7 @@ "creators": { "data": [ { - "id": "3", + "id": "1039986916", "type": "people" } ] @@ -53,7 +53,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022250976", "type": "projects" } ] @@ -61,7 +61,7 @@ "assays": { "data": [ { - "id": "1", + "id": "1035386683", "type": "assays" } ] @@ -69,7 +69,7 @@ "publications": { "data": [ { - "id": "1", + "id": "186", "type": "publications" } ] @@ -77,7 +77,7 @@ "events": { "data": [ { - "id": "1", + "id": "1025618712", "type": "events" } ] @@ -85,7 +85,7 @@ "workflows": { "data": [ { - "id": "1", + "id": "128", "type": "workflows" } ] diff --git a/public/api/examples/dataFilePostResponse.json b/public/api/examples/dataFilePostResponse.json index 94f2b99904..885ac77908 100644 --- a/public/api/examples/dataFilePostResponse.json +++ b/public/api/examples/dataFilePostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "2", + "id": "883654305", "type": "data_files", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "2", + "id": "1022250976", "type": "projects" }, "access": "edit" @@ -30,14 +30,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/data_files/2?version=1", + "url": "http://localhost:3000/data_files/883654305?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2023-03-07T10:50:29.057Z", - "updated_at": "2023-03-07T10:50:29.057Z", + "created_at": "2024-06-20T12:35:26.000Z", + "updated_at": "2024-06-20T12:35:26.000Z", "doi": null, "content_blobs": [ { @@ -46,16 +46,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/pdf", - "link": "http://localhost:3000/data_files/2/content_blobs/3", + "link": "http://localhost:3000/data_files/883654305/content_blobs/1050452679", "size": null } ], "creators": [ { - "profile": "/people/3", + "profile": "/people/1039986916", "family_name": "Last", - "given_name": "Person151", - "affiliation": "An Institution: 179", + "given_name": "Person2083", + "affiliation": "An Institution: 2557", "orcid": null } ], @@ -77,7 +77,7 @@ "creators": { "data": [ { - "id": "3", + "id": "1039986916", "type": "people" } ] @@ -85,7 +85,7 @@ "submitter": { "data": [ { - "id": "2", + "id": "1039986915", "type": "people" } ] @@ -93,11 +93,11 @@ "people": { "data": [ { - "id": "2", + "id": "1039986915", "type": "people" }, { - "id": "3", + "id": "1039986916", "type": "people" } ] @@ -105,7 +105,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022250976", "type": "projects" } ] @@ -113,7 +113,7 @@ "investigations": { "data": [ { - "id": "1", + "id": "973654837", "type": "investigations" } ] @@ -121,7 +121,7 @@ "studies": { "data": [ { - "id": "1", + "id": "1060384895", "type": "studies" } ] @@ -129,7 +129,7 @@ "assays": { "data": [ { - "id": "1", + "id": "1035386683", "type": "assays" } ] @@ -137,7 +137,7 @@ "publications": { "data": [ { - "id": "1", + "id": "186", "type": "publications" } ] @@ -145,7 +145,7 @@ "events": { "data": [ { - "id": "1", + "id": "1025618712", "type": "events" } ] @@ -153,7 +153,7 @@ "workflows": { "data": [ { - "id": "1", + "id": "128", "type": "workflows" } ] @@ -166,14 +166,14 @@ } }, "links": { - "self": "/data_files/2?version=1" + "self": "/data_files/883654305?version=1" }, "meta": { - "created": "2023-03-07T10:50:29.027Z", - "modified": "2023-03-07T10:50:29.057Z", + "created": "2024-06-20T12:35:26.000Z", + "modified": "2024-06-20T12:35:26.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "cc778f60-9f03-013b-15cf-0a81884ed284" + "uuid": "7ed41350-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/dataFileResponse.json b/public/api/examples/dataFileResponse.json index 8531b83576..6e9033dddf 100644 --- a/public/api/examples/dataFileResponse.json +++ b/public/api/examples/dataFileResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "2", + "id": "883654310", "type": "data_files", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "1", + "id": "171", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/data_files/2?version=1", + "url": "http://localhost:3000/data_files/883654310?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2023-03-07T10:50:32.170Z", - "updated_at": "2023-03-07T10:50:32.170Z", + "created_at": "2024-06-20T12:35:30.000Z", + "updated_at": "2024-06-20T12:35:30.000Z", "doi": null, "content_blobs": [ { @@ -47,13 +47,13 @@ "md5sum": "565ae8a7a743c3bfd9f15c69647f5b8b", "sha1sum": "b9d2148740050b7f37975edd0fb97faa508ff767", "content_type": "application/pdf", - "link": "http://localhost:3000/data_files/2/content_blobs/5", + "link": "http://localhost:3000/data_files/883654310/content_blobs/1050452688", "size": 8827 } ], "creators": [ { - "profile": "/people/15", + "profile": "/people/1039986951", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -78,7 +78,7 @@ "creators": { "data": [ { - "id": "15", + "id": "1039986951", "type": "people" } ] @@ -86,7 +86,7 @@ "submitter": { "data": [ { - "id": "16", + "id": "1039986952", "type": "people" } ] @@ -94,11 +94,11 @@ "people": { "data": [ { - "id": "15", + "id": "1039986951", "type": "people" }, { - "id": "16", + "id": "1039986952", "type": "people" } ] @@ -106,7 +106,7 @@ "projects": { "data": [ { - "id": "15", + "id": "1022251009", "type": "projects" } ] @@ -114,7 +114,7 @@ "investigations": { "data": [ { - "id": "2", + "id": "973654841", "type": "investigations" } ] @@ -122,7 +122,7 @@ "studies": { "data": [ { - "id": "2", + "id": "1060384899", "type": "studies" } ] @@ -130,7 +130,7 @@ "assays": { "data": [ { - "id": "2", + "id": "1035386687", "type": "assays" } ] @@ -138,7 +138,7 @@ "publications": { "data": [ { - "id": "2", + "id": "190", "type": "publications" } ] @@ -146,7 +146,7 @@ "events": { "data": [ { - "id": "2", + "id": "1025618716", "type": "events" } ] @@ -154,7 +154,7 @@ "workflows": { "data": [ { - "id": "2", + "id": "132", "type": "workflows" } ] @@ -167,14 +167,14 @@ } }, "links": { - "self": "/data_files/2?version=1" + "self": "/data_files/883654310?version=1" }, "meta": { - "created": "2023-03-07T10:50:32.132Z", - "modified": "2023-03-07T10:50:32.170Z", + "created": "2024-06-20T12:35:30.000Z", + "modified": "2024-06-20T12:35:30.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "ce53a460-9f03-013b-15cf-0a81884ed284" + "uuid": "811359c0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/documentPatch.json b/public/api/examples/documentPatch.json index 411c682591..3d79206d1d 100644 --- a/public/api/examples/documentPatch.json +++ b/public/api/examples/documentPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "documents", - "id": "642", + "id": "308", "attributes": { "title": "A Maximally Patched Document", "description": "A report about the thing that happened", @@ -17,7 +17,7 @@ "permissions": [ { "resource": { - "id": "16398", + "id": "1022252726", "type": "projects" }, "access": "edit" @@ -25,7 +25,7 @@ ] }, "extended_attributes": { - "extended_metadata_type_id": "3021", + "extended_metadata_type_id": "401", "attribute_map": { "role_email": "alice@email.com", "role_phone": "0012345", @@ -44,7 +44,7 @@ "creators": { "data": [ { - "id": "13852", + "id": "1039988618", "type": "people" } ] @@ -52,7 +52,7 @@ "projects": { "data": [ { - "id": "16398", + "id": "1022252726", "type": "projects" } ] @@ -60,7 +60,7 @@ "assays": { "data": [ { - "id": "1905", + "id": "1035386915", "type": "assays" } ] @@ -68,7 +68,7 @@ "workflows": { "data": [ { - "id": "339", + "id": "225", "type": "workflows" } ] diff --git a/public/api/examples/documentPatchResponse.json b/public/api/examples/documentPatchResponse.json index e624d6f62b..754b264e16 100644 --- a/public/api/examples/documentPatchResponse.json +++ b/public/api/examples/documentPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "642", + "id": "308", "type": "documents", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "16398", + "id": "1022252726", "type": "projects" }, "access": "edit" @@ -19,7 +19,7 @@ ], "extended_attributes": { - "extended_metadata_type_id": "3021", + "extended_metadata_type_id": "401", "attribute_map": { "role_email": "alice@email.com", "role_phone": "0012345", @@ -46,32 +46,32 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/documents/642?version=1", + "url": "http://localhost:3000/documents/308?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2024-03-15T16:09:58.000Z", - "updated_at": "2024-03-15T16:09:58.000Z", + "created_at": "2024-06-20T12:39:26.000Z", + "updated_at": "2024-06-20T12:39:26.000Z", "doi": null, "content_blobs": [ { - "original_filename": "file-22", + "original_filename": "file-332", "url": null, - "md5sum": "28219bc7b5e57f29a560e813a8a19f2d", - "sha1sum": "d210301cad1b23eeecc304180c62047468a78445", + "md5sum": "cfd0a2fa5d67073a2046c0bfe42fb68f", + "sha1sum": "e40baba579e6063e7f2bec398e5657a23a421fdb", "content_type": "application/pdf", - "link": "http://localhost:3000/documents/642/content_blobs/2825", - "size": 9 + "link": "http://localhost:3000/documents/308/content_blobs/1050453213", + "size": 10 } ], "creators": [ { - "profile": "/people/13852", + "profile": "/people/1039988618", "family_name": "Last", - "given_name": "Person82", - "affiliation": "An Institution: 108", + "given_name": "Person3431", + "affiliation": "An Institution: 4272", "orcid": null } ], @@ -81,7 +81,7 @@ "creators": { "data": [ { - "id": "13852", + "id": "1039988618", "type": "people" } ] @@ -89,7 +89,7 @@ "submitter": { "data": [ { - "id": "13851", + "id": "1039988617", "type": "people" } ] @@ -97,11 +97,11 @@ "people": { "data": [ { - "id": "13851", + "id": "1039988617", "type": "people" }, { - "id": "13852", + "id": "1039988618", "type": "people" } ] @@ -109,7 +109,7 @@ "projects": { "data": [ { - "id": "16398", + "id": "1022252726", "type": "projects" } ] @@ -117,7 +117,7 @@ "investigations": { "data": [ { - "id": "4748", + "id": "973655139", "type": "investigations" } ] @@ -125,7 +125,7 @@ "studies": { "data": [ { - "id": "3623", + "id": "1060385170", "type": "studies" } ] @@ -133,7 +133,7 @@ "assays": { "data": [ { - "id": "1905", + "id": "1035386915", "type": "assays" } ] @@ -146,21 +146,21 @@ "workflows": { "data": [ { - "id": "339", + "id": "225", "type": "workflows" } ] } }, "links": { - "self": "/documents/642?version=1" + "self": "/documents/308?version=1" }, "meta": { - "created": "2024-03-15T16:09:58.000Z", - "modified": "2024-03-15T16:09:58.000Z", + "created": "2024-06-20T12:39:26.000Z", + "modified": "2024-06-20T12:39:26.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "650f9950-c514-013c-6432-7efdca78d793" + "uuid": "0dd88500-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/documentPost.json b/public/api/examples/documentPost.json index f7ffc6b21d..d23abf3e73 100644 --- a/public/api/examples/documentPost.json +++ b/public/api/examples/documentPost.json @@ -21,7 +21,7 @@ "permissions": [ { "resource": { - "id": "16368", + "id": "1022252696", "type": "projects" }, "access": "edit" @@ -29,7 +29,7 @@ ] }, "extended_attributes": { - "extended_metadata_type_id": "3006", + "extended_metadata_type_id": "386", "attribute_map": { "role_email": "alice@email.com", "role_phone": "0012345", @@ -48,7 +48,7 @@ "creators": { "data": [ { - "id": "13824", + "id": "1039988590", "type": "people" } ] @@ -56,7 +56,7 @@ "projects": { "data": [ { - "id": "16368", + "id": "1022252696", "type": "projects" } ] @@ -64,7 +64,7 @@ "assays": { "data": [ { - "id": "1900", + "id": "1035386910", "type": "assays" } ] @@ -72,7 +72,7 @@ "workflows": { "data": [ { - "id": "334", + "id": "220", "type": "workflows" } ] diff --git a/public/api/examples/documentPostResponse.json b/public/api/examples/documentPostResponse.json index 6206867a8f..b29a029c4c 100644 --- a/public/api/examples/documentPostResponse.json +++ b/public/api/examples/documentPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "636", + "id": "302", "type": "documents", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "16368", + "id": "1022252696", "type": "projects" }, "access": "edit" @@ -19,7 +19,7 @@ ], "extended_attributes": { - "extended_metadata_type_id": "3006", + "extended_metadata_type_id": "386", "attribute_map": { "role_email": "alice@email.com", "role_phone": "0012345", @@ -45,14 +45,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/documents/636?version=1", + "url": "http://localhost:3000/documents/302?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2024-03-15T16:09:56.000Z", - "updated_at": "2024-03-15T16:09:56.000Z", + "created_at": "2024-06-20T12:39:23.000Z", + "updated_at": "2024-06-20T12:39:23.000Z", "doi": null, "content_blobs": [ { @@ -61,16 +61,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/pdf", - "link": "http://localhost:3000/documents/636/content_blobs/2814", + "link": "http://localhost:3000/documents/302/content_blobs/1050453202", "size": null } ], "creators": [ { - "profile": "/people/13824", + "profile": "/people/1039988590", "family_name": "Last", - "given_name": "Person59", - "affiliation": "An Institution: 80", + "given_name": "Person3408", + "affiliation": "An Institution: 4244", "orcid": null } ], @@ -80,7 +80,7 @@ "creators": { "data": [ { - "id": "13824", + "id": "1039988590", "type": "people" } ] @@ -88,7 +88,7 @@ "submitter": { "data": [ { - "id": "13823", + "id": "1039988589", "type": "people" } ] @@ -96,11 +96,11 @@ "people": { "data": [ { - "id": "13823", + "id": "1039988589", "type": "people" }, { - "id": "13824", + "id": "1039988590", "type": "people" } ] @@ -108,7 +108,7 @@ "projects": { "data": [ { - "id": "16368", + "id": "1022252696", "type": "projects" } ] @@ -116,7 +116,7 @@ "investigations": { "data": [ { - "id": "4743", + "id": "973655134", "type": "investigations" } ] @@ -124,7 +124,7 @@ "studies": { "data": [ { - "id": "3618", + "id": "1060385165", "type": "studies" } ] @@ -132,7 +132,7 @@ "assays": { "data": [ { - "id": "1900", + "id": "1035386910", "type": "assays" } ] @@ -145,21 +145,21 @@ "workflows": { "data": [ { - "id": "334", + "id": "220", "type": "workflows" } ] } }, "links": { - "self": "/documents/636?version=1" + "self": "/documents/302?version=1" }, "meta": { - "created": "2024-03-15T16:09:56.000Z", - "modified": "2024-03-15T16:09:56.000Z", + "created": "2024-06-20T12:39:23.000Z", + "modified": "2024-06-20T12:39:23.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "63f3bb30-c514-013c-6432-7efdca78d793" + "uuid": "0ba000f0-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/documentResponse.json b/public/api/examples/documentResponse.json index 52748d52c0..3d24399696 100644 --- a/public/api/examples/documentResponse.json +++ b/public/api/examples/documentResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "641", + "id": "307", "type": "documents", "attributes": { "policy": { @@ -11,13 +11,13 @@ }, "discussion_links": [ { - "id": "723", + "id": "244", "label": "Slack", "url": "http://www.slack.com/" } ], "extended_attributes": { - "extended_metadata_type_id": "3018", + "extended_metadata_type_id": "398", "attribute_map": { "role_email": "alice@email.com", "role_phone": "0012345", @@ -46,14 +46,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/documents/641?version=1", + "url": "http://localhost:3000/documents/307?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2024-03-15T16:09:58.000Z", - "updated_at": "2024-03-15T16:09:58.000Z", + "created_at": "2024-06-20T12:39:26.000Z", + "updated_at": "2024-06-20T12:39:26.000Z", "doi": null, "content_blobs": [ { @@ -62,13 +62,13 @@ "md5sum": "726de0a3f94d65056b909b9736e10349", "sha1sum": "fbcc0dee4b5415de4c82ef5b137d8231fec1331b", "content_type": "application/pdf", - "link": "http://localhost:3000/documents/641/content_blobs/2823", + "link": "http://localhost:3000/documents/307/content_blobs/1050453211", "size": 8 } ], "creators": [ { - "profile": "/people/13848", + "profile": "/people/1039988614", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -81,7 +81,7 @@ "creators": { "data": [ { - "id": "13848", + "id": "1039988614", "type": "people" } ] @@ -89,7 +89,7 @@ "submitter": { "data": [ { - "id": "13849", + "id": "1039988615", "type": "people" } ] @@ -97,11 +97,11 @@ "people": { "data": [ { - "id": "13848", + "id": "1039988614", "type": "people" }, { - "id": "13849", + "id": "1039988615", "type": "people" } ] @@ -109,7 +109,7 @@ "projects": { "data": [ { - "id": "16396", + "id": "1022252724", "type": "projects" } ] @@ -117,7 +117,7 @@ "investigations": { "data": [ { - "id": "4747", + "id": "973655138", "type": "investigations" } ] @@ -125,7 +125,7 @@ "studies": { "data": [ { - "id": "3622", + "id": "1060385169", "type": "studies" } ] @@ -133,7 +133,7 @@ "assays": { "data": [ { - "id": "1904", + "id": "1035386914", "type": "assays" } ] @@ -141,7 +141,7 @@ "publications": { "data": [ { - "id": "1698", + "id": "334", "type": "publications" } ] @@ -149,21 +149,21 @@ "workflows": { "data": [ { - "id": "338", + "id": "224", "type": "workflows" } ] } }, "links": { - "self": "/documents/641?version=1" + "self": "/documents/307?version=1" }, "meta": { - "created": "2024-03-15T16:09:58.000Z", - "modified": "2024-03-15T16:09:58.000Z", + "created": "2024-06-20T12:39:26.000Z", + "modified": "2024-06-20T12:39:26.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "64ddb5c0-c514-013c-6432-7efdca78d793" + "uuid": "0d79a100-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/documentsResponse.json b/public/api/examples/documentsResponse.json index b9f70b27e1..bb2131f583 100644 --- a/public/api/examples/documentsResponse.json +++ b/public/api/examples/documentsResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "638", + "id": "305", "type": "documents", "attributes": { - "title": "A Minimal Document" + "title": "A Maximal Document" }, "links": { - "self": "/documents/638" + "self": "/documents/305" } }, { - "id": "639", + "id": "304", "type": "documents", "attributes": { - "title": "A Maximal Document" + "title": "A Minimal Document" }, "links": { - "self": "/documents/639" + "self": "/documents/304" } } ], diff --git a/public/api/examples/eventPatch.json b/public/api/examples/eventPatch.json index b2ebcc1dcb..5d8194a5b8 100644 --- a/public/api/examples/eventPatch.json +++ b/public/api/examples/eventPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "events", - "id": "20", + "id": "1025618785", "attributes": { "title": "A Maximally Patched Event", "description": "A thing happening", @@ -10,7 +10,7 @@ "permissions": [ { "resource": { - "id": "459", + "id": "1022252557", "type": "projects" }, "access": "edit" @@ -28,7 +28,7 @@ "projects": { "data": [ { - "id": "459", + "id": "1022252557", "type": "projects" } ] @@ -36,7 +36,7 @@ "data_files": { "data": [ { - "id": "28", + "id": "883654388", "type": "data_files" } ] @@ -44,7 +44,7 @@ "presentations": { "data": [ { - "id": "20", + "id": "145", "type": "presentations" } ] @@ -52,7 +52,7 @@ "publications": { "data": [ { - "id": "34", + "id": "330", "type": "publications" } ] diff --git a/public/api/examples/eventPatchResponse.json b/public/api/examples/eventPatchResponse.json index 137ba3028c..5e107d611a 100644 --- a/public/api/examples/eventPatchResponse.json +++ b/public/api/examples/eventPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "20", + "id": "1025618785", "type": "events", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "459", + "id": "1022252557", "type": "projects" }, "access": "edit" @@ -28,7 +28,7 @@ "submitter": { "data": [ { - "id": "424", + "id": "1039988454", "type": "people" } ] @@ -36,7 +36,7 @@ "projects": { "data": [ { - "id": "459", + "id": "1022252557", "type": "projects" } ] @@ -44,7 +44,7 @@ "data_files": { "data": [ { - "id": "28", + "id": "883654388", "type": "data_files" } ] @@ -52,7 +52,7 @@ "publications": { "data": [ { - "id": "34", + "id": "330", "type": "publications" } ] @@ -60,21 +60,21 @@ "presentations": { "data": [ { - "id": "20", + "id": "145", "type": "presentations" } ] } }, "links": { - "self": "/events/20" + "self": "/events/1025618785" }, "meta": { - "created": "2022-06-07T14:13:27.000Z", - "modified": "2022-06-07T14:13:27.000Z", + "created": "2024-06-20T12:39:01.000Z", + "modified": "2024-06-20T12:39:01.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "ecc58c30-c899-013a-0f7e-0a81884ed284" + "uuid": "fea3a130-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/eventPost.json b/public/api/examples/eventPost.json index 33efa56b00..39a2d474ea 100644 --- a/public/api/examples/eventPost.json +++ b/public/api/examples/eventPost.json @@ -9,7 +9,7 @@ "permissions": [ { "resource": { - "id": "436", + "id": "1022252534", "type": "projects" }, "access": "edit" @@ -27,7 +27,7 @@ "projects": { "data": [ { - "id": "436", + "id": "1022252534", "type": "projects" } ] @@ -35,7 +35,7 @@ "data_files": { "data": [ { - "id": "23", + "id": "883654383", "type": "data_files" } ] @@ -43,7 +43,7 @@ "presentations": { "data": [ { - "id": "15", + "id": "140", "type": "presentations" } ] @@ -51,7 +51,7 @@ "publications": { "data": [ { - "id": "29", + "id": "325", "type": "publications" } ] diff --git a/public/api/examples/eventPostResponse.json b/public/api/examples/eventPostResponse.json index d85dd32902..273456ee2d 100644 --- a/public/api/examples/eventPostResponse.json +++ b/public/api/examples/eventPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "14", + "id": "1025618779", "type": "events", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "436", + "id": "1022252534", "type": "projects" }, "access": "edit" @@ -28,7 +28,7 @@ "submitter": { "data": [ { - "id": "406", + "id": "1039988436", "type": "people" } ] @@ -36,7 +36,7 @@ "projects": { "data": [ { - "id": "436", + "id": "1022252534", "type": "projects" } ] @@ -44,7 +44,7 @@ "data_files": { "data": [ { - "id": "23", + "id": "883654383", "type": "data_files" } ] @@ -52,7 +52,7 @@ "publications": { "data": [ { - "id": "29", + "id": "325", "type": "publications" } ] @@ -60,21 +60,21 @@ "presentations": { "data": [ { - "id": "15", + "id": "140", "type": "presentations" } ] } }, "links": { - "self": "/events/14" + "self": "/events/1025618779" }, "meta": { - "created": "2022-06-07T14:13:24.000Z", - "modified": "2022-06-07T14:13:24.000Z", + "created": "2024-06-20T12:38:58.000Z", + "modified": "2024-06-20T12:38:58.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "eb17d850-c899-013a-0f7e-0a81884ed284" + "uuid": "fd1d2960-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/eventResponse.json b/public/api/examples/eventResponse.json index ab07d91b5c..2ee8c38baf 100644 --- a/public/api/examples/eventResponse.json +++ b/public/api/examples/eventResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "19", + "id": "1025618784", "type": "events", "attributes": { "policy": { @@ -22,7 +22,7 @@ "submitter": { "data": [ { - "id": "422", + "id": "1039988452", "type": "people" } ] @@ -30,7 +30,7 @@ "projects": { "data": [ { - "id": "457", + "id": "1022252555", "type": "projects" } ] @@ -38,7 +38,7 @@ "data_files": { "data": [ { - "id": "27", + "id": "883654387", "type": "data_files" } ] @@ -46,7 +46,7 @@ "publications": { "data": [ { - "id": "33", + "id": "329", "type": "publications" } ] @@ -54,21 +54,21 @@ "presentations": { "data": [ { - "id": "19", + "id": "144", "type": "presentations" } ] } }, "links": { - "self": "/events/19" + "self": "/events/1025618784" }, "meta": { - "created": "2022-06-07T14:13:27.000Z", - "modified": "2022-06-07T14:13:27.000Z", + "created": "2024-06-20T12:39:00.000Z", + "modified": "2024-06-20T12:39:00.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "ec66f880-c899-013a-0f7e-0a81884ed284" + "uuid": "fe4eb280-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/extendedMetadataTypeResponse.json b/public/api/examples/extendedMetadataTypeResponse.json index 23f238bd37..523ea4629f 100644 --- a/public/api/examples/extendedMetadataTypeResponse.json +++ b/public/api/examples/extendedMetadataTypeResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "233", + "id": "278", "type": "extended_metadata_types", "attributes": { "title": "A Max Extended Metadata Type", @@ -8,13 +8,13 @@ "enabled": true, "extended_metadata_attributes": [ { - "id": "502", + "id": "652", "title": "age", "label": "Age", "description": null, "sample_attribute_type": { - "id": "539", - "title": "Integer attribute type 4", + "id": "765", + "title": "Integer attribute type 43", "base_type": "Integer", "regexp": ".*" }, @@ -24,13 +24,13 @@ "linked_extended_metadata_type_id": null }, { - "id": "503", + "id": "653", "title": "name", "label": "Name", "description": null, "sample_attribute_type": { - "id": "540", - "title": "String attribute type 7", + "id": "766", + "title": "String attribute type 483", "base_type": "String", "regexp": ".*" }, @@ -40,13 +40,13 @@ "linked_extended_metadata_type_id": null }, { - "id": "504", + "id": "654", "title": "date", "label": "Date", "description": null, "sample_attribute_type": { - "id": "541", - "title": "DateTime attribute type 4", + "id": "767", + "title": "DateTime attribute type 43", "base_type": "DateTime", "regexp": ".*" }, @@ -58,7 +58,7 @@ ] }, "links": { - "self": "/extended_metadata_types/233" + "self": "/extended_metadata_types/278" }, "meta": { "api_version": "0.3", diff --git a/public/api/examples/extendedMetadataTypesResponse.json b/public/api/examples/extendedMetadataTypesResponse.json index 08b883ad75..3397b0a138 100644 --- a/public/api/examples/extendedMetadataTypesResponse.json +++ b/public/api/examples/extendedMetadataTypesResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "231", + "id": "276", "type": "extended_metadata_types", "attributes": { "title": "A Min Extended Metadata Type" }, "links": { - "self": "/extended_metadata_types/231" + "self": "/extended_metadata_types/276" } }, { - "id": "232", + "id": "277", "type": "extended_metadata_types", "attributes": { "title": "A Max Extended Metadata Type" }, "links": { - "self": "/extended_metadata_types/232" + "self": "/extended_metadata_types/277" } } ], diff --git a/public/api/examples/fileTemplatePatch.json b/public/api/examples/fileTemplatePatch.json index cfa2e690de..014123c381 100644 --- a/public/api/examples/fileTemplatePatch.json +++ b/public/api/examples/fileTemplatePatch.json @@ -1,7 +1,7 @@ { "data": { "type": "file_templates", - "id": "41", + "id": "57", "attributes": { "title": "A Maximal FileTemplate", "description": "This is the description", @@ -28,7 +28,7 @@ "permissions": [ { "resource": { - "id": "278", + "id": "1022253159", "type": "projects" }, "access": "edit" @@ -40,7 +40,7 @@ "creators": { "data": [ { - "id": "333", + "id": "1039989032", "type": "people" } ] @@ -48,7 +48,7 @@ "projects": { "data": [ { - "id": "278", + "id": "1022253159", "type": "projects" } ] diff --git a/public/api/examples/fileTemplatePatchResponse.json b/public/api/examples/fileTemplatePatchResponse.json index f27d5d3117..c1d21ce9ab 100644 --- a/public/api/examples/fileTemplatePatchResponse.json +++ b/public/api/examples/fileTemplatePatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "41", + "id": "57", "type": "file_templates", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "278", + "id": "1022253159", "type": "projects" }, "access": "edit" @@ -30,32 +30,32 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/file_templates/41?version=1", + "url": "http://localhost:3000/file_templates/57?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-07-22T12:42:27.000Z", - "updated_at": "2022-07-22T12:42:27.000Z", + "created_at": "2024-06-20T12:40:27.000Z", + "updated_at": "2024-06-20T12:40:27.000Z", "doi": null, "content_blobs": [ { - "original_filename": "file-28", + "original_filename": "file-368", "url": null, - "md5sum": "b2379ac13d99328ff8aa2f2f2c1ffa34", - "sha1sum": "d62c0071c03bbf35eba082bdd2f468fb16868475", + "md5sum": "e0c27fbf19a1ba9e8a59da2f80c87669", + "sha1sum": "286c276b6576eb983f1e142146e9bfd550790094", "content_type": "application/pdf", - "link": "http://localhost:3000/file_templates/41/content_blobs/126", - "size": 9 + "link": "http://localhost:3000/file_templates/57/content_blobs/1050453383", + "size": 10 } ], "creators": [ { - "profile": "/people/333", + "profile": "/people/1039989032", "family_name": "Last", - "given_name": "Person269", - "affiliation": "An Institution: 333", + "given_name": "Person3762", + "affiliation": "An Institution: 4688", "orcid": null } ], @@ -77,7 +77,7 @@ "creators": { "data": [ { - "id": "333", + "id": "1039989032", "type": "people" } ] @@ -85,7 +85,7 @@ "submitter": { "data": [ { - "id": "332", + "id": "1039989031", "type": "people" } ] @@ -93,11 +93,11 @@ "people": { "data": [ { - "id": "332", + "id": "1039989031", "type": "people" }, { - "id": "333", + "id": "1039989032", "type": "people" } ] @@ -105,7 +105,7 @@ "projects": { "data": [ { - "id": "278", + "id": "1022253159", "type": "projects" } ] @@ -122,14 +122,14 @@ } }, "links": { - "self": "/file_templates/41?version=1" + "self": "/file_templates/57?version=1" }, "meta": { - "created": "2022-07-22T12:42:27.000Z", - "modified": "2022-07-22T12:42:27.000Z", + "created": "2024-06-20T12:40:27.000Z", + "modified": "2024-06-20T12:40:27.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "ab016810-ebe9-013a-1162-0a81884ed284" + "uuid": "32287d20-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/fileTemplatePost.json b/public/api/examples/fileTemplatePost.json index c3e1a403bb..ebc5b3034f 100644 --- a/public/api/examples/fileTemplatePost.json +++ b/public/api/examples/fileTemplatePost.json @@ -33,7 +33,7 @@ "permissions": [ { "resource": { - "id": "256", + "id": "1022253137", "type": "projects" }, "access": "edit" @@ -45,7 +45,7 @@ "creators": { "data": [ { - "id": "311", + "id": "1039989010", "type": "people" } ] @@ -53,7 +53,7 @@ "projects": { "data": [ { - "id": "256", + "id": "1022253137", "type": "projects" } ] diff --git a/public/api/examples/fileTemplatePostResponse.json b/public/api/examples/fileTemplatePostResponse.json index 62fa8deab1..8e870c9c47 100644 --- a/public/api/examples/fileTemplatePostResponse.json +++ b/public/api/examples/fileTemplatePostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "35", + "id": "51", "type": "file_templates", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "256", + "id": "1022253137", "type": "projects" }, "access": "edit" @@ -30,14 +30,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/file_templates/35?version=1", + "url": "http://localhost:3000/file_templates/51?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-07-22T12:42:24.000Z", - "updated_at": "2022-07-22T12:42:24.000Z", + "created_at": "2024-06-20T12:40:25.000Z", + "updated_at": "2024-06-20T12:40:25.000Z", "doi": null, "content_blobs": [ { @@ -46,16 +46,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/pdf", - "link": "http://localhost:3000/file_templates/35/content_blobs/118", + "link": "http://localhost:3000/file_templates/51/content_blobs/1050453377", "size": null } ], "creators": [ { - "profile": "/people/311", + "profile": "/people/1039989010", "family_name": "Last", - "given_name": "Person252", - "affiliation": "An Institution: 311", + "given_name": "Person3745", + "affiliation": "An Institution: 4666", "orcid": null } ], @@ -77,7 +77,7 @@ "creators": { "data": [ { - "id": "311", + "id": "1039989010", "type": "people" } ] @@ -85,7 +85,7 @@ "submitter": { "data": [ { - "id": "310", + "id": "1039989009", "type": "people" } ] @@ -93,11 +93,11 @@ "people": { "data": [ { - "id": "310", + "id": "1039989009", "type": "people" }, { - "id": "311", + "id": "1039989010", "type": "people" } ] @@ -105,7 +105,7 @@ "projects": { "data": [ { - "id": "256", + "id": "1022253137", "type": "projects" } ] @@ -122,14 +122,14 @@ } }, "links": { - "self": "/file_templates/35?version=1" + "self": "/file_templates/51?version=1" }, "meta": { - "created": "2022-07-22T12:42:24.000Z", - "modified": "2022-07-22T12:42:24.000Z", + "created": "2024-06-20T12:40:25.000Z", + "modified": "2024-06-20T12:40:25.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "a9467070-ebe9-013a-1162-0a81884ed284" + "uuid": "30c2bc40-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/fileTemplateResponse.json b/public/api/examples/fileTemplateResponse.json index 1bf2bbb14e..b0912aa831 100644 --- a/public/api/examples/fileTemplateResponse.json +++ b/public/api/examples/fileTemplateResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "40", + "id": "56", "type": "file_templates", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "8", + "id": "268", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/file_templates/40?version=1", + "url": "http://localhost:3000/file_templates/56?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-07-22T12:42:27.000Z", - "updated_at": "2022-07-22T12:42:27.000Z", + "created_at": "2024-06-20T12:40:27.000Z", + "updated_at": "2024-06-20T12:40:27.000Z", "doi": null, "content_blobs": [ { @@ -47,13 +47,13 @@ "md5sum": "726de0a3f94d65056b909b9736e10349", "sha1sum": "fbcc0dee4b5415de4c82ef5b137d8231fec1331b", "content_type": "application/pdf", - "link": "http://localhost:3000/file_templates/40/content_blobs/125", + "link": "http://localhost:3000/file_templates/56/content_blobs/1050453382", "size": 8 } ], "creators": [ { - "profile": "/people/329", + "profile": "/people/1039989028", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -78,7 +78,7 @@ "creators": { "data": [ { - "id": "329", + "id": "1039989028", "type": "people" } ] @@ -86,7 +86,7 @@ "submitter": { "data": [ { - "id": "330", + "id": "1039989029", "type": "people" } ] @@ -94,11 +94,11 @@ "people": { "data": [ { - "id": "329", + "id": "1039989028", "type": "people" }, { - "id": "330", + "id": "1039989029", "type": "people" } ] @@ -106,7 +106,7 @@ "projects": { "data": [ { - "id": "276", + "id": "1022253157", "type": "projects" } ] @@ -123,14 +123,14 @@ } }, "links": { - "self": "/file_templates/40?version=1" + "self": "/file_templates/56?version=1" }, "meta": { - "created": "2022-07-22T12:42:27.000Z", - "modified": "2022-07-22T12:42:27.000Z", + "created": "2024-06-20T12:40:27.000Z", + "modified": "2024-06-20T12:40:27.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "aab736b0-ebe9-013a-1162-0a81884ed284" + "uuid": "31eb13a0-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/fileTemplatesResponse.json b/public/api/examples/fileTemplatesResponse.json index 953e0201be..cb93857e76 100644 --- a/public/api/examples/fileTemplatesResponse.json +++ b/public/api/examples/fileTemplatesResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "38", + "id": "54", "type": "file_templates", "attributes": { "title": "A Maximal FileTemplate" }, "links": { - "self": "/file_templates/38" + "self": "/file_templates/54" } }, { - "id": "37", + "id": "53", "type": "file_templates", "attributes": { "title": "A Minimal FileTemplate" }, "links": { - "self": "/file_templates/37" + "self": "/file_templates/53" } } ], diff --git a/public/api/examples/humanDiseaseResponse.json b/public/api/examples/humanDiseaseResponse.json index 17e8afbda8..b8edb9610d 100644 --- a/public/api/examples/humanDiseaseResponse.json +++ b/public/api/examples/humanDiseaseResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "3", + "id": "647916208", "type": "human_diseases", "attributes": { "title": "A Maximal Human Disease", @@ -11,7 +11,7 @@ "projects": { "data": [ { - "id": "934", + "id": "1022252597", "type": "projects" } ] @@ -19,7 +19,7 @@ "assays": { "data": [ { - "id": "127", + "id": "1035386884", "type": "assays" } ] @@ -27,7 +27,7 @@ "models": { "data": [ { - "id": "137", + "id": "1004285591", "type": "models" } ] @@ -44,14 +44,14 @@ } }, "links": { - "self": "/human_diseases/3" + "self": "/human_diseases/647916208" }, "meta": { - "created": "2022-06-07T14:14:35.000Z", - "modified": "2022-06-07T14:14:35.000Z", + "created": "2024-06-20T12:39:06.000Z", + "modified": "2024-06-20T12:39:06.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "15063e40-c89a-013a-0f7e-0a81884ed284" + "uuid": "01c01bc0-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/institutionPatch.json b/public/api/examples/institutionPatch.json index 378edaad18..86385c924f 100644 --- a/public/api/examples/institutionPatch.json +++ b/public/api/examples/institutionPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "institutions", - "id": "641", + "id": "980191687", "attributes": { "title": "Patched institution", "web_page": "http://my.institution.com", diff --git a/public/api/examples/institutionPatchResponse.json b/public/api/examples/institutionPatchResponse.json index 78d95847d6..e77d7b9029 100644 --- a/public/api/examples/institutionPatchResponse.json +++ b/public/api/examples/institutionPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "641", + "id": "980191687", "type": "institutions", "attributes": { "discussion_links": [ @@ -27,14 +27,14 @@ } }, "links": { - "self": "/institutions/641" + "self": "/institutions/980191687" }, "meta": { - "created": "2022-06-07T14:14:01.000Z", - "modified": "2022-06-07T14:14:01.000Z", + "created": "2024-06-20T12:35:59.000Z", + "modified": "2024-06-20T12:35:59.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "00e18f40-c89a-013a-0f7e-0a81884ed284" + "uuid": "92430100-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/institutionPost.json b/public/api/examples/institutionPost.json index f4974285b1..1bb0ab2b36 100644 --- a/public/api/examples/institutionPost.json +++ b/public/api/examples/institutionPost.json @@ -2,7 +2,7 @@ "data": { "type": "institutions", "attributes": { - "title": "Post Institution 627 Max", + "title": "Post Institution 980191673 Max", "country": "United Kingdom", "city": "Manchester", "address": "Manchester Centre for Integrative Systems Biology, MIB/CEAS, The University of Manchester Faraday Building, Sackville Street, Manchester M60 1QD United Kingdom", diff --git a/public/api/examples/institutionPostResponse.json b/public/api/examples/institutionPostResponse.json index 271f621a54..8b71ab51a8 100644 --- a/public/api/examples/institutionPostResponse.json +++ b/public/api/examples/institutionPostResponse.json @@ -1,13 +1,13 @@ { "data": { - "id": "627", + "id": "980191673", "type": "institutions", "attributes": { "discussion_links": [ ], "avatar": null, - "title": "Post Institution 627 Max", + "title": "Post Institution 980191673 Max", "country": "United Kingdom", "country_code": "GB", "city": "Manchester", @@ -27,14 +27,14 @@ } }, "links": { - "self": "/institutions/627" + "self": "/institutions/980191673" }, "meta": { - "created": "2022-06-07T14:14:00.000Z", - "modified": "2022-06-07T14:14:00.000Z", + "created": "2024-06-20T12:35:58.000Z", + "modified": "2024-06-20T12:35:58.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "0054b090-c89a-013a-0f7e-0a81884ed284" + "uuid": "91ca2e80-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/institutionResponse.json b/public/api/examples/institutionResponse.json index 5c2563cfba..9394a7d6b7 100644 --- a/public/api/examples/institutionResponse.json +++ b/public/api/examples/institutionResponse.json @@ -1,11 +1,11 @@ { "data": { - "id": "638", + "id": "980191684", "type": "institutions", "attributes": { "discussion_links": [ { - "id": "56", + "id": "183", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,14 +31,14 @@ } }, "links": { - "self": "/institutions/638" + "self": "/institutions/980191684" }, "meta": { - "created": "2022-06-07T14:14:01.000Z", - "modified": "2022-06-07T14:14:01.000Z", + "created": "2024-06-20T12:35:59.000Z", + "modified": "2024-06-20T12:35:59.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "00bfa1b0-c89a-013a-0f7e-0a81884ed284" + "uuid": "9223aad0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/institutionsResponse.json b/public/api/examples/institutionsResponse.json index 8296ec2b28..bc3425e39d 100644 --- a/public/api/examples/institutionsResponse.json +++ b/public/api/examples/institutionsResponse.json @@ -1,33 +1,33 @@ { "data": [ { - "id": "633", + "id": "980191679", "type": "institutions", "attributes": { "title": "A Maximal Institution" }, "links": { - "self": "/institutions/633" + "self": "/institutions/980191679" } }, { - "id": "631", + "id": "980191677", "type": "institutions", "attributes": { "title": "A Minimal Institution" }, "links": { - "self": "/institutions/631" + "self": "/institutions/980191677" } }, { - "id": "632", + "id": "980191678", "type": "institutions", "attributes": { - "title": "An Institution: 630" + "title": "An Institution: 2812" }, "links": { - "self": "/institutions/632" + "self": "/institutions/980191678" } } ], diff --git a/public/api/examples/investigationPatch.json b/public/api/examples/investigationPatch.json index f234da50c4..9d40ca7494 100644 --- a/public/api/examples/investigationPatch.json +++ b/public/api/examples/investigationPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "investigations", - "id": "127", + "id": "425", "attributes": { "title": "A Maximal Investigation", "policy": { @@ -10,14 +10,14 @@ { "resource": { "type": "projects", - "id": "644" + "id": "2199" }, "access": "manage" }, { "resource": { "type": "projects", - "id": "675" + "id": "2234" }, "access": "manage" } @@ -31,18 +31,18 @@ "data": [ { "type": "projects", - "id": "644" + "id": "2199" }, { "type": "projects", - "id": "675" + "id": "2234" } ] }, "publications": { "data": [ { - "id": "54", + "id": "126", "type": "publications" } ] @@ -50,7 +50,7 @@ "creators": { "data": [ { - "id": "588", + "id": "1908", "type": "people" } ] diff --git a/public/api/examples/investigationPatchResponse.json b/public/api/examples/investigationPatchResponse.json index 15d6ea649a..0b59d5ced4 100644 --- a/public/api/examples/investigationPatchResponse.json +++ b/public/api/examples/investigationPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "127", + "id": "425", "type": "investigations", "attributes": { "policy": { @@ -8,14 +8,14 @@ "permissions": [ { "resource": { - "id": "644", + "id": "2199", "type": "projects" }, "access": "manage" }, { "resource": { - "id": "675", + "id": "2234", "type": "projects" }, "access": "manage" @@ -34,10 +34,10 @@ "position": null, "creators": [ { - "profile": "/people/588", + "profile": "/people/1908", "family_name": "Last", - "given_name": "Person493", - "affiliation": "An Institution: 593, An Institution: 622", + "given_name": "Person1608", + "affiliation": "An Institution: 1959, An Institution: 1992", "orcid": null } ] @@ -46,7 +46,7 @@ "creators": { "data": [ { - "id": "588", + "id": "1908", "type": "people" } ] @@ -54,7 +54,7 @@ "submitter": { "data": [ { - "id": "588", + "id": "1908", "type": "people" } ] @@ -62,7 +62,7 @@ "people": { "data": [ { - "id": "588", + "id": "1908", "type": "people" } ] @@ -70,11 +70,11 @@ "projects": { "data": [ { - "id": "644", + "id": "2199", "type": "projects" }, { - "id": "675", + "id": "2234", "type": "projects" } ] @@ -107,7 +107,7 @@ "publications": { "data": [ { - "id": "54", + "id": "126", "type": "publications" } ] @@ -119,14 +119,14 @@ } }, "links": { - "self": "/investigations/127" + "self": "/investigations/425" }, "meta": { - "created": "2022-06-07T14:14:00.000Z", - "modified": "2022-06-07T14:14:00.000Z", + "created": "2024-06-20T12:33:50.000Z", + "modified": "2024-06-20T12:33:50.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "0018a560-c89a-013a-0f7e-0a81884ed284" + "uuid": "451e5cd0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/investigationPost.json b/public/api/examples/investigationPost.json index c124709c9f..c0e0ba8e5d 100644 --- a/public/api/examples/investigationPost.json +++ b/public/api/examples/investigationPost.json @@ -9,14 +9,14 @@ { "resource": { "type": "projects", - "id": "499" + "id": "2036" }, "access": "manage" }, { "resource": { "type": "projects", - "id": "530" + "id": "2071" }, "access": "manage" } @@ -30,18 +30,18 @@ "data": [ { "type": "projects", - "id": "499" + "id": "2036" }, { "type": "projects", - "id": "530" + "id": "2071" } ] }, "publications": { "data": [ { - "id": "43", + "id": "115", "type": "publications" } ] @@ -49,7 +49,7 @@ "creators": { "data": [ { - "id": "460", + "id": "1762", "type": "people" } ] diff --git a/public/api/examples/investigationPostResponse.json b/public/api/examples/investigationPostResponse.json index e417d1a514..fd6adc7dc4 100644 --- a/public/api/examples/investigationPostResponse.json +++ b/public/api/examples/investigationPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "88", + "id": "381", "type": "investigations", "attributes": { "policy": { @@ -8,14 +8,14 @@ "permissions": [ { "resource": { - "id": "499", + "id": "2036", "type": "projects" }, "access": "manage" }, { "resource": { - "id": "530", + "id": "2071", "type": "projects" }, "access": "manage" @@ -34,10 +34,10 @@ "position": null, "creators": [ { - "profile": "/people/460", + "profile": "/people/1762", "family_name": "Last", - "given_name": "Person383", - "affiliation": "An Institution: 462, An Institution: 491", + "given_name": "Person1480", + "affiliation": "An Institution: 1810, An Institution: 1843", "orcid": null } ] @@ -46,7 +46,7 @@ "creators": { "data": [ { - "id": "460", + "id": "1762", "type": "people" } ] @@ -54,7 +54,7 @@ "submitter": { "data": [ { - "id": "460", + "id": "1762", "type": "people" } ] @@ -62,7 +62,7 @@ "people": { "data": [ { - "id": "460", + "id": "1762", "type": "people" } ] @@ -70,11 +70,11 @@ "projects": { "data": [ { - "id": "499", + "id": "2036", "type": "projects" }, { - "id": "530", + "id": "2071", "type": "projects" } ] @@ -107,7 +107,7 @@ "publications": { "data": [ { - "id": "43", + "id": "115", "type": "publications" } ] @@ -119,14 +119,14 @@ } }, "links": { - "self": "/investigations/88" + "self": "/investigations/381" }, "meta": { - "created": "2022-06-07T14:13:39.000Z", - "modified": "2022-06-07T14:13:39.000Z", + "created": "2024-06-20T12:33:29.000Z", + "modified": "2024-06-20T12:33:29.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "f3edefa0-c899-013a-0f7e-0a81884ed284" + "uuid": "3924d830-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/investigationResponse.json b/public/api/examples/investigationResponse.json index 5aa69d899a..5d70dda339 100644 --- a/public/api/examples/investigationResponse.json +++ b/public/api/examples/investigationResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "119", + "id": "416", "type": "investigations", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "50", + "id": "156", "label": "Slack", "url": "http://www.slack.com/" } @@ -25,7 +25,7 @@ "position": null, "creators": [ { - "profile": "/people/571", + "profile": "/people/1888", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -37,7 +37,7 @@ "creators": { "data": [ { - "id": "571", + "id": "1888", "type": "people" } ] @@ -45,7 +45,7 @@ "submitter": { "data": [ { - "id": "572", + "id": "1889", "type": "people" } ] @@ -53,11 +53,11 @@ "people": { "data": [ { - "id": "571", + "id": "1888", "type": "people" }, { - "id": "572", + "id": "1889", "type": "people" } ] @@ -65,7 +65,7 @@ "projects": { "data": [ { - "id": "626", + "id": "2178", "type": "projects" } ] @@ -73,7 +73,7 @@ "studies": { "data": [ { - "id": "105", + "id": "346", "type": "studies" } ] @@ -81,7 +81,7 @@ "assays": { "data": [ { - "id": "93", + "id": "286", "type": "assays" } ] @@ -89,7 +89,7 @@ "data_files": { "data": [ { - "id": "40", + "id": "111", "type": "data_files" } ] @@ -97,7 +97,7 @@ "models": { "data": [ { - "id": "92", + "id": "127", "type": "models" } ] @@ -105,7 +105,7 @@ "sops": { "data": [ { - "id": "38", + "id": "133", "type": "sops" } ] @@ -113,7 +113,7 @@ "publications": { "data": [ { - "id": "51", + "id": "123", "type": "publications" } ] @@ -121,21 +121,21 @@ "documents": { "data": [ { - "id": "48", + "id": "156", "type": "documents" } ] } }, "links": { - "self": "/investigations/119" + "self": "/investigations/416" }, "meta": { - "created": "2022-06-07T14:13:55.000Z", - "modified": "2022-06-07T14:13:55.000Z", + "created": "2024-06-20T12:33:45.000Z", + "modified": "2024-06-20T12:33:45.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "fd2c1ed0-c899-013a-0f7e-0a81884ed284" + "uuid": "424a8c50-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/investigationsResponse.json b/public/api/examples/investigationsResponse.json index 0ad32b0614..b8711dda12 100644 --- a/public/api/examples/investigationsResponse.json +++ b/public/api/examples/investigationsResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "103", + "id": "398", "type": "investigations", "attributes": { - "title": "Investigation85" + "title": "Investigation320" }, "links": { - "self": "/investigations/103" + "self": "/investigations/398" } }, { - "id": "98", + "id": "392", "type": "investigations", "attributes": { "title": "A Minimal Investigation" }, "links": { - "self": "/investigations/98" + "self": "/investigations/392" } } ], diff --git a/public/api/examples/modelPatch.json b/public/api/examples/modelPatch.json index 2a442b440b..34c88bf590 100644 --- a/public/api/examples/modelPatch.json +++ b/public/api/examples/modelPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "models", - "id": "153", + "id": "1004285585", "attributes": { "title": "A Maximally Patched Model", "description": "A simulation of a thing", @@ -17,7 +17,7 @@ "permissions": [ { "resource": { - "id": "995", + "id": "1022251932", "type": "projects" }, "access": "edit" @@ -29,7 +29,7 @@ "environment": "JWS Online", "discussion_links": [ { - "id": "81", + "id": "239", "url": "http://yahoo.com", "label": "Yahoo" }, @@ -43,7 +43,7 @@ "creators": { "data": [ { - "id": "916", + "id": "1039987854", "type": "people" } ] @@ -51,7 +51,7 @@ "organisms": { "data": [ { - "id": "35", + "id": "627234331", "type": "organisms" } ] @@ -59,7 +59,7 @@ "projects": { "data": [ { - "id": "995", + "id": "1022251932", "type": "projects" } ] @@ -67,7 +67,7 @@ "assays": { "data": [ { - "id": "139", + "id": "1035386814", "type": "assays" } ] @@ -75,7 +75,7 @@ "publications": { "data": [ { - "id": "83", + "id": "299", "type": "publications" } ] diff --git a/public/api/examples/modelPatchResponse.json b/public/api/examples/modelPatchResponse.json index b3d330fc93..dcf1821a35 100644 --- a/public/api/examples/modelPatchResponse.json +++ b/public/api/examples/modelPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "153", + "id": "1004285585", "type": "models", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "995", + "id": "1022251932", "type": "projects" }, "access": "edit" @@ -17,12 +17,12 @@ }, "discussion_links": [ { - "id": "81", + "id": "239", "label": "Yahoo", "url": "http://yahoo.com" }, { - "id": "82", + "id": "240", "label": "fish", "url": "https://fish.com" } @@ -40,14 +40,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/models/153?version=1", + "url": "http://localhost:3000/models/1004285585?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:14:44.000Z", - "updated_at": "2022-06-07T14:14:44.000Z", + "created_at": "2024-06-20T12:37:45.000Z", + "updated_at": "2024-06-20T12:37:45.000Z", "doi": null, "content_blobs": [ { @@ -56,16 +56,16 @@ "md5sum": "6b9283ed4ca52a081398b715aaeb8113", "sha1sum": "454e4b6067f577b680bb8538772b12ebcdb6c4a4", "content_type": "application/xml", - "link": "http://localhost:3000/models/153/content_blobs/404", + "link": "http://localhost:3000/models/1004285585/content_blobs/1050453030", "size": 5933 } ], "creators": [ { - "profile": "/people/916", + "profile": "/people/1039987854", "family_name": "Last", - "given_name": "Person768", - "affiliation": "An Institution: 930", + "given_name": "Person2807", + "affiliation": "An Institution: 3513", "orcid": null } ], @@ -79,7 +79,7 @@ "creators": { "data": [ { - "id": "916", + "id": "1039987854", "type": "people" } ] @@ -87,7 +87,7 @@ "submitter": { "data": [ { - "id": "915", + "id": "1039987853", "type": "people" } ] @@ -95,7 +95,7 @@ "organisms": { "data": [ { - "id": "35", + "id": "627234331", "type": "organisms" } ] @@ -103,11 +103,11 @@ "people": { "data": [ { - "id": "915", + "id": "1039987853", "type": "people" }, { - "id": "916", + "id": "1039987854", "type": "people" } ] @@ -115,7 +115,7 @@ "projects": { "data": [ { - "id": "995", + "id": "1022251932", "type": "projects" } ] @@ -123,7 +123,7 @@ "investigations": { "data": [ { - "id": "187", + "id": "973655036", "type": "investigations" } ] @@ -131,7 +131,7 @@ "studies": { "data": [ { - "id": "164", + "id": "1060385068", "type": "studies" } ] @@ -139,7 +139,7 @@ "assays": { "data": [ { - "id": "139", + "id": "1035386814", "type": "assays" } ] @@ -147,21 +147,21 @@ "publications": { "data": [ { - "id": "83", + "id": "299", "type": "publications" } ] } }, "links": { - "self": "/models/153?version=1" + "self": "/models/1004285585?version=1" }, "meta": { - "created": "2022-06-07T14:14:44.000Z", - "modified": "2022-06-07T14:14:44.000Z", + "created": "2024-06-20T12:37:45.000Z", + "modified": "2024-06-20T12:37:45.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "1a8db7c0-c89a-013a-0f7e-0a81884ed284" + "uuid": "d14659c0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/modelPost.json b/public/api/examples/modelPost.json index fee183de6e..bbaa72ccd9 100644 --- a/public/api/examples/modelPost.json +++ b/public/api/examples/modelPost.json @@ -25,7 +25,7 @@ "permissions": [ { "resource": { - "id": "961", + "id": "1022251898", "type": "projects" }, "access": "edit" @@ -46,7 +46,7 @@ "creators": { "data": [ { - "id": "881", + "id": "1039987819", "type": "people" } ] @@ -54,7 +54,7 @@ "organisms": { "data": [ { - "id": "30", + "id": "627234326", "type": "organisms" } ] @@ -62,7 +62,7 @@ "projects": { "data": [ { - "id": "961", + "id": "1022251898", "type": "projects" } ] @@ -70,7 +70,7 @@ "assays": { "data": [ { - "id": "134", + "id": "1035386809", "type": "assays" } ] @@ -78,7 +78,7 @@ "publications": { "data": [ { - "id": "78", + "id": "294", "type": "publications" } ] diff --git a/public/api/examples/modelPostResponse.json b/public/api/examples/modelPostResponse.json index 3398b677f1..57f59b757c 100644 --- a/public/api/examples/modelPostResponse.json +++ b/public/api/examples/modelPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "140", + "id": "1004285574", "type": "models", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "961", + "id": "1022251898", "type": "projects" }, "access": "edit" @@ -17,7 +17,7 @@ }, "discussion_links": [ { - "id": "76", + "id": "234", "label": "Google", "url": "http://google.com" } @@ -34,14 +34,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/models/140?version=1", + "url": "http://localhost:3000/models/1004285574?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:14:39.000Z", - "updated_at": "2022-06-07T14:14:39.000Z", + "created_at": "2024-06-20T12:37:40.000Z", + "updated_at": "2024-06-20T12:37:40.000Z", "doi": null, "content_blobs": [ { @@ -50,7 +50,7 @@ "md5sum": null, "sha1sum": null, "content_type": "application/pdf", - "link": "http://localhost:3000/models/140/content_blobs/388", + "link": "http://localhost:3000/models/1004285574/content_blobs/1050453016", "size": null }, { @@ -59,16 +59,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/xml", - "link": "http://localhost:3000/models/140/content_blobs/389", + "link": "http://localhost:3000/models/1004285574/content_blobs/1050453017", "size": null } ], "creators": [ { - "profile": "/people/881", + "profile": "/people/1039987819", "family_name": "Last", - "given_name": "Person738", - "affiliation": "An Institution: 895", + "given_name": "Person2777", + "affiliation": "An Institution: 3478", "orcid": null } ], @@ -82,7 +82,7 @@ "creators": { "data": [ { - "id": "881", + "id": "1039987819", "type": "people" } ] @@ -90,7 +90,7 @@ "submitter": { "data": [ { - "id": "880", + "id": "1039987818", "type": "people" } ] @@ -98,7 +98,7 @@ "organisms": { "data": [ { - "id": "30", + "id": "627234326", "type": "organisms" } ] @@ -106,11 +106,11 @@ "people": { "data": [ { - "id": "880", + "id": "1039987818", "type": "people" }, { - "id": "881", + "id": "1039987819", "type": "people" } ] @@ -118,7 +118,7 @@ "projects": { "data": [ { - "id": "961", + "id": "1022251898", "type": "projects" } ] @@ -126,7 +126,7 @@ "investigations": { "data": [ { - "id": "182", + "id": "973655031", "type": "investigations" } ] @@ -134,7 +134,7 @@ "studies": { "data": [ { - "id": "159", + "id": "1060385063", "type": "studies" } ] @@ -142,7 +142,7 @@ "assays": { "data": [ { - "id": "134", + "id": "1035386809", "type": "assays" } ] @@ -150,21 +150,21 @@ "publications": { "data": [ { - "id": "78", + "id": "294", "type": "publications" } ] } }, "links": { - "self": "/models/140?version=1" + "self": "/models/1004285574?version=1" }, "meta": { - "created": "2022-06-07T14:14:39.000Z", - "modified": "2022-06-07T14:14:39.000Z", + "created": "2024-06-20T12:37:40.000Z", + "modified": "2024-06-20T12:37:40.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "17884fa0-c89a-013a-0f7e-0a81884ed284" + "uuid": "ceb6d280-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/modelResponse.json b/public/api/examples/modelResponse.json index df8da90ab5..9d73a189fc 100644 --- a/public/api/examples/modelResponse.json +++ b/public/api/examples/modelResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "151", + "id": "1004285583", "type": "models", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "80", + "id": "238", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/models/151?version=1", + "url": "http://localhost:3000/models/1004285583?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:14:43.000Z", - "updated_at": "2022-06-07T14:14:43.000Z", + "created_at": "2024-06-20T12:37:44.000Z", + "updated_at": "2024-06-20T12:37:44.000Z", "doi": null, "content_blobs": [ { @@ -47,7 +47,7 @@ "md5sum": "6b9283ed4ca52a081398b715aaeb8113", "sha1sum": "454e4b6067f577b680bb8538772b12ebcdb6c4a4", "content_type": "application/xml", - "link": "http://localhost:3000/models/151/content_blobs/401", + "link": "http://localhost:3000/models/1004285583/content_blobs/1050453027", "size": 5933 }, { @@ -56,13 +56,13 @@ "md5sum": "01788bca93265d80e8127ca0039bb69b", "sha1sum": "ffd634ac7564083ab7b66bc3eb2053cbc3d608f5", "content_type": "application/vnd.ms-excel", - "link": "http://localhost:3000/models/151/content_blobs/402", + "link": "http://localhost:3000/models/1004285583/content_blobs/1050453028", "size": 9216 } ], "creators": [ { - "profile": "/people/912", + "profile": "/people/1039987850", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -79,7 +79,7 @@ "creators": { "data": [ { - "id": "912", + "id": "1039987850", "type": "people" } ] @@ -87,7 +87,7 @@ "submitter": { "data": [ { - "id": "913", + "id": "1039987851", "type": "people" } ] @@ -95,7 +95,7 @@ "organisms": { "data": [ { - "id": "34", + "id": "627234330", "type": "organisms" } ] @@ -103,11 +103,11 @@ "people": { "data": [ { - "id": "912", + "id": "1039987850", "type": "people" }, { - "id": "913", + "id": "1039987851", "type": "people" } ] @@ -115,7 +115,7 @@ "projects": { "data": [ { - "id": "993", + "id": "1022251930", "type": "projects" } ] @@ -123,7 +123,7 @@ "investigations": { "data": [ { - "id": "186", + "id": "973655035", "type": "investigations" } ] @@ -131,7 +131,7 @@ "studies": { "data": [ { - "id": "163", + "id": "1060385067", "type": "studies" } ] @@ -139,7 +139,7 @@ "assays": { "data": [ { - "id": "138", + "id": "1035386813", "type": "assays" } ] @@ -147,21 +147,21 @@ "publications": { "data": [ { - "id": "82", + "id": "298", "type": "publications" } ] } }, "links": { - "self": "/models/151?version=1" + "self": "/models/1004285583?version=1" }, "meta": { - "created": "2022-06-07T14:14:43.000Z", - "modified": "2022-06-07T14:14:43.000Z", + "created": "2024-06-20T12:37:44.000Z", + "modified": "2024-06-20T12:37:44.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "19ebefa0-c89a-013a-0f7e-0a81884ed284" + "uuid": "d0b92970-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/organismResponse.json b/public/api/examples/organismResponse.json index 2c3253ca4a..8ce9321ad2 100644 --- a/public/api/examples/organismResponse.json +++ b/public/api/examples/organismResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "5", + "id": "627234345", "type": "organisms", "attributes": { "title": "A Maximal Organism", @@ -11,7 +11,7 @@ "projects": { "data": [ { - "id": "108", + "id": "1022252761", "type": "projects" } ] @@ -19,7 +19,7 @@ "assays": { "data": [ { - "id": "10", + "id": "1035386919", "type": "assays" } ] @@ -27,21 +27,21 @@ "models": { "data": [ { - "id": "8", + "id": "1004285599", "type": "models" } ] } }, "links": { - "self": "/organisms/5" + "self": "/organisms/627234345" }, "meta": { - "created": "2022-06-07T14:12:34.000Z", - "modified": "2022-06-07T14:12:34.000Z", + "created": "2024-06-20T12:39:29.000Z", + "modified": "2024-06-20T12:39:29.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "cd394ea0-c899-013a-0f7e-0a81884ed284" + "uuid": "0fbc5e60-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/organismsResponse.json b/public/api/examples/organismsResponse.json index 501f4f70a7..009b4211c5 100644 --- a/public/api/examples/organismsResponse.json +++ b/public/api/examples/organismsResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "3", + "id": "627234343", "type": "organisms", "attributes": { "title": "A Maximal Organism" }, "links": { - "self": "/organisms/3" + "self": "/organisms/627234343" } }, { - "id": "2", + "id": "627234342", "type": "organisms", "attributes": { "title": "A Minimal Organism" }, "links": { - "self": "/organisms/2" + "self": "/organisms/627234342" } } ], diff --git a/public/api/examples/peopleResponse.json b/public/api/examples/peopleResponse.json index 1b86b76561..55b3d060ef 100644 --- a/public/api/examples/peopleResponse.json +++ b/public/api/examples/peopleResponse.json @@ -1,63 +1,413 @@ { "data": [ { - "id": "105", + "id": "940849572", + "type": "people", + "attributes": { + "title": "Fred Aardvark" + }, + "links": { + "self": "/people/940849572" + } + }, + { + "id": "943873801", + "type": "people", + "attributes": { + "title": "Fred Azbo" + }, + "links": { + "self": "/people/943873801" + } + }, + { + "id": "913531622", + "type": "people", + "attributes": { + "title": "Fred David Bloggs" + }, + "links": { + "self": "/people/913531622" + } + }, + { + "id": "975827294", + "type": "people", + "attributes": { + "title": "Fred Blogs" + }, + "links": { + "self": "/people/975827294" + } + }, + { + "id": "643213978", + "type": "people", + "attributes": { + "title": "Johan Bollen" + }, + "links": { + "self": "/people/643213978" + } + }, + { + "id": "241477277", + "type": "people", + "attributes": { + "title": "Spam Bot" + }, + "links": { + "self": "/people/241477277" + } + }, + { + "id": "982117865", + "type": "people", + "attributes": { + "title": "OwnerOf DownloadForAllSysmoUsersPolicy" + }, + "links": { + "self": "/people/982117865" + } + }, + { + "id": "128215185", + "type": "people", + "attributes": { + "title": "I Am a Duplicate" + }, + "links": { + "self": "/people/128215185" + } + }, + { + "id": "514668853", + "type": "people", + "attributes": { + "title": "I Am a Duplicate" + }, + "links": { + "self": "/people/514668853" + } + }, + { + "id": "730501549", + "type": "people", + "attributes": { + "title": "OwnerOf EditingForAllSysMOUsersPolicy" + }, + "links": { + "self": "/people/730501549" + } + }, + { + "id": "601503375", + "type": "people", + "attributes": { + "title": "OwnerOf FullyPublicPolicy" + }, + "links": { + "self": "/people/601503375" + } + }, + { + "id": "198969080", + "type": "people", + "attributes": { + "title": "Alice Graeter" + }, + "links": { + "self": "/people/198969080" + } + }, + { + "id": "275726558", + "type": "people", + "attributes": { + "title": "SysMO-User InAllowlistAndDenylist" + }, + "links": { + "self": "/people/275726558" + } + }, + { + "id": "420064676", + "type": "people", + "attributes": { + "title": "SysMO-User InDenylist" + }, + "links": { + "self": "/people/420064676" + } + }, + { + "id": "701696858", + "type": "people", + "attributes": { + "title": "Quentin Jones" + }, + "links": { + "self": "/people/701696858" + } + }, + { + "id": "1039988351", "type": "people", "attributes": { "title": "default admin Last" }, "links": { - "self": "/people/105" + "self": "/people/1039988351" + } + }, + { + "id": "1039988352", + "type": "people", + "attributes": { + "title": "Person3241 Last" + }, + "links": { + "self": "/people/1039988352" } }, { - "id": "106", + "id": "1039988353", "type": "people", "attributes": { - "title": "Person85 Last" + "title": "Person3242 Last" }, "links": { - "self": "/people/106" + "self": "/people/1039988353" } }, { - "id": "107", + "id": "1039988355", "type": "people", "attributes": { - "title": "Person86 Last" + "title": "Person3243 Last" }, "links": { - "self": "/people/107" + "self": "/people/1039988355" } }, { - "id": "109", + "id": "12247987", "type": "people", "attributes": { - "title": "Person87 Last" + "title": "Lastname" }, "links": { - "self": "/people/109" + "self": "/people/12247987" } }, { - "id": "110", + "id": "1039988356", "type": "people", "attributes": { "title": "Maximilian Maxi-Mum" }, "links": { - "self": "/people/110" + "self": "/people/1039988356" } }, { - "id": "108", + "id": "1039988354", "type": "people", "attributes": { "title": "Minimal" }, "links": { - "self": "/people/108" + "self": "/people/1039988354" + } + }, + { + "id": "773249994", + "type": "people", + "attributes": { + "title": "Bob Müller" + }, + "links": { + "self": "/people/773249994" + } + }, + { + "id": "194977880", + "type": "people", + "attributes": { + "title": "OwnerOf MyFirstSop" + }, + "links": { + "self": "/people/194977880" + } + }, + { + "id": "523838188", + "type": "people", + "attributes": { + "title": "TestAccessor OnlyInAllowlist" + }, + "links": { + "self": "/people/523838188" + } + }, + { + "id": "1010894610", + "type": "people", + "attributes": { + "title": "TestAccessor OnlyInDenylist" + }, + "links": { + "self": "/people/1010894610" + } + }, + { + "id": "522086294", + "type": "people", + "attributes": { + "title": "Datafile Owner" + }, + "links": { + "self": "/people/522086294" + } + }, + { + "id": "574165609", + "type": "people", + "attributes": { + "title": "Model Owner" + }, + "links": { + "self": "/people/574165609" + } + }, + { + "id": "1038269682", + "type": "people", + "attributes": { + "title": "Random Person" + }, + "links": { + "self": "/people/1038269682" + } + }, + { + "id": "249179401", + "type": "people", + "attributes": { + "title": "Person Place_holder" + }, + "links": { + "self": "/people/249179401" + } + }, + { + "id": "921288942", + "type": "people", + "attributes": { + "title": "OwnerOf PrivatePolicyUsingCustomSharing" + }, + "links": { + "self": "/people/921288942" + } + }, + { + "id": "113629430", + "type": "people", + "attributes": { + "title": "No_user Smith" + }, + "links": { + "self": "/people/113629430" + } + }, + { + "id": "847710731", + "type": "people", + "attributes": { + "title": "Fred Smith Jones" + }, + "links": { + "self": "/people/847710731" + } + }, + { + "id": "262742470", + "type": "people", + "attributes": { + "title": "Fred Smith-Jones" + }, + "links": { + "self": "/people/262742470" + } + }, + { + "id": "1039986468", + "type": "people", + "attributes": { + "title": "Aaron Spiggle" + }, + "links": { + "self": "/people/1039986468" + } + }, + { + "id": "408848532", + "type": "people", + "attributes": { + "title": "Free Spirit" + }, + "links": { + "self": "/people/408848532" + } + }, + { + "id": "382405343", + "type": "people", + "attributes": { + "title": "Registered-User WantsToAccessManyThingsAndHasSomePermissions" + }, + "links": { + "self": "/people/382405343" + } + }, + { + "id": "528771254", + "type": "people", + "attributes": { + "title": "Firstname" + }, + "links": { + "self": "/people/528771254" + } + }, + { + "id": "272240831", + "type": "people", + "attributes": { + "title": "Lonely" + }, + "links": { + "self": "/people/272240831" + } + }, + { + "id": "872873870", + "type": "people", + "attributes": { + "title": "Modeller" + }, + "links": { + "self": "/people/872873870" + } + }, + { + "id": "171291580", + "type": "people", + "attributes": { + "title": "Userless" + }, + "links": { + "self": "/people/171291580" } } ], diff --git a/public/api/examples/personPatch.json b/public/api/examples/personPatch.json index 875fbb4756..ae71c9fc67 100644 --- a/public/api/examples/personPatch.json +++ b/public/api/examples/personPatch.json @@ -1,6 +1,6 @@ { "data": { - "id": "118", + "id": "1039988364", "type": "people", "attributes": { "first_name": "Patched", diff --git a/public/api/examples/personPatchResponse.json b/public/api/examples/personPatchResponse.json index fba5715a9c..e91b734a60 100644 --- a/public/api/examples/personPatchResponse.json +++ b/public/api/examples/personPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "1039992249", + "id": "1039988364", "type": "people", "attributes": { "avatar": null, @@ -19,13 +19,13 @@ "Gromacs", "Python" ], - "login": "user204" + "login": "user3898" }, "relationships": { "projects": { "data": [ { - "id": "1022256840", + "id": "1022252441", "type": "projects" } ] @@ -33,7 +33,7 @@ "institutions": { "data": [ { - "id": "980196784", + "id": "980192886", "type": "institutions" } ] @@ -100,14 +100,14 @@ } }, "links": { - "self": "/people/1039992249" + "self": "/people/1039988364" }, "meta": { - "created": "2022-10-26T11:44:31.000Z", - "modified": "2022-10-26T11:44:31.000Z", + "created": "2024-06-20T12:38:47.000Z", + "modified": "2024-06-20T12:38:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "7acec590-3751-013b-356e-000c29a94011" + "uuid": "f66eeec0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/personPost.json b/public/api/examples/personPost.json index efe5420289..6b0b69f83f 100644 --- a/public/api/examples/personPost.json +++ b/public/api/examples/personPost.json @@ -3,8 +3,8 @@ "type": "people", "attributes": { "first_name": "Post", - "last_name": "Person104", - "email": "maxtest104@test.com", + "last_name": "Person1039988350", + "email": "maxtest1039988350@test.com", "description": "A person with all possible details", "web_page": "http://www.website.com", "orcid": "https://orcid.org/0000-0001-9842-9718", diff --git a/public/api/examples/personPostResponse.json b/public/api/examples/personPostResponse.json index 6909a2a89c..b79574e978 100644 --- a/public/api/examples/personPostResponse.json +++ b/public/api/examples/personPostResponse.json @@ -1,15 +1,15 @@ { "data": { - "id": "1039992235", + "id": "1039988350", "type": "people", "attributes": { "avatar": null, - "title": "Post Person1039992235", + "title": "Post Person1039988350", "description": "A person with all possible details", "first_name": "Post", - "last_name": "Person1039992235", + "last_name": "Person1039988350", "orcid": "https://orcid.org/0000-0001-9842-9718", - "mbox_sha1sum": "f1294d2fd50702dcee3a9686b360667d32eca0ad", + "mbox_sha1sum": "75b8b8d23704f980c8dd9a965e036a388033383c", "expertise": [ "modeling", "programming" @@ -94,14 +94,14 @@ } }, "links": { - "self": "/people/1039992235" + "self": "/people/1039988350" }, "meta": { - "created": "2022-10-26T11:44:29.000Z", - "modified": "2022-10-26T11:44:29.000Z", + "created": "2024-06-20T12:38:44.000Z", + "modified": "2024-06-20T12:38:44.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "792fedf0-3751-013b-356e-000c29a94011" + "uuid": "f478fc80-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/personResponse.json b/public/api/examples/personResponse.json index e09a0d8fc3..2cb01bb8e3 100644 --- a/public/api/examples/personResponse.json +++ b/public/api/examples/personResponse.json @@ -1,9 +1,9 @@ { "data": { - "id": "1039992246", + "id": "1039988361", "type": "people", "attributes": { - "avatar": "/people/1039992246/avatars/45", + "avatar": "/people/1039988361/avatars/37", "title": "Maximilian Maxi-Mum", "description": "A person with all possible details", "first_name": "Maximilian", @@ -23,7 +23,7 @@ "projects": { "data": [ { - "id": "1022256835", + "id": "1022252437", "type": "projects" } ] @@ -31,7 +31,7 @@ "institutions": { "data": [ { - "id": "980196780", + "id": "980192883", "type": "institutions" } ] @@ -39,7 +39,7 @@ "investigations": { "data": [ { - "id": "973655440", + "id": "973655106", "type": "investigations" } ] @@ -47,7 +47,7 @@ "studies": { "data": [ { - "id": "1060385452", + "id": "1060385137", "type": "studies" } ] @@ -55,7 +55,7 @@ "assays": { "data": [ { - "id": "1035387171", + "id": "1035386882", "type": "assays" } ] @@ -63,7 +63,7 @@ "data_files": { "data": [ { - "id": "883654679", + "id": "883654361", "type": "data_files" } ] @@ -71,7 +71,7 @@ "models": { "data": [ { - "id": "1004285720", + "id": "1004285589", "type": "models" } ] @@ -79,7 +79,7 @@ "sops": { "data": [ { - "id": "1055250745", + "id": "1055250491", "type": "sops" } ] @@ -87,7 +87,7 @@ "publications": { "data": [ { - "id": "165", + "id": "303", "type": "publications" } ] @@ -95,7 +95,7 @@ "presentations": { "data": [ { - "id": "78", + "id": "118", "type": "presentations" } ] @@ -103,7 +103,7 @@ "events": { "data": [ { - "id": "1025618735", + "id": "1025618752", "type": "events" } ] @@ -111,7 +111,7 @@ "documents": { "data": [ { - "id": "211", + "id": "267", "type": "documents" } ] @@ -119,7 +119,7 @@ "workflows": { "data": [ { - "id": "218", + "id": "183", "type": "workflows" } ] @@ -127,21 +127,21 @@ "collections": { "data": [ { - "id": "29", + "id": "103", "type": "collections" } ] } }, "links": { - "self": "/people/1039992246" + "self": "/people/1039988361" }, "meta": { - "created": "2022-10-26T11:44:30.000Z", - "modified": "2022-10-26T11:44:30.000Z", + "created": "2024-06-20T12:38:46.000Z", + "modified": "2024-06-20T12:38:46.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "7a421450-3751-013b-356e-000c29a94011" + "uuid": "f5c5aed0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/presentationPatch.json b/public/api/examples/presentationPatch.json index de26625606..813c00464d 100644 --- a/public/api/examples/presentationPatch.json +++ b/public/api/examples/presentationPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "presentations", - "id": "12", + "id": "85", "attributes": { "title": "A Maximally Patched Presentation", "description": "Presenting the research about the thing", @@ -17,7 +17,7 @@ "permissions": [ { "resource": { - "id": "289", + "id": "1022250826", "type": "projects" }, "access": "edit" @@ -29,7 +29,7 @@ "creators": { "data": [ { - "id": "278", + "id": "1039986716", "type": "people" } ] @@ -37,7 +37,7 @@ "projects": { "data": [ { - "id": "289", + "id": "1022250826", "type": "projects" } ] @@ -45,7 +45,7 @@ "publications": { "data": [ { - "id": "18", + "id": "157", "type": "publications" } ] @@ -53,7 +53,7 @@ "events": { "data": [ { - "id": "10", + "id": "1025618684", "type": "events" } ] @@ -61,7 +61,7 @@ "workflows": { "data": [ { - "id": "20", + "id": "99", "type": "workflows" } ] diff --git a/public/api/examples/presentationPatchResponse.json b/public/api/examples/presentationPatchResponse.json index c03539c2da..0d0d7d741a 100644 --- a/public/api/examples/presentationPatchResponse.json +++ b/public/api/examples/presentationPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "12", + "id": "85", "type": "presentations", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "289", + "id": "1022250826", "type": "projects" }, "access": "edit" @@ -31,30 +31,30 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/presentations/12?version=1" + "url": "http://localhost:3000/presentations/85?version=1" } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:13:04.000Z", - "updated_at": "2022-06-07T14:13:04.000Z", + "created_at": "2024-06-20T12:34:57.000Z", + "updated_at": "2024-06-20T12:34:57.000Z", "content_blobs": [ { "original_filename": "test.pdf", "url": null, - "md5sum": "a922da633a99ac8d8a969fee40348450", - "sha1sum": "0ca4731e79fbd6525770dcf68e62a35a4581ebd5", + "md5sum": "df30f9f1a71be8ee7532b1fb1e917a96", + "sha1sum": "72cfabbd17e39311f4bc9e22a09f965bd16cd0c6", "content_type": "application/pdf", - "link": "http://localhost:3000/presentations/12/content_blobs/121", - "size": 9 + "link": "http://localhost:3000/presentations/85/content_blobs/1050452605", + "size": 10 } ], "creators": [ { - "profile": "/people/278", + "profile": "/people/1039986716", "family_name": "Last", - "given_name": "Person228", - "affiliation": "An Institution: 280", + "given_name": "Person1922", + "affiliation": "An Institution: 2357", "orcid": null } ], @@ -64,7 +64,7 @@ "creators": { "data": [ { - "id": "278", + "id": "1039986716", "type": "people" } ] @@ -72,7 +72,7 @@ "submitter": { "data": [ { - "id": "277", + "id": "1039986715", "type": "people" } ] @@ -80,11 +80,11 @@ "people": { "data": [ { - "id": "277", + "id": "1039986715", "type": "people" }, { - "id": "278", + "id": "1039986716", "type": "people" } ] @@ -92,7 +92,7 @@ "projects": { "data": [ { - "id": "289", + "id": "1022250826", "type": "projects" } ] @@ -115,7 +115,7 @@ "publications": { "data": [ { - "id": "18", + "id": "157", "type": "publications" } ] @@ -123,7 +123,7 @@ "events": { "data": [ { - "id": "10", + "id": "1025618684", "type": "events" } ] @@ -131,21 +131,21 @@ "workflows": { "data": [ { - "id": "20", + "id": "99", "type": "workflows" } ] } }, "links": { - "self": "/presentations/12?version=1" + "self": "/presentations/85?version=1" }, "meta": { - "created": "2022-06-07T14:13:04.000Z", - "modified": "2022-06-07T14:13:04.000Z", + "created": "2024-06-20T12:34:57.000Z", + "modified": "2024-06-20T12:34:57.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "deaca630-c899-013a-0f7e-0a81884ed284" + "uuid": "6d527fa0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/presentationPost.json b/public/api/examples/presentationPost.json index 7a8e609d4d..49eac7c0f2 100644 --- a/public/api/examples/presentationPost.json +++ b/public/api/examples/presentationPost.json @@ -21,7 +21,7 @@ "permissions": [ { "resource": { - "id": "254", + "id": "1022250791", "type": "projects" }, "access": "edit" @@ -33,7 +33,7 @@ "creators": { "data": [ { - "id": "239", + "id": "1039986677", "type": "people" } ] @@ -41,7 +41,7 @@ "projects": { "data": [ { - "id": "254", + "id": "1022250791", "type": "projects" } ] @@ -49,7 +49,7 @@ "publications": { "data": [ { - "id": "13", + "id": "152", "type": "publications" } ] @@ -57,7 +57,7 @@ "events": { "data": [ { - "id": "5", + "id": "1025618679", "type": "events" } ] @@ -65,7 +65,7 @@ "workflows": { "data": [ { - "id": "15", + "id": "94", "type": "workflows" } ] diff --git a/public/api/examples/presentationPostResponse.json b/public/api/examples/presentationPostResponse.json index 0e439ae7a2..265daf5e49 100644 --- a/public/api/examples/presentationPostResponse.json +++ b/public/api/examples/presentationPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "6", + "id": "79", "type": "presentations", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "254", + "id": "1022250791", "type": "projects" }, "access": "edit" @@ -30,13 +30,13 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/presentations/6?version=1" + "url": "http://localhost:3000/presentations/79?version=1" } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:12:59.000Z", - "updated_at": "2022-06-07T14:12:59.000Z", + "created_at": "2024-06-20T12:34:53.000Z", + "updated_at": "2024-06-20T12:34:53.000Z", "content_blobs": [ { "original_filename": "a_pdf_file.pdf", @@ -44,16 +44,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/pdf", - "link": "http://localhost:3000/presentations/6/content_blobs/109", + "link": "http://localhost:3000/presentations/79/content_blobs/1050452595", "size": null } ], "creators": [ { - "profile": "/people/239", + "profile": "/people/1039986677", "family_name": "Last", - "given_name": "Person194", - "affiliation": "An Institution: 241", + "given_name": "Person1888", + "affiliation": "An Institution: 2318", "orcid": null } ], @@ -63,7 +63,7 @@ "creators": { "data": [ { - "id": "239", + "id": "1039986677", "type": "people" } ] @@ -71,7 +71,7 @@ "submitter": { "data": [ { - "id": "238", + "id": "1039986676", "type": "people" } ] @@ -79,11 +79,11 @@ "people": { "data": [ { - "id": "238", + "id": "1039986676", "type": "people" }, { - "id": "239", + "id": "1039986677", "type": "people" } ] @@ -91,7 +91,7 @@ "projects": { "data": [ { - "id": "254", + "id": "1022250791", "type": "projects" } ] @@ -114,7 +114,7 @@ "publications": { "data": [ { - "id": "13", + "id": "152", "type": "publications" } ] @@ -122,7 +122,7 @@ "events": { "data": [ { - "id": "5", + "id": "1025618679", "type": "events" } ] @@ -130,21 +130,21 @@ "workflows": { "data": [ { - "id": "15", + "id": "94", "type": "workflows" } ] } }, "links": { - "self": "/presentations/6?version=1" + "self": "/presentations/79?version=1" }, "meta": { - "created": "2022-06-07T14:12:59.000Z", - "modified": "2022-06-07T14:12:59.000Z", + "created": "2024-06-20T12:34:53.000Z", + "modified": "2024-06-20T12:34:53.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "dbeae7a0-c899-013a-0f7e-0a81884ed284" + "uuid": "6af879c0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/presentationResponse.json b/public/api/examples/presentationResponse.json index c540985606..e02101f104 100644 --- a/public/api/examples/presentationResponse.json +++ b/public/api/examples/presentationResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "11", + "id": "84", "type": "presentations", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "18", + "id": "167", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,13 +31,13 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/presentations/11?version=1" + "url": "http://localhost:3000/presentations/84?version=1" } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:13:03.000Z", - "updated_at": "2022-06-07T14:13:03.000Z", + "created_at": "2024-06-20T12:34:56.000Z", + "updated_at": "2024-06-20T12:34:56.000Z", "content_blobs": [ { "original_filename": "test.pdf", @@ -45,13 +45,13 @@ "md5sum": "726de0a3f94d65056b909b9736e10349", "sha1sum": "fbcc0dee4b5415de4c82ef5b137d8231fec1331b", "content_type": "application/pdf", - "link": "http://localhost:3000/presentations/11/content_blobs/120", + "link": "http://localhost:3000/presentations/84/content_blobs/1050452604", "size": 8 } ], "creators": [ { - "profile": "/people/274", + "profile": "/people/1039986712", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -64,7 +64,7 @@ "creators": { "data": [ { - "id": "274", + "id": "1039986712", "type": "people" } ] @@ -72,7 +72,7 @@ "submitter": { "data": [ { - "id": "275", + "id": "1039986713", "type": "people" } ] @@ -80,11 +80,11 @@ "people": { "data": [ { - "id": "274", + "id": "1039986712", "type": "people" }, { - "id": "275", + "id": "1039986713", "type": "people" } ] @@ -92,7 +92,7 @@ "projects": { "data": [ { - "id": "287", + "id": "1022250824", "type": "projects" } ] @@ -100,7 +100,7 @@ "investigations": { "data": [ { - "id": "40", + "id": "973654808", "type": "investigations" } ] @@ -108,7 +108,7 @@ "studies": { "data": [ { - "id": "38", + "id": "1060384866", "type": "studies" } ] @@ -116,7 +116,7 @@ "assays": { "data": [ { - "id": "36", + "id": "1035386654", "type": "assays" } ] @@ -124,7 +124,7 @@ "publications": { "data": [ { - "id": "17", + "id": "156", "type": "publications" } ] @@ -132,7 +132,7 @@ "events": { "data": [ { - "id": "9", + "id": "1025618683", "type": "events" } ] @@ -140,21 +140,21 @@ "workflows": { "data": [ { - "id": "19", + "id": "98", "type": "workflows" } ] } }, "links": { - "self": "/presentations/11?version=1" + "self": "/presentations/84?version=1" }, "meta": { - "created": "2022-06-07T14:13:03.000Z", - "modified": "2022-06-07T14:13:03.000Z", + "created": "2024-06-20T12:34:56.000Z", + "modified": "2024-06-20T12:34:56.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "de40d2f0-c899-013a-0f7e-0a81884ed284" + "uuid": "6cf09130-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/programmePatch.json b/public/api/examples/programmePatch.json index 07b41fd5c0..f60ff03dae 100644 --- a/public/api/examples/programmePatch.json +++ b/public/api/examples/programmePatch.json @@ -1,6 +1,6 @@ { "data": { - "id": "1296", + "id": "42", "type": "programmes", "attributes": { "title": "Changed title", @@ -15,7 +15,7 @@ "projects": { "data": [ { - "id": "7653", + "id": "364", "type": "projects" } ] @@ -23,7 +23,7 @@ "administrators": { "data": [ { - "id": "5588", + "id": "301", "type": "people" } ] @@ -31,7 +31,7 @@ "people": { "data": [ { - "id": "5588", + "id": "301", "type": "people" } ] diff --git a/public/api/examples/programmePatchResponse.json b/public/api/examples/programmePatchResponse.json index 5e6383467e..7edcc269d0 100644 --- a/public/api/examples/programmePatchResponse.json +++ b/public/api/examples/programmePatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "1296", + "id": "42", "type": "programmes", "attributes": { "discussion_links": [ @@ -19,7 +19,7 @@ "administrators": { "data": [ { - "id": "5588", + "id": "301", "type": "people" } ] @@ -27,7 +27,7 @@ "people": { "data": [ { - "id": "5588", + "id": "301", "type": "people" } ] @@ -35,7 +35,7 @@ "projects": { "data": [ { - "id": "7653", + "id": "364", "type": "projects" } ] @@ -107,14 +107,14 @@ } }, "links": { - "self": "/programmes/1296" + "self": "/programmes/42" }, "meta": { - "created": "2023-03-28T14:57:01.000Z", - "modified": "2023-03-28T14:57:01.000Z", + "created": "2024-06-20T12:29:32.000Z", + "modified": "2024-06-20T12:29:32.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "b8016460-afa6-013b-c76a-2c91a17e7bb9" + "uuid": "abc65c50-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/programmePost.json b/public/api/examples/programmePost.json index a16f03954c..b18ae32ebe 100644 --- a/public/api/examples/programmePost.json +++ b/public/api/examples/programmePost.json @@ -15,7 +15,7 @@ "projects": { "data": [ { - "id": "7564", + "id": "275", "type": "projects" } ] @@ -23,11 +23,11 @@ "administrators": { "data": [ { - "id": "5510", + "id": "223", "type": "people" }, { - "id": "5511", + "id": "224", "type": "people" } ] diff --git a/public/api/examples/programmePostResponse.json b/public/api/examples/programmePostResponse.json index e413d7b659..e26d1d523e 100644 --- a/public/api/examples/programmePostResponse.json +++ b/public/api/examples/programmePostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "1288", + "id": "34", "type": "programmes", "attributes": { "discussion_links": [ @@ -20,11 +20,11 @@ "administrators": { "data": [ { - "id": "5510", + "id": "223", "type": "people" }, { - "id": "5511", + "id": "224", "type": "people" } ] @@ -32,11 +32,11 @@ "people": { "data": [ { - "id": "5510", + "id": "223", "type": "people" }, { - "id": "5511", + "id": "224", "type": "people" } ] @@ -44,7 +44,7 @@ "projects": { "data": [ { - "id": "7564", + "id": "275", "type": "projects" } ] @@ -116,14 +116,14 @@ } }, "links": { - "self": "/programmes/1288" + "self": "/programmes/34" }, "meta": { - "created": "2023-03-28T14:56:53.000Z", - "modified": "2023-03-28T14:56:53.000Z", + "created": "2024-06-20T12:29:22.000Z", + "modified": "2024-06-20T12:29:22.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "b37f0780-afa6-013b-c76a-2c91a17e7bb9" + "uuid": "a56119c0-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/programmeResponse.json b/public/api/examples/programmeResponse.json index 4410e43f65..021fd757e1 100644 --- a/public/api/examples/programmeResponse.json +++ b/public/api/examples/programmeResponse.json @@ -1,11 +1,11 @@ { "data": { - "id": "1295", + "id": "41", "type": "programmes", "attributes": { "discussion_links": [ { - "id": "410", + "id": "20", "label": "Slack", "url": "http://www.slack.com/" } @@ -23,7 +23,7 @@ "administrators": { "data": [ { - "id": "5585", + "id": "298", "type": "people" } ] @@ -31,11 +31,11 @@ "people": { "data": [ { - "id": "5584", + "id": "297", "type": "people" }, { - "id": "5585", + "id": "298", "type": "people" } ] @@ -43,7 +43,7 @@ "projects": { "data": [ { - "id": "7648", + "id": "359", "type": "projects" } ] @@ -51,7 +51,7 @@ "institutions": { "data": [ { - "id": "5584", + "id": "297", "type": "institutions" } ] @@ -59,7 +59,7 @@ "investigations": { "data": [ { - "id": "656", + "id": "32", "type": "investigations" } ] @@ -67,7 +67,7 @@ "studies": { "data": [ { - "id": "574", + "id": "28", "type": "studies" } ] @@ -75,7 +75,7 @@ "assays": { "data": [ { - "id": "492", + "id": "24", "type": "assays" } ] @@ -83,7 +83,7 @@ "data_files": { "data": [ { - "id": "164", + "id": "16", "type": "data_files" } ] @@ -91,7 +91,7 @@ "models": { "data": [ { - "id": "656", + "id": "19", "type": "models" } ] @@ -99,7 +99,7 @@ "sops": { "data": [ { - "id": "164", + "id": "16", "type": "sops" } ] @@ -107,7 +107,7 @@ "publications": { "data": [ { - "id": "164", + "id": "8", "type": "publications" } ] @@ -115,7 +115,7 @@ "presentations": { "data": [ { - "id": "82", + "id": "11", "type": "presentations" } ] @@ -123,7 +123,7 @@ "events": { "data": [ { - "id": "82", + "id": "11", "type": "events" } ] @@ -131,7 +131,7 @@ "documents": { "data": [ { - "id": "164", + "id": "8", "type": "documents" } ] @@ -139,7 +139,7 @@ "workflows": { "data": [ { - "id": "82", + "id": "4", "type": "workflows" } ] @@ -151,14 +151,14 @@ } }, "links": { - "self": "/programmes/1295" + "self": "/programmes/41" }, "meta": { - "created": "2023-03-28T14:57:00.000Z", - "modified": "2023-03-28T14:57:00.000Z", + "created": "2024-06-20T12:29:32.000Z", + "modified": "2024-06-20T12:29:32.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "b7d5d740-afa6-013b-c76a-2c91a17e7bb9" + "uuid": "ab8c34d0-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/programmesResponse.json b/public/api/examples/programmesResponse.json index b6e1fe975a..b0b6a27252 100644 --- a/public/api/examples/programmesResponse.json +++ b/public/api/examples/programmesResponse.json @@ -1,33 +1,33 @@ { "data": [ { - "id": "1292", + "id": "38", "type": "programmes", "attributes": { "title": "A Maximal Programme" }, "links": { - "self": "/programmes/1292" + "self": "/programmes/38" } }, { - "id": "1291", + "id": "36", "type": "programmes", "attributes": { - "title": "A Programme: 28" + "title": "A Minimal Programme" }, "links": { - "self": "/programmes/1291" + "self": "/programmes/36" } }, { - "id": "1290", + "id": "37", "type": "programmes", "attributes": { - "title": "A Minimal Programme" + "title": "A Programme: 28" }, "links": { - "self": "/programmes/1290" + "self": "/programmes/37" } } ], diff --git a/public/api/examples/projectPatch.json b/public/api/examples/projectPatch.json index eda94f5199..490fa1c426 100644 --- a/public/api/examples/projectPatch.json +++ b/public/api/examples/projectPatch.json @@ -1,6 +1,6 @@ { "data": { - "id": "15790", + "id": "646", "type": "projects", "attributes": { "avatar": null, @@ -14,21 +14,21 @@ "permissions": [ { "resource": { - "id": "13324", + "id": "513", "type": "people" }, "access": "manage" }, { "resource": { - "id": "15790", + "id": "646", "type": "projects" }, "access": "download" }, { "resource": { - "id": "13808", + "id": "540", "type": "institutions" }, "access": "view" @@ -36,7 +36,7 @@ ] }, "extended_attributes": { - "extended_metadata_type_id": "2662", + "extended_metadata_type_id": "140", "attribute_map": { "dad": { "first_name": "john", @@ -73,7 +73,7 @@ "programmes": { "data": [ { - "id": "507", + "id": "71", "type": "programmes" } ] @@ -81,7 +81,7 @@ "organisms": { "data": [ { - "id": "737", + "id": "33", "type": "organisms" } ] diff --git a/public/api/examples/projectPatchResponse.json b/public/api/examples/projectPatchResponse.json index b8b5bd3f66..91af4f3d71 100644 --- a/public/api/examples/projectPatchResponse.json +++ b/public/api/examples/projectPatchResponse.json @@ -1,13 +1,13 @@ { "data": { - "id": "15790", + "id": "646", "type": "projects", "attributes": { "discussion_links": [ ], "extended_attributes": { - "extended_metadata_type_id": "2662", + "extended_metadata_type_id": "140", "attribute_map": { "dad": { "first_name": "john", @@ -42,21 +42,21 @@ "permissions": [ { "resource": { - "id": "13324", + "id": "513", "type": "people" }, "access": "manage" }, { "resource": { - "id": "15790", + "id": "646", "type": "projects" }, "access": "download" }, { "resource": { - "id": "13808", + "id": "540", "type": "institutions" }, "access": "view" @@ -102,7 +102,7 @@ "organisms": { "data": [ { - "id": "737", + "id": "33", "type": "organisms" } ] @@ -125,7 +125,7 @@ "programmes": { "data": [ { - "id": "507", + "id": "71", "type": "programmes" } ] @@ -202,14 +202,14 @@ } }, "links": { - "self": "/projects/15790" + "self": "/projects/646" }, "meta": { - "created": "2024-03-15T12:40:36.000Z", - "modified": "2024-03-15T12:40:36.000Z", + "created": "2024-06-20T12:30:04.000Z", + "modified": "2024-06-20T12:30:04.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "253ae910-c4f7-013c-642b-7efdca78d793" + "uuid": "bea4ec10-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/projectPost.json b/public/api/examples/projectPost.json index 1b060335b3..318efb9717 100644 --- a/public/api/examples/projectPost.json +++ b/public/api/examples/projectPost.json @@ -13,21 +13,21 @@ "permissions": [ { "resource": { - "id": "13321", + "id": "440", "type": "people" }, "access": "manage" }, { "resource": { - "id": "15784", + "id": "559", "type": "projects" }, "access": "download" }, { "resource": { - "id": "13804", + "id": "464", "type": "institutions" }, "access": "view" @@ -35,7 +35,7 @@ ] }, "extended_attributes": { - "extended_metadata_type_id": "2658", + "extended_metadata_type_id": "118", "attribute_map": { "dad": { "first_name": "john", @@ -72,7 +72,7 @@ "programmes": { "data": [ { - "id": "506", + "id": "66", "type": "programmes" } ] @@ -80,7 +80,7 @@ "organisms": { "data": [ { - "id": "736", + "id": "28", "type": "organisms" } ] diff --git a/public/api/examples/projectPostResponse.json b/public/api/examples/projectPostResponse.json index e6ccd4e633..0b16b767d4 100644 --- a/public/api/examples/projectPostResponse.json +++ b/public/api/examples/projectPostResponse.json @@ -1,13 +1,13 @@ { "data": { - "id": "15786", + "id": "561", "type": "projects", "attributes": { "discussion_links": [ ], "extended_attributes": { - "extended_metadata_type_id": "2658", + "extended_metadata_type_id": "118", "attribute_map": { "dad": { "first_name": "john", @@ -42,21 +42,21 @@ "permissions": [ { "resource": { - "id": "13321", + "id": "440", "type": "people" }, "access": "manage" }, { "resource": { - "id": "15784", + "id": "559", "type": "projects" }, "access": "download" }, { "resource": { - "id": "13804", + "id": "464", "type": "institutions" }, "access": "view" @@ -102,7 +102,7 @@ "organisms": { "data": [ { - "id": "736", + "id": "28", "type": "organisms" } ] @@ -125,7 +125,7 @@ "programmes": { "data": [ { - "id": "506", + "id": "66", "type": "programmes" } ] @@ -202,14 +202,14 @@ } }, "links": { - "self": "/projects/15786" + "self": "/projects/561" }, "meta": { - "created": "2024-03-15T12:40:36.000Z", - "modified": "2024-03-15T12:40:36.000Z", + "created": "2024-06-20T12:29:54.000Z", + "modified": "2024-06-20T12:29:54.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "2520d160-c4f7-013c-642b-7efdca78d793" + "uuid": "b87dd8d0-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/projectResponse.json b/public/api/examples/projectResponse.json index 28df2bde2a..2d52dba2da 100644 --- a/public/api/examples/projectResponse.json +++ b/public/api/examples/projectResponse.json @@ -1,17 +1,17 @@ { "data": { - "id": "14075", + "id": "642", "type": "projects", "attributes": { "discussion_links": [ { - "id": "639", + "id": "36", "label": "Slack", "url": "http://www.slack.com/" } ], "extended_attributes": { - "extended_metadata_type_id": "1824", + "extended_metadata_type_id": "135", "attribute_map": { "dad": { "first_name": "john", @@ -33,7 +33,7 @@ ] } }, - "avatar": "/projects/14075/avatars/70", + "avatar": "/projects/642/avatars/8", "title": "A Maximal Project", "description": "A Taverna project", "web_page": "http://www.taverna.org.uk", @@ -49,8 +49,8 @@ }, "members": [ { - "person_id": "12085", - "institution_id": "12386" + "person_id": "510", + "institution_id": "536" } ], "use_default_policy": true, @@ -99,7 +99,7 @@ "people": { "data": [ { - "id": "12085", + "id": "510", "type": "people" } ] @@ -107,7 +107,7 @@ "institutions": { "data": [ { - "id": "12386", + "id": "536", "type": "institutions" } ] @@ -115,7 +115,7 @@ "programmes": { "data": [ { - "id": "314", + "id": "70", "type": "programmes" } ] @@ -123,7 +123,7 @@ "investigations": { "data": [ { - "id": "4396", + "id": "64", "type": "investigations" } ] @@ -131,7 +131,7 @@ "studies": { "data": [ { - "id": "3327", + "id": "56", "type": "studies" } ] @@ -139,7 +139,7 @@ "assays": { "data": [ { - "id": "1696", + "id": "48", "type": "assays" } ] @@ -147,7 +147,7 @@ "data_files": { "data": [ { - "id": "456", + "id": "24", "type": "data_files" } ] @@ -165,7 +165,7 @@ "models": { "data": [ { - "id": "611", + "id": "31", "type": "models" } ] @@ -173,7 +173,7 @@ "sops": { "data": [ { - "id": "438", + "id": "24", "type": "sops" } ] @@ -181,7 +181,7 @@ "publications": { "data": [ { - "id": "1597", + "id": "16", "type": "publications" } ] @@ -189,7 +189,7 @@ "presentations": { "data": [ { - "id": "155", + "id": "15", "type": "presentations" } ] @@ -197,7 +197,7 @@ "events": { "data": [ { - "id": "184", + "id": "15", "type": "events" } ] @@ -205,7 +205,7 @@ "documents": { "data": [ { - "id": "508", + "id": "16", "type": "documents" } ] @@ -213,7 +213,7 @@ "workflows": { "data": [ { - "id": "244", + "id": "8", "type": "workflows" } ] @@ -221,21 +221,21 @@ "collections": { "data": [ { - "id": "122", + "id": "8", "type": "collections" } ] } }, "links": { - "self": "/projects/14075" + "self": "/projects/642" }, "meta": { - "created": "2024-03-15T12:19:36.000Z", - "modified": "2024-03-15T12:19:36.000Z", + "created": "2024-06-20T12:30:03.000Z", + "modified": "2024-06-20T12:30:04.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "3627d4b0-c4f4-013c-641e-7efdca78d793" + "uuid": "be5ee920-112e-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/projectsResponse.json b/public/api/examples/projectsResponse.json index 6066b016fd..acba601509 100644 --- a/public/api/examples/projectsResponse.json +++ b/public/api/examples/projectsResponse.json @@ -1,363 +1,363 @@ { "data": [ { - "id": "13608", + "id": "599", "type": "projects", "attributes": { - "title": "A Project: -222" + "title": "A Project: -587" }, "links": { - "self": "/projects/13608" + "self": "/projects/599" } }, { - "id": "13609", + "id": "600", "type": "projects", "attributes": { - "title": "A Project: -223" + "title": "A Project: -588" }, "links": { - "self": "/projects/13609" + "self": "/projects/600" } }, { - "id": "13610", + "id": "601", "type": "projects", "attributes": { - "title": "A Project: -224" + "title": "A Project: -589" }, "links": { - "self": "/projects/13610" + "self": "/projects/601" } }, { - "id": "13611", + "id": "602", "type": "projects", "attributes": { - "title": "A Project: -225" + "title": "A Maximal Project" }, "links": { - "self": "/projects/13611" + "self": "/projects/602" } }, { - "id": "13612", + "id": "591", "type": "projects", "attributes": { - "title": "A Project: -226" + "title": "A Project: -579" }, "links": { - "self": "/projects/13612" + "self": "/projects/591" } }, { - "id": "13613", + "id": "592", "type": "projects", "attributes": { - "title": "A Project: -227" + "title": "A Project: -580" }, "links": { - "self": "/projects/13613" + "self": "/projects/592" } }, { - "id": "13614", + "id": "593", "type": "projects", "attributes": { - "title": "A Project: -228" + "title": "A Project: -581" }, "links": { - "self": "/projects/13614" + "self": "/projects/593" } }, { - "id": "13615", + "id": "594", "type": "projects", "attributes": { - "title": "A Maximal Project" + "title": "A Project: -582" }, "links": { - "self": "/projects/13615" + "self": "/projects/594" } }, { - "id": "13594", + "id": "595", "type": "projects", "attributes": { - "title": "A Project: -208" + "title": "A Project: -583" }, "links": { - "self": "/projects/13594" + "self": "/projects/595" } }, { - "id": "13595", + "id": "596", "type": "projects", "attributes": { - "title": "A Project: -209" + "title": "A Project: -584" }, "links": { - "self": "/projects/13595" + "self": "/projects/596" } }, { - "id": "13596", + "id": "597", "type": "projects", "attributes": { - "title": "A Project: -210" + "title": "A Project: -585" }, "links": { - "self": "/projects/13596" + "self": "/projects/597" } }, { - "id": "13597", + "id": "598", "type": "projects", "attributes": { - "title": "A Project: -211" + "title": "A Project: -586" }, "links": { - "self": "/projects/13597" + "self": "/projects/598" } }, { - "id": "13598", + "id": "583", "type": "projects", "attributes": { - "title": "A Project: -212" + "title": "A Project: -571" }, "links": { - "self": "/projects/13598" + "self": "/projects/583" } }, { - "id": "13599", + "id": "584", "type": "projects", "attributes": { - "title": "A Project: -213" + "title": "A Project: -572" }, "links": { - "self": "/projects/13599" + "self": "/projects/584" } }, { - "id": "13600", + "id": "585", "type": "projects", "attributes": { - "title": "A Project: -214" + "title": "A Project: -573" }, "links": { - "self": "/projects/13600" + "self": "/projects/585" } }, { - "id": "13601", + "id": "586", "type": "projects", "attributes": { - "title": "A Project: -215" + "title": "A Project: -574" }, "links": { - "self": "/projects/13601" + "self": "/projects/586" } }, { - "id": "13602", + "id": "587", "type": "projects", "attributes": { - "title": "A Project: -216" + "title": "A Project: -575" }, "links": { - "self": "/projects/13602" + "self": "/projects/587" } }, { - "id": "13603", + "id": "588", "type": "projects", "attributes": { - "title": "A Project: -217" + "title": "A Project: -576" }, "links": { - "self": "/projects/13603" + "self": "/projects/588" } }, { - "id": "13604", + "id": "589", "type": "projects", "attributes": { - "title": "A Project: -218" + "title": "A Project: -577" }, "links": { - "self": "/projects/13604" + "self": "/projects/589" } }, { - "id": "13605", + "id": "590", "type": "projects", "attributes": { - "title": "A Project: -219" + "title": "A Project: -578" }, "links": { - "self": "/projects/13605" + "self": "/projects/590" } }, { - "id": "13606", + "id": "577", "type": "projects", "attributes": { - "title": "A Project: -220" + "title": "A Project: -565" }, "links": { - "self": "/projects/13606" + "self": "/projects/577" } }, { - "id": "13607", + "id": "578", "type": "projects", "attributes": { - "title": "A Project: -221" + "title": "A Project: -566" }, "links": { - "self": "/projects/13607" + "self": "/projects/578" } }, { - "id": "13580", + "id": "579", "type": "projects", "attributes": { - "title": "A Minimal Project" + "title": "A Project: -567" }, "links": { - "self": "/projects/13580" + "self": "/projects/579" } }, { - "id": "13581", + "id": "580", "type": "projects", "attributes": { - "title": "A Project: -195" + "title": "A Project: -568" }, "links": { - "self": "/projects/13581" + "self": "/projects/580" } }, { - "id": "13582", + "id": "581", "type": "projects", "attributes": { - "title": "A Project: -196" + "title": "A Project: -569" }, "links": { - "self": "/projects/13582" + "self": "/projects/581" } }, { - "id": "13583", + "id": "582", "type": "projects", "attributes": { - "title": "A Project: -197" + "title": "A Project: -570" }, "links": { - "self": "/projects/13583" + "self": "/projects/582" } }, { - "id": "13584", + "id": "570", "type": "projects", "attributes": { - "title": "A Project: -198" + "title": "A Project: -558" }, "links": { - "self": "/projects/13584" + "self": "/projects/570" } }, { - "id": "13585", + "id": "571", "type": "projects", "attributes": { - "title": "A Project: -199" + "title": "A Project: -559" }, "links": { - "self": "/projects/13585" + "self": "/projects/571" } }, { - "id": "13586", + "id": "572", "type": "projects", "attributes": { - "title": "A Project: -200" + "title": "A Project: -560" }, "links": { - "self": "/projects/13586" + "self": "/projects/572" } }, { - "id": "13587", + "id": "573", "type": "projects", "attributes": { - "title": "A Project: -201" + "title": "A Project: -561" }, "links": { - "self": "/projects/13587" + "self": "/projects/573" } }, { - "id": "13588", + "id": "574", "type": "projects", "attributes": { - "title": "A Project: -202" + "title": "A Project: -562" }, "links": { - "self": "/projects/13588" + "self": "/projects/574" } }, { - "id": "13589", + "id": "575", "type": "projects", "attributes": { - "title": "A Project: -203" + "title": "A Project: -563" }, "links": { - "self": "/projects/13589" + "self": "/projects/575" } }, { - "id": "13590", + "id": "576", "type": "projects", "attributes": { - "title": "A Project: -204" + "title": "A Project: -564" }, "links": { - "self": "/projects/13590" + "self": "/projects/576" } }, { - "id": "13591", + "id": "567", "type": "projects", "attributes": { - "title": "A Project: -205" + "title": "A Minimal Project" }, "links": { - "self": "/projects/13591" + "self": "/projects/567" } }, { - "id": "13592", + "id": "568", "type": "projects", "attributes": { - "title": "A Project: -206" + "title": "A Project: -556" }, "links": { - "self": "/projects/13592" + "self": "/projects/568" } }, { - "id": "13593", + "id": "569", "type": "projects", "attributes": { - "title": "A Project: -207" + "title": "A Project: -557" }, "links": { - "self": "/projects/13593" + "self": "/projects/569" } } ], diff --git a/public/api/examples/publicationResponse.json b/public/api/examples/publicationResponse.json index cfb88ca0d1..1892e73661 100644 --- a/public/api/examples/publicationResponse.json +++ b/public/api/examples/publicationResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "14", + "id": "209", "type": "publications", "attributes": { "policy": { @@ -11,14 +11,14 @@ }, "discussion_links": [ { - "id": "7", + "id": "190", "label": "Slack", "url": "http://www.slack.com/" } ], "misc_links": [ { - "id": "8", + "id": "191", "label": "A link", "url": "http://www.slack.com/" } @@ -32,14 +32,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/publications/14?version=1", + "url": "http://localhost:3000/publications/209?version=1", "doi": "10.5072/abcd" } ], "version": 1, "revision_comments": null, - "created_at": "2022-09-09T15:53:35.000Z", - "updated_at": "2022-09-09T15:53:35.000Z", + "created_at": "2024-06-20T12:36:11.000Z", + "updated_at": "2024-06-20T12:36:11.000Z", "doi": "10.5072/abcd", "content_blobs": [ { @@ -48,7 +48,7 @@ "md5sum": "726de0a3f94d65056b909b9736e10349", "sha1sum": "fbcc0dee4b5415de4c82ef5b137d8231fec1331b", "content_type": "application/pdf", - "link": "http://localhost:3000/publications/14/content_blobs/12", + "link": "http://localhost:3000/publications/209/content_blobs/1050452780", "size": 8 } ], @@ -81,7 +81,7 @@ "submitter": { "data": [ { - "id": "85", + "id": "1039987265", "type": "people" } ] @@ -89,7 +89,7 @@ "people": { "data": [ { - "id": "85", + "id": "1039987265", "type": "people" } ] @@ -97,7 +97,7 @@ "projects": { "data": [ { - "id": "92", + "id": "1022251332", "type": "projects" } ] @@ -105,7 +105,7 @@ "investigations": { "data": [ { - "id": "12", + "id": "973654855", "type": "investigations" } ] @@ -113,7 +113,7 @@ "studies": { "data": [ { - "id": "8", + "id": "1060384909", "type": "studies" } ] @@ -121,7 +121,7 @@ "assays": { "data": [ { - "id": "4", + "id": "1035386693", "type": "assays" } ] @@ -129,7 +129,7 @@ "data_files": { "data": [ { - "id": "4", + "id": "883654327", "type": "data_files" } ] @@ -137,7 +137,7 @@ "models": { "data": [ { - "id": "12", + "id": "1004285499", "type": "models" } ] @@ -145,7 +145,7 @@ "presentations": { "data": [ { - "id": "4", + "id": "89", "type": "presentations" } ] @@ -153,7 +153,7 @@ "events": { "data": [ { - "id": "4", + "id": "1025618721", "type": "events" } ] @@ -161,21 +161,21 @@ "workflows": { "data": [ { - "id": "4", + "id": "141", "type": "workflows" } ] } }, "links": { - "self": "/publications/14?version=1" + "self": "/publications/209?version=1" }, "meta": { - "created": "2022-09-09T15:53:34.000Z", - "modified": "2022-09-09T15:53:34.000Z", + "created": "2024-06-20T12:36:11.000Z", + "modified": "2024-06-20T12:36:11.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "7c27c030-1285-013b-1218-0a81884ed284" + "uuid": "99a5ba60-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/publicationsResponse.json b/public/api/examples/publicationsResponse.json index 5a29d0caaf..c4892fc37c 100644 --- a/public/api/examples/publicationsResponse.json +++ b/public/api/examples/publicationsResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "12", + "id": "207", "type": "publications", "attributes": { "title": "A Maximal Publication" }, "links": { - "self": "/publications/12" + "self": "/publications/207" } }, { - "id": "11", + "id": "206", "type": "publications", "attributes": { "title": "A Minimal Publication" }, "links": { - "self": "/publications/11" + "self": "/publications/206" } } ], diff --git a/public/api/examples/sampleControlledVocabPatch.json b/public/api/examples/sampleControlledVocabPatch.json index da157689e0..04e7116770 100644 --- a/public/api/examples/sampleControlledVocabPatch.json +++ b/public/api/examples/sampleControlledVocabPatch.json @@ -1,6 +1,6 @@ { "data": { - "id": "18", + "id": "303", "type": "sample_controlled_vocabs", "attributes": { "title": "new title", @@ -10,7 +10,7 @@ "short_name": "new short name", "sample_controlled_vocab_terms_attributes": [ { - "id": "17", + "id": "931", "label": "new term label", "iri": "new iri", "parent_iri": "new parent_iri" diff --git a/public/api/examples/sampleControlledVocabPatchResponse.json b/public/api/examples/sampleControlledVocabPatchResponse.json index b02456a5a8..1f843eb873 100644 --- a/public/api/examples/sampleControlledVocabPatchResponse.json +++ b/public/api/examples/sampleControlledVocabPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "18", + "id": "303", "type": "sample_controlled_vocabs", "attributes": { "title": "new title", @@ -10,7 +10,7 @@ "short_name": "new short name", "sample_controlled_vocab_terms_attributes": [ { - "id": "17", + "id": "931", "label": "new term label", "iri": "new iri", "parent_iri": "new parent_iri" @@ -21,18 +21,18 @@ "sample_controlled_vocab_terms": { "data": [ { - "id": "17", + "id": "931", "type": "sample_controlled_vocab_terms" } ] } }, "links": { - "self": "/sample_controlled_vocabs/18" + "self": "/sample_controlled_vocabs/303" }, "meta": { - "created": "2023-11-15T16:36:00.000Z", - "modified": "2023-11-15T16:36:00.000Z", + "created": "2024-06-20T12:40:41.000Z", + "modified": "2024-06-20T12:40:41.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } diff --git a/public/api/examples/sampleControlledVocabPostResponse.json b/public/api/examples/sampleControlledVocabPostResponse.json index e7fccd07f4..06fbc17612 100644 --- a/public/api/examples/sampleControlledVocabPostResponse.json +++ b/public/api/examples/sampleControlledVocabPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "17", + "id": "302", "type": "sample_controlled_vocabs", "attributes": { "title": "New Vocab Max", @@ -10,7 +10,7 @@ "short_name": "short_name", "sample_controlled_vocab_terms_attributes": [ { - "id": "16", + "id": "930", "label": "organism", "iri": "http://some_iri", "parent_iri": "http://another_iri" @@ -21,18 +21,18 @@ "sample_controlled_vocab_terms": { "data": [ { - "id": "16", + "id": "930", "type": "sample_controlled_vocab_terms" } ] } }, "links": { - "self": "/sample_controlled_vocabs/17" + "self": "/sample_controlled_vocabs/302" }, "meta": { - "created": "2023-11-15T16:36:00.000Z", - "modified": "2023-11-15T16:36:00.000Z", + "created": "2024-06-20T12:40:41.000Z", + "modified": "2024-06-20T12:40:41.000Z", "api_version": "0.3", "base_url": "http://localhost:3000" } diff --git a/public/api/examples/samplePatch.json b/public/api/examples/samplePatch.json index 5f42388b27..7ace32b30f 100644 --- a/public/api/examples/samplePatch.json +++ b/public/api/examples/samplePatch.json @@ -1,7 +1,7 @@ { "data": { "type": "samples", - "id": "3", + "id": "193", "attributes": { "attribute_map": { "full_name": "Fred Bloggs", @@ -12,7 +12,10 @@ "apples": [ "Golden Delicious", "Bramley" - ] + ], + "weight": 3.7, + "age": 42, + "bool": true }, "tags": [ @@ -22,7 +25,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022252320", "type": "projects" } ] diff --git a/public/api/examples/samplePatchResponse.json b/public/api/examples/samplePatchResponse.json index 435a958d0e..7085339e9f 100644 --- a/public/api/examples/samplePatchResponse.json +++ b/public/api/examples/samplePatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "3", + "id": "193", "type": "samples", "attributes": { "policy": { @@ -16,8 +16,8 @@ "tags": [ ], - "created_at": "2023-03-06T15:24:15.832Z", - "updated_at": "2023-03-06T15:24:15.975Z", + "created_at": "2024-06-20T12:38:32.000Z", + "updated_at": "2024-06-20T12:38:33.000Z", "creators": [ ], @@ -34,16 +34,19 @@ ], "patients": [ { - "id": 1, + "id": 191, "type": "Sample", "title": "Fred Bloggs" }, { - "id": 2, + "id": 192, "type": "Sample", "title": "Fred Bloggs" } - ] + ], + "weight": 3.7, + "age": 42, + "bool": true } }, "relationships": { @@ -55,21 +58,21 @@ "submitter": { "data": [ { - "id": "2", + "id": "1039988241", "type": "people" } ] }, "sample_type": { "data": { - "id": "2", + "id": "267", "type": "sample_types" } }, "projects": { "data": [ { - "id": "2", + "id": "1022252320", "type": "projects" } ] @@ -97,21 +100,21 @@ "people": { "data": [ { - "id": "2", + "id": "1039988241", "type": "people" } ] } }, "links": { - "self": "/samples/3" + "self": "/samples/193" }, "meta": { - "created": "2023-03-06T15:24:15.832Z", - "modified": "2023-03-06T15:24:15.975Z", + "created": "2024-06-20T12:38:32.000Z", + "modified": "2024-06-20T12:38:33.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "e133a800-9e60-013b-15a0-0a81884ed284" + "uuid": "edb06c50-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/samplePost.json b/public/api/examples/samplePost.json index 4c59e9a7c3..63a83558cc 100644 --- a/public/api/examples/samplePost.json +++ b/public/api/examples/samplePost.json @@ -11,7 +11,10 @@ "apples": [ "Golden Delicious", "Granny Smith" - ] + ], + "weight": 3.7, + "age": 42, + "bool": true }, "tags": [ "tag1", @@ -21,14 +24,14 @@ "relationships": { "sample_type": { "data": { - "id": "2", + "id": "246", "type": "sample_types" } }, "creators": { "data": [ { - "id": "2", + "id": "1039988186", "type": "people" } ] @@ -36,7 +39,7 @@ "projects": { "data": [ { - "id": "2", + "id": "1022252265", "type": "projects" } ] @@ -44,7 +47,7 @@ "assays": { "data": [ { - "id": "2", + "id": "1035386870", "type": "assays" } ] diff --git a/public/api/examples/samplePostResponse.json b/public/api/examples/samplePostResponse.json index 85cde29b48..7e14681087 100644 --- a/public/api/examples/samplePostResponse.json +++ b/public/api/examples/samplePostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "4", + "id": "177", "type": "samples", "attributes": { "policy": { @@ -17,14 +17,14 @@ "tag1", "tag2" ], - "created_at": "2023-03-06T15:24:11.241Z", - "updated_at": "2023-03-06T15:24:11.220Z", + "created_at": "2024-06-20T12:38:26.000Z", + "updated_at": "2024-06-20T12:38:26.000Z", "creators": [ { - "profile": "/people/2", + "profile": "/people/1039988186", "family_name": "Last", - "given_name": "Person284", - "affiliation": "An Institution: 309", + "given_name": "Person3114", + "affiliation": "An Institution: 3846", "orcid": null } ], @@ -39,14 +39,17 @@ "Golden Delicious", "Granny Smith" ], - "patients": null + "patients": null, + "weight": 3.7, + "age": 42, + "bool": true } }, "relationships": { "creators": { "data": [ { - "id": "2", + "id": "1039988186", "type": "people" } ] @@ -54,21 +57,21 @@ "submitter": { "data": [ { - "id": "2", + "id": "1039988186", "type": "people" } ] }, "sample_type": { "data": { - "id": "2", + "id": "246", "type": "sample_types" } }, "projects": { "data": [ { - "id": "2", + "id": "1022252265", "type": "projects" } ] @@ -81,7 +84,7 @@ "investigations": { "data": [ { - "id": "2", + "id": "973655094", "type": "investigations" } ] @@ -89,7 +92,7 @@ "studies": { "data": [ { - "id": "2", + "id": "1060385125", "type": "studies" } ] @@ -97,7 +100,7 @@ "assays": { "data": [ { - "id": "2", + "id": "1035386870", "type": "assays" } ] @@ -105,21 +108,21 @@ "people": { "data": [ { - "id": "2", + "id": "1039988186", "type": "people" } ] } }, "links": { - "self": "/samples/4" + "self": "/samples/177" }, "meta": { - "created": "2023-03-06T15:24:11.241Z", - "modified": "2023-03-06T15:24:11.220Z", + "created": "2024-06-20T12:38:26.000Z", + "modified": "2024-06-20T12:38:26.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "de769a80-9e60-013b-15a0-0a81884ed284" + "uuid": "e9ee4c30-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sampleResponse.json b/public/api/examples/sampleResponse.json index 96c4c47cfd..662806302a 100644 --- a/public/api/examples/sampleResponse.json +++ b/public/api/examples/sampleResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "6", + "id": "190", "type": "samples", "attributes": { "policy": { @@ -17,8 +17,8 @@ "tag1", "tag2" ], - "created_at": "2023-03-06T15:24:14.918Z", - "updated_at": "2023-03-06T15:24:14.918Z", + "created_at": "2024-06-20T12:38:31.000Z", + "updated_at": "2024-06-20T12:38:31.000Z", "creators": [ ], @@ -35,16 +35,19 @@ ], "patients": [ { - "id": 4, + "id": 188, "type": "Sample", "title": "Fred Bloggs" }, { - "id": 5, + "id": 189, "type": "Sample", "title": "Fred Bloggs" } - ] + ], + "weight": 3.7, + "age": 42, + "bool": true } }, "relationships": { @@ -56,21 +59,21 @@ "submitter": { "data": [ { - "id": "17", + "id": "1039988230", "type": "people" } ] }, "sample_type": { "data": { - "id": "6", + "id": "263", "type": "sample_types" } }, "projects": { "data": [ { - "id": "17", + "id": "1022252309", "type": "projects" } ] @@ -98,21 +101,21 @@ "people": { "data": [ { - "id": "17", + "id": "1039988230", "type": "people" } ] } }, "links": { - "self": "/samples/6" + "self": "/samples/190" }, "meta": { - "created": "2023-03-06T15:24:14.918Z", - "modified": "2023-03-06T15:24:14.918Z", + "created": "2024-06-20T12:38:31.000Z", + "modified": "2024-06-20T12:38:31.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "e0a80650-9e60-013b-15a0-0a81884ed284" + "uuid": "ecf56830-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sampleTypePatch.json b/public/api/examples/sampleTypePatch.json index b94869b5cb..4a59e01de0 100644 --- a/public/api/examples/sampleTypePatch.json +++ b/public/api/examples/sampleTypePatch.json @@ -1,15 +1,15 @@ { "data": { "type": "sample_types", - "id": "23", + "id": "118", "attributes": { "title": "This is a new title.", "sample_attributes": [ { - "id": "39", + "id": "206", "title": "This is a new attribute title", "sample_attribute_type": { - "title": "String attribute type 16" + "title": "String attribute type 513" } } ], @@ -21,7 +21,7 @@ "projects": { "data": [ { - "id": "953", + "id": "1022251411", "type": "projects" } ] @@ -29,7 +29,7 @@ "assays": { "data": [ { - "id": "133", + "id": "1035386724", "type": "assays" } ] diff --git a/public/api/examples/sampleTypePatchResponse.json b/public/api/examples/sampleTypePatchResponse.json index 69b5ee4eee..85e68b2020 100644 --- a/public/api/examples/sampleTypePatchResponse.json +++ b/public/api/examples/sampleTypePatchResponse.json @@ -1,19 +1,19 @@ { "data": { - "id": "23", + "id": "118", "type": "sample_types", "attributes": { "title": "This is a new title.", "description": null, "sample_attributes": [ { - "id": "39", + "id": "206", "title": "This is a new attribute title", "description": null, "pid": null, "sample_attribute_type": { - "id": "38", - "title": "String attribute type 16", + "id": "875", + "title": "String attribute type 513", "base_type": "String", "regexp": ".*" }, @@ -33,7 +33,7 @@ "projects": { "data": [ { - "id": "953", + "id": "1022251411", "type": "projects" } ] @@ -46,7 +46,7 @@ "submitter": { "data": [ { - "id": "872", + "id": "1039987344", "type": "people" } ] @@ -54,21 +54,21 @@ "assays": { "data": [ { - "id": "133", + "id": "1035386724", "type": "assays" } ] } }, "links": { - "self": "/sample_types/23" + "self": "/sample_types/118" }, "meta": { - "created": "2022-06-07T14:14:37.000Z", - "modified": "2022-06-07T14:14:37.000Z", + "created": "2024-06-20T12:36:24.000Z", + "modified": "2024-06-20T12:36:24.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "16802d40-c89a-013a-0f7e-0a81884ed284" + "uuid": "a100d230-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sampleTypePost.json b/public/api/examples/sampleTypePost.json index a01e34a737..4a75983d64 100644 --- a/public/api/examples/sampleTypePost.json +++ b/public/api/examples/sampleTypePost.json @@ -8,7 +8,7 @@ { "title": "full name", "sample_attribute_type": { - "title": "String attribute type 13" + "title": "String attribute type 510" }, "required": true, "pos": 1, @@ -21,7 +21,7 @@ "projects": { "data": [ { - "id": "938", + "id": "1022251394", "type": "projects" } ] @@ -29,7 +29,7 @@ "assays": { "data": [ { - "id": "128", + "id": "1035386719", "type": "assays" } ] diff --git a/public/api/examples/sampleTypePostResponse.json b/public/api/examples/sampleTypePostResponse.json index c2f41e0085..45020606a2 100644 --- a/public/api/examples/sampleTypePostResponse.json +++ b/public/api/examples/sampleTypePostResponse.json @@ -1,19 +1,19 @@ { "data": { - "id": "17", + "id": "110", "type": "sample_types", "attributes": { "title": "A Maximal SampleType", "description": "A very new research", "sample_attributes": [ { - "id": "27", + "id": "172", "title": "full name", "description": null, "pid": null, "sample_attribute_type": { - "id": "26", - "title": "String attribute type 13", + "id": "841", + "title": "String attribute type 510", "base_type": "String", "regexp": ".*" }, @@ -33,7 +33,7 @@ "projects": { "data": [ { - "id": "938", + "id": "1022251394", "type": "projects" } ] @@ -46,7 +46,7 @@ "submitter": { "data": [ { - "id": "857", + "id": "1039987327", "type": "people" } ] @@ -54,21 +54,21 @@ "assays": { "data": [ { - "id": "128", + "id": "1035386719", "type": "assays" } ] } }, "links": { - "self": "/sample_types/17" + "self": "/sample_types/110" }, "meta": { - "created": "2022-06-07T14:14:35.000Z", - "modified": "2022-06-07T14:14:35.000Z", + "created": "2024-06-20T12:36:22.000Z", + "modified": "2024-06-20T12:36:22.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "154f5710-c89a-013a-0f7e-0a81884ed284" + "uuid": "9fc408f0-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sampleTypeResponse.json b/public/api/examples/sampleTypeResponse.json index 7613bde3c2..9c6cddb4ca 100644 --- a/public/api/examples/sampleTypeResponse.json +++ b/public/api/examples/sampleTypeResponse.json @@ -1,18 +1,18 @@ { "data": { - "id": "22", + "id": "117", "type": "sample_types", "attributes": { "title": "A Maximal SampleType", "description": "A very new research", "sample_attributes": [ { - "id": "35", + "id": "196", "title": "full_name", "description": "the persons full name", "pid": null, "sample_attribute_type": { - "id": "34", + "id": "860", "title": "Full name", "base_type": "String", "regexp": "[A-Z][a-z]+[ ][A-Z][a-z]+" @@ -25,12 +25,12 @@ "linked_sample_type_id": null }, { - "id": "36", + "id": "197", "title": "address", "description": null, "pid": null, "sample_attribute_type": { - "id": "35", + "id": "861", "title": "Address", "base_type": "Text", "regexp": ".*" @@ -43,12 +43,12 @@ "linked_sample_type_id": null }, { - "id": "37", + "id": "198", "title": "postcode", "description": null, "pid": "dc:postcode", "sample_attribute_type": { - "id": "36", + "id": "862", "title": "Post Code", "base_type": "String", "regexp": "^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$" @@ -61,12 +61,12 @@ "linked_sample_type_id": null }, { - "id": "38", + "id": "199", "title": "CAPITAL key", "description": null, "pid": null, "sample_attribute_type": { - "id": "37", + "id": "863", "title": "String", "base_type": "String", "regexp": ".*" @@ -77,6 +77,114 @@ "is_title": false, "sample_controlled_vocab_id": null, "linked_sample_type_id": null + }, + { + "id": "200", + "title": "apple", + "description": null, + "pid": null, + "sample_attribute_type": { + "id": "864", + "title": "CV attribute type 14", + "base_type": "CV", + "regexp": ".*" + }, + "required": false, + "pos": 5, + "unit": null, + "is_title": false, + "sample_controlled_vocab_id": "110", + "linked_sample_type_id": null + }, + { + "id": "201", + "title": "apples", + "description": null, + "pid": null, + "sample_attribute_type": { + "id": "865", + "title": "CV List attribute type 4", + "base_type": "CVList", + "regexp": ".*" + }, + "required": false, + "pos": 6, + "unit": null, + "is_title": false, + "sample_controlled_vocab_id": "111", + "linked_sample_type_id": null + }, + { + "id": "202", + "title": "patients", + "description": null, + "pid": null, + "sample_attribute_type": { + "id": "874", + "title": "Sample multi attribute type 8", + "base_type": "SeekSampleMulti", + "regexp": ".*" + }, + "required": false, + "pos": 7, + "unit": null, + "is_title": false, + "sample_controlled_vocab_id": null, + "linked_sample_type_id": "116" + }, + { + "id": "203", + "title": "weight", + "description": null, + "pid": null, + "sample_attribute_type": { + "id": "871", + "title": "Float attribute type 4", + "base_type": "Float", + "regexp": ".*" + }, + "required": false, + "pos": 8, + "unit": null, + "is_title": false, + "sample_controlled_vocab_id": null, + "linked_sample_type_id": null + }, + { + "id": "204", + "title": "age", + "description": null, + "pid": null, + "sample_attribute_type": { + "id": "872", + "title": "Integer attribute type 47", + "base_type": "Integer", + "regexp": ".*" + }, + "required": false, + "pos": 9, + "unit": null, + "is_title": false, + "sample_controlled_vocab_id": null, + "linked_sample_type_id": null + }, + { + "id": "205", + "title": "bool", + "description": null, + "pid": null, + "sample_attribute_type": { + "id": "873", + "title": "Boolean attribute type 4", + "base_type": "Boolean", + "regexp": ".*" + }, + "required": false, + "pos": 10, + "unit": null, + "is_title": false, + "sample_controlled_vocab_id": null, + "linked_sample_type_id": null } ], "tags": [ @@ -88,7 +196,7 @@ "projects": { "data": [ { - "id": "951", + "id": "1022251408", "type": "projects" } ] @@ -101,7 +209,7 @@ "submitter": { "data": [ { - "id": "870", + "id": "1039987341", "type": "people" } ] @@ -109,21 +217,21 @@ "assays": { "data": [ { - "id": "132", + "id": "1035386723", "type": "assays" } ] } }, "links": { - "self": "/sample_types/22" + "self": "/sample_types/117" }, "meta": { - "created": "2022-06-07T14:14:37.000Z", - "modified": "2022-06-07T14:14:37.000Z", + "created": "2024-06-20T12:36:23.000Z", + "modified": "2024-06-20T12:36:23.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "16537c20-c89a-013a-0f7e-0a81884ed284" + "uuid": "a0d6d860-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sopPatch.json b/public/api/examples/sopPatch.json index e2bfe11ce3..44aeaeafe1 100644 --- a/public/api/examples/sopPatch.json +++ b/public/api/examples/sopPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "sops", - "id": "16", + "id": "1055250535", "attributes": { "title": "A Maximally Patched SOP", "description": "Protocol", @@ -17,7 +17,7 @@ "permissions": [ { "resource": { - "id": "218", + "id": "1022253019", "type": "projects" }, "access": "edit" @@ -29,7 +29,7 @@ "creators": { "data": [ { - "id": "205", + "id": "1039988892", "type": "people" } ] @@ -37,7 +37,7 @@ "projects": { "data": [ { - "id": "218", + "id": "1022253019", "type": "projects" } ] @@ -45,7 +45,7 @@ "assays": { "data": [ { - "id": "28", + "id": "1035386971", "type": "assays" } ] @@ -53,7 +53,7 @@ "workflows": { "data": [ { - "id": "8", + "id": "257", "type": "workflows" } ] diff --git a/public/api/examples/sopPatchResponse.json b/public/api/examples/sopPatchResponse.json index c274592884..fe4150d96c 100644 --- a/public/api/examples/sopPatchResponse.json +++ b/public/api/examples/sopPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "16", + "id": "1055250535", "type": "sops", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "218", + "id": "1022253019", "type": "projects" }, "access": "edit" @@ -31,32 +31,32 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/sops/16?version=1", + "url": "http://localhost:3000/sops/1055250535?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:12:53.000Z", - "updated_at": "2022-06-07T14:12:53.000Z", + "created_at": "2024-06-20T12:40:04.000Z", + "updated_at": "2024-06-20T12:40:04.000Z", "doi": null, "content_blobs": [ { "original_filename": "sop.pdf", "url": null, - "md5sum": "63f964868d572e9de7e5a61b2dc27cfa", - "sha1sum": "77197c545a4465cedfc6d75258b7c2765869010c", + "md5sum": "341b39c240d2b301e5a2add1357937db", + "sha1sum": "4418725b3d755ed1247b0e6d05598637314ce8fb", "content_type": "application/pdf", - "link": "http://localhost:3000/sops/16/content_blobs/89", - "size": 9 + "link": "http://localhost:3000/sops/1055250535/content_blobs/1050453320", + "size": 10 } ], "creators": [ { - "profile": "/people/205", + "profile": "/people/1039988892", "family_name": "Last", - "given_name": "Person167", - "affiliation": "An Institution: 207", + "given_name": "Person3658", + "affiliation": "An Institution: 4548", "orcid": null } ], @@ -66,7 +66,7 @@ "creators": { "data": [ { - "id": "205", + "id": "1039988892", "type": "people" } ] @@ -74,7 +74,7 @@ "submitter": { "data": [ { - "id": "204", + "id": "1039988891", "type": "people" } ] @@ -82,11 +82,11 @@ "people": { "data": [ { - "id": "204", + "id": "1039988891", "type": "people" }, { - "id": "205", + "id": "1039988892", "type": "people" } ] @@ -94,7 +94,7 @@ "projects": { "data": [ { - "id": "218", + "id": "1022253019", "type": "projects" } ] @@ -102,7 +102,7 @@ "investigations": { "data": [ { - "id": "32", + "id": "973655203", "type": "investigations" } ] @@ -110,7 +110,7 @@ "studies": { "data": [ { - "id": "30", + "id": "1060385230", "type": "studies" } ] @@ -118,7 +118,7 @@ "assays": { "data": [ { - "id": "28", + "id": "1035386971", "type": "assays" } ] @@ -131,21 +131,21 @@ "workflows": { "data": [ { - "id": "8", + "id": "257", "type": "workflows" } ] } }, "links": { - "self": "/sops/16?version=1" + "self": "/sops/1055250535?version=1" }, "meta": { - "created": "2022-06-07T14:12:53.000Z", - "modified": "2022-06-07T14:12:53.000Z", + "created": "2024-06-20T12:40:04.000Z", + "modified": "2024-06-20T12:40:04.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "d838c140-c899-013a-0f7e-0a81884ed284" + "uuid": "24609170-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sopPost.json b/public/api/examples/sopPost.json index 1b5d0579e0..d609a44bae 100644 --- a/public/api/examples/sopPost.json +++ b/public/api/examples/sopPost.json @@ -21,7 +21,7 @@ "permissions": [ { "resource": { - "id": "128", + "id": "1022252921", "type": "projects" }, "access": "edit" @@ -33,7 +33,7 @@ "creators": { "data": [ { - "id": "121", + "id": "1039988800", "type": "people" } ] @@ -41,7 +41,7 @@ "projects": { "data": [ { - "id": "128", + "id": "1022252921", "type": "projects" } ] @@ -49,7 +49,7 @@ "assays": { "data": [ { - "id": "13", + "id": "1035386954", "type": "assays" } ] @@ -57,7 +57,7 @@ "workflows": { "data": [ { - "id": "1", + "id": "250", "type": "workflows" } ] diff --git a/public/api/examples/sopPostResponse.json b/public/api/examples/sopPostResponse.json index 504a9773b8..424263dc76 100644 --- a/public/api/examples/sopPostResponse.json +++ b/public/api/examples/sopPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "6", + "id": "1055250525", "type": "sops", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "128", + "id": "1022252921", "type": "projects" }, "access": "edit" @@ -30,14 +30,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/sops/6?version=1", + "url": "http://localhost:3000/sops/1055250525?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:12:40.000Z", - "updated_at": "2022-06-07T14:12:40.000Z", + "created_at": "2024-06-20T12:39:52.000Z", + "updated_at": "2024-06-20T12:39:52.000Z", "doi": null, "content_blobs": [ { @@ -46,16 +46,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/pdf", - "link": "http://localhost:3000/sops/6/content_blobs/47", + "link": "http://localhost:3000/sops/1055250525/content_blobs/1050453288", "size": null } ], "creators": [ { - "profile": "/people/121", + "profile": "/people/1039988800", "family_name": "Last", - "given_name": "Person94", - "affiliation": "An Institution: 123", + "given_name": "Person3577", + "affiliation": "An Institution: 4456", "orcid": null } ], @@ -65,7 +65,7 @@ "creators": { "data": [ { - "id": "121", + "id": "1039988800", "type": "people" } ] @@ -73,7 +73,7 @@ "submitter": { "data": [ { - "id": "120", + "id": "1039988799", "type": "people" } ] @@ -81,11 +81,11 @@ "people": { "data": [ { - "id": "120", + "id": "1039988799", "type": "people" }, { - "id": "121", + "id": "1039988800", "type": "people" } ] @@ -93,7 +93,7 @@ "projects": { "data": [ { - "id": "128", + "id": "1022252921", "type": "projects" } ] @@ -101,7 +101,7 @@ "investigations": { "data": [ { - "id": "13", + "id": "973655182", "type": "investigations" } ] @@ -109,7 +109,7 @@ "studies": { "data": [ { - "id": "13", + "id": "1060385211", "type": "studies" } ] @@ -117,7 +117,7 @@ "assays": { "data": [ { - "id": "13", + "id": "1035386954", "type": "assays" } ] @@ -130,21 +130,21 @@ "workflows": { "data": [ { - "id": "1", + "id": "250", "type": "workflows" } ] } }, "links": { - "self": "/sops/6?version=1" + "self": "/sops/1055250525?version=1" }, "meta": { - "created": "2022-06-07T14:12:40.000Z", - "modified": "2022-06-07T14:12:40.000Z", + "created": "2024-06-20T12:39:52.000Z", + "modified": "2024-06-20T12:39:52.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "d05fcab0-c899-013a-0f7e-0a81884ed284" + "uuid": "1d3e5240-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sopResponse.json b/public/api/examples/sopResponse.json index 79efaa3966..e1a45286f0 100644 --- a/public/api/examples/sopResponse.json +++ b/public/api/examples/sopResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "15", + "id": "1055250534", "type": "sops", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "14", + "id": "264", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/sops/15?version=1", + "url": "http://localhost:3000/sops/1055250534?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2022-06-07T14:12:52.000Z", - "updated_at": "2022-06-07T14:12:52.000Z", + "created_at": "2024-06-20T12:40:04.000Z", + "updated_at": "2024-06-20T12:40:04.000Z", "doi": null, "content_blobs": [ { @@ -47,13 +47,13 @@ "md5sum": "726de0a3f94d65056b909b9736e10349", "sha1sum": "fbcc0dee4b5415de4c82ef5b137d8231fec1331b", "content_type": "application/pdf", - "link": "http://localhost:3000/sops/15/content_blobs/88", + "link": "http://localhost:3000/sops/1055250534/content_blobs/1050453319", "size": 8 } ], "creators": [ { - "profile": "/people/201", + "profile": "/people/1039988888", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -66,7 +66,7 @@ "creators": { "data": [ { - "id": "201", + "id": "1039988888", "type": "people" } ] @@ -74,7 +74,7 @@ "submitter": { "data": [ { - "id": "202", + "id": "1039988889", "type": "people" } ] @@ -82,11 +82,11 @@ "people": { "data": [ { - "id": "201", + "id": "1039988888", "type": "people" }, { - "id": "202", + "id": "1039988889", "type": "people" } ] @@ -94,7 +94,7 @@ "projects": { "data": [ { - "id": "208", + "id": "1022253009", "type": "projects" } ] @@ -102,7 +102,7 @@ "investigations": { "data": [ { - "id": "31", + "id": "973655202", "type": "investigations" } ] @@ -110,7 +110,7 @@ "studies": { "data": [ { - "id": "29", + "id": "1060385229", "type": "studies" } ] @@ -118,7 +118,7 @@ "assays": { "data": [ { - "id": "27", + "id": "1035386970", "type": "assays" } ] @@ -126,7 +126,7 @@ "publications": { "data": [ { - "id": "10", + "id": "346", "type": "publications" } ] @@ -134,21 +134,21 @@ "workflows": { "data": [ { - "id": "7", + "id": "256", "type": "workflows" } ] } }, "links": { - "self": "/sops/15?version=1" + "self": "/sops/1055250534?version=1" }, "meta": { - "created": "2022-06-07T14:12:52.000Z", - "modified": "2022-06-07T14:12:52.000Z", + "created": "2024-06-20T12:40:03.000Z", + "modified": "2024-06-20T12:40:04.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "d7d1a740-c899-013a-0f7e-0a81884ed284" + "uuid": "2405a950-1130-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/sopsResponse.json b/public/api/examples/sopsResponse.json index 9c144829d0..4136bac780 100644 --- a/public/api/examples/sopsResponse.json +++ b/public/api/examples/sopsResponse.json @@ -1,23 +1,23 @@ { "data": [ { - "id": "10", + "id": "1055250529", "type": "sops", "attributes": { "title": "This Sop" }, "links": { - "self": "/sops/10" + "self": "/sops/1055250529" } }, { - "id": "9", + "id": "1055250528", "type": "sops", "attributes": { "title": "This Sop" }, "links": { - "self": "/sops/9" + "self": "/sops/1055250528" } } ], diff --git a/public/api/examples/studiesResponse.json b/public/api/examples/studiesResponse.json index 297e3862e1..72491c7a7f 100644 --- a/public/api/examples/studiesResponse.json +++ b/public/api/examples/studiesResponse.json @@ -1,13 +1,13 @@ { "data": [ { - "id": "3086", + "id": "1060385027", "type": "studies", "attributes": { - "title": "Study49" + "title": "Study469" }, "links": { - "self": "/studies/3086" + "self": "/studies/1060385027" } } ], diff --git a/public/api/examples/studyPatch.json b/public/api/examples/studyPatch.json index 5b0327caf0..16c1c55bd2 100644 --- a/public/api/examples/studyPatch.json +++ b/public/api/examples/studyPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "studies", - "id": "3096", + "id": "1060385037", "attributes": { "title": "A Maximal Study", "description": "The Study of many things", @@ -12,7 +12,7 @@ "permissions": [ { "resource": { - "id": "11830", + "id": "1022251755", "type": "projects" }, "access": "view" @@ -20,7 +20,7 @@ ] }, "extended_attributes": { - "extended_metadata_type_id": "940", + "extended_metadata_type_id": "308", "attribute_map": { "name": "Fred Bloggs", "age": 44, @@ -31,14 +31,14 @@ "relationships": { "investigation": { "data": { - "id": "4131", + "id": "973655004", "type": "investigations" } }, "publications": { "data": [ { - "id": "1531", + "id": "268", "type": "publications" } ] @@ -46,7 +46,7 @@ "creators": { "data": [ { - "id": "10375", + "id": "1039987655", "type": "people" } ] diff --git a/public/api/examples/studyPatchResponse.json b/public/api/examples/studyPatchResponse.json index ef367a22eb..76ca6abaac 100644 --- a/public/api/examples/studyPatchResponse.json +++ b/public/api/examples/studyPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "3096", + "id": "1060385037", "type": "studies", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "11830", + "id": "1022251755", "type": "projects" }, "access": "view" @@ -19,7 +19,7 @@ ], "extended_attributes": { - "extended_metadata_type_id": "940", + "extended_metadata_type_id": "308", "attribute_map": { "age": 44, "name": "Fred Bloggs", @@ -36,10 +36,10 @@ "position": null, "creators": [ { - "profile": "/people/10375", + "profile": "/people/1039987655", "family_name": "Last", - "given_name": "Person138", - "affiliation": "An Institution: 173", + "given_name": "Person2639", + "affiliation": "An Institution: 3314", "orcid": null } ] @@ -48,7 +48,7 @@ "creators": { "data": [ { - "id": "10375", + "id": "1039987655", "type": "people" } ] @@ -56,7 +56,7 @@ "submitter": { "data": [ { - "id": "10375", + "id": "1039987655", "type": "people" } ] @@ -64,7 +64,7 @@ "people": { "data": [ { - "id": "10375", + "id": "1039987655", "type": "people" } ] @@ -72,14 +72,14 @@ "projects": { "data": [ { - "id": "11830", + "id": "1022251755", "type": "projects" } ] }, "investigation": { "data": { - "id": "4131", + "id": "973655004", "type": "investigations" } }, @@ -106,7 +106,7 @@ "publications": { "data": [ { - "id": "1531", + "id": "268", "type": "publications" } ] @@ -118,14 +118,14 @@ } }, "links": { - "self": "/studies/3096" + "self": "/studies/1060385037" }, "meta": { - "created": "2024-03-15T10:03:27.000Z", - "modified": "2024-03-15T10:03:27.000Z", + "created": "2024-06-20T12:37:18.000Z", + "modified": "2024-06-20T12:37:18.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "31299a30-c4e1-013c-640d-7efdca78d793" + "uuid": "c12f3e20-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/studyPost.json b/public/api/examples/studyPost.json index 6b7cf7cbf1..4d9507a55e 100644 --- a/public/api/examples/studyPost.json +++ b/public/api/examples/studyPost.json @@ -11,7 +11,7 @@ "permissions": [ { "resource": { - "id": "11779", + "id": "1022251704", "type": "projects" }, "access": "view" @@ -19,7 +19,7 @@ ] }, "extended_attributes": { - "extended_metadata_type_id": "935", + "extended_metadata_type_id": "303", "attribute_map": { "name": "Fred Bloggs", "age": 44, @@ -30,14 +30,14 @@ "relationships": { "investigation": { "data": { - "id": "4110", + "id": "973654983", "type": "investigations" } }, "publications": { "data": [ { - "id": "1526", + "id": "263", "type": "publications" } ] @@ -45,7 +45,7 @@ "creators": { "data": [ { - "id": "10329", + "id": "1039987609", "type": "people" } ] diff --git a/public/api/examples/studyPostResponse.json b/public/api/examples/studyPostResponse.json index 3038b57a85..32c8e6e958 100644 --- a/public/api/examples/studyPostResponse.json +++ b/public/api/examples/studyPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "3078", + "id": "1060385019", "type": "studies", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "11779", + "id": "1022251704", "type": "projects" }, "access": "view" @@ -19,7 +19,7 @@ ], "extended_attributes": { - "extended_metadata_type_id": "935", + "extended_metadata_type_id": "303", "attribute_map": { "age": 44, "name": "Fred Bloggs", @@ -36,10 +36,10 @@ "position": null, "creators": [ { - "profile": "/people/10329", + "profile": "/people/1039987609", "family_name": "Last", - "given_name": "Person99", - "affiliation": "An Institution: 127", + "given_name": "Person2600", + "affiliation": "An Institution: 3268", "orcid": null } ] @@ -48,7 +48,7 @@ "creators": { "data": [ { - "id": "10329", + "id": "1039987609", "type": "people" } ] @@ -56,7 +56,7 @@ "submitter": { "data": [ { - "id": "10329", + "id": "1039987609", "type": "people" } ] @@ -64,7 +64,7 @@ "people": { "data": [ { - "id": "10329", + "id": "1039987609", "type": "people" } ] @@ -72,14 +72,14 @@ "projects": { "data": [ { - "id": "11779", + "id": "1022251704", "type": "projects" } ] }, "investigation": { "data": { - "id": "4110", + "id": "973654983", "type": "investigations" } }, @@ -106,7 +106,7 @@ "publications": { "data": [ { - "id": "1526", + "id": "263", "type": "publications" } ] @@ -118,14 +118,14 @@ } }, "links": { - "self": "/studies/3078" + "self": "/studies/1060385019" }, "meta": { - "created": "2024-03-15T10:03:23.000Z", - "modified": "2024-03-15T10:03:23.000Z", + "created": "2024-06-20T12:37:11.000Z", + "modified": "2024-06-20T12:37:11.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "2f175c70-c4e1-013c-640d-7efdca78d793" + "uuid": "bd177b10-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/studyResponse.json b/public/api/examples/studyResponse.json index 8ad45d9701..c9eefe7983 100644 --- a/public/api/examples/studyResponse.json +++ b/public/api/examples/studyResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "3095", + "id": "1060385036", "type": "studies", "attributes": { "policy": { @@ -11,13 +11,13 @@ }, "discussion_links": [ { - "id": "507", + "id": "205", "label": "Slack", "url": "http://www.slack.com/" } ], "extended_attributes": { - "extended_metadata_type_id": "939", + "extended_metadata_type_id": "307", "attribute_map": { "age": 44, "name": "Fred Bloggs", @@ -34,7 +34,7 @@ "position": null, "creators": [ { - "profile": "/people/10358", + "profile": "/people/1039987638", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -46,7 +46,7 @@ "creators": { "data": [ { - "id": "10358", + "id": "1039987638", "type": "people" } ] @@ -54,7 +54,7 @@ "submitter": { "data": [ { - "id": "10356", + "id": "1039987636", "type": "people" } ] @@ -62,11 +62,11 @@ "people": { "data": [ { - "id": "10356", + "id": "1039987636", "type": "people" }, { - "id": "10358", + "id": "1039987638", "type": "people" } ] @@ -74,21 +74,21 @@ "projects": { "data": [ { - "id": "11810", + "id": "1022251735", "type": "projects" } ] }, "investigation": { "data": { - "id": "4124", + "id": "973654997", "type": "investigations" } }, "assays": { "data": [ { - "id": "1498", + "id": "1035386783", "type": "assays" } ] @@ -96,7 +96,7 @@ "data_files": { "data": [ { - "id": "390", + "id": "883654357", "type": "data_files" } ] @@ -104,7 +104,7 @@ "models": { "data": [ { - "id": "511", + "id": "1004285512", "type": "models" } ] @@ -112,7 +112,7 @@ "sops": { "data": [ { - "id": "372", + "id": "1055250477", "type": "sops" } ] @@ -120,7 +120,7 @@ "publications": { "data": [ { - "id": "1530", + "id": "267", "type": "publications" } ] @@ -128,21 +128,21 @@ "documents": { "data": [ { - "id": "442", + "id": "263", "type": "documents" } ] } }, "links": { - "self": "/studies/3095" + "self": "/studies/1060385036" }, "meta": { - "created": "2024-03-15T10:03:27.000Z", - "modified": "2024-03-15T10:03:27.000Z", + "created": "2024-06-20T12:37:17.000Z", + "modified": "2024-06-20T12:37:17.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "3100d260-c4e1-013c-640d-7efdca78d793" + "uuid": "c0e05a40-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/workflowPatch.json b/public/api/examples/workflowPatch.json index 44ff553325..edffe1c0f7 100644 --- a/public/api/examples/workflowPatch.json +++ b/public/api/examples/workflowPatch.json @@ -1,7 +1,7 @@ { "data": { "type": "workflows", - "id": "110", + "id": "179", "attributes": { "title": "A Maximally Patched Workflow", "description": "A workflow to do important stuff", @@ -46,7 +46,7 @@ "permissions": [ { "resource": { - "id": "409", + "id": "1022251551", "type": "projects" }, "access": "edit" @@ -58,7 +58,7 @@ "creators": { "data": [ { - "id": "400", + "id": "1039987481", "type": "people" } ] @@ -66,7 +66,7 @@ "projects": { "data": [ { - "id": "409", + "id": "1022251551", "type": "projects" } ] @@ -74,7 +74,7 @@ "assays": { "data": [ { - "id": "85", + "id": "1035386753", "type": "assays" } ] @@ -82,7 +82,7 @@ "publications": { "data": [ { - "id": "85", + "id": "238", "type": "publications" } ] @@ -90,7 +90,7 @@ "presentations": { "data": [ { - "id": "75", + "id": "114", "type": "presentations" } ] @@ -98,7 +98,7 @@ "data_files": { "data": [ { - "id": "75", + "id": "883654352", "type": "data_files" } ] @@ -106,7 +106,7 @@ "documents": { "data": [ { - "id": "75", + "id": "258", "type": "documents" } ] @@ -114,7 +114,7 @@ "sops": { "data": [ { - "id": "75", + "id": "1055250472", "type": "sops" } ] diff --git a/public/api/examples/workflowPatchResponse.json b/public/api/examples/workflowPatchResponse.json index c34e8e956c..9c44252882 100644 --- a/public/api/examples/workflowPatchResponse.json +++ b/public/api/examples/workflowPatchResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "110", + "id": "179", "type": "workflows", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "409", + "id": "1022251551", "type": "projects" }, "access": "edit" @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/workflows/110?version=1", + "url": "http://localhost:3000/workflows/179?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2023-06-14T10:43:21.000Z", - "updated_at": "2023-06-14T10:43:22.000Z", + "created_at": "2024-06-20T12:36:52.000Z", + "updated_at": "2024-06-20T12:36:52.000Z", "doi": null, "content_blobs": [ { @@ -47,16 +47,16 @@ "md5sum": "ef2ea32522098acc937199f6c2b64f41", "sha1sum": "a5133ccdb0376324d039431e4eff4f7d21a751cd", "content_type": "application/x-yaml", - "link": "http://localhost:3000/workflows/110/content_blobs/420", + "link": "http://localhost:3000/workflows/179/content_blobs/1050452922", "size": 732 } ], "creators": [ { - "profile": "/people/400", + "profile": "/people/1039987481", "family_name": "Last", - "given_name": "Person108", - "affiliation": "An Institution: 137", + "given_name": "Person2500", + "affiliation": "An Institution: 3140", "orcid": null } ], @@ -99,7 +99,7 @@ "creators": { "data": [ { - "id": "400", + "id": "1039987481", "type": "people" } ] @@ -107,7 +107,7 @@ "submitter": { "data": [ { - "id": "399", + "id": "1039987480", "type": "people" } ] @@ -115,11 +115,11 @@ "people": { "data": [ { - "id": "399", + "id": "1039987480", "type": "people" }, { - "id": "400", + "id": "1039987481", "type": "people" } ] @@ -127,7 +127,7 @@ "projects": { "data": [ { - "id": "409", + "id": "1022251551", "type": "projects" } ] @@ -135,7 +135,7 @@ "investigations": { "data": [ { - "id": "85", + "id": "973654915", "type": "investigations" } ] @@ -143,7 +143,7 @@ "studies": { "data": [ { - "id": "85", + "id": "1060384969", "type": "studies" } ] @@ -151,7 +151,7 @@ "assays": { "data": [ { - "id": "85", + "id": "1035386753", "type": "assays" } ] @@ -159,7 +159,7 @@ "publications": { "data": [ { - "id": "85", + "id": "238", "type": "publications" } ] @@ -167,7 +167,7 @@ "sops": { "data": [ { - "id": "75", + "id": "1055250472", "type": "sops" } ] @@ -175,7 +175,7 @@ "presentations": { "data": [ { - "id": "75", + "id": "114", "type": "presentations" } ] @@ -183,7 +183,7 @@ "data_files": { "data": [ { - "id": "75", + "id": "883654352", "type": "data_files" } ] @@ -191,21 +191,21 @@ "documents": { "data": [ { - "id": "75", + "id": "258", "type": "documents" } ] } }, "links": { - "self": "/workflows/110?version=1" + "self": "/workflows/179?version=1" }, "meta": { - "created": "2023-06-14T10:43:21.000Z", - "modified": "2023-06-14T10:43:22.000Z", + "created": "2024-06-20T12:36:52.000Z", + "modified": "2024-06-20T12:36:52.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "34cbd200-ecce-013b-a2d8-000c29a94011" + "uuid": "b1d47590-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/workflowPost.json b/public/api/examples/workflowPost.json index 01e930043c..871af9edc2 100644 --- a/public/api/examples/workflowPost.json +++ b/public/api/examples/workflowPost.json @@ -50,7 +50,7 @@ "permissions": [ { "resource": { - "id": "378", + "id": "1022251520", "type": "projects" }, "access": "edit" @@ -62,7 +62,7 @@ "creators": { "data": [ { - "id": "371", + "id": "1039987452", "type": "people" } ] @@ -70,7 +70,7 @@ "projects": { "data": [ { - "id": "378", + "id": "1022251520", "type": "projects" } ] @@ -78,7 +78,7 @@ "assays": { "data": [ { - "id": "80", + "id": "1035386748", "type": "assays" } ] @@ -86,7 +86,7 @@ "publications": { "data": [ { - "id": "80", + "id": "233", "type": "publications" } ] @@ -94,7 +94,7 @@ "presentations": { "data": [ { - "id": "72", + "id": "111", "type": "presentations" } ] @@ -102,7 +102,7 @@ "data_files": { "data": [ { - "id": "72", + "id": "883654349", "type": "data_files" } ] @@ -110,7 +110,7 @@ "documents": { "data": [ { - "id": "72", + "id": "255", "type": "documents" } ] @@ -118,7 +118,7 @@ "sops": { "data": [ { - "id": "72", + "id": "1055250469", "type": "sops" } ] diff --git a/public/api/examples/workflowPostResponse.json b/public/api/examples/workflowPostResponse.json index b5018f3525..d22963ba0f 100644 --- a/public/api/examples/workflowPostResponse.json +++ b/public/api/examples/workflowPostResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "104", + "id": "173", "type": "workflows", "attributes": { "policy": { @@ -8,7 +8,7 @@ "permissions": [ { "resource": { - "id": "378", + "id": "1022251520", "type": "projects" }, "access": "edit" @@ -30,14 +30,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/workflows/104?version=1", + "url": "http://localhost:3000/workflows/173?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2023-06-14T10:43:17.000Z", - "updated_at": "2023-06-14T10:43:17.000Z", + "created_at": "2024-06-20T12:36:47.000Z", + "updated_at": "2024-06-20T12:36:47.000Z", "doi": null, "content_blobs": [ { @@ -46,16 +46,16 @@ "md5sum": null, "sha1sum": null, "content_type": "application/x-yaml", - "link": "http://localhost:3000/workflows/104/content_blobs/400", + "link": "http://localhost:3000/workflows/173/content_blobs/1050452902", "size": null } ], "creators": [ { - "profile": "/people/371", + "profile": "/people/1039987452", "family_name": "Last", - "given_name": "Person84", - "affiliation": "An Institution: 108", + "given_name": "Person2476", + "affiliation": "An Institution: 3111", "orcid": null } ], @@ -98,7 +98,7 @@ "creators": { "data": [ { - "id": "371", + "id": "1039987452", "type": "people" } ] @@ -106,7 +106,7 @@ "submitter": { "data": [ { - "id": "370", + "id": "1039987451", "type": "people" } ] @@ -114,11 +114,11 @@ "people": { "data": [ { - "id": "370", + "id": "1039987451", "type": "people" }, { - "id": "371", + "id": "1039987452", "type": "people" } ] @@ -126,7 +126,7 @@ "projects": { "data": [ { - "id": "378", + "id": "1022251520", "type": "projects" } ] @@ -134,7 +134,7 @@ "investigations": { "data": [ { - "id": "80", + "id": "973654910", "type": "investigations" } ] @@ -142,7 +142,7 @@ "studies": { "data": [ { - "id": "80", + "id": "1060384964", "type": "studies" } ] @@ -150,7 +150,7 @@ "assays": { "data": [ { - "id": "80", + "id": "1035386748", "type": "assays" } ] @@ -158,7 +158,7 @@ "publications": { "data": [ { - "id": "80", + "id": "233", "type": "publications" } ] @@ -166,7 +166,7 @@ "sops": { "data": [ { - "id": "72", + "id": "1055250469", "type": "sops" } ] @@ -174,7 +174,7 @@ "presentations": { "data": [ { - "id": "72", + "id": "111", "type": "presentations" } ] @@ -182,7 +182,7 @@ "data_files": { "data": [ { - "id": "72", + "id": "883654349", "type": "data_files" } ] @@ -190,21 +190,21 @@ "documents": { "data": [ { - "id": "72", + "id": "255", "type": "documents" } ] } }, "links": { - "self": "/workflows/104?version=1" + "self": "/workflows/173?version=1" }, "meta": { - "created": "2023-06-14T10:43:17.000Z", - "modified": "2023-06-14T10:43:17.000Z", + "created": "2024-06-20T12:36:47.000Z", + "modified": "2024-06-20T12:36:47.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "326333b0-ecce-013b-a2d8-000c29a94011" + "uuid": "af121740-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/public/api/examples/workflowResponse.json b/public/api/examples/workflowResponse.json index db9cb1b572..c552256018 100644 --- a/public/api/examples/workflowResponse.json +++ b/public/api/examples/workflowResponse.json @@ -1,6 +1,6 @@ { "data": { - "id": "109", + "id": "178", "type": "workflows", "attributes": { "policy": { @@ -11,7 +11,7 @@ }, "discussion_links": [ { - "id": "10", + "id": "195", "label": "Slack", "url": "http://www.slack.com/" } @@ -31,14 +31,14 @@ { "version": 1, "revision_comments": null, - "url": "http://localhost:3000/workflows/109?version=1", + "url": "http://localhost:3000/workflows/178?version=1", "doi": null } ], "version": 1, "revision_comments": null, - "created_at": "2023-06-14T10:43:21.000Z", - "updated_at": "2023-06-14T10:43:21.000Z", + "created_at": "2024-06-20T12:36:51.000Z", + "updated_at": "2024-06-20T12:36:51.000Z", "doi": null, "content_blobs": [ { @@ -47,13 +47,13 @@ "md5sum": "ef2ea32522098acc937199f6c2b64f41", "sha1sum": "a5133ccdb0376324d039431e4eff4f7d21a751cd", "content_type": "application/x-yaml", - "link": "http://localhost:3000/workflows/109/content_blobs/415", + "link": "http://localhost:3000/workflows/178/content_blobs/1050452917", "size": 732 } ], "creators": [ { - "profile": "/people/396", + "profile": "/people/1039987477", "family_name": "One", "given_name": "Some", "affiliation": "University of Somewhere", @@ -99,7 +99,7 @@ "creators": { "data": [ { - "id": "396", + "id": "1039987477", "type": "people" } ] @@ -107,7 +107,7 @@ "submitter": { "data": [ { - "id": "397", + "id": "1039987478", "type": "people" } ] @@ -115,11 +115,11 @@ "people": { "data": [ { - "id": "396", + "id": "1039987477", "type": "people" }, { - "id": "397", + "id": "1039987478", "type": "people" } ] @@ -127,7 +127,7 @@ "projects": { "data": [ { - "id": "407", + "id": "1022251549", "type": "projects" } ] @@ -135,7 +135,7 @@ "investigations": { "data": [ { - "id": "84", + "id": "973654914", "type": "investigations" } ] @@ -143,7 +143,7 @@ "studies": { "data": [ { - "id": "84", + "id": "1060384968", "type": "studies" } ] @@ -151,7 +151,7 @@ "assays": { "data": [ { - "id": "84", + "id": "1035386752", "type": "assays" } ] @@ -159,7 +159,7 @@ "publications": { "data": [ { - "id": "84", + "id": "237", "type": "publications" } ] @@ -186,14 +186,14 @@ } }, "links": { - "self": "/workflows/109?version=1" + "self": "/workflows/178?version=1" }, "meta": { - "created": "2023-06-14T10:43:21.000Z", - "modified": "2023-06-14T10:43:21.000Z", + "created": "2024-06-20T12:36:51.000Z", + "modified": "2024-06-20T12:36:51.000Z", "api_version": "0.3", "base_url": "http://localhost:3000", - "uuid": "3440eef0-ecce-013b-a2d8-000c29a94011" + "uuid": "b13a3450-112f-013d-1f9d-0a81884ed284" } }, "jsonapi": { diff --git a/test/factories/sample_attributes.rb b/test/factories/sample_attributes.rb index de36f107c7..9aad6646f9 100644 --- a/test/factories/sample_attributes.rb +++ b/test/factories/sample_attributes.rb @@ -50,7 +50,7 @@ factory(:string_sample_attribute_with_description_and_pid, parent: :sample_attribute) do association :sample_attribute_type, factory: :string_sample_attribute_type description { "sample_attribute_description" } - pid { "sample_attribute:pid" } + pid { "sample-attribute:pid" } required { true } end end diff --git a/test/fixtures/files/mocking/nfcore_pipelines_trunc.json b/test/fixtures/files/mocking/nfcore_pipelines_trunc.json index f8866a417b..05bc516e8c 100644 --- a/test/fixtures/files/mocking/nfcore_pipelines_trunc.json +++ b/test/fixtures/files/mocking/nfcore_pipelines_trunc.json @@ -1653,6 +1653,14 @@ } } ] + }, + { + "name": "archived", + "archived": true + }, + { + "name": "disabled", + "disabled": true } ] } \ No newline at end of file diff --git a/test/fixtures/files/upload_json_sample_type_template/invalid_attribute_type_templates.json b/test/fixtures/files/upload_json_sample_type_template/invalid_attribute_type_templates.json new file mode 100644 index 0000000000..8f1f30e98e --- /dev/null +++ b/test/fixtures/files/upload_json_sample_type_template/invalid_attribute_type_templates.json @@ -0,0 +1,41 @@ +{ + "data": [ + { + "metadata": { + "name": "Source - Invalid template", + "group": "ISA Test", + "group_order": 1, + "temporary_name": "1_Source - Invalid template", + "version": "1.0.0", + "isa_config": "isaconfig-default_v2015-07-02/studySample.xml", + "isa_measurement_type": null, + "isa_technology_type": null, + "isa_protocol_type": null, + "repo_schema_id": "none", + "organism": "any", + "level": "study source" + }, + "data": [ + { + "iri": null, + "name": "Source Name", + "description": "Sources are considered as the starting biological material used in a study.", + "dataType": "String attribute type 1", + "title": true, + "required": true, + "isaTag": "source" + }, + { + "iri": null, + "name": "Source Characteristic 1", + "description": "A characteristic of the source.", + "dataType": "Invalid String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "source_characteristic" + } + ] + } + ] +} diff --git a/test/fixtures/files/upload_json_sample_type_template/invalid_isa_tag_templates.json b/test/fixtures/files/upload_json_sample_type_template/invalid_isa_tag_templates.json new file mode 100644 index 0000000000..861d5f38ee --- /dev/null +++ b/test/fixtures/files/upload_json_sample_type_template/invalid_isa_tag_templates.json @@ -0,0 +1,41 @@ +{ + "data": [ + { + "metadata": { + "name": "Source - Invalid template", + "group": "ISA Test", + "group_order": 1, + "temporary_name": "1_Source - Invalid template", + "version": "1.0.0", + "isa_config": "isaconfig-default_v2015-07-02/studySample.xml", + "isa_measurement_type": null, + "isa_technology_type": null, + "isa_protocol_type": null, + "repo_schema_id": "none", + "organism": "any", + "level": "study source" + }, + "data": [ + { + "iri": null, + "name": "Source Name", + "description": "Sources are considered as the starting biological material used in a study.", + "dataType": "String attribute type 1", + "title": true, + "required": true, + "isaTag": "invalid_source" + }, + { + "iri": null, + "name": "Source Characteristic 1", + "description": "A characteristic of the source.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "source_characteristic" + } + ] + } + ] +} diff --git a/test/fixtures/files/upload_json_sample_type_template/test_templates.json b/test/fixtures/files/upload_json_sample_type_template/test_templates.json new file mode 100644 index 0000000000..ce4e2f20cc --- /dev/null +++ b/test/fixtures/files/upload_json_sample_type_template/test_templates.json @@ -0,0 +1,236 @@ +{ + "data": [ + { + "metadata": { + "name": "Source - ISA Test template", + "group": "ISA Test", + "group_order": 1, + "temporary_name": "1_Source - ISA Test template", + "version": "1.0.0", + "isa_config": "isaconfig-default_v2015-07-02/studySample.xml", + "isa_measurement_type": null, + "isa_technology_type": null, + "isa_protocol_type": null, + "repo_schema_id": "none", + "organism": "any", + "level": "study source" + }, + "data": [ + { + "iri": null, + "name": "Source Name", + "description": "Sources are considered as the starting biological material used in a study.", + "dataType": "String attribute type 1", + "title": true, + "required": true, + "isaTag": "source" + }, + { + "iri": null, + "name": "Source Characteristic 1", + "description": "A characteristic of the source.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "source_characteristic" + } + ] + }, + { + "metadata": { + "name": "Sample - ISA Test template", + "group": "ISA Test", + "group_order": 2, + "temporary_name": "2_Sample - ISA Test template", + "version": "1.0.0", + "isa_config": "isaconfig-default_v2015-07-02/studySample.xml", + "isa_measurement_type": "Sample", + "isa_technology_type": null, + "isa_protocol_type": "protocol with samples as outputs", + "repo_schema_id": "none", + "organism": "any", + "level": "study sample" + }, + "data": [ + { + "iri": null, + "name": "Input", + "description": "Registered Samples in the platform used as input for this protocol.", + "dataType": "Sample multi attribute type 1", + "required": true, + "isaTag": null + }, + { + "iri": null, + "name": "Name of a protocol with samples as outputs", + "description": "Type of experimental step that generates samples as outputs from the study sources.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "protocol" + }, + { + "iri": null, + "name": "Name of protocol parameter 1", + "description": "A parameter for the protocol.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "parameter_value" + }, + { + "iri": null, + "name": "Sample Name", + "description": "Samples are considered as biological material sampled from sources and used in the study.", + "dataType": "String attribute type 1", + "title": true, + "required": true, + "isaTag": "sample" + }, + { + "iri": null, + "name": "Sample Characteristic 1", + "description": "A characteristic of the sample.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "sample_characteristic" + } + ] + }, + { + "metadata": { + "name": "Material output assay - ISA Test template", + "group": "ISA Test", + "group_order": 3, + "temporary_name": "3_Material output assay - ISA Test template", + "version": "1.0.0", + "isa_config": "none", + "isa_measurement_type": "any", + "isa_technology_type": "any", + "isa_protocol_type": "protocol with material output", + "repo_schema_id": "none", + "organism": "any", + "level": "assay - material" + }, + "data": [ + { + "iri": null, + "name": "Input", + "description": "Registered Samples in the platform used as input for this protocol.", + "dataType": "Sample multi attribute type 1", + "required": true, + "isaTag": null + }, + { + "iri": null, + "name": "Name of a protocol with material output", + "description": "Type of assay or experimental step performed that generates a material output.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "protocol" + }, + { + "iri": null, + "name": "Name of protocol parameter 1", + "description": "A parameter for the protocol.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "parameter_value" + }, + { + "iri": null, + "name": "Output material Name", + "description": "Name of the major material output resulting from the application of the protocol.", + "dataType": "String attribute type 1", + "title": true, + "required": true, + "isaTag": "other_material" + }, + { + "iri": null, + "name": "Output material characteristic 1", + "description": "Characteristic 1 of the output material.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "other_material_characteristic" + } + ] + }, + { + "metadata": { + "name": "Data file output assay - ISA Test template", + "group": "ISA Test", + "group_order": 4, + "temporary_name": "4_Data file output assay - ISA Test template", + "version": "1.0.0", + "isa_config": "none", + "isa_measurement_type": "any", + "isa_technology_type": "any", + "isa_protocol_type": "protocol with data file output", + "repo_schema_id": "none", + "organism": "any", + "level": "assay - data file" + }, + "data": [ + { + "iri": null, + "name": "Input", + "description": "Registered Samples in the platform used as input for this protocol.", + "dataType": "Sample multi attribute type 1", + "required": true, + "isaTag": null + }, + { + "iri": null, + "name": "Name of a protocol with data file output", + "description": "Type of assay or experimental step performed that generates a data file output.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "protocol" + }, + { + "iri": null, + "name": "Name of protocol parameter 1", + "description": "A parameter for the protocol.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "data_file_comment" + }, + { + "iri": null, + "name": "Data file Name", + "description": "Name of the major data file output resulting from the application of the protocol.", + "dataType": "String attribute type 1", + "title": true, + "required": true, + "isaTag": "data_file" + }, + { + "iri": null, + "name": "Data file characteristic 1", + "description": "Characteristic 1 of the data file output.", + "dataType": "String attribute type 1", + "required": true, + "ontology": null, + "CVList": null, + "isaTag": "data_file_comment" + } + ] + } + ] +} diff --git a/test/fixtures/files/upload_single_page/03_combo_update_samples_spreadsheet.xlsx b/test/fixtures/files/upload_single_page/03_combo_update_samples_spreadsheet.xlsx index 357e00d721..18e3038622 100644 Binary files a/test/fixtures/files/upload_single_page/03_combo_update_samples_spreadsheet.xlsx and b/test/fixtures/files/upload_single_page/03_combo_update_samples_spreadsheet.xlsx differ diff --git a/test/fixtures/files/upload_single_page/04_combo_update_assay_samples_spreadsheet.xlsx b/test/fixtures/files/upload_single_page/04_combo_update_assay_samples_spreadsheet.xlsx index fbc99d30c1..2e29324ac6 100644 Binary files a/test/fixtures/files/upload_single_page/04_combo_update_assay_samples_spreadsheet.xlsx and b/test/fixtures/files/upload_single_page/04_combo_update_assay_samples_spreadsheet.xlsx differ diff --git a/test/fixtures/git/nf-core-rnaseq/_git/FETCH_HEAD b/test/fixtures/git/nf-core-rnaseq/_git/FETCH_HEAD index 007f9d59e1..4329f7922f 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/FETCH_HEAD +++ b/test/fixtures/git/nf-core-rnaseq/_git/FETCH_HEAD @@ -1,6 +1 @@ -88562f8745302ec159679369326c6db5e4bd6e3b not-for-merge branch 'TEMPLATE' of https://github.com/nf-core/rnaseq.git -825345ea0c17b3962066a181fc5b5e405bfee5aa not-for-merge branch 'dev' of https://github.com/nf-core/rnaseq.git -3643a94411b65f42bce5357c5015603099556ad9 not-for-merge branch 'master' of https://github.com/nf-core/rnaseq.git -ccfb140d0f21d144e65498edc098f89c0d66d961 not-for-merge branch 'nf-core-template-merge-1.13.2' of https://github.com/nf-core/rnaseq.git -88562f8745302ec159679369326c6db5e4bd6e3b not-for-merge branch 'nf-core-template-merge-1.13.3' of https://github.com/nf-core/rnaseq.git -5681aa9012608ed67c67073ccee07b27586ee36a not-for-merge branch 'pytest-workflow' of https://github.com/nf-core/rnaseq.git +b89fac32650aacc86fcda9ee77e00612a1d77066 branch 'master' of https://github.com/nf-core/rnaseq diff --git a/test/fixtures/git/nf-core-rnaseq/_git/ORIG_HEAD b/test/fixtures/git/nf-core-rnaseq/_git/ORIG_HEAD new file mode 100644 index 0000000000..cc7c16f3fc --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/ORIG_HEAD @@ -0,0 +1 @@ +3643a94411b65f42bce5357c5015603099556ad9 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/index b/test/fixtures/git/nf-core-rnaseq/_git/index new file mode 100644 index 0000000000..4e51a11ae8 Binary files /dev/null and b/test/fixtures/git/nf-core-rnaseq/_git/index differ diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/HEAD b/test/fixtures/git/nf-core-rnaseq/_git/logs/HEAD new file mode 100644 index 0000000000..bd08a33ee1 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/HEAD @@ -0,0 +1,2 @@ +3643a94411b65f42bce5357c5015603099556ad9 3643a94411b65f42bce5357c5015603099556ad9 Finn Bacall 1717586509 +0100 checkout: moving from master to master +3643a94411b65f42bce5357c5015603099556ad9 b89fac32650aacc86fcda9ee77e00612a1d77066 Finn Bacall 1717586512 +0100 pull origin master: Fast-forward diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/heads/master b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/heads/master new file mode 100644 index 0000000000..f9a647c9c6 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/heads/master @@ -0,0 +1 @@ +3643a94411b65f42bce5357c5015603099556ad9 b89fac32650aacc86fcda9ee77e00612a1d77066 Finn Bacall 1717586512 +0100 pull origin master: Fast-forward diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/TEMPLATE b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/TEMPLATE index a59049b106..fd18dddb9a 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/TEMPLATE +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/TEMPLATE @@ -1,2 +1,3 @@ 0000000000000000000000000000000000000000 e9f315d51e88f55398b21b4ff0f4d5e04a7c1dc4 Finn Bacall 1616508146 +0000 fetch origin e9f315d51e88f55398b21b4ff0f4d5e04a7c1dc4 88562f8745302ec159679369326c6db5e4bd6e3b Finn Bacall 1617012765 +0100 fetch origin +88562f8745302ec159679369326c6db5e4bd6e3b eecf64e1f291a1aedbb23d96e95a3cdadd4640dc Finn Bacall 1717582518 +0100 fetch: fast-forward diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/arm b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/arm new file mode 100644 index 0000000000..4107e477eb --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/arm @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 d2f00635cee40ea206e53d2e49a7119bc9482307 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/change_testing_logic b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/change_testing_logic new file mode 100644 index 0000000000..962c24500e --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/change_testing_logic @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 21fe86c80fa9e57144522944a01405f95c7e58b0 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/dev b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/dev index 387e8ebbd9..27a7e6eb94 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/dev +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/dev @@ -1 +1,2 @@ 0000000000000000000000000000000000000000 825345ea0c17b3962066a181fc5b5e405bfee5aa Finn Bacall 1616508146 +0000 fetch origin +825345ea0c17b3962066a181fc5b5e405bfee5aa 21095f381e70b4b73dc392c36318218044a8bc95 Finn Bacall 1717582518 +0100 fetch: fast-forward diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/document_fastp_sampling b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/document_fastp_sampling new file mode 100644 index 0000000000..993008b311 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/document_fastp_sampling @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 cdc8f53f3515b1a7e982006a1b2a282a9fdffafb Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/feat/implement-ci-nf-tests b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/feat/implement-ci-nf-tests new file mode 100644 index 0000000000..7582277c43 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/feat/implement-ci-nf-tests @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 31a9d622bbc4eeb285a2424c1af7938712b4f925 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_bbsplit_config b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_bbsplit_config new file mode 100644 index 0000000000..4aab44fada --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_bbsplit_config @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b5b728b9f36c650aea2245cfd893f7e2cfd8942a Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_gtf_unzip b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_gtf_unzip new file mode 100644 index 0000000000..d165b7d345 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_gtf_unzip @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 f018a0cf87c634a6a2eeb34d64a554a6fa852be0 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_salmon_args b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_salmon_args new file mode 100644 index 0000000000..dc45c695d2 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/fix_salmon_args @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 5bef11b969acb2f2091eb6c84745580b5f70b527 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/improve_rseqc_strandedness b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/improve_rseqc_strandedness new file mode 100644 index 0000000000..0b533dd975 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/improve_rseqc_strandedness @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 5ce89ae977e4017c63f6887034c469dae54ca763 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/master b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/master index f31dc14ed9..ec33116496 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/master +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/master @@ -1 +1,2 @@ 0000000000000000000000000000000000000000 3643a94411b65f42bce5357c5015603099556ad9 Finn Bacall 1616508146 +0000 fetch origin +3643a94411b65f42bce5357c5015603099556ad9 b89fac32650aacc86fcda9ee77e00612a1d77066 Finn Bacall 1717582518 +0100 fetch: fast-forward diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/nf-test-cicd b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/nf-test-cicd new file mode 100644 index 0000000000..0227a86d9b --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/nf-test-cicd @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 6694d694f9b43fb59b73d79b04e1cdbaf3d67ce2 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/optimized-resources b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/optimized-resources new file mode 100644 index 0000000000..7b62989ed3 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/optimized-resources @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 4ab3ecb3cfd734fcd149ee0a00a98b8da0c37ff2 Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/update_default_pipeline_test b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/update_default_pipeline_test new file mode 100644 index 0000000000..15365ecba2 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/logs/refs/remotes/origin/update_default_pipeline_test @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b264499527af3b4c349f258d38c31759d7497c8e Finn Bacall 1717582518 +0100 fetch: storing head diff --git a/test/fixtures/git/nf-core-rnaseq/_git/objects/pack/pack-6e198e3e69261a07440f01e7393b0d0cfb8f9dc9.idx b/test/fixtures/git/nf-core-rnaseq/_git/objects/pack/pack-6e198e3e69261a07440f01e7393b0d0cfb8f9dc9.idx new file mode 100644 index 0000000000..5197d77de9 Binary files /dev/null and b/test/fixtures/git/nf-core-rnaseq/_git/objects/pack/pack-6e198e3e69261a07440f01e7393b0d0cfb8f9dc9.idx differ diff --git a/test/fixtures/git/nf-core-rnaseq/_git/objects/pack/pack-6e198e3e69261a07440f01e7393b0d0cfb8f9dc9.pack b/test/fixtures/git/nf-core-rnaseq/_git/objects/pack/pack-6e198e3e69261a07440f01e7393b0d0cfb8f9dc9.pack new file mode 100644 index 0000000000..41c1e6dc85 Binary files /dev/null and b/test/fixtures/git/nf-core-rnaseq/_git/objects/pack/pack-6e198e3e69261a07440f01e7393b0d0cfb8f9dc9.pack differ diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/heads/master b/test/fixtures/git/nf-core-rnaseq/_git/refs/heads/master index cc7c16f3fc..a8e22ca647 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/refs/heads/master +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/heads/master @@ -1 +1 @@ -3643a94411b65f42bce5357c5015603099556ad9 +b89fac32650aacc86fcda9ee77e00612a1d77066 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/TEMPLATE b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/TEMPLATE index 21be2fdf54..36f6416103 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/TEMPLATE +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/TEMPLATE @@ -1 +1 @@ -88562f8745302ec159679369326c6db5e4bd6e3b +eecf64e1f291a1aedbb23d96e95a3cdadd4640dc diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/arm b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/arm new file mode 100644 index 0000000000..f703a48f42 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/arm @@ -0,0 +1 @@ +d2f00635cee40ea206e53d2e49a7119bc9482307 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/change_testing_logic b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/change_testing_logic new file mode 100644 index 0000000000..30839514e8 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/change_testing_logic @@ -0,0 +1 @@ +21fe86c80fa9e57144522944a01405f95c7e58b0 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/dev b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/dev index 5bb8efaa51..586c90b3cb 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/dev +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/dev @@ -1 +1 @@ -825345ea0c17b3962066a181fc5b5e405bfee5aa +21095f381e70b4b73dc392c36318218044a8bc95 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/document_fastp_sampling b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/document_fastp_sampling new file mode 100644 index 0000000000..dc7a88f54d --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/document_fastp_sampling @@ -0,0 +1 @@ +cdc8f53f3515b1a7e982006a1b2a282a9fdffafb diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/feat/implement-ci-nf-tests b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/feat/implement-ci-nf-tests new file mode 100644 index 0000000000..63b9ab761a --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/feat/implement-ci-nf-tests @@ -0,0 +1 @@ +31a9d622bbc4eeb285a2424c1af7938712b4f925 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_bbsplit_config b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_bbsplit_config new file mode 100644 index 0000000000..c533888961 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_bbsplit_config @@ -0,0 +1 @@ +b5b728b9f36c650aea2245cfd893f7e2cfd8942a diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_gtf_unzip b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_gtf_unzip new file mode 100644 index 0000000000..843a7ac5ec --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_gtf_unzip @@ -0,0 +1 @@ +f018a0cf87c634a6a2eeb34d64a554a6fa852be0 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_salmon_args b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_salmon_args new file mode 100644 index 0000000000..3d2a8db294 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/fix_salmon_args @@ -0,0 +1 @@ +5bef11b969acb2f2091eb6c84745580b5f70b527 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/improve_rseqc_strandedness b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/improve_rseqc_strandedness new file mode 100644 index 0000000000..41e5ef370f --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/improve_rseqc_strandedness @@ -0,0 +1 @@ +5ce89ae977e4017c63f6887034c469dae54ca763 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/master b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/master index cc7c16f3fc..a8e22ca647 100644 --- a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/master +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/master @@ -1 +1 @@ -3643a94411b65f42bce5357c5015603099556ad9 +b89fac32650aacc86fcda9ee77e00612a1d77066 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/nf-test-cicd b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/nf-test-cicd new file mode 100644 index 0000000000..7b056de374 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/nf-test-cicd @@ -0,0 +1 @@ +6694d694f9b43fb59b73d79b04e1cdbaf3d67ce2 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/optimized-resources b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/optimized-resources new file mode 100644 index 0000000000..437417091b --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/optimized-resources @@ -0,0 +1 @@ +4ab3ecb3cfd734fcd149ee0a00a98b8da0c37ff2 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/update_default_pipeline_test b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/update_default_pipeline_test new file mode 100644 index 0000000000..476e51b376 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/remotes/origin/update_default_pipeline_test @@ -0,0 +1 @@ +b264499527af3b4c349f258d38c31759d7497c8e diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.1 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.1 new file mode 100644 index 0000000000..5cd4dee89b --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.1 @@ -0,0 +1 @@ +0fcbb0ac491ecb8a80ef879c4f3dad5f869021f9 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.10 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.10 new file mode 100644 index 0000000000..182e69e387 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.10 @@ -0,0 +1 @@ +adce7ce9abc8f6b338b4f53d0d988ff9a0fd52ff diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.10.1 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.10.1 new file mode 100644 index 0000000000..9977e05a14 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.10.1 @@ -0,0 +1 @@ +6e1e448f535ccf34d11cc691bb241cfd6e60a647 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.0 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.0 new file mode 100644 index 0000000000..feded18c08 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.0 @@ -0,0 +1 @@ +48fb9b4ea640f029f48c79283217d0f20661d38e diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.1 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.1 new file mode 100644 index 0000000000..85fbb9be4b --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.1 @@ -0,0 +1 @@ +287afcfe30a93de77e9b7cf70a1085f58c9525d8 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.2 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.2 new file mode 100644 index 0000000000..853568c181 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.11.2 @@ -0,0 +1 @@ +5671b65af97fe78a2f9b4d05d850304918b1b86e diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.12.0 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.12.0 new file mode 100644 index 0000000000..5c009a8bd2 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.12.0 @@ -0,0 +1 @@ +3bec2331cac2b5ff88a1dc71a21fab6529b57a0f diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.0 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.0 new file mode 100644 index 0000000000..805ce1ee9e --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.0 @@ -0,0 +1 @@ +14f9d26444e08da7b51ddcb1b8c4e0703edde375 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.1 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.1 new file mode 100644 index 0000000000..61a450c37e --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.1 @@ -0,0 +1 @@ +b59e87a54eae60e02f9ae12e3b9c9c59959328d7 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.2 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.2 new file mode 100644 index 0000000000..9f7c55e0c5 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.13.2 @@ -0,0 +1 @@ +a10f41afa204538d5dcc89a5910c299d68f94f41 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.14.0 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.14.0 new file mode 100644 index 0000000000..a8e22ca647 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.14.0 @@ -0,0 +1 @@ +b89fac32650aacc86fcda9ee77e00612a1d77066 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.2 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.2 new file mode 100644 index 0000000000..3f0f40d031 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.2 @@ -0,0 +1 @@ +b3ff92bc54363faf17d820689a8e9074ffd99045 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.3 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.3 new file mode 100644 index 0000000000..38e074daac --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.3 @@ -0,0 +1 @@ +8094c42add6dcdf69ce54dfdec957789c37ae903 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.4 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.4 new file mode 100644 index 0000000000..0db831deca --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.4 @@ -0,0 +1 @@ +964425e3fd8bfc3dc7bce43279a98d17a874d3f7 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.5 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.5 new file mode 100644 index 0000000000..5c93b16583 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.5 @@ -0,0 +1 @@ +646723c70f04ee6d66391758b02822d4f0fe2966 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.6 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.6 new file mode 100644 index 0000000000..5a9cea3ead --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.6 @@ -0,0 +1 @@ +7106bd792b3fb04f9f09b4e737165fa4e736ea81 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.7 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.7 new file mode 100644 index 0000000000..6bca59c07e --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.7 @@ -0,0 +1 @@ +e0dfce9af5c2299bcc2b8a74b6559ce055965455 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.8 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.8 new file mode 100644 index 0000000000..28bfbd2f93 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.8 @@ -0,0 +1 @@ +6995330476244a6bffe55ddcbe50b8ed5cf6c2e2 diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.8.1 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.8.1 new file mode 100644 index 0000000000..489476ffc7 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.8.1 @@ -0,0 +1 @@ +89bf536ce4faa98b4d50a8ec0a0343780bc62e0a diff --git a/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.9 b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.9 new file mode 100644 index 0000000000..49a7752466 --- /dev/null +++ b/test/fixtures/git/nf-core-rnaseq/_git/refs/tags/3.9 @@ -0,0 +1 @@ +e049f51f0214b2aef7624b9dd496a404a7c34d14 diff --git a/test/functional/git_repositories_controller_test.rb b/test/functional/git_repositories_controller_test.rb index dfb3dbdd8d..f105f85190 100644 --- a/test/functional/git_repositories_controller_test.rb +++ b/test/functional/git_repositories_controller_test.rb @@ -51,12 +51,13 @@ class GitRepositoriesControllerTest < ActionController::TestCase "ref" => "refs/remotes/origin/symlink", "sha" => "728337a507db00b8b8ba9979330a4f53d6d43b18"}], "tags" => - [{ "name" => "v0.01", - "ref" => "refs/tags/v0.01", - "sha" => "3f2c23e92da3ccbc89d7893b4af6039e66bdaaaf" }, - { "name" => "v0.02", + [{ "name" => "v0.02", "ref" => "refs/tags/v0.02", - "sha" => "94ae9926a824ebe809a9e9103cbdb1d5c5f98608" }] } + "sha" => "94ae9926a824ebe809a9e9103cbdb1d5c5f98608" }, + { "name" => "v0.01", + "ref" => "refs/tags/v0.01", + "sha" => "3f2c23e92da3ccbc89d7893b4af6039e66bdaaaf" } + ]} assert_equal expected, res end diff --git a/test/functional/homes_controller_test.rb b/test/functional/homes_controller_test.rb index 1240267048..7798174efe 100644 --- a/test/functional/homes_controller_test.rb +++ b/test/functional/homes_controller_test.rb @@ -719,6 +719,54 @@ class HomesControllerTest < ActionController::TestCase end + test 'Show aliases in search options' do + original_load_path = I18n.load_path + I18n.load_path += Dir[Rails.root.join('test', 'config', 'translation_override.en.yml')] + I18n.backend.load_translations + with_config_values({ isa_json_compliance_enabled: true, solr_enabled: true }) do + get :index + assert_response :success + assert_select 'select#search_type' do + assert_select 'option', text: 'Investigation tests', count: 1 + assert_select 'option', text: 'Study tests', count: 1 + assert_select 'option', text: 'Assay tests', count: 1 + assert_select 'option', text: 'Data file tests', count: 1 + assert_select 'option', text: 'Document tests', count: 1 + assert_select 'option', text: 'SOP_test', count: 1 # this is an exception, the alias is not in the translation file + assert_select 'option', text: 'Presentation tests', count: 1 + assert_select 'option', text: 'Event tests', count: 1 + assert_select 'option', text: 'Collection tests', count: 1 + assert_select 'option', text: 'Sample tests', count: 1 + assert_select 'option', text: 'Sample type tests', count: 1 + assert_select 'option', text: 'Template tests', count: 1 + assert_select 'option', text: 'Person tests', count: 1 + assert_select 'option', text: 'Project tests', count: 1 + assert_select 'option', text: 'Institution tests', count: 1 + assert_select 'option', text: 'Programme tests', count: 1 + + # Making sure the default values are not shown + assert_select 'option', text: 'Investigations', count: 0 + assert_select 'option', text: 'Studies', count: 0 + assert_select 'option', text: 'Assays', count: 0 + assert_select 'option', text: 'Data files', count: 0 + assert_select 'option', text: 'Documents', count: 0 + assert_select 'option', text: 'SOP', count: 0 + assert_select 'option', text: 'Presentations', count: 0 + assert_select 'option', text: 'Events', count: 0 + assert_select 'option', text: 'Collections', count: 0 + assert_select 'option', text: 'Samples', count: 0 + assert_select 'option', text: 'Sample types', count: 0 + assert_select 'option', text: 'Templates', count: 0 + assert_select 'option', text: 'People', count: 0 + assert_select 'option', text: 'Projects', count: 0 + assert_select 'option', text: 'Institutions', count: 0 + assert_select 'option', text: 'Programmes', count: 0 + end + end + I18n.load_path = original_load_path + I18n.backend.load_translations + end + test 'get dataset jsonld from index' do get :index, format: :jsonld assert_response :success diff --git a/test/functional/isa_assays_controller_test.rb b/test/functional/isa_assays_controller_test.rb index ba746b6d70..1ad8afd286 100644 --- a/test/functional/isa_assays_controller_test.rb +++ b/test/functional/isa_assays_controller_test.rb @@ -76,8 +76,7 @@ def setup end isa_assay = assigns(:isa_assay) assert_redirected_to controller: 'single_pages', action: 'show', id: isa_assay.assay.projects.first.id, - params: { notice: 'The ISA assay was created successfully!', - item_type: 'assay', item_id: Assay.last.id } + params: { item_type: 'assay', item_id: Assay.last.id } sample_types = SampleType.last(2) title = sample_types[0].sample_attributes.detect(&:is_title).title @@ -139,7 +138,7 @@ def setup assay = FactoryBot.create(:assay, study:, contributor: person) put :update, params: { id: assay, isa_assay: { assay: { title: 'assay title' } } } assert_redirected_to single_page_path(id: project, item_type: 'assay', item_id: assay.id) - assert flash[:error].include?('Resource not found.') + assert flash[:error].include?('Sample type not found.') assay = FactoryBot.create(:assay, study:, sample_type: assay_type, contributor: person) @@ -359,7 +358,7 @@ def setup end isa_assay = assigns(:isa_assay) - assert_redirected_to single_page_path(id: project, item_type: 'assay', item_id: isa_assay.assay.id, notice: 'The ISA assay was created successfully!') + assert_redirected_to single_page_path(id: project, item_type: 'assay', item_id: isa_assay.assay.id) assert_equal isa_assay.assay.sample_type.previous_linked_sample_type, study.sample_types.second assert_equal isa_assay.assay.next_linked_child_assay, end_assay @@ -455,7 +454,7 @@ def setup end isa_assay = assigns(:isa_assay) - assert_redirected_to single_page_path(id: project, item_type: 'assay', item_id: isa_assay.assay.id, notice: 'The ISA assay was created successfully!') + assert_redirected_to single_page_path(id: project, item_type: 'assay', item_id: isa_assay.assay.id) assert_equal begin_assay.previous_linked_sample_type, study.sample_types.second assert_equal isa_assay.assay.sample_type.previous_linked_sample_type, begin_assay.sample_type @@ -619,7 +618,7 @@ def setup # New assay stream should have position 1 and is of type 'number' assert_select 'input[type=number][value=1]#isa_assay_assay_position', count: 1 - assay_stream2 = FactoryBot.create(:assay_stream, study: , contributor: person, position: 5) + FactoryBot.create(:assay_stream, study: , contributor: person, position: 5) get :new, params: { study_id: study.id, is_assay_stream: true } assert_response :success # New assay stream should have position 6 and is of type 'number' diff --git a/test/functional/sample_controlled_vocabs_controller_test.rb b/test/functional/sample_controlled_vocabs_controller_test.rb index f8a450e584..4abdce9459 100644 --- a/test/functional/sample_controlled_vocabs_controller_test.rb +++ b/test/functional/sample_controlled_vocabs_controller_test.rb @@ -70,11 +70,10 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_difference('SampleControlledVocab.count') do assert_difference('SampleControlledVocabTerm.count', 2) do post :create, params: { sample_controlled_vocab: { title: 'fish', description: 'About fish', - sample_controlled_vocab_terms_attributes: { - '0' => { label: 'goldfish', _destroy: '0' }, - '1' => { label: 'guppy', _destroy: '0' } - } - } } + sample_controlled_vocab_terms_attributes: { + '0' => { label: 'goldfish', _destroy: '0' }, + '1' => { label: 'guppy', _destroy: '0' } + } } } end end assert cv = assigns(:sample_controlled_vocab) @@ -89,11 +88,10 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_no_difference('SampleControlledVocab.count') do assert_no_difference('SampleControlledVocabTerm.count') do post :create, params: { sample_controlled_vocab: { title: 'fish', description: 'About fish', - sample_controlled_vocab_terms_attributes: { - '0' => { label: 'goldfish', _destroy: '0' }, - '1' => { label: 'guppy', _destroy: '0' } - } - } } + sample_controlled_vocab_terms_attributes: { + '0' => { label: 'goldfish', _destroy: '0' }, + '1' => { label: 'guppy', _destroy: '0' } + } } } end end assert_response :redirect @@ -105,11 +103,10 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_no_difference('SampleControlledVocab.count') do assert_no_difference('SampleControlledVocabTerm.count', 2) do post :create, params: { sample_controlled_vocab: { title: 'fish', description: 'About fish', - sample_controlled_vocab_terms_attributes: { - '0' => { label: 'goldfish', _destroy: '0' }, - '1' => { label: 'guppy', _destroy: '0' } - } - } } + sample_controlled_vocab_terms_attributes: { + '0' => { label: 'goldfish', _destroy: '0' }, + '1' => { label: 'guppy', _destroy: '0' } + } } } end end assert_response :redirect @@ -123,14 +120,16 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_no_difference('SampleControlledVocab.count') do assert_no_difference('SampleControlledVocabTerm.count') do put :update, params: { id: cv, sample_controlled_vocab: { title: 'the apples', description: 'About apples', - sample_controlled_vocab_terms_attributes: { - '0' => { label: 'Granny Smith', _destroy: '0', id: term_ids[0] }, - '1' => { _destroy: '1', id: term_ids[1] }, - '2' => { label: 'Bramley', _destroy: '0', id: term_ids[2] }, - '3' => { label: 'Cox', _destroy: '0', id: term_ids[3] }, - '4' => { label: 'Jazz', _destroy: '0' } - } - } } + sample_controlled_vocab_terms_attributes: { + '0' => { label: 'Granny Smith', _destroy: '0', + id: term_ids[0] }, + '1' => { _destroy: '1', id: term_ids[1] }, + '2' => { label: 'Bramley', _destroy: '0', + id: term_ids[2] }, + '3' => { label: 'Cox', _destroy: '0', + id: term_ids[3] }, + '4' => { label: 'Jazz', _destroy: '0' } + } } } end end assert cv = assigns(:sample_controlled_vocab) @@ -147,14 +146,16 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_no_difference('SampleControlledVocab.count') do assert_no_difference('SampleControlledVocabTerm.count') do put :update, params: { id: cv, sample_controlled_vocab: { title: 'the apples', description: 'About apples', - sample_controlled_vocab_terms_attributes: { - '0' => { label: 'Granny Smith', _destroy: '0', id: term_ids[0] }, - '1' => { _destroy: '1', id: term_ids[1] }, - '2' => { label: 'Bramley', _destroy: '0', id: term_ids[2] }, - '3' => { label: 'Cox', _destroy: '0', id: term_ids[3] }, - '4' => { label: 'Jazz', _destroy: '0' } - } - } } + sample_controlled_vocab_terms_attributes: { + '0' => { label: 'Granny Smith', _destroy: '0', + id: term_ids[0] }, + '1' => { _destroy: '1', id: term_ids[1] }, + '2' => { label: 'Bramley', _destroy: '0', + id: term_ids[2] }, + '3' => { label: 'Cox', _destroy: '0', + id: term_ids[3] }, + '4' => { label: 'Jazz', _destroy: '0' } + } } } end end assert_response :redirect @@ -294,12 +295,12 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase login_as(person) cv = FactoryBot.create(:ontology_sample_controlled_vocab) assert cv.ontology_based? - get :edit, params:{id: cv.id} + get :edit, params:{ id: cv.id } assert_response :success assert_select 'table#new-terms' do # 3 hidden fields for each field, and an extra one for the remove button default - assert_select 'tr.sample-cv-term input[type=hidden]', count:cv.sample_controlled_vocab_terms.length * 4 + assert_select 'tr.sample-cv-term input[type=hidden]', count:cv.sample_controlled_vocab_terms.length * 5 assert_select 'div.disabled-cv-field', count: cv.sample_controlled_vocab_terms.length * 3 end @@ -310,7 +311,7 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase login_as(person) cv = FactoryBot.create(:apples_sample_controlled_vocab) refute cv.ontology_based? - get :edit, params:{id: cv.id} + get :edit, params:{ id: cv.id } assert_response :success assert_select 'table#new-terms' do @@ -329,8 +330,8 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase login_as(person) VCR.use_cassette('ols/fetch_obo_bad_term') do get :fetch_ols_terms_html, params: { source_ontology_id: 'go', - root_uris: 'http://purl.obolibrary.org/obo/banana', - include_root_term: '1' } + root_uris: 'http://purl.obolibrary.org/obo/banana', + include_root_term: '1' } assert_response :unprocessable_entity assert_equal '404 Not Found', response.body @@ -348,18 +349,29 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_response :success assert_select 'tr.sample-cv-term', count: 4 - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_parent_iri:not([value])' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]','plant cell papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090397' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]','stigma papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090396' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]','leaf papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090705' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_label[value=?]','trichome papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]', +'plant cell papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090397' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]', +'stigma papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090396' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]', +'leaf papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090705' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_label[value=?]', +'trichome papilla' end test 'create with root uris' do @@ -369,10 +381,11 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase post :create, params: { sample_controlled_vocab: { title: 'plant_cell_papilla and haustorium', description: 'multiple root uris', ols_root_term_uris: 'http://purl.obolibrary.org/obo/GO_0090395, http://purl.obolibrary.org/obo/GO_0085035', sample_controlled_vocab_terms_attributes: { - '0' => { label: 'plant cell papilla', iri:'http://purl.obolibrary.org/obo/GO_0090395', parent_iri:'', _destroy: '0' }, - '1' => { label: 'haustorium', iri:'http://purl.obolibrary.org/obo/GO_0085035', parent_iri:'', _destroy: '0' } - } - } } + '0' => { label: 'plant cell papilla', + iri: 'http://purl.obolibrary.org/obo/GO_0090395', parent_iri:'', _destroy: '0' }, + '1' => { label: 'haustorium', + iri: 'http://purl.obolibrary.org/obo/GO_0085035', parent_iri:'', _destroy: '0' } + } } } end end assert cv = assigns(:sample_controlled_vocab) @@ -381,8 +394,10 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_equal 'multiple root uris', cv.description assert_equal 2, cv.sample_controlled_vocab_terms.count assert_equal ['plant cell papilla','haustorium'], cv.labels - assert_equal ['http://purl.obolibrary.org/obo/GO_0090395','http://purl.obolibrary.org/obo/GO_0085035'], cv.sample_controlled_vocab_terms.collect(&:iri) - assert_equal 'http://purl.obolibrary.org/obo/GO_0090395, http://purl.obolibrary.org/obo/GO_0085035', cv.ols_root_term_uris + assert_equal ['http://purl.obolibrary.org/obo/GO_0090395','http://purl.obolibrary.org/obo/GO_0085035'], +cv.sample_controlled_vocab_terms.collect(&:iri) + assert_equal 'http://purl.obolibrary.org/obo/GO_0090395, http://purl.obolibrary.org/obo/GO_0085035', +cv.ols_root_term_uris end test 'fetch ols terms as HTML with multiple root uris and root term included' do @@ -398,25 +413,41 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_response :success assert_select 'tr.sample-cv-term', count: 6 - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_parent_iri:not([value])' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]','plant cell papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090397' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]','stigma papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090396' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]','leaf papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090705' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_label[value=?]','trichome papilla' - - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_4_iri[value=?]','http://purl.obolibrary.org/obo/GO_0085035' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]', +'plant cell papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090397' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]', +'stigma papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090396' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]', +'leaf papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090705' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_label[value=?]', +'trichome papilla' + + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_4_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0085035' assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_4_parent_iri:not([value])' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_4_label[value=?]','haustorium' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_5_iri[value=?]','http://purl.obolibrary.org/obo/GO_0085041' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_5_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0085035' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_5_label[value=?]','arbuscule' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_4_label[value=?]', +'haustorium' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_5_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0085041' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_5_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0085035' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_5_label[value=?]', +'arbuscule' end @@ -434,19 +465,31 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_response :success assert_select 'tr.sample-cv-term', count: 4 - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090397' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]','stigma papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090396' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]','leaf papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090705' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]','trichome papilla' - - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_iri[value=?]','http://purl.obolibrary.org/obo/GO_0085041' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0085035' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_label[value=?]','arbuscule' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090397' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]', +'stigma papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090396' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]', +'leaf papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090705' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]', +'trichome papilla' + + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0085041' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0085035' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_3_label[value=?]', +'arbuscule' end @@ -471,19 +514,28 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase login_as(person) VCR.use_cassette('ols/fetch_obo_plant_cell_papilla') do get :fetch_ols_terms_html, params: { source_ontology_id: 'go', - root_uris: 'http://purl.obolibrary.org/obo/GO_0090395' } + root_uris: 'http://purl.obolibrary.org/obo/GO_0090395' } end assert_response :success assert_select 'tr.sample-cv-term', count: 3 - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090397' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]','stigma papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090396' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]','leaf papilla' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090705' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]','http://purl.obolibrary.org/obo/GO_0090395' - assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]','trichome papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090397' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_0_label[value=?]', +'stigma papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090396' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_1_label[value=?]', +'leaf papilla' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090705' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_parent_iri[value=?]', +'http://purl.obolibrary.org/obo/GO_0090395' + assert_select 'input[type=hidden]#sample_controlled_vocab_sample_controlled_vocab_terms_attributes_2_label[value=?]', +'trichome papilla' end test 'can access typeahead with samples disabled' do @@ -498,4 +550,29 @@ class SampleControlledVocabsControllerTest < ActionController::TestCase assert_equal 'Sample collections', res.first['text'] end end + + test 'should not duplicate terms when updating' do + person = FactoryBot.create(:person) + login_as(person) + cv = FactoryBot.create(:apples_sample_controlled_vocab) + term_ids = cv.sample_controlled_vocab_terms.map(&:id) + + assert_no_difference('SampleControlledVocabTerm.count') do + put :update, params: { id: cv, sample_controlled_vocab: { title: 'the apples', description: 'About apples', + sample_controlled_vocab_terms_attributes: { + '0' => { label: 'Granny Smith', _destroy: '0', + id: term_ids[0] }, + '1' => { label: 'Red Delicious', _destroy: '0', + id: term_ids[1] }, + '2' => { label: 'Bramley', _destroy: '0', + id: term_ids[2] }, + '3' => { label: 'Cox', _destroy: '0', + id: term_ids[3] }, + '4' => { label: 'Granny Smith', _destroy: '0' } + } } } + end + assert_response :unprocessable_entity + assert_template :edit + assert flash[:error] = 'Validation failed: Labels have already been taken' + end end diff --git a/test/functional/single_pages_controller_test.rb b/test/functional/single_pages_controller_test.rb index 7350c73411..e7fdb075e2 100644 --- a/test/functional/single_pages_controller_test.rb +++ b/test/functional/single_pages_controller_test.rb @@ -156,16 +156,45 @@ def setup sample_type_id: source_sample_type.id } response_data = JSON.parse(response.body)['uploadData'] + db_samples = response_data['dbSamples'] + updated_samples = response_data['updateSamples'] + new_samples = response_data['newSamples'] + possible_duplicates = response_data['possibleDuplicates'] + assert_response :success + assert_equal db_samples.size, 5 + assert_equal updated_samples.size, 2 + assert_equal new_samples.size, 2 + assert_equal possible_duplicates.size, 1 - updated_samples = response_data['updateSamples'] - assert(updated_samples.size, 2) + post :upload_samples, as: :html, params: { file:, project_id: project.id, + sample_type_id: source_sample_type.id } - new_samples = response_data['newSamples'] - assert(new_samples.size, 2) + assert_response :success - possible_duplicates = response_data['possibleDuplicates'] - assert(possible_duplicates.size, 1) + assert_select 'table#create-samples-table', count: 1 do + assert_select "tbody tr", count: new_samples.size + end + + assert_select 'table#update-samples-table', count: 1 do + update_sample_ids = updated_samples.map { |s| s['id'] } + update_sample_ids.map do |sample_id| + row_id_updated = "update-sample-#{sample_id}-updated" + assert_select "tr##{row_id_updated}", count: 1 + + row_id_original = "update-sample-#{sample_id}-original" + assert_select "tr##{row_id_original}", count: 1 + end + end + + assert_select 'table#duplicate-samples-table', count: 1 do + dup_sample_ids = possible_duplicates.map { |s| s['duplicate']['id'] } + dup_sample_ids.map do |sample_id| + row_id = "duplicate-sample-#{sample_id}" + assert_select "tr##{row_id}-1", count: 1 + assert_select "tr##{row_id}-2", count: 1 + end + end end end @@ -182,16 +211,43 @@ def setup sample_type_id: sample_collection_sample_type.id } response_data = JSON.parse(response.body)['uploadData'] + updated_samples = response_data['updateSamples'] + new_samples = response_data['newSamples'] + possible_duplicates = response_data['possibleDuplicates'] + assert_response :success + assert_equal updated_samples.size, 2 + assert_equal new_samples.size, 2 + assert_equal possible_duplicates.size, 1 - updated_samples = response_data['updateSamples'] - assert(updated_samples.size, 2) + post :upload_samples, as: :html, params: { file:, project_id: project.id, + sample_type_id: sample_collection_sample_type.id } - new_samples = response_data['newSamples'] - assert(new_samples.size, 2) + assert_response :success - possible_duplicates = response_data['possibleDuplicates'] - assert(possible_duplicates.size, 1) + assert_select 'table#create-samples-table', count: 1 do + assert_select "tbody tr", count: new_samples.size + end + + assert_select 'table#update-samples-table', count: 1 do + update_sample_ids = updated_samples.map { |s| s['id'] } + update_sample_ids.map do |sample_id| + row_id_updated = "update-sample-#{sample_id}-updated" + assert_select "tr##{row_id_updated}", count: 1 + + row_id_original = "update-sample-#{sample_id}-original" + assert_select "tr##{row_id_original}", count: 1 + end + end + + assert_select 'table#duplicate-samples-table', count: 1 do + dup_sample_ids = possible_duplicates.map { |s| s['duplicate']['id'] } + dup_sample_ids.map do |sample_id| + row_id = "duplicate-sample-#{sample_id}" + assert_select "tr##{row_id}-1", count: 1 + assert_select "tr##{row_id}-2", count: 1 + end + end end end @@ -208,16 +264,91 @@ def setup sample_type_id: assay_sample_type.id } response_data = JSON.parse(response.body)['uploadData'] + updated_samples = response_data['updateSamples'] + new_samples = response_data['newSamples'] + possible_duplicates = response_data['possibleDuplicates'] + assert_response :success + assert_equal updated_samples.size, 2 + assert_equal new_samples.size, 1 + assert_equal possible_duplicates.size, 1 - updated_samples = response_data['updateSamples'] - assert(updated_samples.size, 2) + post :upload_samples, as: :html, params: { file:, project_id: project.id, + sample_type_id: assay_sample_type.id } + assert_response :success + + assert_select 'table#create-samples-table', count: 1 do + assert_select "tbody tr", count: new_samples.size + end + + assert_select 'table#update-samples-table', count: 1 do + update_sample_ids = updated_samples.map { |s| s['id'] } + update_sample_ids.map do |sample_id| + row_id_updated = "update-sample-#{sample_id}-updated" + assert_select "tr##{row_id_updated}", count: 1 + + row_id_original = "update-sample-#{sample_id}-original" + assert_select "tr##{row_id_original}", count: 1 + end + end + + assert_select 'table#duplicate-samples-table', count: 1 do + dup_sample_ids = possible_duplicates.map { |s| s['duplicate']['id'] } + dup_sample_ids.map do |sample_id| + row_id = "duplicate-sample-#{sample_id}" + assert_select "tr##{row_id}-1", count: 1 + assert_select "tr##{row_id}-2", count: 1 + end + end + end + end + + test 'Should show permission conflicts for samples' do + with_config_value(:project_single_page_enabled, true) do + unauthorized_user = FactoryBot.create(:user) + login_as unauthorized_user + project, source_sample_type = setup_file_upload.values_at( + :project, :source_sample_type + ) + + file_path = 'upload_single_page/01_combo_update_sources_spreadsheet.xlsx' + file = fixture_file_upload(file_path, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') + + post :upload_samples, as: :json, params: { file:, project_id: project.id, + sample_type_id: source_sample_type.id } + + response_data = JSON.parse(response.body)['uploadData'] + updated_samples = response_data['updateSamples'] + unauthorized_samples = response_data['unauthorized_samples'] new_samples = response_data['newSamples'] - assert(new_samples.size, 1) + + assert_response :success + assert_equal updated_samples.size, 0 + assert_equal unauthorized_samples.size, 2 + assert_equal new_samples.size, 2 possible_duplicates = response_data['possibleDuplicates'] assert(possible_duplicates.size, 1) + + post :upload_samples, as: :html, params: { file:, project_id: project.id, + sample_type_id: source_sample_type.id } + + assert_response :success + + assert_select 'table#create-samples-table', count: 1 do + assert_select "tbody tr", count: new_samples.size + end + + assert_select 'table#update-samples-table', count: 0 + + assert_select 'table#unauthorized-samples-table', count: 1 do + unauthorized_sample_ids = unauthorized_samples.map { |s| s['id'] } + unauthorized_sample_ids.map do |sample_id| + row_id = "unauthorized-sample-#{sample_id}" + assert_select "tr##{row_id}", count: 1 + end + end end end @@ -258,12 +389,12 @@ def setup_file_upload FactoryBot.create( :sample, id: 10_010 + n, - title: "source#{n}", + title: "source_#{n}", sample_type: source_sample_type, project_ids: [project.id], contributor: person, data: { - 'Source Name': 'Source Name', + 'Source Name': "Source #{n}", 'Source Characteristic 1': 'Source Characteristic 1', 'Source Characteristic 2': source_sample_type diff --git a/test/functional/templates_controller_test.rb b/test/functional/templates_controller_test.rb index 753d43a28c..566f16496f 100644 --- a/test/functional/templates_controller_test.rb +++ b/test/functional/templates_controller_test.rb @@ -623,6 +623,33 @@ class TemplatesControllerTest < ActionController::TestCase end end + test 'Should not see add new attribute button at template creation time' do + get :new + assert_response :success + assert_select 'a#add-attribute.hidden', text: /Add new attribute/, count: 1 + end + + test 'Should see add new attribute button at template edit time' do + my_template = FactoryBot.create(:isa_source_template, project_ids: @project_ids, contributor: @person) + get :edit, params: { id: my_template.id } + assert_response :success + assert_select 'a#add-attribute.hidden', text: /Add new attribute/, count: 0 + end + + test 'Should only be able link a new template to projects the current user is project admin of' do + project = FactoryBot.create(:project) + project_admin = FactoryBot.create(:project_administrator, project: project) + login_as(project_admin.user) + get :new + assert_response :success + + # The project selector is a vue-component, which is not translated to html in the test environment + # Instead we check that the json data is present in 'project-selector-possibilities-json' + assert_select 'script#project-selector-possibilities-json', count: 1 + options = "[{\"id\":#{project.id},\"text\":\"#{project.title}\"}]" + assert_select 'script#project-selector-possibilities-json', text: /#{options}/, count: 1 + end + def create_template_from_parent_template(parent_template, person= @person, linked_sample_type= nil) child_template_attributes = parent_template.template_attributes.map do |ta| FactoryBot.create(:template_attribute, parent_attribute_id: ta.id, title: ta.title, isa_tag_id: ta.isa_tag_id, sample_attribute_type: ta.sample_attribute_type, is_title: ta.is_title, required: ta.required, sample_controlled_vocab: ta.sample_controlled_vocab, pos: ta.pos) diff --git a/test/integration/nfcore_scraper_test.rb b/test/integration/nfcore_scraper_test.rb index 5b5321aa73..37b46bd13c 100644 --- a/test/integration/nfcore_scraper_test.rb +++ b/test/integration/nfcore_scraper_test.rb @@ -25,10 +25,10 @@ class NfcoreScraperTest < ActionDispatch::IntegrationTest assert_equal bot, wf.contributor assert_equal [project], wf.projects assert_equal 'nf-core/rnaseq', wf.title - assert_equal 'Nextflow RNA-Seq analysis pipeline, part of the nf-core community.', wf.description + assert_equal 'RNA sequencing analysis pipeline for gene/isoform quantification and extensive quality control.', wf.description assert_equal 'MIT', wf.license assert_equal 'nextflow.config', wf.main_workflow_path - assert_equal '3.0', wf.git_version.name + assert_equal '3.13.2', wf.git_version.name assert_equal %w[rna rna-seq], wf.tags.sort end end @@ -67,10 +67,10 @@ class NfcoreScraperTest < ActionDispatch::IntegrationTest assert_equal bot, wf.contributor assert_equal [project], wf.projects assert_equal 'nf-core/rnaseq', wf.title - assert_equal 'Nextflow RNA-Seq analysis pipeline, part of the nf-core community.', wf.description + assert_equal 'RNA sequencing analysis pipeline for gene/isoform quantification and extensive quality control.', wf.description assert_equal 'MIT', wf.license assert_equal 'nextflow.config', wf.main_workflow_path - assert_equal '3.0', wf.git_version.name + assert_equal '3.13.2', wf.git_version.name end end end @@ -89,10 +89,10 @@ class NfcoreScraperTest < ActionDispatch::IntegrationTest contributor: bot, projects: [project], source_link_url: 'https://github.com/nf-core/rnaseq', - git_version_attributes: { name: '3.0', + git_version_attributes: { name: '3.13.2', git_repository_id: repos.first.id, - ref: 'refs/tags/3.0', - commit: '3643a94', + ref: 'refs/tags/3.13.2', + commit: 'a10f41a', main_workflow_path: 'nextflow.config', mutable: false }) @@ -117,16 +117,18 @@ class NfcoreScraperTest < ActionDispatch::IntegrationTest repos = [FactoryBot.create(:nfcore_remote_repository)] # These are the available remote Git tags in the above repo: - tags = ['1.0', '1.1', '1.2', '1.3', '1.4', '1.4.1', '1.4.2', '2.0', '3.0'] + tags = ['1.0', '1.1', '1.2', '1.3', '1.4', '1.4.1', '1.4.2', '2.0', '3.0', '3.1', '3.2', '3.3', '3.4', '3.5', + '3.6', '3.7', '3.8', '3.8.1', '3.9', '3.10', '3.10.1', '3.11.0', '3.11.1', '3.11.2', '3.12.0', '3.13.1', + '3.13.0', '3.13.2'] existing = FactoryBot.create(:nfcore_git_workflow, contributor: bot, projects: [project], source_link_url: 'https://github.com/nf-core/rnaseq', - git_version_attributes: { name: '3.0', + git_version_attributes: { name: '1.0', git_repository_id: repos.first.id, - ref: 'refs/tags/3.0', - commit: '3643a94', + ref: 'refs/tags/1.0', + commit: '44f1525', main_workflow_path: 'nextflow.config', mutable: false }) @@ -140,7 +142,7 @@ class NfcoreScraperTest < ActionDispatch::IntegrationTest refute scraped.empty? assert_equal tags.count, existing.reload.versions.count - assert_equal tags.sort, existing.versions.map(&:name).sort + assert_equal tags, existing.versions.sort_by(&:created_at).map(&:name) end end end @@ -148,6 +150,15 @@ class NfcoreScraperTest < ActionDispatch::IntegrationTest end end + test 'does not list archived or disabled repositories' do + project = Scrapers::Util.bot_project(title: 'test') + bot = Scrapers::Util.bot_account + scraper = Scrapers::NfcoreScraper.new('test-123', project, bot, output: StringIO.new) + repos = scraper.send(:list_repositories) + assert_equal 1, repos.length + assert_includes repos.map { |r| r['name'] }, 'rnaseq' + end + private def login_as(user) diff --git a/test/integration/schedule_test.rb b/test/integration/schedule_test.rb index 54f930f38d..b7aa273ccb 100644 --- a/test/integration/schedule_test.rb +++ b/test/integration/schedule_test.rb @@ -24,6 +24,11 @@ class ScheduleTest < ActionDispatch::IntegrationTest assert regular assert_equal [RegularMaintenanceJob::RUN_PERIOD, { at: '1:00am' }], regular[:every] + # AuthLookupMaintenanceJob + auth = pop_task(runners, "AuthLookupMaintenanceJob.perform_later") + assert auth + assert_equal [AuthLookupMaintenanceJob::RUN_PERIOD, { at: '1:00am' }], auth[:every] + # LifeMonitor status lm_status = pop_task(runners, "LifeMonitorStatusJob.perform_later") assert lm_status diff --git a/test/integration/workflow_ro_crate_test.rb b/test/integration/workflow_ro_crate_test.rb index 3e660423e6..514e3e8e3a 100644 --- a/test/integration/workflow_ro_crate_test.rb +++ b/test/integration/workflow_ro_crate_test.rb @@ -123,12 +123,4 @@ class WorkflowRoCrateTest < ActionDispatch::IntegrationTest File.delete(git_version.send(:ro_crate_path)) end end - - test 'conformsTo' do - crate = ROCrate::WorkflowCrate.new - - ids = crate['conformsTo'].map { |x| x['@id'] } - assert_includes ids, 'https://w3id.org/ro/crate/1.1' - assert_includes ids, 'https://w3id.org/workflowhub/workflow-ro-crate/1.0' - end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 577f99a6fb..36f3a886fe 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -71,13 +71,13 @@ def with_alternative_rendering(key, value) end def with_config_value(config, value) - Seek::Util.clear_cached if config.to_s.ends_with?('enabled') + Seek::Util.clear_cached oldval = Seek::Config.send(config) Seek::Config.send("#{config}=", value) yield ensure Seek::Config.send("#{config}=", oldval) - Seek::Util.clear_cached if config.to_s.ends_with?('enabled') + Seek::Util.clear_cached end def with_config_values(settings) diff --git a/test/unit/asset_test.rb b/test/unit/asset_test.rb index fc966488e5..4d4a15ad3c 100644 --- a/test/unit/asset_test.rb +++ b/test/unit/asset_test.rb @@ -78,12 +78,12 @@ class AssetTest < ActiveSupport::TestCase assert df.latest_version.contains_downloadable_items? df = FactoryBot.create :data_file, content_blob: FactoryBot.create(:content_blob, url: 'http://webpage.com', external_link: true) - assert !df.contains_downloadable_items? - assert !df.latest_version.contains_downloadable_items? + refute df.contains_downloadable_items? + refute df.latest_version.contains_downloadable_items? model = FactoryBot.create :model_with_urls - assert !model.contains_downloadable_items? - assert !model.latest_version.contains_downloadable_items? + refute model.contains_downloadable_items? + refute model.latest_version.contains_downloadable_items? model = FactoryBot.create :teusink_model assert model.contains_downloadable_items? @@ -94,10 +94,10 @@ class AssetTest < ActiveSupport::TestCase assert model.latest_version.contains_downloadable_items? df = DataFile.new - assert !df.contains_downloadable_items? + refute df.contains_downloadable_items? model = Model.new - assert !model.contains_downloadable_items? + refute model.contains_downloadable_items? # test for versions model = FactoryBot.create :teusink_model @@ -112,7 +112,14 @@ class AssetTest < ActiveSupport::TestCase assert_equal(2, model.versions.count) assert model.find_version(1).contains_downloadable_items? - assert !model.find_version(2).contains_downloadable_items? + refute model.find_version(2).contains_downloadable_items? + + workflow = FactoryBot.create(:nfcore_git_workflow) + assert workflow.contains_downloadable_items? + assert workflow.git_version.contains_downloadable_items? + + workflow = Workflow.new + refute workflow.contains_downloadable_items? end test 'supports_spreadsheet_explore?' do diff --git a/test/unit/content_blob_test.rb b/test/unit/content_blob_test.rb index f92574fc13..111a1cafd7 100644 --- a/test/unit/content_blob_test.rb +++ b/test/unit/content_blob_test.rb @@ -900,61 +900,6 @@ def test_exception_when_both_data_and_io_object refute File.exist?(txt_path) end - test 'fix mime type after failed csv extraction' do - blob = FactoryBot.create(:image_content_blob, content_type:'application/excel', original_filename:'image.xls') - assert blob.is_excel? - - text = blob.to_csv - - assert text.blank? - - blob.reload - - refute blob.is_excel? - assert_equal 'image/png',blob.content_type - end - - test 'fix mime type after failed pdf contents for search' do - blob = FactoryBot.create(:image_content_blob, content_type: 'application/msword', original_filename: 'image.doc') - assert blob.is_pdf_convertable? - - assert_empty blob.pdf_contents_for_search - - blob.reload - - refute blob.is_pdf_convertable? - assert_equal 'image/png', blob.content_type - - # incorrectly described as pdf - blob = FactoryBot.create(:image_content_blob, content_type: 'application/pdf', original_filename: 'image.pdf') - - assert_empty blob.pdf_contents_for_search - - blob.reload - - refute blob.is_pdf_convertable? - assert_equal 'image/png', blob.content_type - - # handles when the file is actually broken, rather than failing due to the mime type - blob = FactoryBot.create(:broken_pdf_content_blob) - assert_empty blob.pdf_contents_for_search - assert_equal 'application/pdf', blob.content_type - end - - test 'fix mime type after spreadsheet xml fail' do - blob = FactoryBot.create(:image_content_blob, content_type:'application/msexcel', original_filename:'image.xls') - assert blob.is_extractable_spreadsheet? - - assert_raises(SysMODB::SpreadsheetExtractionException) do - blob.to_spreadsheet_xml - end - - blob.reload - - refute blob.is_extractable_spreadsheet? - assert_equal 'image/png',blob.content_type - end - test 'tmp_io_objects in tmp dir are deleted' do file = Tempfile.new('testing-content-blob') file.write('test test test') diff --git a/test/unit/jobs/auth_lookup_maintenance_job_test.rb b/test/unit/jobs/auth_lookup_maintenance_job_test.rb new file mode 100644 index 0000000000..102aa8c5e2 --- /dev/null +++ b/test/unit/jobs/auth_lookup_maintenance_job_test.rb @@ -0,0 +1,236 @@ +require 'test_helper' + +class AuthLookupMaintenaceJobTest < ActiveSupport::TestCase + + def setup + #ensure a consistent initial state + disable_authorization_checks do + Seek::Util.authorized_types.each(&:destroy_all) + Seek::Util.authorized_types.each(&:clear_lookup_table) + end + + User.destroy_all + AuthLookupUpdateQueue.destroy_all + end + + test 'run period' do + assert_equal 8.hours, AuthLookupMaintenanceJob::RUN_PERIOD + end + + test 'priority' do + assert_equal 3, AuthLookupMaintenanceJob.priority + end + + test 'queue name' do + assert_equal QueueNames::AUTH_LOOKUP, AuthLookupMaintenanceJob.queue_name + end + + + test 'check authlookup consistency' do + + p = FactoryBot.create(:person) + p2 = FactoryBot.create(:person) + u = FactoryBot.create(:brand_new_user) + + assert_nil u.person + + with_config_value(:auth_lookup_enabled, true) do + assert AuthLookupUpdateQueue.queue_enabled? + + doc1 = FactoryBot.create(:document) + doc2 = FactoryBot.create(:document) + AuthLookupUpdateJob.perform_now + + assert Document.lookup_table_consistent?(p.user) + assert Document.lookup_table_consistent?(p2.user) + assert Document.lookup_table_consistent?(nil) + + assert_no_enqueued_jobs do + assert_no_difference('AuthLookupUpdateQueue.count') do + AuthLookupMaintenanceJob.perform_now + end + end + + # delete a record + Document.lookup_class.where(user_id:p.user.id,asset_id:doc1.id).last.delete + + #duplicate a record + Document.lookup_class.where(user_id:p2.user.id, asset_id:doc2.id).last.dup.save! + + refute Document.lookup_table_consistent?(p.user) + refute Document.lookup_table_consistent?(p2.user) + + assert_enqueued_jobs(1) do + assert_difference('AuthLookupUpdateQueue.count',1) do + AuthLookupMaintenanceJob.perform_now + end + end + + # double check it will be fixed when the job runs + AuthLookupUpdateJob.perform_now + assert Document.lookup_table_consistent?(p.user) + assert Document.lookup_table_consistent?(p2.user) + assert Document.lookup_table_consistent?(nil) + end + + end + + test 'test for anonymous user' do + + with_config_value(:auth_lookup_enabled, true) do + assert AuthLookupUpdateQueue.queue_enabled? + + doc = FactoryBot.create(:document) + AuthLookupUpdateJob.perform_now + + assert Document.lookup_table_consistent?(nil) + + # delete a record + Document.lookup_class.where(user_id:0,asset_id:doc.id).last.delete + + refute Document.lookup_table_consistent?(nil) + + # queued after the user has been removed + assert_enqueued_jobs(1) do + assert_difference('AuthLookupUpdateQueue.count',1) do + AuthLookupMaintenanceJob.perform_now + end + end + + end + end + + test 'skip if user or person in the queue' do + + p = FactoryBot.create(:person) + + with_config_value(:auth_lookup_enabled, true) do + assert AuthLookupUpdateQueue.queue_enabled? + + doc1 = FactoryBot.create(:document) + AuthLookupUpdateJob.perform_now + + assert Document.lookup_table_consistent?(p.user) + + # delete a record + Document.lookup_class.where(user_id:p.user.id,asset_id:doc1.id).last.delete + + refute Document.lookup_table_consistent?(p.user) + + refute AuthLookupUpdateQueue.any? + AuthLookupUpdateQueue.create!(item: p.user) + assert AuthLookupUpdateQueue.any? + + # nothing queued whilst user is queued + assert_no_enqueued_jobs do + assert_no_difference('AuthLookupUpdateQueue.count') do + AuthLookupMaintenanceJob.perform_now + end + end + + AuthLookupUpdateQueue.destroy_all + AuthLookupUpdateQueue.create!(item: p) + assert AuthLookupUpdateQueue.any? + + # nothing queued whilst person is queued + assert_no_enqueued_jobs do + assert_no_difference('AuthLookupUpdateQueue.count') do + AuthLookupMaintenanceJob.perform_now + end + end + + AuthLookupUpdateQueue.destroy_all + refute AuthLookupUpdateQueue.any? + #add another item to make sure it's only checking for user/person + AuthLookupUpdateQueue.create!(item: FactoryBot.create(:sop)) + assert AuthLookupUpdateQueue.any? + + # queued after the user has been removed + assert_enqueued_jobs(1) do + assert_difference('AuthLookupUpdateQueue.count',1) do + AuthLookupMaintenanceJob.perform_now + end + end + + end + end + + test 'skip if particular type is on the queue' do + p = FactoryBot.create(:person) + + with_config_value(:auth_lookup_enabled, true) do + assert AuthLookupUpdateQueue.queue_enabled? + + doc1 = FactoryBot.create(:document) + AuthLookupUpdateJob.perform_now + + assert Document.lookup_table_consistent?(p.user) + + # delete a record + Document.lookup_class.where(user_id:p.user.id,asset_id:doc1.id).last.delete + + refute Document.lookup_table_consistent?(p.user) + + refute AuthLookupUpdateQueue.any? + AuthLookupUpdateQueue.create!(item: doc1) + assert AuthLookupUpdateQueue.any? + + # nothing queued whilst doc1 is queued + assert_no_enqueued_jobs do + assert_no_difference('AuthLookupUpdateQueue.count') do + AuthLookupMaintenanceJob.perform_now + end + end + + AuthLookupUpdateQueue.destroy_all + refute AuthLookupUpdateQueue.any? + + # queued after the doc1 has been removed + assert_enqueued_jobs(1) do + assert_difference('AuthLookupUpdateQueue.count',1) do + AuthLookupMaintenanceJob.perform_now + end + end + + end + end + + test 'checks each type' do + p = FactoryBot.create(:person) + + with_config_value(:auth_lookup_enabled, true) do + assert AuthLookupUpdateQueue.queue_enabled? + + doc = FactoryBot.create(:document) + sample = FactoryBot.create(:sample) + sop = FactoryBot.create(:sop) + with_config_value(:auth_lookup_update_batch_size, 20) do + AuthLookupUpdateJob.perform_now + end + + assert Document.lookup_table_consistent?(p.user) + assert Sample.lookup_table_consistent?(p.user) + assert Sop.lookup_table_consistent?(p.user) + + # delete a record + Document.lookup_class.where(user_id:p.user.id,asset_id:doc.id).last.delete + Sample.lookup_class.where(user_id:p.user.id,asset_id:sample.id).last.delete + Sop.lookup_class.where(user_id:p.user.id,asset_id:sop.id).last.delete + + refute Document.lookup_table_consistent?(p.user) + refute Sample.lookup_table_consistent?(p.user) + refute Sop.lookup_table_consistent?(p.user) + + assert_enqueued_jobs(3) do + assert_difference('AuthLookupUpdateQueue.count',3) do + AuthLookupMaintenanceJob.perform_now + end + end + + assert AuthLookupUpdateQueue.where(item: doc).any? + assert AuthLookupUpdateQueue.where(item: sample).any? + assert AuthLookupUpdateQueue.where(item: sop).any? + end + end + +end \ No newline at end of file diff --git a/test/unit/jobs/populate_templates_job_test.rb b/test/unit/jobs/populate_templates_job_test.rb index 026d19c587..0558063667 100644 --- a/test/unit/jobs/populate_templates_job_test.rb +++ b/test/unit/jobs/populate_templates_job_test.rb @@ -1,11 +1,66 @@ require 'test_helper' class PopulateTemplatesJobTest < ActiveSupport::TestCase + def setup + # Create the SampleAttributeTypes + # The title MUST be set manually! + FactoryBot.create(:string_sample_attribute_type, title: 'String attribute type 1') + FactoryBot.create(:sample_multi_sample_attribute_type, title: 'Sample multi attribute type 1') + + # Create the ISA Tags + %i[source_isa_tag sample_isa_tag protocol_isa_tag source_characteristic_isa_tag sample_characteristic_isa_tag + other_material_isa_tag other_material_characteristic_isa_tag data_file_isa_tag parameter_value_isa_tag + data_file_comment_isa_tag default_isa_tag].map do |tag| + FactoryBot.create(tag) + end + + # Set isa_json_compliance_enabled to true + Seek::Config.isa_json_compliance_enabled = true + end + + def teardown + # Set isa_json_compliance_enabled back to false + Seek::Config.isa_json_compliance_enabled = false + end + test 'perform' do - with_config_value(:isa_json_compliance_enabled, true) do - assert_nothing_raised do + # Copy the JSON file to the source_types directory + src = Rails.root.join('test', 'fixtures', 'files', 'upload_json_sample_type_template', 'test_templates.json') + dest = Seek::Config.append_filestore_path('source_types') + FileUtils.cp(src, dest) + + assert_nothing_raised do + assert_difference('Template.count', 4) do PopulateTemplatesJob.perform_now end end end + + test 'perform with json containing invalid sample attribute type' do + # Copy the JSON file to the source_types directory + src = Rails.root.join('test', 'fixtures', 'files', 'upload_json_sample_type_template', 'invalid_attribute_type_templates.json') + dest = Seek::Config.append_filestore_path('source_types') + FileUtils.cp(src, dest) + + assert_no_difference('Template.count') do + assert_raises(RuntimeError, +'
    • The property \'#/data/0/data/1/dataType\' value \"Invalid String attribute type 1\" did not match one of the following values: String attribute type 1, Sample multi attribute type 1 in schema file:///home/kepel/projects/seek/lib/seek/isa_templates/template_attributes_schema_test.json#
    • Could not find a Sample Attribute Type named \'Invalid String attribute type 1\'
    ') do + PopulateTemplatesJob.perform_now + end + end + end + + test 'perform with json containing invalid ISA tag' do + # Copy the JSON file to the source_types directory + src = Rails.root.join('test', 'fixtures', 'files', 'upload_json_sample_type_template', 'invalid_isa_tag_templates.json') + dest = Seek::Config.append_filestore_path('source_types') + FileUtils.cp(src, dest) + + assert_no_difference('Template.count') do + assert_raises(StandardError) do + PopulateTemplatesJob.perform_now + end + end + end + end diff --git a/test/unit/jobs/regular_maintenace_job_test.rb b/test/unit/jobs/regular_maintenace_job_test.rb index 0cff108369..7b627541b9 100644 --- a/test/unit/jobs/regular_maintenace_job_test.rb +++ b/test/unit/jobs/regular_maintenace_job_test.rb @@ -154,65 +154,6 @@ def setup assert_equal [person3, person4].sort, logs.collect(&:subject).sort end - test 'check authlookup consistency' do - #ensure a consistent initial state - disable_authorization_checks do - Seek::Util.authorized_types.each(&:destroy_all) - Seek::Util.authorized_types.each(&:clear_lookup_table) - end - - User.destroy_all - p = FactoryBot.create(:person) - p2 = FactoryBot.create(:person) - u = FactoryBot.create(:brand_new_user) - - assert_nil u.person - - with_config_value(:auth_lookup_enabled, true) do - assert AuthLookupUpdateQueue.queue_enabled? - - doc1 = FactoryBot.create(:document) - doc2 = FactoryBot.create(:document) - AuthLookupUpdateJob.perform_now - - assert Document.lookup_table_consistent?(p.user) - assert Document.lookup_table_consistent?(p2.user) - assert Document.lookup_table_consistent?(nil) - - assert_no_enqueued_jobs do - assert_no_difference('AuthLookupUpdateQueue.count') do - RegularMaintenanceJob.perform_now - end - end - - # delete a record - Document.lookup_class.where(user_id:p.user.id,asset_id:doc1.id).last.delete - - #duplicate a record - Document.lookup_class.where(user_id:p2.user.id, asset_id:doc2.id).last.dup.save! - - refute Document.lookup_table_consistent?(p.user) - refute Document.lookup_table_consistent?(p2.user) - - #gets immmediately updated for anonymous user - assert Document.lookup_table_consistent?(nil) - - assert_enqueued_jobs(1) do - assert_difference('AuthLookupUpdateQueue.count',1) do - RegularMaintenanceJob.perform_now - end - end - - # double check it will be fixed when the job runs - AuthLookupUpdateJob.perform_now - assert Document.lookup_table_consistent?(p.user) - assert Document.lookup_table_consistent?(p2.user) - assert Document.lookup_table_consistent?(nil) - end - - - end - test 'cleans redundant repositories' do redundant = FactoryBot.create(:blank_repository, created_at: 5.years.ago) redundant_but_in_grace = FactoryBot.create(:blank_repository, created_at: 1.second.ago) diff --git a/test/unit/jobs/reindexing_job_test.rb b/test/unit/jobs/reindexing_job_test.rb index 7bc3f20324..78e8804b89 100644 --- a/test/unit/jobs/reindexing_job_test.rb +++ b/test/unit/jobs/reindexing_job_test.rb @@ -27,6 +27,20 @@ class ReindexingJobTest < ActiveSupport::TestCase end end + test 'dont add items if search disabled' do + p = FactoryBot.create :person + ReindexingQueue.delete_all + + with_config_value(:solr_enabled, false) do + assert_no_enqueued_jobs(only: ReindexingJob) do + assert_no_difference('ReindexingQueue.count') do + ReindexingQueue.enqueue(p) + ReindexingQueue.enqueue(FactoryBot.create(:sop)) + end + end + end + end + test 'gather_items strips deleted (nil) items' do model1 = FactoryBot.create(:model) model2 = FactoryBot.create(:model) @@ -44,4 +58,14 @@ class ReindexingJobTest < ActiveSupport::TestCase assert_includes items, model2 assert_includes items, document end + + test 'follow on job' do + ReindexingQueue.delete_all + refute ReindexingJob.new.follow_on_job? + ReindexingQueue.enqueue(FactoryBot.create(:sop)) + assert ReindexingJob.new.follow_on_job? + with_config_value(:solr_enabled, false) do + refute ReindexingJob.new.follow_on_job? + end + end end diff --git a/test/unit/jobs/sample_data_extraction_job_test.rb b/test/unit/jobs/sample_data_extraction_job_test.rb index 055b83af5a..21e9568d52 100644 --- a/test/unit/jobs/sample_data_extraction_job_test.rb +++ b/test/unit/jobs/sample_data_extraction_job_test.rb @@ -6,6 +6,7 @@ def setup create_sample_attribute_type @person = FactoryBot.create(:project_administrator) User.current_user = @person.user + @project_id = @person.projects.first.id @data_file = FactoryBot.create :data_file, content_blob: FactoryBot.create(:sample_type_populated_template_content_blob), policy: FactoryBot.create(:private_policy), contributor: @person @@ -22,6 +23,22 @@ def setup @sample_type.save! end + test 'extracts samples' do + @data_file.policy = FactoryBot.create(:public_policy) + disable_authorization_checks{@data_file.save!} + job = SampleDataExtractionJob.new + assert_no_difference('Sample.count') do + job.perform(@data_file, @sample_type) + end + samples = job.extractor.fetch + assert_equal 4, samples.count + samples.each do |sample| + assert_equal @sample_type, sample.sample_type + assert_equal [@project_id], sample.project_ids + assert_equal @person, sample.contributor + end + end + test 'records exception' do class FailingSampleDataExtractionJob < SampleDataExtractionJob def perform(data_file, sample_type, assay_ids: nil) diff --git a/test/unit/jobs/sample_data_persist_job_test.rb b/test/unit/jobs/sample_data_persist_job_test.rb index 1d5dbd334a..7031b44536 100644 --- a/test/unit/jobs/sample_data_persist_job_test.rb +++ b/test/unit/jobs/sample_data_persist_job_test.rb @@ -5,7 +5,6 @@ def setup create_sample_attribute_type @person = FactoryBot.create(:project_administrator) User.with_current_user(@person.user) do - @project_id = @person.projects.first.id @data_file = FactoryBot.create :data_file, content_blob: FactoryBot.create(:sample_type_populated_template_content_blob), @@ -33,11 +32,17 @@ def setup end test 'persists samples' do + @data_file.policy = FactoryBot.create(:public_policy, permissions: [FactoryBot.create(:edit_permission)]) + disable_authorization_checks{@data_file.save!} assert_difference('Sample.count', 3) do - assert_difference('ReindexingQueue.count', 3) do - assert_difference('AuthLookupUpdateQueue.count', 3) do - with_config_value(:auth_lookup_enabled, true) do # needed to test added to queue - SampleDataPersistJob.perform_now(@data_file, @sample_type, @person.user) + assert_difference('Policy.count', 3) do + assert_difference('Permission.count', 3) do + assert_difference('ReindexingQueue.count', 3) do + assert_difference('AuthLookupUpdateQueue.count', 3) do + with_config_value(:auth_lookup_enabled, true) do # needed to test added to queue + SampleDataPersistJob.perform_now(@data_file, @sample_type, @person.user) + end + end end end end @@ -48,9 +53,27 @@ def setup assert_equal Task::STATUS_DONE, @data_file.sample_persistence_task.status assert_equal 3, @data_file.extracted_samples.count - assert_equal @sample_type, @data_file.extracted_samples.first.sample_type - assert_equal @person, @data_file.extracted_samples.first.contributor - assert_equal [@project_id], @data_file.extracted_samples.first.project_ids + + samples = @data_file.extracted_samples + + samples.each do |sample| + assert_equal @sample_type, sample.sample_type + assert_equal @person, sample.contributor + assert_equal [@project_id], sample.project_ids + assert_equal @person, sample.contributor + assert_equal Policy::MANAGING, sample.policy.access_type + assert_equal 1, sample.policy.permissions.count + assert_equal Policy::EDITING, sample.policy.permissions.first.access_type + end + + #check the policy and permissions are all uniq and not referencing each other + refute_equal @data_file.policy_id, samples.first.policy_id + policy_ids = samples.collect { |s| s.policy.id } + permission_ids = samples.collect { |s| s.policy.permissions.first.id } + assert_equal 3, policy_ids.count + assert_equal policy_ids, policy_ids.uniq + assert_equal 3, permission_ids.count + assert_equal permission_ids, permission_ids.uniq end test 'persists samples and associate with assay' do diff --git a/test/unit/permissions/auth_lookup_update_queue_test.rb b/test/unit/permissions/auth_lookup_update_queue_test.rb index a1cc616690..95b07d9a8c 100644 --- a/test/unit/permissions/auth_lookup_update_queue_test.rb +++ b/test/unit/permissions/auth_lookup_update_queue_test.rb @@ -161,10 +161,17 @@ def teardown end end - test 'updates when a user registers' do + test 'updates when a user registers but not until associated with a person' do + person = FactoryBot.create(:person) + user = assert_no_difference('AuthLookupUpdateQueue.count') do + FactoryBot.create(:brand_new_user) + end assert_difference('AuthLookupUpdateQueue.count', 1) do - user = FactoryBot.create(:brand_new_user) - assert_equal user, AuthLookupUpdateQueue.order(:id).last.item + user.person = person + user.save! + q = AuthLookupUpdateQueue.order(:id).last + assert_equal user, q.item + assert_equal 1, q.priority end end diff --git a/test/unit/ro_crate/workflow_crate_test.rb b/test/unit/ro_crate/workflow_crate_test.rb new file mode 100644 index 0000000000..f1a85f5109 --- /dev/null +++ b/test/unit/ro_crate/workflow_crate_test.rb @@ -0,0 +1,37 @@ +require 'test_helper' + +class WorkflowCrateTest < ActiveSupport::TestCase + test 'conformsTo' do + crate = ROCrate::WorkflowCrate.new + + ids = crate['conformsTo'].map { |x| x['@id'] } + assert_includes ids, 'https://w3id.org/ro/crate/1.1' + assert_includes ids, 'https://w3id.org/workflowhub/workflow-ro-crate/1.0' + end + + test 'test_suites' do + crate = ROCrate::WorkflowCrate.new + assert_empty crate.test_suites + crate['mentions'] = crate.add_contextual_entity(ROCrate::ContextualEntity.new(crate, '#test_suite', { '@type' => 'TestSuite' })).reference + assert_equal 1, crate.test_suites.length + assert_equal '#test_suite', crate.test_suites.first.id + + crate = ROCrate::WorkflowCrate.new + crate['about'] = [ + crate.add_contextual_entity(ROCrate::ContextualEntity.new(crate, '#test_suite1', { '@type' => 'TestSuite' })).reference, + crate.add_contextual_entity(ROCrate::ContextualEntity.new(crate, '#test_suite2', { '@type' => 'TestSuite' })).reference + ] + assert_equal 2, crate.test_suites.length + crate['mentions'] = crate.add_contextual_entity(ROCrate::ContextualEntity.new(crate, '#test_suite2', { '@type' => 'TestSuite' })).reference + assert_equal 2, crate.test_suites.length + ids = crate.test_suites.map(&:id) + assert_includes ids, '#test_suite1' + assert_includes ids, '#test_suite2' + crate['mentions'] = [crate['mentions'], crate.add_contextual_entity(ROCrate::ContextualEntity.new(crate, '#test_suite3', { '@type' => 'TestSuite' })).reference] + assert_equal 3, crate.test_suites.length + ids = crate.test_suites.map(&:id) + assert_includes ids, '#test_suite1' + assert_includes ids, '#test_suite2' + assert_includes ids, '#test_suite3' + end +end diff --git a/test/unit/sample_attribute_test.rb b/test/unit/sample_attribute_test.rb index 4ab9f2f82e..abe11a0df8 100644 --- a/test/unit/sample_attribute_test.rb +++ b/test/unit/sample_attribute_test.rb @@ -67,6 +67,9 @@ class SampleAttributeTest < ActiveSupport::TestCase sample_type: FactoryBot.create(:simple_sample_type) refute attribute.valid? + attribute.pid = 'Source:bacterial culture' + refute attribute.valid? + attribute.pid = 'http://somewhere.org#fish' assert attribute.valid? attribute.pid = 'dc:fish' @@ -333,6 +336,9 @@ class SampleAttributeTest < ActiveSupport::TestCase attribute = FactoryBot.create(:string_sample_attribute_with_description_and_pid, is_title: true, pid: 'http://pid.org/attr/title', sample_type: FactoryBot.create(:simple_sample_type)) assert_equal 'title',attribute.short_pid + attribute.pid = 'Source:bacterial culture' + assert_equal 'Source:bacterial-culture',attribute.short_pid + attribute = FactoryBot.create(:sample_sample_attribute, sample_type: FactoryBot.create(:simple_sample_type)) assert_equal '', attribute.short_pid end diff --git a/test/unit/sample_controlled_vocab_test.rb b/test/unit/sample_controlled_vocab_test.rb index 6918c77450..c9253225d3 100644 --- a/test/unit/sample_controlled_vocab_test.rb +++ b/test/unit/sample_controlled_vocab_test.rb @@ -312,4 +312,12 @@ class SampleControlledVocabTest < ActiveSupport::TestCase assert vocab.ontology_based? end + test 'should not allow to add term with same label' do + vocab = FactoryBot.create(:apples_sample_controlled_vocab) + vocab.sample_controlled_vocab_terms.create(label: 'Golden Delicious') + assert_raises ActiveRecord::RecordInvalid do + vocab.sample_controlled_vocab_terms.create!(label: 'Golden Delicious') + end + end + end diff --git a/test/unit/samples/sample_type_editing_constraints_test.rb b/test/unit/samples/sample_type_editing_constraints_test.rb index ace957c974..4cfdc03a7a 100644 --- a/test/unit/samples/sample_type_editing_constraints_test.rb +++ b/test/unit/samples/sample_type_editing_constraints_test.rb @@ -87,13 +87,29 @@ class SampleTypeEditingConstraintsTest < ActiveSupport::TestCase assert c.allow_required?(:age) assert c.allow_required?('full name') - # accespts attribute + # accepts attribute attr = c.sample_type.sample_attributes.detect { |t| t.accessor_name == 'address' } refute_nil attr refute c.allow_required?(attr) attr = c.sample_type.sample_attributes.detect { |t| t.accessor_name == 'age' } refute_nil attr assert c.allow_required?(attr) + + # should refute if inherited from a template + template = FactoryBot.create(:isa_source_template) + sample_type_from_template = create_sample_type_from_template(template, c.sample_type.projects.first, c.sample_type.contributor) + sample_type_from_template.sample_attributes << FactoryBot.create(:sample_attribute, title: 'Extra Source Characteristic', sample_attribute_type: FactoryBot.create(:string_sample_attribute_type), required: false, isa_tag_id: FactoryBot.create(:source_characteristic_isa_tag).id, sample_type: sample_type_from_template) + + c_inherited = Seek::Samples::SampleTypeEditingConstraints.new(sample_type_from_template) + sample_type_from_template.sample_attributes.each do |attr| + if attr.title == 'Extra Source Characteristic' + refute c_inherited.send(:inherited?, attr) + assert c_inherited.allow_required?(attr) + else + assert c_inherited.send(:inherited?, attr) + refute c_inherited.allow_required?(attr) + end + end end test 'allow_attribute_removal?' do
    Order
    - <%= button_link_to('Add new attribute', 'add', '#', id: 'add-attribute') %> + <%= button_link_to('Add new attribute', 'add', '#', id: 'add-attribute', class: @template.new_record? ? 'hidden' : '') %>