Commit Graph

4706 Commits

Author SHA1 Message Date
Thomas Trompette
f0de1ab245
Add Multiselect for forms (#9092)
- Add new FormMultiSelectField component
- Factorize existing display / input into new ui components
- Update the variable resolver to handle arrays properly

<img width="526" alt="Capture d’écran 2024-12-17 à 11 46 38"
src="https://github.com/user-attachments/assets/6d37b513-8caa-43d0-a27e-ab55dac21f6d"
/>
2024-12-17 14:41:55 +01:00
BOHEUS
c754585e47
Basic test verifying if demo account is working properly (#8442) 2024-12-17 13:56:00 +01:00
Charles Bochet
8bb699cbc2
Fix cursor generation buffer dependency in front (#9101)
Buffer is part of nodejs API and is not recognized by front js runner.
buffer library (already installed) is providing a polyfill for that
2024-12-17 13:42:41 +01:00
nitin
582530ef1e
Favorites Drag and Drop Implementation (#8979)
Adds drag and drop functionality for favorites management, allowing
users to:

- Move favorites between folders
- Move favorites from folders to orphan section
- Move orphan favorites into folders

Known Issues:
Drop detection at folder boundaries requires spacing workaround
2024-12-17 12:46:58 +01:00
Charles Bochet
4fe3250e81
Fix re render view groups (#9098)
Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-12-17 12:29:10 +01:00
nitin
c63842925f
Favorites Folders Fast Followups (#8920)
Fixes :
<img width="716" alt="Screenshot 2024-12-06 at 3 45 41 PM"
src="https://github.com/user-attachments/assets/61fdf355-0d0a-4ed7-befa-ada23341a58f">

Fixes: Reduce menu width to 160px and it should appear below three dots
<img width="394" alt="Screenshot 2024-12-06 at 3 46 49 PM"
src="https://github.com/user-attachments/assets/b1266f83-9b6f-445b-9409-d7f691776bd0">

Fixes: The right margin should be 2px
<img width="1134" alt="Screenshot 2024-12-06 at 3 47 45 PM"
src="https://github.com/user-attachments/assets/b6dd857c-6575-418d-8e32-64cd4e5d4e85">

Fixes:
Requirement: Clicking the heart Icon should put the record as favorite.
It shouldn't open the menu on first click. It should only on second
click, when the record is already a favorite.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-17 12:15:36 +01:00
nitin
ac2894c87c
Fixed Custom Icon Persistance Across New View Creations (#9070)
closes #8714
2024-12-17 16:42:34 +05:30
Jérémy M
1f4d1358a1
fix: add create cursor util (#9086)
Followup of #9053
2024-12-17 12:05:55 +01:00
Jérémy M
1851bb8476
feat: hide empty record group default true (#9090)
Fix #8969 

Previously we were putting hide default record group to `false` in
record group mode.
Also the mode was saved in the current view by changing the visibility
boolean of each record group.
As we want to hide by default, this PR instead is using a different
logic so it's totally based on the front-end side.
2024-12-17 11:54:41 +01:00
Baptiste Devessier
5bd73e0df1
Add date form field (#9021)
- Add an option to hide the input from the
`packages/twenty-front/src/modules/ui/input/components/internal/date/components/AbsoluteDatePickerHeader.tsx`
component
- Create a form field for dates
  - Integrate the picker
- Create an input **without a mask** to let the user types a date and
validate it by pressing the Enter key
- Extract some utils to parse and format dates
2024-12-17 11:11:19 +01:00
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