Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#801] Export Metadata Subfield Formats #815

Merged
merged 1 commit into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions app/models/invenio_rdm_record_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def invenio_metadata(gf)
"resource_type": resource_type(gf.resource_type.shift),
"creators": creators(gf.creator),
"title": gf.title.first,
"additional_titles": gf.title.last(gf.title.size-1).map{ |title| {"title": title, "type": "alternative_title", "lang": "eng"} }
"additional_titles": gf.title.last(gf.title.size-1).map{ |title| {"title": title, "type": "alternative_title", "lang": "eng"} },
"formats": gf.mime_type
}
end

Expand Down Expand Up @@ -137,9 +138,4 @@ def creators(creators)
}
end
end

def format_creator_names(creator_name)
family_name = creator_name.pop # remove last value from display name
given_name = creator_name.join(' ') # the remaining strings becomes given name
end
Meowcenary marked this conversation as resolved.
Show resolved Hide resolved
end
6 changes: 4 additions & 2 deletions spec/models/invenio_rdm_record_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
proxy_depositor: assistant.username,
on_behalf_of: user.username,
creator: [user.formal_name],
title: ["Primary Title"]
title: ["Primary Title"],
mime_type: 'application/pdf'
)
}
let(:json) do
Expand Down Expand Up @@ -50,7 +51,8 @@
"title": "Tertiary Title",
"type": "alternative_title",
"lang": "eng"
}]
}],
"formats": "application/pdf"
},
"provenance": {
"created_by": {
Expand Down