Commit Graph

3787 Commits

Author SHA1 Message Date
Divyesh Patel
3d9620a98c
fix: Company picker opening when it shouldn't (#7023)
### The Company Picker opens when it shouldn't.

Fixes #6989 

### Video


https://github.com/user-attachments/assets/a1e56418-8409-46e8-879a-d8335593ea28
2024-09-16 15:25:59 +02:00
Charles Bochet
03fa5913d8
Re-enable displaying one-to-many in table and kanban (#7053)
As per title
2024-09-16 15:20:08 +02:00
Raphaël Bosi
f1264fda76
Fix: Set sync stage started at when starting sync (#7046)
Fix:`syncStageStartedAt` was not set correctly after refactoring
2024-09-16 15:10:53 +02:00
Raphaël Bosi
833832525c
Create command to set stale message sync back to pending (#7048)
Some message channels are stuck in an ongoing `syncStage` because
`syncStartedAt` was not set correctly at the beginning of the sync.
This command resets message channels with an ongoing `syncStage` and
`syncStartedAt` set to null.
2024-09-16 15:10:42 +02:00
gitstart-app[bot]
8208a3e976
Introduce ARRAY field type (#6862)
This PR was created by \[GitStart\](<https://gitstart.com/>) to address
the requirements from this ticket:
\[TWNTY-6447\](<https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6447>).

This ticket was imported from:
<https://github.com/twentyhq/twenty/issues/6447>

### Description

\- We added a new field type

### Refs

#6447

### Demo

<https://jam.dev/c/2b4d7853-ea89-4e9d-a561-6edcb4fdb34b>

Fixes #6447

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-16 14:07:55 +02:00
Weiko
bc99cfec98
0-30-set-custom-object-is-soft-deletable.command (#7045)
This command was supposed to set all custom objects as softDeletable.
After some discussion we realised this bool was not used as intended so
we are removing it all together until we find a better usage (remote
objects for example). This PR removes the command which won't be needed
anymore
2024-09-16 13:53:27 +02:00
Weiko
31dea498e9 Remove objectMetadata isSoftDeletable 2024-09-16 13:40:10 +02:00
Weiko
37d85a716a
[flexible-schema] Add createOne/createMany with upsert to graphql query runner (#7041)
## Context
This PR introduces createOne/createMany through the new graphql query
runner.
Trying to use twentyOrm wrapper as much as possible, in this case here
the args are already converted from "metadata-like" structure (including
composite fields) as graphql input to typeorm / raw columns (I had to
introduce a little fix there).

Keep in mind that I'm not using the new graphql query runner parsing
classes here, especially the selected-fields part, because typeorm
already returns all the record columns in the InsertResult object
(including default values such as id, createdAt, ...). That also means
relation objects will be returned as NULL in the gql response but we
don't handle nested creation for the moment so it should be fine.

Note: also removing the feature flag from findOne/findMany
2024-09-16 12:20:04 +02:00
Félix Malfait
64756dc699
Fix contributor script (#7040)
We had an issue affecting twenty.com/contributors ; this should probably
fix it
2024-09-16 10:55:20 +02:00
Charles Bochet
872f52990a
Optimize migrate-email-fields-command (#7035)
Quick follow up to prepare for 0.30 release
2024-09-15 13:13:35 +02:00
Charles Bochet
f54eea0227
Optimize sync, reset, seed commands to flush cache and to use less memory (#7034)
In this PR:
- removing ugprade-0.24 commands as we are releasing 0.30
- introducing cache:flush command
- refactoring upgrade command and sync-metadata command to use the
ActiveWorkspacesCommand so they consistently run on all workspaces or
selected workspaces

Fixes:
- clear localStorage on sign out
- fix missing workspaceMember in verify resolver
- do not throw on datasource already destroyed exception which can
happen with race condition when several resolvers are resolving in
parallel
2024-09-15 12:47:45 +02:00
nitin
0dbd4a7665
removed @chakra-ui dependencies (#7004)
Issue #6976 
@FelixMalfait 

I could not do
```
import { Banner } from 'twenty-ui';

const StyledBanner = styled(Banner)
  display: flex;
  align-items: center;
  padding: ${({ theme }) => theme.spacing(8)};
  position: absolute;
  border-radius: 8px;
  &:hover {
    background-color: ${({ theme }) => theme.accent.primary};
  }
;
```
The styles wont get overridden for Banner, so for now I styled a new
banner in `UnmatchColumnBanner` which is inconsistent.
I couldnt figure out why css properties are not being overridden, need
help!

@Bonapara 
Question - 
Should the click work on entire banner or just cheveron? For now it just
on cheveron click.


https://github.com/user-attachments/assets/0f409e78-a341-4f26-af74-117e4b2775a9

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-14 16:55:17 +02:00
BOHEUS
4544114109
Add data-testid to MultiWorkspaceDropdownButton container (#7028)
PR for #6895
2024-09-14 13:01:04 +02:00
Quentin G.
3a3262f003
fix(one-liner): update SERVER_URL when not using default port (#7026)
Small fix that should resolve #6341 by replacing the port of SERVER_URL
in the generated .env file
2024-09-14 11:05:43 +02:00
Quentin G.
d1871a4a64
feat: replace ts-node with tsx and pre-install it globaly in docker (#7027)
Implement https://github.com/twentyhq/twenty/issues/5976 suggestion.
It leads to faster boot time since we don't have to install
dependencies.

It should also solve https://github.com/twentyhq/twenty/issues/4772 as
we don't need to run ressource-heavy `npm install` (the mentioned
migration step does not seem to exist anymore anyway.
2024-09-14 11:05:01 +02:00
Quentin G.
b0bc839a49
feat: improve self hosting documentation (#7024)
This PR aims to resolve common misunderstanding while deploying Twenty
with Docker compose.

I've made the documentation clearer, and more detailed.

This should solve https://github.com/twentyhq/twenty/issues/5184, #6140
and similar issues
2024-09-14 11:03:28 +02:00
Charles Bochet
a18b998bed Fix emailThread not loading and rest batch api forbidden 2024-09-14 02:34:40 +02:00
Charles Bochet
8588612cee Fix billing services not accepting new subscriptions 2024-09-13 20:01:18 +02:00
Charles Bochet
523df5398a Optimize metadata queries (#7013)
In this PR:

1. Refactor guards to avoid duplicated queries: WorkspaceAuthGuard and
UserAuthGuard only check for existence of workspace and user in the
request without querying the database
2024-09-13 19:42:22 +02:00
Ana Sofia Marin Alexandre
cf8b1161cc
add field config new icons (#6996)
https://github.com/twentyhq/twenty/issues/6950
Add new icons to Object Fields Data types.

Before:

![image](https://github.com/user-attachments/assets/55697e31-841d-435e-8c70-13ff1c59268d)


After:

![image](https://github.com/user-attachments/assets/bd43f0ec-d3f7-4ecf-a95f-87a030f68e24)

![image](https://github.com/user-attachments/assets/369893a9-35be-43f8-bfcb-55149effa78a)
2024-09-13 15:07:38 +02:00
Weiko
7fd86a860c
[metadata] fix soft delete for standard objects missing deletedAt fieldMetadata (#7017)
This https://github.com/twentyhq/twenty/pull/7006 introduced a
regression.

The goal was to set "isSoftDeletable" to all standard objects but it was
done at the wrong level, meaning it was setting the boolean correctly
but not creating the corresponding fieldMetadata.

I took the occasion to update the new graphql query runner to use that
boolean and automatically add a filter on soft delete in case it's true.

Also adding **IsQueryRunnerTwentyORMEnabled** by default in the seeds
2024-09-13 12:03:27 +02:00
Baptiste Devessier
e9f8e6e718
Display tag for workflow version status (#6972)
- Move where we fetch workflow data. We now fetch them in the `Workflow`
component directly. That's useful to access it in the
`WorkflowShowPageEffect` and `WorkflowDiagramCanvas` components.

![CleanShot 2024-09-10 at 16 27
53@2x](https://github.com/user-attachments/assets/7d30f407-31ab-472c-a096-c525042c0f35)
2024-09-13 11:25:07 +02:00
gitstart-app[bot]
31c02202bd
Handle migration of Email to Emails fields (#6885)
This is the second PR on TWNTY-6261 which handlesdata migration of Email
field to Emails field.\
\
How to Test?\
Firstly make sure that you have completed the testing steps on first PR
then follow the below steps:

- Checkout to TWNTY-6261-emails-migrations branch
- Rebuild typescript using "npx nx build twenty-server"
- Run command "yarn command:prod upgrade-0.25" to do migration\
  \
  Loom Video:\

<https://www.loom.com/share/f82b8d29f8f64f92abe3c59c01147b45?sid=9f8ccc05-aa38-4c49-b139-fd0823066273>

**Testing Messaging Sync functionality:**

Please watch the below video to see that the synchronization of contacts
is working fine after migrating Email field to Emails field:\

<https://www.loom.com/share/400949464b244272b78c25e338cc6ab2?sid=103f6625-5933-4b99-9825-0fed33782f36>

**Question to the client**

should we rename email to emails here? in the DomainName PR, the name
did not change.

```typescript
  @WorkspaceField({
    standardId: PERSON_STANDARD_FIELD_IDS.email,
    type: FieldMetadataType.EMAILS,
    label: 'Email',
    description: 'Contact’s Email',
    icon: 'IconMail',
  })
  email: EmailsMetadata;
```

**Test Messaging Sync**

This pr will update messaging sync files so the changes shouldn't break
existing functionality of importing people and companies in the app.\
To test messaging sync you should follow the below steps:\
1. you need to connect a google account to see the importing
functionality. For this purpose you

have to create a project inside Google Cloud. But to make things easier
you can use the below credentials of an already created project. Put
them in .env of twenty-server package:

```properties
MESSAGING_PROVIDER_GMAIL_ENABLED=true
CALENDAR_PROVIDER_GOOGLE_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=951231465939-h61tg6nkpkv1821qi899fjbj9looquto.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=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
AUTH_GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=http://localhost:3000/auth/google-apis/get-access-token
MESSAGE_QUEUE_TYPE=bull-mq
```

Alternative env

```properties
MESSAGING_PROVIDER_GMAIL_ENABLED=true
CALENDAR_PROVIDER_GOOGLE_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=622006708006-dc4n3vrtf3cs2h6k7hgbborudme7ku9l.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=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
AUTH_GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=http://localhost:3000/auth/google-apis/get-access-token
MESSAGE_QUEUE_TYPE=bull-mq
```

1. Launch your worker with `npx nx run twenty-server:worker`
2. npx nx run twenty-server:command cron:messaging:messages-import
3. npx nx run twenty-server:command cron:messaging:message-list-fetch
4. npx nx run twenty-server:command
cron📆calendar-event-list-fetch
5. Run the app and navigate to Settings/Accounts then connect your
Google account

---------

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-12 18:31:11 +02:00
Baptiste Devessier
3548751be2
Scaffold empty workflow (#6926)
- Create a workflow version when the user visits an empty workflow.
- If the trigger is not defined yet and the user selects either the
standard object type or the event type first, we automatically select
the first option of the other value. Indeed, every state update is
automatically saved on the backend and we need both standard object and
event types to save the event name.
- Introduces a change in the backend. I removed the assertions that
throw when a workflow version is not complete, that is, when it doesn't
have a defined trigger, which is the case when scaffolding a new
workflow with a first empty workflow version.
- We should keep validating the workflow versions, at least when we
publish them. That should be done in a second step.
2024-09-12 17:01:10 +02:00
Charles Bochet
3c4168759a Refactor metadata caching (#7011)
This PR introduces the following changes:
- add the metadataVersion to all our metadata cache keys to ease
troubleshooting:
<img width="1146" alt="image"
src="https://github.com/user-attachments/assets/8427805b-e07f-465e-9e69-1403652c8b12">
- introduce a cache recompute lock to avoid overloading the database to
recompute the cache many time
2024-09-12 16:06:19 +02:00
Weiko
9b46e8c663
Set all standard objects soft deletable (#7006) 2024-09-12 13:44:48 +02:00
Muhamad Fahri Mulyawan
a850b43c52
add contibuting_example.md (#6998)
add a contributing_example.md on folder .github

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-12 12:31:34 +02:00
martmull
3190f4a87b
6658 workflows add a first twenty piece email sender (#6965) 2024-09-12 11:00:25 +02:00
Félix Malfait
f8e5b333d9
Add relations to notes/tasks list view (#6971)
<img width="664" alt="Screenshot 2024-09-10 at 17 00 11"
src="https://github.com/user-attachments/assets/37132805-ff67-4d28-b664-b03da680e166">

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-12 10:50:49 +02:00
Weiko
725ee837f9
Refactor graphql query runner + fix nested or (#6986) 2024-09-11 14:22:33 +02:00
Lucas Bordeau
b506332420
Fixed CI (#6982)
Fixed CI : 
- Unit test for useTimelineActivities
- Story for field creation with new 2-step process
2024-09-11 12:15:12 +02:00
Weiko
1317e1c4f2
[Flexible-schema] Add findOne and fix findMany pagination + soft-delete for graphql-query-runner (#6978) 2024-09-11 11:29:56 +02:00
Charles Bochet
425eb040f7
Fix not possible to edit options (#6979)
We have recently merged: https://github.com/twentyhq/twenty/pull/6700

However, this introduced a regression on field edition as we have
removed the type dropdown from the field edition page. This dropdown was
wrapped into a controller setting the type on the form. Without this
type, the form is considered as invalid and cannot be saved.

I'm setting the form values through useForm.

I'm unhappy with this PR for too reasons:
- usage of activeMetadataField?.icon ?? '' format because I cannot call
useForm conditionnally. This would imply splitting the component into
several components to avoid this issue
- usage of react hook form which is very hard to debug, we should remove
it from the project
2024-09-11 11:23:52 +02:00
gitstart-app[bot]
846953b0f4
Support for multiple values in the Phone field (#6882)
### Description

- This is the first PR on Phones field;


- We are introducing new field type(Phones)


- We are Forbidding creation of Phone field


- We Added support for filtering and sorting on Phones field


- We are using the same display mode as used on the Links field type
(chips), check the Domain field of the Company object


- We are also using the same logic of the link when editing the field

**How to Test**

1. Checkout to TWNTY-6260 branch
2. Reset database using "npx nx database:reset twenty-server" command
3. Add custom field of type Phones in settings/data-model

**Loom Video:**\

<https://www.loom.com/share/3c981260be254dcf851256d020a20ab0?sid=58507361-3a3b-452c-9de8-b5b1abda70ac>

### Refs

#6260

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-09-11 11:15:04 +02:00
Gaurav Khanna
91187dcf82
Fix note linked text in timeline view (in dark mode) (#6944)
This PR Fixes https://github.com/twentyhq/twenty/issues/6942

Other improvements : 
- Fetch activities (note and task) title only when loading timeline, so
we don't always have a clickable title.
- Fixed IconButton width regression.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-10 16:33:08 +02:00
Faisal-imtiyaz123
d1b4f85e8c
Adds secondary color and styling to code blocks using theme varibales ( #6029 ) (#6931)
Follow-up of #6929, this PR just changes the hard coded values to theme
values.
2024-09-10 11:53:20 +02:00
nitin
05d70b03fd
added button in nav bar for kanban view (#6829)
@Bonapara 
Addressing issue #6783.
 
I tried to achieve the exact behavior you were looking for, but I
couldn't get the dropdown to render correctly in that specific column.
I'd love some help to make sure it's working as expected! 😊
Most of the logic is shared with the `useHandleOpportunity` and
`useAddNewCard` hooks, which could be refactored to reduce code debt.
Also, please go harsh with the review because I know there's a lot of
code cleaning required.
I also agree with Charles's point in [this
comment](https://github.com/twentyhq/twenty/issues/6783#issuecomment-2323299840).
Thanks :)


https://github.com/user-attachments/assets/bccdb3f1-3946-4e22-b9a4-b7496ef134c9
2024-09-10 10:53:27 +02:00
Shreyansh Kumar
fbe9e2c0db
Fixed the overflow height of the Developers page's table (#6963)
Ref: https://github.com/twentyhq/twenty/issues/6962

As of now, if user has more than 20 API keys or webhooks, whole page has
scroll, when for the end user (UX) it'd be better if each table had it's
own scroll.
2024-09-10 10:31:16 +02:00
Faisal-imtiyaz123
b3b594efcd
Fixes multi-select search not working ( #6800 ) (#6964)
fixes #6800
2024-09-10 09:24:48 +02:00
Sandheep-OSC
93991680a7
Fix/object detail recordcell tooltip (#6908)
Fixes for https://github.com/twentyhq/twenty/issues/6596

![image](https://github.com/user-attachments/assets/69014a93-a61c-4b6a-bffa-33fdb31a8511)

---------

Co-authored-by: martmull <martmull@hotmail.fr>
2024-09-10 09:06:21 +02:00
Weiko
ace0f7b515
Bump version to 0.24.2 (#6955) 2024-09-09 18:45:45 +02:00
nitin
64f8573ac4
minor fix - removed scrollwrapper stylings for SettingsPageContainer (#6949)
@Bonapara 
fixes
https://github.com/twentyhq/twenty/pull/6700#issuecomment-2322817298
2024-09-09 17:19:14 +02:00
Nabhag Motivaras
2edab3fa2c
fix: ability to create empty kanban (#6951)
## ISSUE
- Closes #6946
2024-09-09 16:10:40 +02:00
Avinash Bhardwaj
1ff31a90f4
sort task groups reverse alphabetically by their status (#6886)
This PR Solves #6830 

## Issue Summary
The tasks are grouped by their respective statuses and displayed on the
ui. The grouping is performed by `lodash.groupBy` which doesn't maintain
explicit ordering of the keys.

## Fix
Sort the tasks groups array by their status on the basis of
reverse-alphabetical order before generating task component for each
task data.

#### Why reverse alphabetical?
It implicitly sorts the statuses as per the order `TODO` ->
`IN_PROGRESS` -> `DONE`
Caveats:
1. Changing the name of one or more status might result in a different
unwanted order.
2. `null` is unhandled, although the original code doesn't allow for
nulls as status while displaying

### Alternative Fix
Maintain an explicit ordering of the statuses and sort the tasks
accordingly.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-09 15:56:52 +02:00
nitin
b01745dba7
Prevent fullWidth from being passed to Link ie <a> (#6893)
fixes #6825
2024-09-09 15:22:59 +02:00
Harshit Singh
5123655128
fix: Notes not visible in Timeline activities (#6936)
## Description

- This PR solves #6935 #6934 

- fixed the notes color in timeline activities which was not visible in
dark mode

- fixed spelling typo

## Before 
<img width="626" alt="Screenshot 2024-09-08 at 12 28 03 PM"
src="https://github.com/user-attachments/assets/7c532c6b-af3f-4af6-baa1-be134d2142a6">


<img width="1195" alt="Screenshot 2024-09-08 at 12 20 27 PM"
src="https://github.com/user-attachments/assets/2fb868b0-b66c-485f-b574-1beaf83bfb23">


## After
<img width="561" alt="Screenshot 2024-09-08 at 12 27 53 PM"
src="https://github.com/user-attachments/assets/937e11ff-77ef-4170-b1ef-dc9cbfa86166">

<img width="1194" alt="Screenshot 2024-09-08 at 12 19 17 PM"
src="https://github.com/user-attachments/assets/12455593-051d-490d-bc53-f5c5699f9c97">
2024-09-09 14:35:03 +02:00
Viraj Jaiswal
23974d2e34
Update SettingsDevelopersApiKeyDetail.tsx typo (#6937)
Corrected typo error of Expiration description in which it was
"diasbled" to "disabled".
2024-09-08 19:07:21 +02:00
Harshit Singh
1c4f418445
Fixed page inputs style layout bugs (#6899)
## Description

This PR resolves the issue #6870
- Adjusted width for all textInput - `240px`
- Added responsiveness to Address field

- [ ] To add Blur to background text component


## Before
<img width="421" alt="Screenshot 2024-09-05 at 11 57 40 AM"
src="https://github.com/user-attachments/assets/24f55e35-660e-4263-9bb0-ab363893e63b">

<img width="443" alt="Screenshot 2024-09-05 at 11 57 54 AM"
src="https://github.com/user-attachments/assets/656e93f6-ec48-41b7-b92f-06f9bfc779f2">


## After 

<img width="377" alt="Screenshot 2024-09-05 at 11 51 37 AM"
src="https://github.com/user-attachments/assets/f323930c-a8bf-4d38-9ed8-db43b86209b1">

<img width="427" alt="Screenshot 2024-09-05 at 11 52 26 AM"
src="https://github.com/user-attachments/assets/f34922fc-4687-4842-a85a-e28b603d47ae">

<img width="429" alt="Screenshot 2024-09-05 at 11 52 50 AM"
src="https://github.com/user-attachments/assets/f3016e57-1214-408f-9f5b-ee34d9caaf5d">

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-07 00:12:51 +02:00
Harshit Singh
697d466422
fix: Minor bugs in notes pages (#6914)
## Descripion

This PR fixed the issue #6913 

## Currently behavior

<img width="646" alt="Screenshot 2024-09-06 at 1 12 33 AM"
src="https://github.com/user-attachments/assets/60f3ec83-5976-40b1-a89e-01f28b8e809b">

<img width="244" alt="Screenshot 2024-09-06 at 1 13 31 AM"
src="https://github.com/user-attachments/assets/89b77e03-fe58-4fab-88e2-f121d6e7eb72">

## Expected behaviour

<img width="585" alt="Screenshot 2024-09-06 at 1 15 07 AM"
src="https://github.com/user-attachments/assets/206d4f65-c9d1-449a-8f05-f485116157ae">

<img width="242" alt="Screenshot 2024-09-06 at 1 15 20 AM"
src="https://github.com/user-attachments/assets/88cd6acd-bb8e-4cf3-b5cf-169cb51c9f91">

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-06 23:55:47 +02:00
nitin
7a8d46a51d
added timeout to avoid appending of blocks (#6725)
@FelixMalfait
fixes #6724  
Thanks :)

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-09-06 23:38:52 +02:00