Commit Graph

2153 Commits

Author SHA1 Message Date
f3e667a651 496 add open in full page button on command menu record page (#10659)
Closes https://github.com/twentyhq/core-team-issues/issues/496

I upgraded react tabler icons to the latest version to be able to use
the newest icons.

The option menu was no longer accessible on right drawer record pages,
this pr fixes this and creates a new button which opens the record show
page.
This button is accessible via the shortcut `Command` + `Enter`


https://github.com/user-attachments/assets/570071b2-4406-40bd-be48-a0e5e430ed70
2025-03-05 12:02:31 +01:00
5d2be60758 Various frontend fixes for roles pages (#10654) 2025-03-04 18:09:23 +01:00
b83d8a4b27 [BUG] Object Settings Model tabs list heigh value 0 (#10646)
# Introduction
While working on https://github.com/twentyhq/core-team-issues/issues/355
encountered a recent regression:

![image](https://github.com/user-attachments/assets/654349a0-fd3d-4e17-a503-b942165f1771)

I honestly cannot explain this regression, should take time to do some
commits dichotomy in order to identify the problematic one but it feels
overkill

## Remarks
- Modified a common components please while reviewing have a look to
other of its invokation too ( others settings page )
2025-03-04 17:40:17 +01:00
9da973592d 460 create restore one and restore many records action (#10647)
Closes https://github.com/twentyhq/core-team-issues/issues/460


https://github.com/user-attachments/assets/5271e56d-bf67-49cc-a8da-e25c12171e2e
2025-03-04 17:27:14 +01:00
19fce0c77d Fix gap between releases and logout (#10649)
## Context
A gap was introduced when we refactored the menu rendering as Logout
menu item was handled differently in its own NavigationDrawer section
which added the gap.
To fix that we are moving the Logout to the menu rendering logic in
useSettingsNavigationItems hook, allowing items to have onClick prop
instead of a path.

Before
<img width="213" alt="Screenshot 2025-03-04 at 14 36 55"
src="https://github.com/user-attachments/assets/23b63673-a9c4-47de-af71-7dda74469e9f"
/>

After
<img width="225" alt="Screenshot 2025-03-04 at 14 36 38"
src="https://github.com/user-attachments/assets/053c0c0d-8876-40b6-ae2c-b68124393f7f"
/>
2025-03-04 14:58:36 +01:00
aba20dae11 Implemented CRUD for view filter group and removed old states (#10590)
This PR implements CRUD for view filter groups with the new logic as
already done for view filters and view sorts.

It also completely removes the old combined view filter group states and
usage.

This PR is quite big but the impact is limited since it only changes
advanced filters module, which is under feature flag at the moment, and
it is already in a broken state so unusable, even if someone activates
the feature flag.
2025-03-04 13:16:02 +01:00
be1073a2ef Fix settings page container (#10645)
This was changed in https://github.com/twentyhq/twenty/pull/10556 and
was not needed. Reverting to fix the roles page.

## Before

<img width="1155" alt="Screenshot 2025-03-04 at 11 30 30"
src="https://github.com/user-attachments/assets/21ae9c02-7c37-46e1-be40-e69ae809ea80"
/>

## After
<img width="1128" alt="Screenshot 2025-03-04 at 11 30 09"
src="https://github.com/user-attachments/assets/956a6222-7925-4aa2-9adb-efd158189368"
/>

Also checked if security page is still working
<img width="1136" alt="Screenshot 2025-03-04 at 11 30 19"
src="https://github.com/user-attachments/assets/0c30101b-51ae-4755-b5a7-d564fb093160"
/>
2025-03-04 11:35:00 +01:00
ec4b6c9aa2 Fix: security and developers path should not be accessible to non-admin users (#10628)
https://github.com/twentyhq/core-team-issues/issues/468
2025-03-04 10:51:06 +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
41db10daff Revert "Remove reference to data-testid from styling" (#10635)
Reverts twentyhq/twenty#10407
2025-03-03 19:15:12 +01:00
e8b6b1b941 fix(): several ui improvements (#10556)
Close #10531

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-03-03 17:06:16 +01:00
a5d60919a7 Create import csv action (#10624)
Closes https://github.com/twentyhq/core-team-issues/issues/63

This PR:
- Creates an **Import csv** action
- Allows the import of notes and tasks
- Removes the import action from the index option menu
- Adds export action when only one record is selected
- Adds see deleted record action to workflow objects
2025-03-03 17:03:53 +01:00
3d56e5394f Create a JSON tree visualizer (#10579)
Inspired by
https://github.com/reduxjs/redux-devtools/tree/main/packages/react-json-tree

- Created a reusable JSON tree visualizer
- For now, the visualizer is only meant to render raw JSON. It can't
determine if a string is a UUID and display a specific icon.

**The visualizer is not rendered in the app. You must use Storybook to
review it.**

## Demo



https://github.com/user-attachments/assets/ffd4fc94-b33d-4481-9ac1-fa3a348b7c81
2025-03-03 16:55:16 +01:00
2325e0ae0f fix(): include workspace in reset password flow (#10617)
Fix #10586
2025-03-03 16:47:33 +01:00
9300f0a29b Fix: Prevent Multiple Search Icons in Command Menu (#10424)
Description:
This PR fixes an issue where clicking the search button multiple times
caused multiple search icons to appear in the search bar. The issue was
caused by continuously appending new items to the navigation stack
instead of replacing the existing search page entry.

Before:


https://github.com/user-attachments/assets/1abc4223-6295-4eea-b276-00e4539a2992



After:



https://github.com/user-attachments/assets/04d3a306-f3ca-4d3d-9028-9e4b4574e6a6

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2025-03-03 15:08:34 +00:00
d2ad23d1cf fix workspace member search (#10613) 2025-03-03 11:57:07 +01:00
c5795b7325 Fixed board total count on view picker button (#10612)
This PR adds a missing call to `setRecordIndexEntityCount` during board
data loading.
2025-03-03 11:25:48 +01:00
51c34b77d9 feat(twenty-front/Button): add loading state on Button (#10536) 2025-03-03 11:04:32 +01:00
2e4c596644 [TEST] Covering useDeleteOne relations optimistic cache behavior (#10238)
## Introduction
Added coverage on the `useDeleteOneRecord` hooks, especially its
optimistic behavior feature.
Introduced a new testing tool `InMemoryTestingCacheInstance` that has
builtin very basic expectors in order to avoid future duplication when
covering others record hooks `update, create, destroy` etc etc

## Notes
Added few comments in this PR regarding some builtin functions I've
created around companies and people mocked object model and that I think
could be cool to spread and centralize within a dedicated "class
template"

Also put in light that unless I'm mistaken some tests are running on
`RecordNode` and not `RecordObject`

Took few directions on my own that as I always I would suggestion nor
remarks on them !

Let me know

## Misc
- Should we refactor `useDeleteOneRecord` tests to follow `eachTesting`
pattern ? => I feel like this is inappropriate as this hooks is already
high level, the only plus value would be less tests code despite
readability IMO
2025-03-03 10:22:26 +01:00
2773dde714 Remove reference to data-testid from styling (#10407)
Fixes https://github.com/twentyhq/core-team-issues/issues/204

---------

Co-authored-by: ad-elias <elias@autodiligence.com>
2025-02-28 16:37:14 +01:00
00b650a121 Fix export view missing column and viewGroups not persisted bug (#10584)
Fixes https://github.com/twentyhq/twenty/issues/10535
Also fixes missing columns in export view
2025-02-28 15:59:13 +01:00
2aa72de210 remove isRichTextV2Enabled feature flag (#10562) 2025-02-28 14:34:06 +01:00
ea1ac3708c Implemented view filter group CRUD hooks and utils (#10551)
This PR implements hooks and utils logic for handling CRUD and view
filter group comparison.

The main hook is useAreViewFilterGroupsDifferentFromRecordFilterGroups,
like view filters and view sorts.

Inside this hook we implement getViewFilterGroupsToCreate,
getViewFilterGroupsToDelete and getViewFilterGroupsToUpdate.

All of those come with their unit tests.

In this PR we also introduce a new util to prevent nasty bugs happening
when we compare undefined === null,

This util is called compareStrictlyExceptForNullAndUndefined and it
should replace every strict equality comparison between values that can
be null or undefined (which we have a lot)

This could be enforced by a custom ESLint rule, the autofix may also be
implemented (maybe the util should be put in twenty-shared ?)
2025-02-28 13:32:54 +01:00
85bfd87bb4 input alignment fix (#10577)
this fix was already the case before this
[change](https://github.com/twentyhq/twenty/pull/10124/files#diff-a48e37b645699a3309d359e3084f0218c38441585d8e3884083c411dacb096f4L273)

Unsure why this change was necessary. 

<img width="914" alt="Screenshot 2025-02-28 at 16 02 38"
src="https://github.com/user-attachments/assets/c8bd791b-81b3-429b-9d0a-88a47058a979"
/>
2025-02-28 17:39:11 +05:30
4d7ba29d9f Add PageHeaderOpenCommandMenuButton on Record index page header for command menu v1 (#10576)
The only way to open the command menu in v1 on the index page was
through the shortcut, but since important actions (export and see
deleted records) have been moved to the command menu, we want an easy
way to open it on v1.


https://github.com/user-attachments/assets/b446f385-da69-4dcc-af9d-74d36b52e94f
2025-02-28 11:42:02 +01:00
0c4a984110 Fixed view bar chips margin and gaps (#10575)
This PR fixed ViewBar chips that were using margin instead of padding
and gaps.

This SortOrFilter chip was using margin left to space itself where it
was the role of the view bar to handle gap between chips and
padding-left at the beginning.
2025-02-28 11:39:59 +01:00
ef7581f4ef [permissions] Fix redirection at sign-up after configuring billing (#10569)
During sign-up, new users setting new workspaces are required to choose
a billing plan (30-days or 7 days). They are then redirected to
billing.twenty.com to confirm and configure their plan choice.
Then they are quickly redirected to /settings/billing before being
redirected to /create-workspace.

The problem is that even though /create-workspace is not a gated path,
/settings/billing is: it is a path gated by WORKSPACE permission which
has not been granted to the user at this stage. therefore the user is
not redirected to /create-workspace since they do not reach
/settings/billing path but is redirected to the profile page instead.
(To see this feature flag must be removed + billing enabled: you can use
this branch [from this closed
PR](https://github.com/twentyhq/twenty/pull/10570)).

The chosen workaround is to bypass, in the FE, the permission check for
WORKSPACE permission if the workspace's activation status is
PENDING_CREATION. There is no need for any BE change.
2025-02-28 07:52:28 +01:00
aa74c36ce9 Fix record opening on board card (#10559)
The record opening when clicking on the body of the board card should
behave the same as when clicking on the record chip.

Before:


https://github.com/user-attachments/assets/8d5956e4-d529-455c-9d28-02d5a8b6e290

After:


https://github.com/user-attachments/assets/70dadd77-a151-47b5-b8b4-ec01d6e2c48e
2025-02-27 18:29:09 +01:00
dddf67ed01 Prevent command menu backspace shortcut on V1 (#10555)
Before:


https://github.com/user-attachments/assets/87be65fa-4b24-4e15-b0a4-ca1aa06f5ca6


After:


https://github.com/user-attachments/assets/ef9076a0-214f-4680-a455-157a206e8197
2025-02-27 18:14:45 +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
d9e6b95c04 Disable drag select when the command menu is opened (#10541)
Before:


https://github.com/user-attachments/assets/3d6a3833-cf5d-4330-a814-896a5c9df930

After:


https://github.com/user-attachments/assets/5f490fc2-59aa-45d5-b485-2abced4b31ef
2025-02-27 12:36:47 +01:00
8bd9bc9d31 Make the frontend resilient to old workflow run output formats (#10522)
- Create zod schemas for everything related to a workflow run
- Update the types to be inferred from the zod schemas
- Improper workflow run outputs will render a blank screen; we could
show an error in the future



https://github.com/user-attachments/assets/8e666c3e-82b0-4ab5-8804-2f70130ea257
2025-02-27 10:36:19 +01:00
5a39903d42 Implemented record filter group initialization from view (#10527)
This PR implements the initialization of current record filter groups
state from view.

It also implements mapRecordFilterGroupToViewFilterGroup,
mapRecordFilterGroupLogicalOperatorToViewFilterGroupLogicalOperator and
mapViewFilterGroupLogicalOperatorToRecordFilterGroupLogicalOperator with
their corresponding unit tests.

Some unused states not caught by ESLint are also removed.
2025-02-27 10:25:59 +01:00
2f048201ad Fix field empty value check for Person standard object (#10533)
The previous code was not correct if labelIdentifier is a FULL_NAME.
We already have an util for this

Fixes: https://github.com/twentyhq/twenty/issues/10532
2025-02-27 10:08:47 +01:00
d246010c5c RecordPicker refactoring part 3: remove effects (#10505)
This PR is part 3 of RecordPicker refactoring. 

It aims to remove all effects from:
- (low level layer) SingleRecordPicker, MultipleRecordPicker
- (higher level layer) RelationPicker, RelationToOneInput,
RelationFromManyInput, ActivityTargetInput...

In this PR, I'm re-grouping Effects in ActivityTarget section and
creating a hook that will be called on inlineCellOpen
2025-02-27 09:56:03 +01:00
b349d3f8c2 62 create see deleted records action (#10525)
Closes https://github.com/twentyhq/core-team-issues/issues/62

- Created action
- Removed action from the option menu
- Fixed the filters and sorts providers for the command menu



https://github.com/user-attachments/assets/b42de3ea-536c-458c-a0e7-abd6f929d234
2025-02-26 18:51:17 +01:00
5327febcbe [REFACTOR] remove isRemote assertion from hasFieldPosition util (#10519)
Following this discussion
https://github.com/twentyhq/twenty/pull/10510#discussion_r1971845556
with @ijreilly
2025-02-26 18:28:55 +01:00
24aca790f7 Remove export action from the view options menu (#10517)
Closes https://github.com/twentyhq/core-team-issues/issues/64
Remove export action from the view options menu
2025-02-26 18:20:07 +01:00
431da37cdf add stories to roles components (#10503)
## Context
Adding stories for roles components. Also moving modules components to
the proper "modules" folder, "pages" folder being only for entry points.

## Test
Run storybook

<img width="1145" alt="Screenshot 2025-02-26 at 13 40 40"
src="https://github.com/user-attachments/assets/bc184ab0-c590-4362-8c5a-1bf5ef176e6c"
/>
<img width="1149" alt="Screenshot 2025-02-26 at 13 40 32"
src="https://github.com/user-attachments/assets/699cd205-31db-45e9-b9c1-caff1832bd47"
/>
<img width="1153" alt="Screenshot 2025-02-26 at 13 40 11"
src="https://github.com/user-attachments/assets/72e45a67-ea89-4999-8b16-6f7d027d07f6"
/>
<img width="471" alt="Screenshot 2025-02-26 at 13 38 16"
src="https://github.com/user-attachments/assets/62676943-9935-42b5-b769-5544f7eed85f"
/>
<img width="472" alt="Screenshot 2025-02-26 at 13 38 12"
src="https://github.com/user-attachments/assets/946baab9-1be4-439e-bf99-0ebeab0995f7"
/>
2025-02-26 18:16:05 +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
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
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
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
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