Commit Graph

2880 Commits

Author SHA1 Message Date
martmull
5dfcc413cf
9024 workflow test serverless function follow up (#9066)
-  Fix Tablist style
- Fix dropdown style (wrong grey background)
- Update dropdown variable when no outputSchema is available 



https://github.com/user-attachments/assets/56698fe8-8dd3-404a-b2b2-f1eca6f5fa28
2024-12-17 10:35:38 +01:00
nitin
0692bba710
fix advanced mode settings navigation animations (#9096)
Before:


https://github.com/user-attachments/assets/9aa8b8ec-2490-4fb2-8d1e-a01b09349eda

After: 


https://github.com/user-attachments/assets/eb76471d-2d11-4e85-94ce-24c25acf274a
2024-12-17 10:13:41 +01:00
Mohammed Abdul Razak Wahab
08a9db2df6
Add Twenty Shared & Fix profile image rendering (#8841)
PR Summary: 

1. Added `Twenty Shared` Package to centralize utilitiies as mentioned
in #8942
2. Optimization of `getImageAbsoluteURI.ts` to handle edge cases


![image](https://github.com/user-attachments/assets/c72a3061-6eba-46b8-85ac-869f06bf23c0)

---------

Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-17 09:24:21 +01:00
Antoine Moreaux
4e329d08b0
feat(database): add unique constraint on workspace subdomain (#9084)
Added a unique constraint to the "subdomain" column in the workspace
entity to ensure no duplicate subdomains exist in the database. Included
a TypeORM migration script to enforce this change at the database level.
2024-12-16 19:41:18 +01:00
Antoine Moreaux
33b028658e
fix(twenty-front): allow to connect available provider only (#9080)
Fix #8710

## Summary
The Pull Request updates components related to the settings account
management feature. The changes ensure the behavior of buttons and the
UI dynamically adapts based on the availability of authentication
providers retrieved from the current workspace state.

- Added checks for Google and Microsoft authentication enablement and
used these conditions to display buttons dynamically in both components.
- Updated `SettingsAccountsConnectedAccountsListCard` to dynamically
enable the footer button based on workspace authentication settings.
- Revised `SettingsAccountsListEmptyStateCard` to conditionally render
account connection buttons depending on the availability of enabled
authentication providers in the current workspace state.
2024-12-16 18:44:30 +01:00
Marie
311b5f64c4
Refacto scroll + Aggregate queries for view groups (#9089)
Closes https://github.com/twentyhq/private-issues/issues/217.

Refactoring scroll not to cause table-wide re-render when opening a
dropdown (triggering a scroll lock) in the table.
2024-12-16 17:58:57 +01:00
Félix Malfait
c90d2fd5cc
Change default behavior of ENABLE DB MIGRATION (#9077)
See:
https://github.com/twentyhq/twenty/issues/9031#issuecomment-2542015975

I think it would be easier if the default behavior for the container was
to run the migration, and setting the environment variable would be used
to disable it (e.g. on the worker).

Long-term goal is for the default setup to work out of the box with ~2
env variables only (database url, redis url)

I don't think there's a big risk if people forget to turn it off on the
worker?
2024-12-16 17:31:45 +01:00
Thomas des Francs
449be46936
0.34 changelog (#9091) 2024-12-16 17:26:15 +01:00
Raphaël Bosi
8ce6f6daea
Refactored all single record actions (#9045)
## Context

Refactored all single record actions so they can be defined by a config
file.
This refactoring is made with the idea that later the actions will be
stored in the database, so we needed a way to serialize them.
For each object we can define a config file, if an object has no config
file, it falls back to the default config.
I introduced action hooks, which return:
- `shouldBeRegistered`: `boolean` Whether the action should be
registered.
- `onClick`: `() => void` The code that will be executed when we click
on an action
- `ConfirmationModal`?: `React.ReactNode` (optional) The confirmation
modal which will be displayed on click

This PR also closes #8973 

## Next steps

- Refactor multiple records actions
- Refactor no selection actions
- Add tests
2024-12-16 16:30:18 +01:00
Weiko
5d51a826ea
fix demo seed conflicting with dev seed (#9087)
We have conflicts which prevents us from running demo seed command after
a database-reset or/and if dev seed has already been populated. This is
because we are trying to create Tim user twice (but due to the
insert()...onConflict() in the seed creation, it does not create the
second one), for seed-dev and seed-demo .

This PR fixes that by using the same user id, allowing us to use the
same Tim apple for both dev/demo seeds

Test
<img width="802" alt="Screenshot 2024-12-16 at 15 36 56"
src="https://github.com/user-attachments/assets/72244978-130f-4561-8709-43376453b247"
/>
<img width="780" alt="Screenshot 2024-12-16 at 15 37 17"
src="https://github.com/user-attachments/assets/01ce221b-34f6-4e48-ae30-d84bdf9d3cc2"
/>
2024-12-16 15:47:09 +01:00
Antoine Moreaux
f8f3945680
fix(): sleep before redirect (#9079)
## Summary
This Pull Request centralizes the redirection logic by introducing a
reusable `useRedirect` hook, which replaces direct usage of
`window.location.href` with more standardized and testable functionality
across multiple modules.

- Introduced a new `useRedirect` hook for handling redirection logic
with optional controlled delays.
- Refactored redirection implementations in various modules (`useAuth`,
workspace, and settings-related hooks, etc.) to use the newly introduced
`useRedirect` or related high-level hooks.
- Updated API and documentation to include or improve support for SSO,
particularly OIDC and SAML setup processes in server logic.
- Enhanced frontend and backend configurability with new environment
variable settings for SSO.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-16 15:15:55 +01:00
Jérémy M
9e9c1bdff1
feat: record group insert at bottom when created (#9053)
Fix #9050 

When we add a new record in a record group this one should be added at
them bottom.
2024-12-16 14:57:16 +01:00
Weiko
5a27491bb2
Fix Tasks/Notes created with null position (#9068)
Fixes https://github.com/twentyhq/twenty/issues/8810
Fixes https://github.com/twentyhq/twenty/issues/5268
Fixes https://github.com/twentyhq/twenty/issues/8971

- Fixing Task/Note creation not sending position during creation
- Adding a command to backfill position being null, using existing
backfill command.
- Removed unused backfill job.
- Updated workspace entities to set position non-nullable and set a
default value to make it non-required on the API
- Updated position factory to set a default position for all objects
having a POSITION field instead of only company/people
- Moved the try/catch in each resolver factory calling
GraphqlQueryRunnerException handler, makes more sense to call it in the
actual graphql-query-runner and removing some duplicate codes
- Adding validations for input in QueryRunnerArgs factories
- Allow sync-metadata to override and sync defaultValues for certain
field types (that can't be updated by users)
- Removing health-check from sync-metadata command during force mode to
improve performances
2024-12-16 14:45:54 +01:00
Charles Bochet
2ceb1c87b3
Fix array enum renaming (#9067)
When creating an enum type (let's say post_type_enum), postgres will
automatically create a array enum type based on this enum and prefix it
with an underscore (so _post_type_enum).

Our code was not taking this case into account while dealing with
MULTISELECT

Resources:
https://www.postgresql.org/docs/current/sql-createtype.html

<img width="1329" alt="image"
src="https://github.com/user-attachments/assets/c41bc90c-9884-4995-8fae-d26869153a1d"
/>
2024-12-13 19:16:04 +01:00
Félix Malfait
042b6c65ed
Change favicon/company enrichment urls (#9065)
We're moving favicon/telemetry/company enrichment to a separate url for
better security/monitoring
2024-12-13 18:41:57 +01:00
Ana Sofia Marin Alexandre
abaf2651ec
add product table data in real time (#9055)
Solves (https://github.com/twentyhq/private-issues/issues/198)

**TLDR**

Updates the billingProduct table data using stripe webhooks event. It
saves all the updates/creates of the products, but ensuring that it has
the lastest version of the correct metadata attributes (typeof
BillingProductMetadata)

**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

Go to Stripe In test mode and update or create a product using a
metadata of type of BillingProductMetadata, you can also update it using
a different values for metadata.

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2024-12-13 18:15:11 +01:00
Thomas Trompette
5961d26f91
Add email composite field (#9061)
Same as links, only adding primary email
2024-12-13 18:05:31 +01:00
Thomas Trompette
32e7eb79b9
Add links composite field (#9059)
- only primary links for now
- need for a global strat for validation. This will come later
2024-12-13 15:53:21 +00:00
Charles Bochet
7e67b1c5a6
Enforce system wide sso providers (#9058)
We have recently introduced the possibility to specify workspace
specific auth providers.
I'm:
- introducing system wide auth providers (provided by clientConfig)
- making sure workspace specific auth providers belong to system wide
auth providers set
2024-12-13 16:38:04 +01:00
Charles Bochet
57869d3c8c
Fix broken chips on timelin eActivity on show pages (#9057)
We were using RecordIndexContext in FieldDisplays components which is
wrong as the FieldDisplays could be used in locations not providing this
context (not being indexes pages).

Instead, we are passing it within FieldContext which the context that
will always be there for FieldDisplays and we need indexes to fill this
FieldContext with their RecordIndexContext value when needed
2024-12-13 15:34:00 +01:00
nitin
257834ea71
In navigation drawer, cursor should not be drag on hover and some enhancements (#8975)
as per the title- on hover, the draggable items had a grab cursor.
Couldn't change it to a pointer, because then onClick would have a weird
behavior of grab which causes lag onClick.
2024-12-13 14:37:46 +01:00
Charles Bochet
9579f22bc2
Move settings data model refreshMetadata to sync calls (#9046)
In this PR, I'm
- removing setting up the isAppWaitingForFreshMetadata boolean state in
PageChangeEffect navigate (not robust) to some precise synchronous
places, improving the control we have on when the app considers it's
ready to be rendered based on fresh metadata
- fixing tests
2024-12-13 13:14:10 +01:00
martmull
b10d831371
8726 workflow add a test button in workflow code step (#9016)
- add test button to workflow code step
- add test tab to workflow code step


https://github.com/user-attachments/assets/e180a827-7321-49a2-8026-88490c557da2



![image](https://github.com/user-attachments/assets/cacbd756-de3f-4141-a84c-8e1853f6556b)

![image](https://github.com/user-attachments/assets/ee170d81-8a22-4178-bd6d-11a0e8c73365)
2024-12-13 10:16:29 +00:00
Jérémy M
07aaf0801c
fix: can't properly drag and drop in empty record group (#9039)
Fix #8968 

Fix issue with drag and drop when record group are empty.
Happy to discuss the implementation, as it's limited to the
`@hello-pangea/dnd` api.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-13 09:37:23 +01:00
Marie
d56c815897
[Fix] isLabelSyncedWithName should be nullable (#9028)
isLabelSyncedWithName should be nullable for fieldMetadata, as it is for
objectMetadata.

+ Adding missing validation on label and name sync in
fieldMetadataService for creation and update
+ adding metadata tests
2024-12-12 18:25:40 +01:00
Thomas Trompette
2990d23411
Fix composite field creation (#9044)
- composite field need to be formatted before being saved
- repository.create() does not do it. So we simply lose the composite
fields on the way
- save() does it directly and doing create() before does not change
anything
2024-12-12 16:34:56 +00:00
Charles Bochet
77c2961912
Fast follows on 0.34 (#9034)
Co-authored-by: Weiko <corentin@twenty.com>
2024-12-12 15:46:48 +00:00
Marie
05cd0d1803
[Aggregate queries for table views - #2] Add aggregate queries footer for simple views (#9025)
In this PR, we are introducing aggregate queries on table views, behind
a feature flag.
This does not work with view groups yet, nor with views that have
records until the bottom. (both will be tackled next)
2024-12-12 13:38:58 +01:00
Jérémy M
5f2a39d9e9
fix: group by sort options should have a checkmark when selected (#9038)
Fix #8966 

This PR is adding a checkmark beside the selected sort option in the
`Options` dropdown menu.

<img width="225" alt="Screenshot 2024-12-12 at 12 03 18 PM"
src="https://github.com/user-attachments/assets/81783bc0-5aea-4f0d-9327-c70f3e70edb6"
/>
2024-12-12 11:18:53 +00:00
Jérémy M
d7da73f0ec
feat: record group add new (#8925)
Fix #8757

This PR is adding the Add new button on view groups.
Also this PR fix an issue where the pending record can be draggable, and
is causing error.

<img width="1119" alt="Screenshot 2024-12-10 at 4 24 43 PM"
src="https://github.com/user-attachments/assets/4fd01e99-c85e-4a06-a733-cbf3cc32957d">

It also start to issues with the way we're using Context.
We're initializing pretty much all Context like this:

```typescript
export const RecordTableContext = createContext<RecordTableContextProps>(
   {} as RecordTableContextProps,
 );
```

This is causing issues when by mistake we use the context like this
outside the Provider hierarchy:

```typescript
const context = useContext(RecordTableContext);
```

This is going to fail silently, and all the context variables become
undefined...

To fix this I've introduced an util called `createRequiredContext`, this
one is returning an array containing the provider and the hook to
retrieve the context.
The context is initialized to undefined inside this utility, this way we
can check if the value has been initialized with the provider to check
if we're inside it. It'll throw an error if this one is used outside the
provider.
The return values are properly typed, so `undefined` is not added to the
value of the Context.

I'll create a followup ticket to use this new utility function, if
that's ok and replace it everywhere in the codebase.
We can also consider adding a eslint rule to warn about the use of
`createContext` directly.
2024-12-12 11:50:13 +01:00
BOHEUS
182ebb6394
Playwright tests - stage 1 - login with email and password test (#8988)
Scenario:
https://github.com/twentyhq/twenty/issues/8469#issuecomment-2471420099

To launch this test, `yarn playwright test --project Authentication`
must be used in `packages/twenty-e2e-testing` directory (for some reason
when launching this test from IDE, be Webstorm or VSCode, it won't fetch
the data from .env)
2024-12-12 11:05:25 +01:00
Ana Sofia Marin Alexandre
bce5be85a3
add info to customer table and stripe customer data (#9004)
Solves (https://github.com/twentyhq/private-issues/issues/194)

**TLDR**

Updates the billingCustomer table data using stripe webhooks event, also
updates the customer's metadata in stripe, in order to contain the
workspaceId associated to this customer.

**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.

**Next steps**
Learn more about integrations tests and implement some for this PR.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-12 08:00:39 +01:00
Weiko
c776179ecc
start 0.40.0 canary (#9029) 2024-12-11 19:23:51 +01:00
Charles Bochet
90c26643a8
Fix race condition while loading metadata on sign in (#9027) 2024-12-11 18:56:02 +01:00
khuddite
183fd877c4
Add a confirmation modal for relation object deletion (#8818)
Fixes #8698 

1. Summary
We decided to add a confirmation modal for the relation object deletion.
It's gonna a bit of safety to the user interactions because this action
can be disruptive even though it can be restored.

2. Solution
Used `createPortal` function to address the issue where the vertical
scrollbar shows over the modal. Added a logic that displays a
confirmation modal for deletion in [this
file](d284419d66/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx).
I can update the text(title, description, and CTA) as necessary based on
the feedback.

_**However, I observed an issue that the deleted object still shows up
under the list until hard-refresh. I figured that can be addressed as a
separate issue.**_

3. Recording


https://github.com/user-attachments/assets/1a64b702-a915-49f3-a226-2c2d5af8a1d7
2024-12-11 18:23:27 +01:00
Suhotra Dey
07de458fda
fix:Hide Scrollbar before Scroll (#8896)
Fix for the issue #8847 Hide Scrollbar before Scroll.


https://github.com/user-attachments/assets/27dda89f-e3f6-4c72-bcc5-8c7e10d3c823

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: ehconitin <nitinkoche03@gmail.com>
2024-12-11 22:44:46 +05:30
Thomas Trompette
4d9facb9bd
Add address composite form field (#9022)
- Create FormCountrySelectInput using the existing FormSelectFieldInput
- Create AddressFormFieldInput component
- Fix FormSelectFieldInput dropdown + add leftIcon

<img width="554" alt="Capture d’écran 2024-12-11 à 15 56 32"
src="https://github.com/user-attachments/assets/c3019f29-af76-44e1-96bd-a0c6283674e1"
/>
2024-12-11 16:57:42 +00:00
Raphaël Bosi
2c4a77a7b7
Refactor RecordShowActionMenu to use contextual actions (#9023)
Closes #8736
2024-12-11 15:24:02 +00:00
Charles Bochet
224b6d1334
Fix login issue (#9012)
Co-authored-by: Weiko <corentin@twenty.com>
2024-12-11 15:42:53 +01:00
Raphaël Bosi
ad04040ea6
8976 modify mobile page header (#9020)
Closes #8976
2024-12-11 15:06:09 +01:00
Murali Singh
6067852c1c
fix(chip): update padding for transparent variant (#7164) (#8823)
This PR addresses the issue described in #7164, where the Chip
component's padding for the Transparent variant was not correctly
aligned. The following changes have been made:

The padding-left for the Transparent variant is now set to 2px to
improve alignment.
Other chip variants retain the default horizontal padding values.

These changes ensure that the Transparent chip variant is rendered
consistently with the rest of the design, as described in #7164.

See screenshots below for before and after comparison:
Before:

![image](https://github.com/user-attachments/assets/7749e393-3a9b-4367-a6f9-cb32a9897e7d)

![image](https://github.com/user-attachments/assets/2ad80002-f867-4bf2-b27c-29392b008ed9)

After:
![Screenshot 2024-12-01 at 4 02
08 AM](https://github.com/user-attachments/assets/71fb19a1-00fb-4ea3-989f-185c92221d5e)

![image](https://github.com/user-attachments/assets/7cc93c5e-d42b-4ada-bd27-178836b660b4)

Please review @Bonapara and let me know if you have any feedback or
concerns.

---------

Co-authored-by: guillim <guigloo@msn.com>
2024-12-11 14:52:55 +01:00
Guillim
841b1f0e11
Thomas request (#9017)
Design request
2024-12-11 13:50:33 +01:00
Raphaël Bosi
5c60a5511e
8929 move recordindexactionmenu menu inside the recordindexpageheader (#9007)
Closes #8929 

Users with the feature flag `IS_PAGE_HEADER_V2_ENABLED` set to false
will still have the old behavior with the action bar.

To test the PR, test with and without the feature flag.
2024-12-11 11:51:33 +01:00
Guillim
89f6f32243
Title overflow (#9009)
fix #8803
2024-12-11 11:37:08 +01:00
Naifer
c1fff908fe
Fix:Hide deleted filter component when reset button is clicked (#8880)
Resolve: #8874 

Problem :
When we are on the deleted records page and use the filter, if no
records are found, we see the no deleted recordName message along with a
button to remove the deleted filter. However, if we reset and filter
again, and still don't find any records, this message and button for the
deleted filter continue to display.
Solution: 
I noticed that the component RecordTableEmptyStateSoftDelete has this
button, and its visibility is controlled by the function
toggleSoftDeleteFilterState. If the state is true, the button appears;
if it's false, it doesn't. Therefore, we just need to call this function
when the reset button is clicked and set the state to false.
![All-Peopleand1morepage-Personal-MicrosoftEdge2024-12-0421-04-12-ezgif
com-video-to-gif-converter](https://github.com/user-attachments/assets/68e524ff-2902-4a25-a361-3bb8e1220ff8)

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-12-11 10:06:23 +00:00
Marie
8ecf07f112
[Aggregate queries for table views - #1] Introduce aggregateOperationForViewFieldState (#9010)
Introducing aggregateOperationForViewFieldState to add a state storing
the aggregate operation for each view field
2024-12-10 18:03:38 +00:00
Thomas Trompette
b6e02b630d
Add full name composite field (#9008)
- Add composite field
- Add test
- Fix search variable dropdown scroll
<img width="548" alt="Capture d’écran 2024-12-10 à 16 52 43"
src="https://github.com/user-attachments/assets/c337f0c3-8a70-401a-abd0-7206489ba73e">
2024-12-10 16:29:55 +00:00
Weiko
96d56f8883
Fix removeBillingFKWithCore migration location (#9006)
removeBillingFKWithCore migration is in the wrong folder and is not
executed as intended.
Moving to billing folder to fix that and to be only run in billing mode
2024-12-10 16:33:52 +01:00
Lucas Bordeau
013eda4a32
Fixed dropdown bugs on 0.34 (#9000)
- New task dropdown wasn't using the proper dropdown id
- Action menu triggered by context menu (right click) on table cell was
listening in edit mode.
2024-12-10 16:01:03 +01:00
Weiko
b0595e452a
Fix add-subdomain-to-workspace command (#9005)
## Context
Fix add-subdomain-to-workspace command not included in global module
also fixing the command regex logic that was not generating subdomain
properly
2024-12-10 15:32:13 +01:00
Raphaël Bosi
90d47a8fca
Fix favorite button (#9001)
Closes #8977
2024-12-10 15:20:37 +01:00
Guillim
afd3252cbe
Settings options (#8996)
- [x] text change

![image](https://github.com/user-attachments/assets/c7304052-18ad-4870-a5ad-5ea73aedcad1)

- [x] CSS for settings cards
Current :

![image](https://github.com/user-attachments/assets/8fd9b3cc-c3df-47a0-9ccb-1a0417f076f2)
Expected :  

![image](https://github.com/user-attachments/assets/8a4e7f17-8ee8-4664-b8b0-5b2857568570)
2024-12-10 13:23:00 +00:00
Félix Malfait
0a8960c2ed
Fix broken workspace deletion (#9002)
Fixes #8985
2024-12-10 14:13:58 +01:00
Raphaël Bosi
f0dbeea704
Remove buttons for activity empty state (#8999)
Before:
<img width="482" alt="Capture d’écran 2024-12-10 à 11 17 53"
src="https://github.com/user-attachments/assets/3641e902-10b9-4fbf-8383-d6e5d5b2de79">

After:
<img width="453" alt="Capture d’écran 2024-12-10 à 11 33 01"
src="https://github.com/user-attachments/assets/9f949933-0740-4c91-abf3-2c1817a68968">
2024-12-10 11:09:40 +00:00
Raphaël Bosi
c553361f25
Fix RecordDetailSectionHeader spacing (#8997)
Before:
<img width="339" alt="Capture d’écran 2024-12-10 à 11 02 30"
src="https://github.com/user-attachments/assets/4fd1d598-0efe-4ee9-931e-dd307af21c95">

After:
<img width="345" alt="Capture d’écran 2024-12-10 à 11 02 19"
src="https://github.com/user-attachments/assets/fb72a661-ac66-43c7-906c-9020171dbf3b">
2024-12-10 11:16:45 +01:00
Raphaël Bosi
d70987653b
8964 add feature flag is page header v2 enabled (#8995)
Closes #8964
2024-12-10 10:56:28 +01:00
Thomas des Francs
228b7386ea
API & Webhooks doc quick fix (#8994)
Quick fix for https://github.com/twentyhq/twenty/issues/8990
2024-12-10 10:39:38 +01:00
Pradeep Kaswan
49c3250519
update: Replace reactflow with @xyflow/react and Update Dependencies (#8940)
## Description:

This pull request includes the following changes:

1. **Dependency Update**:
   - Added `@xyflow/react` as a dependency.
- Replaced imports from `reactflow` with `@xyflow/react` in multiple
components.

2. **Dependency Removal**:
- Removed `reactflow` dependency and its related code from the project.

3. **Type Definitions Update**:
- Updated type definitions for nodes and edges to align with the new
library.

4. **Code Refactoring**:
- Minor refactoring for improved code clarity and consistency in the
following components:
     - `SettingsDataModelOverview`
     - `SettingsDataModelOverviewEffect`
     - `SettingsDataModelOverviewField`
     - `SettingsDataModelOverviewObject`

5. **Dependency Files Update**:
- Updated `package.json` and `yarn.lock` to reflect the changes in
dependencies.

## Additional Notes:
- These changes ensure that the project is now using the `@xyflow/react`
library instead of `reactflow`.
- The refactoring improves code readability and maintains consistency
across the components.
- Please review the changes and provide any feedback or suggestions.

## Testing:
- The changes have been tested locally and verified to work as expected.

## Checklist:
- [x] Added `@xyflow/react` as a dependency.
- [x] Replaced `reactflow` imports with `@xyflow/react`.
- [x] Removed `reactflow` dependency.
- [x] Updated type definitions for nodes and edges.
- [x] Refactored components for improved clarity and consistency.
- [x] Updated `package.json` and `yarn.lock`.
- [x] Tested the changes locally.

## Related Issue
Fixes #6662
2024-12-10 10:21:01 +01:00
Guillim
28ff5610f0
better label for toggle input that will improve UX (#8982)
Answering the ticket : Increase the clickable area of toggles to parent
container

# Change in Labels

In order to solve this ticket, we change the way we handle the labels VS
the inputs. The use of `htmlFor` and setting up the appropriate id for
the toggle solves the "blank click"
<img width="239" alt="Screenshot 2024-12-09 at 17 43 53"
src="https://github.com/user-attachments/assets/19eab5fc-8393-496d-b713-57e51c620bf1">

fix #8953

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-10 09:41:04 +01:00
nitin
0a61550f43
View picker minor change - favorite fast followups (#8987)
Clicking "Add to favorite" should add the record as a favorite. It
shouldn't open the menu on the first click; it should only open on the
second click when the record is already a favorite.
2024-12-10 09:39:04 +01:00
Suhotra Dey
f4ef51fbe5
Fix : Small fixes for the options menu (#8983)
Fix #8789 : fixed options menu with current view hook to fetch the view
name

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-10 09:19:46 +01:00
Emily Yu
0654d814c6
Added Button Shortcut Style Enhancements + Additional Storybook Tests (#8947)
Resolves Issue #4871 (or enhances)

**Additions**
- **Customized Styling for Button Shortcuts:** Previously, button
shortcuts/separator styling was standardized. We added customized
styling for optional button shortcuts based on button accents and
variants.
- **Enhanced Storybook Catalogs:** We modified ShortcutCatalog in
Button.stories.tsx to display button shortcuts across styles and various
inputs.

![Screenshot 2024-12-07 at 9 16
35 PM](https://github.com/user-attachments/assets/f56ec269-d5d4-45d7-b490-e5632371f9b2)
![Screenshot 2024-12-07 at 9 16
30 PM](https://github.com/user-attachments/assets/04c3b7a9-a0bb-49fc-ae30-6e488f9658dd)
![Screenshot 2024-12-07 at 9 16
22 PM](https://github.com/user-attachments/assets/a22847c2-f5da-4a10-9a0d-f07389e1751e)

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-10 08:27:11 +01:00
azaurus1
bb5cc7e30c
Update PG_DATABASE_URL to match Service name in k8s manifests (#8989)
### Issue Summary
The `service` name in the Kubernetes manifest for the PostgreSQL
database is defined as `twentycrm-db`. However, the `DSN` configuration
in the Server and Worker `deployments` incorrectly references
`twenty-db`. This mismatch causes the pods to fail during initialization
and crash on boot.

### Fix Description
- Updated the `DSN` values in both the Server and Worker `deployments`
to correctly reference `twentycrm-db`, ensuring alignment with the
database `service` name.
- Verified the deployments to ensure the pods start without issues after
the fix.

### Testing
- Deployed the updated manifests in a development environment.
- Confirmed that both Server and Worker pods initialize correctly and
connect to the database service as expected.
2024-12-10 08:21:38 +01:00
Weiko
23015de996
Add migration ci check (#8867)
Fixes #8865

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-09 17:15:24 +01:00
Guillim
310bba758b
fix (#8963)
fixing 

![image](https://github.com/user-attachments/assets/96841950-17a9-4e71-b09e-f505c40a736a)
2024-12-09 13:44:19 +00:00
nitin
8d469b9bc3
Swap dark placeholders (#8956)
closes #8853
2024-12-09 14:21:10 +01:00
Raphaël Bosi
387f5259a7
8928 refactor page header buttons (#8952)
Closes #8928 

<img width="1296" alt="Capture d’écran 2024-12-09 à 10 26 37"
src="https://github.com/user-attachments/assets/f33202b0-9c11-48da-8daa-e867d62a1803">
<img width="1296" alt="Capture d’écran 2024-12-09 à 10 26 54"
src="https://github.com/user-attachments/assets/a94f89d4-ca12-403f-bfcb-12168a82f77c">
2024-12-09 10:55:33 +01:00
nitin
ef0ae2568d
View picker dropdown position fix (#8945)
as per title
2024-12-07 18:26:41 +01:00
Lucas Bordeau
1749793bc1
More fixes (#8931)
Fixes https://github.com/twentyhq/twenty/issues/8888
2024-12-07 16:49:53 +01:00
Antoine Moreaux
2524d64687
Feat/improve error management in core module (#8933)
## Summary
This Pull Request introduces a custom validator for checking forbidden
words in workspaces and refines how exceptions are handled within the
workspace module.

- Introduced `ForbiddenWords` custom class validator for validating
forbidden words against specific fields in `UpdateWorkspaceInput`.
- Added `EnvironmentService` usage in `WorkspaceService` to check
default subdomains.
- New file `workspaceGraphqlApiExceptionHandler` to handle GraphQL API
exceptions with specific error mappings.
- Expanded `WorkspaceExceptionCode` with `SUBDOMAIN_ALREADY_TAKEN`.
- Added new unit tests for validating forbidden words and exception
handler behavior.
2024-12-07 16:48:53 +01:00
Charles Bochet
99f53a5030
Fix broken image urls in Settings > Profile and Invite To Workspace Email (#8942)
Fixes #8601

We had 3 implementations of getImageAbsoluteURI: in twenty-front, in
twenty-ui and in twenty-emails. I was able to remove the one in
twenty-front but I could not remove it from twenty-emails as this is a
standalone for now. The vision is to introduce shared utils in a
twenty-shared package
2024-12-07 14:57:32 +01:00
Charles Bochet
ab8ad46685
Fix bug reoder on table in view groups mode (#8894)
Fixes #8403 

Added comments on the PR to explain changes
2024-12-06 19:19:27 +01:00
Marie
f36555bdc0
Fix infinite loading on field settings (#8938)
We were experiencing infinite loading on field settings pages (creation
of new field), due to the fact that the component was being rendered on
and on and on.
This was due to useGetCurrentUserQuery calls outside of the update
function, causing renders in cascade. We also had an issue with the
component being unmounted too often.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-06 18:46:06 +01:00
Félix Malfait
b2be2fb398
Fix advanced settings tool icon alignment (#8935)
Followup of @bosiraphael's design

<img width="333" alt="Screenshot 2024-12-06 at 17 25 45"
src="https://github.com/user-attachments/assets/b744a7a6-99cb-4d4c-b9da-df0661536208">
<img width="614" alt="Screenshot 2024-12-06 at 17 26 19"
src="https://github.com/user-attachments/assets/e9f31fed-66b2-4ed7-a5cd-97a9bc526752">

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-12-06 18:07:37 +01:00
Antoine Moreaux
9bbb963a08
refactor(settings): nest support section within workspace (#8937)
Refactor the settings structure to include the support section within
the workspace feature when multi-workspace is enabled. This update
provides a more consistent user interface by grouping related settings,
thereby enhancing the manageability of workspace-specific actions.

Fix #8914
2024-12-06 17:58:46 +01:00
Antoine Moreaux
6285186ead
doc(tips): add tips to inform on authenticate methods settings (#8936)
Fix #8879
2024-12-06 17:54:47 +01:00
Guillim
4208bd2b83
Settings Icon CSS update (#8934)
Current :

![image](https://github.com/user-attachments/assets/985e4f1b-6379-43ee-9311-25b455d8f5c0)

Expected : 
<img width="594" alt="Screenshot 2024-12-06 at 17 01 45"
src="https://github.com/user-attachments/assets/a26a5415-ecd2-4111-a093-ae049b734925">


Design Request from @Bonapara 😸
2024-12-06 17:47:28 +01:00
Raphaël Bosi
9c67a109af
Fix SingleRecordSelectMenuItemsWithSearch (#8932)
- Fix all fields being selected when opening dropdown
- Fix not being able to set back to no selection when a record is
selected and there is only one record to select

Before:



https://github.com/user-attachments/assets/31185a05-7e1a-4550-aa2a-591683934224


After:


https://github.com/user-attachments/assets/e3cd388b-44de-42e2-970b-b4d4f31253bc
2024-12-06 17:41:58 +01:00
Thomas Trompette
e1a0259154
Split record crud actions (#8930)
Having a global record crud action adds complex logic.
We decided to split those actions. I only kept a common folder / module
in backend.

⚠️ this may break existing workflows if these were using previous
actions!
2024-12-06 16:58:57 +01:00
Raphaël Bosi
229a93e41a
Fix advanced settings icon tool and right bar alignment (#8910)
Before:
<img width="253" alt="Capture d’écran 2024-12-05 à 18 27 58"
src="https://github.com/user-attachments/assets/73f943d9-d5be-4f0c-8b65-a2c0a8420b80">


After:
<img width="233" alt="Capture d’écran 2024-12-05 à 18 27 45"
src="https://github.com/user-attachments/assets/e3992655-fd1f-4748-91e7-3f4e3a2a5fda">

Co-authored-by: Weiko <corentin@twenty.com>
2024-12-06 15:37:46 +00:00
Lucas Bordeau
a9cb20f317
Refactor and fixes dropdown bugs (#8807)
Fixes https://github.com/twentyhq/twenty/issues/8788
Fixes https://github.com/twentyhq/twenty/issues/8793
Fixes https://github.com/twentyhq/twenty/issues/8791
Fixes https://github.com/twentyhq/twenty/issues/8890
Fixes https://github.com/twentyhq/twenty/issues/8893

- [x] Also : 

Icon buttons under dropdown are visible without blur : 

![Capture d’écran du 2024-11-29
15-09-53](https://github.com/user-attachments/assets/f563333d-4e43-4ded-acc7-62e116004ed9)

- [x] Also : 

<img width="237" alt="image"
src="https://github.com/user-attachments/assets/e4c70936-beff-4481-89cb-0a32a36e0ee2">

- [x] Also : 

<img width="335" alt="image"
src="https://github.com/user-attachments/assets/5be60395-6baf-49eb-8d40-197add049e20">

- [x] Also : 

<img width="287" alt="image"
src="https://github.com/user-attachments/assets/a317561f-7986-4d70-a1c0-deee4f4e268a">

- Button create new without padding
- Container is expanding

- [x] Also : 

<img width="303" alt="image"
src="https://github.com/user-attachments/assets/09f8a27f-91db-4191-acdc-aaaeedaf6da5">

- [x] Also : 

<img width="133" alt="image"
src="https://github.com/user-attachments/assets/fe17b32e-f7a4-46c4-8040-239eaf8198e8">

Font is cut at bottom ?

- [x] Also : 

<img width="385" alt="image"
src="https://github.com/user-attachments/assets/7bab2092-2936-4112-a2ee-d32d6737e304">

The component should flip and not resize in this situation

- [x] Also : 

<img width="244" alt="image"
src="https://github.com/user-attachments/assets/5384f49a-71f9-4638-a60c-158cc8c83f81">

- [x] Also : 


![image](https://github.com/user-attachments/assets/9cd1f43a-df59-401e-9a41-bdb8e93ebe58)
2024-12-06 14:27:48 +00:00
Guillim
14b7bcf262
Fix phone not reactive (#8918)
Fixin reactivity on the multi items phone component (add/delete/edit
phones)

<img width="325" alt="Screenshot 2024-12-06 at 11 03 34"
src="https://github.com/user-attachments/assets/96ddaf82-19ae-4a09-aa45-04caad2f0af1">

---------

Co-authored-by: khuddite <khuddite@gmail.com>
Co-authored-by: Weiko <deniaud.corentin@gmail.com>
2024-12-06 14:45:14 +01:00
Antoine Moreaux
36fb14179b
feat(workspace): Add subdomain availability check (#8906)
Implemented a feature to check the availability of subdomains when
updating workspace settings. This includes a new mutation,
`isSubdomainAvailable`, to validate subdomain availability through
GraphQL. The frontend now verifies if a subdomain is available to
prevent duplicates during updates.

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-12-06 13:28:30 +00:00
Thomas Trompette
5c565345ae
Add delete record action (#8908)
<img width="1272" alt="Capture d’écran 2024-12-05 à 18 04 19"
src="https://github.com/user-attachments/assets/dcbcc761-2f6d-4b6d-9e10-0f5b25d12c39">

- Adding new action
- Adding tests
- Moving into action folder
2024-12-06 13:02:17 +01:00
Antoine Moreaux
ab22fd560a
fix(): Add default name to workspace in MultiWorkspaceDropdownButton (#8924)
Fix #8923
2024-12-06 12:23:02 +01:00
martmull
2b3b073570
8725 workflow avoid serverless function autosave errors (#8916)
See issue #8725 
- Build function asynchronously using a job
- prevent useless builds
- run promises simultaneously

Todo:
- fix outputSchema computing
2024-12-06 10:13:12 +00:00
Raphaël Bosi
a8867fd090
Remove advanced settings wrapper from security page (#8912)
Before:
Without advanced settings toggled:
<img width="1512" alt="Capture d’écran 2024-12-05 à 19 12 53"
src="https://github.com/user-attachments/assets/efe550e2-5b7f-483f-9726-254acefb2872">

With advanced settings toggled:
<img width="1512" alt="Capture d’écran 2024-12-05 à 19 13 01"
src="https://github.com/user-attachments/assets/2fab6843-5be1-4d5b-83c4-94c22c85d4d3">

After:
Without advanced settings toggled:
<img width="1512" alt="Capture d’écran 2024-12-05 à 19 12 34"
src="https://github.com/user-attachments/assets/72d87281-3822-42d7-816b-403724052678">

With advanced settings toggled:
<img width="1512" alt="Capture d’écran 2024-12-05 à 19 12 26"
src="https://github.com/user-attachments/assets/34c87be4-d528-41a8-b269-e274939a75c7">
2024-12-06 00:17:47 +01:00
Khuddite
50af41f170
Remove duplicate plus sign for phone numbers (#8871)
Fixes #8838 

1. Summary
It seems [this PR](https://github.com/twentyhq/twenty/pull/8614) caused
the issue. We added a plus sign on front-end when the
[callingCode](c735026f6c/packages/twenty-front/src/modules/ui/field/display/components/PhonesDisplay.tsx (L70))
retrieved from back-end already has a plus sign.

2. Solution
@guillim Please let me know if I missed a case where the plus sign is
not there for the `callingCode`. If so, I think we should check whether
or not `callingCode` has a leading plus sign on front-end before adding
it. For now, I just removed the code that appends a plus sign on
front-end.

3. Screenshots

![localhost_3001_objects_people_view=f4aee583-9d0c-4961-a6e1-fd66bc51dfd5](https://github.com/user-attachments/assets/9fe8b361-47b9-4e3f-82b7-570713cf430c)

---------

Co-authored-by: guillim <guigloo@msn.com>
Co-authored-by: Guillim <guillim@users.noreply.github.com>
Co-authored-by: Weiko <deniaud.corentin@gmail.com>
2024-12-05 22:41:14 +01:00
Guillim
4623b6127b
Dropdown in dropdown (#8911)
Dropdown in dropdown bug
while still fixing scroll issue 
fix #8716
2024-12-05 19:07:19 +01:00
eliasylonen
f60ce384c6
CSV importing and exporting fixes (#8824)
Fixes issue https://github.com/twentyhq/twenty/issues/5793 (and
duplicate https://github.com/twentyhq/twenty/issues/8822)

- Fix importing multi-select and array fields.
- Fix exporting and importing RAW_JSON fields.

---------

Co-authored-by: ad-elias <elias@autodiligence.com>
2024-12-05 18:44:53 +01:00
Weiko
815e5dfa16
Fix migration folder (#8909)
## Context
Common migrations now live in a different directory however the PR that
added that behavior was not up to date with the few migrations that were
merged recently.

This PR moves the migrations to the correct folder so they can be
executed properly.

## Test
reset-db

Before
<img width="1505" alt="Screenshot 2024-12-05 at 18 14 13"
src="https://github.com/user-attachments/assets/6cabf094-805a-4101-aeb2-3678497c2947">
After
<img width="1200" alt="Screenshot 2024-12-05 at 18 15 40"
src="https://github.com/user-attachments/assets/3ae59af5-d615-48e0-bfde-9467770acc27">
2024-12-05 18:19:22 +01:00
Raphaël Bosi
c23896c5dc
Fix dropdown overflow (#8907)
Fixes:
<img width="267" alt="Capture d’écran 2024-12-03 à 14 59 24"
src="https://github.com/user-attachments/assets/73278208-25d2-4225-a632-eb37cc69fcd6">
2024-12-05 18:12:59 +01:00
Raphaël Bosi
de56c01206
8733 refactor gmailhandleerrorservice (#8901)
Closes #8733 
- Refactor `GmailHandleErrorService`
- Add tests and mocks for the errors
2024-12-05 17:57:57 +01:00
Antoine Moreaux
680366e998
fix(): validate subdomain (#8902)
Fix #8876
2024-12-05 17:30:23 +01:00
Antoine Moreaux
f4c5d03b98
fix(): redirect loop + signout (#8899) 2024-12-05 16:24:24 +01:00
Ana Sofia Marin Alexandre
11d244194f
Add billing tables (#8772)
Beforehand, the name of the branch is not representative of the work
that has been done in this PR

**TLDR:**

Solves https://github.com/twentyhq/private-issues/issues/192
Add 3 tables BillingCustomer, BillingProduct and BillingPrice and
BillingMeter to core, inspired by the Stripe implementation. Separates
migration, between common and billing on order to not populate the db of
the self-hosting instances with unused tables.

**In order to test:**

Run the command:
npx nx typeorm -- migration:run -d
src/database/typeorm/core/core.datasource.ts


**Considerations:**

I only put the information we should use right now in the Billing
module, for instance columns like meter or agreggation formula where
omitted in the creation of the tables.
These columns and other ones who fall on the same spectrum will be added
as we need them.

If you want to add more information to the table, I'll leave some
utility links down bellow:

- BillingPrices: https://docs.stripe.com/api/prices/object
- BillingCustomer: https://docs.stripe.com/api/customers/object
- BillingProduct:  https://docs.stripe.com/api/products/object

**Next Steps**

Use the Stripe Webhook in order to update the tables accordingly

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-05 16:17:35 +01:00
Weiko
c993f2de0b
Fix user email unique constraint (#8898)
## Context
Fix wrong unique index on user email as we don't want an index on
email/deletedAt but a partial on a where condition on deletedAt. This
should enforce email unicity excluding the ones that have a deletedAt

## Test
Run
```sql
SELECT email, COUNT(*) as duplicate_count
FROM core."user"
WHERE "deletedAt" IS NULL
GROUP BY email
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
```
to check duplicates before running the migration
2024-12-05 15:54:12 +01:00
Marie
26ff344f56
Refetch aggregate queries on record creation/update/deletion of record (#8885)
Closes #8755.
Refetching the aggregate queries on an object following creation,
update, deletion of a record.
2024-12-05 15:23:54 +01:00
Guillim
9ed9b4746a
Settings Form Select refacto (#8875)
fixes #8751
2024-12-05 13:44:24 +00:00
Guillim
6c78cac908
Fix wrapping text side effects (#8895)
- ellipsis on the letter level instead of work level
- summaryCard title line-height diffferent from the record line-height
2024-12-05 14:43:16 +01:00