Skip to content

Commit 38eb875

Browse files
committed
Merge branch 'seek-1.17' into extended-publication-type
2 parents d539480 + 987ad29 commit 38eb875

39 files changed

+1717
-121
lines changed

app/assets/javascripts/single_page/index.js.erb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function rowHasHiddenFields(row) {
223223
// This function is called when 'excel-export' btn is clicked.
224224
// Posts the content of the dynamic table to the single_pages_controller,
225225
// which generates an excel workbook based on a template.
226-
async function exportToExcel(tableName, studyId, assayId, sampleTypeId) {
226+
async function exportToExcel(tableName, studyId, assayId, sampleTypeId, projectId) {
227227
const table = $j(`table[id=${tableName}]`);
228228

229229
// Checks whether the dynamic table has errors
@@ -296,7 +296,16 @@ async function exportToExcel(tableName, studyId, assayId, sampleTypeId) {
296296
alert(`Failed to export through excel!\nStatus: ${response.status} - ${JSON.stringify(response.error().statusText)}\nError: ${response.responseText}`);
297297
})
298298
.always( function(response){
299-
setTimeout(() => {location.reload()}, 2000);
299+
setTimeout(() => {
300+
const itemType = assayId == null ? 'study' : 'assay';
301+
const itemId = assayId == null ? studyId : assayId;
302+
if (projectId != null && itemType && itemId != null) {
303+
window.location.href = `/single_pages/${projectId}?item_type=${itemType}&item_id=${itemId}`;
304+
} else {
305+
// If one of the variables is missing, just reload the current page.
306+
location.reload();
307+
}
308+
}, 2000);
300309
});
301310
}
302311

app/models/sop.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class Sop < ApplicationRecord
22

33
include Seek::Rdf::RdfGeneration
4+
include Seek::BioSchema::Support
45

56
has_and_belongs_to_many :direct_studies, class_name: 'Study'
67

app/views/isa_assays/_assay_samples.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
}
7474

7575
function sampleExportExcel() {
76-
exportToExcel("assay-samples-table", '<%=assay.study_id%>', '<%=assay.id%>', '<%=sample_type.id%>');
76+
exportToExcel("assay-samples-table", <%= assay&.study_id %>, <%= assay&.id %>, <%= sample_type.id %>, <%= project&.id %>);
7777
}
7878

7979
function assaySampleUploadExcel(){

app/views/isa_studies/_source_material.html.erb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ uploadExcel: 'sourceUploadExcel()', sample_type_id: sample_type&.id} %>
6060
$j(".dataTables_scrollBody").css("min-height", "300px");
6161
});
6262
63-
function SourcePasteFromClipboard(){
64-
window.sourceDynamicTable.pasteFromClipboard()
65-
}
66-
6763
function SourceSave(){
6864
window.sourceDynamicTable.save()
6965
}
@@ -77,7 +73,7 @@ uploadExcel: 'sourceUploadExcel()', sample_type_id: sample_type&.id} %>
7773
}
7874
7975
function sourceExportExcel() {
80-
exportToExcel("source-material-table", '<%=study.id%>', null, '<%=sample_type.id%>');
76+
exportToExcel("source-material-table", <%=study.id%>, null, <%=sample_type.id%>, <%= project.id %>);
8177
}
8278

8379
function sourceUploadExcel(){

app/views/isa_studies/_study_design.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<% study ||= nil %>
2-
<% valid_study = study&.sample_types.present? %>
31
<%
4-
source_table_action = displaying_single_page? ? "highlightTreeviewItem('source_table')" : "loadDynamicTableFromDefaultView('source_table')"
5-
study_protocol_action = displaying_single_page? ? "highlightTreeviewItem('study_protocol')" : "loadDynamicTableFromDefaultView('study_protocol')"
6-
study_samples_table_action = displaying_single_page? ? "highlightTreeviewItem('study_samples_table')" : "loadDynamicTableFromDefaultView('study_samples_table')"
7-
study_experiment_overview_action = displaying_single_page? ? "highlightTreeviewItem('study_experiment_overview')" : "loadDynamicTableFromDefaultView('study_experiment_overview')"
2+
study ||= nil
3+
valid_study = study&.sample_types.present?
4+
source_table_action = displaying_single_page? ? "highlightTreeviewItem('source_table')" : "loadDynamicTableFromDefaultView('source_table')"
5+
study_protocol_action = displaying_single_page? ? "highlightTreeviewItem('study_protocol')" : "loadDynamicTableFromDefaultView('study_protocol')"
6+
study_samples_table_action = displaying_single_page? ? "highlightTreeviewItem('study_samples_table')" : "loadDynamicTableFromDefaultView('study_samples_table')"
7+
study_experiment_overview_action = displaying_single_page? ? "highlightTreeviewItem('study_experiment_overview')" : "loadDynamicTableFromDefaultView('study_experiment_overview')"
88
%>
99

1010
<% if valid_study %>

app/views/isa_studies/_study_samples.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
}
7171

7272
function sampleExportExcel() {
73-
exportToExcel("study-samples-table", '<%=study.id%>', null, '<%=sample_type.id%>');
73+
exportToExcel("study-samples-table", <%= study&.id %>, null, <%= sample_type.id %>, <%= project&.id %>);
7474
}
7575

7676
function studySampleUploadExcel(){

lib/seek/bio_schema/resource_decorators/assets_creator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module BioSchema
33
module ResourceDecorators
44
# Decorator that provides extensions for a creator
55
class AssetsCreator < Thing
6-
PERSON_PROFILE = 'https://bioschemas.org/profiles/Person/0.2-DRAFT-2019_07_19/'.freeze
6+
PERSON_PROFILE = 'https://bioschemas.org/profiles/Person/0.3-DRAFT'.freeze
77

88
schema_mappings given_name: :givenName,
99
family_name: :familyName,

lib/seek/bio_schema/resource_decorators/collection.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ def schema_type
99
'Collection'
1010
end
1111

12-
def conformance
13-
'https://schema.org/Collection'
14-
end
15-
1612
def schema_enabled_assets
1713
assets.reject(&:blank?).select(&:schema_org_supported?)
1814
end

lib/seek/bio_schema/resource_decorators/creative_work.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CreativeWork < Thing
1717
subject_of: :subjectOf,
1818
part_of: :isPartOf,
1919
doi: :identifier,
20-
previous_version_url: :isBasedOn
20+
previous_version_url: :isBasedOn
2121

2222
def doi
2323
"https://doi.org/#{resource.doi}" if resource.try(:doi).present?

lib/seek/bio_schema/resource_decorators/data_file.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DataFile < CreativeWork
88

99
schema_mappings distribution: :distribution
1010

11-
DATASET_PROFILE = 'https://bioschemas.org/profiles/Dataset/0.3-RELEASE-2019_06_14/'.freeze
11+
DATASET_PROFILE = 'https://bioschemas.org/profiles/Dataset/1.0-RELEASE'.freeze
1212

1313
def description
1414
description = resource.description&.truncate(4999)
@@ -19,6 +19,7 @@ def description
1919
def distribution
2020
return unless resource.content_blob
2121
return if resource.content_blob.show_as_external_link?
22+
2223
blob = resource.content_blob
2324
data = {
2425
'@type': 'DataDownload',

0 commit comments

Comments
 (0)