invenio-vocabularies 3.1.0__py2.py3-none-any.whl → 3.2.0__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of invenio-vocabularies might be problematic. Click here for more details.

@@ -10,6 +10,6 @@
10
10
 
11
11
  from .ext import InvenioVocabularies
12
12
 
13
- __version__ = "3.1.0"
13
+ __version__ = "3.2.0"
14
14
 
15
15
  __all__ = ("__version__", "InvenioVocabularies")
@@ -16,13 +16,18 @@ function CustomAwardForm({ deserializeFunder, selectedFunding }) {
16
16
  function deserializeFunderToDropdown(funderItem) {
17
17
  let funderName = null;
18
18
  let funderPID = null;
19
+ let funderCountry = null;
19
20
 
20
21
  if (funderItem.name) {
21
22
  funderName = funderItem.name;
22
23
  }
23
24
 
24
- if (funderItem.pid) {
25
- funderPID = funderItem.pid;
25
+ if (funderItem.id) {
26
+ funderPID = funderItem.id;
27
+ }
28
+
29
+ if (funderItem.country) {
30
+ funderCountry = funderItem.country;
26
31
  }
27
32
 
28
33
  if (!funderName && !funderPID) {
@@ -30,7 +35,7 @@ function CustomAwardForm({ deserializeFunder, selectedFunding }) {
30
35
  }
31
36
 
32
37
  return {
33
- text: funderName || funderPID,
38
+ text: [funderName, funderCountry, funderPID].filter((val) => val).join(", "),
34
39
  value: funderItem.id,
35
40
  key: funderItem.id,
36
41
  ...(funderName && { name: funderName }),
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
3
  # Copyright (C) 2020-2022 CERN.
4
+ # Copyright (C) 2023 Graz University of Technology.
4
5
  #
5
6
  # Invenio-Vocabularies is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the MIT License; see LICENSE file for more
@@ -123,3 +124,41 @@ class InvenioVocabularies(object):
123
124
  service=self.service,
124
125
  config=app.config["VOCABULARIES_RESOURCE_CONFIG"],
125
126
  )
127
+
128
+
129
+ def finalize_app(app):
130
+ """Finalize app.
131
+
132
+ NOTE: replace former @record_once decorator
133
+ """
134
+ init(app)
135
+
136
+
137
+ def api_finalize_app(app):
138
+ """Api Finalize app.
139
+
140
+ NOTE: replace former @record_once decorator
141
+ """
142
+ init(app)
143
+
144
+
145
+ def init(app):
146
+ """Init app."""
147
+ # Register services - cannot be done in extension because
148
+ # Invenio-Records-Resources might not have been initialized.
149
+ sregistry = app.extensions["invenio-records-resources"].registry
150
+ ext = app.extensions["invenio-vocabularies"]
151
+ sregistry.register(ext.affiliations_service, service_id="affiliations")
152
+ sregistry.register(ext.awards_service, service_id="awards")
153
+ sregistry.register(ext.funders_service, service_id="funders")
154
+ sregistry.register(ext.names_service, service_id="names")
155
+ sregistry.register(ext.subjects_service, service_id="subjects")
156
+ sregistry.register(ext.service, service_id="vocabularies")
157
+ # Register indexers
158
+ iregistry = app.extensions["invenio-indexer"].registry
159
+ iregistry.register(ext.affiliations_service.indexer, indexer_id="affiliations")
160
+ iregistry.register(ext.awards_service.indexer, indexer_id="awards")
161
+ iregistry.register(ext.funders_service.indexer, indexer_id="funders")
162
+ iregistry.register(ext.names_service.indexer, indexer_id="names")
163
+ iregistry.register(ext.subjects_service.indexer, indexer_id="subjects")
164
+ iregistry.register(ext.service.indexer, indexer_id="vocabularies")
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
3
  # Copyright (C) 2020-2022 CERN.
4
+ # Copyright (C) 2023 Graz University of Technology.
4
5
  #
5
6
  # Invenio-Vocabularies is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the MIT License; see LICENSE file for more
@@ -13,30 +14,6 @@ from flask import Blueprint
13
14
  blueprint = Blueprint("invenio_vocabularies_ext", __name__)
14
15
 
15
16
 
16
- @blueprint.record_once
17
- def init(state):
18
- """Init app."""
19
- app = state.app
20
- # Register services - cannot be done in extension because
21
- # Invenio-Records-Resources might not have been initialized.
22
- sregistry = app.extensions["invenio-records-resources"].registry
23
- ext = app.extensions["invenio-vocabularies"]
24
- sregistry.register(ext.affiliations_service, service_id="affiliations")
25
- sregistry.register(ext.awards_service, service_id="awards")
26
- sregistry.register(ext.funders_service, service_id="funders")
27
- sregistry.register(ext.names_service, service_id="names")
28
- sregistry.register(ext.subjects_service, service_id="subjects")
29
- sregistry.register(ext.service, service_id="vocabularies")
30
- # Register indexers
31
- iregistry = app.extensions["invenio-indexer"].registry
32
- iregistry.register(ext.affiliations_service.indexer, indexer_id="affiliations")
33
- iregistry.register(ext.awards_service.indexer, indexer_id="awards")
34
- iregistry.register(ext.funders_service.indexer, indexer_id="funders")
35
- iregistry.register(ext.names_service.indexer, indexer_id="names")
36
- iregistry.register(ext.subjects_service.indexer, indexer_id="subjects")
37
- iregistry.register(ext.service.indexer, indexer_id="vocabularies")
38
-
39
-
40
17
  def create_blueprint_from_app(app):
41
18
  """Create app blueprint."""
42
19
  return app.extensions["invenio-vocabularies"].resource.as_blueprint()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: invenio-vocabularies
3
- Version: 3.1.0
3
+ Version: 3.2.0
4
4
  Summary: "Invenio module for managing vocabularies."
5
5
  Home-page: https://github.com/inveniosoftware/invenio-vocabularies
6
6
  Author: CERN
@@ -24,8 +24,8 @@ Requires-Dist: invenio-search[opensearch2] <3.0.0,>=2.1.0 ; extra == 'opensearch
24
24
  Provides-Extra: postgresql
25
25
  Provides-Extra: sqlite
26
26
  Provides-Extra: tests
27
- Requires-Dist: pytest-black >=0.3.0 ; extra == 'tests'
28
- Requires-Dist: invenio-app <2.0.0,>=1.3.3 ; extra == 'tests'
27
+ Requires-Dist: pytest-black-ng >=0.4.0 ; extra == 'tests'
28
+ Requires-Dist: invenio-app <2.0.0,>=1.4.0 ; extra == 'tests'
29
29
  Requires-Dist: invenio-db[mysql,postgresql] <2.0.0,>=1.0.14 ; extra == 'tests'
30
30
  Requires-Dist: pytest-invenio <3.0.0,>=2.1.0 ; extra == 'tests'
31
31
  Requires-Dist: Sphinx >=4.5 ; extra == 'tests'
@@ -74,6 +74,13 @@ https://invenio-vocabularies.readthedocs.io/
74
74
  Changes
75
75
  =======
76
76
 
77
+ Version 3.2.0 (released 2024-03-22)
78
+
79
+ - funding: add country and ror to funder search results
80
+ - init: move record_once to finalize_app (removes deprecation on `before_first_request`)
81
+ - installation: upgrade invenio-app
82
+
83
+
77
84
  Version 3.1.0 (released 2024-03-05)
78
85
 
79
86
  - custom_fields: added subject field
@@ -1,10 +1,10 @@
1
- invenio_vocabularies/__init__.py,sha256=zYD2SFatCz_VnsGt6BdXwowIM3I8ldPtGfW4BRPoCbs,377
1
+ invenio_vocabularies/__init__.py,sha256=T7_NfvtdyJ5WKhZsXZ5oAtejPyW8TBTuWr1mzkm3CHw,377
2
2
  invenio_vocabularies/cli.py,sha256=Ymuy0l846eJXIA4UybunSqq7P9m2N0OdTtj6nEgd1-0,6355
3
3
  invenio_vocabularies/config.py,sha256=mLypkeVrPKZPtokvHSF-_Q7YcV4sCVONiyhGhu-34hI,3772
4
- invenio_vocabularies/ext.py,sha256=wMJfv3GG4ZOp-c4ePVrNhxi9KyWAb874b9_D23K1orU,3805
4
+ invenio_vocabularies/ext.py,sha256=ukuvkhkLPBy2AITFLojLYTIUlP2qcbHNkt6ES8i1TwY,5310
5
5
  invenio_vocabularies/fixtures.py,sha256=nNWwH04HFASjfj1oy5kMdcQGKmVjzUuA5wSw-ER1QAg,1585
6
6
  invenio_vocabularies/proxies.py,sha256=H_bcJXPTwGbErx-pF89ChayOZcXJXJGZW7O0xkJkYQ4,693
7
- invenio_vocabularies/views.py,sha256=SKXfzdsHEfarpua6snB4D7nQLv9KczYexCHmEYMPKHM,2548
7
+ invenio_vocabularies/views.py,sha256=fo71zH5c-YkkNq0mBXqVdXQ52xieku1gVQEyp3ww-dM,1344
8
8
  invenio_vocabularies/webpack.py,sha256=aLRm0ut3rXPb8D87pVA9mO_ODq7WOSZdsJQyU4iMLoI,1891
9
9
  invenio_vocabularies/alembic/17c703ce1eb7_create_names_table.py,sha256=2QGs0Ofi6yd93VzIBqghNi47hrZtuLf0DylKyvVzskI,1572
10
10
  invenio_vocabularies/alembic/4a9a4fd235f8_create_vocabulary_schemes.py,sha256=Ywtp8qOFcI3PxUXemHdvy_VwdcUVtMFV1sFgNAmYrms,1054
@@ -23,7 +23,7 @@ invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/index.js,sha
23
23
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/index.js,sha256=iSx-bdQkKj6XA9NAam31bdcQmFygljQnjLcFjjK3lwU,245
24
24
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/index.js,sha256=7sSg482yJODQHU4jkP-hWJjpBOw7ubFr5nPZl5D_1gQ,262
25
25
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/AwardResults.js,sha256=AgqJg9GEcJvKZR4plZsH0j7cm9C3yjT9YCPI6uvmOyc,3499
26
- invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js,sha256=PRlPCk6oh7Cxb4QlEmyekv5efWihCi5uqVeL_Cdl91Y,3644
26
+ invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js,sha256=Hht40rz6JgeKvjbEemLM4QBD2N3HWcmSRarZVywGiwc,3798
27
27
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FunderDropdown.js,sha256=pPMB9Hirc8z3efquecrO_CKlfXE1ws6OqDB7fB30l5k,2431
28
28
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.js,sha256=r8t_6xIM49UdjV38ltuzM5KMJIJ_oOgHc1__KsyvjGE,6555
29
29
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.test.js,sha256=z_4lWkf3h9Uin8OzSBSKY1wpUxtbnjE2kRUjW80jAhA,35
@@ -266,10 +266,10 @@ invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.mo,sha256=g1I5aNO8r
266
266
  invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.po,sha256=vg8qC8ofpAdJ3mQz7mWM1ylKDpiNWXFs7rlMdSPkgKk,4629
267
267
  invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.mo,sha256=cqSm8NtMAwrP9O6qbmtkDtRT1e9D93qpsJN5X9_PPVw,600
268
268
  invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.po,sha256=9ACePz_EpB-LfcIJajZ2kp8Q04tcdrQLOtug162ZUss,4115
269
- invenio_vocabularies-3.1.0.dist-info/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
270
- invenio_vocabularies-3.1.0.dist-info/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
271
- invenio_vocabularies-3.1.0.dist-info/METADATA,sha256=77H1YHotqln4kRFvQ0T_nCiSf97XGSrgCohzyf3o0aA,6148
272
- invenio_vocabularies-3.1.0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
273
- invenio_vocabularies-3.1.0.dist-info/entry_points.txt,sha256=cBazxlQQIn53RNdPI8edCL5v1k-6fE7UU4O0QssUoBE,2309
274
- invenio_vocabularies-3.1.0.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
275
- invenio_vocabularies-3.1.0.dist-info/RECORD,,
269
+ invenio_vocabularies-3.2.0.dist-info/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
270
+ invenio_vocabularies-3.2.0.dist-info/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
271
+ invenio_vocabularies-3.2.0.dist-info/METADATA,sha256=P_Hv7pjmodRu8F38__8YDHbgLwqHrHhGsW0a2a_qc0M,6371
272
+ invenio_vocabularies-3.2.0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
273
+ invenio_vocabularies-3.2.0.dist-info/entry_points.txt,sha256=Cca3c5XGXkQItZ2-1oeN5xffwM8I1J3XjSvdq9-l_Bw,2497
274
+ invenio_vocabularies-3.2.0.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
275
+ invenio_vocabularies-3.2.0.dist-info/RECORD,,
@@ -16,12 +16,18 @@ invenio_vocabularies_funders = invenio_vocabularies.views:create_funders_bluepri
16
16
  invenio_vocabularies_names = invenio_vocabularies.views:create_names_blueprint_from_app
17
17
  invenio_vocabularies_subjects = invenio_vocabularies.views:create_subjects_blueprint_from_app
18
18
 
19
+ [invenio_base.api_finalize_app]
20
+ invenio_vocabularies = invenio_vocabularies.ext:api_finalize_app
21
+
19
22
  [invenio_base.apps]
20
23
  invenio_vocabularies = invenio_vocabularies:InvenioVocabularies
21
24
 
22
25
  [invenio_base.blueprints]
23
26
  invenio_vocabularies_ext = invenio_vocabularies.views:blueprint
24
27
 
28
+ [invenio_base.finalize_app]
29
+ invenio_vocabularies = invenio_vocabularies.ext:finalize_app
30
+
25
31
  [invenio_db.alembic]
26
32
  invenio_vocabularies = invenio_vocabularies:alembic
27
33