Commit Graph

392 Commits

Author SHA1 Message Date
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
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
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
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
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
af8a167fb2 Update searchVector on new richTextV2 note and task entities + migration command (#10303)
closes https://github.com/twentyhq/core-team-issues/issues/343
closes https://github.com/twentyhq/core-team-issues/issues/340
2025-02-18 18:11:29 +01:00
0cd6e29bff Leave old body field on task and note object (#10243) 2025-02-17 10:38:20 +01:00
bab529b138 Fixing unhandled exception for microsoft driver (#10223)
Fixing a difficult bug: an unhandled exception for microsoft driver when
one of the many Microsoft BATCH request failed.
2025-02-14 18:50:53 +01:00
017280384a Add flow to run output (#10220)
We need the version trigger and steps to be stored in the output. We
should not rely on the version itself because some run are made on draft
versions. Which means versions could be edited afterwards.
2025-02-14 15:20:27 +01:00
258025a18f Fix upgrade-0-42 command to migrate RICH_TEXT field metadata to RICH_TEXT_V2 (#10218)
While making sure the upgrade-0.42 command was working as expected to
upgrade from 0.41 to 0.42, we've detected that the standardId of the new
bodyV2 (type RICH_TEXT_V2) was not properly set ; standardId was not
correct.

This was forcing the sync-metadata command to try to re-create the field
again.
2025-02-14 13:50:06 +01:00
934a97df51 Fix custom exceptions not propagating error code (#10210)
## Context
In some CustomException exceptions, we were instantiating a code without
initializing it which was overriding the parent code and it was then
lost when retrieving it in filters.
Removing them to make sure we don't reproduce this pattern
2025-02-14 10:27:47 +01:00
f2da915b20 Poc lambda subhosting (#10192)
Add `SERVERLESS_LAMBDA_SUBHOSTING_ROLE` to allow hosting lambdas in
separate aws account

Tested with old configuration and new configuration
2025-02-14 09:18:49 +01:00
372ebd14fe withDelete option to TypeOrm (#10161)
fixes https://github.com/twentyhq/core-team-issues/issues/112
2025-02-13 08:50:24 +01:00
0609b31c64 add WorkspaceDuplicateCriteria decorator + update duplicate resolver logic (#10128)
## Context

All objects have '...duplicates' resolver but only companies and people
have duplicate criteria (hard coded constant).
Gql schema and resolver should be created only if duplicate criteria
exist.

## Solution

- Add a new @WorkspaceDuplicateCriteria decorator at object level,
defining duplicate criteria for given object.
- Add a new duplicate criteria field in ObjectMetadata table
- Update schema and resolver building logic
- Update front requests for duplicate check (only for object with
criteria defined)



closes https://github.com/twentyhq/twenty/issues/9828
2025-02-12 17:32:59 +01:00
b66289c44c replace log by throw (#10167)
as title
2025-02-12 16:31:41 +00:00
c30f416912 Add log (#10162)
add log to fix issue in staging
2025-02-12 15:01:34 +00:00
f3586d4989 HandleAlias (#10156)
If a user has microsoft aliases, they will be taken into account, in a
similar way as we did for google
2025-02-12 14:22:13 +01:00
33af71ccd3 Create base search record action (#10135)
Create Search Record action without filters neither sorting

<img width="234" alt="Capture d’écran 2025-02-11 à 18 19 25"
src="https://github.com/user-attachments/assets/f18caaa3-476a-436f-9f93-1ad506b24da2"
/>
<img width="262" alt="Capture d’écran 2025-02-11 à 18 19 38"
src="https://github.com/user-attachments/assets/25fcbfcf-57fb-476f-aba9-119be7c3e067"
/>
<img width="236" alt="Capture d’écran 2025-02-11 à 18 19 53"
src="https://github.com/user-attachments/assets/1eb2be25-0727-4797-868c-afdc05040e6a"
/>
2025-02-12 10:29:32 +00:00
83bf2d1739 Webhook follow up (#10124)
- fix webhook creation
- fix pointer
2025-02-11 16:30:11 +00:00
a4806b72c7 folders (#10081)
# Folders

Adding the possibility to synchronize messages form more than one
microsoft folder (think "inbox" or "sent items")

It will keep the current way for gmail.

- step 1 : implement a first version of full message & partial message 
- step 2 : implement retro-compatibility which includes the command to
run the migration to backfill microsoft synccursor from messageChannelt
o messageFolders
2025-02-11 16:19:53 +00:00
cc68deaab1 Translations cleaning / workflows (#10125) 2025-02-11 15:26:21 +01:00
6da9976193 Fix readonly in some steps (#10121)
- readonly in titles
- readonly in code step
- update a few icons
- update event label
2025-02-11 14:22:18 +00:00
d52c7ffd73 we don't create companies for personal domain emails anylonger (#10110)
and we reomve an usued function
2025-02-10 16:34:35 +00:00
d4ffd52988 add invalid captcha and messageChannel sync status health monitoring (#10029)
Context : 
We want to implement some counters to monitor server health. First
counters will track : messageChannel sync status during job execution
and invalid captcha.

How : 
Counters are stored in cache and grouped by one-minute windows.
Controllers are created for each metric, aggregating counter over a
five-minutes window.
Endpoints are public and will be queried by Prometheus.

closes https://github.com/twentyhq/core-team-issues/issues/55
2025-02-10 11:24:42 +00:00
e70e69cf94 Store output step by step (#10101)
- add context field
- store it with the output after each step execution
2025-02-10 11:27:15 +01:00
ead626c2ec 360 workflow implement workflow cron triggers frontend 2 (#10051)
as title, closes https://github.com/twentyhq/core-team-issues/issues/360

## Cron Setting behavior

https://github.com/user-attachments/assets/0de3a8b9-d899-4455-a945-20c7541c3053

## Cron running behavior


https://github.com/user-attachments/assets/4c33f167-857c-4fcb-9dbe-0f9b661c9e61
2025-02-07 17:15:03 +01:00
736b845c98 335 workflow implement workflow cron triggers backend (#9988)
[Backend side] Add cron triggers to workflow
Closes https://github.com/twentyhq/core-team-issues/issues/335
2025-02-05 11:02:49 +00:00
7dfb9dd77f Fix send email error when empty connected account (#10005)
- Fix send email error when empty connected account
- Add a global util to valid uuid
- Add an util to check if object is workflow related
2025-02-04 17:13:29 +01:00
39e7f6cec3 setup localization for twenty-emails (#9806)
One of the steps to address #8128 

How to test:
Please change the locale in the settings and click on change password
button. A password reset email in the preferred locale will be sent.


![image](https://github.com/user-attachments/assets/2b0c2f81-5c4d-4e49-b021-8ee76e7872f2)

![image](https://github.com/user-attachments/assets/0453e321-e5aa-42ea-beca-86e2e97dbee2)

Todo:
- Remove the hardcoded locales for invitation, warn suspended workspace
email, clean suspended workspace emails
- Need to test invitation, email verification, warn suspended workspace
email, clean suspended workspace emails
- The duration variable `5 minutes` is always in english. Do we need to
do something about that? It does seems odd in case of chinese
translations.

Notes:
- Only tested the password reset , password update notify templates.
- Cant test email verification due to error during sign up `Internal
server error: New workspace setup is disabled`

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-02-02 21:01:34 +01:00
7fd89678b7 [CHORE] Avoid isDefined duplicated reference, move it to twenty-shared (#9967)
# Introduction
Avoid having multiple `isDefined` definition across our pacakges
Also avoid importing `isDefined` from `twenty-ui` which exposes a huge
barrel for a such little util function

## In a nutshell
Removed own `isDefined.ts` definition from `twenty-ui` `twenty-front`
and `twenty-server` to move it to `twenty-shared`.
Updated imports for each packages, and added explicit dependencies to
`twenty-shared` if not already in place

Related PR https://github.com/twentyhq/twenty/pull/9941
2025-02-01 12:10:10 +01:00
d777f62651 clean code and normalize billing eventNames (#9928)
Solves :
https://github.com/twentyhq/private-issues/issues/251

**TLDR:**

Clean Billing Code using feedback of the previous PR (#9865). Normalized
the metadata and names of the products, prices, and meters in Stripe so
that they can be accessed in stripe's test mode and live mode.

**In order to test:**

1. Have the environment variable IS_BILLING_ENABLED set to true and add
the other required environment variables for Billing to work
2. Do a database reset (to ensure that the new feature flag is properly
added and that the billing tables are created)
3. 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)
4. Run the server , the frontend, the worker, and the stripe listen
command (stripe listen --forward-to
http://localhost:3000/billing/webhooks)
5. Buy a subscription for the Acme workspace
6. Create a workflow and run it
7. After the run has been finished check in sprite the quantity of
events in the CreditMeter, you should see that there is a new occurence
with value one.
2025-01-30 17:39:02 +01:00
afed36ef5b Remove before-after + fix header label (#9932)
- Fix header label on step

Before
<img width="224" alt="Capture d’écran 2025-01-30 à 12 11 27"
src="https://github.com/user-attachments/assets/e04e2d83-2414-4a92-a307-159e1ca16c64"
/> <img width="224" alt="Capture d’écran 2025-01-30 à 13 27 40"
src="https://github.com/user-attachments/assets/72e2c567-7ee0-43ff-9ae2-898e46d677c1"
/>

After
<img width="224" alt="Capture d’écran 2025-01-30 à 13 29 00"
src="https://github.com/user-attachments/assets/e7e458ab-458d-4e84-98a2-63596f44e0e7"
/> <img width="224" alt="Capture d’écran 2025-01-30 à 13 29 25"
src="https://github.com/user-attachments/assets/df1b0cbd-c8f2-44f6-b2f6-944e5ec8e14f"
/>



- Remove before - after when there is only one of them
2025-01-30 16:19:47 +00:00
a5273732b3 Icon microsoft (#9907)
Implementing the Outlook icon for CreatedBy, only for emails.

Not in this PR original scope : The similar feature for calendar created
records. Since it was straightforward, I added it to the scope of this
PR.

Fix https://github.com/twentyhq/core-team-issues/issues/252
2025-01-30 16:09:42 +00:00
4084f2114e creating the messagefolder entity (#9933)
first step for the
https://github.com/twentyhq/core-team-issues/issues/149 issue
2025-01-30 16:47:22 +01:00
0d6f4a32a7 Add billing meter event service (#9865)
Solves :
https://github.com/twentyhq/private-issues/issues/241
https://github.com/twentyhq/private-issues/issues/254

**TLDR:**

- Add BillingMeterEventService and StripeBillingMeterEventService in
order to send billing meter events to stripe.
- Plugged the service into workflow node execution for testing purposes
(more improvements on this area will be done in the next PR's)

**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 the Acme workspace 
- Create a workflow and run it
- After the run has been finished check in sprite the quantity of events
in the CreditMeter, you should see that there is a new occurence with
value one.

**Take into consideration:**

- I used an eventName that I have made a long time ago, so it hasn't a
significant naming. I'm updating the meters and associated prices in
stripe to use the correct meter with a more clearer eventName.
- I put some error handling in the execution of the workflow nodes, this
is still incomplete and needs some refinement, I would like the feedback
of the workflows track for a more cleaner approach
2025-01-29 19:36:01 +01:00
07197d1e6d feat: new relation in graphql-query-runner (#9883)
Fix https://github.com/twentyhq/core-team-issues/issues/300

Within GraphQLQueryRunner the new relation format will be used when the
feature flag `IsNewRelationEnabled` is set to true.
2025-01-29 17:04:39 +01:00
7291a1ddcd Add event when creating draft from previous version (#9910)
We create draft without emitting creation event. So workflow statuses
are not properly updated

This service needs a refacto. Will do it once we get out from fast
follows rush
2025-01-29 15:48:22 +01:00
f74bb5a60b Add field description+label translations (#9899)
Add translations for field descriptions
2025-01-28 23:20:28 +01:00
b1219ff107 Add POC for Field translation (#9898)
Similar to ObjectMetadata translation

Also fixed an issue linked to the migration from `t` to `message`
helper: we're forced to rebuild the ID ourselves
2025-01-28 21:25:09 +01:00
72d4619cd4 adding the predicate in the UPSERT function (#9891)
Bug fix : we are adding the predicate in the UPSERT function in order to
fix a postgres constraint
2025-01-28 16:51:37 +01:00
b63ae14318 RICH_TEXT_V2 backend (#9848)
- Add RICH_TEXT_V2 composite type to backend.
- Add `bodyV2` field to tasks and notes.
- Minimum required frontend changes to avoid errors when creating a note

[Testing
instructions](https://github.com/twentyhq/twenty/pull/9690#issuecomment-2602378218)

---------

Co-authored-by: ad-elias <elias@autodiligence.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2025-01-28 14:05:06 +01:00
6f72f1af33 Fix Messaging sync upsert in messageChannel association (#9880)
We have recently changed an .insert into a .upsert but we forgot to add
the unique index on the postgres schema.
2025-01-28 11:48:09 +01:00
af8d22ee99 Fix ObjectType casing and conflict between Relation and RelationMetadata (#9849)
Fixes #9827 

Also uncovered a conflict with `@objectType('Relation')` and
`@objectType('relation)`

I don't want to address it in this PR so I will create a followup issue
when we close this but I think there's a confusion between
Relation/RelationMetadata, it's unclear what is what

---------

Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
2025-01-28 10:06:18 +01:00
08a0e67477 Translate label and descriptions for objects (#9876)
Begin server-side translations
2025-01-28 09:54:59 +01:00
549c3faf71 Add server translation (#9847)
First proof of concept for server-side translation.

The goal was to translate one metadata item:

<img width="939" alt="Screenshot 2025-01-26 at 08 18 41"
src="https://github.com/user-attachments/assets/e42a3f7f-f5e3-4ee7-9be5-272a2adccb23"
/>
2025-01-27 21:07:49 +01:00
98671b6cd2 bug fix urgent (#9851)
upsert messaging
2025-01-27 10:38:18 +01:00
07dec36976 Tt fast follows 24/01 (#9843)
- Add icons on steps
- Add search input on object selection
- Improve event label
<img width="503" alt="Capture d’écran 2025-01-24 à 17 59 34"
src="https://github.com/user-attachments/assets/4e5d31d6-6fe5-4f78-9112-3fbd6ee66743"
/>
<img width="503" alt="Capture d’écran 2025-01-24 à 17 59 54"
src="https://github.com/user-attachments/assets/7f37402f-3d1a-4bea-9082-05f50a711f35"
/>
<img width="503" alt="Capture d’écran 2025-01-24 à 18 00 08"
src="https://github.com/user-attachments/assets/fffabaff-9d5d-4584-9297-e21434333de0"
/>
2025-01-24 17:25:01 +00:00
29df6e64a0 Fix icon matching + small other fixes on workflows (#9814)
- Record Fields label
- body height fix
- Icons on object picker
- Fix icon matching between nodes and right drawer

<img width="1296" alt="Capture d’écran 2025-01-23 à 18 51 12"
src="https://github.com/user-attachments/assets/ecd5fb00-49cd-416e-96af-9200418294e0"
/>
2025-01-24 15:47:09 +01:00
15814d465a Fix missing events during account connection (#9825)
Fix #8765
2025-01-24 10:10:42 +00:00