Commit Graph

4918 Commits

Author SHA1 Message Date
f44d99d2ff Refactored object filter dropdown states (#9507)
Refactored object filter dropdown states while keeping the existing
structure to avoid creating a big PR.

The goal is to extract each sub hook returned by the useFilterDropdown
hook and create a PR for each function and the associated refactor for
the dependent zones in the code, so that we proceed by small increments.
2025-01-09 18:18:27 +01:00
524962a3d8 add httpExceptionHandlerService to oauthfilter (#9518)
## Context
500 from oauth controllers are never captured, fixing this
2025-01-09 17:48:36 +01:00
acc3aa6df5 Destroy connected account when deleting workspace member (#9484)
Closes #9114
2025-01-09 14:36:45 +01:00
7126ec5ae7 accessibility: make dropdowns accessible (#9475)
#### Motivation

Improve accessibility of dropdowns.

#### Before

Dropdowns are not accessible.

<img width="1219" alt="Screenshot 2025-01-09 at 10 00 36"
src="https://github.com/user-attachments/assets/060198f8-a42f-408c-a39a-b83da55e23c4"
/>

#### Ater

Dropdowns are accessible


![image](https://github.com/user-attachments/assets/e46d6292-913c-458b-acd4-37ed4e1a1e9b)
2025-01-09 14:19:58 +01:00
e62079ab6d Open emails and calendar events inside command menu (#9477)
https://github.com/user-attachments/assets/cfc8f85e-d49d-4aa1-a8c2-2410aca19444
2025-01-09 14:09:30 +01:00
b61db75fc5 fix: add logo url response status check when creating workspace (#9474)
### Context
Workspace logo for work email is generated via twenty favicon service.
If twenty favicon can not find user domain favicon, it responds with
404.
### Fix
Check logo url before saving it when creating new workspace

closes #9359

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-09 14:07:48 +01:00
8c1b9bf540 Revert "Change Apollo cache policy" (#9480)
Reverts twentyhq/twenty#9296
until we implement a fix for
https://github.com/twentyhq/twenty/issues/9299#issuecomment-2576868142
2025-01-09 14:04:59 +01:00
c535d21587 Include Date fields in aggregate operations on dates (#9479)
Follow-up on https://github.com/twentyhq/twenty/pull/9444/files - I had
forgotten to include Date field types (in addition to DateTime)
2025-01-09 12:13:21 +00:00
efb2a59e06 Force workflow step detail re-create (#9476)
When switching between the same step detail component, even if the props
is updated, component is not re-created.
This is an issue since form fields often keep an internal state. Which
means that even if form data are updated, the displayed value may still
be the value of the previous step detail.
Adding a key to for re-creation.
2025-01-09 10:16:12 +00:00
ae68a4b8d9 Navigation drawer sibling gap fix (#9472)
fixes
https://discord.com/channels/1130383047699738754/1326560179113955328/1326560179113955328
2025-01-09 10:49:43 +01:00
a2f2f4148a Migrate right drawer record page to the command menu (#9459)
Closes #9423



https://github.com/user-attachments/assets/0d93f170-8c4f-43ff-a0ca-3d2874d44820
2025-01-09 09:58:14 +01:00
e0e436a51d Fix File controller tests 2025-01-08 21:52:29 +01:00
9bfcd1573c Fix scalar throwing 500 (#9465)
## Context
Scalar validation/serde throws 500 instead of 400.

## Test
Before
<img width="785" alt="Screenshot 2025-01-08 at 19 17 14"
src="https://github.com/user-attachments/assets/61fadbd0-ce62-49be-bda6-c7047feb8725"
/>

After
<img width="831" alt="Screenshot 2025-01-08 at 19 16 05"
src="https://github.com/user-attachments/assets/d7038f0c-ea7a-4016-90d8-d2ce35c5763b"
/>
2025-01-08 19:24:14 +01:00
09513b66c4 Fix: Proper HTTP Status Code Usage for Authentication and Authorization Errors (#9463)
This PR ensures the correct usage of HTTP status codes (401 Unauthorized
and 403 Forbidden) for authentication and authorization errors, aligning
with standard HTTP semantics. The changes impact the handling of
AuthException across the application.

Changes Implemented
Updated Exception Handling Logic:

401 Unauthorized: Now used for cases where the user is unauthenticated
(e.g., missing JWT, expired JWT, invalid credentials).
403 Forbidden: Used strictly for cases where the user is authenticated
but lacks the required permissions.
2. Affected Files:
  before :- 
   
![Screenshot 2025-01-04
184617](https://github.com/user-attachments/assets/2d3f1c93-7d08-40d6-81b3-4c99d025a204)
 
  After:- 
  

![image](https://github.com/user-attachments/assets/7ca84182-8285-4d28-a4e4-56abefbdc4e2)
 
3.  Frontend Impact:

Verified frontend token renewal and error-handling flows.
Updated logic for handling 401 responses to trigger re-authentication
(e.g., token refresh or redirect to login).


4.Issue Resolved:   #9347
2025-01-08 19:23:14 +01:00
d324cac742 Fix : #8825 If attachment token expires, it throws a 500 error instead of Unauthenticated (#9043)
Fixes #8825

FilePathGuard implements token verification via verifyWorkspaceToken
function which throws AuthException error ,
since CanActivate expects a boolean value , we add a try catch while
verifying the token

if token is invalid/expired 
<img width="1470" alt="Screenshot 2024-12-12 at 9 44 58 PM"
src="https://github.com/user-attachments/assets/106a85dd-f894-46ea-80c3-f29b4ea5b4d3"
/>
else 
<img width="917" alt="Screenshot 2024-12-12 at 9 47 10 PM"
src="https://github.com/user-attachments/assets/d82168f4-d140-48dc-94a4-56773a93db83"
/>

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-08 19:09:33 +01:00
d61409a5df fix(auth, workspace-invitation): enforce required subdomains (#9464)
Updated the handling of `targetWorkspaceSubdomain` and `subdomain` to
enforce them as required fields. This prevents potential issues caused
by missing values during sign-in/up and workspace invitation processes.
2025-01-08 18:51:49 +01:00
bc30c6973c Fix deployment-db manifest according to docker-compose file (#9447)
Update `packages/twenty-docker/k8s/manifests/deployment-db.yaml` file to
match recent changes in docker-compose.yaml version.

- update postgresql docker image to Spilo version
- add important ENV vars
2025-01-08 17:55:47 +01:00
27b58e9f43 fix(sso): adjust callback URL generation for SAML and OIDC (#9460)
Updated SAML-specific callback URL handling to include the ID, while
OIDC URLs now use the server base URL from config. Also added a debug
log in SSO authentication and cleaned up redirection URL logic in the
frontend.
2025-01-08 16:03:30 +00:00
8475b55172 Implement aggregate operations on dates (#9444)
Adding aggregate operations for dates: min ("Earliest date") and max
("Latest date")
2025-01-08 15:45:56 +00:00
7036a8ccc3 Fix dropdown input design (#9439)
### Context
Update to match Figma design for dropdown input - [standard
input](https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=28562-75034&t=4FdGFZfPLtvNq8La-4)
/ [custom phone
input](https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=28562-74922&t=YIxM3jgx8kC9qiyQ-4)

### Preview
<img width="200" alt="Screenshot 2025-01-07 at 16 07 31"
src="https://github.com/user-attachments/assets/d61eb446-aa62-43e5-b3a4-95efc8e3997e"
/>

<img width="200" alt="Screenshot 2025-01-07 at 16 06 12"
src="https://github.com/user-attachments/assets/8e80658c-8e33-408c-96b7-733ca72de8cb"
/>

<img width="200" alt="Screenshot 2025-01-07 at 16 06 22"
src="https://github.com/user-attachments/assets/9c2b204d-aa97-4fb1-a884-54d64864c900"
/>

<img width="200" alt="Screenshot 2025-01-07 at 16 06 36"
src="https://github.com/user-attachments/assets/a47b0e49-3c25-4738-b6a6-c3f0af067bc7"
/>


closes #8904

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-08 16:16:46 +01:00
a1664fbc7b Remove identifierFieldMetadataId from createObjectInput (#9450)
Removing labelIdentifierFieldMetadataId and
imageIdentifierFieldMetadataId that should not be part of
createObjectInput as they don't make sense for an object yet to create
and will break
2025-01-08 16:08:14 +01:00
973ec83e71 Animated the Sidebar Objects Tree view opening/closing (#9287)
closes #6485 


https://github.com/user-attachments/assets/79efca87-1d9b-4fa2-a457-3117be679c6e

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-01-08 19:36:49 +05:30
bec7911d59 Navigation drawer scroll padding fix (#9141)
closes https://github.com/twentyhq/twenty/issues/9026
fixes #9312



https://github.com/user-attachments/assets/3d7df3ec-8a5e-4308-8993-82c715edc683

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2025-01-08 14:03:47 +00:00
428572ae99 Multi item input hotkeys fixes (#9453)
- Follow-up on #9442
- Fixed multi item input field on escape
2025-01-08 15:03:27 +01:00
aa0d8546a8 [REFACTOR][FRONT]: Remove objectMetadata and fieldMetadata sluggification (#9441)
# Introduction
For motivations and context please have a look to
https://github.com/twentyhq/twenty/pull/9394 whom this PR results from.
In this pull-request we remove any `metadataField` and `objectMetadata`
sluggification. We directly consume `objectMetadata.namePlural` and
`metadataField.name`, ***it seems like that historically the consumed
`metadataField.name`*** are we sure that we wanna change this behavior ?

## Notes
Unless I'm mistaken by reverting the `kebabcase` url formatting we might
be creating deadlinks that user could have save beforehand => Discussed
with Charles said it's controlled risk.

---------

Co-authored-by: Paul Rastoin <paulrastoin@Pauls-MacBook-Pro.local>
2025-01-08 11:31:53 +01:00
00a9646d68 Fixed date input fields (#9442)
- Fixed date input fields : proper hotkey management, like other fields
- Removed DropdownUnmountEffect which was causing many bugs.
2025-01-08 10:43:49 +01:00
3198748401 fix: avoid clipping by aggregate footer (#9403)
fixes #9352 

![image](https://github.com/user-attachments/assets/f62b2324-d95c-4d7e-9c21-69d36427c7b1)
2025-01-08 10:06:27 +01:00
4f7fa7adcd Minor active navigation drawer item label font color fix (#9356)
fixes
https://discord.com/channels/1130383047699738754/1324667162379685972/1324667162379685972
2025-01-08 02:33:20 +05:30
b006459e73 Sort create record action fields by view field position (#9443)
<img width="555" alt="Capture d’écran 2025-01-07 à 17 40 29"
src="https://github.com/user-attachments/assets/ac85a2d4-7867-4ae3-a639-16969a439d78"
/>

<img width="1274" alt="Capture d’écran 2025-01-07 à 17 40 43"
src="https://github.com/user-attachments/assets/adfb793a-759c-4d4b-8672-79be1b4ad3fa"
/>
2025-01-07 16:58:58 +00:00
6e04a3b19f refactor(auth): integrate react-hook-form context (#9417)
Remove redundant validation logic and streamline form handling by
leveraging react-hook-form's context. Simplify component props and
enhance consistency across the sign-in/up flow.

Fix https://github.com/twentyhq/twenty/issues/9380
2025-01-07 17:09:45 +01:00
6129052850 Fixed single record select hotkeys (#9433)
There is a problem of hotkey scope not being passed to the relation
picker used for single record select fields.

Fixed it where we open a single record select.
2025-01-07 16:06:06 +00:00
0c75b244ba Remove serverless functions on soft delete (#9438)
Delete workflow versions serverless functions when soft delete workflow
2025-01-07 15:51:34 +00:00
46f51577a3 fix frontend build 2025-01-07 16:09:48 +01:00
78849fc513 fix inject-runtime-env command 2025-01-07 15:53:16 +01:00
7d7955fc65 Move capitalize into twenty-shared (#9414)
capitalize had been moved into twenty-shared. Let's remove the
duplicates in server and front !
2025-01-07 14:25:29 +00:00
7b70f7d93b [9382][FRONT]: Compute highlighted object view using raw name plural (#9394)
# Introduction
Please find related ticket here #9382
To fix the issue the solution seems to be to stop searching for last
viewed `objectMetadata` using their slugged version `namePlural`

## Upcoming cleanup
After discussing with @charlesBochet it seems like a bad practice to
slug the `objectMetadata`, in this way in a following PR we will suggest
a cleanup of the remaining method that does within the
`useFilteredObjectMetadataItems.ts`

## Conclusion
As always any suggestions are welcomed !
Please let me know

closes #9382

---------

Co-authored-by: Paul Rastoin <paulrastoin@Pauls-MacBook-Pro.local>
2025-01-07 15:20:54 +01:00
04f648f7f3 Refactor activate workflow actions (#9434)
Closes #9407
2025-01-07 14:17:16 +01:00
b71246bc5d feat: put back group by feature flag (#9428)
Rollback and put back view group feature flag to push to prod.
2025-01-07 13:52:42 +01:00
edf0a1818c Fix inject runtime env (#9421)
Script is using here-string <<< which is not supported by sh, using bash
instead
Also removing "sh" from the command to actually use the bash from the
shebang
2025-01-07 11:02:27 +01:00
1691fa5065 Remove buggy refetch query (#9420)
- Fixes flash when writing code in workflow code steps
- Fixes tab selection collusion when switching code steps 


https://github.com/user-attachments/assets/45e884a7-6765-4596-b37f-3a22dd78664f
2025-01-07 10:59:19 +01:00
00e71477d3 feat(sso): add support for identityProviderId in SAML flow (#9411)
Updated SAML callback URLs and relevant logic to include
identityProviderId, ensuring better handling of multiple identity
providers. Refactored client and server-side code to streamline form
interactions and validation within the SSO module.

Fix https://github.com/twentyhq/twenty/issues/9323
https://github.com/twentyhq/twenty/issues/9325
2025-01-07 10:30:13 +01:00
9392acbee5 Fix use as draft (#9413)
Closes #9408
2025-01-07 10:21:00 +01:00
c61831c78a Workflow dark mode improvements (#9412)
## Dark mode

Old vs New

![CleanShot 2025-01-06 at 17 49
19@2x](https://github.com/user-attachments/assets/4fda3da0-3a84-43b5-a60b-ee2f3356e540)

![CleanShot 2025-01-06 at 17 49
32@2x](https://github.com/user-attachments/assets/e2aa498a-fa4d-41d3-af20-fa3ab605bbab)

## Light mode

Old vs New

![CleanShot 2025-01-06 at 17 49
11@2x](https://github.com/user-attachments/assets/0587d18f-4f1d-42bd-94a5-9e06be685bb3)

![CleanShot 2025-01-06 at 17 49
01@2x](https://github.com/user-attachments/assets/aacbc40c-c477-4ece-bed2-12cdf18ab705)
2025-01-06 18:07:23 +01:00
a9b95bcf03 Add count and percent aggregations to kanban headers (#9348)
Closes https://github.com/twentyhq/private-issues/issues/226


https://github.com/user-attachments/assets/cee78080-6dda-4102-9595-d32971cf9104
2025-01-06 17:57:32 +01:00
b22a598d7d Add Currency form field (#9389) 2025-01-06 15:39:48 +00:00
17bf2b6173 Move the workflow draft version overriding to the backend (#9328)
- In the `formatFieldMetadataValue` function, allow people to call
TypeORM's `save()` method with unserialized JSON data.
- Create an `overrideWorkflowDraftVersion` mutation that takes a
workflow id and the id of the workflow version to use as the new draft
  - If no draft exists yet, create one
  - If a draft already exists, deactivate its serverless functions
- Duplicate every step. For serverless function steps, it includes
duplicating the functions
  - Save the data of the step in DB
- Call the `overrideWorkflowDraftVersion` mutation in the old workflow
header and in the new Cmd+K actions
- I chose to not update the Apollo cache manually as the information of
the new draft are going to be automatically fetched once the user lands
on the workflow's show page. Note that we redirect the user to this page
after overriding the draft version.
2025-01-06 14:56:09 +01:00
7d3c8b440c fix : Update local setup doc (#9383)
Co-authored-by: Etienne Jouan <etiennejouan@MacBook-Pro-de-Etienne.local>
2025-01-06 14:04:48 +01:00
3eb7ec909e refactor(workspace, users, billing): remove default workspace + rename (#9360)
Replaced user-based parameterization with workspace-focused logic across
seed scripts, mocks, and billing services. Removed redundant `user`
references and standardized to `workspace` to align with updated
business rules. Adjusted mock data and tests to reflect these changes.

Fix https://github.com/twentyhq/twenty/issues/9295
2025-01-06 12:33:57 +01:00
25083e5405 fix: Group by not visible for table (#9365)
Group by option was not visible on table, this is fixing the issue.
2025-01-06 10:51:26 +00:00
bf00c971ee Typo in Settings - Emails (#9355) 2025-01-06 11:06:51 +01:00