Commit Graph

3036 Commits

Author SHA1 Message Date
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
a0fe94d15b adding some delay for tooltip (#9339)
tooltips are currently instantaneous. let's add some delay for better
user experience

After investigation, it looks like the open property prevents delays
from happening. Swithcing to hidden property

See https://discord.com/channels/1130383047699738754/1324678408684306486
2025-01-03 18:29:08 +01:00
5bd2154110 Add createdBy source for workflows (#9342)
Fix createdBy that is not displayed for workflows

<img width="1510" alt="Capture d’écran 2025-01-03 à 17 58 05"
src="https://github.com/user-attachments/assets/f2d4d7a9-466b-46e7-9d43-d55de88fb803"
/>
2025-01-03 17:26:15 +00:00
694c8aae40 tiny margin error (#9343)
fixing the issue reported by Thomas here
https://discord.com/channels/1130383047699738754/1324664239012446208
2025-01-03 18:00:58 +01:00
ae4615d140 Minor fixes on context menu (#9340)
- Fixed click outside for kanban not working (changed strategy)
- Tried a different approach for setting the context menu position
- Fixes https://github.com/twentyhq/twenty/issues/9336
2025-01-03 17:46:42 +01:00
e87b2c9e33 Fix creation from empty state (#9341)
Invert logic of pending record creation

Fix https://github.com/twentyhq/twenty/issues/9338
2025-01-03 17:42:13 +01:00
b433145f80 Fix access to workflow version (#9335)
Fix access to workflow version
2025-01-03 16:22:18 +01:00
e5754d2152 Remove env-config.js (#9331)
Fixes #5340 which had been open for a long time
2025-01-03 15:18:02 +01:00
03b1da82c1 Fix select all (#9337)
There was a bug when selecting all records on the index page.
This was due to the fact that
`WorkflowRunRecordActionMenuEntrySetterEffect` was mounted when it
shouldn't have been.
2025-01-03 15:13:51 +01:00
9da0a5df6f Fixed import modal content scroll bug (#9330)
fixes #9297
2025-01-03 14:05:51 +01:00
8b7e4ddad1 Creating a new task is not very smooth (#9326)
"'TODO'" is the default value from the database and must be escaped in
the frontend. The issue was revealed by the "status" field of Tasks but
it would have been the same for the others

fix #9210
2025-01-03 11:14:36 +01:00
8333892647 Fixed context menu on index page (#9316)
Fixes https://github.com/twentyhq/twenty/issues/8970

The context menu wasn't working because of wrong architecture with the
Dropdown component, as it's a unique behavior (no clickable component
and portal) it also required refactoring a bit the Dropdown component.

- Context menu now uses a portal
- Fixed dropdown offset without clickable component (now using a
fallback anchor component)
- Fixed React array key props
2025-01-03 10:11:33 +00:00
0674388426 Do not reset number on country change (#9329)
As title
2025-01-02 18:10:22 +00:00