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

beams: convert cf to vocabulary #269

Merged
merged 1 commit into from
Nov 26, 2024
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
5 changes: 4 additions & 1 deletion app_data/vocabularies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ departments:
data-file: vocabularies/departments.yaml
accelerators:
pid-type: acc
data-file: vocabularies/accelerators.yaml
data-file: vocabularies/accelerators.yaml
beams:
pid-type: bea
data-file: vocabularies/beams.yaml
54 changes: 54 additions & 0 deletions app_data/vocabularies/beams.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
- id: X5
title:
en: X5
- id: H2
title:
en: H2
- id: M2
title:
en: M2
- id: H2-VLE
title:
en: H2-VLE
- id: H8
title:
en: H8
- id: T9
title:
en: T9
- id: T7
title:
en: T7
- id: T11
title:
en: T11
- id: X1
title:
en: X1
- id: T10
title:
en: T10
- id: T8
title:
en: T8
- id: K12
title:
en: K12
- id: H4-VLE
title:
en: H4-VLE
- id: T4
title:
en: T4
- id: H6
title:
en: H6
- id: H4
title:
en: H4
- id: X3
title:
en: X3
- id: X7
title:
en: X7
21 changes: 16 additions & 5 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,12 @@ RDM_CUSTOM_FIELDS = [
KeywordCF(name="cern:projects", multiple=True),
KeywordCF(name="cern:facilities", multiple=True),
KeywordCF(name="cern:studies", multiple=True),
KeywordCF(name="cern:beams", multiple=True),
VocabularyCF(
name="cern:beams",
vocabulary_id="beams",
dump_options=True,
multiple=True,
)
]

THEME_MATHJAX_CDN = (
Expand Down Expand Up @@ -372,16 +377,22 @@ RDM_CUSTOM_FIELDS_UI = [
),
dict(
field="cern:beams",
ui_widget="MultiInput",
ui_widget="Dropdown",
props=dict(
label=_("Beams"),
label="Beam",
icon="bullseye",
description="Please select a recognised beam from the list if applicable e.g H4, X7, T9 etc.",
search=False,
multiple=True,
sort_by="title_sort",
clearable=True,
type="text",
description="You should fill this field with one of the beams e.g H4, X7, T9 etc.",
multiple_values=True,
autocompleteFrom="/api/vocabularies/beams",
note=_(
"The specific beam of the data record, e.g., H4."
),
),
)
)
]
},
Expand Down