Commit Graph

4765 Commits

Author SHA1 Message Date
Guillim
928c99a725
Phone country fix (#9167) 2024-12-20 15:28:17 +01:00
Raphaël Bosi
d08075f610
Command menu actions fixes (#9169)
- Fix command menu not closing after executing an action
- Add delete and favorite actions to workflow and workflow versions
2024-12-20 13:42:01 +00:00
nitin
f65a90d137
minor fix -- datamodel multiselect edit form dropdowns (#9168)
made sure dropdown gets unique ids.
2024-12-20 14:17:13 +01:00
Weiko
52362812a5 Catch workspace issues in backfill upgrade commands 2024-12-20 12:11:05 +01:00
nitin
2e216e7a73
Icon alignment in NavigationDrawerItems (#9164)
Icons are not aligned to the labels
before:
<img width="387" alt="Screenshot 2024-12-20 at 4 09 01 PM"
src="https://github.com/user-attachments/assets/c115abcd-9779-4597-b40e-6ceceeaa13b9"
/>

after: 

<img width="387" alt="Screenshot 2024-12-20 at 4 08 36 PM"
src="https://github.com/user-attachments/assets/a0535030-a810-4023-b677-8380b833f712"
/>
2024-12-20 11:53:21 +01:00
Charles Bochet
f499c728fd
Fix activity editor (#9165) 2024-12-20 11:52:00 +01:00
martmull
0d2bfad3c9
Separate date and datetime components (#9161)
Add a 2 components solution for FormDate and FormDateTime
2024-12-20 10:50:30 +00:00
Weiko
779c503381
Fix sync metadata default value not being synced (#9163)
## Context
We used to not sync defaultValue and recently introduced a change in
3340f01c31/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/comparators/workspace-field.comparator.ts
with shouldNotOverrideDefaultValue to sync it for specific field
metadata type that can't be overwritten by the user.
This means we should have removed 'defaultValue' from
commonFieldPropertiesToIgnore list since it was handled differently.
This PR fixes that

Before
<img width="792" alt="Screenshot 2024-12-20 at 11 04 09"
src="https://github.com/user-attachments/assets/1771c5a3-2162-4013-8a08-c54d2619fda3"
/>

After
<img width="798" alt="Screenshot 2024-12-20 at 11 04 55"
src="https://github.com/user-attachments/assets/33e09f16-c615-4a43-950d-d2df955fb196"
/>
2024-12-20 11:42:42 +01:00
Raphaël Bosi
1acf845101
9018 fix batch delete follow ups (#9166)
Follow ups on #9018
2024-12-20 11:41:09 +01:00
martmull
2437572a5c
Fix discard draft optimistic rendering (#9153)
Remove draft workflow version from cached workflow
2024-12-20 11:36:47 +01:00
Raphaël Bosi
925294675c
9018 fix batch delete (#9149)
Closes #9018
2024-12-20 10:46:24 +01:00
Raphaël Bosi
a0b5720831
Fix modals being unregistered inside command menu (#9155)
Fix modals being unregistered inside command menu
2024-12-20 10:45:22 +01:00
nitin
54c4d64ae8
Scrollable fixed dropdowns container minor refactor (#9159)
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-12-20 10:43:48 +01:00
martmull
94136d953e
8749 invalid openapi schema (#9156) 2024-12-20 09:56:22 +01:00
Charles Bochet
ded0a68b89 Fix tests 2024-12-19 17:49:29 +01:00
BOHEUS
811002d8b9
Github CI workflow fix (#9137) 2024-12-19 17:01:58 +01:00
Charles Bochet
1d627039c0
Add possibility to destroy a record (#9144)
There are two follow ups to this PR:
- Bug: sometimes when opening Cmd+K from a deleted record, we are facing
a global error
- On Index page, actions in top right are displaying label and not short
name
- Implement multiple actions once refactoring on delete is complete

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-12-19 17:00:30 +01:00
Guillim
360c34fd18
Phone country code unique (#9035)
fix #8775
2024-12-19 16:42:18 +01:00
Weiko
3f58a41d2f
Fix sort with pagination and composite fields (#9150)
Fixes https://github.com/twentyhq/twenty/issues/8863

## Description
This PR fixes an issue with cursor-based pagination when dealing with
composite fields (like `fullName`). Previously, the pagination direction
was incorrectly determined for composite fields because the code wasn't
properly handling nested object structures in the `orderBy` parameter.
Refactored the code accordingly.
2024-12-19 16:41:04 +01:00
Marie
ed56a68b7c
Improve aggregate footer cell display (#9124)
Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-19 14:36:14 +00:00
Antoine Moreaux
7d8f895ae9
fix test (#9147) 2024-12-19 15:24:49 +01:00
Thomas Trompette
53576245aa
Fix version creation / update when opening an action (#9145)
Actions using tiptap trigger updates when called.

Flow is following:
- component using tiptap receive default value
- we separate the default value because we need to add specific
attributes to the editor when inserting breaks or variables
- editor performs an update for each value

It means that initialize our editor performs several updates. We need to
avoid persisting until the init finished.
2024-12-19 13:19:25 +00:00
Harsh Singh
784bc78ed0
add: objectName in fav folder (#8785)
Closes: #8549 

It was quite complex to get this right. So, I went through Notion's
website to see how they implemented it.
Instead of using `display: none` or having a space reserved for the
Icon, I used clip-path & opacity trick to achieve the desired behaviour.
This maintains accessibility and helps in label or ObjectName to take
the full space.

Also, truncation now works for label & objectName as a whole instead of
separately, as seen in my previous PR.

**Caveats**

The only problem that now remains is not having
`NavigationDrawerAnimatedCollapseWrapper`. Having it on top of any text
or div won't let the flex or truncation property work.

[Screencast from 2024-11-28
13-37-31.webm](https://github.com/user-attachments/assets/29255cd2-3f15-4b1d-b1e1-c041c70052e5)

---------

Co-authored-by: ehconitin <nitinkoche03@gmail.com>
Co-authored-by: martmull <martmull@hotmail.fr>
2024-12-19 11:51:03 +01:00
Baptiste Devessier
65586a00cc
Add date time form field (#9133)
- Create a really simple abstraction to unify the date and date time
fields. We might dissociate them sooner than expected.
- The _relative_ setting is ignored
2024-12-19 10:46:21 +00:00
Ana Sofia Marin Alexandre
028e5cd940
add sync customer command and drop subscription customer constraint (#9131)
**TLDR:**
Solves (https://github.com/twentyhq/private-issues/issues/212)
Add command to sync customer data from stripe to BillingCustomerTable
for all active workspaces. Drop foreign key contraint on billingCustomer
in BillingSubscription (in order to not break the DB).

**In order to test:**

- Billing should be enabled
- Have some workspaces that are active and whose id's are not mentioned
in BillingCustomer (but the customer are present in stripe).

Run the command: 
`npx nx run twenty-server:command billing:sync-customer-data`

Take into consideration
Due that all the previous subscriptions in Stripe have the workspaceId
in their metadata, we use that information as source of true for the
data sync

**Things to do:**

- Add tests for Billing utils
- Separate StripeService into multipleServices
(stripeSubscriptionService, stripePriceService etc) perhaps add them in
(https://github.com/twentyhq/private-issues/issues/201)?
2024-12-19 11:30:05 +01:00
Mantey
e84176dc0d
Reactive form preview (#8663)
## Description

This PR fixes issues with field previews not updating immediately when
settings are changed in the Data Model Editor. The changes affect number
field types, ensuring that the preview updates in real-time as settings
are modified.

### Fixed Issues
- Number field preview not updating when changing decimals or number
type (e.g., percentage)

Recording

https://www.loom.com/share/14a30f67266d4a08a694c759ae06b0f3?sid=c0de35ef-9982-438b-b822-94ed106f6891

~~Fixes #8663~~
Fixes #8556

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-19 11:22:13 +01:00
Thomas Trompette
32fef06734
Remove react hook form in send email action (#9130)
- remove react hook form
- put back multiline for body
2024-12-19 09:48:46 +00:00
Antoine Moreaux
7375ab8d71
Fix/refresh token (#9135) 2024-12-18 19:10:16 +01:00
nitin
5e03f4dfb1
fix icon shrink and use avatar for logo and icons (#9117)
- Fixed icon shrinking on tabs. The introduction of EllipsisDisplay
takes 100% of the width, thus shrinking the icons.
- Removed scroll wrapper tablist. This was removed in #9016 but
reintroduced in #9089. This reintroduction made the dark border below
the active tab disappear.
- Used Avatar for icon and logo rendering following the changes made in
#9093
2024-12-18 19:06:08 +01:00
Antoine Moreaux
a2423fad5e
feat(auth): add workspaceId validation and token expiration (#9134)
Added validation to ensure refresh tokens include a workspaceId,
throwing an exception for malformed tokens. Included workspaceId in
payloads and introduced expiration handling for access tokens. This
enhances token security and prevents potential misuse.

Close #9126
2024-12-18 18:56:49 +01:00
Mohammed Abdul Razak Wahab
f620fd3c18
Fixes person navigation after image upload (#9076)
Fixes #8949
2024-12-18 18:44:00 +01:00
Charles Bochet
71254bfca0
Fix workspace logo (#9129)
Follow up on:
https://github.com/twentyhq/twenty/issues/9042#issuecomment-2550886611
2024-12-18 18:09:52 +01:00
martmull
5586270df4
Remove buggy dependencies (#9115)
Fixes double download
2024-12-18 17:05:33 +00:00
Marie
f482b459a9
Remove workspace gates for aggregate fields metadata (#9125)
As part of our rollout strategy, let's remove the workspaces gates,
which will trigger the creation of the field metadatas needed for the
aggregate queries features.
In a later release we will remove the feature flag completely, after all
fields have been created for all workspaces
2024-12-18 17:45:10 +01:00
Charles Bochet
baf339567c Fix broken import on graphql api exception helper 2024-12-18 16:57:39 +01:00
Antoine Moreaux
2bcce44e08
feat(workspace): expand forbidden subdomain validation (#9082)
Added new forbidden words and regex patterns to subdomain validation in
`update-workspace-input`. Enhanced the `ForbiddenWords` validator to
support both strings and regex matching. Updated tests to verify
regex-based forbidden subdomain validation.

Fix #9064

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-12-18 16:46:59 +01:00
Antoine Moreaux
550756c2bf
feat(auth): enhance workspace handling and error feedback (#9118)
Add support for setting a user's default workspace during sign-in if a
target workspace subdomain exists. Enhance error feedback by displaying
authentication error messages using a Snackbar in the front-end and
improving redirect logic for workspace-specific errors.
2024-12-18 16:46:25 +01:00
Jérémy M
01fc70da0f
fix: 3 first columns should be sticky view group (#9123)
Fix #9113 

<img width="591" alt="Screenshot 2024-12-18 at 3 33 05 PM"
src="https://github.com/user-attachments/assets/df55eff3-7b0d-4cf0-881b-167e1bf2f97b"
/>

<img width="543" alt="Screenshot 2024-12-18 at 3 34 37 PM"
src="https://github.com/user-attachments/assets/76fe06e1-0a46-4130-921d-1d480306bda2"
/>
2024-12-18 16:35:08 +01:00
Thomas Trompette
94676215ad
Add fields to update in update record action (#9108)
- update backend action so it handles composite fields
- add fields to update multiselect
- generate form based on that field
- add icons
2024-12-18 13:32:21 +00:00
Baptiste Devessier
b6508cc615
Add UUID form field input (#9121) 2024-12-18 14:26:35 +01:00
Jérémy M
ae044c2fc8
fix: view group wrong cursor (#9119)
Wrong cursor was shown on `Load more` and `Add new` row in view group
mode
2024-12-18 12:54:09 +01:00
Jérémy M
3b48920314
feat: NoValue is bot properly created the backend (#9110)
`No Value` view groups wasn't properly created when we select a group by
field metadata, this PR fix the issue.
Also a script is added to backfill the current view groups.

---------

Co-authored-by: Marie <51697796+ijreilly@users.noreply.github.com>
2024-12-18 12:26:38 +01:00
Lucas Bordeau
d895468ebe
Removed unecessary dropdown container on MultiSelectFieldInput (#9116)
There was an unecessary dropdown menu container div that was conflicting
with the recent refactor of dropdowns. The OverlayContainer component is
now at the root of the tree of a cell.
2024-12-18 12:22:02 +01:00
Félix Malfait
45214fe548
Add no-seed configuration to database:reset (#9112)
Based on feedback here:
https://github.com/twentyhq/twenty/issues/9109#issuecomment-2550198035
2024-12-18 11:44:06 +01:00
Baptiste Devessier
deb37edd7c
Add Raw JSON Form Field Input (#9078)
- Implemented the `renderText` method for `VariableTag`. This method
returns the `variable` attribute of the node, i.e. `{{test}}`.
- Used the `editor.getText()` function to simply get the textual
representation of the field without relying on `editor.getJSON()` and
`parseEditorContent`.
- Implemented the RawJSON form field, which is heavily based on the
`TextVariableEditor` component.
- This component is inspired from the `RawJsonFieldInput` field,
especially the JSON validation.

Closes https://github.com/twentyhq/private-issues/issues/180
2024-12-18 11:42:12 +01:00
nitin
8623585106
minor fix -- missing margin bottom for orphan favorites (#9111)
this PR is a followup of the favorites followups which was the follow-up
of some other PR :)
2024-12-18 09:27:29 +01:00
Harsh Singh
e0f1db2ed3
fix: recordBoard sticky header + scrollThumb (#8946)
Fixes: #8944 

[Screencast from 2024-12-08
00-43-19.webm](https://github.com/user-attachments/assets/b6e15fcc-46a1-4ab0-aacf-86056248bb69)

---------

Co-authored-by: ehconitin <nitinkoche03@gmail.com>
2024-12-18 11:08:54 +05:30
Murali Singh
fb8d193238
Fix: Replace styled logo with Avatar component for workspace logo in NavigationDrawerHeader (#9093)
This PR addresses issue #9042

- Replaced the styled logo with the `Avatar` component.
- `Avatar` now handles the case when no `logo` is uploaded by using the
workspace name's first character as the `placeholder`.
- This ensures a consistent fallback when the `logo` is undefined.

---------

Co-authored-by: guillim <guigloo@msn.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-17 20:42:06 +01:00
Antoine Moreaux
07bde4883e
feat(auth): add default workspace support for user handling (#9099)
Introduce `defaultWorkspaceId` to improve workspace redirection logic.
Updated GraphQL schema, server logic, and frontend components
accordingly to prioritize default workspaces when available.

## Summary
This PR adds a mechanism to handle and prioritize default workspace
selection for users during authentication. It updates the logic in
multiple components and services to ensure users are redirected to their
default workspaces if no specific selection is provided.

### Main changes:
- **GraphQL Schema Updates**:
- Enhanced `UserExists` GraphQL entity with a new `defaultWorkspaceId`
field to specify the user's default workspace.
  - Updated queries and mutations to handle the `defaultWorkspaceId`.

- **Client-Side Updates**:
- Enhanced `useAuth` hook to include logic for managing default
workspace redirection.
- Adjusted UI logic in `SignInUpGlobalScopeForm` to utilize the
`defaultWorkspaceId`.

- **Server-Side Adjustments**:
- Modified `AuthService` to include `defaultWorkspaceId` in
`checkUserExists`.
- Default workspace logic added to the backend flow for consistent
handling.

- **Tests/Helpers**:
- Added utility and type changes to integrate the new backend response
changes (e.g., `UserExists` GraphQL).
- **Subsequent function lifecycle** was adjusted to include recheck for
workspace token states when performing sign-in flows.
2024-12-17 19:56:19 +01:00
Ana Sofia Marin Alexandre
55dc5983a2
add price and meter dynamically add foreign keys in billing (#9100)
**TLDR**
Solves: https://github.com/twentyhq/private-issues/issues/199
Partially solves: https://github.com/twentyhq/private-issues/issues/221
(more details below)

Updates the BillingMeter and BillingPrice tables while listening to the
events "price.created" and "price.updated" from the stripe webhook. Also
added the foreign keys, that couldn't be added to the BillingEntities.

**In Order To test**
Billing:

- Set IS_BILLING_ENABLED to true
- Add your BILLING_STRIPE_SECRET and BILLING_STRIPE_API_KEY
- Add your BILLING_STRIPE_BASE_PLAN_PRODUCT_ID (use the one in testMode
> Base Plan)

Authenticate with your account in the stripe CLI
Run the command: stripe listen --forward-to
http://localhost:3000/billing/webhooks

Run the twenty workker

Authenticate yourself on the app choose a plan and run the app normally.
In stripe and in posgress the customer table data should be added.

**Take Into Consideration**

In a previous migration the foreign key to workpaceId was taken down
this was due to the separation of the migrations if billing is enabled.
Because we want to separate in these two categories: we will be
polluting the Common Migrations with relations to tables that don't
exists. This will be addressed in a PR in the next sprint (perhaps a
decorator?)


**Doing**
Testing migrations, when we are in main and when billing is enabled.
2024-12-17 19:54:56 +01:00