Commit Graph

4789 Commits

Author SHA1 Message Date
cd2946b670 refacto(*): remove everything about default workspace (#9157)
## Summary
- [x] Remove defaultWorkspace in user
- [x] Remove all occurrence of defaultWorkspace and defaultWorkspaceId
- [x] Improve activate workspace flow
- [x] Improve security on social login
- [x] Add `ImpersonateGuard`
- [x] Allow to use impersonation with couple `User/Workspace`
- [x] Prevent unexpected reload on activate workspace
- [x] Scope login token with workspaceId 

Fix https://github.com/twentyhq/twenty/issues/9033#event-15714863042
2024-12-24 11:47:41 +00:00
fe6948ba0b fix: settings form select menu (#9179)
Closes: #8647 
Closes: #8649 

**Changes & Why**

1. Added a Search Input to `SettingsDataModelFieldAddressForm` &
`SettingsDataModelFieldCurrencyForm` as `Select` component already
accepts it as a prop.
2. Gave a fixed width to the dropdown of both the above components to
ensure it doesn't shrink on search for the menu items with low word
count.
3. Added countries Flag to `SettingsDataModelFieldAddressForm`. 
4. Replaced `MenuItem` with `MenuItemSelect` to get the desired
highlighted background for the selected item with `IconCheck` to
differentiate the current selected item. This is useful across all the
select components throughout the app.
5. I realized that in some components we might not need IconCheck and
only need a highlighted background for the selected item. For ex:
`SettingsDataModelFieldBooleanForm` . Therefore, I created a prop
`needIconCheck` with default as true so it doesn't break the existing
`MenuItemSelect` and we can pass that prop as false wherever needed.

[Screencast from 2024-12-21
12-08-08.webm](https://github.com/user-attachments/assets/4f8070a8-f339-4556-a137-bbbad58b171c)
2024-12-24 12:24:40 +01:00
801bf7c016 quick fix for positionInViewFilterGroup (#9223)
fix 9206

In the future, we should have a look at the column naming
"positionInViewFilterGroup"
because it breaks the SQL queries in `record-position-query.factory.ts`
for viewFilter tablenames
2024-12-24 10:49:50 +00:00
b52c23bb66 feat(database): Add trigger to set impersonation on first user (#9195)
Introduced a trigger to automatically set `canImpersonate` to true for
the first user inserted into the `core.user` table. The trigger is
removed after the first user is added to ensure this behavior only
applies to the initial user. Includes both the creation and rollback
logic for the migration.

Close https://github.com/twentyhq/twenty/issues/9173
2024-12-24 09:52:57 +01:00
86d74724fb Current workspace member filter (#8016) (#9182)
New branch based on feedback in PR #8950 and issue #8016

---------

Co-authored-by: ad-elias <elias@autodiligence.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-12-23 18:55:13 +01:00
49da7d2ca0 Tablist fix (#9216) 2024-12-23 17:31:04 +01:00
b3c1f62a5f collapsed navigationDrawerItem width fix (#9211)
Before: 

<img width="81" alt="Screenshot 2024-12-23 at 9 25 25 PM"
src="https://github.com/user-attachments/assets/d4c07ed5-0953-422f-aabf-fa2ca10ba7e5"
/>

After: 

<img width="76" alt="Screenshot 2024-12-23 at 9 25 11 PM"
src="https://github.com/user-attachments/assets/1ea6d64e-8c1f-4d0c-9b34-f8dceae9538d"
/>
2024-12-23 17:04:29 +01:00
74cf00a36d Fixed dragging with empty orphan favorites (#9205)
Created a resizable container tied to dragging state to create suitable
droppable zone when there's no orphan favorites.

Co-authored-by: Weiko <corentin@twenty.com>
2024-12-23 15:57:09 +01:00
3eff317b59 Remove favorite folder related feature flags (#9178)
Co-authored-by: Weiko <corentin@twenty.com>
2024-12-23 15:56:56 +01:00
061c92069f Fix position calculations -- favorites (#9202)
Co-authored-by: Weiko <corentin@twenty.com>
2024-12-23 14:45:01 +00:00
691fbbe576 Fix show page navigation bugs (#9199)
Fixes total count bug that was -1 the total count
Fixes a bug when trying to go from first to last or the other way around
Fixes a React array key bug

Follow-up issue (non critical) :
https://github.com/twentyhq/twenty/issues/9197
2024-12-23 14:24:15 +01:00
6abe735cad Fix optimistic rendering when deleting multiple records (#9198)
Fixes
https://discord.com/channels/1130383047699738754/1319676302944370730/1319676302944370730
2024-12-23 14:19:25 +01:00
c947040137 Revert "Fix "Create profile" page not supporting dark mode (#8110)" (#9201)
Reverts twentyhq/twenty#9185
This PR breaks sync-metadata, will merge back after 0.35
2024-12-23 14:11:41 +01:00
ee0282bcc8 refacto(auth): Simplify workspace lookup and cleanup UI logic (#9160)
Streamlined workspace selection by defaulting to the first available
workspace. Adjusted conditional rendering for a separator between
authentication providers, improving clarity and reducing redundancy.
Minor formatting changes were also applied for consistency.

Close #9094
2024-12-23 13:17:00 +01:00
164f010501 Use uuid package instead of crypto package (#9191)
Fixes #9186
2024-12-23 12:04:15 +01:00
80bc38fc96 update upgrade guide for 0.35 (#9190) 2024-12-23 11:39:19 +01:00
093f627e1d fix(auth): adjust button variant based on sign-in-up step (#9188)
Update the button variant to dynamically switch between 'secondary' and
'primary' based on the current step in the sign-in-up flow. Ensures the
UI reflects the correct state, improving user experience and
consistency.
2024-12-23 11:30:36 +01:00
7d57d61f47 Fix "Create profile" page not supporting dark mode (#8110) (#9185)
Fixes issue #8110

Co-authored-by: ad-elias <elias@autodiligence.com>
2024-12-23 11:06:10 +01:00
f71527bf6d Fixes before 0-35 release (#9176)
Co-authored-by: Weiko <corentin@twenty.com>
2024-12-23 10:56:25 +01:00
2651379ccc Add automatic company logo fetching during workspace creation (#9158)
Closes #9151 

## Description
This PR automatically sets a workspace's logo based on the user's work
email domain during signup. When a user creates a new workspace using
their work email (e.g., @airbnb.com), the system will fetch and set
their company logo from twenty-icons.com as the default workspace logo.

## Implementation Details
- Added a new `CompanyEnrichmentService` to handle company-related data
enrichment
- Created a modular architecture that supports future enrichment
features (e.g., company name, details)
- Integrated with existing work email detection
- Maintains user ability to override the logo later

## Testing

https://github.com/user-attachments/assets/f7855c99-462a-4053-9e52-29649e954275


I tested the following scenarios:
- Signing up with a work email (e.g., @company.com) → Logo is
automatically set
- Signing up with a personal email (e.g., @gmail.com) → No logo is set
- User can still upload a custom logo after automatic setting

## Technical Notes
- Uses existing `isWorkEmail` utility
- Structured for future extensibility (additional company data
enrichment)
- No breaking changes to existing functionality

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-22 09:24:27 +01:00
03f89791b6 Add upgrade 0.35 command module (#9175)
Moving commands from 0.40 to 0.35 since they should be ready for 0.35.
2024-12-20 18:18:56 +01:00
c992be1694 Workspace logo is not visible (#9174)
Fixing "Workspace logo is not visible in the navbar" report issue from
@Weiko
2024-12-20 18:15:02 +01:00
8f3fbeccb1 wrote 0.35 changelog (#9171)
Favorites
2024-12-20 16:48:18 +01:00
1eee99cfd6 Don't register delete multiple records action when deleted filter is active (#9170)
Don't register delete multiple records action when deleted filter is
active
2024-12-20 15:49:55 +01:00
928c99a725 Phone country fix (#9167) 2024-12-20 15:28:17 +01:00
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
f65a90d137 minor fix -- datamodel multiselect edit form dropdowns (#9168)
made sure dropdown gets unique ids.
2024-12-20 14:17:13 +01:00
52362812a5 Catch workspace issues in backfill upgrade commands 2024-12-20 12:11:05 +01:00
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
f499c728fd Fix activity editor (#9165) 2024-12-20 11:52:00 +01:00
0d2bfad3c9 Separate date and datetime components (#9161)
Add a 2 components solution for FormDate and FormDateTime
2024-12-20 10:50:30 +00:00
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
1acf845101 9018 fix batch delete follow ups (#9166)
Follow ups on #9018
2024-12-20 11:41:09 +01:00
2437572a5c Fix discard draft optimistic rendering (#9153)
Remove draft workflow version from cached workflow
2024-12-20 11:36:47 +01:00
925294675c 9018 fix batch delete (#9149)
Closes #9018
2024-12-20 10:46:24 +01:00
a0b5720831 Fix modals being unregistered inside command menu (#9155)
Fix modals being unregistered inside command menu
2024-12-20 10:45:22 +01:00
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
94136d953e 8749 invalid openapi schema (#9156) 2024-12-20 09:56:22 +01:00
ded0a68b89 Fix tests 2024-12-19 17:49:29 +01:00
811002d8b9 Github CI workflow fix (#9137) 2024-12-19 17:01:58 +01:00
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
360c34fd18 Phone country code unique (#9035)
fix #8775
2024-12-19 16:42:18 +01:00
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
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
7d8f895ae9 fix test (#9147) 2024-12-19 15:24:49 +01:00
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
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
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
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
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