Commit Graph

2666 Commits

Author SHA1 Message Date
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
Jérémy M
04c06e3f91
fix: isIconDisplayedOnHoverOnly marked as required (#4805)
Fix PR #4676, `isIconDisplayedOnHoverOnly` should be provided or not
marked as required
2024-04-04 14:38:54 +02:00
Basant Besra
9d2bb33646
fix: Add isIconStatic prop item to allow the icons to be always rendered statically ignoring hover behaviour (#4676)
Fix #4653

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-04-04 14:05:56 +02:00
bosiraphael
85caed3463
4702 rename calendareventattendee to calendareventparticipant (#4761)
Closes #4702
2024-04-04 14:00:10 +02:00
Marie
357882c395
[feat][FE] Enable deletion of custom fields in workspace (#4802)
**Context**
Fixes https://github.com/twentyhq/twenty/issues/4597
Enables deletion of custom fields that aren't active nor of type
relation ([BE PR](https://github.com/twentyhq/twenty/pull/4780))

**How was it tested?**
Locally tested

<img width="541" alt="Capture d’écran 2024-04-04 à 13 33 18"
src="https://github.com/twentyhq/twenty/assets/51697796/bc462b86-b494-409e-9836-69bdaeb812cb">
<img width="661" alt="Capture d’écran 2024-04-04 à 13 34 25"
src="https://github.com/twentyhq/twenty/assets/51697796/8fe47114-545e-48b5-a107-34be531b7ea5">
2024-04-04 13:45:15 +02:00
Charles Bochet
b1a586d324
Fix View creation, view fields re-ordering, view filters and view sorts erratic behaviors (#4800)
We used to not type properly the return of getRecordFromCache before the
work from last week.
The getViewFromCache function was patching this temporarily in a "dirty"
way.

Now that this is cleaner, I'm removing the typescript patch. This fixing
several behaviors on viewBar
2024-04-04 13:24:58 +02:00
Thaïs
eef1211463
chore: include react components in twenty-ui test config (#4709)
Split from https://github.com/twentyhq/twenty/pull/4518

Part of https://github.com/twentyhq/twenty/issues/4766

- Re-generates some of the twenty-ui test and storybook config with Nx
- Includes tsx files in twenty-ui tests and compiles them with swc

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 12:30:49 +02:00
Thaïs
932a8d68f5
chore: add script to generate twenty-ui barrels before build (#4707)
Split from https://github.com/twentyhq/twenty/pull/4518

Part of #4766 

Adds a script to auto-generate twenty-ui exports in `index.ts` files.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 12:14:20 +02:00
Thaïs
bf8ee99ebb
chore: use common eslint config for most packages (#4705)
Split from https://github.com/twentyhq/twenty/pull/4518

Related to #4766 

Mutualizes eslint config between projects.
I didn't include `twenty-server` in this PR as this was causing too many
lint errors.
2024-04-04 12:05:26 +02:00
Muralidhar
ff0db8d716
fix: linked records redirection (#4312)
Closes: #4093 
---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 11:01:33 +02:00
Thaïs
f58d855097
feat: add Settings/Integrations/Database/New Connection form (#4787)
Closes #4554

<img width="556" alt="image"
src="https://github.com/twentyhq/twenty/assets/3098428/56738254-aa43-4bfd-b7c5-29a9e1b7258f">

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-04 10:03:40 +02:00
rostaklein
306ef1df9c
feat: schema version header check (#4563)
closes https://github.com/twentyhq/twenty/issues/4479

tried to catch the error inside various places including
https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/src/engine/integrations/exception-handler/exception-handler.service.ts
but it seems like the error never reaches the GraphQL module 😮

any idea where we could intercept such an error `Cannot query field`?

---------

Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
2024-04-04 09:52:45 +02:00
Quentin G
eab65f34f9
feat(ci): use concurrency.group to cancel previous jobs (#4795)
As recommended on the repo of the action we were using
https://github.com/styfle/cancel-workflow-action, we should use
`concurrency.group` rather than a dedicated action.

Here is a PR to use it on all our workflows
2024-04-04 09:30:55 +02:00
Kanav Arora
bcf5268f7f
3886 - Shortcut Sort/Filter (#3901)
Closes #3886

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-04 00:43:44 +02:00
Félix Malfait
b65d82c274
Force explicit deletion behavior for relations (#4775)
We've seen a few cascading errors (e.g. comment.activityId would be non
nullable but cascade behavior is set to "set null"). I think it's safer
if we have to explicitly chose the deletion behavior it every time.

Especially since Postgres default to "No action" while we defaulted to
"Set Null", which is confusing.

In the future we will most likely introduce a second param
`onSoftDelete` in the decorator
2024-04-03 18:30:12 +02:00
Quentin G
ccd02fe58c
feat: init docker compose test (#4730)
Job testing if docker compose is working. It triggers on pull_requests.
2024-04-03 18:08:21 +02:00
martmull
6d23642d28
4777 multi select field backend implement multi select type (#4790)
- fix default value for multi select field metadata
2024-04-03 17:19:24 +02:00
Marie
ff6abacc86
[feat] Enable deletion of custom fields in workspace (#4780)
**Context**
cf. feature request
[#4597](https://github.com/twentyhq/twenty/issues/4597)
Enables deletion of custom fields that aren't active nor of type
relation

Also 
1. renamed a misnamed file
2. deleted redundant hook BeforeDeleteOneField as it seemed best to move
the logic to the resolver instead

**How was it tested?**
Did not write unit tests as code is to be migrated (discussed with
@Weiko).
Locally tested.

---------

Co-authored-by: Marie Stoppa <mariestoppa@MacBook-Pro-de-Marie.local>
2024-04-03 17:17:23 +02:00
martmull
358269c60e
Add IS_MULTI_SELECT_ENABLED feature flag (#4779)
closes #4776
2024-04-03 17:15:38 +02:00
Thaïs
5c3e5a0d8a
feat: create Settings/Integrations/Database/Connection page (#4785)
Closes #4556

- Renames some pages and components after discussion about terminology
with @thomtrp.
- Creates the Settings/Integrations/Database/Connection page.
2024-04-03 17:15:02 +02:00
Félix Malfait
7a34dc4910
Simplify docs and remove Docker local setup (#4783)
Having 2 different dev setups caused confusion, let's remove the Docker
local setup and recommend people install yarn locally.

Also simplified some docs by merging pages together, the recommend
self-hosting option is now the docker-compose / to adapt the
docker-compose.
2024-04-03 16:38:28 +02:00
Thomas Trompette
1c6f0eb577
Integrate relations for remote objects (#4754)
Foreign table id cannot be a foreign key of a base table. But the
current code use foreign keys to link object metadata with activities,
events... So we will:
- create a column without creating a foreign key
- add a comment on the table schema so pg_graphql sees it as a foreign
key

This PR:
- refactor a bit object metadata service so the mutation creation is
separated into an util
- adds the mutation creation for remote object relations
- add a new type of mutation to create a comment

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-03 14:56:51 +02:00
Félix Malfait
3b72eed2dc
Fix issue caused by a merge conflict (#4768) 2024-04-03 09:18:33 +02:00
Aditya Pimpalkar
6ed0a5e2d6
feat: Redirect to previous page after login (#4731)
fix: #4721
2024-04-03 08:05:18 +02:00