Commit Graph

1908 Commits

Author SHA1 Message Date
Charles Bochet
2b311b5f7b
Update standard fields (#6532)
In this PR:
- adding Favorites to Tasks and Notes
- fixing inconsistencies between custom object creation and sync of
standard fields of custom objects
- fixing workspaceCacheVersion not used to invalidate existing
datasource
2024-08-04 23:22:41 +02:00
Charles Bochet
03204021cb
Refactor onboarding user vars to be absent when user is fully onboarded (#6531)
In this PR:
- take feedbacks from: https://github.com/twentyhq/twenty/pull/6530 /
https://github.com/twentyhq/twenty/pull/6529 /
https://github.com/twentyhq/twenty/pull/6526 /
https://github.com/twentyhq/twenty/pull/6512
- refactor onboarding uservars to be absent when the user is fully
onboarded: isStepComplete ==> isStepIncomplete
- introduce a new workspace.activationStatus: CREATION_ONGOING

I'm retesting the whole flow:
- with/without BILLING
- sign in with/without SSO
- sign up with/without SSO
- another workspaceMembers join the team
- subscriptionCanceled
- access to billingPortal
2024-08-04 20:37:36 +02:00
Charles Bochet
c543716381
Various fixes: profilePicture / logo upload, imageIdentifiers (#6530)
In this PR:
- refactoring auth module to extract a jwt module that can be re-used
from other part of the app (avoiding circular dependencies file module
=> auth => file (file and auth both need jwt actually)
- activating imageIdentfier on person on workspace creation (this will
put back the images on people)
- fixing picture upload (we were missing some fileToken)
2024-08-04 15:08:25 +02:00
Charles Bochet
e787215e15
Add createdBy field on custom object creation (#6529)
In this PR, I'm:
- adding createdBy field (type ACTOR) on custom objects when created
- moving `name` and `position` default column to the set of columns
automatically creation on object creation
- fixing a bug on mutations (update / create), if the targetted object
has a 'data' custom field, it was conflicting with the payload ==> I
feel we need to refactor this part of the code but we can keep this for
a bit later as we plan to move out of pg_graphql

<img width="1198" alt="image"
src="https://github.com/user-attachments/assets/891c4a97-bab1-415c-8551-dabd5996a794">
2024-08-04 13:12:24 +02:00
Charles Bochet
e2b42ee6c9 Allow free access for configuration using billing 2024-08-04 01:37:53 +02:00
Charles Bochet
76185c2f68
Add command to backfill new onboarding user vars (#6526)
As per our guideline to maintain a smooth migration to the new minor
versions, this command is backfilling existing workspaces with the 3
userVars used to keep track of user onboarding:
```
  ONBOARDING_CONNECT_ACCOUNT_COMPLETE = 'ONBOARDING_CONNECT_ACCOUNT_COMPLETE',
  ONBOARDING_INVITE_TEAM_COMPLETE = 'ONBOARDING_INVITE_TEAM_COMPLETE',
  ONBOARDING_CREATE_PROFILE_COMPLETE = 'ONBOARDING_CREATE_PROFILE_COMPLETE',
```
2024-08-04 01:04:13 +02:00
martmull
7cd5427589
Fix onboarding status performance issues (#6512)
Updated the onboardingStatus computation to improve performances

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-04 00:33:33 +02:00
Marie
e01d3fd0be
Do not override value for composite types address and links when entering input (#6502)
Closes #6434.

We don't want to override the values of the records' address or links as
they are composite field and it is costly to loose the data.
We will need a more unified behaviour here - maybe introduce a Ctrl+Z
option.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-03 20:12:31 +02:00
Marie
6e0c1b4c73
Fallback to default value when migrating value from enum (#6517)
When migrating the option values of a select type, if the field is non
nullable (for now, only available for opportunity's "stage" standard
field), we fallback to the (potentially updated) default value instead
of nullifying the value to avoid getting a database error.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-03 17:53:01 +02:00
Félix Malfait
5f88caf409
Refacto default value (#6507)
A quick followup of #6506 to add clarity and differentiate emptyValue
from defaultValue
2024-08-03 16:43:53 +02:00
Jérémy M
6432ad39b9
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:
[80c0fc7ff1).

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-03 15:43:31 +02:00
Weiko
9cf08d912a
Fix migration search path (#6520) 2024-08-02 21:34:20 +02:00
Aditya Pimpalkar
1f5c25ac0a
fix: navigate with arrow keys in select/multi-select (#5983)
closes: #4977



https://github.com/twentyhq/twenty/assets/13139771/8121814c-9a8a-4a8d-9290-1aebe145220f

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-02 20:12:46 +02:00
Weiko
c5d95dc4c8
Add logs to migration runner (#6518) 2024-08-02 19:13:39 +02:00
Thomas Trompette
277c51d58e
Add note and task target relation creation for customs (#6515)
As title

Urgent bug to fix, I will take the time to refacto this code next week

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-08-02 18:04:32 +02:00
Marie
268a0b09e0
Revert "Add skip option at sign-up (#6495)" (#6516)
This reverts commit eba6806594.
2024-08-02 16:27:08 +02:00
Marie
eba6806594
Add skip option at sign-up (#6495)
Closes #5925.

<img width="440" alt="Capture d’écran 2024-08-01 à 15 35 08"
src="https://github.com/user-attachments/assets/9a190b38-8e6a-46e6-8bf8-80a60cd52016">
2024-08-02 15:20:41 +02:00
Weiko
5870979bfa
Fix missing encoding in workspace-logo, members, person (#6510) 2024-08-02 15:18:48 +02:00
Thomas Trompette
0c036efcc4
Remove duplicated index from view picker (#6514)
<img width="815" alt="Capture d’écran 2024-08-02 à 15 15 51"
src="https://github.com/user-attachments/assets/0b192091-39f9-46c4-80b8-3c1a97f00480">
2024-08-02 15:18:29 +02:00
Thomas Trompette
950882d9fa
Fix title padding and style on task and attachment (#6509)
Fix https://github.com/twentyhq/twenty/issues/5923

<img width="593" alt="Capture d’écran 2024-08-02 à 12 09 24"
src="https://github.com/user-attachments/assets/a1c84060-9b32-4780-beb7-f44b85e49d07">
<img width="593" alt="Capture d’écran 2024-08-02 à 12 09 29"
src="https://github.com/user-attachments/assets/641cab31-723c-4253-9c3c-00fef70f2d06">
<img width="593" alt="Capture d’écran 2024-08-02 à 12 09 33"
src="https://github.com/user-attachments/assets/ba2adcb6-7651-4288-91f3-304d13c3e7bd">
2024-08-02 15:01:54 +02:00
Thomas Trompette
931a19260f
Fix label fonts in timeline events (#6511)
As title
2024-08-02 14:53:59 +02:00
Marie
489e8def9c
Fix icons not showing in sign-in background (#6513) 2024-08-02 14:34:33 +02:00
Prateek Jain
281bf689fa
Make api name editable and add expiry (#6473)
Fixes #6302

---------

Co-authored-by: martmull <martmull@hotmail.fr>
2024-08-02 13:31:06 +02:00
Lucas Bordeau
68120d529c
Add sort feature for Links type (#6503)
Closes https://github.com/twentyhq/twenty/issues/5741

Filtering was already working.

I just added the required logic in the frontend to allow sorting by
primary link url (because label can be empty)
2024-08-02 11:10:54 +02:00
Lucas Bordeau
f0ca3439a8
Fixed sort bug when two select values were null (#6493)
Fixes https://github.com/twentyhq/twenty/issues/5762

The problem was only happening with a sort on a select type field, also
appears with currency type and maybe other types.

This was because NULL values were sorted in a random order because the
sort function was comparing two NULL values as not equal, so I just
added a case for when A === B === NULL.
2024-08-02 10:48:36 +02:00
Félix Malfait
0dcdda3928
Add updated at column (#6506)
Introduced `updatedAt` column. and fix an existing bug where the field
edition page was crashing because we were trying to compute Date('now')
(param coming from the default value)
2024-08-02 10:03:36 +02:00
Weiko
676c902731
Fix timelineActivity updated fields (#6494)
## Context
We recently introduced the new twenty ORM and used it in the update
methods in the query runner.
Initially we were using pg_graphql to fetch the record before updating
it allowing us to compare the before and the after and create a diff.
This diff is then used for the timeline activity creation. Now,
twentyORM is doing the fetch and pg_graphql is still doing the update
and their responses are not exactly the same, which means the diff is
not working as intended (e.g date types were always in the diff due to
one being in Date format and the other as a string)

This PR introduces a updatedFields property to the update event which
comes from the input. This is not ideal as this won't work for API users
that send the whole payload but will be sufficient enough for our FE
that only sends modified fields. We then compare only those fields in
the diff.
2024-08-01 18:41:28 +02:00
rostaklein
a424c63476
file storage workspace id prefix (#6230)
closes https://github.com/twentyhq/twenty/issues/6155

just an idea, i guess this could work well, but im open for discussion

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-08-01 18:07:22 +02:00
Charles Bochet
5c92ab937e
Leverage workspace activationStatus to decide if a workspace is activated or not (#6497)
An ACTIVE workspace is a workspace that has a complete workspaceSchema
and is authorized to be browsed by users.

In this PR, I'm:
- introducing a new activationStatus: PENDING_CREATION (existing ACTIVE
/ INACTIVE)
- removing workspaceService.isWorkspaceActivated (based on
workspaceSchema existence which is not robust and checking
activationStatus.ACTIVE instead)
- removing dynamic activationStatus field on worksapce resolver (we can
use the postgres column directly now that data has been migrated)
- on user sign up creating the workspace in PENDING_CREATION, and on
workspace activation setting it to ACTIVE
- only re-activating a workspace if the current activationStatus is
INACTIVE through billing webhooks (a PENDING_CREATION should stay
PENDING and ACTIVE should stay ACTIVE)
2024-08-01 17:05:15 +02:00
Marie
1a90df8961
Create a new entry directly from a many picker (#6478)
Closes #6091
2024-08-01 15:08:07 +02:00
Thomas Trompette
8c8f192765
Trigger workflow on database event (#6480)
- Add global listener on database event
- Fetch event listener associated
- Trigger associated workflow

Also updated the runner so it expects the input to be in the payload
rather than the trigger
2024-08-01 11:57:44 +02:00
martmull
ae423f5e75
Improve typing definition (#6481)
- added typing for workflow-runner results
- fix workflow typing
- add a `workflow-action-runner` submodule that contains factories for
action runners
- added code-action-runner
- simplified code
2024-08-01 11:38:31 +02:00
SIDDAM VINAY
0f69106558
Fix row background not changing to blue on selection (#6479)
[Screencast from 2024-07-31
21-57-49.webm](https://github.com/user-attachments/assets/d2d80b10-def9-4d0e-8bcc-53555742db19)
@Bonapara Please review
Closes #6461 - fixed , on selection the background is now changing to
blue
2024-08-01 11:29:06 +02:00
Félix Malfait
3a1576bc22
Fix 2 small bugs following tasks migration (#6483)
This PR fixes two bugs:
- A broken link to the task page that had been left on the mobile
version
- On Kanban cards, the badge for notes/tasks wasn't properly displayed
because the title wasn't loaded from the backend
2024-08-01 11:28:09 +02:00
nitin
8c7ae9e07f
Adjusted empty tag style (#6465)
Fixed Issue #6307  

corrected 
- border style
- font color
- font weight

added
- Empty Tag story
2024-08-01 10:29:05 +02:00
gitstart-app[bot]
d9dcd63a1c
Expose duplicate check on REST API and enable batch duplicate checks (#6328)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-5472](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-5472).
This ticket was imported from:
[TWNTY-5472](https://github.com/twentyhq/twenty/issues/5472)

 --- 

### Description:
- Following what is already done in the code, we create a REST endpoint
that generates the Graphql query and returns its result.

### Refs: #5472


### Demo:

<https://www.loom.com/share/e0b1030f056945a0bf93bdd88ea01d8f?sid=6f128e8c-370b-4079-958e-0ea2d073a241>

FIxes #5472

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: gitstart-twenty <140154534+gitstart-twenty@users.noreply.github.com>
Co-authored-by: martmull <martmull@hotmail.fr>
2024-08-01 10:08:22 +02:00
pereira0x
c3417ddba1
Share an email thread to workspace members chip and dropdown (#4199) (#5640)
# Feature: Email thread members visibility

For this feature we implemented a chip and a dropdown menu that allows
users to check which workspace members can see an email thread, as
depicted on issue (#4199).

## Implementations

- create a new database table (messageThreadMember)
- relations between `messageThreadMembers` and the relevant existing
tables (`MessageThread` and `WorkspaceMembers`)
- added a new column to the `MessageThread table`: `everyone` - to
indicate that all workspace members can see the email thread
- create a new repository for the new table, including new queries
- edit the queries so that the new fields could be fetched from the
frontend
- created a component `MultiChip`, that shows a group of user avatars,
instead of just one
- created a component, `ShareDropdownMenu`, that shows up once the
`EmailThreadMembersChip` is clicked. On this menu you can see which
workspace members can view the email thread.

## Screenshots

Here are some screenshots of the frontend components that were created:

Chip with everyone in the workspace being part of the message thread:

![image](https://github.com/twentyhq/twenty/assets/26422084/80d75cdc-656f-490d-9eb1-a07346aad75c)

Chip with just one member of the workspace (the owner) being part of the
message thread:

![image](https://github.com/twentyhq/twenty/assets/26422084/c26677c6-ab93-4149-8201-b110d7346a28)

Chip with some members of the workspace being part of the message
thread:

![image](https://github.com/twentyhq/twenty/assets/26422084/9eccf5f8-134c-4c62-9145-5d5aa2346071)

How the chip looks in a message thread:

![image](https://github.com/twentyhq/twenty/assets/26422084/a9de981d-7288-4aed-8616-c1cb7de524e2)

Dropdown that opens when you click on the chip:

![image](https://github.com/twentyhq/twenty/assets/26422084/a1bb9cd4-01bb-45c5-bf8b-b31c2f3d85e0)

## Testing and Mock data

We also added mock data (TypeORM seeds), focusing on adding mock data
related to message thread members.

## Conclusion

As some of the changes that we needed to do, regarding the change of
visibility of the message thread, were not covered by the existing
documentation, we were told to open a PR and ask for feedback on this
part of the implementation. Right now, our implementation is focused on
displaying who is part of an email thread.

Feel free to let us know which steps we should follow next :)

---------

Co-authored-by: Simão Sanguinho <simao.sanguinho@tecnico.ulisboa.pt>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-31 18:50:27 +02:00
Charles Bochet
ae7821ce70
Fast follows on new task/note behaviors (#6477)
In this PR, I'm fixing two issues that we have faced:
- computing a rich text first line in case of the first block content is
not a text
- migrating existing timelineActivities tied to tasks / notes to
linked-tasks / linked-notes during migration command
2024-07-31 17:49:56 +02:00
Félix Malfait
ff74623dbb
Add opportunities to search and fix a small bug (#6476) 2024-07-31 16:50:16 +02:00
Félix Malfait
80c0fc7ff1
Activity as standard object (#6219)
In this PR I layout the first steps to migrate Activity to a traditional
Standard objects

Since this is a big transition, I'd rather split it into several
deployments / PRs

<img width="1512" alt="image"
src="https://github.com/user-attachments/assets/012e2bbf-9d1b-4723-aaf6-269ef588b050">

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: bosiraphael <71827178+bosiraphael@users.noreply.github.com>
Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: Faisal-imtiyaz123 <142205282+Faisal-imtiyaz123@users.noreply.github.com>
Co-authored-by: Prateek Jain <prateekj1171998@gmail.com>
2024-07-31 15:36:11 +02:00
Thomas des Francs
defcee2a02
0.23 changelog (#6472) 2024-07-31 15:04:41 +02:00
Marie
64763fb70c
Revert update of workspaceMember standard id (#6475) 2024-07-31 15:04:26 +02:00
martmull
424225943c
Add missing break (#6474) 2024-07-31 14:01:18 +02:00
martmull
6b4c79ff0d
Add workflow runner (#6458)
- add workflow runner module
- add an endpoint to trigger a workflow via api
- improve error handling for serverless functions

## Testing
- create 2 serverless functions
- create a workflow
- create this workflow Version
```
{
  "type": "MANUAL",
  "input": {"b": "bb"},
  "nextAction": {
    "name": "step_1",
    "displayName": "Code",
    "type": "CODE",
    "valid": true,
    "settings": {
      "serverlessFunctionId": "Serverless function 1 Id",
      "errorHandlingOptions": {
        "retryOnFailure": {
          "value": false
        },
        "continueOnFailure": {
          "value": false
        }
      }
    },
    "nextAction": {
      "name": "step_1",
      "displayName": "Code",
      "type": "CODE",
      "valid": true,
      "settings": {
        "serverlessFunctionId": "Serverless function 1 Id",
        "errorHandlingOptions": {
          "retryOnFailure": {
            "value": false
          },
          "continueOnFailure": {
            "value": false
          }
        }
      },
      "nextAction": {
        "name": "step_1",
        "displayName": "Code",
        "type": "CODE",
        "valid": true,
        "settings": {
          "serverlessFunctionId": "Serverless function 2 Id",
          "errorHandlingOptions": {
            "retryOnFailure": {
              "value": false
            },
            "continueOnFailure": {
              "value": false
            }
          }
        }
      }
    }
  }
}

`
``
- call 
```
mutation Trigger {
  triggerWorkflow(workflowVersionId: "WORKFLOW_VERSION_ID") {
    result
  }
}
```
- try when errors are injected in serverless function
2024-07-31 12:48:33 +02:00
Marie
b8496d22b6
Do not add 'https' prefix while migrating domainName if source url is empty (#6471) 2024-07-31 12:03:49 +02:00
Lucas Bordeau
db2cb2bc2d
Fixed format date unit test (#6469)
With the introduction of the new function formatToHumanReadableTime, we
had to modify a unit test that wasn't using a UTC date as input data.
2024-07-31 11:50:55 +02:00
Marie
7fe00b163e
Add logs and fix timestamps in migrate domain command (#6468) 2024-07-31 11:23:19 +02:00
AbdulQader Qassab
50f1cd352d
Add description for Developers/webhook page (#6327)
- Add optional description field to webhook page in developer settings.

Fix https://github.com/twentyhq/twenty/issues/6236

---------

Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
2024-07-31 10:59:30 +02:00
Prateek Jain
ee4f1da956
Fix total count in show page (#6462)
Fixes #6405 

We need to take into account both the totalCount of **before cursor**
results and **after cursor** results.
2024-07-30 19:16:36 +02:00
Faisal-imtiyaz123
70f9df7dc4
Fixes Remove Compact View From Kanban View Sub Options Menu's ( #6116 ) (#6453)
fixes  #6116
2024-07-30 18:39:04 +02:00
Weiko
3fa758e59a
Fix background mock (#6463)
## Before

<img width="1284" alt="Screenshot 2024-07-30 at 18 24 04"
src="https://github.com/user-attachments/assets/3c8d2ee9-daa0-4b32-ac90-7124252bc79c">

## After
<img width="1317" alt="Screenshot 2024-07-30 at 18 23 57"
src="https://github.com/user-attachments/assets/5dd36510-cf42-4698-a395-8435e6552810">
2024-07-30 18:33:05 +02:00
bosiraphael
77152a10b1
Fix company creation duplicate on email sync after introducing links type (#6460)
- Introduce `extractDomainFromLink`
- Use is inside `create-company.service`
2024-07-30 18:10:36 +02:00
Weiko
b85ae7e1ac
Fix googleApisSetRequestExtraParams (#6455) 2024-07-30 16:08:59 +02:00
Thomas Trompette
68e3730be1
Fix base graphql error message (#6457)
Display error message instead of name

<img width="762" alt="Capture d’écran 2024-07-30 à 15 51 07"
src="https://github.com/user-attachments/assets/a6b49254-a99e-42fc-8704-089f38bf8e7b">
2024-07-30 15:55:57 +02:00
Marie
3a37dfc7d5
Fix domainName seeds (#6454) 2024-07-30 15:14:36 +02:00
Lucas Bordeau
ccf4d1eeec
Date formatting per workspace member settings (#6408)
Implement date formatting per workspace member settings

We'll need another round to maybe initialize all workspaces on the
default settings.

For now the default behavior is to take system settings if nothing is
found in DB.

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-07-30 14:52:10 +02:00
Charles Bochet
45ebb0b824 Seed workspaces as active 2024-07-30 14:49:14 +02:00
Thomas Trompette
e3496a19b5
Move folder (#6451)
Fix folder mistake
2024-07-30 14:16:23 +02:00
Thomas Trompette
ee14f25996
Add enable workflow trigger endpoint (#6443)
Basic endpoint that only returns a boolean currently and overrides the
previous listener.
2024-07-30 14:00:37 +02:00
Weiko
c449b4cbfb
Fix user query fragment (#6450) 2024-07-30 12:47:14 +02:00
bosiraphael
cd4263f7fd
6431 create new field activationStatus inside workspace table (#6439)
Closes #6431 
- create new field `activationStatus`
- create migration commands
- add logic to update `activationStatus` on workspace activation and on
stripe subscriptionStatus change

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-30 12:36:39 +02:00
Marie
8e35edad30
Migrate domainName field from text type to links type (#6410)
Closes #5759.
2024-07-30 11:47:37 +02:00
martmull
fb0fd99a38
Fix error handling in serverless service (#6442)
- narrowing error handling in aws sdk usage
- updating dto to authorize null descriptions
2024-07-29 18:51:57 +02:00
Charles Bochet
0a21a16eb0
Raise coverage (#6441)
Adding a few tests and remove a few unused files to raise code coverage
a bit
2024-07-29 18:50:35 +02:00
Charles Bochet
d2fe31061e
Improve RecordShowPage Header performances (#6440)
In this PR, I am:
- removing a useEffect (we use the onCompleted prop of useFindManyQuery
hook)
- moving this logic into a RecordShowPageHeader to avoid re-renders of
the whole tree
2024-07-29 18:11:41 +02:00
NitinPSingh
0fd3c8b264
Fix 6428/chat open on clicking dropdown (#6429)
This issue was caused due to last comomit on issue by me only
fix_6127/support_button_updated

I had fixed the chat opening problem , in this commit

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-29 17:41:33 +02:00
nitin
6bc7622e1e
Record Page Navigation Arrows Cause Unnecessary skeleton loading (#6367)
@Bonapara 
Issue #6325 

- Desired Behavior
The navigation should always be visible. Clicking on a Next/Previous
arrow should immediately increment the number without switching to the
skeleton loading step.
**Done** 

Please let me know what do you think about this approach.

Thanks :)



https://github.com/user-attachments/assets/bda3608f-87e3-45bd-a7c8-4a6b48391cf2

Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: martmull <martmull@hotmail.fr>
2024-07-29 17:00:22 +02:00
Thomas Trompette
515d6fb1c5
Filter out by error code + invert filtering (#6432)
As title

Instance of not working well.

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-29 16:18:23 +02:00
Lucas Bordeau
9b28eebfd6
Fixes CI post merge (#6435)
This PR fixes CI problems post merge of
https://github.com/twentyhq/twenty/pull/6282

CI often crashes because some TS files aren't included during
development and developers push errors on their PR.

Created an issue to mitigate this :
https://github.com/twentyhq/twenty/issues/6436
2024-07-29 15:37:14 +02:00
Weiko
4389e81e64
fix timeline activity deleted field (#6433)
Fixes https://github.com/twentyhq/twenty/issues/6362
2024-07-29 15:17:40 +02:00
gitstart-app[bot]
fed12ddfcd
Improve performance of demo workspace - Rename getImageAbsoluteURIOrBase64 function (#6282)
### Description

1. This PR is a continuation of a previous PR:
https://github.com/twentyhq/twenty/pull/6201#pullrequestreview-2175601222

2. One test case was removed here:
`packages/twenty-front/src/utils/image/__tests__/getImageAbsoluteURI.test.ts`
because since we are not handling base64 images anymore, the result is
the same of the last test case. Would you rather we update the test
instead?


### Refs

- #3514
- https://github.com/twentyhq/twenty/pull/6201

### Demo


https://www.loom.com/share/4f32b535c77a4d418e319b095d09452c?sid=df34adf8-b013-44ef-b794-d54846f52d2d

Fixes #3514

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-07-29 14:07:21 +02:00
martmull
00fea17920
Serverless function UI (#6388)
https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=36235-120877

Did not do the file manager part. A Function is defined using one unique
file at the moment

Feature protected by featureFlag `IS_FUNCTION_SETTINGS_ENABLED`

## Demo


https://github.com/user-attachments/assets/0acb8291-47b4-4521-a6fa-a88b9198609b
2024-07-29 13:03:09 +02:00
Charles Bochet
936279f895 Fix incorrect fetch of userVars when users are part of multi-workspaces 2024-07-28 11:58:10 +02:00
Charles Bochet
dcb8c7c03a Fix incorrect fetch of userVars when userId is not specified 2024-07-28 11:30:14 +02:00
nitin
75e0e1434a
Update UI to Match Figma Specs: Labels, Buttons, Gaps (#6415)
@Bonapara 
Done with issue #5910 

![Screenshot from 2024-07-25
22-37-03](https://github.com/user-attachments/assets/6c241f55-81e5-4d3f-b718-b823bc313d67)

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-28 11:05:10 +02:00
NitinPSingh
9d51af3b41
fix #6127 updated support button (#6422)
fix #6127 

updated the Support button toopen a menu that allows users to either
access the [user guide](https://twenty.com/user-guide) or contact
support through the chat.

![Screenshot
(675)](https://github.com/user-attachments/assets/026e48ee-c397-44ae-bee7-e76698298a52)

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-27 18:40:34 +02:00
bosiraphael
6728e40256
5899 display a banner to alert users which need to reconnect their account (#6301)
Closes #5899

<img width="1280" alt="Index - banner"
src="https://github.com/twentyhq/twenty/assets/71827178/313cf20d-eb34-496a-8c7c-7589fbd55954">

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-27 18:34:52 +02:00
bosiraphael
d0db3b765f
6255 move services from messaging common module into the correct module and refactor them (#6409)
Closes #6255 

- Move files from `messaging/common` into the correct module
- Remove common module between calendar and messaging
`calendar-messaging-participant-manager`
- Update and fix massaging and calendar participant matching
- Create `MatchParticipantModule`

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-27 12:29:02 +02:00
Thomas Trompette
3060eb4e1e
Handle query runner errors (#6424)
- Throw service error from query runner
- Catch in resolver factories 
- Map to graphql errors

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-27 12:27:04 +02:00
gitstart-app[bot]
3ff24658e1
"Name" column is visible on table view but not on kanban view (#6427)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-4238](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-4238).
This ticket was imported from:
[TWNTY-4238](https://github.com/twentyhq/twenty/issues/4238)

 --- 

## Description

- We moved the filter from RecordIndexContainer to RecordBoardCard, this
change will fix the fix issue that the name column was not visible in
Kanban view and will keep the behavior in the Kanban card. The options
dropdown uses the same state that the card uses, but the name is
rendered on the card because, for the name field, the card uses another
data because the render of the name is different from the render of the
other fields, so we removed the filter in the state, but we need to
filter only in the card to avoid duplicated data, we could not find any
other case that this filter is useful for another component
- We updated the type in RecordBoardFieldDefinition to fix TS error in
RecordBoardCard file

### Demo

<https://jam.dev/c/7c9db8e1-9b53-49cf-a44c-0b0fec5b1988>

### Refs

- #4238

Fixes #4238

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-07-27 11:58:51 +02:00
Thomas Trompette
368f142f3a
Delete cache version on reset db (#6426)
As title
2024-07-27 11:54:03 +02:00
Charles Bochet
5a1835e9e0 Improve datasource creation resilience to missing cache 2024-07-27 11:35:47 +02:00
Aakarshan Thapa
1529148c04
Updated MessageChannelSyncStatus enum: changed COMPLETED to ACTIVE (#5965)
Fixes #5961

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-25 21:17:55 +02:00
Charles Bochet
7b943457c8 Update sync-metadata to use feature-flag core module 2024-07-25 20:47:38 +02:00
Charles Bochet
8083175432
Fix object metadata not found (#6416) 2024-07-25 20:34:50 +02:00
Charles Bochet
4cb83e050f
Put workfows behind a feature flag (#6417)
We have recently merged
[#workflow](https://github.com/twentyhq/twenty/pull/6412) but we should
put the workflow standard object behind a feature flag for now

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-07-25 20:33:31 +02:00
Charles Bochet
515bf666cf Do not create identifier for remote object 2024-07-25 18:39:08 +02:00
Thomas Trompette
ce68f8ac79
Add workflow and version as standard object (#6412)
As title

Hidden behind a feature flag.
2024-07-25 18:33:11 +02:00
Charles Bochet
d022837b5b
Display command logs on boot error (#6414)
As per title
2024-07-25 17:53:57 +02:00
bosiraphael
b31153105f
Fix participant chip (#6411)
- Fix gap
- Modify query to retrieve person and workspaceMember to display a
record chip inside the message right drawer

Before:
<img width="74" alt="Capture d’écran 2024-07-25 à 17 14 57"
src="https://github.com/user-attachments/assets/b37e19d0-8efb-408d-aba7-66d9a7cca433">
<img width="105" alt="Capture d’écran 2024-07-25 à 17 14 40"
src="https://github.com/user-attachments/assets/f6d4b164-279b-4be3-ac66-6b613a3f3144">

After:
<img width="126" alt="Capture d’écran 2024-07-25 à 17 13 53"
src="https://github.com/user-attachments/assets/97059253-6f5d-4f8c-b2b6-acd614862801">
<img width="67" alt="Capture d’écran 2024-07-25 à 17 14 18"
src="https://github.com/user-attachments/assets/0808a354-1c97-4bb6-8cf7-9d4c10c3a4d4">
2024-07-25 17:24:51 +02:00
nitin
9618639744
Align Workspace Switcher with Breadcrumb by Adjusting Height (#6384)
@Bonapara 
Issue #6375 

This change makes sure the container height is 32px instead of 28px.
should the container inside it should also be 32px, please refer video
below for context


https://github.com/user-attachments/assets/fe97f0de-e1fd-4fda-a9a7-e9585469c530


Also skeleton height is 20px (refer video below), the black component in
the video is the skeleton for this particular component.
What should be skeletons height?


https://github.com/user-attachments/assets/0956c8d9-8e4e-4c20-bb71-7fb1e2cba4fd

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-25 13:59:46 +02:00
Charles Bochet
d073ebff43
Prevent field with null standardId to be considered as field identifier (#6407)
Otherwise, any custom field will be considered as image/label identifier
by the sync-metadata scripts
2024-07-25 13:28:10 +02:00
Jérémy M
d0201e17ac
Fix: query runner orm (#6397)
Fix WorkspaceQueryRunner events using TwentyORM

Fix #6057

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-25 13:21:57 +02:00
martmull
b9c8d607aa
Test revert crm integration (#6321)
PR to test revert integration in production
2024-07-25 09:38:55 +02:00
martmull
7c6ca0e841
Fix api timeout (#6401) 2024-07-25 08:38:05 +02:00
Marie
082d55beac
[fix] Migrated links field should be standard (#6387)
Fixing script + ading logs to sync-metadata
2024-07-24 12:16:14 +02:00
Marie
001e698bbe
Use LinksMetadata right type for Links fields (#6380) 2024-07-24 10:48:15 +02:00
Pacifique LINJANJA
6785a2b92c
chore: remove the passwordResetToken field from the database (#6377)
# This PR

- Fix #6305
2024-07-24 10:44:11 +02:00
nitin
895910e1d1
Fix RecordTableHeaderCell (#6383)
@Bonapara

Fixed! the issue (#6365) where the `background-color` style was not set,
causing the bug. Now, the background color is properly applied.



https://github.com/user-attachments/assets/668bd3cc-77ea-42a9-84d4-071fca497e07
2024-07-24 10:41:03 +02:00
Marie
b0b2281fc5
Fix mocks for unlogged users (#6376) 2024-07-24 10:08:54 +02:00
brendanlaschke
ea4d051c4e
Fix task text overflow (#6351)
closes #5552

<img width="754" alt="Bildschirmfoto 2024-07-19 um 23 35 25"
src="https://github.com/user-attachments/assets/715192cd-679d-430a-95f1-8bc1d8fd26f4">
2024-07-24 10:04:10 +02:00
Aryan Singh
5c8fe027f9
5425 - Introducing support for all Composite Fields Import (#5470)
Adding support for all Composite Fields while using the "import"
functionality. This includes:
- Currency
- Address

Edit : 
- Refactored a lot of types in the spreadsheet import module
- Renamed a lot of functions, hooks and types that were not
self-explanatory enough

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-23 18:02:23 +02:00
Charles Bochet
2cc0597ee4 Update seed links format 2024-07-23 14:48:26 +02:00
Charles Bochet
6c34ef9a14
Simplify ORM (#6373)
This PR refactors the ORM-Manager to simplify and unify the datasource
creation. I'm deprecating all usages if InjectWorkspaceDatasource and
InjectWorkspaceRepository as we can't be sure they are up-to-date
2024-07-23 14:13:16 +02:00
Marie
794e73eeb6
Migrate conferenceLink to type Links (#6372) 2024-07-23 14:09:52 +02:00
Marie
8d33264a7d
Migrate fields of deprecated type LINK to type LINKS (#6332)
Closes #5909.

Adding a command to migrate fields of type Link to fields of type Links,
including their data.
2024-07-23 09:57:30 +02:00
Charles Bochet
c69d665114
Fix reset PasswordToken (#6366)
## Bug Description

We are facing a bug in case recaptcha is enabled.
To reproduce:
- Create your recaptcha: https://www.google.com/recaptcha/about/
- update your server .env with the following variables:

```
CAPTCHA_SECRET_KEY=REPLACE_ME
CAPTCHA_SITE_KEY=REPLACE_ME
CAPTCHA_DRIVER=google-recaptcha
```

- Go to the login page, enter an existing user email and hit 'Reset your
password'.

- Add a console.log in emailPasswordResetLink in auth.resolver.ts to get
the token that would be sent by email if you don't have the mailer setup

- Browse: /reset-password/{passwordToken}

- Update the password:
<img width="1446" alt="image"
src="https://github.com/user-attachments/assets/dd5b077f-293e-451a-8630-22d24ac66c42">

- See that the token is invalid

You should see two calls in your developer network tab. A successful one
to update the password and another to log you in. This 2nd call
(Challenge) does not have the captcha token provided. It should be

## Fix

- Refreshing the token on page load
- providing it to the Challenge graphql call
2024-07-22 17:36:31 +02:00
brendanlaschke
01fe3b673e
Datamodel overview show other fields (#6352)
<img width="638" alt="Bildschirmfoto 2024-07-19 um 23 49 00"
src="https://github.com/user-attachments/assets/57b600c4-d985-4e4c-afc0-e0c6dd5bc9f6">

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 16:13:49 +02:00
brendanlaschke
4545ba2737
Update blocknote (#6349)
Updating blocknote providing bugfixes & new block types

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 16:00:14 +02:00
Charles Bochet
d212aedf81
Fix ORM (#6363)
This PR fixes a few bugs on TwentyORM:
- fix many to one relations that were not properly queries
- fix many to one relations that were not properly parsed
- compute datasource (or use from cache) at run-time and do not use
injected one that could be outdated

We still need to refactor it to simplify, I feel the API are too complex
and we have too many cache layers. Also the relation computation part is
very complex and bug prone
2024-07-22 15:07:35 +02:00
Faisal-imtiyaz123
284e75791c
Fixes Strange behaviour when reordering options of select field (#6103) (#6339)
fixes #6103

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 14:33:02 +02:00
falko100
f24536c115
Add Confirmation Modal for Deletion Action and Map All Action Bar Entries (#6357)
This pull request addresses an issue where the delete button, placed
closely to the export button, could lead to accidental deletions without
confirmation. The problem was that the confirmation modal for the delete
action, being the second action, was not displayed. The code was updated
to map all action bar entries and display their respective confirmation
modals correctly.

### Changes Made:
- Updated the rendering of action bar entries to ensure all confirmation
modals are shown.
Changed from displaying only the first action bar entry's confirmation
modal to mapping through all entries and displaying each modal if it
exists.
- Removed the delete from the onClick because it is present in the
onConfirmClick.
2024-07-22 14:22:10 +02:00
Marie
14fcd5f900
Fix display of boolean fields in timeline activities (#6361)
before
<img width="556" alt="Capture d’écran 2024-07-22 à 11 29 59"
src="https://github.com/user-attachments/assets/c3f76698-77f8-411f-8488-c3b119184f91">

after
<img width="963" alt="Capture d’écran 2024-07-22 à 11 31 07"
src="https://github.com/user-attachments/assets/29248677-16c6-49f5-8a86-cfe8aa677d86">
2024-07-22 14:15:10 +02:00
Faisal-imtiyaz123
4f249df831
Fixes data importer showing incorrect unmatched fields (# 6138) (#6311)
fixes #6138

---------

Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
2024-07-22 14:13:00 +02:00
gitstart-app[bot]
41931c53e8
Record board columns design fix (full height borders) (#6350)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-5273](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-5273).
This ticket was imported from:
[TWNTY-5273](https://github.com/twentyhq/twenty/issues/5273)

 --- 


## Description:

- We added a min-height to fix the main issue, in two components, one of
them needs \`calc\` because the border causes the creation of a
scrollbar
- The change on the overflow fixes the issue mentioned
[here](https://github.com/twentyhq/twenty/issues/5273#issuecomment-2232945913)

## Refs: #5273

## Demo:

\
<https://jam.dev/c/01cac1e5-ed66-439c-88fb-9406a06429c5>\
\
Fixes #5273

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-07-22 13:58:55 +02:00
brendanlaschke
936994ff44
Fix demo opportunities name (#6347)
closes #5129
2024-07-22 12:22:32 +02:00
Ashmash100
52c6320f74
Fixed reset rating field to "no value" on star re-click (#6296)
### Description
Resolves Issue:  [https://github.com/twentyhq/twenty/issues/6224](#6224)

### Additional Consideration
I have changed the default start rating value from 1 star to no star
since clicking on the selected start was reverting the filed to 1 star
which didn't seem like the appropriate behaviour. Let me know if this
change is fine

---------

Co-authored-by: JosephAshwin23 <joseph.sanjivi@anywhere.co>
Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
2024-07-22 12:17:10 +02:00
Priyank Sevak
33fc4ff907
New "inverted" Background Colors (#6354)
- Added 2 new Inverted background colors as requested under issue#4726

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 12:03:23 +02:00
Charles Bochet
d8cadad0fa
Deprecate inject workspace repo (#6353) 2024-07-20 00:43:29 +02:00
Charles Bochet
2e38c3bbc1
Refactor raw queries to use prepared query to avoid security vuln. (#6348)
As per title, we should avoid at all cost using non-prepared query and
NEVER use them whenever the input come from the user.
2024-07-19 22:32:40 +02:00
Charles Bochet
cac0d22285 Fix chromatic pixel tests 2024-07-19 19:42:04 +02:00
Lucas Bordeau
b64e8096d6
Fixed scoped hotkeys (#6322)
- Removed enabled props from useScopedHotkeys becayse it doesn't work
- Moved enter useScopedHotkeys in a handler that we drill down to the
text inputs on the settings form

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-19 19:25:12 +02:00
Jérémy M
de20c564c7
feat: add eslint rule for enforcing WorkspaceService naming convention (#6308)
### Description

This PR introduces a custom ESLint rule named
`inject-workspace-repository`. The purpose of this rule is to enforce
naming conventions for files and classes that use the
`@InjectWorkspaceRepository` decorator or include services ending with
`WorkspaceService` in their constructors.

### Rule Overview

The new ESLint rule checks for the following conditions:

1. **File Naming**:
- Only file ending with `.service.ts` or `.workspace-service.ts` are
checked.
- If a file contains a class using the `@InjectWorkspaceRepository`
decorator or a service ending with `WorkspaceService` in the
constructor, the file name must end with `.workspace-service.ts`.

2. **Class Naming**:
- Classes that use the `@InjectWorkspaceRepository` decorator or include
services ending with `WorkspaceService` in their constructors must have
names that end with `WorkspaceService`.

### How It Works

The rule inspects each TypeScript file to ensure that the naming
conventions are adhered to. It specifically looks for:

- Constructor parameters with the `@InjectWorkspaceRepository`
decorator.
- Constructor parameters with a type annotation ending with
`WorkspaceService`.

When such parameters are found, it checks the class name and the file
name to ensure they conform to the expected patterns.

### Example Code

#### Valid Cases

1. **Correct File and Class Name with Decorator**:
    ```typescript
    // Filename: my.workspace-service.ts
    class MyWorkspaceService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    ```

2. **Service Dependency**:
    ```typescript
    // Filename: another.workspace-service.ts
    class AnotherWorkspaceService {
      constructor(private myWorkspaceService: MyWorkspaceService) {}
    }
    ```

#### Invalid Cases

1. **Incorrect Class Name**:
    ```typescript
    // Filename: my.workspace-service.ts
    class MyService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    ```

2. **Incorrect File Name**:
    ```typescript
    // Filename: my.service.ts
    class MyWorkspaceService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    // Error: File name should end with '.workspace-service.ts'.
    ```

3. **Incorrect File and Class Name**:
    ```typescript
    // Filename: my.service.ts
    class MyService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    // Error: File name should end with '.workspace-service.ts'.
    ```

4. **Incorrect File Type**:
    ```typescript
    // Filename: another.service.ts
    class AnotherService {
      constructor(private myWorkspaceService: MyWorkspaceService) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    // Error: File name should end with '.workspace-service.ts'.

    ```

5. **Incorrect Class Name with Dependency**:
    ```typescript
    // Filename: another.workspace-service.ts
    class AnotherService {
      constructor(private myWorkspaceService: MyWorkspaceService) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    ```

### First step

This rule is only a warning for now, and then we'll migrate all the code
that need to be migrated and move from `warn` to `error`.

Fix #6309

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-19 19:17:57 +02:00
Charles Bochet
41211dc1a6 Fix linter and yarn.lock not being synced 2024-07-19 18:57:38 +02:00
Lucas Bordeau
187b6f9335
Fix record show page request errors (#6345)
- Removed getCursorFromRecordId
- Get cursor from request
- Fixed problem with navigation and optimistic rendering
2024-07-19 18:43:46 +02:00
Faisal-imtiyaz123
12c33159e0
Fixes Default View Ordering (#6114) (#6326)
fixes #6114

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-19 18:27:33 +02:00
Jérémy M
088d061b3e
feat: twenty orm for standard and custom objects (#6178)
### Overview

This PR builds upon #5153, adding the ability to get a repository for
custom objects. The `entitySchema` is now generated for both standard
and custom objects based on metadata stored in the database instead of
the decorated `WorkspaceEntity` in the code. This change ensures that
standard objects with custom fields and relations can also support
custom objects.

### Implementation Details

#### Key Changes:

- **Dynamic Schema Generation:** The `entitySchema` for standard and
custom objects is now dynamically generated from the metadata stored in
the database. This shift allows for greater flexibility and
adaptability, particularly for standard objects with custom fields and
relations.
  
- **Custom Object Repository Retrieval:** A repository for a custom
object can be retrieved using `TwentyORMManager` based on the object's
name. Here's an example of how this can be achieved:

  ```typescript
const repository = await this.twentyORMManager.getRepository('custom');
  /*
* `repository` variable will be typed as follows, ensuring that standard
fields and relations are properly typed:
   * const repository: WorkspaceRepository<CustomWorkspaceEntity & {
   *    [key: string]: any;
   * }>
   */
  const res = await repository.find({});
  ```

Fix #6179

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
2024-07-19 18:23:52 +02:00
Antar Das
a86cc5cb9c
fix: icon visibility on horizontal scroll #6304 (#6315)
https://github.com/user-attachments/assets/5f8741ad-bdab-4ef3-8741-dacbd2381ea3

fix: When scrolling horizontally, table header goes behind the first
frozen column #6304
2024-07-19 18:00:31 +02:00
Weiko
a374922902
Cannot delete label identifier associated field (#6340)
## Context
An object should always have a labelIdentifier (would be its primary key
at least). If the associated field is deleted by a user, it will break
the app. Ideally we should handle that on the DB level but we don't have
a FK for this column yet.
In the meantime I'm adding the validation check in the backend, note
that this is already handle on the FE side since the "archive/delete"
buttons don't appear for such fields so you need to reassign it to
another field first which is the desired behaviour.
2024-07-19 15:57:40 +02:00
Lucas Bordeau
b38006455d
Fixed sort for Currency type (#6333)
Fixes : #6056 

- Refactored the logic to get order by query variables for field types
- Added a case for Currency field type
2024-07-19 15:27:28 +02:00
Charles Bochet
d488b7f80f Linter fix post merge conflicts 2024-07-19 15:20:25 +02:00
Sandab Gharti GC
7e80cd5366
mod: entrypoint for docker to setup db even in server with less memory (#5815)
Hello team,

- Modified File: `packages/twenty-docker/twenty/entrypoint.sh`
- Reason: The current `entrypoint.sh` works fine for server with RAM
more than 8GB. But the server with less RAM will give error while
running `scripts/setup-db.ts`.

![setup-db-failed](https://github.com/twentyhq/twenty/assets/52379037/5e27240a-23ef-4d52-93bb-337e1a004feb)

- My commit: It will set `NODE_OPTIONS="--max-old-space-size=8192"` in
docker entrypoint which guarantee to run the script successfully.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-19 14:54:00 +02:00
RobertoSimonini1
7b615cf97e
truncate the string if overlow the text (#6166)
This PR aims to fix #6102 

I think we should dicuss a bit about how we should manage the lenght and
set the variables globally

Edit : 

@RobertoSimonini1 I used this PR to fix various problems that were left
unsolved :
- Refactor TextDisplay component, EllipsisDisplay was redundant with
OverflowingTextWithTooltip
- Removed maxWidth on TextDisplay for all other components, as it wasn't
the right way to do it, the parent container should be responsible for
width not the TextDisplay (code smell)
- Drilled-down isCentered to respect its intent in the RecordInlineCell
display of the record show page title
- Fixed RecordInlineCellEditMode so that the portal is well centered
above the record show page title
- Fixed DoubleTextInput width so that it expands normally and takes all
its parent available space.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-19 14:25:57 +02:00
Lucas Bordeau
1b0759ef2f
Fix post merge revamp navigation bar (#6297)
Closes #6285 

@charlesBochet Also added some more utils for our component state v2.
2024-07-19 14:24:47 +02:00
Weiko
67e2d5c73a
Add label identifier to object decorator (#6227)
## Context
LabelIdentifier and ImageIdentifier are metadata info attached to
objectMetadata that are used to display a record in a more readable way.
Those columns point to existing fields that are part of the object.
For example, for a relation picker of a person, we will show a record
using the "name" labelIdentifier and the "avatarUrl" imageIdentifier.
<img width="215" alt="Screenshot 2024-07-11 at 18 45 51"
src="https://github.com/twentyhq/twenty/assets/1834158/488f8294-0d7c-4209-b763-2499716ef29d">

Currently, the FE has a specific logic for company and people objects
and we have a way to update this value via the API for custom objects,
but the code is not flexible enough to change other standard objects.

This PR updates the WorkspaceEntity API so we can now provide the
labelIdentifier and imageIdentifier in the WorkspaceEntity decorator.

Example:
```typescript
@WorkspaceEntity({
  standardId: STANDARD_OBJECT_IDS.activity,
  namePlural: 'activities',
  labelSingular: 'Activity',
  labelPlural: 'Activities',
  description: 'An activity',
  icon: 'IconCheckbox',
  labelIdentifierStandardId: ACTIVITY_STANDARD_FIELD_IDS.title,
})
@WorkspaceIsSystem()
export class ActivityWorkspaceEntity extends BaseWorkspaceEntity {
  @WorkspaceField({
    standardId: ACTIVITY_STANDARD_FIELD_IDS.title,
    type: FieldMetadataType.TEXT,
    label: 'Title',
    description: 'Activity title',
    icon: 'IconNotes',
  })
  title: string;
...
```
2024-07-19 14:24:04 +02:00
Sanidhya Singh
8a1af3a2ff
Fix: Number of records design on kanban (#6313)
Fixes #6306 

On hover, the VerticalDots icons will appear but the number of records
won't disappear.
2024-07-18 18:45:05 +02:00
Weiko
65e8503da8
Fix Metadata GQL server hook (#6323)
## Context
We've created a yoga (gql server) hook that catches requests and cache
them when needed. In practice we use it on the "objects" query because
this is often queried on the FE and it should never return something
different unless the schema has been intentionally changed by the user
when editing their data model (updating objects, fields, etc).

The issue here is we always cache the response regardless of its result,
even when it fails. This PR fixes that behaviour by only caching the
query response if it is successful.

I'm also fixing the cache key because the signature let users put
multiple operations and the cache key was not taking this into account
(we always use it on only one operation but we might have issues in the
future because another operation response could have erased the cached
response of another). Now the cache key contains the name of the
operation as well.

## Test
tested locally by manually throwing an error in the JWT auth guard
2024-07-18 16:51:50 +02:00
Marie
a4e82d643a
Support custom composite field deletion (#6320)
as per title
Fixes #6033 and closes #4841
2024-07-18 15:28:32 +02:00
Charles Bochet
62e9492e8b Fix email and calendar settings not displayed when only one channel is present 2024-07-18 09:23:14 +02:00
Weiko
efd932e99b
Add rating filter/sort + fix isEmpty/isNotEmpty + fix combinedViewFilters (#6310)
## Context
- Adding RATING sort and filter capabilities.
- Fixing isEmpty/isNotEmpty filters
- Fixing combined view filters so it combines filters per field metadata
and not per filter id. This is more a product question but to me it does
not make sense to apply multiples filters on the same field IF the
operations is wrapped in a AND. If at some point we want to put a OR
instead then that would make more sense
2024-07-17 17:54:37 +02:00
martmull
47ddc7be83
6181 workflows create a custom code executor (#6235)
Closes #6181

## Testing
- download Altair graphql dev tool https://altairgraphql.dev/#download
- create a file locally `test.ts` containing:
```
export const handler = async (event: object, context: object) => {
  return { test: 'toto', data: event['data'] };
}
```
- play those requests in Altair:
mutation UpsertFunction($file: Upload!) {
  upsertFunction(name: "toto", file: $file)
}

mutation ExecFunction {
  executeFunction(name:"toto", payload: {data: "titi"})
}
- it will run the local driver, add those env variable to test with
lambda driver
```
CUSTOM_CODE_ENGINE_DRIVER_TYPE=lambda
LAMBDA_REGION=eu-west-2
LAMBDA_ROLE=<ASK_ME>
```
2024-07-17 17:53:01 +02:00
Charles Bochet
e6f6069fe7
Fix tests and lint (#6303)
Fixing tests and lint on main!
2024-07-17 14:52:17 +02:00
Deval Minocha
94c2358c89
#6094 Prevent creating a custom field with an existing name (#6100)
Fixes #6094 
Description: Added logic inside SettingsObjectNewFieldStep2.tsx to
prevent form submission
Current Behaviours:
<img width="947" alt="Screenshot 2024-07-03 at 1 45 31 PM"
src="https://github.com/twentyhq/twenty/assets/95612797/bef54bc4-fc83-48f3-894a-34445ec64723">

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-17 11:43:57 +02:00
Marie
37ae99390e
Add upgrade guide section to webiste (#6294)
...to guide user to transition between versions.

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-07-17 10:06:18 +02:00
Prince Yadav
539251c7ad
fix: adding https in checkurltype (#6295)
# Fix URL handling for LinkedIn and Twitter links

Fixes #6287 

## Solution
Updated `checkUrlType` function to prepend "https://" to URLs if
missing, ensuring proper handling of social media links.

## Changes
- Modified `/packages/twenty-front/src/utils/checkUrlType.ts`
- Added a check to prepend "https://" if URL doesn't start with a
protocol

---------

Co-authored-by: Prince Yadav <prince1.yadav@tataaig.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-07-16 22:43:44 +02:00
Marie
1bfc6aeba0
Bump version to v0.22.0 (#6292) 2024-07-16 17:14:35 +02:00
Lucas Bordeau
8833a38db5
Fix undefined state from react-router-dom. (#6293)
Fix state not well typed from react-router-dom, it can be undefined and
we should check for that.
2024-07-16 17:10:19 +02:00
Marie
9711a430de
Fix command for sync stage enum (#6291)
We were missing the default value for syncStage, while it is expected
since indicated in the metadata
2024-07-16 16:50:39 +02:00
Weiko
8eb021531d
Add missing commands to 0.22 (#6286) 2024-07-16 16:14:20 +02:00
Aditya Pimpalkar
4a67cfa1c3
feat: Revamp navigation bar (#6031)
closes: #4428

Testing for fetchMoreRecords is pending, along with component tests

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-16 14:38:17 +02:00