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 - add new button on opportunity board company picker doesnt work #8488

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ehconitin
Copy link
Contributor

opportunitybutton.mp4

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes the "New" button functionality in the opportunity board's company picker by implementing company creation and improving data fetching.

  • Added company creation flow in RecordBoardColumnNewOpportunity.tsx using createCompanyOpportunityAndOpenRightDrawer function
  • Implemented right drawer opening after company creation with proper state management via viewableRecordIdState
  • Added cache-and-network fetch policy in useFilteredSearchEntityQuery.ts to ensure immediate visibility of newly created companies
  • Added error handling with isDefined checks for company creation responses

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +58 to +61
const createdCompany = await createCompany({
id: newRecordId,
name: searchInput,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: No error handling if company creation fails. Could leave UI in inconsistent state.

Comment on lines +63 to +65
setViewableRecordId(newRecordId);
setViewableRecordNameSingular(CoreObjectNameSingular.Company);
openRightDrawer(RightDrawerPages.ViewRecord);
Copy link
Contributor

Choose a reason for hiding this comment

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

style: State updates and drawer opening should happen after confirming company creation succeeded

@@ -60,6 +60,7 @@ export const useFilteredSearchEntityQuery = ({
filter: notFilter,
limit: limit ?? DEFAULT_SEARCH_REQUEST_LIMIT,
searchInput: searchFilter,
fetchPolicy: 'cache-and-network',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure about this one!
But the newly created entities won't get fetched without this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants