Commit Graph

3837 Commits

Author SHA1 Message Date
Félix Malfait
8d496902b7
Fix linter (#7191)
Fix linter
2024-09-21 07:02:40 +02:00
Subham Sharma
4ed1eb581a
Set a unique constraint on email table in users #7180 (#7184)
Link to issue - https://github.com/twentyhq/twenty/issues/7180

File changed -
twenty/packages/twenty-server/src/engine/core-modules/user/user.entity.ts

---------

Co-authored-by: subham sharma <subham.sharma@smartbear.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-21 06:37:55 +02:00
Félix Malfait
6d5d73fbe8
Improve snackbar and fix sentry (#7181)
- Improve snackbar to enable displaying multi-line message (so far we
only displayed the first few words which was very frustrating)

- Followup on previous issue to enable tim@apple.dev on the demo
workspace (prefilled automatically)

- Fix sentry tracing which had been broken when migrating from v7 to v8
2024-09-21 06:33:15 +02:00
Raphaël Bosi
20d06b3c0f
7182 person avatar is not the same color in emails and calendar (#7185)
Fixes #7182 and displayName in calendar
2024-09-21 00:35:39 +02:00
Nabhag Motivaras
c97c71762e
fix: Input fields to have expected behaviour in case of empty / only whitespaces string (#6736)
# ISSUE
- Closes #6734
- Closes #6633
- Closes #6733
- Closes #6816

# Description

- [x] Don't allow Empty (whitespaces) Objects to Create, all the
keyboard shortcuts are also handled for this.



https://github.com/user-attachments/assets/1c9add4e-f13f-458b-8f76-63bd868413a2



https://github.com/user-attachments/assets/e72b6ee3-74e4-4517-a230-3eb10db80dc7

Note: we do have one other issue with FullName field #6740 Inorder to
test use **shift**.




- [x] Api Keys Input Name Field -> New and Detail View Name field
shouldn't be empty or string with whitespaces, we won't able to have
whitespaces in both. **Try Entering just spaces**



https://github.com/user-attachments/assets/b521b49f-648c-4585-9d15-8ff4faed3c3a


- [x] Similar to above, Empty webhook endpoint url under
**/settings/developers/webhooks/new** won't be created. **Try Entering
just spaces**

- [x] New Functions or Updating Functions will not able to have
whitespaces, empty string as Name. **Try Entering just spaces**



https://github.com/user-attachments/assets/09fcf394-c6d9-4080-8efd-462b054a22d0



- [x] under **settings/workspace-members** changes will lead and solve
that user won't be able to enter Invite by email as just whitespaces +
button is now getting disabled when there is no correct email. **Try
Entering just spaces**



https://github.com/user-attachments/assets/b352edfa-113b-4645-80fd-db6f120ab5db



- [x] Text Input Field, will not allow to start entering with
whitespaces and won't take just whitespaces as value spaces between
words will work.


https://github.com/user-attachments/assets/8c1a0812-45be-4ed2-bd3d-bb4f92147976

- [x] Similarly Number works as per above including shortcuts. 


https://github.com/user-attachments/assets/9f69cc87-5c3c-43ee-93c4-fa887bc0d7ee


- [x] Similarly FullName field works as per above including shortcuts



https://github.com/user-attachments/assets/7bb006b2-abf7-44cd-a214-7a2fc68df169

- [x] Pasting fullName is been Improved. 

- Case 1 (Two Words): If there are exactly two words, return them as is.
- Case 2 (More than Two Words): If there are more than two words, return
the first two words only.
- Case 3 (One Word): If there is only one word, return it as the first
name, with an empty string as the last name.
- WhiteSpaces have been handled. 

```
console.log(splitFullName("John     Doe")); // ["John", "Doe"]
console.log(splitFullName("        ")); // ["", ""]
console.log(splitFullName("John")); // ["John", ""]
console.log(splitFullName("  John   Doe  ")); // ["John", "Doe"]
console.log(splitFullName("John Michael  Andrew Doe")); // ["John", "Michael"]
```

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-20 21:25:50 +02:00
Thomas Trompette
c8c1890ad7
Safely parse phone numbers before display (#7186)
Timeline activity properties are stored as string rather than array.
Adding a safe parsing in front. Would be better to also update in
backend but doing this as a quick fix
2024-09-20 17:40:12 +02:00
Lucas Bordeau
25522752e4
View module refactor with atomic recoil component instance states (#6810)
This PR refactors the view module to implement utils that avoid having
to create hooks to inject the scope id in the states, like
`useViewStates`, each componentState will know its unique related
InstanceContext (which holds the instanceId), and thus will be able to
retrieve it itself.

We keep the naming componentState as it reflects the fact that those
states are tied to instances of a component (or its children).

We introduce the instance word where it is needed, in place of scopeId
for example, to precise the fact that we handle instances of component
state, one for each instance of a component.

For example, the currentViewId is a state that is tied to an instance of
the ViewBar, but as we can switch between views, we want currentViewId
to be a componentState tied to an instance of the ViewBar component.

This PR also refactors view filter and sort states to fix this issue :
https://github.com/twentyhq/twenty/issues/6837 and other problems
involving resetting those states between page navigation.

Fixes https://github.com/twentyhq/twenty/issues/6837

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-20 16:13:29 +02:00
Weiko
bebeb1515b
Add indexes to custom relations (#7156)
TODO: command to retro-actively create indexes to existing custom
objects
2024-09-20 15:06:26 +02:00
Félix Malfait
f845187f8e
Change demo account email (#7177)
Change the demo account's email to be able to set SIGN_IN_PREFIL = true
on demo.twenty.com
2024-09-20 13:55:46 +02:00
Lucas Bordeau
0aa48fb1e4
Fixed bug with record without activity target (#7175)
Fixed bug that was appearing with records without any activity target

The problem may come from the new TwentyORM that doesn't understand the
filter like before.
2024-09-20 12:53:29 +02:00
Subham Sharma
ebf677809a
Update System Data Type Names to Display 'System' #7136 (#7170)
Changes made in 

twenty/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx

fixes #7136

Co-authored-by: subham sharma <subham.sharma@smartbear.com>
2024-09-20 11:44:28 +02:00
Harshit Singh
7967d2d643
fix: Update theme card width (#7147)
> [!Note]
> This PR solves the issue #7119 
> Updated the width of Style Color card from ` 120px `to ` 160px` for
better UI
2024-09-20 11:41:20 +02:00
Harshit Singh
e566b8d204
fix: Cropped company logos on the Companies Kanban (#7166)
> [!Note]
> This PR addresses the issue #7161 
> Removed margin right which made images crop.

## Before 

<img width="236" alt="Screenshot 2024-09-20 at 1 35 55 AM"
src="https://github.com/user-attachments/assets/21e56f6e-2860-4a85-a866-4b619b42b659">


## After

<img width="205" alt="Screenshot 2024-09-20 at 1 35 34 AM"
src="https://github.com/user-attachments/assets/8fdc2999-9f26-42e6-bbc5-e339a23db823">
2024-09-20 11:04:14 +02:00
Jérémy M
eef7f1661d
feat: add integration tests (#6923)
### Summary

This PR introduces several integration tests, a mix of manually written
tests and those generated using the `generate-integration-tests` Python
script located in the `scripts` folder.

### Tests Added:
- **Authentication tests**: Validating login, registration, and token
handling.
- **FindMany queries**: Fetching multiple records for all existing
entities that do not require input arguments.

### How the Integration Tests Work:
- A `setupTest` function is called during the Jest test run. This
function initializes a test instance of the application and exposes it
on a dedicated port.
- Since tests are executed in isolated workers, they do not have direct
access to the in-memory app instance. Instead, the tests query the
application through the exposed port.
- A static accessToken is used, this one as a big expiration time so it
will never expire (365 years)
- The queries are executed, and the results are validated against
expected outcomes.

### Current State and Next Steps:
- These tests currently run using the existing development seed data. We
plan to introduce more comprehensive test data using `faker` to improve
coverage.
- At the moment, the only mutation tests implemented are for
authentication. Future updates should include broader mutation testing
for other entities.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-20 11:02:52 +02:00
Charles Bochet
7781d70bb8
Fix CSV export missing last page (#7167) 2024-09-20 05:42:59 +02:00
Weiko
b1889e4569
Fix nested relations (#7158)
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-20 05:16:13 +02:00
Raphaël Bosi
6a5f9492d3
7142 make messaging full message list fetch idempotent (#7148)
- Add message deletion and thread cleaning during full message list
fetch
- Add thread cleaning  during partial message list fetch
- Delete provider from cache key
2024-09-19 18:32:25 +02:00
Thomas Trompette
8964d26d5b
Clean views without object metadata (#7153)
Add command for cleaning + clean on object deletion
2024-09-19 18:13:07 +02:00
Félix Malfait
3025ac346c
Upgrade sentry (#7145)
Upgrave Sentry to v8 and add Sentry Cron monitoring

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-19 18:09:24 +02:00
gitstart-app[bot]
b3ed6cb903
[Bug] Select options names can't start with a number (#7079)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-6980](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6980).
This ticket was imported from:
[TWNTY-6980](https://github.com/twentyhq/twenty/issues/6980)

 --- 

### Description

- **fix**: added a transformation step that prefixes the newly added
option with an underscore before the Graphql enum is generated so it
saves successfully and passes the default GraphQL validation.

### Demo

- <https://www.loom.com/share/feda2198ed8b4e558f96520a0d051725>

### Refs

#6980

Fixes #6980

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Weiko <corentin@twenty.com>
2024-09-19 14:05:28 +02:00
Weiko
e0ada0a8ee
Add deletedAt to foreignKey indexes (#7133)
We had to remove soft-deletion on default filters due to the missing
indexes. We now generate composite indexes with the foreign key
containing the deletedAt column as well which should improve
performances
2024-09-19 11:23:40 +02:00
Divyesh Patel
9d5b9f8415
Improved note cards design (#7129)
Fixes #7120

- Removed margin according to design
- Increased card content padding from 8px to 16px


![image](https://github.com/user-attachments/assets/bf1b2be4-7176-4af1-bad0-7e7f159b57c2)
2024-09-19 10:47:41 +02:00
Antoine Moreaux
89c97993e3
feat(invitation): Improve invitation flow - Milestone 2 (#6804)
From PR: #6626 
Resolves #6763 
Resolves #6055 
Resolves #6782

## GTK
I retain the 'Invite by link' feature to prevent any breaking changes.
We could make the invitation by link optional through an admin setting,
allowing users to rely solely on personal invitations.

## Todo
- [x] Add an expiration date to an invitation
- [x] Allow to renew an invitation to postpone the expiration date
- [x] Refresh the UI
- [x] Add the new personal token in the link sent to new user
- [x] Display an error if a user tries to use an expired invitation
- [x] Display an error if a user uses another mail than the one in the
invitation

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-18 23:27:31 +02:00
Weiko
ad18c44f25
Improve perf during repository creation in nested relations (#7132) 2024-09-18 21:54:22 +02:00
Weiko
210c336ccf
Fix performance (#7131) 2024-09-18 21:15:30 +02:00
Weiko
41fe8f7fea
Fix nested relations with large dataset in find queries (#7127)
## Before
<img width="920" alt="before"
src="https://github.com/user-attachments/assets/4809556f-0459-4f56-a716-b969a943d492">

## After
<img width="920" alt="after"
src="https://github.com/user-attachments/assets/504186b2-d002-482d-bc3e-2dda45c314b1">
2024-09-18 20:06:04 +02:00
Raphaël Bosi
1d56ace2af
Fix sync statuses on the fe (#7117)
Follows #6685
2024-09-18 18:46:39 +02:00
Weiko
02618b3e6a Fix graphql query createMany resolver with nested relations (#7061)
Looks like insert() does not return foreign keys. We could eventually
call findMany after but it seems that's what save() is doing so I'm
replacing insert with save.
```typescript
/**
 * Flag to determine whether the entity that is being persisted
 * should be reloaded during the persistence operation.
 *
 * It will work only on databases which does not support RETURNING / OUTPUT statement.
 * Enabled by default.
 */
reload?: boolean;
```

Note: save() also does an upsert by default with no way to configure
that so if we want to keep that behaviour we will need to add a check
before
```typescript
if (args.upsert) {
    const existingRecords = await repository.findBy({
      id: Any(args.data.map((record) => record.id)),
    });
    ...
```

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-18 18:45:52 +02:00
Thomas des Francs
147eaaa5b0
0.30 changelog (#7126) 2024-09-18 18:40:07 +02:00
Ana Sofia Marin Alexandre
cac3e116a3
Add SettingsCard for Config Data Type and Accounts Settings (#7093)
https://github.com/twentyhq/twenty/issues/6950
Add new Settings Card for Config Data Type and accounts Settings
Before:
<img width="707" alt="Screenshot 2024-09-11 at 17 43 16"
src="https://github.com/user-attachments/assets/63ff9373-fa86-4b22-8e8b-21483039c3be">
After:
<img width="755" alt="Screenshot 2024-09-17 at 14 15 18"
src="https://github.com/user-attachments/assets/213c24a1-dc1c-4ffb-8890-7c1f63ed376c">
<img width="755" alt="Screenshot 2024-09-17 at 14 15 38"
src="https://github.com/user-attachments/assets/0fc12d19-b92a-493d-80fa-0064cf491fbc">
2024-09-18 18:32:41 +02:00
Thomas Trompette
b1cb8998f8
Backfill workspace favorites (#7122)
- command to backfill workspace favorites
- create workspace favorites on workspace activation
- create workspace favorites on demo seed

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-18 18:26:55 +02:00
Charles Bochet
759eb3070e
Improve demo seed (#7125)
We have a few issues on demo seeding:
- redis metdata cache was not flushed
- server ram graphql schema cache was not cleared on metadata version
increment
2024-09-18 17:35:08 +02:00
Lucas Bordeau
c24076266b
Fixed scroll wrapper for settings page container (#7124)
Padding was set on global page component while it is needed only for
settings page container component.
2024-09-18 17:26:48 +02:00
Thomas Trompette
741a969cc1
Add fail on metadata cache miss (#7118)
- avoid failing when missing cache (used for command)
- remove unused load cache function. Cache will be always re-created
when trying to fetch if not existing
2024-09-18 15:40:24 +02:00
Heber Santiago Alvarez Rincon
44587b4908
enhance picture uploader, change justify content (#6974)
Fixes https://github.com/twentyhq/twenty/issues/6966

to put label in the place and change remove button to gray.

sorry you dont assign this to me but I want to help, hope that if 6
hours pass u could check it

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-18 15:08:28 +02:00
Raphaël Bosi
55a3ee2c3b
Modify messaging settings description (#7089)
Modify messaging settings description
2024-09-18 15:07:08 +02:00
Raphaël Bosi
66456828ab
7059 Fix email loading in the timeline (#7116)
Fixes #7059
2024-09-18 14:37:23 +02:00
Weiko
999974893c
Fix race condition with datasource creation (#7106)
## Context
We currently have a race condition when dealing with datasource
creation. This happen when multiple queries arrive at the same time (for
example graphql dataloaders) and the datasource is not created yet.
Since the datasource is stored in memory this can happen more often as
well and they were all triggering the datasource creation at the same
time.

I'm trying to fix the issue with promise memoization. Now, instead of
caching the datasource only, we also want to cache the promise of the
datasource creation and make the creation itself synchronous.

More info about promise memoization in this article for example:
https://www.jonmellman.com/posts/promise-memoization

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2024-09-18 14:01:55 +02:00
Harshit Singh
94ba4c0558
fix: Tasks page overflows with large title and body (#6970)
## Description

This PR solves the issue #6968.

## Before


https://github.com/user-attachments/assets/7a18498e-1185-423e-922f-585d0f93eafb

- For responsive behaviour 

<img width="550" alt="Screenshot 2024-09-11 at 2 49 46 AM"
src="https://github.com/user-attachments/assets/db509b3a-2619-4045-90cd-af6ffdcb6bf5">


## Expected behavior


https://github.com/user-attachments/assets/3f64e246-6431-4eea-9acf-5bf124aadc22

- <img width="713" alt="Screenshot 2024-09-11 at 2 48 39 AM"
src="https://github.com/user-attachments/assets/e160c1ea-118f-4090-8af7-a3d6a7234b25">


## Edge cases

Edge cases handled -

- when date is added or removed, it doesn't effect the body or title
- Relations with long names don't affect the task body
- Short title and long description and long description and short title
are handled

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-18 14:00:48 +02:00
HKS07
cfc00c7924
Twnty-#6797 view/edit inactive feature (#6953)
This PR resolves the issue raised under #6797. Earlier no view/edit
option were present for inActive objects in data-model inside settings.
To resolve that following changes were done:

1. `SettingsObjectFieldItemTableRow` was not passing the onEdit with url
to `SettingsObjectFieldActiveActionDropdown` to redirect on clicking it.
So passed onEdit there.
2. `SettingsObjectFieldActiveActionDropdown` was not implementing the
onEdit functionality, so implemented that by creating `handleEdit()`
function.
3. `SettingsObjectFieldEdit` was assuming only `activeObjectMetadata
`will be coming to render on page. So, when inactive object was accessed
the path not found error message was thrown. Thus did changes to manage
both active and inactive objects by generalizing the
              `activeObjectMetadata ` ->  `objectMetadata` 
               `activeMetadataField `-> `metadataField`.
4. `findObjectMetadataItemBySlug `function was written inside
`useFilteredObjectMetadataItems` for fetching active/inactive object.
5. Updated `SettingsObjectFieldEdit` button to show and change the
active to inactive state and vice versa.
6. Test was written for `findObjectMetadataItemBySlug`.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-18 12:01:21 +02:00
Shreyansh Kumar
df8bb84b35
Verification popup can be activated multiple times (#6938)
Fixes https://github.com/twentyhq/twenty/issues/6912

By clicking Enter key over and over, user can repeat action Expected:
When 'yes' is typed in popup and user clicks Enter key once, popup
should disappear and correlated action should be performed only once

Implementation:
- Added loading state for buttons onClick and onEnter to disable the
button when the "Delete Api Key" and "Regenerate Api Key" function is
called.
- Added a new function to handle modal close and logic handling on
clicking enter key.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-18 10:48:49 +02:00
Faisal-imtiyaz123
72ab6bcf35
Fixes resetting of scroll position in RecordShowPage due to opening of some dropdowns (#6890) (#6906)
fixes #6890

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-18 10:35:13 +02:00
Pacifique LINJANJA
601e15f028
Feat(frontend): improve the soft delete empty state (#6877)
# This PR

- Fix #6834 

## Demo


https://www.loom.com/share/235c4425f3264f429e2064a9d1604a90?sid=02a815c9-3b1a-45e6-b5ce-d5eb3b40e10e

## Notes

- There is a missing icon in Figma corresponding to the
`noDeletedRecordFound` in the dark mode, thus I used the same icon
(different background because we have the correct background image) for
both dark / light modes
<img width="625" alt="Screenshot 2024-09-03 at 15 04 57"
src="https://github.com/user-attachments/assets/cbc0c3dd-a1ee-49a5-be9a-36450e78a992">
cc: @Bonapara

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-18 09:39:39 +02:00
Charles Bochet
9c885861a3 Add logs to troubleshoot performances issues 2024-09-18 00:10:35 +02:00
Raphaël Bosi
7cdf2dc4ec
7092 destroy connected account instead of soft deleting it (#7099)
- Create `destroyOne` endpoint
- Call `destroyOne` when removing a `connectedAccount`
2024-09-17 18:30:40 +02:00
gitstart-app[bot]
c42ea57b97
New Settings Layout (#6867)
#### \
Description

- **Added "Exit Settings" Back Button**: Introduced a new back button
labeled "Exit Settings" for easy navigation back to the app content.
- **Implemented Settings Navbar Breadcrumb**: A breadcrumb navigation
bar for each settings page has been added to improve navigation within
the settings. This ensures users can easily trace their location within
the settings.
- **Persistent CTA Zone**: The Call-to-Action (CTA) zone at the top of
the page now remains visible even when the user scrolls down, preventing
unresponsive behavior and improving accessibility.
- **Page Title**: The page title has been added to each settings page
and separated from the breadcrumb, following the app's layout standards.
- we could not reproduce the Billing and CMR Migrations settings on the
app, but we updated the files according, please let's us know if is
there any way to log in with access to these pages, or if is everything
ok.
- Some breadcrumbs are not following the Figma, are following the
current app sections isntead, because we would need to change the
sidebar structure, and we should not do it on this PR

### Demo


<https://www.loom.com/share/21b20a2cd2f3471e94d61563c9901b19?sid=9dc49456-6cae-48e1-9149-8d706f00ab65>

### Refs:

#6144

Fixes #6144

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-17 18:29:00 +02:00
Marie
fe4ca2133d
Fix search on email (#7094)
following email (text field type) -> emails (emails field type -
composite) migration!

closes https://github.com/twentyhq/twenty/issues/7080
2024-09-17 14:57:34 +02:00
nitin
3c306e9be8
relations header button to appear at all times for mobile devices (#7044)
fixes #7036
2024-09-17 11:51:13 +02:00
Marie
dcac832616
[Emails migration] Fix email field migration (#7065)
Fix email field migration

- Remove deprecated field of type Email
- Add standard emails field on person to person views in position 4
2024-09-16 19:35:13 +02:00
Harshit Singh
b0c9b9ebe2
fix: page header accessible when deleting webhook (#6985)
## Description

This PR resolves the issue #6817 

- while deleting webhook, page header is still accessible for both
mobile viewport and large devices
- When creating a webhook, save or cancel state is not accessible due to
page header being overflowed.
- Setting state breaks spaces resulting due to `max-width`

## Current Behaviour


https://github.com/user-attachments/assets/991b29ac-df1b-4250-8c83-444a36148a7f

<img width="430" alt="Screenshot 2024-09-11 at 4 23 51 PM"
src="https://github.com/user-attachments/assets/b2cadd50-7b0d-4b8e-86ff-cffedce65c91">

<img width="427" alt="Screenshot 2024-09-11 at 4 24 12 PM"
src="https://github.com/user-attachments/assets/fcb6dd71-bd3f-4307-82a1-29711688a2e7">

## Expected behavior


https://github.com/user-attachments/assets/cbac0b56-578f-49d5-a092-84f936016ca6

<img width="427" alt="Screenshot 2024-09-11 at 4 24 26 PM"
src="https://github.com/user-attachments/assets/e8eda096-c6d8-4e97-8c0b-44c522567d26">

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-09-16 17:55:49 +02:00