Commit Graph

5590 Commits

Author SHA1 Message Date
d40a5ed74f Fix REST API not using metadata cache (#10521) 2025-02-26 17:59:35 +01:00
a6ea8b98b6 i18n - translations (#10518)
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 17:21:18 +01:00
ea0d3c605f [FIX] Optimistically compute position only for objectMetadataItem that has the field (#10510)
# Introduction
In this PR https://github.com/twentyhq/twenty/pull/10493 introduced a
regression on optimistic cache for record creation, by expecting a
`position` `fieldMetadataItem` on every `ObjectMetadataItem` which is a
wrong assertion
Some `Tasks` and `ApiKeys` do not have one

## Fix
Dynamically compute optimistic record input position depending on
current `ObjectMetadataItem`

## Refactor
Refactored a failing test following [jest
each](https://jestjs.io/docs/api#describeeachtablename-fn-timeout)
pattern to avoid error prone duplicated env tests. Created a "standard'
and applied it to an other test also using `it.each`.
2025-02-26 17:04:52 +01:00
e6355c7c49 Fixed record sort on kanban (#10515)
This PR fixes a leftover from the removal of combined filters and sorts.

Board request hook was still relying on combinedViewSorts, here we just
use currentRecordSorts instead and it works well.
2025-02-26 16:59:08 +01:00
d47e5ec47d Fix command menu closing and opening (#10497)
Since I introduced AnimatePresence to animate the exit of the command
menu, the command menu wasn't working properly. By adding this
animation, I had to reset the command menu states at the end of the
animation, otherwise, the component inside the command menu would throw
errors. The problem was that, by closing and instantly reopening the
command menu, the `onExitComplete` wasn't triggered and the states
weren't reset before the opening. By introducing a new state
`isCommandMenuClosingState`, I can reset those states at the beginning
of the opening if the animation didn't have the time to finish.
2025-02-26 16:52:44 +01:00
f74e4bedc4 Create a right drawer for viewing steps in workflow runs (#10366)
- Improve the type-safety of the objects mapping the id of a right
drawer or side panel view to a React component
- Improve the types of the `useTabList` hook to type the available tab
identifiers strictly
- Create a specialized `WorkflowRunDiagramCanvas` component to render a
`WorkflowRunDiagramCanvasEffect` component that opens
`RightDrawerPages.WorkflowRunStepView` when a step is selected
- Create a new side panel view specifically for workflow run step
details
- Create tab list in the new side panel; all the tabs are `Node`,
`Input` and `Output`
- Create a hook `useWorkflowSelectedNodeOrThrow` not to duplicate
throwing mechanisms

Closes https://github.com/twentyhq/core-team-issues/issues/432

## Demo


https://github.com/user-attachments/assets/8d5df7dc-0b99-49a2-9a54-d3eaee80a8e6
2025-02-26 16:48:24 +01:00
694553608b Implements record filter group upsert and remove (#10514)
This PR implements a parallel code path to upsert and remove record
filter groups.

Those record filter groups aren't keeping track of the view id but since
they are in a view context, it's implicit that the advanced filter
feature can keep track of view for record filter groups.

We'll need record filter group for an upcoming feature without views, so
we need to abstract record filter group from view.

We have viewFilterGroup.id === recordFilterGroup.id, so it's easy to map
each other.
2025-02-26 16:24:11 +01:00
dd12bc31ca Fix record page context store instance id (#10508)
Fixes bug introduced by https://github.com/twentyhq/twenty/pull/10272
- Replace show page context store instance id by 'main-context-store'
2025-02-26 15:05:22 +00:00
fe46ede1ac i18n - translations (#10512)
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 15:20:11 +01:00
b705425358 Create Workflow Form action (#10509)
- create form action
- add `pendingEvent` to executor output
- when receiving pendingEvent, exit workflow execution
- let the workflow in running status for now before taking a decision
2025-02-26 14:15:39 +00:00
1af25bf31d i18n - translations (#10506)
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 14:08:14 +01:00
64938d5a05 Refactor RecordPicker part 2 (#10502)
Keep clarifying folders:
- record-picker is now clean
- record-picker-morph-legacy contains activityTarget logic that will be
abstracted later
2025-02-26 13:54:16 +01:00
ec87218b9c [Refactor] generateDepthOneRecordGqlFieldsFromRecord (#10499)
## Introduction
This refactor results from this
https://github.com/twentyhq/twenty/pull/10493 review
Introduced a new abstraction to the extinsting
`generateDepthOneRecordGqlFields` that was accepting an optional record
in arg in order to map generated `recordGqlFields` to the keys in the
record

1/ Created a dedicated util method
`generateDepthOneRecordGqlFieldsFromRecord` to do so
2/ Updated each previous `generateDepthOneRecordGqlFields` passing a
record to call new `generateDepthOneRecordGqlFieldsFromRecord`
2025-02-26 11:11:45 +00:00
41a412bd55 i18n - translations (#10498)
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 11:20:35 +01:00
611e89e5c9 [BUGFIX] Create optimistic cache generate recordGqlFields from prefilled record (#10493)
# Introduction
The record does not appear in the table because the optimistic record
input cached does not fulfill the mutation response fields, which result
in it being considered as invalid response
close #10199 
close https://github.com/twentyhq/twenty/issues/10153
2025-02-26 11:11:01 +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
4d02bf1362 Implement record filter group states and context (#10490)
This PR simply implements record filter group states and context, as we
did for record filter and record sort.

We use a separate context for record filter and record filter group,
we'll see later if it can be merged in practice, but better be cautious
for now.
2025-02-25 18:31:34 +01:00
d9bde155ff update twenty team members danger (#10491) 2025-02-25 18:24:42 +01:00
9fbd698ea4 i18n - translations (#10487)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 17:48:13 +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
2331176c53 Remove current workspace member from role assignment picker (#10482)
## Context
Removing the ability to assign yourself from the UI. The backend already
checks that. This is because a member can only have one role for the V1
of permissions
Took the opportunity to move some roles related components in dedicated
folders
2025-02-25 17:43:57 +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
1d49fcae77 i18n - translations (#10483)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 17:01:24 +01:00
7c9b902cfe feat(approval-domain): add UI for approval domains (#10480) 2025-02-25 15:44:07 +00:00
9997cf5a4e 322 compact command chips dropdown (#10456)
Closes https://github.com/twentyhq/core-team-issues/issues/322



https://github.com/user-attachments/assets/d4806f04-e217-40f5-9707-93334bbd49ea

---------

Co-authored-by: Devessier <baptiste@devessier.fr>
2025-02-25 16:42:38 +01:00
a1c7e3279c Refactor RecordSingleSelect and RecordMultiSelect to be synchronous (#10469)
## Context
We are experiencing a lot of re-rendering / flash on MultiRecordSelect /
SingleRecordSelect / RelationPicker.

This PR is a first step to refactor this components

## Scope

Only move files to uniformize and prepare for the upcoming refactoring

## Vision
- SingleRecordPicker
- MultipleRecordPicker
- sharing RecordPicker tooling (RecordPickerComponentInstanceContext,
searchState)

Used in other areas:
- RelationPicker (which is actually only a subcomponent of
RelationToOneFieldInput)
- RelationFromManyFieldInput
- WorkflowRelationFieldInput
- etc.

+ remove all effects
+ migrate to the latest APIs
+ make a pass on re-renders to remove them completely (we likely need to
use a bit more familyStates here)
2025-02-25 15:48: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
89e11b4626 [BUGFIX] Account owner should not be clickable & [Refactor] Chip.tsx links (#10359)
# Introduction

closes #10196 
Initially fixing the `Account Owner` record field value should not be
clickable and redirects on current page bug.
This has been fixed computing whereas the current filed is a workspace
member dynamically rendering a stale Chip components instead of an
interactive one

## Refactor
Refactored the `AvatarChip` `to` props logic to be scoped to lower level
scope `Chip`.
Now we have `LinkChip` `Chip`, `LinkAvatarChip` and `AvatarChip` all
exported from twenty-ui.

The caller has to determine which one to call from the design system

## New rule regarding chip links
As discussed with @charlesBochet and @FelixMalfait 
A chip link will now ***always*** have `to` defined. ( and optionally an
`onClick` ).
`ChipLinks` cannot be used as buttons anymore

## Factorization
Deleted the `RecordIndexRecordChip.tsx` file ( aka
`RecordIdentifierChip` component ) that was duplicating some logic,
refactored the `RecordChip` in order to handle what was covered by
`RecordIdentifierChip`

## Conclusion
As always any suggestions are more than welcomed ! Took few opinionated
decision/refactor regarding nested long ternaries rendering `ReactNode`
elements

## Misc


https://github.com/user-attachments/assets/8ef11fb2-7ba6-4e96-bd59-b0be5a425156

---------

Co-authored-by: Mohammed Razak <mohammedrazak2001@gmail.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-02-25 14:36:17 +00:00
fc0e98b53e i18n - translations (#10478)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 15:34:31 +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
2247d3fa91 Clean record filter and record sort (#10466)
This PR removes what's left from record filter and record sort previous
logic to handle CRUD and state management with view.

So everything that is named combinedFilter and combinedSort is removed
here.

We implement currentRecordFilters and currentRecordSorts everywhere.

We also remove the event in a state onSortSelectComponentState. (a
pattern we want to avoid)
2025-02-25 14:03:30 +00: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
9c0c4ebf27 i18n - translations (#10472)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 12:01:01 +01:00
e77ba2be52 Add non root user for twenty website docker file (#10470)
- Create user 1000 and give it the necessary permissions
2025-02-25 10:51:09 +00:00
3f7bb4f958 i18n - translations (#10471)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-02-25 11:46:17 +01:00
7abc67c905 refactor(forms): simplify form handling and button behavior (#10441)
Removed redundant handleSave and handleSubmit props in domain settings.
Integrated form submission logic directly into form components, ensuring
consistent behavior and reducing complexity. Updated button components
to explicitly support the "type" attribute for improved accessibility
and functionality.

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-02-25 10:37:36 +00:00
bfc92fc00d i18n - translations (#10468)
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 11:35:02 +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
ac0fd364e9 [permissions] Add tests on role resolver (#10452) 2025-02-24 18:13:01 +01:00
9046a9ac16 Migrate url tooling to twenty-shared (#10440)
Migrate and unify URL tooling in twenty-shared.

We now have:
- isValidHostname which follows our own business rules
- a zod schema that can be re-used in different context and leverages is
isValidHostname
- isValidUrl on top of the zod schema
- a getAbsoluteURl and getHostname on top of the zod schema

I have added a LOT of tests to cover all the cases I've found

Also fixes: https://github.com/twentyhq/twenty/issues/10147
2025-02-24 18:01:51 +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