Commit Graph

4791 Commits

Author SHA1 Message Date
ecf21774dd Fix workspace hydratation (#12452)
We must separate the concept of hydratation which happens at the request
level (take the token and pass auth/user context), from the concept of
authorization which happens at the query/endpoint/mutation level.

Previously, hydratation exemption happened at the operation name level
which is not correct because the operation name is meaningless and
optional. Still this gave an impression of security by enforcing a
blacklist. So in this PR we introduce linting rule that aim to achieve a
similar behavior, now every api method has to have a guard. That way if
and endpoint is not protected by AuthUserGuard or AuthWorspaceGuard,
then it has to be stated explicitly next to its code.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-06-09 14:14:32 +02:00
322c8a1852 Upgrade to Node22 (#12488)
BlocknoteJS requires an ESM module where our server is CJS, this forced
us to pin the server-util version, which led us to force the resolution
of several packages, leading to bugs downstream.

From Node 22.12 Node supports requiring ESM modules (available from Node
22.0 with a flag). So I upgrade the module.
I picked Node 22 and not Node 23 or Node 24 because 22 is the LTS and we
don't plan to change node versions frequently.

If you remain on Node 18, things should still mostly work, except if you
edit a Rich Text field.

I also starting changing the default runtime for Serverless Functions
which isn't directly related. This means new serverless functions will
be created on Node 22, but we will still need another PR to migrate
existing serverless functions before September (end of support by AWS).

(In this PR I also remove the upgrade commands from 0.43 since they rely
on Blocknote and I didn't want to have to deal with this)

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-06-06 18:35:30 +02:00
0188b66280 Add filters to search record action (#12481)
First PR to add filters to send records. Lot of work left, but I want to
split. I mainly want to validate the architecture there.


https://github.com/user-attachments/assets/63375a75-ba88-49df-8c12-5e3e58de5342

TODO in next PRs:
- fix design
- make filters reliable. Some composite fields are not implemented and
some fields like datetime do not work well
- improve typing
2025-06-06 12:29:53 +00:00
b85ea721e5 i18n - translations (#12478)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-05 21:01:38 +02:00
254a3eadb8 i18n - translations (#12477)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-05 20:57:07 +02:00
b2c57c5dcc Update billing page ctas (#12459)
## Before

![image](https://github.com/user-attachments/assets/95315651-8b04-4004-a6b6-8742ebcc6f9d)

## After
<img width="1056" alt="image"
src="https://github.com/user-attachments/assets/4a51b7c7-898b-485f-95e8-97911292f2b1"
/>
<img width="1299" alt="image"
src="https://github.com/user-attachments/assets/44e5e545-a660-455a-91be-3b139ccb9f30"
/>
<img width="1180" alt="image"
src="https://github.com/user-attachments/assets/0ca765a7-1d9a-473a-b7d2-c6f9b1a72417"
/>
<img width="963" alt="image"
src="https://github.com/user-attachments/assets/b620fd8a-61c9-4dd3-a3b1-e4ba940371e4"
/>
<img width="863" alt="image"
src="https://github.com/user-attachments/assets/a0d2dcb5-19e5-4f83-80d4-ad5a715f1e5f"
/>

---------

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2025-06-05 20:56:55 +02:00
c75f10bc33 Fix filter sub-field icons (#12456)
This PR fixes filter sub-field icons, with more relevant icons.

Fixes https://github.com/twentyhq/core-team-issues/issues/1006
2025-06-05 20:54:49 +02:00
7c898cd008 Fix filter and sort chips in view bar (#12455)
This PR fixes the filter and sort chips in the view bar.

Fixes https://github.com/twentyhq/core-team-issues/issues/1002
Fixes https://github.com/twentyhq/core-team-issues/issues/1003
2025-06-05 20:53:47 +02:00
276f1796cc Implemented dropdown menu section label in filter and sort (#12453)
This PR implements a new component `DropdownMenuSectionLabel`, to be
used for indicating visible and hidden fields in the multiple dropdowns
that use those two sections.

After : 

<img width="247" alt="Capture d’écran 2025-06-04 à 12 49 42"
src="https://github.com/user-attachments/assets/759c48ca-c54d-4921-bea6-cbfe7a2d244d"
/>
<img width="252" alt="Capture d’écran 2025-06-04 à 12 49 20"
src="https://github.com/user-attachments/assets/72cd63d0-e5d6-4000-897d-c16efd8396c9"
/>
<img width="359" alt="Capture d’écran 2025-06-04 à 12 48 44"
src="https://github.com/user-attachments/assets/d7c41039-dc15-46d7-be89-33a39e226fb2"
/>

In this PR we also fix the scrolling behavior of those two sections so
that it is more natural. The height mechanism will be properly
refactored by this issue :
https://github.com/twentyhq/twenty/issues/11766, in the mean time this
temporary modification is working :


https://github.com/user-attachments/assets/c7ddb424-66b9-41e3-a6a8-a29ece09d62e

Some components that weren't used are also removed :
`AdvancedFilterDropdownFieldSelectMenu`,
`AdvancedFilterDropdownFieldSelectMenuItem` and
`AdvancedFilterDropdownSubFieldSelectMenu`

Fixes https://github.com/twentyhq/core-team-issues/issues/1000
2025-06-05 20:50:12 +02:00
26bd16a2cb fix: favicon when workspace icon is removed (#12451)
closes #12304
2025-06-05 20:46:08 +02:00
6f156a69b0 feat: new tab list (#12384)
closes #9904

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-06-05 20:44:21 +02:00
a86b5fb9b2 fix(frontend): prevent command menu reopening when clicking the same field (#12390)
ressolve #12205
This PR fixes the issue where the record in the command menu was
reopening when clicking the same field again.

https://github.com/user-attachments/assets/52da7b3f-4704-4a9c-8fc4-29534568b0c0




- Added recordId to cells so it can be accessed when
useListenClickOutside is triggered, and compared the previous recordId
with the new one to prevent closing the command menu for the same
record.

- When the field is clicked, we compare the lastRecordId with the new
recordId inside the openRecordInCommandMenu function to avoid reopening
the menu unnecessarily.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-06-05 20:32:46 +02:00
76860207ca Index-back-into-the-game (#12466)
# Indexes

### TLDR:
 Putting indexes back, except relation ones

### Details:
- Added index synchronization logic back (it was removed previously in
45d4845b26)
in the sync-metadata service.

- for unique inedexes, a command will create unicity again by handling
duplicates that were cretated since the
45d4845b26
was triggered
2025-06-05 20:01:37 +02:00
61237916fd Fix Integration test (#12470)
# Integration test failing

- fix the local run by renaming folder in the jest configuration.
Otherwise "clickhouse" tests were failing

- falsy test introduced 2 days ago in
https://github.com/twentyhq/twenty/pull/12271/files
2025-06-05 19:57:53 +02:00
2f89b36693 Fix ClientConfigProviderEffect infite loop (#12472)
Fixes an infinite loop introduced by #12371

An infinite loop was triggered when there was an error when fetching the
client config.
Cause of the bug: `isLoadedOnce` wasn't set to true when catching an
error in `useClientConfig`.

This effect then created an infinite loop inside
`ClientConfigProviderEffect` because `fetchClientConfig` updated
`clientConfigApiStatus.isLoading` but not `isLoadedOnce`.

```typescript
useEffect(() => {
    if (
      !clientConfigApiStatus.isLoadedOnce &&
      !clientConfigApiStatus.isLoading
    ) {
      fetchClientConfig();
    }
  }, [
    clientConfigApiStatus.isLoadedOnce,
    clientConfigApiStatus.isLoading,
    fetchClientConfig,
  ]);
```
2025-06-05 19:38:10 +02:00
9598a4dda2 Fix infinite loop on table load (#12474)
This was a tough one:
- we should avoid updating lazy findManyRecords function with
onCompleted callback, this is prone to infinite loops
2025-06-05 19:37:23 +02:00
39d3c6a218 i18n - translations (#12468)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-05 16:01:19 +02:00
3f30964523 [FE] handle restricted objects 2 (#12437)
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-06-05 15:49:22 +02:00
ad804ebecd i18n - translations (#12465)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-05 14:22:43 +02:00
2dd8b9af10 add field validation + add other subfields import (#12444)
- Add some subfield imports : primaryLinkLabel / primaryPhoneCallingCode
/ additionalPhones
- Add validation rules for field and subfield

Comments
- Check other validations that can be done
- Refacto on subFieldKey ("...Label")
- Add global tests on validation step -
[issue](https://github.com/twentyhq/core-team-issues/issues/1067)

closes https://github.com/twentyhq/core-team-issues/issues/903 
closes https://github.com/twentyhq/core-team-issues/issues/910
closes https://github.com/twentyhq/core-team-issues/issues/985
closes https://github.com/twentyhq/core-team-issues/issues/904
2025-06-05 12:12:24 +00:00
b481abbb0f Begin refactoring AI module (#12464)
Cleaning up to prepare for a few tests
2025-06-05 12:28:42 +02:00
a67435f840 i18n - translations (#12458)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-04 15:24:58 +02:00
63c9af54f5 feat: implement TS vector search filter (#12392)
Closes #12427 

This PR introduces a comprehensive search filter system that enhances
the application's data filtering capabilities. At its core, the
implementation leverages a custom useSearchFilter hook that manages
search state and operations, providing a consistent search experience
across different components. The search functionality is optimized for
performance through debounced operations (500ms) and efficient state
management using Recoil. Users can trigger search through keyboard
shortcuts (Ctrl/Cmd + F) or UI interactions, with the system maintaining
search state persistence and providing clear visual feedback. The
implementation integrates seamlessly with the existing record filtering
system, view bar components, and advanced filter system, while ensuring
good performance through optimized re-renders and component state
isolation.


https://github.com/user-attachments/assets/12936189-fba8-44b3-a30c-d8cb6d6bd514

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Marie <51697796+ijreilly@users.noreply.github.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
Co-authored-by: Jordan Chalupka <9794216+jordan-chalupka@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
Co-authored-by: Guillim <guillim@users.noreply.github.com>
Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com>
Co-authored-by: jaspass04 <147055860+jaspass04@users.noreply.github.com>
Co-authored-by: martmull <martmull@hotmail.fr>
Co-authored-by: Thomas des Francs <tdesfrancs@gmail.com>
Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: Matt Dvertola <64113801+mdvertola@users.noreply.github.com>
Co-authored-by: guillim <guigloo@msn.com>
Co-authored-by: Zeroday BYTE <github@zerodaysec.org>
2025-06-04 15:07:52 +02:00
7046965496 Fix dropdown z index (#12442)
Fixes https://github.com/twentyhq/twenty/issues/11942

This PR creates two different dropdown z indexes, one for normal
dropdowns, and one for the dropdowns inside modals.
2025-06-04 11:14:56 +02:00
f7e2c1c627 Fix metadata mocks loaded during login issue (#12446)
If you tried to add a delay in `refreshObjectMetadataItems` like this`
await new Promise((resolve) => setTimeout(resolve, 5000))`, then this
caused an issue where the user was redirected to his workspace because
the metadata was not loaded.

This happened because I had removed the call to fetch metadata
explicitly in useAuth (instead relying on the effect to fetch it because
it was done twice). I had removed it because this was causing issues in
the onboarding process where /metadata was called too early and then
cached with the wrong reply.

The correct fix is instead to change the fetch policy to `network only`
to stop hiding re-renders to the object metadata effect with Apollo's
cache mechanism. Now the [] reply isn't cached in the onboarding, the
metadata effect is only triggered during initial page load and refresh
should be called explicitely.

I also noticed a bug on the server side where sometimes the frontend was
passing a token for public requests (login token exchange request,
public domain data request). I removed the check so that the backend
completely ignores the token when it's passed on public request. The
downside is that we're losing information for logs (who did that request
to a public endpoint), but it doesn't make much sense to throw
authentication errors on that endpoint imo. Probably a better root-cause
fix would be to understand why a token is still passed on the frontend,
but that would require more investigation — the bug happened when I was
signing up and redirected from the app.xxx domain to the workspace
domain
2025-06-04 11:01:30 +02:00
e227c0443a Fix workflow diagram success edges (#12439)
## Before
<img width="492" alt="image"
src="https://github.com/user-attachments/assets/6c85baea-3b58-4196-87ab-dcc7bcb4e5ca"
/>

## After
<img width="477" alt="image"
src="https://github.com/user-attachments/assets/0428f1f0-ef73-4fa1-b778-d1536a8b84e6"
/>
2025-06-03 16:51:04 +02:00
0e68602030 Fix function input computation in workflow code step (#12440)
As title
Fix consist by awaiting for getFunctionInputFromSourceCode response
2025-06-03 16:50:46 +02:00
7ab3d19e64 update setup docs - config variables (#12370)
closes https://github.com/twentyhq/core-team-issues/issues/958
2025-06-03 16:24:28 +02:00
cb010d90fe 998 workflow restore (#12417)
Add a post hook to restore workflow sub-entities
2025-06-03 15:28:43 +02:00
a943f9cf36 Improve documentation by adding multiple emails support (#12435)
Follow up on https://github.com/twentyhq/twenty/pull/12368

---------

Co-authored-by: Thomas des Francs <tdesfrancs@gmail.com>
2025-06-03 13:07:06 +00:00
eb7556e333 Fix: multi-select default values validation (#12271)
https://github.com/user-attachments/assets/3bea63cc-b098-4252-8787-fc6263f01e8d


Closes #12277

---------

Co-authored-by: prastoin <paul@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-06-03 15:01:58 +02:00
eed9125945 Improved participant matching with additional emails support (#12368)
# Improved participant matching with additional emails support

Closes #8991 

This PR extends the participant matching system to support additional
emails in addition to primary emails for both calendar events and
messages. Previously, the system only matched participants based on
primary emails, missing matches with secondary email addresses.

- Contact creation now consider both primary and additional emails when
checking for existing contacts
- Calendar and message participant listeners now handle both primary and
additional email changes
- Added tests

## To test this PR:

Check that:
- Primary emails take precedence over additional emails in matching
- Case-insensitive email comparisons work correctly
- A contact is not created if a person already exists with the email as
its additional email
- Event listeners handle both creation and update scenarios
- Matching and unmatching logic works for complex email change scenarios
- When unmatching after a change in a primary or secondary email, events
and messages should be rematched if another person has this email as its
primary or secondary email.

---------

Co-authored-by: guillim <guigloo@msn.com>
2025-06-03 14:36:56 +02:00
179365b4bc making sure status is "ONGOING" (#12432)
Fixes #12428
2025-06-03 14:36:06 +02:00
a8eacd30a1 better logging of calendar failures (#12431)
better logging to troubleshoot calendar events failure :

```
[Nest] 1  -  [GoogleCalendarGetEventsService] Error: internal_failure
```
2025-06-03 12:23:36 +00:00
278a7baf5e Feat: add support for day-first and year-first date formats (DD/MM/YYYY, YYYY/MM/DD) (#12333)
Closes #12152 



https://github.com/user-attachments/assets/53640777-578f-4de8-a1f8-52d409a7582d

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-06-03 14:12:01 +02:00
70cc3e75fe Eliminate unnecessary API calls when persisting field (#12429)
Fixes #10177

Modified `usePersistField` to check for deep equality between the value
to persist and the current record store value before sending an update
query.
2025-06-03 12:20:57 +02:00
ece2784ed7 Fix linter post merge (#12430) 2025-06-03 11:51:49 +02:00
4aae6bae1c fix(packages): shell command built from environment values (#12386)
b7473371b3/packages/twenty-server/src/engine/core-modules/serverless/commands/add-packages.command.ts (L6-L6)


b7473371b3/packages/twenty-server/src/engine/core-modules/serverless/commands/add-packages.command.ts (L10-L10)


b7473371b3/packages/twenty-server/src/engine/core-modules/serverless/commands/add-packages.command.ts (L79-L79)

Fix the issue should avoid dynamically constructing the shell command.
Instead, we can use `execFile` or `execFileSync`, which allows us to
pass arguments as an array, avoiding shell interpretation of special
characters. This ensures that the `folderPath` is treated as a literal
argument and not subject to command injection.

Specifically:
1. Replace the use of `execPromise` with `execFilePromise` (a
promisified version of `execFile`).
2. Modify the `addToGit` method to pass the `folderPath` as an argument
to `git add` instead of interpolating it into the command string.



---
2025-06-03 11:35:31 +02:00
f60b704feb #12336 adding gmail email sync error handling (#12383)
I believe that some emails with invalid characters are breaking the sync
process.

this PR attempts to create a "safeParseAddress" function. Hopefully this
will change current behavior of a single email breaking the entire sync
process to the sync process "skipping" an invalid email address and
continuing on.

I opened this because of issues explained in #12336

---------

Co-authored-by: guillim <guigloo@msn.com>
2025-06-03 11:17:48 +02:00
7617dd76aa removing webhooks failed logs (#12425)
As discussed with @martmull , we remove the logs in order to keep our
logs (for cloud users, Grafana) clean.

Comes in the effort of cleaning logs to faster troubleshoot, see below
the noise it creates
<img width="1345" alt="Screenshot_2025-06-02_at_13 51 40"
src="https://github.com/user-attachments/assets/70ecdb2d-f37e-446b-8df4-a6a8fb165a9a"
/>

related to [this
issue](https://github.com/twentyhq/core-team-issues/issues/1059)
2025-06-03 09:01:01 +00:00
e1395b00e3 Remove useless indexes (#12422)
As discussed with @charlesBochet - those indexes don't add any value
2025-06-03 10:03:19 +02:00
8c2da395bb Fix Invalid input in Track Analytics (#12421)
Fix #12231
2025-06-03 08:50:44 +02:00
c4ffd38435 i18n - translations (#12419)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-02 20:39:09 +02:00
8e710004ba Role page various fixes 2 (#12416)
- Fix: AvatarURL signedPath for workspace members were not consistent
when queried multiple times and it was causing the frontend to wrongly
interpret this as a change in the deepEqual condition
- Use SaveAndCancel button to be consistent with data model page
- When applying all object permission changes, a "smarter" logic applies
and removes all permissions if read is unchecked for example
- Hide settings permissions when Settings All Access is toggled
2025-06-02 20:24:53 +02:00
e1a7fa3e5d [permissions] Override workspaceDatasource.createQueryBuilder (#12415)
In the frame of https://github.com/twentyhq/core-team-issues/issues/924

- Rename dataSource -> workspaceDataSource when relevant to ease
understandability
- override workspaceDataSource.createQueryBuilder, because we don't want
developers to use it directly since it does not run permission checks at
this level. Indeed, we cannot do so because 1) datasources are shared
between roles so we would need to re-think its implementation to make
that possible, while for now we never call
workspaceDatasource.createQueryBuilder in our codebase 2)
workspaceEntityManager.createQueryBuilder, that we have overriden with
permission checks, then performs a call to
workspaceDataSource.createQueryBuilder so that would make two permission
checks.
2025-06-02 16:37:23 +00:00
5ea3a3c887 i18n - translations (#12418)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-06-02 18:08:34 +02:00
a508f4a4fb Add empty message for form actions (#12414)
<img width="503" alt="Capture d’écran 2025-06-02 à 15 55 36"
src="https://github.com/user-attachments/assets/9b3f60ae-7a13-45f8-aa87-ba32211e832f"
/>
2025-06-02 16:04:39 +00:00
e71aef5a3a Import v2 - add label for subfield in csv export (#12355)
To test : Export companies record - "Domain Name PrimaryLinkUrl" >>
"Domain Name / Link URL"

closes https://github.com/twentyhq/core-team-issues/issues/907
2025-06-02 17:21:44 +02:00
dc205370df Forbid upsert of objectPermissions on system objects (#12382)
Closes https://github.com/twentyhq/core-team-issues/issues/865
2025-06-02 15:03:37 +00:00
e13d83b660 Seed update - Replaced Qonto by Anthropic (#12340)
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-06-02 16:42:53 +02:00