Skip to content

Commit

Permalink
feat: APPS 2389 2396 2397 Add identifier_global, history, edition met…
Browse files Browse the repository at this point in the history
…adata fields (#1135)

* add Aidentifier_global, edition and history metadata fields

* fix spec errors

* fix specs

* fix linting error

* fix error in spec

* fix specs

* fix specs

* fix linting

* fix linting

* update catalog controller alphabetically to match the spec and make it easier to read

* fix linting errors

* add oai terms

* update the oai yaml

* update identifier_global_tesim to identifier_global_ssim
  • Loading branch information
jendiamond authored Dec 12, 2023
1 parent 878a46a commit fd25d46
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 189 deletions.
261 changes: 110 additions & 151 deletions app/controllers/catalog_controller.rb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/metadata/find_this_item_metadata.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
repository_tesim: "Repository"
local_identifier_ssim: "Local identifier"
identifier_global_ssim: "Identifier"
opac_url_tesim: "Opac url"
oclc_ssi: "OCLC Number"
ark_ssi: "ARK"
1 change: 1 addition & 0 deletions config/metadata/item_overview_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ uniform_title_tesim: 'Uniform title'
# Relators
creator_tesim: 'Creator'
author_tesim: 'Author'
edition_ssm: 'Edition'
editor_tesim: 'Editor'
photographer_tesim: 'Photographer'
architect_tesim: 'Architect'
Expand Down
1 change: 1 addition & 0 deletions config/metadata/note_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description_tesim: 'Description'
caption_tesim: 'Caption'
contents_note_tesim: 'Contents note'
colophon_tesim: 'Colophon'
history_tesim: 'History'
provenance_tesim: 'Provenance'
note_tesim: 'Note'
related_to_ssm: 'Related items'
Expand Down
4 changes: 4 additions & 0 deletions config/oai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ default:
alternative:
- alternative_title_tesim
- uniform_title_tesim
- edition_ssm
creator:
- creator_tesim
contributor:
Expand Down Expand Up @@ -63,6 +64,7 @@ default:
- content_disclaimer_ssm
- resp_statement_tesim
- citation_source_tesim
- history_tesim
format:
- format_tesim
- format_book_tesim
Expand All @@ -78,6 +80,7 @@ default:
- opac_url_ssi
- oclc_ssi
- ark_ssi
- identifier_global_ssim
source:
- member_of_collections_ssim
DC:
Expand All @@ -88,6 +91,7 @@ DC:
description:
- content_disclaimer_ssm
- related_to_ssm

DPLA:
parent_schema: default
object:
Expand Down
140 changes: 105 additions & 35 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,111 @@
.show_fields.keys
end
let(:expected_show_fields) do
["architect_tesim", "alternative_title_tesim", "ark_ssi", "author_tesim",
"based_near_label_tesim", "binding_note_ssi", "calligrapher_tesim",
"caption_tesim", "collation_tesim", "colophon_tesim", "composer_tesim",
"condition_note_ssi", "contents_note_tesim", "contributor_tesim",
"creator_tesim", "date_created_tesim", "description_tesim",
"dimensions_tesim", "dlcs_collection_name_tesim", "editor_tesim",
"engraver_tesim", "explicit_tesim", "extent_tesim", "features_tesim",
"finding_aid_url_ssm", "foliation_tesim", "format_tesim",
"funding_note_tesim", "genre_tesim", "geographic_coordinates_ssim",
"human_readable_resource_type_tesim",
"human_readable_rights_statement_tesim",
"human_readable_language_tesim",
"identifier_tesim", "illuminator_tesim", "illustrator_tesim",
"iiif_manifest_url_ssi", "illustrations_note_tesim", "incipit_tesim",
"inscription_tesim", "keyword_tesim", "latitude_tesim",
"local_rights_statement_ssm", "location_tesim", "local_identifier_ssim",
"longitude_tesim", "lyricist_tesim", "medium_tesim",
"member_of_collections_ssim", "named_subject_tesim", "note_tesim",
"oclc_ssi", "opac_url_ssi", "page_layout_ssim", "photographer_tesim",
"place_of_origin_tesim", "printmaker_tesim", "provenance_tesim", "program_tesim",
"publisher_tesim", "repository_tesim", "rights_country_tesim",
"rights_holder_tesim", "rubricator_tesim", "scribe_tesim", "script_tesim",
"series_tesim", "services_contact_ssm", "subject_tesim", "subject_cultural_object_tesim",
"subject_domain_topic_tesim", "subject_topic_tesim",
"summary_tesim", "support_tesim", "title_tesim", "toc_tesim",
"uniform_title_tesim", "hand_note_tesim", "writing_system_tesim",
"commentator_tesim", "translator_tesim", "license_tesim",
"normalized_date_sim", "subject_geographic_tesim",
"subject_temporal_tesim", "associated_name_tesim",
"descriptive_title_tesim", "form_ssi", "references_tesim",
"shelfmark_ssi", "other_versions_tesim", "content_disclaimer_ssm",
"interviewer_tesim", "interviewee_tesim", "cartographer_tesim",
"artist_tesim", "recipient_tesim", "director_tesim", "producer_tesim", "host_tesim",
"musician_tesim", "printer_tesim", "researcher_tesim",
'format_book_tesim', 'resp_statement_tesim', 'citation_source_tesim', 'related_to_ssm', 'human_readable_related_record_title_ssm', "oai_set_ssim"]
[
"architect_tesim",
"alternative_title_tesim",
"ark_ssi",
"artist_tesim",
"author_tesim",
"based_near_label_tesim",
"binding_note_ssi",
"calligrapher_tesim",
"caption_tesim",
"cartographer_tesim",
'citation_source_tesim',
"collation_tesim",
"colophon_tesim",
"commentator_tesim",
"composer_tesim",
"condition_note_ssi",
"content_disclaimer_ssm",
"contents_note_tesim",
"contributor_tesim",
"creator_tesim",
"date_created_tesim",
"description_tesim",
"dimensions_tesim",
"director_tesim",
"dlcs_collection_name_tesim",
"edition_ssm",
"editor_tesim",
"engraver_tesim",
"extent_tesim",
"features_tesim",
"finding_aid_url_ssm",
"foliation_tesim",
"form_ssi",
'format_book_tesim',
"format_tesim",
"funding_note_tesim",
"genre_tesim",
"geographic_coordinates_ssim",
"hand_note_tesim",
"history_tesim",
"host_tesim",
"human_readable_language_tesim",
"human_readable_resource_type_tesim",
'human_readable_related_record_title_ssm',
"human_readable_rights_statement_tesim",
"identifier_tesim",
"identifier_global_ssim",
"iiif_manifest_url_ssi",
"illuminator_tesim",
"illustrations_note_tesim",
"illustrator_tesim",
"interviewee_tesim",
"interviewer_tesim",
"keyword_tesim",
"latitude_tesim",
"license_tesim",
"local_identifier_ssim",
"local_rights_statement_ssm",
"location_tesim",
"longitude_tesim",
"lyricist_tesim",
"medium_tesim",
"member_of_collections_ssim",
"musician_tesim",
"named_subject_tesim",
"normalized_date_sim",
"note_tesim",
"oai_set_ssim",
"oclc_ssi",
"opac_url_ssi",
"other_versions_tesim",
"page_layout_ssim",
"photographer_tesim",
"place_of_origin_tesim",
"printer_tesim",
"printmaker_tesim",
"producer_tesim",
"program_tesim",
"provenance_tesim",
"publisher_tesim",
"recipient_tesim",
'related_to_ssm',
"repository_tesim",
"researcher_tesim",
'resp_statement_tesim',
"rights_country_tesim",
"rights_holder_tesim",
"rubricator_tesim",
"scribe_tesim",
"series_tesim",
"services_contact_ssm",
"subject_cultural_object_tesim",
"subject_domain_topic_tesim",
"subject_geographic_tesim",
"subject_temporal_tesim",
"subject_tesim",
"subject_topic_tesim",
"summary_tesim",
"support_tesim",
"title_tesim",
"toc_tesim",
"translator_tesim",
"uniform_title_tesim"
]
end

it 'has exactly expected show fields' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{
'repository_tesim' => 'Repository',
'local_identifier_ssim' => 'Local identifier',
'identifier_global_ssim' => 'Identifier',
'opac_url_tesim' => 'Opac url',
'oclc_ssi' => 'OCLC Number',
'ark_ssi' => 'ARK'
Expand All @@ -32,6 +33,10 @@
expect(config['local_identifier_ssim'].to_s).to eq('Local identifier')
end

it 'returns the Identifier' do
expect(config['identifier_global_ssim'].to_s).to eq('Identifier')
end

it 'returns the Opac url' do
expect(config['opac_url_tesim'].to_s).to eq 'Opac url'
end
Expand All @@ -52,7 +57,7 @@
it "returns existing keys" do
expect(presenter_object.find_this_item_terms).to be_instance_of(Hash)
expect(presenter_object.find_this_item_terms.include?('ark_ssi')).to be true
expect(all).to eq 5
expect(all).to eq 6
expect(config.length).to eq all
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'date_created_tesim' => 'Date Created',
'descriptive_title_tesim' => 'Descriptive title',
'director_tesim' => 'Director',
'edition_ssm' => 'Edition',
'editor_tesim' => 'Editor',
'engraver_tesim' => 'Engraver',
'human_readable_language_tesim' => 'Language',
Expand Down Expand Up @@ -126,6 +127,10 @@
expect(config['director_tesim'].to_s).to eq('Director')
end

it 'returns the Edition Key' do
expect(config['edition_ssm'].to_s).to eq('Edition')
end

it 'returns the Editor Key' do
expect(config['editor_tesim'].to_s).to eq('Editor')
end
Expand Down Expand Up @@ -228,7 +233,7 @@
let(:missing) { presenter_object_missing_items.overview_terms.keys.length }

it "returns existing keys" do
expect(all).to eq 44
expect(all).to eq 45
expect(config.length).to eq all
end

Expand Down
7 changes: 6 additions & 1 deletion spec/presenters/ursus/note_metadata_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'caption_tesim' => 'Caption',
'contents_note_tesim' => 'Contents note',
'colophon_tesim' => 'Colophon',
'history_tesim' => 'History',
'provenance_tesim' => 'Provenance',
'note_tesim' => 'Note',
'related_to_ssm' => 'Related items',
Expand Down Expand Up @@ -52,6 +53,10 @@
expect(config['colophon_tesim'].to_s).to eq('Colophon')
end

it 'returns the History Key' do
expect(config['history_tesim'].to_s).to eq('History')
end

it 'returns the Provenance Key' do
expect(config['provenance_tesim'].to_s).to eq('Provenance')
end
Expand Down Expand Up @@ -91,7 +96,7 @@

it "returns existing keys" do
expect(presenter_object.note_terms).to be_instance_of(Hash)
expect(all).to eq 13
expect(all).to eq 14
expect(config.length).to eq all
end

Expand Down

0 comments on commit fd25d46

Please sign in to comment.