Skip to content
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

Fix the NSF award API endpoint #2244

Merged
merged 5 commits into from
Jan 31, 2024
Merged

Fix the NSF award API endpoint #2244

merged 5 commits into from
Jan 31, 2024

Conversation

robyngit
Copy link
Member

@robyngit robyngit commented Jan 17, 2024

The major part of the fix involved setting up the ADC proxy to point to the new NSF grants API endpoint, then using the proxy in MetacatUI rather than the endpoint directly since it doesn't support CORS. Other minor fixes and improvements made along the way include:

  • Remove unused getGrant method from the LookupModel
  • Use native fetch API instead of jQuery.ajax to retrieve grants
  • Show spinner to indicate that grants are being retrieved (was set up but not used)
  • Move some logic from the getGrantAutocomplete method to new, smaller methods
  • Add missing JS docs
  • Add error handling
  • Add a guide to help repos set up their own proxy
  • Start tests for the LookupModel, including a test for the getGrants method

- Update the default grantsUrl to point to a proxy relative to the repository’s domain
- Remove unused getGrant method from the LookupModel
- Use native fetch API instead of jQuery.ajax to retrieve grants
- Show spinner to indicate that grants are being retrieved (was set up but not used)
- Move some logic from the getGrantAutocomplete method to new, smaller methods
- Add missing JS docs
- Add error handling

Issue #2233
@robyngit robyngit linked an issue Jan 17, 2024 that may be closed by this pull request
@robyngit
Copy link
Member Author

@rushirajnenuji, no rush, but if would you have a chance to give this a quick test to make sure everything's ok? You should only need to set the theme to "arctic" in order for the funding autocomplete field to work in the editor.

@rushirajnenuji
Copy link
Member

Thank you @robyngit -- I'll test it out and get back to you.

@robyngit
Copy link
Member Author

@rushirajnenuji forgot to point out that I did identify some improvements that are needed to this in the future: #2243 (just to save you some time in case you come to the same conclusions)

Copy link
Member

@rushirajnenuji rushirajnenuji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed these changes on my local instance of MetacatUI and they look good. Thank you for getting this fix in @robyngit!

@robyngit
Copy link
Member Author

Thanks @rushirajnenuji !

@robyngit robyngit merged commit cd2e5f6 into develop Jan 31, 2024
2 checks passed
@robyngit robyngit deleted the bugfix-2233-award-endpoint branch September 26, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the NSF award API endpoint
2 participants