Skip to content

Commit

Permalink
Merge branch 'main' into i359-notify
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Oct 25, 2022
2 parents a46517d + b5e0e0b commit 2c96d91
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 92 deletions.
82 changes: 3 additions & 79 deletions app/views/works/_edit_javascript.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,7 @@
}

var contributorRoles = function() {
var roles = [];
roles.push({key: "ContactPerson", value: "Contact Person"})
roles.push({key: "DataCollector", value: "Data Collector"})
roles.push({key: "DataCurator", value: "Data Curator"})
roles.push({key: "DataManager", value: "Data Manager"})
roles.push({key: "Distributor", value: "Distributor"})
roles.push({key: "Editor", value: "Editor"})
roles.push({key: "HostingInstitution", value: "Hosting Institution"})
roles.push({key: "Producer", value: "Producer"})
roles.push({key: "ProjectLeader", value: "Project Leader"})
roles.push({key: "ProjectManager", value: "Project Manager"})
roles.push({key: "ProjectMember", value: "Project Member"})
roles.push({key: "RegistrationAgency", value: "Registration Agency"})
roles.push({key: "RegistrationAuthority", value: "Registration Authority"})
roles.push({key: "RelatedPerson", value: "Related Person"})
roles.push({key: "Researcher", value: "Researcher"})
roles.push({key: "ResearchGroup", value: "Research Group"})
roles.push({key: "RightsHolder", value: "Rights Holder"})
roles.push({key: "Sponsor", value: "Sponsor"})
roles.push({key: "Supervisor", value: "Supervisor"})
roles.push({key: "WorkPackageLeader", value: "Work Package Leader"})
roles.push({key: "Other", value: "Other"})
return roles;
return <%= raw(Datacite::Mapping::ContributorType.to_a.map{ |rel| { key: rel.key, value: rel.value } }.to_json) %>;
}

var rolesHtml = function(roleId, activeRole) {
Expand Down Expand Up @@ -135,65 +113,11 @@
}

var relationTypes = function() {
var types = [];
types.push({key: "IS_CITED_BY", value: "IsCitedBy"})
types.push({key: "CITES", value: "Cites"})
types.push({key: "IS_SUPPLEMENT_TO", value: "IsSupplementTo"})
types.push({key: "IS_SUPPLEMENTED_BY", value: "IsSupplementedBy"})
types.push({key: "IS_CONTINUED_BY", value: "IsContinuedBy"})
types.push({key: "CONTINUES", value: "Continues"})
types.push({key: "HAS_METADATA", value: "HasMetadata"})
types.push({key: "IS_METADATA_FOR", value: "IsMetadataFor"})
types.push({key: "IS_NEW_VERSION_OF", value: "IsNewVersionOf"})
types.push({key: "IS_PREVIOUS_VERSION_OF", value: "IsPreviousVersionOf"})
types.push({key: "HAS_VERSION", value: "HasVersion"})
types.push({key: "IS_VERSION_OF", value: "IsVersionOf"})
types.push({key: "IS_PART_OF", value: "IsPartOf"})
types.push({key: "HAS_PART", value: "HasPart"})
types.push({key: "IS_REFERENCED_BY", value: "IsReferencedBy"})
types.push({key: "REFERENCES", value: "References"})
types.push({key: "IS_DOCUMENTED_BY", value: "IsDocumentedBy"})
types.push({key: "DOCUMENTS", value: "Documents"})
types.push({key: "IS_COMPILED_BY", value: "IsCompiledBy"})
types.push({key: "COMPILES", value: "Compiles"})
types.push({key: "IS_VARIANT_FORM_OF", value: "IsVariantFormOf"})
types.push({key: "IS_ORIGINAL_FORM_OF", value: "IsOriginalFormOf"})
types.push({key: "IS_IDENTICAL_TO", value: "IsIdenticalTo"})
types.push({key: "IS_REVIEWED_BY", value: "IsReviewedBy"})
types.push({key: "REVIEWS", value: "Reviews"})
types.push({key: "IS_DERIVED_FROM", value: "IsDerivedFrom"})
types.push({key: "IS_SOURCE_OF", value: "IsSourceOf"})
types.push({key: "IS_OBSOLETED_BY", value: "IsObsoletedBy"})
types.push({key: "OBSOLETES", value: "Obsoletes"})
types.push({key: "IS_DESCRIBED_BY", value: "IsDescribedBy"})
types.push({key: "DESCRIBES", value: "Describes"})
types.push({key: "IS_REQUIRED_BY", value: "IsRequiredBy"})
types.push({key: "REQUIRES", value: "Requires"})
return types;
return <%= raw(Datacite::Mapping::RelationType.to_a.map{ |rel| { key: rel.key, value: rel.value } }.to_json) %>;
}

var relatedIdentifierTypes = function() {
var types = [];
types.push({key: "ARK", value: "ARK"})
types.push({key: "ARXIV", value: "arXiv"})
types.push({key: "BIBCODE", value: "bibcode"})
types.push({key: "DOI", value: "DOI"})
types.push({key: "EAN13", value: "EAN13"})
types.push({key: "EISSN", value: "EISSN"})
types.push({key: "HANDLE", value: "Handle"})
types.push({key: "ISBN", value: "ISBN"})
types.push({key: "ISSN", value: "ISSN"})
types.push({key: "ISTC", value: "ISTC"})
types.push({key: "LISSN", value: "LISSN"})
types.push({key: "LSID", value: "LSID"})
types.push({key: "PMID", value: "PMID"})
types.push({key: "PURL", value: "PURL"})
types.push({key: "UPC", value: "UPC"})
types.push({key: "URL", value: "URL"})
types.push({key: "URN", value: "URN"})
types.push({key: "IGSN", value: "IGSN"})
types.push({key: "W3ID", value: "w3id"})
return types;
return <%= raw(Datacite::Mapping::RelatedIdentifierType.to_a.map{ |rel| { key: rel.key, value: rel.value } }.to_json) %>;
}

// ************************************************ //
Expand Down
2 changes: 1 addition & 1 deletion app/views/works/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<h2 class="h2"><%= t('works.uploads.post_curation.heading') %></h2>
<%= render(partial: 'works/uploads/post_curation_s3_resources') %>
</section>
<% else %>
<% else %>
<%= render(partial: 'works/uploads_form', locals: { form: form }) %>
<% end %>
</div>
Expand Down
24 changes: 12 additions & 12 deletions spec/system/view_data_in_s3_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@
expect(page).to have_content file1.filename
expect(page).to have_content file2.filename
end
end

context "when user is a super super_admin_user" do
let(:user) { FactoryBot.create(:research_data_moderator) }
it "shows data from S3" do
stub_s3(data: s3_data)
visit work_path(work)
expect(page).to have_content file1.filename
expect(page).to have_content file2.filename

click_on "Edit"
expect(page).to have_content file1.filename
expect(page).to have_content file2.filename
end
context "when user is a super admin user" do
let(:user) { FactoryBot.create(:research_data_moderator) }
it "shows data from S3" do
stub_s3(data: s3_data)
visit work_path(work)
expect(page).to have_content file1.filename
expect(page).to have_content file2.filename

click_on "Edit"
expect(page).to have_content file1.filename
expect(page).to have_content file2.filename
end
end
end
Expand Down

0 comments on commit 2c96d91

Please sign in to comment.