Skip to content

Commit

Permalink
records: upgrade jsonschema version
Browse files Browse the repository at this point in the history
* adds internal notes
  • Loading branch information
kpsherva authored and zzacharo committed Nov 8, 2024
1 parent ae3e7ea commit 7e2b195
Show file tree
Hide file tree
Showing 11 changed files with 499 additions and 49 deletions.
15 changes: 8 additions & 7 deletions invenio_rdm_records/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
from datetime import timedelta

import idutils
from invenio_administration.permissions import administration_permission
from invenio_access.permissions import system_permission
from invenio_i18n import lazy_gettext as _
from invenio_records_resources.services.records.queryparser import QueryParser
from invenio_records_resources.services.records.queryparser.transformer import (
RestrictedTerm,
RestrictedTermValue,
SearchFieldTransformer,
)

Expand Down Expand Up @@ -274,12 +275,12 @@ def always_valid(identifier):
],
"query_parser_cls": QueryParser.factory(
mapping={
"internal_notes.note": RestrictedTerm(administration_permission),
"internal_notes.id": RestrictedTerm(administration_permission),
"internal_notes.added_by": RestrictedTerm(administration_permission),
"internal_notes.timestamp": RestrictedTerm(administration_permission),
"_exists_": RestrictedTerm(
administration_permission, word=word_internal_notes
"internal_notes.note": RestrictedTerm(system_permission),
"internal_notes.id": RestrictedTerm(system_permission),
"internal_notes.added_by": RestrictedTerm(system_permission),
"internal_notes.timestamp": RestrictedTerm(system_permission),
"_exists_": RestrictedTermValue(
system_permission, word=word_internal_notes
),
},
tree_transformer_cls=SearchFieldTransformer,
Expand Down
2 changes: 1 addition & 1 deletion invenio_rdm_records/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class CommonFieldsMixin:

# Remember to update INDEXER_DEFAULT_INDEX in Invenio-App-RDM if you
# update the JSONSchema and mappings to a new version.
schema = ConstantField("$schema", "local://records/record-v6.0.0.json")
schema = ConstantField("$schema", "local://records/record-v7.0.0.json")

dumper = SearchDumper(
extensions=[
Expand Down
18 changes: 0 additions & 18 deletions invenio_rdm_records/records/jsonschemas/records/record-v6.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,24 +379,6 @@
}
}
},
"internal_notes": {
"properties": {
"id": {
"type": "string"
},
"note": {
"type": "string"
},
"timestamp": {
"type": "string",
"description": "ISO8601 formatted timestamp in UTC.",
"format": "date-time"
},
"added_by": {
"$ref": "local://records/definitions-v2.0.0.json#/agent"
}
}
},
"provenance": {
"type": "object",
"description": "Record provenance.",
Expand Down
Loading

0 comments on commit 7e2b195

Please sign in to comment.