-
Notifications
You must be signed in to change notification settings - Fork 1
adding override for funding ui #222
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an override for the funding UI by introducing new components and extending existing ones to support both standard and custom award/grant workflows. Key changes include:
- Addition of FundingModal with custom and standard modes.
- New FundingField and FundingFieldItem components that integrate drag-and-drop and override support.
- Enhancements to related components (AwardResults, CustomAwardForm, FunderDropdown) and an update in the CI workflow.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/NoAwardResults.js | New component for handling "no award results" with clickable action. |
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FundingModal.js | Implements a modal for adding/editing funding with validation and mode switching. |
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FundingFieldItem.js | Introduces drag-and-drop functionality for funding items. |
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FundingField.js | Wraps funding components into a FieldArray with DnD support. |
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FunderDropdown.js | Provides a dropdown for filtering by funder using award facets. |
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/CustomAwardForm.js | Provides form fields for entering custom award details. |
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/AwardResults.js | Displays award search results and allows selection via radio buttons. |
assets/js/invenio_app_rdm/overridableRegistry/mapping.js | Registers the new FundingField in the overridable component registry. |
.github/workflows/ci.yml | Updates the pre-commit action version. |
Comments suppressed due to low confidence (2)
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FundingModal.js:135
- [nitpick] For consistency and maintainability, consider using the ModalTypes.STANDARD constant instead of the literal "standard" when comparing the mode.
{mode === "standard" ? i18next.t("Add standard award/grant") : i18next.t("Add custom funding")}
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FunderDropdown.js:16
- [nitpick] Consider moving the definition of the custom hook 'useFundersFromFacets' outside of the component body to avoid re-creating it on every render.
const [fundersFromFacets] = useFundersFromFacets(awardsList);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Sahil590. Looks nice but I think we can probably reduce the amount of code we need to take a copy of.
import { AwardResults } from "./AwardResults"; | ||
import CustomAwardForm from "./CustomAwardForm"; | ||
import { FunderDropdown } from "./FunderDropdown"; | ||
import { NoAwardResults } from "./NoAwardResults"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're making any changes to these so I don't think we need to take copies we can just use the versions from invenio-rdm-records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get this from the invenio-rdm-records I got it from /invenio-vocabularies/src/contrib/forms/Funding when I tried to import the JS directly using
import { AwardResults } from "@js/invenio-vocabularies/src/contrib/forms/Funding/AwardResults";
I keep getting an error is that the correct path to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks about right but try an underscore instead of a dash in invenio_vocabularies
.
import { Button, Form, Icon, List } from "semantic-ui-react"; | ||
import { FieldLabel, FeedbackLabel } from "react-invenio-forms"; | ||
|
||
import { FundingFieldItem } from "./FundingFieldItem"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above can we use the version from then library?
Adding the override for the Funding ui. It is alot of files but they are neccessary for all the components to work.
Can not really remove much from the origianl files without breaking some things open to some suggestions on things to remove if not needed.
The main edits are done in the
site/ic_data_repo/assets/semantic-ui/js/ic_data_repo/Funding/FundingModal.js
Developer Checklist
Developers should review and confirm each of these items before requesting review
Reviewer Checklist
Reviewers should review and confirm each of these items before approval
If there are multiple reviewers, this section can be duplicated for each reviewer
Testing
List user test scripts that need to be run
List any non-unit test scripts that need to be run