invenio-vocabularies 7.2.1__py2.py3-none-any.whl → 7.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.

@@ -11,6 +11,6 @@
11
11
 
12
12
  from .ext import InvenioVocabularies
13
13
 
14
- __version__ = "7.2.1"
14
+ __version__ = "7.3.0"
15
15
 
16
16
  __all__ = ("__version__", "InvenioVocabularies")
@@ -1,5 +1,5 @@
1
1
  // This file is part of InvenioVocabularies
2
- // Copyright (C) 2021-2024 CERN.
2
+ // Copyright (C) 2021-2025 CERN.
3
3
  // Copyright (C) 2021 Northwestern University.
4
4
  //
5
5
  // Invenio is free software; you can redistribute it and/or modify it
@@ -11,7 +11,7 @@ import { FieldArray, getIn } from "formik";
11
11
  import { HTML5Backend } from "react-dnd-html5-backend";
12
12
  import { DndProvider } from "react-dnd";
13
13
  import { Button, Form, Icon, List } from "semantic-ui-react";
14
- import { FieldLabel } from "react-invenio-forms";
14
+ import { FieldLabel, FeedbackLabel } from "react-invenio-forms";
15
15
 
16
16
  import { FundingFieldItem } from "./FundingFieldItem";
17
17
  import FundingModal from "./FundingModal";
@@ -25,7 +25,7 @@ function FundingFieldForm(props) {
25
25
  label,
26
26
  labelIcon,
27
27
  fieldPath,
28
- form: { values },
28
+ form: { values, errors, initialErrors, initialValues },
29
29
  move: formikArrayMove,
30
30
  push: formikArrayPush,
31
31
  remove: formikArrayRemove,
@@ -81,12 +81,25 @@ function FundingFieldForm(props) {
81
81
 
82
82
  return { headerContent, descriptionContent, awardOrFunder };
83
83
  };
84
+
85
+ const fundingList = getIn(values, fieldPath, []);
86
+ const formikInitialValues = getIn(initialValues, fieldPath, []);
87
+
88
+ const error = getIn(errors, fieldPath, null);
89
+ const initialError = getIn(initialErrors, fieldPath, null);
90
+ const fundingError = error || (fundingList === formikInitialValues && initialError);
91
+
92
+ let className = "";
93
+ if (fundingError) {
94
+ className = typeof fundingError !== "string" ? fundingError.severity : "error";
95
+ }
96
+
84
97
  return (
85
98
  <DndProvider backend={HTML5Backend}>
86
- <Form.Field required={required}>
99
+ <Form.Field required={required} className={className}>
87
100
  <FieldLabel htmlFor={fieldPath} icon={labelIcon} label={label} />
88
101
  <List>
89
- {getIn(values, fieldPath, []).map((value, index) => {
102
+ {fundingList.map((value, index) => {
90
103
  const key = `${fieldPath}.${index}`;
91
104
  // if award does not exist or has no id, it's a custom one
92
105
  const awardType = value?.award?.id ? "standard" : "custom";
@@ -120,7 +133,7 @@ function FundingFieldForm(props) {
120
133
  key="custom"
121
134
  icon
122
135
  labelPosition="left"
123
- className="mb-5"
136
+ className={`mb-5 ${className}`}
124
137
  >
125
138
  <Icon name="add" />
126
139
  {i18next.t("Add")}
@@ -141,7 +154,13 @@ function FundingFieldForm(props) {
141
154
  <FundingModal
142
155
  searchConfig={searchConfig}
143
156
  trigger={
144
- <Button type="button" key="custom" icon labelPosition="left">
157
+ <Button
158
+ type="button"
159
+ key="custom"
160
+ icon
161
+ labelPosition="left"
162
+ className={className}
163
+ >
145
164
  <Icon name="add" />
146
165
  {i18next.t("Add custom")}
147
166
  </Button>
@@ -156,6 +175,8 @@ function FundingFieldForm(props) {
156
175
  computeFundingContents={computeFundingContents}
157
176
  />
158
177
  </Overridable>
178
+
179
+ {fundingError && <FeedbackLabel errorMessage={fundingError} />}
159
180
  </Form.Field>
160
181
  </DndProvider>
161
182
  );
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2019-2024 CERN.
3
+ # Copyright (C) 2019-2025 CERN.
4
4
  # Copyright (C) 2019-2022 Northwestern University.
5
5
  # Copyright (C) 2022 TU Wien.
6
6
  # Copyright (C) 2022 Graz University of Technology.
@@ -34,7 +34,7 @@ theme = WebpackThemeBundle(
34
34
  "react-dnd-html5-backend": "^11.1.0",
35
35
  "react-dropzone": "^11.0.0",
36
36
  "react-i18next": "^11.11.0",
37
- "react-invenio-forms": "^4.0.0",
37
+ "react-invenio-forms": "^4.6.0",
38
38
  "react-searchkit": "^3.0.0",
39
39
  "yup": "^0.32.0",
40
40
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: invenio-vocabularies
3
- Version: 7.2.1
3
+ Version: 7.3.0
4
4
  Summary: Invenio module for managing vocabularies.
5
5
  Home-page: https://github.com/inveniosoftware/invenio-vocabularies
6
6
  Author: CERN
@@ -91,6 +91,10 @@ https://invenio-vocabularies.readthedocs.io/
91
91
  Changes
92
92
  =======
93
93
 
94
+ Version v7.3.0 (released 2025-03-18)
95
+
96
+ - form: funding: use FeedbackLabel and add error styling
97
+
94
98
  Version v7.2.1 (released 2025-03-17)
95
99
 
96
100
  - subjects: Keep bool_prefix clause for suggest search
@@ -1,4 +1,4 @@
1
- invenio_vocabularies/__init__.py,sha256=FF7Nbc5UIY5-_1hX-O9pIOHKNZx3eHEhglDsMUstpdQ,429
1
+ invenio_vocabularies/__init__.py,sha256=IuQRd0A4SQseB03HVn0A3YbUI1JUeqRykVF3aqcYMew,429
2
2
  invenio_vocabularies/cli.py,sha256=CpXTTIn2GTpUqNfLEMlRAp3JWst8ZjHVxoGYdhuuv_4,5959
3
3
  invenio_vocabularies/config.py,sha256=HCX670_PXw-fA1aaTto93N4579dr4M3xRxnA4nHZn18,6967
4
4
  invenio_vocabularies/ext.py,sha256=GujJ4UARd4Fxf4z7zznRk9JAgHamZuYCOdrKU5czg00,5987
@@ -7,7 +7,7 @@ invenio_vocabularies/fixtures.py,sha256=iEPkWf_ZjdP2D9r2sLdIlPoR8Rq2m5cnoFwywUGH
7
7
  invenio_vocabularies/jobs.py,sha256=cbiZnJ3D6Q-j4NvijjqeCoD90TSTMyYul8l4BmBIxPw,5776
8
8
  invenio_vocabularies/proxies.py,sha256=k7cTUgWfnCoYIuNqAj_VFi1zBN33KNNclRSVnBkObEM,711
9
9
  invenio_vocabularies/views.py,sha256=PNJ5nvc3O7ASwNe56xmqy5YaU9n3UYF3W2JwvtE_kYs,1561
10
- invenio_vocabularies/webpack.py,sha256=hzTM0qx6iiRHkmjti53yuZ5ebfPMR5mpO9uNewBat74,1891
10
+ invenio_vocabularies/webpack.py,sha256=FkM8TxXClmaJcD8YsQq5Mai56nYVJh_1IYTMEHb3c1M,1891
11
11
  invenio_vocabularies/administration/__init__.py,sha256=0bDp2Aw8aZth7C-q9Xn9rxeCUQQRoIUxoWWWwPvKbXA,308
12
12
  invenio_vocabularies/administration/views/__init__.py,sha256=31DP4jLG6q4HQlzSRiGLPxUjHPUCCl4N34y4XMuPP6g,313
13
13
  invenio_vocabularies/administration/views/vocabularies.py,sha256=JyKr1OYF9DO89zvWCNOtNfClO_QptdHdjvgY1kkImnw,1290
@@ -32,7 +32,7 @@ invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/form
32
32
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/AwardResults.js,sha256=AgqJg9GEcJvKZR4plZsH0j7cm9C3yjT9YCPI6uvmOyc,3499
33
33
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js,sha256=TfwrlA_GrINvN1LAdW7J6q_hkbsiEKxbCWc-7VVp8mY,4674
34
34
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FunderDropdown.js,sha256=pPMB9Hirc8z3efquecrO_CKlfXE1ws6OqDB7fB30l5k,2431
35
- invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.js,sha256=wXJz4ZL7J0ZPppcP-qd6U5Mnupf2hkog4zxMrQ9xZtI,6906
35
+ invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.js,sha256=NfbBZOxqphYqWB3i0N5p3LDNo4WxM1ko50K_zuuFT28,7621
36
36
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.test.js,sha256=z_4lWkf3h9Uin8OzSBSKY1wpUxtbnjE2kRUjW80jAhA,35
37
37
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingFieldItem.js,sha256=ZN4dEcHCVtSVFjzb1SAYPxmaY1Qk5ZdCt1yY7j6pvQs,4610
38
38
  invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingModal.js,sha256=X2l1hjwboHFZWEEODvQS8Q7YntD6npj_TmZLiXkuZQs,7474
@@ -305,10 +305,10 @@ invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.mo,sha256=bpqywk-Hn
305
305
  invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.po,sha256=vg8qC8ofpAdJ3mQz7mWM1ylKDpiNWXFs7rlMdSPkgKk,4629
306
306
  invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.mo,sha256=o3nwy64PXTcRaAbRrJpYMICW5aVQ0sCdGIn2Xy4UccU,600
307
307
  invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.po,sha256=9ACePz_EpB-LfcIJajZ2kp8Q04tcdrQLOtug162ZUss,4115
308
- invenio_vocabularies-7.2.1.dist-info/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
309
- invenio_vocabularies-7.2.1.dist-info/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
310
- invenio_vocabularies-7.2.1.dist-info/METADATA,sha256=3-zcdTl1ywGyCPAQH03TfC2OFlKWc0Ox-Z5WUwjvh30,13364
311
- invenio_vocabularies-7.2.1.dist-info/WHEEL,sha256=SrDKpSbFN1G94qcmBqS9nyHcDMp9cUS9OC06hC0G3G0,109
312
- invenio_vocabularies-7.2.1.dist-info/entry_points.txt,sha256=lget4Ekno9VRTq36oowWReIJA99165gOp0BOiiET60Y,3179
313
- invenio_vocabularies-7.2.1.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
314
- invenio_vocabularies-7.2.1.dist-info/RECORD,,
308
+ invenio_vocabularies-7.3.0.dist-info/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
309
+ invenio_vocabularies-7.3.0.dist-info/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
310
+ invenio_vocabularies-7.3.0.dist-info/METADATA,sha256=VdGum0SJJwYTn6gfdGbGiNWSDkDw84w4veKV4j6Dr4g,13460
311
+ invenio_vocabularies-7.3.0.dist-info/WHEEL,sha256=Kol19cahXavY536r5Aj6aAgK_6CmctrOu3bgNJMSNJA,109
312
+ invenio_vocabularies-7.3.0.dist-info/entry_points.txt,sha256=lget4Ekno9VRTq36oowWReIJA99165gOp0BOiiET60Y,3179
313
+ invenio_vocabularies-7.3.0.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
314
+ invenio_vocabularies-7.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any