Commit Graph

2789 Commits

Author SHA1 Message Date
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
Anoop P
fbd7c34478
Basic github ci workflow for twenty website (#4869)
Creates a basic github workflow for this issue #4832
2024-04-08 12:47:52 +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
Darek Desu
9d77f1247d
Typo in docker compose up hint (#4866) 2024-04-07 11:14:20 +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
Félix Malfait
3df4b78e38
Fix dropdown menu header (#4835)
Fix an issue I add introduced by removing "position:static" and an other
regression from https://github.com/twentyhq/twenty/issues/4366
2024-04-05 10:31:08 +02:00
Ady Beraud
b82519301c
Website UI design (#4829)
**Fixed different issues** :
 
- Multiple CSS fixes: font-size, colors, margins, z-index ...
- Fixed hover on contributor avatars
- Added link to contributors in footer
- Made the year in the footer dynamic (2023 --> 2024)
- Added name of contributor in "Thank you" section of Contributor page
- Added footer in small screens
- Made Activity Log Responsive 
- Fixed bug in "saving issues to DB", title was null everywhere. I
needed to implement an "upsert" behaviour to update the existing
database on init

**To be noted :** 

There is the following bug on production happening on mobile when you
refresh a second time :

<img width="1440" alt="Screenshot 2024-04-05 at 01 30 58"
src="https://github.com/twentyhq/twenty/assets/102751374/b935b07a-63dc-463d-8dcb-070ad4ef6db0">


It seems to be related to the following issue on mdx :
[https://github.com/hashicorp/next-mdx-remote/issues/350](https://github.com/hashicorp/next-mdx-remote/issues/350)

I added the following code that fixed this bug for me in development
(this needs to be tested in production) :

```
const serialized = await serialize(content, {
    mdxOptions: {
      development: process.env.NODE_ENV === 'development',
    }
  })
```

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
2024-04-05 08:41:08 +02:00
Charles Bochet
e8c58ae541
Make field input transparency consistent (#4828)
Minor fix until for the release 0.4.0 until we properly fix all input
background and backdrop-filters
2024-04-04 20:51:41 +02:00
Charles Bochet
499e1a09e3
Fix ScrollWrapper inner elements padding (#4827)
Closes https://github.com/twentyhq/twenty/issues/4824 and
https://github.com/twentyhq/twenty/issues/4788
2024-04-04 19:19:26 +02:00
Félix Malfait
65e665c74c
Add Sentry types to dependencies (#4825)
Someone reported an error during install that might be due to missing
types import.
2024-04-04 19:09:49 +02:00
Quentin G
5d6094dfa3
fix: update build script for twenty-emails (#4823)
Fix an issue with the build of the server in docker failing to find vite
2024-04-04 18:37:35 +02:00
Thaïs
e784dc8a98
chore: enable no-console eslint rule for tests and stories (#4816)
Re-enables no-console eslint rule in stories and tests files:
- In stories, use `action` from '@storybook/addon-actions' or `fn` from
'@storybook/test' instead of console.
- In tests, console methods can be mocked like this:
`global.console.error = jest.fn()`.
2024-04-04 18:36:39 +02:00
Charles Bochet
48b1be9917
Fix ViewPicker create mode: view type switcher (#4821)
In this PR, I'm fixing two things on the ViewPicker in Create mode:
- if the Dropdown has no max height, it should not be scrollable (which
is causing issue with inner dropdowns being cut by overflow: hidden
- if the user has changed the icon, the type or the name of the view,
consider the create form as isDirty and prevent its value to be
overriden by re-renders (cache updates for example)
2024-04-04 18:32:55 +02:00
Thaïs
1f98bc899d
feat: fetch database connections (#4813)
Closes #4757

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-04 17:27:36 +02:00
Weiko
f8edb6652e
Gracefully close Redis connection when cacheStorageModule is destroyed (#4812)
## Context
When running a command, the process should end normally however it stays
hanging due to the open connection with redis client (when
CACHE_STORAGE_TYPE=redis)
This PR adds the necessary logic to gracefully close the connection once
the module is destroyed. Thanks to that, the command process now
properly ends once executed.
2024-04-04 16:15:22 +02:00
Thaïs
f184541293
feat: add Database Connection Summary Card to Settings/Integrations/D… (#4791)
…atabase/Connection page

Closes #4558

<img width="542" alt="image"
src="https://github.com/twentyhq/twenty/assets/3098428/16d7d8ce-57db-4e48-ba72-a2318a2d34a4">

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 15:56:52 +02:00
TRP
9d45f7811e
adjust window size for scroll (#4792)
related to #4749. 

Adjusted the max height for window so that it cuts the last option a
little.

I wanted to test the menu from the second pic in the issue with the
multi select option but could not figure out where it was in the
application.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 15:55:39 +02:00
Kanav Arora
18072d2935
Fixed attachment field type (#4811)
updatedAt and deletedAt field changed to string like createdAt field. On
file upload updatedAt field will be given date same as createdAt.

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 15:51:45 +02:00
Thomas Trompette
2e419091cc
Prevent remote object updates (#4804)
Backend: Adding a new util function that throw an error if the
objectMetadata is remote

Frontend: hiding the save button when remote

Also renaming `useObjectMetadataItemForSettings` since this hook is used
in other places than settings and is not in the settings repo. Name can
definitely be challenged!

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-04 15:47:08 +02:00
Thaïs
c5349291c8
chore: setup twenty-ui absolute path alias (#4732)
Split from https://github.com/twentyhq/twenty/pull/4518

- Setup `@ui/*` as an internal alias to reference `twenty-ui/src`.
- Configures twenty-front to understand the `@ui/*` alias on development
mode, so twenty-ui can be hot reloaded.
- When building on production mode, twenty-front needs twenty-ui to be
built beforehand (which is automatic with the `dependsOn` option).
- Configures twenty-front to understand the `@ui/*` alias when launching
tests, so there is no need to re-build twenty-ui for tests.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 15:38:01 +02:00
Thomas Trompette
41960f3593
Remote objects: Fix comment override - id typing - label (#4784)
Several fixes for remote objects:
- labels are now displayed in title case. Added an util for this.
- Ids are often integers but the foreign keys on the relations were
uuid. Sending the id type to the object metadata service so it can
creates the foreign key accordingly
- Graphql comments are override when several remote objects are
imported. Building a function that fetch the existing comment and update
it

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-04 15:35:49 +02:00
Kanav Arora
f8ec40dbfb
Fix: File Upload (#4806)
File upload issue fixed.
There was a type mismatch and isDate was returning false
2024-04-04 15:33:17 +02:00