Commit Graph

1739 Commits

Author SHA1 Message Date
8c982653cf fix/REDIS_URL-has-failed-the-following-constraints-isUrl (#11082)
Added 'rediss' in protocols array so that url doesn't fail isUrl
constraint
2025-03-20 22:38:27 +01:00
6d8cf442a7 Give worker access to server volume (#11065) 2025-03-20 16:43:38 +01:00
8b7188e85b [fix] [permissions] Fix role assignment at sign-up (#11045)
In [a previous PR](https://github.com/twentyhq/twenty/pull/11023) I
fixed the issue where users where re-assigned the default role when
signin up using SSO.
The "fix" actually introduced another error, calling
`assignRoleToUserWorkspace` only when a user is signing up to twenty,
forgetting about the case where an existing twenty user signs up to a
different workspace. They should still be assigned the role in that
case.

To fix this and improve clarity, I moved assignRoleToUserWorkspace to
addUserToWorkspace and renamed addUserToWorkspace to
addUserToWorkspaceIfUserNotInWorkspace since this is at each sign in but
does nothing if user is already in the workspace.

I think ideally we should refactor this part to improve readability and
understandability, maybe with different flows for each case: signIn and
signUp, to twenty or to a workspace
2025-03-20 10:37:26 +00:00
d99f027e8d 400 workflows webhooks trigger (#11041)
https://github.com/user-attachments/assets/dc0ece22-4d87-417f-b9e1-a11c3fd52ce8
2025-03-20 10:12:52 +00:00
8b513a7d3b contact creation was recreating a primaryemail du to casing (#11042)
a first step to fix some of the issues i notices in grafana for netzero

in grafana, we log this error :  
```
error: error: duplicate key value violates unique constraint "IDX_UNIQUE_87914cd3ce963115f8cb943e2ac"

query failed: INSERT INTO "workspace_20fjk7nksxxxxxxxxxxx"."person"("cdrOpportunityId", "siteOpportunityId", "xLinkPrimaryLinkLabel", "xLinkPrimaryLinkUrl", "xLinkSecondaryLinks", "linkedinLinkPrimaryLinkLabel", "linkedinLinkPrimaryLinkUrl", "linkedinLinkSecondaryLinks", "emailsPrimaryEmail", "emailsAdditionalEmails", "companyId", "deletedAt", "position", "phonesPrimaryPhoneNumber", "phonesPrimaryPhoneCountryCode", "phonesPrimaryPhoneCallingCode", "phonesAdditionalPhones", "createdAt", "id", "searchVector", "avatarUrl", "city", "jobTitle", "nameFirstName", "nameLastName", "updatedAt", "createdBySource", "createdByWorkspaceMemberId", "createdByName", "createdByContext") VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $1, $2, $3, DEFAULT, $4, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $5, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $6, $7, DEFAULT, $8, $9, $10, $11), (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $12, $13, $14, DEFAULT, $15, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $16, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $17, $18, DEFAULT, $19, $20, $21, $22), (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $23, $24, $25, DEFAULT, $26, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $27, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $28, $29, DEFAULT, $30, $31, $32, $33), (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $34, $35, $36, DEFAULT, $37, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $38, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $39, $40, DEFAULT, $41, $42, $43, $44) RETURNING "xLinkPrimaryLinkLabel", "xLinkPrimaryLinkUrl", "xLinkSecondaryLinks", "linkedinLinkPrimaryLinkLabel", "linkedinLinkPrimaryLinkUrl", "linkedinLinkSecondaryLinks", "emailsPrimaryEmail", "emailsAdditionalEmails", "companyId", "deletedAt", "position", "phonesPrimaryPhoneNumber", "phonesPrimaryPhoneCountryCode", "phonesPrimaryPhoneCallingCode", "phonesAdditionalPhones", "createdAt", "id", "searchVector", "avatarUrl", "city", "jobTitle", "nameFirstName", "nameLastName", "updatedAt", "createdBySource", "createdByWorkspaceMemberId", "createdByName", "createdByContext" 
```
The index is related to the People table on the netzero workspace
schema. When I looked at the email trying to be inserted, it contains
captial letters. I looked at the DB and there are existing small caps
emails. That's why my guess it that the failure comes from the contact
creation service.

Intersting fact, it comes from the CALENDAR source, not the email one.
That's why i added a little bit of error logging in case it reproduces
itself
2025-03-19 18:24:35 +01:00
0d40126a29 i18n - translations (#11031)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-03-19 15:20:18 +01:00
b8b00e5398 add integration test on global search resolver (#11007)
closes https://github.com/twentyhq/core-team-issues/issues/580
2025-03-19 14:22:02 +01:00
69b3b34859 [permissions] Fix user is assigned default role after SSO sign-in (#11023)
When logging using a SSO method, we call signInUp service in which we
were wrongfully assigning a role to the user even if the user is signing
in and not signin up.

This went unnoticed during our QA as a different sign-in method is
called when logging with the credentials.

---------

Co-authored-by: Weiko <corentin@twenty.com>
2025-03-19 14:14:45 +01:00
8c5335a863 i18n - translations (#11026)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-19 13:22:31 +01:00
5ba3c09b14 [CHORE] Prepare twenty-serverfor twenty-shared multi barrel refactor (#11022)
# Introduction
While running https://github.com/twentyhq/twenty/pull/10960 scripts
discovers few issues:
- Invalid named folder `pre-hooks.ts`
- Mock consuming outbound imported module resulting in consumed before
initialization
2025-03-19 11:26:42 +00:00
4ce607869e [CHORE] TypeScript Lingui configuration file (#11021)
# Introduction 
We want theses configurations to be strictly typed but needed as in
https://github.com/twentyhq/twenty/pull/10960 will browse through all
TypeScript files within the codebase
2025-03-19 12:05:55 +01:00
ecc21656cb i18n - translations (#11019)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-19 11:20:44 +01:00
7921ee5216 Stop emitting update event if before===after (#11004)
as title
2025-03-19 10:49:21 +01:00
ca9c070945 Fix activity (#11015)
Deprecating unused states and making sure that the ActivityRichText
editor loads when activity.bodyV2 is present
2025-03-19 10:45:11 +01:00
d47debaff6 i18n - translations (#11010)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-18 21:32:51 +01:00
7546d9b82c i18n - translations (#11009)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-18 21:20:45 +01:00
9e83d902d8 [permissions V2] Create and update a custom role (without granularity) (#11003)
First steps for https://github.com/twentyhq/core-team-issues/issues/595
and https://github.com/twentyhq/core-team-issues/issues/621

Not handling granular permissions through objectPermissions and
settingsPermissions next; will come next !
2025-03-18 18:42:30 +01:00
6acb70d6a9 i18n - translations (#10998)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-18 17:36:49 +01:00
0ce91d84c1 Allow to add and delete fields (#10990)
- Allow to add a new field
- On field click, display a delete button
- Use id instead of names for fields



https://github.com/user-attachments/assets/4ebffe22-225a-4bae-aa49-99e66170181a
2025-03-18 17:24:52 +01:00
6d517360d1 i18n - translations (#10994)
Created by Github action

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-03-18 17:21:25 +01:00
324794707a i18n - translations (#10988)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-18 15:34:51 +01:00
38c6222422 i18n - translations (#10986)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-18 15:20:19 +01:00
1bd3000b5d Investigate workflow user error (#10952)
Investigation related to https://github.com/twentyhq/twenty/issues/10868

- throw an error when computedVersion is undefined
2025-03-18 14:24:21 +01:00
ab9498b3de feat(workspace): delete custom domain on hard workspace delete (#10975)
Add logic to remove a workspace's custom domain during hard deletion.
Includes tests to verify behavior for both hard and soft deletion cases.

Fix #10351
2025-03-18 14:06:24 +01:00
aa6fd90424 Create objectPermissions and settingsPermissions tables (#10962)
Closes https://github.com/twentyhq/core-team-issues/issues/594
2025-03-18 10:45:31 +01:00
2be26ecc98 add temporary log to investigate on deletion logic (#10955)
related to
[611](https://github.com/twentyhq/core-team-issues/issues/611)
2025-03-17 17:13:01 +01:00
bda835b9f8 feat(twenty-front/workspace-menu): improve workspace menu (#10642)
New workspace menu
2025-03-17 15:31:31 +00:00
a2ea831b9b i18n - translations (#10949)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-17 15:34:42 +01:00
8b5d5b35ad Workspace seeders with version (#10895)
# Introduction
close https://github.com/twentyhq/core-team-issues/issues/487
Updated the seeders to infer the workspace's version from the
`APP_VERSION` env var

To test in local run: `npx nx database:reset twenty-server` with either
a defined or not defined `APP_VERSION` in your `.env`
( note that invalid semver values will throw an error and stop the
process ) ( valid version ex: `APP_VERSION=1.0.0`)
2025-03-17 15:32:49 +01:00
3e3e8de400 i18n - translations (#10948)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-17 15:20:27 +01:00
7ff2fccd5b i18n - translations (#10939)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-17 13:22:36 +01:00
b99e71c37a i18n - translations (#10938)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-17 13:11:21 +01:00
35119bceaa i18n - translations (#10936)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-17 11:35:34 +01:00
e49ba69f19 i18n - translations (#10933)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-17 11:20:51 +01:00
d0c31d3f71 Fix missing translations for advanced mode toggle (#10931)
Advanced mode toggle was in `twenty-ui` which doesn't support Lingui.

I removed lingui from the global package json and moved it to the local
package.json instead to prevent that kind of error from happening again
2025-03-17 10:09:07 +01:00
fb1e674781 Add ids to translations to make it easier to debug (#10930)
As per title
2025-03-17 09:15:54 +01:00
23b4605987 [REFACTOR] Workspace version only x.y.z (#10910)
# Introduction
We want the APP_VERSION to be able to contains pre-release options, in a
nutshell to be semVer compatible.
But we want to have workspace, at least for the moment, that only store
`x.y.z` and not `vx.y.z` or `x.y.z-alpha` version in database

Explaining this refactor

Related https://github.com/twentyhq/twenty/pull/10907
2025-03-14 19:21:44 +01:00
d0e80a5ba2 [Fix] Class validator native isSemver does not handle v-prefix (#10907)
# Introduction
Under the hood class-validator isSemver uses
https://github.com/validatorjs/validator.js/blob/master/src/lib/isSemVer.js
which does not cover all semVer use cases

## Even tho
Had a discussion with @charles was about to store in db ws version as
`vx.y.z`. We felt like we wanted it to be stored as `x.y.z`, in my
opinion `APP_VERSION` should reflect the tag used to be build the
instance and not be updated
But we could extract only `x.y.z` from it at runtime

Also handling the `v` extraction in CD is IMO not the most reliable

## Env var logging refactor
Now not stopping on first error log
```ts
Successfully compiled: 2128 files with swc (185.34ms)
Watching for file changes.
[Nest] 52686  - 03/14/2025, 6:28:33 PM   ERROR PG_DATABASE_URL should not be null or undefined
PG_DATABASE_URL must be a URL address
[Nest] 52686  - 03/14/2025, 6:28:33 PM   ERROR APP_VERSION must be a valid semantic version (e.g., 1.0.0)

/Users/paulrastoin/ws/twenty/packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts:1019
    throw new Error("Environment variables validation failed")
          ^
Error: Environment variables validation failed
    at Object.validate (/Users/paulrastoin/ws/twenty/packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts:1019:11)
    at Function.forRoot (/Users/paulrastoin/ws/twenty/node_modules/@nestjs/config/dist/config.module.js:67:45)
    at Object.<anonymous> (/Users/paulrastoin/ws/twenty/packages/twenty-server/src/engine/core-modules/environment/environment.module.ts:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at Object.<anonymous> (/Users/paulrastoin/ws/twenty/packages/twenty-server/dist/src/database/typeorm/typeorm.module.js:14:28)
```
2025-03-14 18:00:03 +00:00
ef251f8129 Set attachment authorId nullable (#10908)
## Context
This should fix workspaceMember deletion when attachments exist.
Attachment should still be available even if its author leaves the
workspace. Currently the author is never displayed in the product.

<img width="936" alt="Screenshot 2025-03-14 at 18 46 49"
src="https://github.com/user-attachments/assets/30f85505-11d9-4190-9b9e-2f9a433e5da1"
/>
<img width="953" alt="Screenshot 2025-03-14 at 18 46 25"
src="https://github.com/user-attachments/assets/6a8da47d-70ed-420d-9e18-76f5d901a909"
/>
2025-03-14 18:49:31 +01:00
b47dcba313 added lab custom domain illustration (#10905) 2025-03-14 18:26:13 +01:00
3168958f8a Allow APP_VERSION to be empty string + dockerFile fix (#10900)
# Introduction
No choice but to allow APP_VERSION to be an empty string as it's though
to dynamically define dockerfile env vars
2025-03-14 16:25:36 +00:00
61f7625238 Compute any new Workspace version from APP_VERSION (#10893)
# Introduction
We want any new activated workspace to be filled with a version equal to
the current `APP_VERSION`
Please note that in a workspace lifecycle this operation will be run
only once, discussed with @charlesBochet in front of `3 fois plus de
piments`

Going straightforward in this PR in order to release asap
Started et will continue to implem new integrations regarding `SignUp`
and `ActivateWorkspace` happy and expections path in
https://github.com/twentyhq/twenty/tree/prastoin-new-workspace-has-version-integrations-tests
2025-03-14 15:18:48 +01:00
c371dd5d27 Add custom domain to Lab and move countBoolean command to 0.44 from 0.50 (#10884)
- Add customs domain to Lab
- Moving back countBoolean command to 0.44 from 0.50 (I inadvertently
moved it yesterday night...)

<img width="592" alt="Screenshot 2025-03-14 at 12 07 44"
src="https://github.com/user-attachments/assets/1d8d7b36-f392-4df0-974d-426a55760af2"
/>
2025-03-14 15:13:44 +01:00
9883472d55 fix public feature flag update (#10887)
## Context
upsert from typeorm does not seem to return keys that are not updated,
I'm reverting back to find/save since upsert is not consistent
2025-03-14 15:01:06 +01:00
b12b2485c5 Fixed kanban for advanced filters and other bugs (#10888)
This PR mainly fixes advanced filters on kanban view.

It also fixes various bugs and cleans some old states.

## Advanced filters on kanban views

Kanban views use a different hook to retrieve data from the backend :
useLoadRecordIndexBoardColumn, this hook wasn't using the new state
currentRecordFilterGroupsComponentState.

## Removal of confusing duplicate states

A few different states were used for filters and states, where we only
need one for filters and one for sorts for all indexes. So we remove
here the different states that can lead to confusion about what state
should be used in what case.

States removed : 
- recordIndexFilterState
- recordIndexSortState
- recordIndexViewFilterGroupsState
- tableFiltersComponentState
- tableSortsComponentState

We also remove the logic that was used to manage those states.

## Abstracted non composite field type check into a util

We abstract the check made in mapFieldMetadataToGraphQLQuery into a util
isNonCompositeField, because those kinds of checks should be stored into
a separate unique file that acts as a source of truth.

## Bug with advanced filter rule position not saved

The position of an advanced filter rule wasn't correctly saved in the
backend, here we remove the WorkspaceIsSystem decorator on the
positionInViewFilterGroup fields.

The function that saved view filters was also ignoring the field
positionInViewFilterGroup, we add it back.

## Bug with view picker option dropdown closing weirdly

The view picker option dropdown was closing as soon as we hovered
outside of the option dropdown, which was annoying for the user, here we
apply the same behavior as every dropdown in the app : closing on click
outside.
2025-03-14 14:41:30 +01:00
362bc333d1 [ENH] APP_VERSIONdocumentation (#10880)
# Introduction
In https://github.com/twentyhq/twenty/pull/10751 we decided not to put
`APP_VERSION` references in `.env.example` as it's programmatically
defined by our CD and should not be override by any manual interaction.

Still, as a dev testing the upgrade command in local, if you do not set
the `APP_VERSION` in local you will encounter the following error:
```ts
'Cannot run upgrade command when APP_VERSION is not defined'
```

@guillim currently doing the release legitimately raised that it was not
very intuitive

## Levers
- Improve error message such as adding reference to checking env
variables
- App local upgrade command dev dedicated documentation ?

## Conclusion
Any suggestions are more than welcomed !
2025-03-14 10:00:32 +00:00
6cf1775fac i18n - translations (#10878)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-14 09:35:03 +01:00
2edf510de2 i18n - translations (#10877)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-14 09:21:17 +01:00
1bffe57f6b feat: added countTrue and countFalse (#10741)
fix: #10603 


https://www.loom.com/share/cebc8a19bd8e4ae684a5a215d0fd1f94?sid=cadaa395-285c-45c9-b3ce-2ae6d1330a3c

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-03-14 07:34:21 +01:00
7f8ab6dda5 i18n - translations (#10871)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-13 21:32:55 +01:00