Skip to content

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

Merged
merged 4 commits into from
Apr 28, 2025
Merged

adding override for funding ui #222

merged 4 commits into from
Apr 28, 2025

Conversation

Sahil590
Copy link
Contributor

@Sahil590 Sahil590 commented Apr 16, 2025


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

  • Code meets acceptance criteria from issue
  • Unit tests are written and all pass
  • User Test Scripts (if required) are written and have been run through
  • Code documentation and related non-code documentation has all been updated

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

  • Code meets acceptance criteria from issue
  • Unit tests are written and all pass
  • User Test Scripts (if required) are written and have been run through
  • Code documentation and related non-code documentation has all been updated
  • Migation has been created and tested

Testing

List user test scripts that need to be run

List any non-unit test scripts that need to be run

@Sahil590 Sahil590 linked an issue Apr 23, 2025 that may be closed by this pull request
@Sahil590 Sahil590 marked this pull request as ready for review April 25, 2025 07:50
@Sahil590 Sahil590 requested a review from Copilot April 25, 2025 07:50
Copy link
Contributor

@Copilot Copilot AI left a 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);

@Sahil590 Sahil590 requested a review from cc-a April 28, 2025 09:31
Copy link
Collaborator

@cc-a cc-a left a 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.

Comment on lines 23 to 26
import { AwardResults } from "./AwardResults";
import CustomAwardForm from "./CustomAwardForm";
import { FunderDropdown } from "./FunderDropdown";
import { NoAwardResults } from "./NoAwardResults";
Copy link
Collaborator

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.

Copy link
Contributor Author

@Sahil590 Sahil590 Apr 28, 2025

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?

Copy link
Collaborator

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";
Copy link
Collaborator

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?

@Sahil590 Sahil590 requested a review from cc-a April 28, 2025 12:56
@cc-a cc-a merged commit ebea475 into develop Apr 28, 2025
2 checks passed
@cc-a cc-a deleted the award-ui branch April 28, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

UI tweaks for award search
2 participants