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

[ENG-6419] Share integration #2377

Conversation

futa-ikeda
Copy link
Contributor

@futa-ikeda futa-ikeda commented Nov 4, 2024

Purpose

  • Make sure institution dashboard pages talking to SHARE don't break

Summary of Changes

  • Update project page controller's getters to account for missing values
  • Add new package osfmap/jsonld.ts with utilities to make getting stuff from SHARE easier and more readable

Screenshot(s)

Side Effects

QA Notes

@futa-ikeda
Copy link
Contributor Author

Note: Since this PR is blocking some initial QA efforts, I plan on changing some of the getters in search-result.ts to use the new helper functions in a subsequent PR.

Copy link
Contributor

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

One question about a place that might stand to be more defensive?

Comment on lines +23 to +25
export function getSingleOsfmapValue(osfmapObject: any, propertyPath: string[]) {
return iterOsfmapValues(osfmapObject, propertyPath).next().value;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you use this on something that's not a single value? Does it fail gracefully? Or does typescript help here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should just get the first one, and if there's no @id or @value, it should just return undefined

@futa-ikeda futa-ikeda merged commit a39b12c into CenterForOpenScience:feature/insti-dash-improv Nov 5, 2024
9 checks passed
@futa-ikeda futa-ikeda deleted the share-integration branch November 5, 2024 18:44
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.

2 participants