Commit Graph

3705 Commits

Author SHA1 Message Date
Marie
96d659cf56 Make custom objects soft deletable by default (#6768)
Fixes #6766
2024-08-31 18:02:41 +02:00
Weiko
7df5f91dc5
Add set custom object is soft deletable command (#6788)
## Context
Custom object were not automatically created as softDeletable, this has
been fixed in a recent PR.
This PR adds a command to backfill existing custom objects.

We also introduce a baseCommandRunner and ActiveWorkspacesCommandRunner
to put some boilerplate and simplify future commands.

## Test
```bash
yarn command:prod upgrade-0-24:set-custom-object-is-soft-deletable
[Nest] 75852  - 08/29/2024, 5:16:41 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Running command on 2 workspaces
query: UPDATE "metadata"."objectMetadata" SET "isSoftDeletable" = $1, "updatedAt" = CURRENT_TIMESTAMP WHERE ("workspaceId" IN ($2, $3) AND "isCustom" = $4 AND "isSoftDeletable" = $5) -- PARAMETERS: [true,"3b8e6458-5fc1-4e63-8563-008ccddaa6db","20202020-1c25-4d02-bf25-6aeccf7ea419",true,false]
[Nest] 75852  - 08/29/2024, 5:16:41 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Updated 1 entities
[Nest] 75852  - 08/29/2024, 5:16:41 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Command completed!
```

```bash
yarn command:prod upgrade-0-24:set-custom-object-is-soft-deletable -d
[Nest] 75424  - 08/29/2024, 5:16:14 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Running command on 2 workspaces
[Nest] 75424  - 08/29/2024, 5:16:14 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Dry run mode: No changes will be applied
query: SELECT "ObjectMetadataEntity"."id" AS "ObjectMetadataEntity_id" FROM "metadata"."objectMetadata" "ObjectMetadataEntity" WHERE (("ObjectMetadataEntity"."workspaceId" IN ($1, $2)) AND ("ObjectMetadataEntity"."isCustom" = $3) AND ("ObjectMetadataEntity"."isSoftDeletable" = $4)) -- PARAMETERS: ["3b8e6458-5fc1-4e63-8563-008ccddaa6db","20202020-1c25-4d02-bf25-6aeccf7ea419",true,false]
[Nest] 75424  - 08/29/2024, 5:16:14 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Dry run: 1 entities would be updated
[Nest] 75424  - 08/29/2024, 5:16:14 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Command completed!
```

```bash
yarn command:prod upgrade-0-24:set-custom-object-is-soft-deletable -w 20202020-1c25-4d02-bf25-6aeccf7ea419 -w 20202020-1c25-4d02-bf25-6aeccf7ea419
query: UPDATE "metadata"."objectMetadata" SET "isSoftDeletable" = $1, "updatedAt" = CURRENT_TIMESTAMP WHERE ("workspaceId" IN ($2, $3) AND "isCustom" = $4) -- PARAMETERS: [true,"20202020-1c25-4d02-bf25-6aeccf7ea419","20202020-1c25-4d02-bf25-6aeccf7ea419",true]
[Nest] 70588  - 08/29/2024, 5:11:31 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Updated 2 entities
[Nest] 70588  - 08/29/2024, 5:11:31 PM     LOG [SetCustomObjectIsSoftDeletableCommand] Command completed!
```

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-31 17:49:12 +02:00
Harshit Singh
c5572f1b1e
fix: Deactivate & Activate icons should be swapped UI improvements (#6796)
## Fix

This fixes the minor UI issue #6795 in which it addressed the following
two problems-

1. Fixed the Icon switch
2. Updated the Delete Modal

## Screenshots

<img width="314" alt="Screenshot 2024-08-30 at 1 38 31 AM"
src="https://github.com/user-attachments/assets/2a3e2363-6c0e-493e-825a-5a84121ccc3d">

<img width="168" alt="Screenshot 2024-08-30 at 1 39 13 AM"
src="https://github.com/user-attachments/assets/51b48b85-070f-4656-a42d-31db0baebca3">

<img width="182" alt="Screenshot 2024-08-30 at 1 39 23 AM"
src="https://github.com/user-attachments/assets/6ac958eb-34eb-44b8-a588-30813a567f3e">
2024-08-31 16:40:38 +02:00
Raphaël Bosi
cd66ea74a2
6657 Refactor and fix blocklist (#6803)
Closes #6657
- Fix listeners
- Refactor jobs to take array of events
- Fix calendar events and messages deletion

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-31 16:38:47 +02:00
Harshit Singh
d9650fd5cf
fix: Updated Button states for pages and minor UI fix (#6812)
## Description

#6811 

- Deleted button lacked `accent danger` on options menu
- Customize fields `onhover` lacked width to cover entire div tag
- Deactivate button lacked variant

## After

<img width="305" alt="Screenshot 2024-08-31 at 1 43 29 AM"
src="https://github.com/user-attachments/assets/82852227-e7d2-4327-a8cc-8f9f0e84f488">

<img width="229" alt="Screenshot 2024-08-31 at 1 09 31 AM"
src="https://github.com/user-attachments/assets/4783dd5a-a8ab-41b5-83d5-95425b6bebc4">
<img width="163" alt="Screenshot 2024-08-31 at 1 07 49 AM"
src="https://github.com/user-attachments/assets/33ec9928-6463-4797-bfc4-b40a927ec8ec">

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-31 14:59:11 +02:00
Nabhag Motivaras
ea7b9e90c9
fix: EmailThreads and Calendar making one extra graphql requests even total records are fetched (#6814)
## ISSUE (BUG)
- Closes #5282

## Description
- [x] Email Threads Tab was making two graphql requests
**[GetTimelineThreadsFromCompanyId]** when navigating after a first
render of record page, once only, later it was making only one.
- [x] Similarly Calendar Tab
**[GetTimelineCalendarEventsFromCompanyId]**

### Before


https://github.com/user-attachments/assets/c234b7b4-fe7d-4655-92d6-0a6817fda6b5


### After 


https://github.com/user-attachments/assets/80af33c7-b801-4377-a59a-47c43e0fecdd

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-31 14:22:33 +02:00
Charles Bochet
e903ce398e Increase storybook pages code coverage 2024-08-31 12:31:10 +02:00
Lucas Bordeau
56f8091a42 Fix CI errored tasks for front (#6806)
In this PR:
- revert de-optimization of icons bundle for storybook. This was forcing
the browser to load ~3k files while running stories
- adding lazy loading on Settings route to improve developer experience
(some files will be loaded later)
- fix FE tests: unit, modules stories, pages stories

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-31 01:40:06 +02:00
Thomas Trompette
a3ea0acd1a
Set statuses on workflows (#6792)
Add listener to keep status on workflows up to date:
- version draft => statuses should contain draft
- version active => statuses should contain active
- version deactivated => if no version active, statuses should contain
deactivated

Renaming also the endpoints because it was not reflecting the full
behaviour.

Finally, adding a new status Archived for versions. Will be used when a
version is deactivated, but is not the last published version anymore.
It means this version cannot be re-activated.
2024-08-30 18:06:04 +02:00
Baptiste Devessier
f7c99ddc7a
Create new steps in workflow editor (#6764)
This PR adds the possibility of creating new steps. For now, only
actions are available. The steps are stored on the server, and the
visualizer is reloaded to include them.

Selecting a step opens the right drawer and shows its details. For now,
it's only the id of the step, but in the future, it will be the
parameters of the step.

In the future we'll want to let users add steps at any point in the
diagram. As a consequence, it's crucial to be able to walk in the tree
that make the steps to find the correct place where to put the new step.
I wrote a function that returns where the new step should be inserted.
This function will become recursive once we get branching implemented.

Things to mention:

- Reactflow needs every node and edge to have a unique identifier. In
this PR, I chose to use steps' id as nodes' id. That way, it's easy to
move from a node to a step, which helps make operations on a step
without resolving the step's id from the node's id.
2024-08-30 15:51:36 +02:00
Lucas Bordeau
26eba76fb5
Created a breadcrumb for left nav menu sub items (#6762)
Closes https://github.com/twentyhq/twenty/issues/6484

<img width="270" alt="image"
src="https://github.com/user-attachments/assets/3cfd7a5a-5239-4998-87f7-a9b45e3b5229">
2024-08-30 15:10:18 +02:00
Charles Bochet
09ac8e3274 Add instructions to migrate to 0.24 version 2024-08-30 01:13:13 +02:00
Charles Bochet
407030576b Update wording on soft deletes 2024-08-29 18:26:27 +02:00
Thomas Trompette
8982a5833c
Bump version to 0.24 (#6789)
As title
2024-08-29 18:22:48 +02:00
Thomas des Francs
0d21ccdefd
0.24 changelog (#6787) 2024-08-29 18:22:38 +02:00
Lucas Bordeau
b05361e650
Fixed record table fetch more scroll bug (#6790)
Fetch more on the record table was causing a strange bug where it was
auto scrolling to the bottom of the newly loaded chunk of rows.

This was confusing because we lost our previous position in the record
table.

With this fix the table doesn't scroll when more rows are loaded.

The fetch more row has been moved in the same tbody as the rest of the
rows.

We now only hide it when there is no more record to fetch.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-29 18:22:17 +02:00
Antoine Moreaux
cd06ae20e8
chore(*): remove unused code (#6781)
The code removed in the PR was flagged as unused by the JetBrains
inspector.

I did a QA on the dev environment but other checks are highly
recommended.

There is one commit by scope to make the review easier.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-29 18:16:50 +02:00
nitin
ebfdc6cfd2
Added ability to search objects and fields (#6775)
Closes #6770 



https://github.com/user-attachments/assets/e3134389-30d2-48c8-bbca-34209d5ae66d
2024-08-29 14:15:01 +02:00
Rishi Kant
9fafb2cca0
fix/6759: reduce icon size in note grip menu to 16px and adjust conta… (#6780)
### Summary

This pull request addresses issue #6759 by adjusting the icon size and
container padding in the note grip menu. The 6-dot icon's size has been
reduced from 20px to 16px, while the container size has been kept at
20px to maintain the proper alignment and spacing.

### Changes Made
- **Icon Size**: Reduced the SVG icon size to 16x16px.
- **Container Size**: Ensured the container remains 20x20px to
accommodate the icon and maintain visual consistency.

### Screenshots
<img width="1440" alt="Screenshot 2024-08-29 at 3 26 41 AM"
src="https://github.com/user-attachments/assets/d8618636-165a-440d-a41e-947b2aa00bdb">


### Related Issue
- [Issue #6759]

### Testing
- Verified that the icon and container sizes are correctly displayed in
the note grip menu.
- Ensured no other UI elements were affected by these changes.

Please review the changes and let me know if any additional
modifications are required. Thank you!

Co-authored-by: Rishi Kant <khairrishi@Rishis-MacBook-Air.local>
2024-08-29 11:56:41 +02:00
Nabhag Motivaras
9a3f29b9a0
fix: relation and record chip height (#6758)
# ISSUE 
- Closes #6756 

After Changes: 


https://github.com/user-attachments/assets/1885be11-b50a-4b05-afae-d2f02a403ad6



https://github.com/user-attachments/assets/edc6a913-95a6-4c75-8ec2-83e2c27fddb0
2024-08-29 11:42:42 +02:00
gitstart-app[bot]
7a9a43b85c
Add composite Emails field and forbid creation of Email field type (#6689)
### Description

1. 
   - We are introducing new field type(Emails)


   - We are Forbiding creation of Email field


   - We Added support for filtering and sorting on Emails field


- We are using the same display mode as used on the Links field type
(chips), check the Domain field of the Company object


   - We are also using the same logic of the link when editing the field

   \
   How To Test\
   Follow the below steps for testing locally:\
   1. Checkout to TWENTY-6261\
2. Reset database using "npx nx database:reset twenty-server" command\
   3. Run both the backend and frontend app\
4. Go to Settings/Data model and choose one of the standard objects like
people\
   5. Click on Add Field button and choose Emails as the field type

   \
   ### Refs

   #6261\
   \
   ### Demo

    \

<https://www.loom.com/share/22979acac8134ed390fef93cc56fe07c?sid=adafba94-840d-4f01-872c-dc9ec256d987>

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-08-29 11:42:24 +02:00
Weiko
c87ccfa3c7
refactor graphql query runner connection mapper (#6771) 2024-08-28 19:02:45 +02:00
gitstart-app[bot]
7c894fe870
Improve Data Importer Select Matching - Post Merge Updates (#6750)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-6135-1](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6135-1).

 --- 
### Description
This [PR](https://github.com/twentyhq/twenty/pull/6338) was merged, but
the reviewr asked for some changes in another PR
https://github.com/twentyhq/twenty/pull/6338#pullrequestreview-2255006727


### Refs
https://github.com/twentyhq/twenty/pull/6338

### Demo
<https://jam.dev/c/80336c7a-4536-4a58-b531-981bac81cb26>

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-08-28 17:33:39 +02:00
nitin
0531eb5015
Removed drag grip and accent is now tertiary in hidden fields (#6650)
Closes #6115

This change successfully addresses the issue as described. However, it
also causes the primary non-draggable field, `Name`, to render without a
draggable handle and with a secondary accent. Is this an acceptable
outcome?



https://github.com/user-attachments/assets/4bc15e00-6c73-41d4-8342-4e36487d0981

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-28 17:27:14 +02:00
Nabhag Motivaras
747a1549e9
fix: defaultHomePagePath to be last visited page or alphatically first active object with the name (#6629)
### ISSUE 

- Closes #6612
- Closes #6125
- Closes #5949
- Closes #6652 

### Description 

- [x] need to check changes in jest test.
- [x] fallback to alphabetically firstActiveObject with the name if no
last visited exist


https://github.com/user-attachments/assets/dd11480b-c47f-4393-9857-8a55467061e3

- [x] fallback to last visited page with the last visited view by
default if no views would have toggled with subNav or viewChangeDropdown
it will fallback to INDEX or if no INDEX view then zero position view,
works with both subNavViewBar and viewChangeDropdown.



https://github.com/user-attachments/assets/33e97e55-2aa2-4c45-a3ab-fc8e43f4964c



https://github.com/user-attachments/assets/d1db76a2-da59-4cd2-81bf-d6119408fbbf

- [x] lastVisited view across the objects have been persisted so now
navigating back from x object to y or z to x will open always last
visited view and defaults to index or zero position view.



https://github.com/user-attachments/assets/70a01a11-a7ef-4031-926e-02923551466c

- [x] lastVisited Page with view has been persisted across the
workspace, scope is per workspace so jumping between workspace will also
work to have lastvisited object of particular workspace.



https://github.com/user-attachments/assets/25107339-8ec1-4421-9f6e-1da43b8f4816

- [x] when lastVisitedObject has been deactivated and going back from
settings should have a fallback Object that is alphabetically First
activeObject.



https://github.com/user-attachments/assets/6b24a933-b139-49ac-82b2-eac5e4848516


- [x] Creation of new View of **anyType** should also get persist and
that should get lastVisitedObject with View in case the user leaves from
there right away.



https://github.com/user-attachments/assets/80ff7114-051d-4e9b-ab58-0e1e3a7d328c

- [x] Similarly deleted view also works. 


https://github.com/user-attachments/assets/cb0b8043-fba4-4a66-941d-b3fa0a57eb22


- [x] fixed active subnav background when opening object directly with
root path **/** , it wasn't showing active subNav background.

Before: 


https://github.com/user-attachments/assets/db341c4a-f1f9-43c4-9838-37d1a1f5ab8e

Fixed: 


https://github.com/user-attachments/assets/0f0fd492-bc5d-4efe-b695-bee4e3f41d4e

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-28 17:15:54 +02:00
nitin
5deb0abe4d
added "reply in gmail" button (#6754)
Issue https://github.com/twentyhq/twenty/issues/4217
2024-08-28 16:47:55 +02:00
Raphaël Bosi
e7bbc7ddfc
Fix participant listeners (#6767)
Fixes a bug where all the messagesParticipants and the
calendarEventParticipants were linked to a contact after its
restoration.
2024-08-28 16:26:08 +02:00
nitin
e2eaffcf53
Added "Add record" button in kanban view column headers dropdown (#6649)
Closes #4629 
Refactored `RecordBoardColumnNewOpportunityButton` and
`RecordBoardColumnNewButton` to use the same logic in dropdown.

I kept those hooks inside `record-board-column` where these buttons are.
Let me know if it should be placed somewhere else.

Also Added navigation state preservation when clicked on `edit from
settings`

Thanks :)

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-28 16:16:37 +02:00
Thomas Trompette
ff1adb06b2
Add workflow statuses (#6765)
Following figma updates
https://www.figma.com/design/PNBfTgOVraw557OXChYagk/Explo?node-id=21872-7929&t=DOUzd6rzwr6lprcs-0

- No activity targets for workflow entities for now
- Adding a direct relation between workflow run et workflow
- Adding a status on the version (draft, active, deactivated)
- Adding a list of statuses on workflow 
- publishedVersionId => lastPublishedVersionId

Also adding:
- the endpoint to deactivate a version
2024-08-28 14:53:25 +02:00
Raphaël Bosi
da23ca3c23
Fix message direction seeds (#6760)
Direction is now on mcma and no longer on message
2024-08-28 13:03:00 +02:00
Charles Bochet
374931bb19 Fix post merge conflicts on messaging services 2024-08-27 19:39:29 +02:00
Charles Bochet
8dd772aee2 Fix post merge conflicts on messaging services 2024-08-27 19:30:25 +02:00
Raphaël Bosi
e6a55f270b
5617 Create CalendarOngoingStaleCron Job (#6748)
Closes #5617

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-27 19:13:15 +02:00
Raphaël Bosi
e771793626
6655 remove field direction in message and add it in mcma (#6743)
Closes #6655 
- Remove direction from message
- Add direction do mcma
- Create migration command
- Create upgrade 0.24
2024-08-27 19:11:04 +02:00
Charles Bochet
5ce1e6b07d
Improve record table scroll look (#6753)
We had a regression on the record table as our inView hook was not able
to find the right div to compute its margin. This is because we are
identify this div by a hacky css selector as we don't have a direct
control on it (it's provided by our scrolling library)
2024-08-27 19:10:11 +02:00
Thomas Trompette
9f69383aa2
Add function execution throttler (#6742)
Add throttler service to limit the number of function execution
2024-08-27 18:56:47 +02:00
Raphaël Bosi
81fa3f0c41
6256 refactor messaging module to remove all provider specific code and put it inside the drivers folders (#6721)
Closes #6256 
Closes #6257 
+ Create custom exceptions

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-27 18:14:45 +02:00
Weiko
eb49cb2d08
Fix twenty-front build (#6752) 2024-08-27 17:35:50 +02:00
Weiko
f6fd92adcb
[POC] add graphql query runner (#6747)
## Context
The goal is to replace pg_graphql with our own ORM wrapper (TwentyORM).
This PR tries to add some parsing logic to convert graphql requests to
send to the ORM to replace pg_graphql implementation.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-08-27 17:06:39 +02:00
Charles Bochet
ef4f2e43b0
Fix Website build CD (#6751)
Website CD has been broken by the recent addition of typeorm patch in
root package.json

Our current vision is to add npm package to each twenty-package
package.json directly
2024-08-27 14:13:05 +02:00
Charles Bochet
8f9b942410 Increase front build max memory usage for sourcemaps build 2024-08-27 13:30:39 +02:00
nitin
33e455655f
Added sync status on the FE (#6730)
Issue #6685 

How do we make sure we get the latest syncStatus on the frontend?
For now we dont get it unless refreshed.
useInterval() on fetching account details?
2024-08-27 11:11:24 +02:00
gitstart-app[bot]
d61d5857f8
View becomes blank after deleting select (#6703)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-6027](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6027).
This ticket was imported from:
[TWNTY-6027](https://github.com/twentyhq/twenty/issues/6027)

 --- 

### Description

- Delete corresponding view simultaneously once select field is
deactivated instead of deleted because the bug happens on the
deactivation (one step before deleting), confirmation:
<https://discord.com/channels/1130383047699738754/1268662542172028971/1270367244509249651>
- Is still possible to create Kanban views with deactivated Select
fields, but this is not related to the PR.
- The changes on the frontend are for refreshing the data after the view
deletion

### Refs

#6027

### Demo


<https://www.loom.com/share/4f705344e3054cd5b3d5eadd398d2c9c?sid=8db3d8b9-4dce-4e31-8359-0e31cbc0e2e7>

Fixes #6027

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-27 11:10:32 +02:00
BOHEUS
b1fbf4b683
E2E tests (#6717)
Continuation of #6644 

Now chromium browser is used in workspaces tests instead of firefox and
screenshots after each test are properly saved in one folder when run
from IDE and from terminal using `yarn test:e2e` command
2024-08-27 11:07:10 +02:00
Marie
d622803ac2
[Fix] Move save button to top on field edit (#6739)
Before
<img width="802" alt="image"
src="https://github.com/user-attachments/assets/2a9d9501-6bd4-4dc2-b8d7-98a29816caab">

After
<img width="871" alt="Capture d’écran 2024-08-26 à 12 17 29"
src="https://github.com/user-attachments/assets/b6cb688c-fdcd-4b10-8d91-197245f7dd56">
2024-08-26 19:26:49 +02:00
Charles Bochet
c4f0292b2d Increase front build max memory usage for sourcemaps build 2024-08-26 17:22:35 +02:00
Charles Bochet
1d6a1f64c9
Fix twenty-front performances (#6744)
I have investigated the performance of our frontend vite build:
`npx nx run twenty:start` of `npx nx run twenty:build`

RAM usage:
- 160Mb: vite serve
- background typescript checker: 2.5GB
- background eslint checker: 3.5GB

I'm introducing two environment variables in FE .env to disable these
checkers on lower configuration (and to disable them from CD build):
```
# VITE_DISABLE_TYPESCRIPT_CHECKER=true
# VITE_DISABLE_ESLINT_CHECKER=true
```
2024-08-26 16:35:09 +02:00
gitstart-app[bot]
55685d3c5b
Fix currency field edition form (#6723)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-6692](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6692).
This ticket was imported from:
[TWNTY-6692](https://github.com/twentyhq/twenty/issues/6692)

 --- 


### Description

The problem is not related to the API, what was happening was a failure
in the form validation, because in the changed file, the `currencyCode`
value, which should be a string with single quotes around it, was
receiving single quotes again, unnecessarily, and this affected field
validation in
`packages/twenty-front/src/modules/object-record/record-field/validation-schemas/currencyFieldDefaultValueSchema.ts`

please, make this change below before testing the PR(to fix a bug, the
slice is not updated yet):\

<aa4ae53fb4>

### Demo


<https://www.loom.com/share/2ce130f2e2fe46868e9b1e9119f65cde?sid=dbcb2da2-3641-423c-bdfc-01b0fc52162a>

### Refs

#6692

Fixes #6692

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-08-26 15:02:12 +02:00
Lucas Bordeau
6467da5cab
Fix table re-renders on update field (#6722)
The update of all fields was caused by `useContextSelector` not being
properly implemented.

As it is a memoization library the `useRecordFieldValue` hook wasn't
giving to the library the required things to allow memoization.

I just added recordId + fieldName to the memoization function so that
`useContextSelector` doesn't recompute itself whenever any record
changes.
2024-08-23 19:31:27 +02:00
Baptiste Devessier
e49acae851
Visualize Workflows (#6697)
## Features

- Fetch a workflow and display it in a tree with the React Flow library
- The nodes are positioned by an algorithm
- The feature is put behind a feature flag. The `/workflow/:id` route is
disabled if the flag is off.
- I started implementing a right drawer. That's a big WIP and it will be
finished in another PR.

## How to test this feature

1. Create a workflow instance in the database through a GraphQL query.
See below for instructions.
2. After enabling the feature flag, you should be able to see the
workflow you created in the workflows list. To visualize the workflow,
go to the `/workflow/:id` page where the id is the id of the workflow.
See the video for a quick way to do so.

```gql
// First
mutation createWorkflow($data: WorkflowCreateInput!) {
  createWorkflow(data: $data) {
    id
  }
}

// Result
{
  "data": {
    "name": "test"
  }
}

// Second
mutation createWorkflowVersion($data: WorkflowVersionCreateInput!) {
  createWorkflowVersion (data: $data) {
    id
  }
}

// Result
{
  "data": {
    "name": "v1",
    "trigger": {
  "name": "trigger",
"displayName": "New or Updated Row",
"type": "DATABASE_EVENT",
"settings": {
"eventName": "company.created",
"triggerName": "Company Created"
},
  "nextAction": {
    "name": "step_1",
    "displayName": "Code",
    "type": "CODE",
    "valid": true,
    "settings": {
      "serverlessFunctionId": "function_id",
      "errorHandlingOptions": {
        "retryOnFailure": {
          "value": false
        },
        "continueOnFailure": {
          "value": false
        }
      }
    }
  }
},
"workflowId": "workflow_id"
  }
}
```


https://github.com/user-attachments/assets/42bbd98c-5e13-447c-9307-461a18ac2195
2024-08-23 17:50:13 +02:00