Commit Graph

5494 Commits

Author SHA1 Message Date
c0fda41519 Fix N+1 featureFlags (#10371)
## Context
featureFlag query was done for each record returned by the ORM and
transformed in the QueryResultGettersFactory which was causing an N+1
2025-02-20 19:32:30 +01:00
05d00e6604 Store the current flow definition in a state to not depend on a specific workflow version (#10352)
This PR introduces a new Recoil state to store the flow.

A few parts of the application need to know the definition of the
current flow. Previously, we stored the workflow version's ID and
fetched its definition with the `useWorkflowVersion` hook. However, we
must use another strategy to visualize workflow runs. Indeed, we now
store the definition of the workflow in the workflow run output when it
is executed. This is useful for draft versions, which can change between
the moment they were executed and the moment they are visualized.
2025-02-20 17:12:03 +01:00
d96865abc3 fix deleteCurrentWorkspace resolver output (#10365)
Tests are planned in this sprint - Core priority

closes https://github.com/twentyhq/twenty/issues/10347
2025-02-20 17:09:59 +01:00
68cb94f365 [BUGFIX] Call and await destroyDataSourceForWorkspace to avoid killing poor pod (#10364)
# Motivations
Upgrade migration is not possible atm in production because running over
all workspaces cause cpu raise leading to pod termination
2025-02-20 16:45:21 +01:00
f12bc5e126 Deduplicate-emails (#10361)
last request from @felix

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-02-20 16:34:27 +01:00
b2bbf88e28 [permissions] Place lab + billing behind settings/workspace permission gates (#10354) 2025-02-20 15:31:11 +00:00
3c80e2601f Add initialization of new record sorts state and added remove record sorts util (#10358)
This PR adds the same synchronization utils and hooks from view to
record sorts, as we did with view and record filters.

The goal is to apply what's in the view sorts only when needed.

Also added tests for those utils and hooks.

We also add useRemoveRecordSorts.
2025-02-20 16:24:02 +01:00
aeb8806f0d replyto-microsoft-fix (#10360)
During QA on main, I realised there was a tiny issue with this new
button for microsoft
2025-02-20 14:49:56 +00:00
04a62e9749 Deduplicate-emails (#10355)
Following User request to remove duplicate emails

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-02-20 15:40:49 +01:00
d4aba8d1ff move deletion limit on hard deletion (#10353) 2025-02-20 11:20:58 +01:00
94c0d0f8d2 [BUG] Refactor actor composite type (#10232)
fixes #10200 

The FieldActor Zod schema was updated to correctly handle null context.

---------

Co-authored-by: prastoin <paul@twenty.com>
2025-02-20 11:05:26 +01:00
927b8c717e Poc lambda deployment duration (#10340)
closes https://github.com/twentyhq/core-team-issues/issues/436

## Acheivements
Improve aws lambda deployment time from ~10/15 secs to less that 1 sec

## Done
- migrate with the new code executor architecture for local and lambda
drivers
- support old and new executor architecture to avoid breaking changes
- first run is long, next runs are quick even if code step is updated

## Demo using `lambda` driver
### Before


https://github.com/user-attachments/assets/7f7664b4-658f-4689-8949-ea2c31131252


### After



https://github.com/user-attachments/assets/d486c8e2-f8f8-4dbd-a801-c9901e440b29
2025-02-20 10:49:57 +01:00
3f93aba5fc Added parallel code path to set new record sorts state (#10345)
This PR implements a parallel code path to set record sorts without
impacting the actual sort, like we did on record filter.

We add a ViewBarRecordSortEffect which mirrors
ViewBarRecordFilterEffect.

It also adds availableFieldMetadataItemsForSortFamilySelector to replace
sortDefinitions progressively.
2025-02-20 10:40:25 +01:00
316876fcb5 Add files deletion when destroying attachment, workspace or workspaceMember (#10222)
Solution
- update attachment soft delete logic by destroy (seen with Weiko &
Felix)
- add two jobs for file and workspace folder deletion
- add listener to attachment and workspaceMember destroy event -> add
file deletion job
- update logic in deleteWorkspace method -> add wokspace folder deletion
job

closes https://github.com/twentyhq/core-team-issues/issues/147

To go further
- delete old avatar when workspaceMember replaces its avatar
- same with workspace picture

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-02-20 09:35:14 +00:00
422e4e33c0 [BUGFIX][PROD] RICH_TEXT_V2 command handle {} body col value (#10324)
# Introduction
Encountered in issue in production where we have a lot of records that
has RICH_TEXT_FIELD set to `{}`

```sh
[Nest] 20106  - 02/19/2025, 12:43:08 PM     LOG [MigrateRichTextFieldCommand] Generating markdown for 1 records
[Nest] 20106  - 02/19/2025, 12:43:09 PM     LOG [MigrateRichTextFieldCommand] Error in workspace 3b8e6458-5fc1-4e63-8563-008ccddaa6db: TypeError: o is not iterable
```

## Fix
While reading `fieldValue` definition also strictly check if it's `{}` +
checking after JSON parse if it's an iterable to pass to the
`serverBlockNoteEditor` in order to be 100 bullet proof for prod
migration command

## Refactor Dry run
Implemented dry run

## Refactor to Idempotency
Made the script idempotent in order to avoid issues with re-running
commands

## Error repro
- In local checkout on v0.41.5 run `yarn && npx nx reset && npx nx
start`
- Create record manually in db that has a RICH_TEXT body to `{}`
- Checkout to main, `yarn && npx nx reset && npx nx build twenty-server
&& yarn command:prod upgrade-0.42:migrate-rich-text-field -d`
2025-02-20 09:16:58 +00:00
ef9328e2e9 add not found redirection logic if object in url param not exists (#10339)
closes #10150
2025-02-20 09:17:52 +01:00
65bd1d7775 Role permissions tab should display object permissions from API result (#10344)
## Context
Role all-objects permissions were mocked. Now that the backend returns
it, we are using its values.

<img width="556" alt="Screenshot 2025-02-19 at 18 39 07"
src="https://github.com/user-attachments/assets/9a1c57fd-dc18-43ef-bc2d-be738d1716f5"
/>
2025-02-19 18:58:19 +01:00
4a2a312efd remove lingui no single variables to translate #2 (#10342) 2025-02-19 18:34:35 +01:00
202af87be5 Remove no-single-variables-to-translate eslint rule (#10341)
## Context
This rule crashes the FE for some reason, disabling it for now
2025-02-19 18:22:41 +01:00
78178010f1 following emails logic with intertnal conversaiotn (#10333) 2025-02-19 16:44:09 +00:00
984eeda807 refactor(sso): standardize SSO identity provider query names (#10335)
Updated method, query, and variable names to align with a consistent
naming convention for fetching SSO identity providers. Added
comprehensive unit tests to validate SSO service logic, ensuring better
reliability and maintainability.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-02-19 17:39:31 +01:00
4fd0c28439 i18n - translations (#10334)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-19 17:17:07 +01:00
2fc8eaa25b Implement record sort states and record sort context (#10257)
This PR is simple, it creates states for record sort, mirroring record
filter states.

It also implements RecordSortsComponentInstanceContext everywhere
RecordFiltersComponentInstanceContext is used.

This could be later merged into a common RecordContext concept but we
first need to decide how to handle the existing ContextStore and
RecordIndexContext and ideally end up with a unique context (or a
context provider component that wraps in all those contexts at once).

Some bugs are already present on main when trying to delete a sort, they
will be fixed in the next PRs.
2025-02-19 16:51:49 +01:00
2372114f52 i18n - translations (#10332)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-19 16:45:44 +01:00
ad47ab5bcd Display confirmation dialog on connected account deletion (#10323)
![deleteConfirmation](https://github.com/user-attachments/assets/1f0fea78-d02c-4351-b79f-733c08e0e0ec)

Fairly straightforward change, it's my first contribution in this
project so tried to follow the existing patterns.
I couldn't find any component tests or e2e Playwright tests touching
this area to update - happy to write some from scratch if necessary!

Closes #10285

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-02-19 16:29:10 +01:00
7bf851b29b I18n ci 9 (#10331) 2025-02-19 16:08:31 +01:00
3b8647e368 Improve i18n CI - 8 (#10330) 2025-02-19 15:44:34 +01:00
77caf36d90 Fix workflow run ouput format (#10302)
- Adapt the frontend to use the new output format
2025-02-19 15:10:59 +01:00
ad9af65898 internal-messages-backend-and-frontend (#10291)
fixes https://github.com/twentyhq/twenty/issues/10263
fixes https://github.com/twentyhq/twenty/issues/10262 also
2025-02-19 15:02:10 +01:00
7636def54d typo (#10327)
typo when doing the fix
2025-02-19 13:52:43 +00:00
f9763ff7ac fixing test mainly by @charlesBochet (#10325)
to enable CI to work

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-02-19 14:13:30 +01:00
d628958905 Remove status check when ending workflow (#10299)
Should be possible to end workflow, not matter what the current status
is.
On failure before the workflow was started, this error prevent the
workflow to be marked as failed with the right error message.
2025-02-19 13:58:32 +01:00
d5b04fae28 impersonate regression fix (#10306) 2025-02-19 12:05:40 +01:00
861face2a8 [permissions] Enforce object-records permission checks in resolvers (#10304)
Closes https://github.com/twentyhq/core-team-issues/issues/393

- enforcing object-records permission checks in resolvers for now. we
will move the logic to a lower level asap
- add integration tests that will still be useful when we have moved the
logic
- introduce guest seeded role to test limited permissions on
object-records
2025-02-19 11:21:03 +01:00
33178fa8b2 Fix sorts on table and board (#10311)
This PR fixes sorts on table and board.

The sorts were not taken into account due to the recent view refactor
that had the side effect of removing the synchronization between
recordSortsState and changing the state.

The fix was to use combined view sorts instead, which are currently the
source of truth for sorts.

Also added a confirmation modal for manual sorting on board.
2025-02-19 10:57:13 +01:00
645065abba Fix queryRunnerArgsFactory for updateMany resolver (#10322)
This was updated a few weeks ago and went unnoticed since 1) integration
tests were broken + 2) we don't have actionnable updateMany mutations in
the product at the moment

It will fix some tests, at least
all-people-resolvers.integration-spec.ts for instance
2025-02-19 10:09:27 +01:00
c0014cfe96 refactor(domain-manager): improve default workspace resolution (#10282)
Refactor logic for determining the default workspace in single-workspace
mode. Added fallback to Apple workspace when multiple workspaces are
found and updated validations to ensure a workspace is always returned.
Simplified handling of scenarios where multi-workspace mode is enabled.

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-02-19 09:06:34 +00:00
dca4fc1423 [BUGFIX] Reply button opens google (#10269)
fixes https://github.com/twentyhq/twenty/issues/10242
2025-02-19 09:58:50 +01:00
248ec4cd6f i18n CI 7 (#10321) 2025-02-19 09:24:01 +01:00
df3d3a3c0c I18n ci 6 (#10320) 2025-02-19 08:35:07 +01:00
45566fbdb6 i18n - translations (#10319)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-19 07:21:43 +01:00
84eb5fa46a i18n - translations (#10318)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-19 05:20:53 +01:00
dce7f375bc i18n - translations (#10317)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-19 03:44:15 +01:00
46914652b2 i18n - translations (#10316)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-19 01:32:47 +01:00
8d819a1489 i18n - translations (#10315)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-18 23:20:04 +01:00
7f4b5795bf Stop showing lines on translation files (#10313) 2025-02-18 21:21:32 +01:00
9c5b6c844b i18n - translations (#10312)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-18 21:21:01 +01:00
82acafb843 i18n - translations (#10310)
Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-18 19:21:28 +01:00
8d8bd4a597 feedback from Thomas (#10297)
as required by @bonapara
here :
https://discord.com/channels/1130383047699738754/1341421200739536978/1341421200739536978
2025-02-18 19:05:24 +01:00
9cdfa3384f fix the missing createdBy icon for Companies (#10307)
fixes the missing icons for createdBy chips on Companies

Refference fo the bug detection :
https://discord.com/channels/1130383047699738754/1341407800424927232/1341407800424927232


<img width="378" alt="Screenshot 2025-02-18 at 17 37 34"
src="https://github.com/user-attachments/assets/8c35ebf4-b946-4674-9f56-290be7c20c4f"
/>
2025-02-18 19:04:07 +01:00