Commit Graph

4949 Commits

Author SHA1 Message Date
c1847054f8 Playwright E2E test - sign up with invite link via email (#9332)
Related to
https://github.com/twentyhq/twenty/issues/8469#issuecomment-2471573054

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-01-12 21:52:30 +01:00
ba77091b06 fix: reset table selection when navigating away from index page (#9140)
Fixes #9132 

## Purpose
Currently, when navigating away from an index page and returning,
previously checked selections remain checked. This fix ensures the
selection context is properly reset on navigation.

## Changes
- Add `RecordIndexResetSelectionEffect` component to handle selection
cleanup
- Integrate effect into `RecordIndexPage`
- Uses existing `useResetTableRowSelection` hook to clear selections

## Testing
1. Go to any index page (e.g., Companies)
2. Select some records using checkboxes
3. Navigate to a detail page
4. Return to the index page
5. Verify that no records are selected

## Demo
I've recorded a short video demonstrating how this PR fixes the issue:

[Loom Video
Link](https://www.loom.com/share/72ca46a5dc194b5092e1944a985fa0d2?sid=55c95d8b-2376-4ac5-b406-6483aa7e341f)

Before fix: Selections persist after navigation
After fix: Selections are properly reset

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-11 11:23:07 +01:00
9ed9b310f7 Update links in docs to current release (#9553)
As this was missing I just updated to reference the files from the
current release tag
2025-01-10 21:58:30 +01:00
9d735b8562 Try migrating to depot (#9555) 2025-01-10 21:46:26 +01:00
5ec28afac9 Fix Storybook tests (#9554)
Finally fixing the storybook tests!
2025-01-10 20:54:10 +01:00
2e0169b954 Aggregate follow-up (#9547)
In this PR
- fix [some UI
regressions](https://discord.com/channels/1130383047699738754/1327189577575956514/1327189577575956514)
introduced by work on view groups
- address some follow-ups:
1. [Menu should keep selected when the menu is
open](https://discord.com/channels/1130383047699738754/1326607851824877639/1326607851824877639)
2.
[Cropping](https://discord.com/channels/1130383047699738754/1326610578869063800/1326610578869063800)
3. [Put earliest date / latest date in a separate "Date"
submenu](https://discord.com/channels/1130383047699738754/1326856023985618966/1326856023985618966)
- Refactor around date aggregate operations
2025-01-10 20:01:36 +01:00
873f20bc0e [CI][FRONT] Storybook tests sharding (#9448)
# Introduction
The idea here is to improve perf nor fluidity of both storybook build
and tests execution duration.

## Levers:
- Storybook tests
[shards](https://storybook.js.org/docs/writing-tests/test-runner)
- Refactored storybook's build caching using `actions/cache/restore` and
`actions/cache/save` to avoid useless computation with we wanna just
write or retrieve it
- Running storybook build with --test
[flag](https://storybook.js.org/docs/api/main-config/main-config-build)
( please note that we only disable docs addons in order to keep coverage
up and running )

closes https://github.com/twentyhq/core-team-issues/issues/49
2025-01-10 18:40:03 +01:00
b40f58a512 refactor(admin-panel): standardize FeatureFlagKey usage (#9548)
Replaced string-based feature flag keys with the typed FeatureFlagKey
enum across the admin panel module and related front-end hooks. This
ensures stronger type safety, reduces potential errors, and improves
consistency in handling feature flags.
2025-01-10 18:38:50 +01:00
ed51bff2f4 Clean up object record filter (#9550)
Last clean up of object dropdown filter states v1. 

Removed old state scope context component.
2025-01-10 18:37:29 +01:00
4efa959401 Fix apollo cache for workflow cmd+k (#9549)
When a workflow was activate, the previous activated version was still
available in cmd+k
This is because we were only updating entities in cache after
activation.
We also need to update the queries stored in cache, because this is
where the cmd+k look to know which workflow is active.


https://github.com/user-attachments/assets/750cc24a-7583-4641-856c-0f9892d26331
2025-01-10 18:33:10 +01:00
11a47264a7 fix: fix regression on multiItem input field when no item (#9543)
### Context
Fix on [8904 issue](https://github.com/twentyhq/twenty/issues/8904)
([PR](https://github.com/twentyhq/twenty/pull/9439)) introduces a
regression when field has no item.
Background should be lighter.
<img width="250" alt="Screenshot 2025-01-10 at 16 08 03"
src="https://github.com/user-attachments/assets/1eb39455-f24a-4301-9a72-7a9a8f5c8382"
/>


### Solution
Conditional styling, displayed only when MultiInput has item
<img width="250" alt="Screenshot 2025-01-10 at 16 08 20"
src="https://github.com/user-attachments/assets/6bc02aa0-0430-4207-8163-c31d66751f3e"
/>

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-10 18:32:52 +01:00
4ca03d0066 fix(auth): handle error properly in loadCurrentUser (#9539)
Updated the loadCurrentUser function to throw specific errors when an
API error occurs. This improves clarity and error handling, replacing
the generic "No current user result" exception.

Fix #9536
2025-01-10 17:21:33 +01:00
07fa58b042 docs(server-commands): fix typo in command to generate migrations (#9545)
- the command had `--migration:generate` instead of `migration:generate`
written in the doc
- when copy pasting it we got this error
```
Not enough non-option arguments: got 0, need at least 1
```
- after removing the extra `--` it worked as expected
2025-01-10 17:21:15 +01:00
b46bc84dab Fix mail import gmail driver when message has been deleted (#9546)
We forgot to ignore messages that were removed
2025-01-10 16:52:29 +01:00
d1170668df refactor: update import paths for FeatureFlagKey (#9542)
Replaced references to '~/generated-metadata/graphql' with
'~/generated/graphql' across multiple files. This change ensures
uniformity in import paths and aligns with the updated directory
structure.
2025-01-10 16:20:10 +01:00
92c119ed43 Add suggested values for variable dropdown (#9437)
<img width="378" alt="Capture d’écran 2025-01-07 à 15 37 20"
src="https://github.com/user-attachments/assets/c15abcac-684a-4c3b-ad12-62cf91afe927"
/>

Here is a first version:
- simple fields have a suggested value
- composite do not, but sub values of composite do
- json, arrays or complex values do not
2025-01-10 16:18:37 +01:00
5648c3b31c [refactor]: Remove isSSOEnabled logic throughout the codebase (#9462)
Eliminated all references to `isSSOEnabled` across the frontend,
backend, and configuration files. This change simplifies the codebase by
removing unnecessary feature flag checks, associated logic, and
environment variables. The SSO feature remains available without
reliance on this flag.
2025-01-10 14:45:35 +01:00
e58edc3bc1 Removed useFilterDropdown hook (#9537)
Removed useFilterDropdown hook and its many calls which were only
exporting states.

The test has been removed because it was used to do the equivalent of
testing Recoil states, so it wasn't useful anymore.
2025-01-10 14:45:17 +01:00
7b2debf6fb Add error marker when invalid main function (#9489)
## Before

![image](https://github.com/user-attachments/assets/f6af6721-0896-48b5-8556-9d2a9c19de06)

## After

![image](https://github.com/user-attachments/assets/c59407c8-8244-4906-9d05-713909a19c33)
2025-01-10 14:29:58 +01:00
ddcb3dfd28 Feature flags env variable gating (#9481)
closes #9032

---------

Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
2025-01-10 14:04:00 +01:00
75bf9e3c69 fix(admin-panel): resolve feature flag key mismatch (#9530)
Update feature flag handling by mapping input keys to enum values. This
ensures compatibility and prevents potential runtime errors when
updating workspace feature flags.
2025-01-10 12:30:42 +01:00
c716a30d92 Refactored empty filter (#9532)
Refactored empty filter function and removed it from useFilterDropdown
hook
2025-01-10 12:30:01 +01:00
654a0bb79e Fix CI Server 2025-01-10 12:29:22 +01:00
0a798a6671 Feat/view groups fast follow (#9513)
Fix #9512 

- 🟠 [Icon should be
lighter](https://discord.com/channels/1130383047699738754/1326487470895923222)
The current weight is the same as in Figma, waiting for confirmation
- 🟠 [None has an unwanted margin
left](https://discord.com/channels/1130383047699738754/1326493647796961323)
This component is used in lot of places, removing the padding left can
brake other places
- 🟢 [All cells should have a the same right
design](https://discord.com/channels/1130383047699738754/1326489001926066176)
- 🔴 [Group Sorting should not "freeze" when mouse is
release](https://discord.com/channels/1130383047699738754/1326494381795966996)
Can't find a good way to fix it, seems more related to the fact it's
running in debug mode.
- 🟢 [Alignment
issue](https://discord.com/channels/1130383047699738754/1326486523822084140)
- 🟢 [View record count
error](https://discord.com/channels/1130383047699738754/1326491489466978365)
- 🟢 [Vertically align tags and
numbers/count](https://discord.com/channels/1130383047699738754/1326490661800902728)
- 🟢 [Display "Calculate" only on hover in view
groups](https://discord.com/channels/1130383047699738754/1326490411929436191)
- 🟢 [Aggregates height in view groups is 28px instead of
32px](https://discord.com/channels/1130383047699738754/1326489587127943188)
- 🟠 [Picker under the
aggregate](https://discord.com/channels/1130383047699738754/1326487940557439039)
Can't reproduce the issue
- 🟢 [Icon should not be
hoverable](https://discord.com/channels/1130383047699738754/1326477402360123425)
- 🟢 [Crop long view
titles](https://discord.com/channels/1130383047699738754/1326477009576136755)
- 🟢 [Removing the group by on opportunities (group by none) give an
white
screen](https://discord.com/channels/1130383047699738754/1324651927962910750)
2025-01-09 19:12:57 +01:00
1f1cac3b00 chore: update returned attachement fullPath (#9516)
### Solution

fullPath prop on attachement (when returned by backend) is updated to
'domain + path' (formerly 'path').

Consequently, getFileAbsoluteURI util in front is removed.

closes #8763

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-09 19:12:36 +01:00
4c8c338316 Update ci runner for sb build 2025-01-09 18:58:36 +01:00
21774c60c7 Refactored reset filter dropdown (#9523)
This PR extracts reset filter logic from useFilterDropdown hook.

The goal is to remove useFilterDropdown hook by incrementally removing
each sub hook one by one.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-09 18:56:21 +01:00
17e2e38812 Refactored select filter and select filter definition logic (#9519)
This PR extracts the logic to manage filter and filter definition
setting.

Previously it was ambiguous, we had the same "selectFilter" naming used
for setting filter definition in filter dropdown and for setting the
actual filter value and saving to view filter states.

This is another incremental refactor, which will allow to remove
useFilterDropdown hook.
2025-01-09 18:54:34 +01:00
71a4593ba4 Move FieldMetadataType to twenty-shared (#9482)
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-09 18:43:30 +01:00
c39af5f063 Add Integration and unit tests on Billing (#9317)
Solves [ https://github.com/twentyhq/private-issues/issues/214 ]

**TLDR**
Add unit and integration tests to Billing. First approach to run jest
integration tests directly from VSCode.

**In order to run the unit tests:**
Run unit test using the CLI or with the jest extension directly from
VSCode.

**In order to run the integration tests:**
Ensure that your database has the billingTables. If that's not the case,
migrate the database with IS_BILLING_ENABLED set to true:
` npx nx run twenty-server:test:integration
test/integration/billing/suites/billing-controller.integration-spec.ts`

**Doing:**
- Unit test on transformSubscriptionEventToSubscriptionItem
- More tests cases in billingController integration tests.

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2025-01-09 18:30:41 +01:00
4ed1db3845 fix AuthException parameters 2025-01-09 18:29:09 +01:00
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