Commit Graph

636 Commits

Author SHA1 Message Date
Charles Bochet
27cd577dbb Fix login by email blocked 2024-04-26 18:22:36 +02:00
Charles Bochet
b15533e4b3 Bump version to 0.10.3 2024-04-26 17:52:13 +02:00
Thaïs
8beec03762
fix: fix SignInUpForm Continue button being disabled (#5185)
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-26 16:27:40 +02:00
Hinson Chan
e1d0b26cf9
5180 - does not call debounced update for invalid names (#5181)
fix: #5180 

Previously, clearing your name would kick you to the profile creation
page.


https://github.com/twentyhq/twenty/assets/68029599/8c0087da-6b03-4b6e-b202-eabe8ebcee18


Fixed so it checks your name is valid before calling the debounced
update


https://github.com/twentyhq/twenty/assets/68029599/4bc71d8f-e4f4-49ae-9cb8-497bd971be94

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-04-26 15:23:03 +02:00
Thomas Trompette
224c8d361b
Setup relations for remote objects (#5149)
New strategy:
- add settings field on FieldMetadata. Contains a boolean isIdField and
for numbers, a precision
- if idField, the graphql scalar returned will be a GraphQL id. This
will allow the app to work even for ids that are not uuid
- remove globals dateScalar and numberScalar modes. These were not used
- set limit as Integer
- check manually in query runner mutations that we send a valid id

Todo left:
- remove WorkspaceBuildSchemaOptions since this is not used anymore.
Will do in another PR

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
2024-04-26 14:37:34 +02:00
Deepak Kumar
dc576d0818
GH-3546 Recaptcha on login form (#4626)
## Description

This PR adds recaptcha on login form. One can add any one of three
recaptcha vendor -
1. Google Recaptcha -
https://developers.google.com/recaptcha/docs/v3#programmatically_invoke_the_challenge
2. HCaptcha -
https://docs.hcaptcha.com/invisible#programmatically-invoke-the-challenge
3. Turnstile -
https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#execution-modes

### Issue
- #3546 

### Environment variables - 
1. `CAPTCHA_DRIVER` - `google-recaptcha` | `hcaptcha` | `turnstile`
2. `CAPTCHA_SITE_KEY` - site key
3. `CAPTCHA_SECRET_KEY` - secret key

### Engineering choices
1. If some of the above env variable provided, then, backend generates
an error -
<img width="990" alt="image"
src="https://github.com/twentyhq/twenty/assets/60139930/9fb00fab-9261-4ff3-b23e-2c2e06f1bf89">
    Please note that login/signup form will keep working as expected.
2. I'm using a Captcha guard that intercepts the request. If
"captchaToken" is present in the body and all env is set, then, the
captcha token is verified by backend through the service.
3. One can use this guard on any resolver to protect it by the captcha.
4. On frontend, two hooks `useGenerateCaptchaToken` and
`useInsertCaptchaScript` is created. `useInsertCaptchaScript` adds the
respective captcha JS script on frontend. `useGenerateCaptchaToken`
returns a function that one can use to trigger captcha token generation
programatically. This allows one to generate token keeping recaptcha
invisible.

### Note
This PR contains some changes in unrelated files like indentation,
spacing, inverted comma etc. I ran "yarn nx fmt:fix twenty-front" and
"yarn nx lint twenty-front -- --fix".

### Screenshots

<img width="869" alt="image"
src="https://github.com/twentyhq/twenty/assets/60139930/a75f5677-9b66-47f7-9730-4ec916073f8c">

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-04-25 23:52:28 +02:00
martmull
44855f0317
Fix broken billing portal when subscription canceled (#5082)
Fix billing portal link for canceled subscription
2024-04-25 18:33:49 +02:00
bosiraphael
d23e02adca
4001 add validation for blocklist (#5172)
Closes #4001
2024-04-25 15:32:55 +02:00
Vinod Rathod
4af2c5f298
Added a search box in sort menu (#5045)
Closes #4368

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-04-25 15:31:41 +02:00
Orinami Olatunji
0ccbdacb5a
feat: Status tags can show loader to complement displayed text (#5137)
Resolves #5134 



https://github.com/twentyhq/twenty/assets/16918891/48475f1b-a61f-4b87-8b9b-1271a183ac4b

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-25 10:27:17 +02:00
Hinson Chan
a283a3deed
5161 - fix workspace icon is missing on multi-workspace (#5165)
Fixes #5161

<img width="179" alt="image"
src="https://github.com/twentyhq/twenty/assets/68029599/5a7a5b11-c6ec-4f1f-b94d-37be470a7f79">

detail: before this PR, the icon would display as normal for the default
data:// icons, but not for uploaded files
(`workspace-logo/original/{}.png` for example). This PR fixes this by
calling the getImageAbsoluteURIOrBase64 function to resolve the missing
path.
2024-04-25 10:01:44 +02:00
Orinami Olatunji
2b8116f57f
fix: Calendar events participated in should be displayed in red (#5146)
Resolves #5131
2024-04-25 09:56:23 +02:00
Orinami Olatunji
adbc8ab96f
#5073 - fix datepicker styling in dark mode (#5074)
This PR fixes three issues with the datepicker in dark mode. The
following UI elements now appear in light colors when the theme is set
to dark mode:

- The selected date.
- The clock icon.
- The date time input component.

Before:
<img width="1003" alt="theming bug"
src="https://github.com/twentyhq/twenty/assets/16918891/914b7043-e692-4de8-8440-ddd89cbf3973">

After:
<img width="374" alt="dark_theme_calendar_after"
src="https://github.com/twentyhq/twenty/assets/16918891/346fd950-1ef8-405e-9486-59abb81f92db">
<img width="347" alt="light_theme_calendar_after"
src="https://github.com/twentyhq/twenty/assets/16918891/17463094-53e5-4bc4-8812-a53a37cd08ed">

#5073

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-24 15:18:26 +02:00
martmull
87a9ecee28
D gamer007/add microsoft oauth (#5103)
Need to create a new branch because original branch name is `main` and
we cannot push additional commits
Linked to https://github.com/twentyhq/twenty/pull/4718


![image](https://github.com/twentyhq/twenty/assets/29927851/52b220e7-770a-4ffe-b6e9-468605c2b8fa)

![image](https://github.com/twentyhq/twenty/assets/29927851/7a7a4737-f09f-4d9b-8962-5a9b8c71edc1)

---------

Co-authored-by: DGamer007 <prajapatidhruv266@gmail.com>
2024-04-24 14:56:02 +02:00
Dev
b634057fdd
Fix ellipsis overflow causing edit icon to be hidden on links (#5071)
Fixes #5064 

### Demo


https://github.com/twentyhq/twenty/assets/21654351/28ab7374-c57e-4f7e-9720-05138c53a33d

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-24 13:27:59 +02:00
Aditya Pimpalkar
c63ee519ea
feat: oauth for chrome extension (#4870)
Previously we had to create a separate API key to give access to chrome
extension so we can make calls to the DB. This PR includes logic to
initiate a oauth flow with PKCE method which redirects to the
`Authorise` screen to give access to server tokens.

Implemented in this PR- 
1. make `redirectUrl` a non-nullable parameter 
2. Add `NODE_ENV` to environment variable service
3. new env variable `CHROME_EXTENSION_REDIRECT_URL` on server side
4. strict checks for redirectUrl
5. try catch blocks on utils db query methods
6. refactor Apollo Client to handle `unauthorized` condition
7. input field to enter server url (for self-hosting)
8. state to show user if its already connected
9. show error if oauth flow is cancelled by user

Follow up PR -
Renew token logic

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-04-24 11:45:16 +02:00
Lucas Bordeau
444e97fa3e
Fixed date picker UI that was too overloaded (#5039)
Date picker UI was off because of the recent refactor with new field
types Date and DateTime. We had to allow the date picker to edit both.

In this PR we come back to the previous design and we only use the input
to modify time.

Also we use our Select component instead of the ones from the library
`react-datepicker`

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-04-23 18:45:32 +02:00
Marie
ff39ba5a15
[fix] Support non latin characters in schema names (#5063)
Fixes #4943

## How was it tested?
Local (front + /metadata)
Unit tests for utils

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-04-23 13:37:29 +02:00
Orinami Olatunji
8f6460bec5
#4976 fix dark mode for multi-select picker in activity target chips (#5111)
#4976 - Fixed the dark mode for multi-select picker in
ActivityTargetChips.

Bug:

![image](https://github.com/twentyhq/twenty/assets/16918891/53f55bba-f692-4dc9-a6b6-440d4ff5b278)

Fix:


https://github.com/twentyhq/twenty/assets/16918891/8e72cd02-0956-468d-b898-a10313448f62

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-04-23 11:46:05 +02:00
Ikko Eltociear Ashimine
0db35c9a5f
Fix typo in config/index.ts (#5109)
seperate -> separate
2024-04-23 11:22:31 +02:00
Marie
68662fa543
[refacto] Introduce stateless TextInputV2 (#5013)
## Context
As discussed with @lucasbordeau and @charlesBochet we are looking at
making low level UI components stateless when possible.
Therefore TextInput should not handle a hotkey state. Instead hotkeys
should be defined in the parent component (as done here in
CreateProfile).

Introducing here TextInputV2 that is stateless and that can already
replace TextInput without any behaviour change everywhere it is used
with `disableHotkey` prop.

## How was it tested?
Locally + Storybook

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-22 11:19:41 +02:00
Charles Bochet
4bd2cdd580
Load all data on record boards (#5070)
## Context

For users with many records, only the first n*60 records were loaded on
board views (n being the number of visible columns). This was because of
the following behavior:
- watch for end of column visibility changes. If an end of column is
visible, try to fetch more. However, watching for visbility changes is
not reliable enough.

## What we want

If an end of column is visible, try to fetch more. If no more records is
availble in pagination, do not fetch more
2024-04-19 23:39:19 +02:00
Thaïs
d3170fc1ea
fix: fix root start script (#5032)
Fixes #5022

See https://nx.dev/recipes/running-tasks/root-level-scripts#setup
2024-04-19 18:28:02 +02:00
Félix Malfait
d145684966
New Timeline (#4936)
Refactored the code to introduce two different concepts:
- AuditLogs (immutable, raw data)
- TimelineActivities (user-friendly, transformed data)

Still some work needed:
- Add message, files, calendar events to timeline (~2 hours if done
naively)
- Refactor repository to try to abstract concept when we can (tbd, wait
for Twenty ORM)
- Introduce ability to display child timelines on parent timeline with
filtering (~2 days)
- Improve UI: add links to open note/task, improve diff display, etc
(half a day)
- Decide the path forward for Task vs Notes: either introduce a new
field type "Record Type" and start going into that direction ; or split
in two objects?
- Trigger updates when a field is changed (will be solved by real-time /
websockets: 2 weeks)
- Integrate behavioral events (1 day for POC, 1 week for
clean/documented)

<img width="1248" alt="Screenshot 2024-04-12 at 09 24 49"
src="https://github.com/twentyhq/twenty/assets/6399865/9428db1a-ab2b-492c-8b0b-d4d9a36e81fa">
2024-04-19 17:52:57 +02:00
Arun Kumar
e0efa358de
Fixes #5024: Update local recoil state when workspace name changes (#5033)
This PR fixes #5024.

Local recoil state was not updated when workspace name is changed. This
PR updates local recoil state so that dropdown (and other parts of the
app) correctly shows the workspace name without reload.
2024-04-18 16:54:32 +02:00
Charles Bochet
d07dc11124
Fix activity Target picker not being displayed (#5040)
<img width="1025" alt="image"
src="https://github.com/twentyhq/twenty/assets/12035771/3f37ed27-661e-43ea-bc15-f59efa12bfca">
2024-04-18 16:16:12 +02:00
martmull
1c1a055c94
Improve multi word filtering (#5034)
improve multi word search

closes #4212 
closes #3386
2024-04-18 15:46:59 +02:00
Lucas Bordeau
88c14b7e52
Fix Record Inline Cell position on Edit mode (#5038)
Fixed 0.5 offset of inline cell edit mode
2024-04-18 15:46:40 +02:00
Lucas Bordeau
dc91d06e1b
Fixed position in query fields (#5036)
Position was not passed to the request query fields so it changed every
time we updated a field.
2024-04-18 15:24:28 +02:00
Lucas Bordeau
df49575c3e
Fix component id to scope id (#5035)
This pull request fixes the component id to scope id in the
useUpsertRecordV2 function.
2024-04-18 15:24:15 +02:00
bosiraphael
8702c71d45
4746 create created listener on blocklist (#5031)
Closes #4746 for messaging.

I will create another PR to implement the listener on calendar.
2024-04-18 15:06:13 +02:00
Charles Bochet
c42fcf435a Improve performance on TableBody but disable shadow on first column freeze 2024-04-18 14:45:45 +02:00
Zoltán Völcsey
c402631067
fix: Added isDisplayModeContentEmpty to the showEditButton's check (#5025)
Closes #5011 

Hi! I added isDisplayModeContentEmpty to the showEditButton's check.


https://github.com/twentyhq/twenty/assets/41576384/54a87c16-b58a-4a46-8373-f6c924201113
2024-04-18 13:47:12 +02:00
gitstart-twenty
168358a327
Implement a masked currency input (#5010)
### Description
Implement a masked currency input

### Refs
#4358 

### Demo
https://jam.dev/c/93da117c-b193-488f-b9f9-906b33ac5190

Fixes #4358

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-18 13:44:07 +02:00
Lucas Bordeau
bc5cfd046c
Fixed default currency code in currency field (#5028)
Default currency logic was not handling a specific case where the
default currency is empty in the field metadata.

I fixed the ternary cascade and made it more explicit, thus also
avoiding falling into having an empty currency code being persisted.
2024-04-18 11:25:17 +02:00
Thaïs
7065495223
fix: attempt to fix Dockerfile front build (#5020) 2024-04-18 11:24:39 +02:00
Lucas Bordeau
86afc34e61
Speed up RecordTableCell by 5x (#5023)
Improved table cell performances by putting all hooks from
RecordTableCell in RecordTableContext and RecordTable component, so that
each cell now only subscribes to a reference to those hooks' returned
function.

We couldn't do memoization here since the problem is not to memoize
between re-renders but to share the same function reference between
hundreds of different components, so a context it the fastest way for
this.

I had to refactor the hooks a little bit so that they take as arguments
what was previously taken from the cell's context.
2024-04-18 10:44:00 +02:00
Marie
3e60c0050c
[fix] Fix white screen when error handled by AppErrorBoundary (#5017)
[In a previous PR](https://github.com/twentyhq/twenty/pull/5008) I was
fixing dark mode by calling useTheme in AppErrorBoundary while there was
actually no parent ThemeProvider. This was causing a bug when an error
was actually intercepted by AppErrorBoundary because theme was empty.

Now I am providing the error theme in GenericErrorFallback, fallbacking
to THEME_LIGHT as it can be called from outside a ThemeProvider (as it
is the case today), but also reading into ThemeProvider in case we end
up using this component in a part of the application where it is
available, not to necessarily use THEME_LIGHT.

## How was it tested?
with @thaisguigon 
Locally (dark mode works + error mode works (throwing an error in
RecoilDebugObserver))
2024-04-18 10:42:30 +02:00
Deepak Kumar
5c30509d21
GH-4362 Add syncing status (#4950)
This PR adds a `syncing` status on frontend.

Issue
- #4362

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-17 22:06:52 +02:00
Charles Bochet
a52f2e5bd9
Fix Storybook stories (Datamodel edition / preview / signOut) (#5019)
As per title ; some small changes on broken stories
2024-04-17 18:48:41 +02:00
Pacifique LINJANJA
627a6bda29
Update twenty-front commands (#4667)
# This PR

- Moves dev and ci scripts to the `project.json` file in the
twenty-front package
- Adds a project.json file in the root of the project with the main
start command that start both twenty-server and twenty-front
applications concurrently
- Updates the script command of the root project with the start:prod
command (replacing the start command which will be used in dev with the
help of nx)
- Add a start:prod command in the twenty-front app, replacing the start
command (now used for dev purpose)

Issue ref #4645 

@charlesBochet @FelixMalfait please let me know how can I improve it

---------

Co-authored-by: Thaïs Guigon <guigon.thais@gmail.com>
2024-04-17 18:06:02 +02:00
Anchit Sinha
1ab31f4cac
4798-feat(front): Add calendar settings option in settings account dropdown (#4997)
Closes #4798 


![image](https://github.com/twentyhq/twenty/assets/22574091/cbdd941a-47bf-4bf4-982d-cc9538586e85)

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-04-17 17:41:24 +02:00
gitstart-twenty
d54e690f0d
Fix explicit boolean predicates rule not working with boolean constants (#5009)
### Description
Fix explicit boolean predicates rule not working with boolean constants

### Refs
#4881

### Demo

Fixes #4881

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-17 17:06:37 +02:00
Thomas Trompette
6cf3ade300
Make id available in remote table output (#5003)
Wrongly use `PrimaryGeneratedColumn` typeOrm decorator instead of the
nest query one.

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-17 17:05:47 +02:00
Charles Bochet
d02509b1b6
Fix chromatic tests (#5012) 2024-04-17 16:56:39 +02:00
Marie
ac9ccbc2b5
[fix] Fix dark mode (#5008)
## Context
Fixing broken dark mode
<img width="826" alt="Capture d’écran 2024-04-17 à 15 50 39"
src="https://github.com/twentyhq/twenty/assets/51697796/94df50bd-5b43-4def-a39d-268a10ac560a">

## How was it tested
Locally
Test of dark mode on storybook is added on another PR
2024-04-17 16:54:03 +02:00
Charles Bochet
75fd430149
Increase storybook pages coverage (#4885)
On FE:
- refreshing metadata mocks
- updating jest tests
- fixing storybook pages coverage
- fixing storybook modules coverage
2024-04-17 16:24:04 +02:00
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