Commit Graph

4735 Commits

Author SHA1 Message Date
Weiko
0a0be421d7 Merge branch 'main' into c--fix-block-editor-changed-content 2024-12-18 17:51:21 +01: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
martmull
e492efb79e
Remove serverless functions from settings (#9105)
closes https://github.com/twentyhq/twenty/issues/8727

@Bonapara wants to keep the code for now so I ended up by setting the
`isFunctionSettingsEnabled` constants to false in the codebase
2024-12-17 17:57:17 +01:00
Raphaël Bosi
b033a50d7c
8978 add navigation inside the command menu for showpage (#9103)
Closes #8978

- Added new options in the actions config files: `shortLabel`,
`availableOn`
- Added two actions: Navigate to previous records and Navigate to next
records
- Modified `useRecordShowPagePagination` to loop on records when we are
on first record and we hit previous or when we are on last record and we
hit next
- Introduced a new component state
`contextStoreCurrentViewTypeComponentState`
2024-12-17 16:48:12 +00:00
Weiko
e7882a6857 fix 2024-12-17 17:45:29 +01:00
Charles Bochet
bb8c763f9c Fix broken main post fix 2024-12-17 17:10:51 +01:00
nitin
edff53f5b8
fix - add new button on opportunity board company picker doesnt work (#8488)
Closes https://github.com/twentyhq/twenty/issues/8455


https://github.com/user-attachments/assets/fec269b9-abb4-47e4-811e-fa23b69ca040

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-17 17:09:11 +01:00
Baptiste Devessier
f05a217f62
Add some tests to the variable resolver to ensure static JSON is properly evaluated (#9104) 2024-12-17 17:02:16 +01:00
Charles Bochet
d0f7270c28 Fix twenty-front to take twenty-shared into account 2024-12-17 16:07:03 +01:00
Weiko
3c0c1722ff Replace block editor on page change 2024-12-17 16:01:22 +01:00
Charles Bochet
e0dfa9519a Fix Dockerfile twenty to take twenty-shared into account 2024-12-17 15:42:36 +01:00
Lucas Bordeau
860dec3428
Fixed dropdown blur and unified components (#9062)
- Removed disableBlur property from dropdown because it is no longer
needed since there's only one OverlayContainer component so there can be
only one blur at a time.
- Removed blur CSS properties from every component that used it because
one standalone OverlayContainer is able to handle all cases if placed
properly.
- Also removed disableBackgroundBlur property from SingleRecordSelect
- Removed FieldInputOverlay and FieldTextAreaOverlay components that
were a first attempt to create something like an OverlayContainer
- Used new unified OverlayContainer in RecordInlineCell and
RecordTableCell
- Fixed ScrollWrapper so that it works well both for dropdown with non
overflowing content and dropdown with overflowing content.
- Removed export default value on SearchVariablesDropdown as it is not
used in this codebase
- Refactored SearchVariablesDropdown function as component anti-pattern
- Refactored SearchVariablesDropdownFieldItems UI problems with
separator and missing ScrollWrapper behavior
- Refactored SearchVariablesDropdownObjectItems with UI problems with
separator and missing ScrollWrapper behavior
- Fixed blur bug on Firefox due to wrong placement of the element that
had the CSS property. Blur works on Firefox it it's on the container
that has the highest level in the tree.
- Fixed bug in ActivityTargetInlineCell by removing an unnecessary
container component StyledSelectContainer
- Unified problems of field height with a new common component
FieldInputContainer, instead of putting width and height at the wrong
abstraction level, width and height are a field's concern not a
dropdown, overlay or low-level input concern.
- Fixed block editor dropdown with new OverlayContainer
- Aligning field dropdown with their anchor on inline and table cells,
there are still many small pixel misalignments that give a low quality
impression.
- Fixed FormDateFieldInput that was missing OverlayContainer
2024-12-17 14:28:26 +00:00
khuddite
4aabe9e224
Fix pricing modal being cut off and unscrollabel on low resolution screens or when zoomed in (#8848)
Fixes: #7999

1. Summary
I am not 100% sure why it's happening, but it seems `justify-content:
center` conflicts with `overflow-y: auto` and that's why the modal
content becomes unscrollable and cut off.

2. Solution
To preserve the styling that centers the content inside the modal even
when the content height is less than the modal, I moved
`justify-content: center` from the content to the modal container. When
the content overflows the modal, it seems `justify-content: center` does
nothing, though.

3. Screen Recording


https://github.com/user-attachments/assets/17d8ddbd-7fe8-46ce-b8d0-82d817ee7025

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-17 14:51:27 +01:00
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