Feat/activities custom objects (#3213)

* WIP

* WIP - MultiObjectSearch

* WIP

* WIP

* Finished working version

* Fix

* Fixed and cleaned

* Fix

* Disabled files and emails for custom objects

* Cleaned console.log

* Fixed attachment

* Fixed

* fix lint

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2024-01-05 09:08:33 +01:00
committed by GitHub
parent c15e138d72
commit b112b74022
72 changed files with 1611 additions and 551 deletions

View File

@ -29,33 +29,37 @@ export const useSpreadsheetPersonImport = () => {
...options,
onSubmit: async (data) => {
// TODO: Add better type checking in spreadsheet import later
const createInputs = data.validData.map((person) => ({
id: v4(),
name: {
firstName: person.firstName as string | undefined,
lastName: person.lastName as string | undefined,
},
email: person.email as string | undefined,
...(person.linkedinUrl
? {
linkedinLink: {
label: 'linkedinUrl',
url: person.linkedinUrl as string | undefined,
},
}
: {}),
...(person.xUrl
? {
xLink: {
label: 'xUrl',
url: person.xUrl as string | undefined,
},
}
: {}),
jobTitle: person.jobTitle as string | undefined,
phone: person.phone as string | undefined,
city: person.city as string | undefined,
}));
const createInputs = data.validData.map(
(person) =>
({
id: v4(),
name: {
firstName: person.firstName as string | undefined,
lastName: person.lastName as string | undefined,
},
email: person.email as string | undefined,
...(person.linkedinUrl
? {
linkedinLink: {
label: 'linkedinUrl',
url: person.linkedinUrl as string | undefined,
},
}
: {}),
...(person.xUrl
? {
xLink: {
label: 'xUrl',
url: person.xUrl as string | undefined,
},
}
: {}),
jobTitle: person.jobTitle as string | undefined,
phone: person.phone as string | undefined,
city: person.city as string | undefined,
}) as Person,
);
// TODO: abstract this part for any object
try {
await createManyPeople(createInputs);