invenio-vocabularies 3.2.0__py2.py3-none-any.whl → 3.3.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.2.0"
13
+ __version__ = "3.3.0"
14
14
 
15
15
  __all__ = ("__version__", "InvenioVocabularies")
@@ -12,6 +12,8 @@ import { TextField, RemoteSelectField } from "react-invenio-forms";
12
12
  import { i18next } from "@translations/invenio_rdm_records/i18next";
13
13
  import _isEmpty from "lodash/isEmpty";
14
14
 
15
+ import Overridable from "react-overridable";
16
+
15
17
  function CustomAwardForm({ deserializeFunder, selectedFunding }) {
16
18
  function deserializeFunderToDropdown(funderItem) {
17
19
  let funderName = null;
@@ -53,64 +55,85 @@ function CustomAwardForm({ deserializeFunder, selectedFunding }) {
53
55
 
54
56
  return (
55
57
  <Form>
56
- <RemoteSelectField
58
+ <Overridable
59
+ id="InvenioVocabularies.CustomAwardForm.RemoteSelectField.Container"
57
60
  fieldPath="selectedFunding.funder.id"
58
- suggestionAPIUrl="/api/funders"
59
- suggestionAPIHeaders={{
60
- Accept: "application/vnd.inveniordm.v1+json",
61
- }}
62
- placeholder={i18next.t("Search for a funder by name")}
63
- serializeSuggestions={(funders) => {
64
- return funders.map((funder) =>
65
- deserializeFunderToDropdown(deserializeFunder(funder))
66
- );
67
- }}
68
- searchInput={{
69
- autoFocus: _isEmpty(selectedFunding),
70
- }}
71
- label={i18next.t("Funder")}
72
- noQueryMessage={i18next.t("Search for funder...")}
73
- clearable
74
- allowAdditions={false}
75
- multiple={false}
76
- selectOnBlur={false}
77
- selectOnNavigation={false}
78
- required
79
- search={(options) => options}
80
- isFocused
81
- onValueChange={({ formikProps }, selectedFundersArray) => {
82
- if (selectedFundersArray.length === 1) {
83
- const selectedFunder = selectedFundersArray[0];
84
- if (selectedFunder) {
85
- const deserializedFunder = serializeFunderFromDropdown(selectedFunder);
86
- formikProps.form.setFieldValue(
87
- "selectedFunding.funder",
88
- deserializedFunder
89
- );
61
+ >
62
+ <RemoteSelectField
63
+ fieldPath="selectedFunding.funder.id"
64
+ suggestionAPIUrl="/api/funders"
65
+ suggestionAPIHeaders={{
66
+ Accept: "application/vnd.inveniordm.v1+json",
67
+ }}
68
+ placeholder={i18next.t("Search for a funder by name")}
69
+ serializeSuggestions={(funders) => {
70
+ return funders.map((funder) =>
71
+ deserializeFunderToDropdown(deserializeFunder(funder))
72
+ );
73
+ }}
74
+ searchInput={{
75
+ autoFocus: _isEmpty(selectedFunding),
76
+ }}
77
+ label={i18next.t("Funder")}
78
+ noQueryMessage={i18next.t("Search for funder...")}
79
+ clearable
80
+ allowAdditions={false}
81
+ multiple={false}
82
+ selectOnBlur={false}
83
+ selectOnNavigation={false}
84
+ required
85
+ search={(options) => options}
86
+ isFocused
87
+ onValueChange={({ formikProps }, selectedFundersArray) => {
88
+ if (selectedFundersArray.length === 1) {
89
+ const selectedFunder = selectedFundersArray[0];
90
+ if (selectedFunder) {
91
+ const deserializedFunder = serializeFunderFromDropdown(selectedFunder);
92
+ formikProps.form.setFieldValue(
93
+ "selectedFunding.funder",
94
+ deserializedFunder
95
+ );
96
+ }
90
97
  }
91
- }
92
- }}
93
- />
94
-
95
- <Header as="h3" size="small">
96
- {i18next.t("Award information")} ({i18next.t("optional")})
97
- </Header>
98
+ }}
99
+ />
100
+ </Overridable>
101
+ <Overridable id="InvenioVocabularies.CustomAwardForm.AwardInformationHeader.Container">
102
+ <Header as="h3" size="small">
103
+ {i18next.t("Award information")} ({i18next.t("optional")})
104
+ </Header>
105
+ </Overridable>
98
106
  <Form.Group widths="equal">
99
- <TextField
100
- label={i18next.t("Number")}
101
- placeholder={i18next.t("Award number")}
107
+ <Overridable
108
+ id="InvenioVocabularies.CustomAwardForm.AwardNumberTextField.Container"
102
109
  fieldPath="selectedFunding.award.number"
103
- />
104
- <TextField
105
- label={i18next.t("Title")}
106
- placeholder={i18next.t("Award Title")}
110
+ >
111
+ <TextField
112
+ label={i18next.t("Number")}
113
+ placeholder={i18next.t("Award number")}
114
+ fieldPath="selectedFunding.award.number"
115
+ />
116
+ </Overridable>
117
+ <Overridable
118
+ id="InvenioVocabularies.CustomAwardForm.AwardTitleTextField.Container"
107
119
  fieldPath="selectedFunding.award.title"
108
- />
109
- <TextField
110
- label={i18next.t("URL")}
111
- placeholder={i18next.t("Award URL")}
120
+ >
121
+ <TextField
122
+ label={i18next.t("Title")}
123
+ placeholder={i18next.t("Award Title")}
124
+ fieldPath="selectedFunding.award.title"
125
+ />
126
+ </Overridable>
127
+ <Overridable
128
+ id="InvenioVocabularies.CustomAwardForm.AwardUrlTextField.Container"
112
129
  fieldPath="selectedFunding.award.url"
113
- />
130
+ >
131
+ <TextField
132
+ label={i18next.t("URL")}
133
+ placeholder={i18next.t("Award URL")}
134
+ fieldPath="selectedFunding.award.url"
135
+ />
136
+ </Overridable>
114
137
  </Form.Group>
115
138
  </Form>
116
139
  );
@@ -18,6 +18,8 @@ import FundingModal from "./FundingModal";
18
18
 
19
19
  import { i18next } from "@translations/invenio_rdm_records/i18next";
20
20
 
21
+ import Overridable from "react-overridable";
22
+
21
23
  function FundingFieldForm(props) {
22
24
  const {
23
25
  label,
@@ -108,46 +110,52 @@ function FundingFieldForm(props) {
108
110
  );
109
111
  })}
110
112
  </List>
111
- <FundingModal
112
- searchConfig={searchConfig}
113
- trigger={
114
- <Button
115
- type="button"
116
- key="custom"
117
- icon
118
- labelPosition="left"
119
- className="mb-5"
120
- >
121
- <Icon name="add" />
122
- {i18next.t("Add award")}
123
- </Button>
124
- }
125
- onAwardChange={(selectedFunding) => {
126
- formikArrayPush(selectedFunding);
127
- }}
128
- mode="standard"
129
- action="add"
130
- deserializeAward={deserializeAward}
131
- deserializeFunder={deserializeFunder}
132
- computeFundingContents={computeFundingContents}
133
- />
134
- <FundingModal
135
- searchConfig={searchConfig}
136
- trigger={
137
- <Button type="button" key="custom" icon labelPosition="left">
138
- <Icon name="add" />
139
- {i18next.t("Add custom")}
140
- </Button>
141
- }
142
- onAwardChange={(selectedFunding) => {
143
- formikArrayPush(selectedFunding);
144
- }}
145
- mode="custom"
146
- action="add"
147
- deserializeAward={deserializeAward}
148
- deserializeFunder={deserializeFunder}
149
- computeFundingContents={computeFundingContents}
150
- />
113
+
114
+ <Overridable id="InvenioVocabularies.FundingField.AddAwardFundingModal.Container">
115
+ <FundingModal
116
+ searchConfig={searchConfig}
117
+ trigger={
118
+ <Button
119
+ type="button"
120
+ key="custom"
121
+ icon
122
+ labelPosition="left"
123
+ className="mb-5"
124
+ >
125
+ <Icon name="add" />
126
+ {i18next.t("Add award")}
127
+ </Button>
128
+ }
129
+ onAwardChange={(selectedFunding) => {
130
+ formikArrayPush(selectedFunding);
131
+ }}
132
+ mode="standard"
133
+ action="add"
134
+ deserializeAward={deserializeAward}
135
+ deserializeFunder={deserializeFunder}
136
+ computeFundingContents={computeFundingContents}
137
+ />
138
+ </Overridable>
139
+
140
+ <Overridable id="InvenioVocabularies.FundingField.AddCustomFundingModal.Container">
141
+ <FundingModal
142
+ searchConfig={searchConfig}
143
+ trigger={
144
+ <Button type="button" key="custom" icon labelPosition="left">
145
+ <Icon name="add" />
146
+ {i18next.t("Add custom")}
147
+ </Button>
148
+ }
149
+ onAwardChange={(selectedFunding) => {
150
+ formikArrayPush(selectedFunding);
151
+ }}
152
+ mode="custom"
153
+ action="add"
154
+ deserializeAward={deserializeAward}
155
+ deserializeFunder={deserializeFunder}
156
+ computeFundingContents={computeFundingContents}
157
+ />
158
+ </Overridable>
151
159
  </Form.Field>
152
160
  </DndProvider>
153
161
  );
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: invenio-vocabularies
3
- Version: 3.2.0
3
+ Version: 3.3.0
4
4
  Summary: "Invenio module for managing vocabularies."
5
5
  Home-page: https://github.com/inveniosoftware/invenio-vocabularies
6
6
  Author: CERN
@@ -74,6 +74,10 @@ https://invenio-vocabularies.readthedocs.io/
74
74
  Changes
75
75
  =======
76
76
 
77
+ Version 3.3.0 (released 2024-04-16)
78
+
79
+ - assets: add overridable awards and funding
80
+
77
81
  Version 3.2.0 (released 2024-03-22)
78
82
 
79
83
  - funding: add country and ror to funder search results
@@ -1,4 +1,4 @@
1
- invenio_vocabularies/__init__.py,sha256=T7_NfvtdyJ5WKhZsXZ5oAtejPyW8TBTuWr1mzkm3CHw,377
1
+ invenio_vocabularies/__init__.py,sha256=tQFCf91BM4aB3XPviHFG0TfPMsFrW4DQIJ4RMO2dIkA,377
2
2
  invenio_vocabularies/cli.py,sha256=Ymuy0l846eJXIA4UybunSqq7P9m2N0OdTtj6nEgd1-0,6355
3
3
  invenio_vocabularies/config.py,sha256=mLypkeVrPKZPtokvHSF-_Q7YcV4sCVONiyhGhu-34hI,3772
4
4
  invenio_vocabularies/ext.py,sha256=ukuvkhkLPBy2AITFLojLYTIUlP2qcbHNkt6ES8i1TwY,5310
@@ -23,9 +23,9 @@ 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=Hht40rz6JgeKvjbEemLM4QBD2N3HWcmSRarZVywGiwc,3798
26
+ invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js,sha256=PDgCRtbOXkXOQCodbxoieHenhXrXhSTMQk4LcS-AjYg,4794
27
27
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FunderDropdown.js,sha256=pPMB9Hirc8z3efquecrO_CKlfXE1ws6OqDB7fB30l5k,2431
28
- invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.js,sha256=r8t_6xIM49UdjV38ltuzM5KMJIJ_oOgHc1__KsyvjGE,6555
28
+ invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.js,sha256=aqQ92Z0WJ4rfXz0E8KIIN4-qjORdQYxXPa5eS5b_g8A,6912
29
29
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.test.js,sha256=z_4lWkf3h9Uin8OzSBSKY1wpUxtbnjE2kRUjW80jAhA,35
30
30
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingFieldItem.js,sha256=ZN4dEcHCVtSVFjzb1SAYPxmaY1Qk5ZdCt1yY7j6pvQs,4610
31
31
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingModal.js,sha256=To8qRm0RoMSiGZaNWfd2TM7NFZLML-8l9Wx7De8DKyI,8112
@@ -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.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,,
269
+ invenio_vocabularies-3.3.0.dist-info/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
270
+ invenio_vocabularies-3.3.0.dist-info/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
271
+ invenio_vocabularies-3.3.0.dist-info/METADATA,sha256=Pfbhxq_NJ2hyIoBF4N4sRWmRWXsxlukEUkhT4QD3H2M,6454
272
+ invenio_vocabularies-3.3.0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
273
+ invenio_vocabularies-3.3.0.dist-info/entry_points.txt,sha256=Cca3c5XGXkQItZ2-1oeN5xffwM8I1J3XjSvdq9-l_Bw,2497
274
+ invenio_vocabularies-3.3.0.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
275
+ invenio_vocabularies-3.3.0.dist-info/RECORD,,