Commit Graph

2220 Commits

Author SHA1 Message Date
Weiko
2f223f3294
Fix 'name' column wrongly added in standard objects (#7428)
## Context
Name shouldn't be added to all tables, especially standard objects
because they already have their own labelIdentifierFieldMetadata
specified in the workspace-entity schema. This PR removes this column
from the "base" list of columns to add when creating a new object/table
and moves it to the object-metadata service that is, as of today, only
used for custom objects. Also had to modify the migration-runner to
handle column creation in a table creation migration (this was available
in the migration definition already but was not doing anything)

This also fixes an issue in standard objects that already have a "name"
field defined with a different field type, this is even more important
when the said field is a composite field. For example people already has
a FULL_NAME name field which clashes with the default TEXT name field
meaning it was only creating 1 field metadata for 'name' but 3 columns
were created: `name, nameFirstName, nameLastName`. This inconsistency
with metadata (which is our source of truth everywhere) brought some
issues (lately, converting back typeorm response to gql (including
composition) was broken).
2024-10-04 18:31:19 +02:00
Harshit Singh
424c4890b0
fix: New Relation Design hot fix (#7423)
## Description

- This PR solves the issue #7353 

- [x]  Improved layout for mobile and desktop

-    [ ] Added tooltip on hover

---------

Co-authored-by: Nitin Koche <nitinkoche03@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-04 16:38:15 +02:00
Weiko
511150a2d3
Refactor graphql query runner and add mutation resolvers (#7418)
Fixes https://github.com/twentyhq/twenty/issues/6859

This PR adds all the remaining resolvers for
- updateOne/updateMany
- createOne/createMany
- deleteOne/deleteMany
- destroyOne
- restoreMany

Also
- refactored the graphql-query-runner to be able to add other resolvers
without too much boilerplate.
- add missing events that were not sent anymore as well as webhooks
- make resolver injectable so they can inject other services as well
- use objectMetadataMap from cache instead of computing it multiple time
- various fixes (mutation not correctly parsing JSON, relationHelper
fetching data with empty ids set, ...)

Next steps: 
- Wrapping query builder to handle DB events properly
- Move webhook emitters to db event listener
- Add pagination where it's missing (findDuplicates, nested relations,
etc...)
2024-10-04 11:58:33 +02:00
gitstart-app[bot]
8afa504b65
Add Skeleton loading for side panel (#7394)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7112](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7112).

 --- 


### Description

- To test you can use `await new Promise(r => setTimeout(r, 5000));`
line 74 of \`openCreateActivityDrawer.ts\`
- We added a recoil state to define the loading status
- Design points to note:

1 - We did not change the chip component styles because would be
unrelated to the issue can you confirm if you still need this change?


![](https://assets-service.gitstart.com/28455/c5999ef1-a7fc-4c53-b425-d0588092ba90.png)

2- In Figma, the loading state shows the Chip rendering an initial name
before showing the loaded name, currently, we are rendering the correct
name while loading, the change that makes this possible is below


![](https://assets-service.gitstart.com/28455/a0e14045-9a14-4d19-9570-62781fba1aa4.png)

if we set it as null, the initial name would appear, but also the
previous data in the state would affect the UI, passing the
`activityObjectNameSingular` data allows us to clear the previous data,
and make the Chip instantly updated, let us know if this behavior is
fine, or if you still want an initial name to be rendered while is
loading.

3 - Currently, the loading state of the tabs does not affect the
selected tab (auto-defined by the component) should we change this logic
for all Tabs used in the app, or make this behavior optional by using
props?


![](https://assets-service.gitstart.com/28455/223c2e9f-3f4b-4107-b40d-f98a95266d5d.png)

### Demo


<https://www.loom.com/share/590df738a8ec41e6b64232bde237c01f?sid=7f8f4e40-ec82-4282-a43d-452a1cf27f4a>

### Refs

#7112

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: gitstart-twenty <140154534+gitstart-twenty@users.noreply.github.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-10-04 11:41:05 +02:00
gitstart-app[bot]
97eff774bd
Allow input and display of floats for Number fields (#7340)
### Description

- We added a decimal field for a Number Field type in the settings
- We updated the Number Field type create a form with decimals input
- We are not implementing the dropdown present on the Figma because it
seems not related

### Demo


<https://www.loom.com/share/18a8d4b712a14f6d8b66806764f8467f?sid=3fc79b46-ae32-46e3-8635-d0eee02e53b2>

Fixes #6987

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-10-04 10:45:25 +02:00
nitin
e3ed574420
minor fix - reset single entity search (#7420)
minor follow up fix #7285

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-03 22:31:03 +02:00
sid0-0
a946c6a33d
fix: validate emails in record-fields (#7245)
fix: #7149 

Introduced a minimal field validation framework for record-fields.
Currently only shows errors for email field.

<img width="350" alt="image"
src="https://github.com/user-attachments/assets/1a1fa790-71a4-4764-a791-9878be3274f1">
<img width="347" alt="image"
src="https://github.com/user-attachments/assets/e22d24f2-d1a7-4303-8c41-7aac3cde9ce8">

---------

Co-authored-by: sid0-0 <a@b.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-03 18:55:29 +02:00
nitin
04579144ca
Kanban card creation followup (#7285)
@Bonapara #7002
@FelixMalfait  #6316 
;)

Naming could be improved, do let me know!


https://github.com/user-attachments/assets/b10c9120-644d-4943-bc65-ec0d62f9986f
2024-10-03 17:50:54 +02:00
Marie
5f9435c718
Search (#7237)
Steps to test

1. Run metadata migrations
2. Run sync-metadata on your workspace
3. Enable the following feature flags: 
IS_SEARCH_ENABLED
IS_QUERY_RUNNER_TWENTY_ORM_ENABLED
IS_WORKSPACE_MIGRATED_FOR_SEARCH
4. Type Cmd + K and search anything
2024-10-03 17:18:49 +02:00
Keerat Kohli
4c250dd811
Fixes #7220: Remove primary banner icon when only one value present (#7275)
## Changes
- Added a check to make sure that we only indicate an entry is primary
if there is more than one value.

- The banner icon now only displays when there are either **2 or more
emails, phone numbers, or domains.**

## Emails

![image](https://github.com/user-attachments/assets/54832aaf-a319-4b70-87bf-3621e05f1637)


![image](https://github.com/user-attachments/assets/44bb8909-9f34-426d-8942-2bb7974e9113)

## Phones

![image](https://github.com/user-attachments/assets/85ca4c36-c148-4d86-89d6-1c02a960f2f4)


![image](https://github.com/user-attachments/assets/f11b5c2e-4376-4bf6-8560-e4c956f2c2e5)

## Domains

![image](https://github.com/user-attachments/assets/ce324714-6bd7-45ac-9a2f-8a2671d080a0)


![image](https://github.com/user-attachments/assets/153883a3-782f-424b-abc4-d882ec969bc2)

## Notes
This is my first time contributing so I am open to any feedback.

Co-authored-by: Keerat Kohli <kkeerat012@gmail.com>
2024-10-03 17:17:45 +02:00
Harshit Singh
8350e7d808
fix: Toggle not visible in light mode (#7322)
> [!Note]
> - This PR solves the issue #7321 
> - Added a minor fix in color background of toggle

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-03 16:35:18 +02:00
martmull
62fe1d0e88
6653 serverless functions store and use environment variables in serverless function scripts (#7390)
![image](https://github.com/user-attachments/assets/a15bd4c1-3db4-4466-b748-06bdf3874354)

![image](https://github.com/user-attachments/assets/71242dfb-956b-43ed-9704-87cb0dfbc98d)
2024-10-03 13:56:17 +02:00
Harshit Singh
3cd24d542b
Resolved Typescript console errors (#7408)
## Description

- This PR addresses the issues-
   - #7404 
   -  #7359 
   - and builds on the existing logic from PR #7360
   
- Handled the 4 Ts console errors

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-03 12:02:51 +02:00
Ngan Phan
da69317837
fix: zero showing in record cell and page (#7384)
This PR fixes zero being displayed as empty in record cell and show page
in currency field #6802
I checked graphql resquests and the data is stored in the correct form
(0 or null). The problem only lies in the front end and how the field is
null checked.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-03 11:41:50 +02:00
Prakhar Sharma
b8e406c13a
Fixed button group spacing of dropdown button (#7409)
#7386

---------

Co-authored-by: Nitin Koche <nitinkoche03@gmail.com>
2024-10-03 02:41:24 +05:30
Vardhaman Bhandari
2e962f8e0e
Vertically center Kanban card titles in compact mode (#7391)
This PR addresses the issue of[ Kanban card titles not being vertically
centered in compact
mode](https://github.com/twentyhq/twenty/issues/7385). The following
changes have been made:

Updated CSS styles to ensure that titles are properly aligned vertically
within their respective cards when in compact mode.
Enhanced overall readability and aesthetics of the Kanban board.
#7385


![after-fix](https://github.com/user-attachments/assets/0d88d3c9-5f41-42de-a7a6-9434fd65bd38)

Co-authored-by: Nitin Koche <nitinkoche03@gmail.com>
2024-10-03 01:52:45 +05:30
Gaz Jones
b39d262058
fix: replace defaultProps with default parameters in SpreadsheetImport (#7406)
This PR addresses https://github.com/twentyhq/twenty/issues/6827

React has deprecated the use of `defaultProps` on function components
and will remove support in a future major release. This commit replaces
the usage of `defaultProps` in the `SpreadsheetImport` component with
default parameters to fix the following warning:

**Changes:**

- Removed `SpreadsheetImport.defaultProps =
defaultSpreadsheetImportProps;`
- Merged `defaultSpreadsheetImportProps` with incoming `props` using
object spread syntax.
- Adjusted the component to use the merged props (`mergedProps`) instead
of `props`.
2024-10-02 20:30:39 +02:00
nitin
83e43366bb
Delete button in right drawer / side pannel (#7200)
fixes #7069 
@Bonapara 


https://github.com/user-attachments/assets/b1b57070-1ef4-4cc3-9907-028219245558

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-02 20:22:55 +02:00
gitstart-app[bot]
35788af351
TWNTY-6808 - Ability to Filter by Creation Source (#7078)
### Description

- Ability to Filter by Creation Source

### Demo

LOOM:
<https://www.loom.com/share/dba9c3d37a4242fe90f977b1babffbde?sid=59b07c51-d245-43cc-bb38-7d898ef72878>

### Refs

#6808

Fixes #6808

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: gitstart-twenty <140154534+gitstart-twenty@users.noreply.github.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-10-02 17:56:09 +02:00
gitstart-app[bot]
23001ac17d
Settings Advanced Mode (#7130)
### Description

- We implemented the Advanced Mode state and used this on a section of
the settings sidebar
- in DefaultLayout.tsx, was updated because of the 64 + 16(container
size of IconTool + the margins)

### <https://jam.dev/c/29bcec70-0b7f-4afa-98e6-9755657cf09d>

### Refs

#6147 

Fixes #6147

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: gitstart-twenty <140154534+gitstart-twenty@users.noreply.github.com>
2024-10-02 17:04:07 +02:00
Ngan Phan
57eaa01d35
Adjust Floating Input Padding and Border Color (#7328)
This PR fix the padding and border color of floating text input #7286 
The text area automatically has padding of 4px so I reset it to 0 and
adjusting container padding to 8px.
2024-10-02 09:39:46 +02:00
Yura Levchenko
d7dd41e7e4
Changed condition on which 'Add task' button is displayed (#7333) (#7362)
This PR addresses issue #7333. It updates the condition for displaying
the 'Add task' button. The button is now only visible for the 'TODO'
section or when no 'TODO' block is present (i.e., there are no tasks in
this category).
Additionally, I removed the unused showAddButton, which is no longer
necessary due to the updated logic.

![image](https://github.com/user-attachments/assets/571542d7-1b0f-4b91-afcf-4592490f1f72)

![image](https://github.com/user-attachments/assets/46974459-d3cd-497a-a6b6-9302cbff7716)

---------

Co-authored-by: Nitin Koche <nitinkoche03@gmail.com>
2024-10-02 08:58:51 +02:00
Baptiste Devessier
35361093bf
Delete workflow step (#7373)
- Allows the deletion of triggers and steps in workflows. If the
workflow can not be edited right now, we create a new draft version.
- The workflow right drawer can now render nothing. It's necessary to
behave that way because a deleted step will still be displayed for a
short amount of time in the drawer. The drawer will be filled with blank
content when it disappears.


https://github.com/user-attachments/assets/abd5184e-d3db-4fe7-8870-ccc78ff23d41

Closes #7057
2024-10-01 18:14:54 +02:00
Harshit Singh
3a0c32a88d
fix: Remove many to many relation option (#7360)
## Description

- This PR addresses the issue #7359
2024-10-01 15:58:19 +02:00
nitin
c505a8edd2
minor fix - fixed forwardRef and unique key console errors (#7337)
context -  #7183
2024-10-01 15:53:59 +02:00
Thomas des Francs
a940912edb
Github banner (#7371) 2024-10-01 15:29:35 +02:00
Charles Bochet
4008f8f40e
Add redis to contributor guide (#7369)
## Context

We are adding redis to default twenty configuration. 

## What

1. This PR sets up the local setup for contributors accordingly

2. I'm also updating the code blocks guide:

Before:
<img width="921" alt="image"
src="https://github.com/user-attachments/assets/2203cc99-b5a5-4d05-a8b1-98a348aee9df">


After:
<img width="921" alt="image"
src="https://github.com/user-attachments/assets/5b3e6f34-723d-4309-888b-c02ce794891d">
2024-10-01 15:21:45 +02:00
Baptiste Devessier
cde255a031
Add workflow email action (#7279)
- Add the SAVE_EMAIL action. This action requires more setting
parameters than the Serverless Function action.
- Changed the way we computed the workflow diagram. It now preserves
some properties, like the `selected` property. That's necessary to not
close the right drawer when the workflow back-end data change.
- Added the possibility to set a label to a TextArea. This uses a
`<label>` HTML element and the `useId()` hook to create an id linking
the label with the input.
2024-10-01 14:22:14 +02:00
Sachin
0d570caff5
Fix cursor should not be pointer when record image identifier is not Editable (#7320)
- This PR solves the issue Cursor should not be "pointer" when record
image identifier is not editable #7277

---------

Co-authored-by: Sachin KS <mac@apples-MacBook-Air.local>
2024-10-01 09:02:13 +02:00
Thomas Trompette
ca027d6772
Add output to workflow run (#7276)
Example of output stored for following workflow:

<img width="244" alt="Capture d’écran 2024-09-27 à 11 18 06"
src="https://github.com/user-attachments/assets/722bfa96-2dd1-41f7-ab87-d39584ac9efc">

Output:

```
{"steps": [
  {"type": "CODE", "result": {"email": "test@twenty.com"}}, 
  {"type": "SEND_EMAIL", "result": {"success": true}}
]}
```
2024-09-30 18:45:44 +02:00
Weiko
06d4ba92e5
increase export feature page size (#7341)
## Context
Now that we have improved performances, we can increase the export
feature page size from 30 to 200 (and probably above if results are
good). This should be ok since we are only querying the first level of
an object and omit relations.
I've moved this value to a constant.
2024-09-30 15:45:17 +02:00
Harshit Singh
95e1053b7a
fix: Title overflows in mobile viewport for right drawer (#7311)
## Description

- This PR solves the issue #7310
2024-09-30 12:13:33 +02:00
Charles Bochet
1e4ed1e96f
Tag main as 0.31 canary (#7332)
We are updating our git worklow.

Case 1: **URGENT / PATCH**
If you want to include something URGENT that cannot wait for the next
release, you'll need to:
- create a PR from the latest patch (right now v0.30.1)
- create a new patch tag from this PR (would be v0.30.2 right now)
- merge this PR in main so it's in 0.31 too

Case 2: **REGULAR**
- Open a PR from main and merge it into main

I'm tagging main as v0.31.canary to make it clear!
2024-09-30 11:42:06 +02:00
Baptiste Devessier
5d1208f8af
Set default zoom to workflows (#7331)
## Improvements

- This PR calls `fitView` when the Reactflow component inits. It tries
to fit the flow in a view with a fixed min and max zoom.
- Every time the WorkflowDiagramCanvas is rendered for a different
`workflowVersionId`, the `fitView` will be re-called. This is
implemented with a React `key`.
- The canvas will be re-rendered when an activated/deactivated version
is updated (and a new draft version is created.)
- It will also be re-rendered when the user selects another workflow
version and this doesn't cause the `WorkflowDiagramCanvas` component to
unmount. It happens if the user wants to go the previous or next
workflow or workflow version.

## Previous Behavior

![CleanShot 2024-09-30 at 10 32
06@2x](https://github.com/user-attachments/assets/ea43cd43-8c9c-491c-a535-8cca9168fb22)

## New Behavior

![CleanShot 2024-09-30 at 10 26
47@2x](https://github.com/user-attachments/assets/7bfb91b2-1782-47a1-ab5a-3eaa9f1be923)


https://github.com/user-attachments/assets/cb73f456-58b1-49c3-bd31-a1650810e9dd

## Notes

Closes #7047

This PR is a simplification of #7151. We'll have to improve the way we
manage zoom in another PR.
2024-09-30 11:24:57 +02:00
Vardhaman Bhandari
04adcbc521
Fix icon resizing issue for Notes and Tasks (#7318)
This pull request addresses a [resizing issue with the Notes and Tasks
icons](https://github.com/twentyhq/twenty/issues/7282). Previously, the
icons would change size based on the length of the title or when the
column width was adjusted, leading to inconsistent UI behavior. This
update ensures that the icons maintain a stable size, enhancing the
overall user experience.

Solves Issue : #7282


[twenty-icon-sizing-issue.webm](https://github.com/user-attachments/assets/3ef59592-4dfb-463e-bc7b-a803ee105211)
2024-09-30 11:23:55 +02:00
Baptiste Devessier
eb04925f06
Remove useless hook call (#7278)
Hook is no longer used after #7236
2024-09-30 10:50:42 +02:00
nitin
dd24662590
Remove extra Billing title (#7309)
fixes #7305
2024-09-30 14:15:57 +05:30
Lucas zapico
b5fff7f23a
docs: enhance localhost documentation with REST API URL (#7317)
- Add callout for local REST API URL alongside the GraphQL API URL.
- This change aims to reduce confusion and complexity for the
self-hosted community.

**Associated Issue - "(Docs) Enhance local hosting docs with reference
to the REST API URL as well as the Graphql API URL [#7316]"**
2024-09-29 11:33:45 +02:00
Charles Bochet
c2a8cd0a2f
Support Emails and Phones in Spreadsheet import (#7312)
This is a fast follow on v0.30 release:
- removing phone (deprecated PHONE field type) search from command menu.
I could have replaced it by a phone (PHONES field type) search but as we
are about to release the new search in v0.31 it does not seem to worse
the investment
- supporting EMAILS and PHONES field types in spreadsheet import

Note: while working on Spreadsheet import I found the code quite complex
and with areas having duplicated code. It does not seem to be a high
priority as I was able to maintain it at a low cost but it's not a
peaceful code surface to navigate!
2024-09-28 16:11:10 +02:00
Charles Bochet
e4959ad534
Add 0.30 release notes (#7300)
In this PR:
- update your environment variables to default `CACHE_STORAGE_TYPE` to
`redis` and `MESSAGE_QUEUE_TYPE` to `bull-mq`
- add redis container to our default docker-compose
- add `REDIS_HOST` and `REDIS_PORT` to docker-compose yaml
- add upgrade instructions
2024-09-27 19:10:26 +02:00
Weiko
ae6777fab8
Fix viewFilter operand for dateTime fields (#7306) 2024-09-27 19:10:18 +02:00
Raphaël Bosi
942281f4b0
Fix email migration (#7298)
Checks if person standard email field exists before running the
migration.
2024-09-27 17:20:15 +02:00
Marie
e28d8dd952
Fix standardId issues with phones field migration (#7294)
Co-authored-by: Weiko <corentin@twenty.com>
2024-09-27 16:52:06 +02:00
Raphaël Bosi
9f477129e2
Fix use object metadata item (#7297)
Fixes a bug which happened during workspace creation and remove
duplicated code
2024-09-27 16:42:35 +02:00
ad-elias
9d36493cf0
Date filter improvements (#5917) (#7196)
Solves issue #5917.

This PR is now ready for the first review!

Filters do not fully work yet, there's a problem applying multiple
filters like the following:

```
{
  and: [
    {
      [correspondingField.name]: {
        gte: start.toISOString(),
      } as DateFilter,
    },
    {
      [correspondingField.name]: {
        lte: end.toISOString(),
      } as DateFilter,
    },
  ],
}
```

I'll do my best to dig into it tonight!

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-27 15:57:38 +02:00
Raphaël Bosi
c9c2f32922
7154 deleted event is not emitted when calling destroyone (#7159)
Closes #7154
2024-09-27 15:52:04 +02:00
nitin
ca906bbf6b
5922 - UI Overlap and State Persistence in Filter Menus (#7270)
fixes #5922 


https://github.com/user-attachments/assets/07d088da-cefb-4d87-9016-e14cef18567d
2024-09-27 14:20:21 +02:00
Rishi Kant
c4762c3921
Add Header to Email & Calendar Tabs #7288 (#7293)
# Fix: 7288 - Add Header to Email & Calendar Tabs (No Account Connected)

## Description
Added a header to the **Email** and **Calendar** tabs when no account is
connected, matching the style and spacing of the account page to prevent
layout issues when switching between pages.

### Header Content:
- **Connected Accounts**
- **Manage your internet accounts**

## Screenshot:
<img width="1440" alt="Screenshot 2024-09-27 at 5 20 55 PM"
src="https://github.com/user-attachments/assets/0c641dd6-e17f-47c4-9e30-45a3f8a9eac9">


Fixes #7288

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-27 14:09:33 +02:00
Harshit Singh
c6d763ede9
fix: Cursor pointer on Settings cards (#7291)
> [!Note]
> This PR solves the issue #7289
2024-09-27 13:33:33 +02:00
Félix Malfait
2f41e1405f
Change tinybird event format (#7272)
Separate pageview analytics from core events
2024-09-26 17:23:58 +02:00
Félix Malfait
a10324cbd3
Fix analytics (#7271)
Incorrect check
2024-09-26 16:42:16 +02:00
Raphaël Bosi
0e375d9021
Add phone fields migration command to 0 30 (#7269)
Add phone fields migration command to 0 30
2024-09-26 15:26:58 +02:00
Thomas Trompette
6736ca784b
Update clean view command + add dry run to favorite backfill (#7268)
Clean favorites associated with activities
2024-09-26 15:00:47 +02:00
Marie
c1db435a79
Fix email migration script (#7267) 2024-09-26 14:36:19 +02:00
Raul Villarreal
d504a6c437
Fix: Remove 'Soon' integrations from Settings when disabled (#7259)
## Description
This PR addresses issue #7110, where Airtable, Stripe and PostgreSQL
integrations were showing as "Soon" under Settings > Integrations.

## Changes

- Update `getSettingsIntegrationAll` so that when these integrations are
disabled (via feature flags), they are removed from the list instead of
showing as "Soon".
<img width="569" alt="Screenshot 2024-09-25 at 11 21 07 a m"
src="https://github.com/user-attachments/assets/dae34e1f-b231-4e0c-bbd0-7d43a6a2f94a">

- Tweaked `useSettingsIntegrationCategories` to only show the "All"
category if there's at least one integration enabled.
<img width="582" alt="Screenshot 2024-09-25 at 11 21 15 a m"
src="https://github.com/user-attachments/assets/57b87b18-8018-49e5-a507-527f2e6e701b">

## Notes
This is my first contribution to the project, so I'm open to feedback! 😄
Let me know if there's anything I should tweak or improve.
2024-09-26 11:19:12 +02:00
Ana Sofia Marin Alexandre
16bb1f22e4
Connect EventTracker to TB endpoint (#7240)
#7091 
EventTrackers send information of events to the TinyBird instance:

In order to test:

1. Set ANALYTICS_ENABLED= true and TELEMETRY_ENABLED=true in
evironment-variables.ts
2. Set the TINYBIRD_TOKEN in environment variables (go to TiniyBird
Tokens)
3. Log in to twenty's TinyBird and go to datasources/analytics_events in
twenty_analytics workspace
4. Run twenty and navigate it
5. New events will be logged in the datasources, containing their
timestamp, sessionId and payload.

<img width="1189" alt="Screenshot 2024-09-24 at 17 23 01"
src="https://github.com/user-attachments/assets/85375897-504d-4e75-98e4-98e6a9671f98">
Example of payload when user is not logged in

```
{"hostName":"localhost",
"pathname":"/welcome",
"locale":"en-US",
"userAgent":"Mozilla/5.0",
"href":"http://localhost:3001/welcome",
"referrer":"",
"timeZone":"Europe/Barcelona"}
```
Example of payload when user is logged in
```
{"userId":"2020202",
"workspaceId":"202",
"workspaceDisplayName":"Apple",
"workspaceDomainName":"apple.dev",
"hostName":"localhost",
"pathname":"/objects/companies",
"locale":"en-US",
"userAgent":"Mozilla/5.0Chrome/128.0.0.0Safari/537.36",
"href":"http://localhost:3001/objects/companies",
"referrer":"",
"timeZone":"Europe/Paris"}
```

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-26 10:53:10 +02:00
ad-elias
c9e882f4c0
Fix LinkedIn URL special character formatting (#7249)
Before:
<img width="348" alt="link-formatting-before"
src="https://github.com/user-attachments/assets/500344e9-09f2-4a3e-99cc-6a3f1eb2685b">

After:
<img width="348" alt="linkedin-formatting-after"
src="https://github.com/user-attachments/assets/b5d845c8-8f25-493b-8fe1-ed79f3c0bbdd">

Co-authored-by: Nitin Koche <nitinkoche03@gmail.com>
2024-09-25 18:40:04 +02:00
nitin
7752510316
Kanban card creation revamp (#7169)
fixes #6957
2024-09-25 18:30:39 +02:00
sid0-0
89b50c020f
Fixing last column width in table-view (#7258)
fixes: #7160 

`table-layout: fixed` requires a width, added that.

Screenshots:
<img width="1509" alt="image"
src="https://github.com/user-attachments/assets/edb4f900-bc83-4aa4-bcce-85d73c0015d6">
<img width="1507" alt="image"
src="https://github.com/user-attachments/assets/79b28ad1-2a02-4d85-b991-55c545adaa36">

Small screen:
<div style="display:flex;">
<img width="40%" alt="image"
src="https://github.com/user-attachments/assets/26234bdc-163f-48ba-a04d-eef3b9112de6">
<img width="40%" alt="image"
src="https://github.com/user-attachments/assets/4fe653d1-703d-4ef6-b256-30996de1fa13">
</div>

---------

Co-authored-by: sid0-0 <a@b.com>
2024-09-25 18:25:58 +02:00
Baptiste Devessier
729c990546
Activate/Deactivate workflow and Discard Draft (#7022)
## Setup

This PR can be tested only if some feature flags have specific values:

- `IsWorkflowEnabled` equals `true`
- `IsQueryRunnerTwentyORMEnabled` equals `false`

These feature flags weren't committed to don't break other branches.

## What this PR brings

- Display buttons to activate and deactivate a workflow version and a
button to discard the current draft version. I also scaffolded a "Test"
button, which doesn't do anything for now.
- Wired the activate, deactivate and discard draft buttons to the
backend.
- Made it possible to "edit" active and deactivated versions by
automatically creating a new draft version when the user tries to edit
the version.
- Hide the "Discard Draft", button if the current version is not a draft
or is the first version ever created.
- On the backend, don't consider discarded drafts when checking if a new
draft version can be created.
- On the backend, disallow deleting the first created workflow version.
Otherwise, we will end up with a blank canvas in the front end, and it
will be impossible to recover from it.
- On the backend, disallow running deactivation steps if the workflow
version is not currently active. Previously, we were throwing, which is
unnecessary as it's a valid case.

## Spotted bugs that we must dive into

### Duplicate workflow versions in Apollo cache


https://github.com/user-attachments/assets/7cfffd06-11e0-417a-8da0-f9a5f43b84e2

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-25 18:09:31 +02:00
Harshit Singh
75b493ba6c
fix: Values field card lacks width in mobile viewports (#7248)
## Description

- This PR fixes the issue #7230 

## Current Behaviour
<img width="411" alt="Screenshot 2024-09-24 at 9 51 42 AM"
src="https://github.com/user-attachments/assets/65d283b8-24fa-4e25-b3bd-2e35efabf768">

## After

<img width="556" alt="Screenshot 2024-09-25 at 10 38 40 AM"
src="https://github.com/user-attachments/assets/97a32497-4230-438f-b048-707bdcd9b674">

<img width="578" alt="Screenshot 2024-09-25 at 10 38 52 AM"
src="https://github.com/user-attachments/assets/74e7d055-96fc-4bf4-bddc-e84cf03a6599">
2024-09-25 17:56:47 +02:00
Raphaël Bosi
3d5ecc9c08
7242 error when displaying message threads with a large number of participants (#7251)
Closes #7242
2024-09-25 16:53:18 +02:00
Weiko
7669b40543
Fix calendar page without account (#7256)
More details in this PR https://github.com/twentyhq/twenty/pull/7202

We(I) forgot to fix on the calendar page.
2024-09-25 16:15:52 +02:00
Marie
e1cb82bb23
[Phones migration](fix) update label of standard field by using raw query (#7255) 2024-09-25 16:09:55 +02:00
Marie
97ce100fa2
[Phone field migration][fix] Update field label (#7247) 2024-09-25 14:06:03 +02:00
Thomas Trompette
49b5e53ceb
Add index key to tasks and notes views (#7241)
Missing INDEX key for some tasks and notes views. We need it to backfill
favorites.
2024-09-25 11:51:25 +02:00
ad-elias
092496f2db
'Display as relative date' field formatting option for dateTime and date fields #5398 (#6945)
Implements #5398.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-25 11:42:16 +02:00
Marie
b3a0cba961
[Phones migration][Fix] Remove field from view after creation (#7243) 2024-09-25 11:31:07 +02:00
Harshit Singh
7c90e717d6
fix: Phone dropdown field has extra width (#6866)
## Description

This PR solves the issue #6865 

## Current Behaviour
<img width="486" alt="Screenshot 2024-09-03 at 2 04 55 AM"
src="https://github.com/user-attachments/assets/c88f3c22-0b18-4974-a4ea-94ecd5f1379d">

## Expected behavior
<img width="518" alt="Screenshot 2024-09-03 at 2 05 46 AM"
src="https://github.com/user-attachments/assets/2a6cb64a-7858-4607-85a4-0214aeacc2ab">
2024-09-24 17:21:29 +02:00
Marie
825dfeb400
[fix][Phone field migration] Use "Phones" in new field label (#7239) 2024-09-24 17:20:15 +02:00
Falgun Patel
fd6740fa88
fix issue (#7152 : Improve relation empty states on record page) (#7157)
- "No xxx" removed for empty relations
- All(0) removed

---------

Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com>
2024-09-24 17:02:58 +02:00
Harshit Singh
2fedf0d2fc
fix: onEnter creating new function page in settings (#7236)
## Description

- This PR solves the issue #7235 
- On pressing enter, it automatically redirected to New function page in
settings
2024-09-24 16:43:03 +02:00
gitstart-app[bot]
fa241fa4e9
Handle migration of Phone field to Phones field (#7128)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-6260](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6260).
This ticket was imported from:
[TWNTY-6260](https://github.com/twentyhq/twenty/issues/6260)

 --- 

### Description

This is the second PR on TWNTY-6260 which handles data migration of
Phone field to Phones field.\
\
How to Test?\
 Follow the below steps:

- On the main branch, 
- go to
`packages/twenty-server/src/database/typeorm-seeds/workspace/people.ts`
and change any person's phone number to a string with characters for
example: "test invalid phone", and then reset the DB.
  - reset database using `npx nx database:reset twenty-server`
- This is to make sure that invalid numbers will be handled properly. We
should use the invalid value itself to avoid removing data and see how
the behavior is on the front end. should be the same as in the main, the
display shows the invalid value, but the input is empty when you click,
and then you can update.
- Checkout to `TWNTY-6260-phone-migration` branch
- Rebuild typescript using `npx nx build twenty-server`
- Run command `yarn command:prod upgrade-0.32` to do migration
- Run both backend and frontend to see the migrated field

### Demo

- **Loom Video:**\

<https://www.loom.com/share/4b9bcb423cee447d8ad09852a83b27da?sid=ed74ecaa-0339-4575-acdc-a863e95e94fd>

### Refs

#6260

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
Co-authored-by: Weiko <corentin@twenty.com>
2024-09-24 16:31:30 +02:00
Raphaël Bosi
b83f0f46e5
Add try catch around messaging monitoring cron and fix decorators (#7207)
Add try catch around messaging monitoring cron and fix
decorators:`@Process` and `@SentryCronMonitor` were inverted.
2024-09-24 16:29:05 +02:00
Raphaël Bosi
4d31995564
Remove shouldUseEmailsField (#7208)
Remove shouldUseEmailsField. This boolean was used to ensure
retro-compatibility with the old email field. It is no longer needed.
2024-09-24 16:03:43 +02:00
Rishi Kant
8385d3cfdf
fix: #7226 - Improve photo uploader design (#7234)
## Description

### Changes Made

- **Icon Size and Style**: Resized the icon**.
- **Icon Update**: Changed to **photo-up**.
- **Background Color**: Set to **transparent light**.
- **Hover Background Color**: Set to **transparent medium**.
- **Border**: Set to **Border/medium**.
- **Icon Color on Hover**: Set to **light** and **tertiary**.

## Preview of the changes made -

https://github.com/user-attachments/assets/72219531-7ffe-47b5-bae9-216764df68ee
2024-09-24 15:45:59 +02:00
Harshit Singh
c3e79e54b5
fix: Appearance Settings Cropped Card (#7232)
## Description

- This PR fixes the issue #7198

## Before 
<img width="592" alt="Screenshot 2024-09-24 at 10 58 13 AM"
src="https://github.com/user-attachments/assets/a3ffd558-d00b-4bff-bf1e-d2533fcbc3c1">


## After

<img width="671" alt="Screenshot 2024-09-24 at 10 57 31 AM"
src="https://github.com/user-attachments/assets/1ac97aa7-2d38-422b-bf34-21b832c989da">
2024-09-24 15:20:47 +02:00
nitin
fcaa9d9aed
Introduced Specific Icons image identifier for Notes and Tasks (#6997)
Fixes #6486
2024-09-24 15:17:20 +05:30
Marie
e3547582d0
Fix demo seeds (#7204) 2024-09-23 15:13:46 +02:00
Weiko
d8e16cbfd1
Fix IN filter with empty array (#7202)
## Context
The api currently allows empty array in the IN filter but the expected
behaviour is not very clear. Typeorm seems to return all records when it
is empty which could lead to undesired result. Instead we decided to
throw an error.
I've updated the FE accordingly to skip calls when array is empty.

<img width="696" alt="Screenshot 2024-09-23 at 14 20 28"
src="https://github.com/user-attachments/assets/4b641430-ff17-40a6-bbc5-75e9a1d55f50">
2024-09-23 15:12:49 +02:00
Thomas Trompette
bb875b1ea8
Fix lambda creation (#7201)
As title
2024-09-23 14:28:22 +02:00
Weiko
c8e171a929
Fix paginated order by with composite fields (#7187)
## Context
Cursor is modifying the where object but does not handle properly
composite fields. I'm introducing field metadata as a source of truth to
fix this issue.
RAW_JSON for example (as a sub-field type) should be ignored in a lt/gt,
probably other field types as well.

## Before
```typescript
[
  {
    emails: {
      lt: {
        primaryEmail: "brenda.brown@example.com",
        additionalEmails: null,
      },
    },
  },
  {
    emails: {
      eq: {
        primaryEmail: "brenda.brown@example.com",
        additionalEmails: null,
      },
    },
    position: {
      gt: 877,
    },
  },
  {
    emails: {
      eq: {
        primaryEmail: "brenda.brown@example.com",
        additionalEmails: null,
      },
    },
    position: {
      eq: 877,
    },
    id: {
      gt: "fe43c45d-7560-4eb1-8fd3-c48fd0a4dcd4",
    },
  },
]
```


## After
```typescript
[
  {
    emails: {
      primaryEmail: {
        lt: "brenda.brown@example.com",
      },
    },
  },
  {
    emails: {
      primaryEmail: {
        eq: "brenda.brown@example.com",
      },
    },
    position: {
      gt: 877,
    },
  },
  {
    emails: {
      primaryEmail: {
        eq: "brenda.brown@example.com",
      },
    },
    position: {
      eq: 877,
    },
    id: {
      gt: "fe43c45d-7560-4eb1-8fd3-c48fd0a4dcd4",
    },
  },
]
```
2024-09-23 13:32:59 +02:00
nitin
aa7b3107f4
minor fix - email thread reply button stylings/corrections (#7168)
fixes #7155
2024-09-23 11:04:04 +02:00
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