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

Possibility to create a person from the company page #5724

Closed
pacyL2K19 opened this issue Jun 4, 2024 · 2 comments
Closed

Possibility to create a person from the company page #5724

pacyL2K19 opened this issue Jun 4, 2024 · 2 comments

Comments

@pacyL2K19
Copy link
Contributor

Scope & Context

To enhance the user experience, we should allow users to create people from the company page with a New button below the dropdown of the people suggestion.

Current behavior

Currently you only have a possibility to pick up a person from the existed list of people, if the person doesn't exist yet, you have to first create him from the people page then get back to the company page

Screenshot 2024-06-03 at 12 31 44

Expected behavior

Adding a New button to allow users to create person, then auto selection after the creation succeeded

Technical inputs

N/A

@FelixMalfait Is this something we can implement to improve the ux on this page? Please have a look

Copy link
Contributor

greptile-apps bot commented Jun 4, 2024

Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).

To implement the feature to create a person from the company page, follow these steps:

  1. Add New Button: In the company page component, add a New button below the dropdown of the people suggestion.

  2. Handle Button Click: On button click, open a form/modal to input the new person's details.

  3. Create Person Logic: Use the existing createPerson function from /packages/twenty-chrome-extension/src/db/person.db.ts to create the person. Refer to the logic in addPerson function in /packages/twenty-chrome-extension/src/contentScript/extractPersonProfile.ts for guidance.

  4. Auto Select Person: After successful creation, auto-select the newly created person in the dropdown.

Example code snippet for button click handler:

const handleNewPersonClick = async () => {
  const personData = { /* collect data from form */ };
  const personId = await createPerson(personData);
  if (personId) {
    // logic to auto-select the person in the dropdown
  }
};

Ensure to integrate the form/modal for input and handle the state updates accordingly.

References

/packages/twenty-chrome-extension/src/contentScript/extractPersonProfile.ts
/packages/twenty-chrome-extension/src/db/person.db.ts
/packages/twenty-chrome-extension/src/graphql/person/mutations.ts
/packages/twenty-chrome-extension/src/graphql/person/queries.ts
/packages/twenty-front/src/modules/object-record/relation-picker/components/stories/SingleEntitySelect.stories.tsx
/packages/twenty-front/src/pages/object-record/stories/RecordShowPage.stories.tsx
/packages/twenty-front/src/pages/opportunities/stories/Opportunities.stories.tsx

Ask Greptile

@FelixMalfait
Copy link
Member

Hey @pacyL2K19 great suggestion which we actually just implemented 😁 #5551
Looking forward to your feedback after you try it

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Product development ✅ Jun 7, 2024
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

No branches or pull requests

2 participants