Commit Graph

1025 Commits

Author SHA1 Message Date
88c09587db i18n - translations (#10689)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-06 11:20:45 +01:00
54865d91a3 update globalSearch resolver (#10680)
### Context
In order to deprecate search[Object] resolvers, we need to update
globalSearch resolver to bring it to the same level of functionality

### Solution
- Add includedObject args to search in pre-selected tables
- Add record filtering

### Tested on gql api  
- Simple search with search term
- Search with excluded objects, with included objects, with both and
both with search term
- Search with id filtering and all args combined
- Search with deletedAt filtering and all args combined

- from front, search in command menu

back end part of https://github.com/twentyhq/core-team-issues/issues/495
2025-03-06 09:11:25 +01:00
e92e094a81 feat(approved-access-domain): QA (#10681) 2025-03-06 07:35:10 +01:00
3cd52b052e feat: files visiblity with file configuration (#10438)
Ref: #10404 

- Added `FileFolderConfig` with `isPublic` key.
- Updated `file-path-guard.ts` to `ignoreExpiration` to validate the
token if `isPublic` is `true`.
- Token verification ignores expiration, assuming it's used to fetch
file metadata with a required workspaceId as we cannot remove the token
as we will loose the `workspaceId`.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-03-05 16:17:24 +00:00
f4fcf39eb5 [permissions] Prepare for roll-out (#10676)
Closes https://github.com/twentyhq/core-team-issues/issues/469 and
https://github.com/twentyhq/core-team-issues/issues/500

In this PR
1. stop conditioning permission initialization for a workspace to env
variable value. Instead we want to create and assign permissions and
roles in all new workspaces. For now that will be totally silent.
2. temporarily, the default role is set to the admin role for new
workspaces. it will also be the case for existing workspaces through the
backfill command. Member role is still being created though. (when we
will do the final roll-out we will update this so that future workspaces
have the member role as default role. our goal here is not to break any
current behaviour for users, that today have all have the equivalent of
admin rights).
2025-03-05 16:47:41 +01:00
91e714969f Fix REST API when metadata cache not found (#10669)
## Context
When REST API calls fail due to metadata cache version not found, we
throw an exception without trying to recover.
In Graphql implementation, the exception is thrown after recomputing the
cache. This PR implements the same logic for REST for users only user
the REST API.
2025-03-05 16:47:02 +01:00
4d7e52ef25 deprocate getProductPrices query in front end (#10397)
**TLDR:**
Deprecate getProductPrices in the frontEnd and replace it with
BillingBaseProductPrices.

**In order to test:**

- Have the environment variable IS_BILLING_ENABLED set to true and add
the other required environment variables for Billing to work
- Do a database reset (to ensure that the new feature flag is properly
added and that the billing tables are created)
- Run the command: npx nx run twenty-server:command
billing:sync-plans-data (if you don't do that the products and prices
will not be present in the database)
- Run the server , the frontend, the worker, and the stripe listen
command (stripe listen --forward-to
http://localhost:3000/billing/webhooks)
- Buy a subscription for acme workspace the choose your plan should be
using the new front end endpoint
2025-03-05 15:27:34 +01:00
03c945ef97 i18n - translations (#10661)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-04 19:37:02 +01:00
a60f7586f3 i18n - translations (#10660)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-04 19:21:32 +01:00
f6bc567aaf i18n - translations (#10652)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-04 15:34:31 +01:00
136feb57a7 i18n - translations (#10651)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-03-04 15:20:11 +01:00
9d80d2a8ef i18n - translations (#10644)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-03-04 11:35:27 +01:00
156530ff5e i18n - translations (#10639)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-04 09:12:57 +01:00
327f0cd370 Health status worker metrics improvements (#10442)
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-03-04 08:17:12 +01:00
2325e0ae0f fix(): include workspace in reset password flow (#10617)
Fix #10586
2025-03-03 16:47:33 +01:00
d2ad23d1cf fix workspace member search (#10613) 2025-03-03 11:57:07 +01:00
d19144208b Improve migration runner performances (#10572)
## Context
Workspace creation and more specifically sync-metadata performances are
bad at the moment. We are trying to identify bottlenecks and one of the
root causes is the migration runner that can take up to 10s when setting
up a new workspaces with all its tables.
First observation is we do a lot of things sequentially, mostly to make
the code easier to read and debug but it impacts performances. For
example, a table creation is done in two steps, we first ask typeorm to
create the table then ask typeorm to create columns (and sometimes
columns one by one), each instruction can take time because typeorm
seems to do some checks internally.

The proposition here is to try to merge migrations when possible, for
example when we create a table we want the migration to also contain the
columns it will contain so we can ask typeorm to add the columns at the
same time. We are also using batch operations when possible (addColumns
instead of addColumn, dropColumns instead of dropColumn)
Still, we could go further with foreign keys creations or/and try with
raw query directly.

## Test
New workspace creation:
See screenshot, 9865.40233296156ms is on main, the rest is after the
changes:

<img width="610" alt="Screenshot 2025-02-28 at 09 27 21"
src="https://github.com/user-attachments/assets/42e880ff-279e-4170-b705-009e4b72045c"
/>

ResetDB and Sync-metadata on an existing workspace commands still work
2025-02-28 19:51:45 +01:00
baa3043954 Refactor upgrade commands (#10592)
Simplifying a lot the upgrade system.

New way to upgrade:
`yarn command:prod upgrade`

New way to write upgrade commands (all wrapping is done for you)
```
  override async runOnWorkspace({
    index,
    total,
    workspaceId,
    options,
  }: RunOnWorkspaceArgs): Promise<void> {}
```

Also cleaning CommandModule imports to make it lighter
2025-02-28 19:51:32 +01:00
122a6a7801 [permissions] Backfill command to prepare workspaces (#10581)
Closes https://github.com/twentyhq/core-team-issues/issues/317

---------

Co-authored-by: Weiko <corentin@twenty.com>
2025-02-28 15:46:51 +01:00
33370f5d1f add sentry monitoring + update cron pattern to each hour (#10583)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-02-28 14:34:18 +01:00
2aa72de210 remove isRichTextV2Enabled feature flag (#10562) 2025-02-28 14:34:06 +01:00
8762c06ff2 add tests on workspace deletion logic (#10530)
closes [#424](https://github.com/twentyhq/core-team-issues/issues/424)
2025-02-28 10:38:51 +01:00
a29c26c8d7 Add submit form step endpoint (#10538)
- add endpoint to submit form step
- update context and output of workflow run
- resume workflow execution
2025-02-28 10:03:45 +01:00
a3a05c63f6 [permisions] Bypass permission checks with api key (#10516)
Closes https://github.com/twentyhq/core-team-issues/issues/325
2025-02-28 07:50:49 +01:00
0dc1cd9df1 [REG/FEAT] Sync metadata after upgrade (#10557)
# Introduction
Historically we've been programmatically running sync metadata just
after all upgrade command's migration.
Adding back this behavior as default to the new dynamic modules

Duplicated already existing synchronize metadata logic as a quick fix as
we're about to iterate over commands next sprint
2025-02-27 18:44:41 +01:00
6be66f27d3 API rest exception filter (#10548)
While troubleshooting with a person self-hosting Twenty (v0.42.2), we
figured out that logs were missing on REST findMany, findOne and
duplicate endpoints

This PR fixes it
2025-02-27 15:03:26 +01:00
39543872e6 add new @WorkspaceIsSearchable decorator + updates services + add migration command (#10507)
closes https://github.com/twentyhq/core-team-issues/issues/345
2025-02-27 13:57:07 +01:00
17dbb634ca [permissions] forbid deletion of last admin user (#10504)
A user should not be able to delete their account if they are the last
admin of a workspace.

It means that if a user wants to sign out of twenty, they should delete
their workspace, not their account
2025-02-27 12:44:51 +01:00
084554eaa8 Fix filter rest api (#10537)
## Context
Rest API is now using cache metadata but the change was not done
everywhere which was breaking the API
<img width="953" alt="Screenshot 2025-02-27 at 10 48 31"
src="https://github.com/user-attachments/assets/84f549a6-59b5-4989-b1ba-2d5c515ee47c"
/>
2025-02-27 11:05:53 +01:00
83930551d8 Move workflow versions and steps building to workflow-builder folder (#10523)
We are starting to put too many services in common folder. Version and
step building should be separated into different services and go to the
builder folder. Today builder folder only manage schema.

We should:
- keep services responsible for only one action
- keep modules based on the actual action these provide rather than
having common module

This PR:
- creates a service for workflow version builder
- moves version and step builders to workflow builder folder rather than
commun
- creates separated folders for schema, version and steps

No logic has been added. Only modules created and functions moved.
2025-02-27 10:39:48 +01:00
aa25a80171 i18n - translations (#10529)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-26 19:36:21 +01:00
7f406bc349 i18n - translations (#10528)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-26 19:21:31 +01:00
d40a5ed74f Fix REST API not using metadata cache (#10521) 2025-02-26 17:59:35 +01:00
26ea465862 i18n - translations (#10494)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 19:36:34 +01:00
45853aed8c i18n - translations (#10492)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 19:21:34 +01:00
42ea02329a Fix thread pagination (#10485)
Fixes https://github.com/twentyhq/twenty/issues/10308.

The issue came from the fact that the pagination inside the
`findAndCount` wasn't working properly. The limit was applied on the
joint table. Adding a `groupBy` fixes this, but since it isn't available
on the `findAndCount` I had to modify the query using the query builder.
2025-02-25 17:44:42 +01:00
90a390ee33 add new globalSearch resolver + update useSearchRecords hook (#10457)
# Context

To enable search records sorting by ts_rank_cd / ts_rank, we have
decided to add a new search resolver serving `GlobalSearchRecordDTO`.

-----

- [x] Test to add - work in progress


closes https://github.com/twentyhq/core-team-issues/issues/357
2025-02-25 17:43:35 +01:00
3f25d13999 i18n - translations (#10486)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 17:36:21 +01:00
85a2ad1659 i18n - translations (#10484)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 17:21:25 +01:00
589a0c7b2d Fix graphql conflict between role custom object and role dto (#10479)
## Context
Following the strategy where we want to block custom object creation
when the type is reserved by core objects. The issue happened again with
the recently introduced role table.
2025-02-25 15:46:06 +01:00
531babd46f i18n - translations (#10477)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-02-25 15:20:14 +01:00
9fe5c96d56 [permissions] Update updateRole logic + disallow self role-assignment (#10476)
In this PR

- updateWorkspaceMemberRole api was changed to stop allowing null as a
valid value for roleId. it is not possible anymore to just unassign a
role from a user. instead it is only possible to assign a different role
to a user, which will unassign them from their previous role. For this
reason in the FE the bins icons next to the workspaceMember on a role
page were removed
- updateWorkspaceMemberRole will throw if a user attempts to update
their own role
- tests tests tests!
2025-02-25 15:20:07 +01:00
61904050ac i18n - translations (#10474)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 13:22:32 +01:00
0220672fa9 Add default role to workspace (#10444)
## Context
Adding a defaultRole to each workspace, this role will be automatically
added when a member joins a workspace via invite link or public link
(seeds work differently though).
Took the occasion to refactor a bit the frontend components, splitting
them in smaller components for more readability.

## Test
<img width="948" alt="Screenshot 2025-02-24 at 14 54 02"
src="https://github.com/user-attachments/assets/13ef1452-d3c9-4385-940c-2ced0f0b05ef"
/>
2025-02-25 11:26:35 +01:00
a1eea40cf7 feat: populate relation join column (#10212)
Fix
https://github.com/twentyhq/core-team-issues/issues/241#issue-2793030259
2025-02-25 11:24:05 +01:00
dde70ee3b0 Add fields for admin panel access and workspace version (#10451)
Prepare for better version upgrade system + split admin panel into two
permissions + fix GraphQL generation detection

---------

Co-authored-by: ehconitin <nitinkoche03@gmail.com>
2025-02-24 21:38:41 +01:00
d3fe322fc7 i18n - translations (#10460)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-24 19:36:31 +01:00
6a73a58ad9 i18n - translations (#10458)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-24 19:21:26 +01:00
d4bdae562f i18n - translations (#10450)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-24 17:43:32 +01:00
cbd4d98c85 Data changes to prepare for workspaceMember page (#10439)
Workspace Member will get their own record page in the future.

This PR lays backend changes to prepare for this:
- Settings most fields on WorkspaceMember as system fields
- Renaming workspaceMember/workspaceMemberId to
forWorkspaceMember/forWorkspaceMemberId as it conflicts with the morph
relationship, if we want to be able to add a workspace member as
favorite

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-02-24 17:37:08 +01:00