Skip to content

PORTALS-3686, PORTALS-3687 #2039

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 2 commits into from
Jul 15, 2025
Merged

Conversation

nickgros
Copy link
Collaborator

Fix issues in SynapseForm where search params were no longer passed to the component.

We used to always inject the URLSearchParams as props to top-level portals components. This recently changed, breaking these components where these params must now be manually passed.

Fix issues in SynapseForm where search params were no longer passed to the component.

We used to always inject the URLSearchParams as props to top-level portals components. This recently changed, breaking these components where these params must now be manually passed.
export type SynapseFormWrapperProps = {
// Provide the parent container (folder/project), that should contain a folder (named <user_id>) that this user can write to.
formSchemaEntityId: string // Synapse file that contains the form schema.
formUiSchemaEntityId: string // Synapse file that contains the form ui schema.
formNavSchemaEntityId: string //Synapse file that consists screen nav schema
token?: string // user's access token
searchParams?: UploadToolSearchParams
Copy link
Collaborator Author

@nickgros nickgros Jul 15, 2025

Choose a reason for hiding this comment

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

We no longer automatically inject searchParams as a prop, which caused the regression (probably changed when we switched to lazy-loaded routes).

IMO searchParams as a prop is an antipattern--we are not directly dealing with routing and we want to avoid tightly coupling the implementation with the router.

Refactor here to make sure the former searchParam props are now all top-level props.

@@ -0,0 +1,13 @@
import { useSearchParams } from 'react-router'

export function useGetFormPropsFromSearchParams() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Utility to get these props out of the URL search params

Also remove outdated Story for ADKP
@nickgros nickgros merged commit 4500440 into Sage-Bionetworks:main Jul 15, 2025
25 of 26 checks passed
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