Commit Graph

1078 Commits

Author SHA1 Message Date
martmull
64cc6ecc3b
Fix relation field type (#4992) 2024-04-17 14:56:27 +02:00
Zoltán Völcsey
cf50391b00
fix: Display hidden columns and separator conditionally (#4982)
Closes #4979 

Hi! `RecordTableHeaderPlusButtonContent.tsx` component displays hidden
columns and separator, only if length of `hiddenTableColumns` array is
greater than zero.

The top right corner looked good.

![add-field1](https://github.com/twentyhq/twenty/assets/41576384/0b75ce42-d524-42ba-a76d-66c3d15d523e)

![add-field2](https://github.com/twentyhq/twenty/assets/41576384/44cf3910-2f99-4e99-8130-5cafa58c5828)

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-17 14:51:57 +02:00
bosiraphael
3024e04a1c
4971 add issyncenabled toggle in messaging settings (#4995)
- Closes #4971
- Fix calendar import to take isSyncEnabled into account
2024-04-17 13:35:23 +02:00
Charles Bochet
67db7d85c0
Proposal Date picker overflow (#4996)
Unfortunately, it is not possible in CSS to have an overflow:visible
over x-axis while having an overflow:hidden over y-axis, leading to the
following issue:

<img width="1512" alt="image"
src="https://github.com/twentyhq/twenty/assets/12035771/9b84cbbb-c6c4-4fd6-a630-a24f01eccf73">

I'm refactoring the RecordInlineCell and RecordTableCell to use
useFloating + createPortal to open the cell.
2024-04-17 11:35:45 +02:00
Ashutosh Gupta
340af9a244
fix: Auto Reset Opportunity Creation Search Field (#4951)
## Description

In the previous implementation, we saved the user's search field input.
However, I have introduced a new prop called `clearOnOpen`, which allows
us to reset the search field upon loading.

Closes: #4923 



https://github.com/twentyhq/twenty/assets/95065270/dd2cab30-ea47-444e-b356-d5c98087bcc6

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-17 11:31:33 +02:00
Weiko
6211f84de8
block invite link if workspace subscription is not active (#4991)
Fixes https://github.com/twentyhq/twenty/issues/4980

## Test
tested locally with incomplete and active
2024-04-17 10:55:47 +02:00
Thomas Trompette
6fa2aee624
Introduce remote table entity (#4994)
We will require remote table entity to map distant table name and local
foreign table name.
Introducing the entity:
- new source of truth to know if a table is sync or not
- created synchronously at the same time as metadata and foreign table

Adding a few more changes:
- exception rather than errors so the user can see these
- `pluralize` library that will allow to stop adding `Remote` suffix on
names

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-17 10:52:10 +02:00
Marie
17422b7690
fix: I should be able to use "enter" key to create profile (#4978)
## Context
Fixes #4808 

TL;DR
Introducing pure stateless modal component ("UI modal") for our auth
modal not to have default hotkeyScope overriding our create-profile
hotkeyScope
+ we dont want the shortcut to be available for all the modal content, only for the input that should not be using a hotkeyscope, so we are using onKeyDown for the specific issue on create profile.

Explanation
create-profile hotkey scope is set by PageChangeEffect; CreateProfile
component adds enter key shortcut; but this scope is overwritten by the
default scope by the Modal component that expects a hotkeyScope to reset
to (and defaults to the default hotkeyScope if none indicated).
In the auth flow we were using that Modal component to give a modal look
to the flow but it is not a modal per say, it's a set of pages contained
within a modal look.
By creating this UI component we are escaping that hotkeyScope
overriding that does not make sense in our context.

## How was it tested
Locally
Storybook
2024-04-17 10:45:02 +02:00
Ady Beraud
5ecc4ad378
Modify UI website and fix navbar issue on small devices (#4961)
-Fixed scroll issue on navbar:


https://github.com/twentyhq/twenty/assets/102751374/19f609f0-637d-483f-a695-f4a276155f2c

-Modified various UI elements, including design and layout adjustments
Example: 
**Before:**

<img width="279" alt="Screenshot 2024-04-14 at 18 45 04"
src="https://github.com/twentyhq/twenty/assets/102751374/c0f58aa6-440b-475a-bc85-69fef564f693">

**After:** 
<img width="312" alt="Screenshot 2024-04-14 at 18 45 17"
src="https://github.com/twentyhq/twenty/assets/102751374/2da4c2e8-e482-4d36-b6dc-02a51dde1950">

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
2024-04-17 10:18:18 +02:00
Weiko
2efc794b43
[messaging] Add message deletion during partial sync (#4972)
## Context

- Rename remaining V2 services.
- Delete messages in DB when gmail history tells us they've been
deleted. I removed the logic where we store those in a cache since it's
a bit overkill because we don't need to query gmail and can use those
ids directly. The strategy is to delete the message channel message
association of the current channel, not the message or the thread since
they can still be linked to other channels. However, we will need to
call the threadCleaner service on the workspace to remove orphan
threads/non-associated messages.

Note: deletion for full-sync is a bit tricky because we need the full
list of message ids to compare with the DB and make sure we don't
over-delete. Currently, to keep memory, we don't have a variable that
holds all ids as we flush it after each page. Easier solution would be
to wipe everything before each full sync but it's probably not great for
the user experience if they are currently manipulating messages since
full-sync can happen without a user intervention (if a partial sync
fails due to historyId being invalidated by google for some reason)
2024-04-16 17:18:06 +02:00
Lucas Bordeau
19a3be7b1b
Date picker for Date and DateTime field input (#4981)
- Implemented correct mask for Date and DateTime field in
InternalDatePicker
- Use only keyDown event and click outside in InternalDatePicker and
DateInput
- Refactored InternalDatePicker UI to have month and year displayed
- Fixed bug and synchronized date value between the different inputs
that can change it

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
2024-04-16 16:58:08 +02:00
bosiraphael
d63937ec6f
4988 dont import emails with ics attachments (#4990)
- Closes #4988 
- Fix parenthesis error in filter
2024-04-16 15:45:31 +02:00
Weiko
4bf23780a1
[calendar/messaging] fix google refresh token transaction (#4989)
## Context
The full-sync job was enqueued within a transaction, which means it
could be executed before the transaction was commit and
connected-account was not created yet.
This PR re-arrange the code a bit to avoid this

cc @bosiraphael thx for flagging this!
2024-04-16 15:06:37 +02:00
Weiko
cd6ed867be
fix google oauth guard (#4987)
## Context
Recent PR introduced a verifyTransientToken inside the
GoogleAPIsProviderEnabledGuard guard. This is used to extract the
workspaceId from the token. This is working fine for the first call sent
to google however the callback is calling the same guard which is
causing an issue because the transientToken is missing from the
callback.
Imho, the same guard shouldn't be used by the callback but for the time
being I'm adding a check to prevent using feature flag when
transientToken is absent. In fact, it is present in the request but not
in the same key. Because the scope is only relevant for the first call,
I'm simply adding a check there.
2024-04-16 12:47:59 +02:00
Weiko
0376a9b38f
[calendar] enabled calendar scope if feature flag enabled (#4984)
## Context
Currently the calendar scope is bound to an env variable. We want to
rollout this feature to some users so this PR adds a check on the
existing IS_CALENDAR_ENABLED flag
2024-04-16 11:07:37 +02:00
Thomas des Francs
30d91f3427
Removed Remote Objects from 0.10 changelog (#4983)
Will be announced later
2024-04-16 09:45:18 +02:00
martmull
0ad9e94318
Fix google account login (#4969)
- Fixes Google account login 
- Fixes security issue
2024-04-15 20:08:19 +02:00
martmull
1c3775e4a0
Fix Never api key expiration dates (#4965)
closes #4714 

We cannot set null expiration dates for api keys. So we will set to 100
years instead of null. If apiKey expires in more that 10 years, it is
displayed as "Never expires"
2024-04-15 20:05:59 +02:00
bosiraphael
691454ef3b
4745 move common logic between messaging and calendar in packagestwenty serversrcmodulesconnected account (#4962)
Closes #4745
2024-04-15 18:10:12 +02:00
bosiraphael
d7d9f0c16b
Fix ParticipantChip and stories imports (#4974)
- Fix ParticipantChip
- Fix stories imports after some component have been moved to twenty UI
2024-04-15 18:09:05 +02:00
Weiko
db2935b877
[message-queue] Add job auto-removal (#4973)
## Context

With the addition of cronjobs, the app is building a lot of jobs and
stores them indefinitely. There is no real point to keep all of them in
the queue once they have been processed (completed or failed) so we are
adding a new default option to the bull-mq driver

## Implementation
See bull-mq JobsOption doc
```typescript
    /**
     * If true, removes the job when it successfully completes
     * When given a number, it specifies the maximum amount of
     * jobs to keep, or you can provide an object specifying max
     * age and/or count to keep. It overrides whatever setting is used in the worker.
     * Default behavior is to keep the job in the completed set.
     */
    removeOnComplete?: boolean | number | KeepJobs;
    /**
     * If true, removes the job when it fails after all attempts.
     * When given a number, it specifies the maximum amount of
     * jobs to keep, or you can provide an object specifying max
     * age and/or count to keep. It overrides whatever setting is used in the worker.
     * Default behavior is to keep the job in the failed set.
     */
    removeOnFail?: boolean | number | KeepJobs;
```

removeOnFail should be a bit higher since they are the ones we are most
likely looking at when needed.
2024-04-15 17:33:27 +02:00
bosiraphael
11d928baa3
Seed calendar events (#4967)
Added seeds for: 
- `calendar-event-participants`
- `calendar-channel`
- `calendar-channel-event-association`
2024-04-15 15:47:23 +02:00
bosiraphael
764a3ebfde
4501 improve filters for emails imports (#4966)
- Reduce gmailSearchFilterNonPersonalEmails to the essential
- Filter out promotions, social media and forums emails
2024-04-15 15:45:38 +02:00
Emad
42e50cb818
fix: record object chip background color when idle (not hovered) (#4662)
Fixes #4651 


https://github.com/twentyhq/twenty/assets/50639499/c4b604a1-4e73-422a-bc13-a2764f564a75

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-04-15 15:40:27 +02:00
Félix Malfait
9d992143ff
Improve phone input display (#4968)
Small UI improvements to border / display on phone input field
2024-04-15 15:31:22 +02:00
Zoltán Völcsey
5477665e5d
feat: Improved Page and History names (#4908)
Improved page and history names. 
Closes #4684 

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-04-15 14:40:30 +02:00
Thomas Trompette
756de8a31b
Add connection failed status (#4939)
1/ When the user inputs wrong connection informations, we do not inform
him. He will only see that no tables are available.
We will display a connection failed status if an error is raised testing
the connection

2/ If the connection fails, it should still be possible to delete the
server. Today, since we try first to delete the tables, the connection
failure throws an error that will prevent server deletion. Using the
foreign tables instead of calling the distant DB.

3/ Redirect to connection show page instead of connection list after
creation

4/ Today, foreign tables are fetched without the server name. This is a
mistake because we need to know which foreign table is linked with which
server. Updating the associated query.

<img width="632" alt="Capture d’écran 2024-04-12 à 10 52 49"
src="https://github.com/twentyhq/twenty/assets/22936103/9e8406b8-75d0-494c-ac1f-5e9fa7100f5c">

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-15 14:09:01 +02:00
Aditya Pimpalkar
3e65fbd3d5
bug: update revokedAt on PKCE flow (#4918)
The authorization token has an expiry of 5 minutes, we already have
checks in place to verify this and throw a Forbidden exception. We need
to revoke the token once it's used otherwise it could be used multiple
times to gain access to tokens till it expires.
2024-04-15 12:49:05 +02:00
Thaïs
56b7c84116
chore: add incremental typecheck to twenty-ui (#4947)
Part of #4766
2024-04-15 12:15:29 +02:00
Quentin G
96bd5f1803
feat: add sourcemap generation for front (#4949)
This PR changes the vite config to enable the generation of sourcemaps
with the help of an Env.
It also adds a new script to run the build with the said env as well as
more memory (the dafault 2go leads to an OOM)
2024-04-15 12:12:59 +02:00
Thaïs
b6d0b8a895
refactor: move Checkmark, Avatar, Chip and Tooltip to twenty-ui (#4946)
Split from https://github.com/twentyhq/twenty/pull/4518

Part of #4766
2024-04-15 12:05:06 +02:00
Félix Malfait
acc2092b95
Disable audit logs on WorkspaceMember (#4960)
Having audit logs on workspace member causes a conflict on column name
2024-04-14 11:49:20 +02:00
Félix Malfait
9aa24ed803
Compile with swc on twenty-server (#4863)
Experiment using swc instead of tsc (as we did the switch on
twenty-front)

It's **much** faster (at least 5x) but has stricter requirements.
I fixed the build but there's still an error while starting the server,
opening this PR for discussion.

Checkout the branch and try `nx build:swc twenty-server`

Read: https://docs.nestjs.com/recipes/swc#common-pitfalls
2024-04-14 09:09:51 +02:00
gitstart-app[bot]
efcb5dc6d4
New Datetime field picker (#4907)
### Description
New Datetime field picker

### Refs
https://github.com/twentyhq/twenty/issues/4376

### Demo


https://github.com/twentyhq/twenty/assets/140154534/32656323-972c-413a-9986-a78efffae1b4


Fixes #4376

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-13 19:07:51 +02:00
Thomas des Francs
464a2d5998
add 0.10 Changelog Updates (#4945)
![CleanShot 2024-04-12 at 17 38
01@2x](https://github.com/twentyhq/twenty/assets/19412894/09803b55-8e8b-456e-8235-0cd77a163da3)
![CleanShot 2024-04-12 at 17 38
21@2x](https://github.com/twentyhq/twenty/assets/19412894/b171f8e2-b786-4a41-8669-146fd2a26b6e)
![CleanShot 2024-04-12 at 17 38
36@2x](https://github.com/twentyhq/twenty/assets/19412894/5cc79c44-ff4d-43f3-992e-bc1dce9ec83a)
![CleanShot 2024-04-12 at 17 38
56@2x](https://github.com/twentyhq/twenty/assets/19412894/36721bd8-b082-40aa-ac59-2cf496499cfd)
2024-04-13 18:43:53 +02:00
martmull
7799d0efd8
Fix Google Login Invitation link (#4942)
close #4925

Before, for google-auth, if the user exists, we would simply returns a
login token, without checking the InvitationLink
Now, we just call the `authService.signUp` function that handle all
use-cases for us (user exists or not, invitationLink exists or not)
2024-04-12 17:22:38 +02:00
Thaïs
9f83cc1426
refactor: move @/ui/display/icon to twenty-ui (#4820)
Split from https://github.com/twentyhq/twenty/pull/4518

Part of https://github.com/twentyhq/twenty/issues/4766
2024-04-12 15:30:48 +02:00
Jeet Chawda
280229bad6
Added isAuditLogged column to object-metadata-entity (#4898)
Added isAuditLogged column to object-metadata-entity.ts

This is my first open source pull request. Please do let me know if made
any mistake. I will be greatfull. Thank u

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-12 15:28:07 +02:00
Weiko
f4fda221b7
Fix cron module structure (#4933)
This PR introduces a new folder structure for business modules.
Cron commands and jobs are now stored within the same module/folder at
the root of the business module
e.g: /modules/messaging/crons/commands instead of
/modules/messaging/commands/crons
Patterns are now inside their own cron-command files since they don't
need to be exported
Ideally cronJobs and cronCommands should have their logic within the
same class but it's a bit harder than expected due to how commanderjs
and our worker need both some class heritage check, hence the first
approach is to move them in the same folder

Also Messaging fullsync/partialsync V2 has been dropped since this is
the only used version => Breaking change for ongoing jobs and crons.
Jobs can be dropped but we will need to re-run our crons (only
cron:messaging:gmail-fetch-messages-from-cache)
2024-04-12 14:43:03 +02:00
Quentin G
a6b38d76ce
fix: sentry init is using the wrong environment (#4940)
In the previous PR #4912 it seems that I forgot to pass the environment
on the backend.
Here is a quick fix!

I also added some "doc" in the the .env.example
2024-04-12 12:27:35 +02:00
Thomas des Francs
f47fe62742
Fix last broken image in User-guide "Tips" (#4941)
Uploaded a new visual and corrected the file path.
2024-04-12 12:17:11 +02:00
bosiraphael
c0b3a8715f
4810 display participants in the right drawer of the calendar event (#4896)
Closes #4810

- Introduces a new component `ExpandableList` which uses intersection
observers to display the maximum number of elements possible
2024-04-12 10:33:46 +02:00
Ady Beraud
432d041203
Added loader and counter animations (#4931)
Added loader animation: 


https://github.com/twentyhq/twenty/assets/102751374/c569762a-f512-4995-ac4d-47570bacdcaa

Added counter animation: 


https://github.com/twentyhq/twenty/assets/102751374/7d96c625-b56a-4ef6-8042-8e71455caf67

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-12 10:27:32 +02:00
Ady Beraud
138fcbf45f
fixed react-error with mdx on mobile (#4919)
Extracted mdx compilation logic to the server component to prevent
hydration bugs

<img width="538" alt="Screenshot 2024-04-11 at 14 03 36"
src="https://github.com/twentyhq/twenty/assets/102751374/53383da5-2e5d-4ab6-829c-550b8af2ca25">

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
2024-04-12 10:20:11 +02:00
Ady Beraud
990f9aeff4
Make <Background /> component responsive (#4767)
- Adjusted the height of the background image to fit every possible
screen
- Added the proper rotation degree to the background
- Refactored gradient colour stop into CONST to make sure each
background image starts at the same level

**To be noted :** 
I had to use Javascript and useEffect to make the div take the entire
height of the page (turn it into a "use client" component). This was
necessary because absolute positioning by default makes the element's
sizing relative to its nearest positioned ancestor, not the entire
document.

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
2024-04-12 10:16:45 +02:00
Ady Beraud
b42a892c7b
modified UI and activity log in website (#4935)
-Small fixes in UI 
-Added extra columns in contributor activity log when necessary (ex: few
contributions):

**Before:** 

<img width="809" alt="Screenshot 2024-04-11 at 20 37 40"
src="https://github.com/twentyhq/twenty/assets/102751374/d58cebe5-4128-43bb-a649-3c9ac0276c53">

**After:** 

<img width="897" alt="Screenshot 2024-04-11 at 20 37 53"
src="https://github.com/twentyhq/twenty/assets/102751374/7e112f8f-b257-4397-96fa-79e605daab37">

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
2024-04-12 10:15:23 +02:00
Thomas des Francs
743c3c2c17
User-guide broken images fix (#4932)
# Before

Some images were broken because of an uppercase folder name:

![CleanShot 2024-04-11 at 18 08
21](https://github.com/twentyhq/twenty/assets/19412894/bd5b9f67-2fe1-4bb5-9c4d-2f914e54d714)

# After fix

![CleanShot 2024-04-11 at 18 07
30](https://github.com/twentyhq/twenty/assets/19412894/396eb6ed-f229-4e13-b1dd-b875670858db)
2024-04-11 19:26:59 +02:00
Weiko
dc542a395e
fix default value for message channel enums (#4934) 2024-04-11 18:42:31 +02:00
martmull
e6a5a63acf
Provide initialSnapshot to logout recoil state update snapshot (#4929) 2024-04-11 18:26:55 +02:00
bosiraphael
bc3930911e
Fix calendar preview avatar display (#4930)
- Fix avatar preview
- Fix border radius
2024-04-11 18:02:08 +02:00
Thomas Trompette
f332213e0d
Fix remote object read-only + remove relations (#4921)
- Set `readOnly` boolean in table row context. Preventing updates and
deletion
- Show page is null for remote objects. No need for complicated design
since this is temporary?
- Relation creations are now behind a feature flag for remote objects
- Refetch objects and views after syncing objects

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-11 17:58:02 +02:00
Weiko
fc56775c2a
[calendar/messaging] fix connected account auth failed should skip sync (#4920)
- AuthFailedAt is set when a refreshToken is not valid and an
accessToken can't be generated, meaning it will need a manual action
from the user to provide a new refresh token.
- Calendar/messaging jobs should not be executed if authFailedAt is not
null.
2024-04-11 17:57:48 +02:00
bosiraphael
8853408264
4736 add listener on calendarchannel isautocontactcreationenabled (#4913)
Closes #4736
2024-04-11 17:57:19 +02:00
gitstart-app[bot]
7211730570
New field type: DATE (#4876)
### Description
New field type: DATE

### Refs
https://github.com/twentyhq/twenty/issues/4377

### Demo

https://jam.dev/c/d0b59883-593c-4ca3-966b-c12d5d2e1c32

Fixes #4377

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-11 17:29:29 +02:00
brendanlaschke
ca9cc86742
Storybook fix dark mode (#4865)
preview has now also a dark background & added a one click change theme
button

<img width="994" alt="Bildschirmfoto 2024-04-06 um 18 27 45"
src="https://github.com/twentyhq/twenty/assets/48770548/95f12617-e48f-4492-9b51-13410aff43ee">
2024-04-11 17:28:12 +02:00
Artur
ffda4058e0
4809 - disable double signup with mouse click / enter (#4878)
Fixing #4809 

The form has a button with a disabled condition, unfortunately there was
an error in checking the condition.
```
disabled={
       SignInUpStep.Init
                ? false
                ...
```
SignInUpStep.Init is always equal to true, so the first arm was
returning false and button was never disabled. Fixing this check fixes
the double mouse click bug as expected.
```
disabled={
              signInUpStep === SignInUpStep.Init
```

Still, the enter keypress is handled a little bit differently. There is
a handleKeyDown event that was ignoring if the form is submitting or
not. I added the check for that, and now pressing enter multiple times
does not result in any errors
2024-04-11 17:08:23 +02:00
Quentin G
bf60227d67
feat: add SENTRY_RELEASE env (#4912)
Add support for a new SENTRY_RELEASE and SENTRY_ENVIRONMENT env.
It is optional and allows to init sentry with a Release version and an
env (used internally at Twenty).
Docker image have been updated do intergrate the new env as an Argument
2024-04-11 16:53:15 +02:00
Lucas Bordeau
c69a3f01da
Use defaultValue in currency input (#4911)
- Fix default value sent to backend, using single quotes by default
- Use default value in field definition and column definition so that
field inputs can access it
- Used currency default value in CurrencyFieldInput

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-11 16:49:00 +02:00
Quentin G
e48960afbe
chore: remove old deployments (#4922)
We migrated all Twenty's env to the new Twenty docker image. We can now
remove old deployments of front and back.
This PR takes care of that!
2024-04-11 16:35:11 +02:00
martmull
ee64576e5f
Fix phone cell display (#4924)
Closes #4796 

## What has been done
- fix phone number value detection
- Update formatting from International format to National format

## Before
phone were formatted as text field type

![image](https://github.com/twentyhq/twenty/assets/29927851/27d87522-5b02-4131-8b83-6bce7501fb1b)

## After
phone are properly formatted in National format

![image](https://github.com/twentyhq/twenty/assets/29927851/72f71b0f-4fd7-4060-afe3-feb87bddab0d)

## FYI
Phones in International format look like

![image](https://github.com/twentyhq/twenty/assets/29927851/6bd47dc1-6350-46b9-b5fd-94f4344bffac)
2024-04-11 16:30:49 +02:00
martmull
a7fcc5d47e
4778 multi select field front implement multi select type (#4887) 2024-04-11 12:57:08 +02:00
Thomas Trompette
aecf8783a0
Sync table from frontend (#4894)
This PR:
- separates the existing updateSyncStatus endpoint into 2 endpoints
- creates mutations and hooks that will call those endpoints
- trigger the hook on toggle
- removes form logic and add a separated component for toggling

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-11 11:51:49 +02:00
Om Jee Mishra
bea6d4173c
Fix postgres 15 & 16 conflict (#4860)
@charlesBochet
2024-04-11 11:42:48 +02:00
gitstart-app[bot]
584d90ec89
Create new field type JSON (#4729)
### Description
Create new field type JSON

### Refs
https://github.com/twentyhq/twenty/issues/3900

### Demo


https://github.com/twentyhq/twenty/assets/140154534/9ebdf4d4-f332-4940-b9d8-d9cf91935b67

Fixes #3900

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-04-11 11:41:36 +02:00
Marie
f25d58b0d9
[feat][FE] Stop persisting new empty records (#4853)
## Context
Closes [#4773](https://github.com/twentyhq/twenty/issues/4773)
Persisting of new records is delayed to cell escape and not performed
for empty records.

## How was it tested?
Locally tested + jest

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-10 19:16:34 +02:00
martmull
01991fe717
4902 bug fix fix api filter for enum (#4909)
- Handle NUMERIC, SELECT, PROBABILITY, RATING FieldMetadataTypes

Those filters now works:
- http://localhost:3000/rest/opportunities?filter=stage[eq]:MEETING
-
http://localhost:3000/rest/opportunities?filter=stage[in]:[MEETING,NEW]

When providing wrong enum values, the following error messages are
returned:
- http://localhost:3000/rest/opportunities?filter=stage[eq]:MEETINGG
> BadRequestException: 'filter' enum value 'MEETINGG' not available in
'stage' enum. Available enum values are ['NEW', 'SCREENING', 'MEETING',
'PROPOSAL', 'CUSTOMER']
-
http://localhost:3000/rest/opportunities?filter=stage[in]:[MEETING,NEWW]
> BadRequestException: 'filter' enum value 'NEWW' not available in
'stage' enum. Available enum values are ['NEW', 'SCREENING', 'MEETING',
'PROPOSAL', 'CUSTOMER']
2024-04-10 18:54:55 +02:00
bosiraphael
e7d146363c
4710 implement google calendar incremental sync (#4822)
Closes #4710
2024-04-10 15:53:14 +02:00
Charles Bochet
f1cc1c60e0
Fix ID type being used in place of UUID in graphql and metadata queries (#4905)
We have recently discovered that we were using ID type in place of UUID
type in many place in the code.
We have merged #4895 but this introduced bugs as we forgot to replace it
everywhere
2024-04-10 11:33:17 +02:00
Weiko
4f2c29dce0
uuid codegen update (#4897)
Following https://github.com/twentyhq/twenty/pull/4895/files
2024-04-09 18:06:39 +02:00
Lucas Bordeau
ee5aaae796
Implemented dataloader for relation metadata (#4891)
- Implemented dataloader package on metadata graphql server
- Implemented a dataloader for relation metadata module

---------

Co-authored-by: Jérémy M <jeremy.magrin@gmail.com>
2024-04-09 17:09:02 +02:00
Charles Bochet
b724c5e610
Fix graphql API accepting malformed UUIDs (#4895)
We have discovered that GraphQL inputs for fields of type ids in create
/ update input where using a more permissive ID type than the type used
in FilterInput in queries.

This PRs fixes it and make sure that all Input are using UUID graphql
scalar types
2024-04-09 16:44:52 +02:00
Thaïs
704f7f6d8e
feat: fetch database connection tables in Settings/Integrations/Datab… (#4882)
…ase/Connection

Closes #4758

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-09 14:22:15 +02:00
Weiko
19df43156e
[calendar] change api scope (#4888)
## Context
Calendar scope was too broad, this PR updates it to events only.
Also changing "Cannot connect Google account to demo workspace" error to
a 404 to avoid having a 500 for something expected
2024-04-09 11:18:48 +02:00
Jérémy M
35717fce8b
feat: sync command missing ability to rename standard object (#4819)
We've introduced in PR #4373 standard ids to be able to rename standard
fields and objects.
Fields part was working properly, but objects part was not yet
implemented.
This PR is adding the missing parts to make it work.
2024-04-09 10:20:34 +02:00
Lucas Bordeau
b1242bb850
4087 refactor object metadata item hooks and utils (#4861)
- Extracted each exported element from useObjectMetadataItem into its
own hook.
2024-04-09 09:19:52 +02:00
Thomas Trompette
651af1c0e1
Use migrations for remote tables (#4877)
Foreign tables should be created using migrations, as we do for standard
tables.
Since those are not really generated from the object metadata but from
the remote table, those migrations won't live in the object metadata
service.

This PR:
- creates new types of migration : create_foreign_table and
drop_foreign_table
- triggers those migrations rather than raw queries directly
- moves the logic to fetch current foreign tables into the remote table
service since this is not directly linked to postgres data wrapper
- adds logic to unsync all tables before deleting

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-08 18:21:29 +02:00
Thomas Trompette
d4a9a26069
Delete connection from frontend (#4880)
This PR:
- creates the query to delete a connection
- creates the hook that triggers the query
- triggers the hook function when clicking on remove + get back to
connection page

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-08 17:27:14 +02:00
Lucas Bordeau
97f9fc3f81
Fixed hotkey bug with Select component and added debug logs for hotkeys (#4879)
- Select component was adding a duplicate useListenClickOutside already
present in useDropdown for closing dropdown.
- Added debug logs for hotkeys scopes
2024-04-08 17:08:30 +02:00
bosiraphael
038b2c0efc
4738 add listeners on person creation and workspacemember creation to update participants (#4854)
Closes #4738

- Added the logic to unmatch a participant when the email of a person or
a workspace member is updated
2024-04-08 17:03:42 +02:00
Jérémy M
5019b5febc
feat: drop target column map (#4670)
This PR is dropping the column `targetColumnMap` of fieldMetadata
entities.
The goal of this column was to properly map field to their respecting
column in the table.
We decide to drop it and instead compute the column name on the fly when
we need it, as it's more easier to support.
Some parts of the code has been refactored to try making implementation
of composite type more easier to understand and maintain.

Fix #3760

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-08 16:00:28 +02:00
Anoop P
84f8c14e52
Implement context specific icon in breadcrumb navigation (#4839)
fixes #4834 

<img width="447" alt="Screenshot 2024-04-05 at 4 13 21 PM"
src="https://github.com/twentyhq/twenty/assets/44577841/036f6c51-c6c5-4e15-a895-e356ca230e5c">

<img width="437" alt="Screenshot 2024-04-05 at 4 13 35 PM"
src="https://github.com/twentyhq/twenty/assets/44577841/335d0317-43b2-4827-9cf7-42373b3953f5">

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-08 15:44:01 +02:00
bosiraphael
018b9efc2c
4743 use auth google apis callback url instead of messaging provider gmail callback url (#4838)
Closes #4743
2024-04-08 14:56:12 +02:00
Weiko
ab60b8be65
[messaging]Add temporary capture to gmail refresh token exceptions (#4875)
## Context
This exception is currently caught since this is expected but it seems
to be rejected more than it should so we want to have more visibility on
it

## Test
<img width="562" alt="Screenshot 2024-04-08 at 11 32 28"
src="https://github.com/twentyhq/twenty/assets/1834158/43bb6de9-191a-42d4-911b-6e83c7d8aa18">
2024-04-08 13:23:31 +02:00
Thaïs
1cbbb1600c
feat: add Remove menu option to Settings/Integrations/Database/Connec… (#4874)
…tion page

Closes #4872
2024-04-08 11:28:04 +02:00
Thomas Trompette
2890a7a44a
Fix get available tables (#4873)
Endpoint is broken since we now use `Remote` as a suffix for remote
table names.

This PR:
- creates a common function to calculate the name of the remote table
- use it in the `findAvailableRemotePostgresTables` to know if a table
has been synced or not

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-08 11:11:24 +02:00
Karthik S Kashyap
3eef4a8938
#4852 - Remove margin left on Record Board (Kanban) (#4862)
https://github.com/twentyhq/twenty/issues/4852

Hey, I'm very new to React! Also, this is my first try at contributing
to open source.

Hoping to learn React and Nestjs, I look forward to contributing more in
the future!

Looking forward to your feedback and guidance!

**Edit:**
![Group
9](https://github.com/twentyhq/twenty/assets/47709410/210a0b9e-0a26-4e3e-8e1b-a88837c90f10)

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-04-07 21:44:18 +02:00
Charles Bochet
4713ba0279 Fix sign-up bug because currentCacheVersion does not exist yet 2024-04-06 00:47:23 +02:00
Charles Bochet
0a9c79b3b3 Fix userload on signout 2024-04-05 21:01:03 +02:00
Charles Bochet
9f2c9ee76e
Remove repetitive query of ClientConfig and CurrentWorkspace member (#4859)
## Removing repetitive queries (impacting performance on page load)

We have recently introduced the capability to detect schema version
mismatch. To do that, we add a new header in all our queries. On page
load, this header is added once we know the currentUser and especially
its currentWorkspace and related schema version.
However, applying this header to apollo client will re-trigger all
queries that have been already performed (GetClientConfig and
GetCurrentUser). To avoid re-triggering them, I'm introducing two new
"isLoaded" states and skip the query if the query has already been
performed

## Fixing Relation Detail not displaying data on show page

Small bug introduced in a previous PR
2024-04-05 20:33:02 +02:00
Lucas Bordeau
a3184dcc2f
Used query fields for record table and record board (#4857)
- Added two hooks for computing query keys for index table and index
board.
- Using query keys for findManyRecords on index table and index board
2024-04-05 20:30:16 +02:00
Dmitriy Voytovich
a95972f808
refactor(chore):3896-replace-lodash-debounce-to-useDebounce (#4814)
Close: #3896 

## PR Details

Changed `lodash.debounce` to `useDebounce`.

Co-authored-by: VoitovychDM <voitovych.dm.m@gmail.com>
2024-04-05 19:07:44 +02:00
Charles Bochet
7774ef68a2
Release 0.4.0 (#4856)
0.4.0 Release!
2024-04-05 18:35:48 +02:00
Félix Malfait
bffd73e391
Fix environment variable casting (#4855)
Fixes #4628
2024-04-05 18:15:47 +02:00
Thaïs
bbdb926687
feat: add Tables settings to Settings/Integrations/Database/Connectio… (#4851)
…n page

Closes #4560
2024-04-05 18:12:54 +02:00
Charles Bochet
f4017119ab
Various cosmetic fixes for 0.4.0 (#4844)
In this PR:
- fix empty list placeholder positionning
- prevent user from erasing custom address field as composite types
removal is not supported yet @ijreilly FYI
- fix show page relation error
- Implement address filter
2024-04-05 17:32:14 +02:00
Weiko
f8da8f9805
[messaging] remove v2 feature flag (#4845)
## Context
We are now removing Messaging V2 feature flag to use it everywhere.

## Implementation
- renaming FetchWorkspaceMessagesCommandsModule to
MessagingCommandModule to make it more generic since it it hosts all
commands related to the messaging module
- creating a crons folder inside commands and jobs crons should be named
with xxx.cron.command.ts instead of xxx.command.ts. Same for jobs, jobs
should be named with xxx.cron.job.ts. In a future PR we should make sure
those CronJobs implement a CronJob interface since it's a bit different
(a CronJob does not contain a payload compared to a Job)
- Cron commands have been renamed to "cron:$module:command" so
`fetch-all-workspaces-messages-from-cache:cron:start` has been renamed
to `cron:messaging:gmail-fetch-messages-from-cache`. Also having to
create a command to stop the cron is a bit painful to maintain so I
removed them for now, this can be easily done manually with pg-boss or
bull-mq
- Removing full-sync and partial-sync commands as they were there for
testing only, we might put them back at some point but we will have to
adapt the code anyway.
- Feature flag has been removed from the MessageChannel standard object
to make sure those new columns are created during the next sync-metadata
2024-04-05 16:59:48 +02:00
Weiko
e0918c89c1
Fix contact creation when calendar is not enabled (#4843)
## Context
Calendar tables are behind a featureFlag, they do not exist if the
feature flag is off which means we should not use them for the same
reason. I'm adding a check on the featureFlag before calling the
repository.

```
Error executing raw query for workspace 20202020-1c25-4d02-bf25-6aeccf7ea419: relation "workspace_1wgvd1injqtife6y4rvfbu3h5.calendarEventParticipant" does not exist
```
## Test
locally with and without featureflag
2024-04-05 15:55:12 +02:00
Ady Beraud
8b52f06326
fixed eslint build issue (#4842)
**Fixed the following build issue:**

```
./src/app/contributors/api/fetch-issues-prs.tsx
12:3  Error: Type boolean trivially inferred from a boolean literal, remove type annotation.  @typescript-eslint/no-inferrable-types

./src/app/contributors/api/search-issues-prs.tsx
12:3  Error: Type boolean trivially inferred from a boolean literal, remove type annotation.  @typescript-eslint/no-inferrable-types
```

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
2024-04-05 15:45:54 +02:00
Thomas Trompette
4b34e7bf1e
Add new database connection (#4837)
Closes https://github.com/twentyhq/twenty/issues/4555

<img width="593" alt="Capture d’écran 2024-04-05 à 11 54 28"
src="https://github.com/twentyhq/twenty/assets/22936103/e6021417-bc78-460b-adf6-834330bbd894">

Connect the existing for with the backend so we can now create database
connections.

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-05 15:36:57 +02:00
Aditya Pimpalkar
ed8ecb154d
feat: traditional Oauth alongside PKCE (#4697)
ref: #4437
2024-04-05 13:09:41 +02:00