cocina_display 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: add082bf5794bc0df8fc9480cae4fe320b295867ec41ee09099ba5a5333eab93
4
- data.tar.gz: d0a5d92a67890c13ef0e26876655956c277c04571ccefb5ab120d5e68e058137
3
+ metadata.gz: 225982c5b9748bc337ec552e64becdb2ad78c1e6c2bb8ac8e9c77064140bf69b
4
+ data.tar.gz: 64e7a2349e5b7e3cd0deca4675423ab135cf270d228ff067b7872637a2b79f48
5
5
  SHA512:
6
- metadata.gz: 2828617fb57955a4578da26efb839c038df38809417c5fe63bcc44fe7ec8d3412c7ebf8259679e984e997f28e9d535a200818e4a546b0f26b4f3df122cd96e85
7
- data.tar.gz: 0a6e51f36f516c1e414f8aa2cf10828a1608509dd7f06da9be2b5a3d866141c3be02cfcf3f1a282c08d00097880ee96e79d4cf0d4e61bdd4c6084d4322f65c2d
6
+ metadata.gz: 6ebdbca3032b4b8f54dd63d7f62ee9fea98a8380de0981d5acaa335bec5093cb0f170c1237fee7388461ca2d6786da35b58f90dfdf9017ae5d3eb96f33c11cf3
7
+ data.tar.gz: 736d1e098f29f20a4a480c99d91642f664d62e4c25aa449505e5421047d7d84d2f9ba56741d8a8c33755832718d9c092fb77b867cd64b3b483a6d359d2022fcb
@@ -26,26 +26,20 @@ en:
26
26
  note: Note
27
27
  resource_type: Resource Type
28
28
  identifier:
29
- doi: DOI
30
- handle: Handle
31
29
  identifier: Identifier
30
+ local: Local identifier
31
+ other: Other identifier
32
+ doi: DOI
32
33
  isbn: ISBN
33
34
  ismn: ISMN
34
35
  isrc: ISRC
35
36
  issn: ISSN
36
37
  issn_l: ISSN
37
- issue_number: Issue number
38
- language: Language
39
38
  lccn: LCCN
40
- matrix_number: Matrix number
41
- music_plate: Music plate
42
- music_publisher: Music publisher
43
39
  oclc: OCLC
44
40
  orcid: ORCID
45
41
  sici: SICI
46
- stock_number: Stock number
47
42
  upc: UPC
48
- videorecording_identifier: Videorecording identifier
49
43
  language: Language
50
44
  license: License
51
45
  note:
@@ -44,8 +44,9 @@ module CocinaDisplay
44
44
  # All {Title} objects, grouped by their label for display.
45
45
  # @note All primary titles are included under "Title", not just the first.
46
46
  # @return [Array<DisplayData>]
47
- def title_display_data
48
- DisplayData.from_objects(all_titles)
47
+ # @param exclude_primary [Boolean] Exclude primary titles. Defaults to false.
48
+ def title_display_data(exclude_primary: false)
49
+ DisplayData.from_objects(exclude_primary ? secondary_titles : all_titles)
49
50
  end
50
51
 
51
52
  # The first title marked primary, or the first without a type.
@@ -80,7 +80,7 @@ module CocinaDisplay
80
80
  # @return [String]
81
81
  def label
82
82
  cocina["displayLabel"].presence ||
83
- I18n.t(label_key, default: :identifier, scope: "cocina_display.field_label.identifier")
83
+ I18n.t(label_key, default: default_label, scope: "cocina_display.field_label.identifier")
84
84
  end
85
85
 
86
86
  # Check if the identifier is a DOI.
@@ -92,6 +92,12 @@ module CocinaDisplay
92
92
 
93
93
  private
94
94
 
95
+ # Default label for an identifier, based on its type.
96
+ # @return [String]
97
+ def default_label
98
+ type&.capitalize || :identifier
99
+ end
100
+
95
101
  # Key used for i18n lookup of the label, based on the type.
96
102
  # @return [String, nil]
97
103
  def label_key
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module CocinaDisplay
5
- VERSION = "1.11.0" # :nodoc:
5
+ VERSION = "1.12.0" # :nodoc:
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina_display
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Budak
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-03 00:00:00.000000000 Z
10
+ date: 2026-03-04 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: janeway-jsonpath