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

Migrate Domain Field to the new Link Field Type #5759

Closed
Bonapara opened this issue Jun 6, 2024 · 7 comments · Fixed by #6410
Closed

Migrate Domain Field to the new Link Field Type #5759

Bonapara opened this issue Jun 6, 2024 · 7 comments · Fixed by #6410
Assignees
Labels
scope: back+front Issues requiring full-stack knowledge size: short

Comments

@Bonapara
Copy link
Member

Bonapara commented Jun 6, 2024

Current Behavior

The domain field on the company object uses a "Text" field type.

CleanShot 2024-06-06 at 10 26 52

Desired Behavior

We want to migrate the domain field to the newly introduced linked field type, allowing users to specify multiple values (several domains).

CleanShot 2024-06-06 at 10 27 14

We should adapt the email syncing logic to account for companies having different domains attached. We should sync emails from any matching domain name (e.g., [email protected] or [email protected]).

We should keep the custom logic for the domain field, such as fetching the favicon.

Copy link
Contributor

greptile-apps bot commented Jun 6, 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 :).

  1. Update the domain field metadata in src/models/company.js to use the Link field type:
// src/models/company.js
{
  name: 'domain',
  type: 'Link',
  multiple: true,
  ...
}
  1. Modify the email syncing logic in src/services/emailSync.js to handle multiple domains:
// src/services/emailSync.js
const domains = company.domain; // Assuming domain is now an array
emails.forEach(email => {
  if (domains.some(domain => email.endsWith(`@${domain}`))) {
    // Sync email
  }
});
  1. Update any relevant UI components to support the new Link field type for the domain field in src/components/CompanyForm.js:
// src/components/CompanyForm.js
<Field name="domain" component={LinkField} multiple />

References

@pacyL2K19
Copy link
Contributor

I can work on this next @Bonapara

@Bonapara
Copy link
Member Author

Bonapara commented Jun 7, 2024

Sure @pacyL2K19, thanks for contributing!

@pacyL2K19
Copy link
Contributor

Starting work on this @Bonapara
Please assign it to me

@Bonapara
Copy link
Member Author

Done! Thanks @pacyL2K19

@Bonapara
Copy link
Member Author

Bonapara commented Jul 1, 2024

@ijreilly is it related to what you're working on?

@FelixMalfait FelixMalfait assigned ijreilly and unassigned pacyL2K19 Jul 10, 2024
@FelixMalfait FelixMalfait moved this from 🆕 New to 🔖 Planned in Product development ✅ Jul 10, 2024
@ijreilly
Copy link
Collaborator

ijreilly commented Jul 15, 2024

vision: add settings on fields to be able to add business logic executed at save.
e.g.: "isDomain" setting to remove protocol

@ijreilly ijreilly moved this from 🔖 Planned to 🏗 In progress in Product development ✅ Jul 24, 2024
@ijreilly ijreilly moved this from 🏗 In progress to 👀 In review in Product development ✅ Jul 29, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Product development ✅ Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: back+front Issues requiring full-stack knowledge size: short
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants