2023-12-11 17:45:45 +03:00
|
|
|
{
|
|
|
|
"folders": [
|
|
|
|
{
|
|
|
|
"name": "ROOT",
|
|
|
|
"path": "../"
|
|
|
|
},
|
2024-02-12 14:30:23 +03:00
|
|
|
{
|
|
|
|
"name": "packages/twenty-chrome-extension",
|
|
|
|
"path": "../packages/twenty-chrome-extension"
|
|
|
|
},
|
2023-12-11 17:45:45 +03:00
|
|
|
{
|
|
|
|
"name": "packages/twenty-docker",
|
|
|
|
"path": "../packages/twenty-docker"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "packages/twenty-front",
|
|
|
|
"path": "../packages/twenty-front"
|
|
|
|
},
|
feat: add new ACTOR field type and createdBy standard fields (#6324)
This pull request introduces a new `FieldMetadataType` called `ACTOR`.
The primary objective of this new type is to add an extra column to the
following objects: `person`, `company`, `opportunity`, `note`, `task`,
and all custom objects.
This composite type contains three properties:
- `source`
```typescript
export enum FieldActorSource {
EMAIL = 'EMAIL',
CALENDAR = 'CALENDAR',
API = 'API',
IMPORT = 'IMPORT',
MANUAL = 'MANUAL',
}
```
- `workspaceMemberId`
- This property can be `undefined` in some cases and refers to the
member who created the record.
- `name`
- Serves as a fallback if the `workspaceMember` is deleted and is used
for other source types like `API`.
### Functionality
The pre-hook system has been updated to allow real-time argument
updates. When a record is created, a pre-hook can now compute and update
the arguments accordingly. This enhancement enables the `createdBy`
field to be populated with the correct values based on the
`authContext`.
The `authContext` now includes:
- An optional User entity
- An optional ApiKey entity
- The workspace entity
This provides access to the necessary data for the `createdBy` field.
In the GraphQL API, only the `source` can be specified in the
`createdBy` input. This allows the front-end to specify the source when
creating records from a CSV file.
### Front-End Handling
On the front-end, `orderBy` and `filter` are only applied to the name
property of the `ACTOR` composite type. Currently, we are unable to
apply these operations to the workspace member relation. This means that
if a workspace member changes their first name or last name, there may
be a mismatch because the name will differ from the new one. The name
displayed on the screen is based on the workspace member entity when
available.
### Missing Components
Currently, this PR does not include a `createdBy` value for the `MAIL`
and `CALENDAR` sources. These records are created in a job, and at
present, we only have access to the workspaceId within the job. To
address this, we should use a function similar to
`loadServiceWithContext`, which was recently removed from `TwentyORM`.
This function would allow us to pass the `authContext` to the jobs
without disrupting existing jobs.
Another PR will be created to handle these cases.
### Related Issues
Fixes issue #5155.
### Additional Notes
This PR doesn't include the migrations of the current records and views.
Everything works properly when the database is reset but this part is
still missing for now. We'll add that in another PR.
- There is a minor issue: front-end tests are broken since this commit:
[https://github.com/twentyhq/twenty/commit/80c0fc7ff108d61c0e8d89fd334da64bd224f7aa](https://github.com/twentyhq/twenty/commit/80c0fc7ff108d61c0e8d89fd334da64bd224f7aa).
---------
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-03 16:43:31 +03:00
|
|
|
{
|
|
|
|
"name": "packages/twenty-ui",
|
|
|
|
"path": "../packages/twenty-ui"
|
|
|
|
},
|
2024-09-20 12:02:52 +03:00
|
|
|
{
|
|
|
|
"name": "packages/twenty-emails",
|
|
|
|
"path": "../packages/twenty-emails"
|
|
|
|
},
|
2023-12-11 17:45:45 +03:00
|
|
|
{
|
|
|
|
"name": "packages/twenty-server",
|
|
|
|
"path": "../packages/twenty-server"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "packages/twenty-utils",
|
|
|
|
"path": "../packages/twenty-utils"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "packages/twenty-zapier",
|
|
|
|
"path": "../packages/twenty-zapier"
|
|
|
|
},
|
2024-01-04 01:07:25 +03:00
|
|
|
{
|
|
|
|
"name": "tools/eslint-rules",
|
|
|
|
"path": "../tools/eslint-rules"
|
|
|
|
},
|
2023-12-11 17:45:45 +03:00
|
|
|
],
|
|
|
|
"settings": {
|
2024-03-07 19:21:50 +03:00
|
|
|
"editor.formatOnSave": false,
|
|
|
|
"files.eol": "auto",
|
|
|
|
"[typescript]": {
|
|
|
|
"editor.formatOnSave": false,
|
|
|
|
"editor.codeActionsOnSave": {
|
2024-07-02 18:21:13 +03:00
|
|
|
"source.fixAll.eslint": "explicit",
|
2024-03-07 19:21:50 +03:00
|
|
|
"source.addMissingImports": "always"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"[javascript]": {
|
|
|
|
"editor.formatOnSave": false,
|
|
|
|
"editor.codeActionsOnSave": {
|
2024-07-02 18:21:13 +03:00
|
|
|
"source.fixAll.eslint": "explicit",
|
2024-03-07 19:21:50 +03:00
|
|
|
"source.addMissingImports": "always"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"[typescriptreact]": {
|
|
|
|
"editor.formatOnSave": false,
|
|
|
|
"editor.codeActionsOnSave": {
|
2024-07-02 18:21:13 +03:00
|
|
|
"source.fixAll.eslint": "explicit",
|
2024-03-07 19:21:50 +03:00
|
|
|
"source.addMissingImports": "always"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"[json]": {
|
|
|
|
"editor.formatOnSave": true
|
|
|
|
},
|
|
|
|
"javascript.format.enable": false,
|
|
|
|
"typescript.format.enable": false,
|
|
|
|
"cSpell.enableFiletypes": [
|
|
|
|
"!javascript",
|
|
|
|
"!json",
|
|
|
|
"!typescript",
|
|
|
|
"!typescriptreact",
|
|
|
|
"md",
|
|
|
|
"mdx"
|
|
|
|
],
|
|
|
|
"cSpell.words": [
|
|
|
|
"twentyhq"
|
|
|
|
],
|
|
|
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
|
|
|
"[javascript][typescript][typescriptreact]": {
|
|
|
|
"editor.codeActionsOnSave": {
|
|
|
|
"source.fixAll.eslint": "explicit",
|
|
|
|
"source.addMissingImports": "always"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"search.exclude": {
|
|
|
|
"**/.yarn": true,
|
|
|
|
},
|
2023-12-11 17:45:45 +03:00
|
|
|
"files.exclude": {
|
|
|
|
"packages/": true
|
|
|
|
},
|
2024-03-07 19:21:50 +03:00
|
|
|
"jest.runMode": "on-demand",
|
2023-12-11 17:45:45 +03:00
|
|
|
"jest.disabledWorkspaceFolders": [
|
|
|
|
"ROOT",
|
|
|
|
"packages/twenty-zapier",
|
|
|
|
"packages/twenty-docker",
|
|
|
|
"packages/twenty-utils",
|
|
|
|
"packages/twenty-postgres"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|