Commit Graph

3470 Commits

Author SHA1 Message Date
Charles Bochet
7b943457c8 Update sync-metadata to use feature-flag core module 2024-07-25 20:47:38 +02:00
Charles Bochet
8083175432
Fix object metadata not found (#6416) 2024-07-25 20:34:50 +02:00
Charles Bochet
4cb83e050f
Put workfows behind a feature flag (#6417)
We have recently merged
[#workflow](https://github.com/twentyhq/twenty/pull/6412) but we should
put the workflow standard object behind a feature flag for now

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2024-07-25 20:33:31 +02:00
Charles Bochet
515bf666cf Do not create identifier for remote object 2024-07-25 18:39:08 +02:00
Thomas Trompette
ce68f8ac79
Add workflow and version as standard object (#6412)
As title

Hidden behind a feature flag.
2024-07-25 18:33:11 +02:00
Charles Bochet
d022837b5b
Display command logs on boot error (#6414)
As per title
2024-07-25 17:53:57 +02:00
bosiraphael
b31153105f
Fix participant chip (#6411)
- Fix gap
- Modify query to retrieve person and workspaceMember to display a
record chip inside the message right drawer

Before:
<img width="74" alt="Capture d’écran 2024-07-25 à 17 14 57"
src="https://github.com/user-attachments/assets/b37e19d0-8efb-408d-aba7-66d9a7cca433">
<img width="105" alt="Capture d’écran 2024-07-25 à 17 14 40"
src="https://github.com/user-attachments/assets/f6d4b164-279b-4be3-ac66-6b613a3f3144">

After:
<img width="126" alt="Capture d’écran 2024-07-25 à 17 13 53"
src="https://github.com/user-attachments/assets/97059253-6f5d-4f8c-b2b6-acd614862801">
<img width="67" alt="Capture d’écran 2024-07-25 à 17 14 18"
src="https://github.com/user-attachments/assets/0808a354-1c97-4bb6-8cf7-9d4c10c3a4d4">
2024-07-25 17:24:51 +02:00
nitin
9618639744
Align Workspace Switcher with Breadcrumb by Adjusting Height (#6384)
@Bonapara 
Issue #6375 

This change makes sure the container height is 32px instead of 28px.
should the container inside it should also be 32px, please refer video
below for context


https://github.com/user-attachments/assets/fe97f0de-e1fd-4fda-a9a7-e9585469c530


Also skeleton height is 20px (refer video below), the black component in
the video is the skeleton for this particular component.
What should be skeletons height?


https://github.com/user-attachments/assets/0956c8d9-8e4e-4c20-bb71-7fb1e2cba4fd

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-25 13:59:46 +02:00
Charles Bochet
d073ebff43
Prevent field with null standardId to be considered as field identifier (#6407)
Otherwise, any custom field will be considered as image/label identifier
by the sync-metadata scripts
2024-07-25 13:28:10 +02:00
Jérémy M
d0201e17ac
Fix: query runner orm (#6397)
Fix WorkspaceQueryRunner events using TwentyORM

Fix #6057

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-25 13:21:57 +02:00
martmull
c3cdb664be
Fix yarn lock (#6402) 2024-07-25 11:40:12 +02:00
martmull
b9c8d607aa
Test revert crm integration (#6321)
PR to test revert integration in production
2024-07-25 09:38:55 +02:00
martmull
7c6ca0e841
Fix api timeout (#6401) 2024-07-25 08:38:05 +02:00
Marie
082d55beac
[fix] Migrated links field should be standard (#6387)
Fixing script + ading logs to sync-metadata
2024-07-24 12:16:14 +02:00
Marie
001e698bbe
Use LinksMetadata right type for Links fields (#6380) 2024-07-24 10:48:15 +02:00
Pacifique LINJANJA
6785a2b92c
chore: remove the passwordResetToken field from the database (#6377)
# This PR

- Fix #6305
2024-07-24 10:44:11 +02:00
nitin
895910e1d1
Fix RecordTableHeaderCell (#6383)
@Bonapara

Fixed! the issue (#6365) where the `background-color` style was not set,
causing the bug. Now, the background color is properly applied.



https://github.com/user-attachments/assets/668bd3cc-77ea-42a9-84d4-071fca497e07
2024-07-24 10:41:03 +02:00
Marie
b0b2281fc5
Fix mocks for unlogged users (#6376) 2024-07-24 10:08:54 +02:00
brendanlaschke
ea4d051c4e
Fix task text overflow (#6351)
closes #5552

<img width="754" alt="Bildschirmfoto 2024-07-19 um 23 35 25"
src="https://github.com/user-attachments/assets/715192cd-679d-430a-95f1-8bc1d8fd26f4">
2024-07-24 10:04:10 +02:00
Aryan Singh
5c8fe027f9
5425 - Introducing support for all Composite Fields Import (#5470)
Adding support for all Composite Fields while using the "import"
functionality. This includes:
- Currency
- Address

Edit : 
- Refactored a lot of types in the spreadsheet import module
- Renamed a lot of functions, hooks and types that were not
self-explanatory enough

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-23 18:02:23 +02:00
Charles Bochet
2cc0597ee4 Update seed links format 2024-07-23 14:48:26 +02:00
Charles Bochet
6c34ef9a14
Simplify ORM (#6373)
This PR refactors the ORM-Manager to simplify and unify the datasource
creation. I'm deprecating all usages if InjectWorkspaceDatasource and
InjectWorkspaceRepository as we can't be sure they are up-to-date
2024-07-23 14:13:16 +02:00
Marie
794e73eeb6
Migrate conferenceLink to type Links (#6372) 2024-07-23 14:09:52 +02:00
Marie
8d33264a7d
Migrate fields of deprecated type LINK to type LINKS (#6332)
Closes #5909.

Adding a command to migrate fields of type Link to fields of type Links,
including their data.
2024-07-23 09:57:30 +02:00
Charles Bochet
c69d665114
Fix reset PasswordToken (#6366)
## Bug Description

We are facing a bug in case recaptcha is enabled.
To reproduce:
- Create your recaptcha: https://www.google.com/recaptcha/about/
- update your server .env with the following variables:

```
CAPTCHA_SECRET_KEY=REPLACE_ME
CAPTCHA_SITE_KEY=REPLACE_ME
CAPTCHA_DRIVER=google-recaptcha
```

- Go to the login page, enter an existing user email and hit 'Reset your
password'.

- Add a console.log in emailPasswordResetLink in auth.resolver.ts to get
the token that would be sent by email if you don't have the mailer setup

- Browse: /reset-password/{passwordToken}

- Update the password:
<img width="1446" alt="image"
src="https://github.com/user-attachments/assets/dd5b077f-293e-451a-8630-22d24ac66c42">

- See that the token is invalid

You should see two calls in your developer network tab. A successful one
to update the password and another to log you in. This 2nd call
(Challenge) does not have the captcha token provided. It should be

## Fix

- Refreshing the token on page load
- providing it to the Challenge graphql call
2024-07-22 17:36:31 +02:00
brendanlaschke
01fe3b673e
Datamodel overview show other fields (#6352)
<img width="638" alt="Bildschirmfoto 2024-07-19 um 23 49 00"
src="https://github.com/user-attachments/assets/57b600c4-d985-4e4c-afc0-e0c6dd5bc9f6">

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 16:13:49 +02:00
brendanlaschke
4545ba2737
Update blocknote (#6349)
Updating blocknote providing bugfixes & new block types

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 16:00:14 +02:00
Charles Bochet
d212aedf81
Fix ORM (#6363)
This PR fixes a few bugs on TwentyORM:
- fix many to one relations that were not properly queries
- fix many to one relations that were not properly parsed
- compute datasource (or use from cache) at run-time and do not use
injected one that could be outdated

We still need to refactor it to simplify, I feel the API are too complex
and we have too many cache layers. Also the relation computation part is
very complex and bug prone
2024-07-22 15:07:35 +02:00
Faisal-imtiyaz123
284e75791c
Fixes Strange behaviour when reordering options of select field (#6103) (#6339)
fixes #6103

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 14:33:02 +02:00
falko100
f24536c115
Add Confirmation Modal for Deletion Action and Map All Action Bar Entries (#6357)
This pull request addresses an issue where the delete button, placed
closely to the export button, could lead to accidental deletions without
confirmation. The problem was that the confirmation modal for the delete
action, being the second action, was not displayed. The code was updated
to map all action bar entries and display their respective confirmation
modals correctly.

### Changes Made:
- Updated the rendering of action bar entries to ensure all confirmation
modals are shown.
Changed from displaying only the first action bar entry's confirmation
modal to mapping through all entries and displaying each modal if it
exists.
- Removed the delete from the onClick because it is present in the
onConfirmClick.
2024-07-22 14:22:10 +02:00
Marie
14fcd5f900
Fix display of boolean fields in timeline activities (#6361)
before
<img width="556" alt="Capture d’écran 2024-07-22 à 11 29 59"
src="https://github.com/user-attachments/assets/c3f76698-77f8-411f-8488-c3b119184f91">

after
<img width="963" alt="Capture d’écran 2024-07-22 à 11 31 07"
src="https://github.com/user-attachments/assets/29248677-16c6-49f5-8a86-cfe8aa677d86">
2024-07-22 14:15:10 +02:00
Faisal-imtiyaz123
4f249df831
Fixes data importer showing incorrect unmatched fields (# 6138) (#6311)
fixes #6138

---------

Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
2024-07-22 14:13:00 +02:00
gitstart-app[bot]
41931c53e8
Record board columns design fix (full height borders) (#6350)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-5273](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-5273).
This ticket was imported from:
[TWNTY-5273](https://github.com/twentyhq/twenty/issues/5273)

 --- 


## Description:

- We added a min-height to fix the main issue, in two components, one of
them needs \`calc\` because the border causes the creation of a
scrollbar
- The change on the overflow fixes the issue mentioned
[here](https://github.com/twentyhq/twenty/issues/5273#issuecomment-2232945913)

## Refs: #5273

## Demo:

\
<https://jam.dev/c/01cac1e5-ed66-439c-88fb-9406a06429c5>\
\
Fixes #5273

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
2024-07-22 13:58:55 +02:00
brendanlaschke
936994ff44
Fix demo opportunities name (#6347)
closes #5129
2024-07-22 12:22:32 +02:00
Ashmash100
52c6320f74
Fixed reset rating field to "no value" on star re-click (#6296)
### Description
Resolves Issue:  [https://github.com/twentyhq/twenty/issues/6224](#6224)

### Additional Consideration
I have changed the default start rating value from 1 star to no star
since clicking on the selected start was reverting the filed to 1 star
which didn't seem like the appropriate behaviour. Let me know if this
change is fine

---------

Co-authored-by: JosephAshwin23 <joseph.sanjivi@anywhere.co>
Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
2024-07-22 12:17:10 +02:00
Priyank Sevak
33fc4ff907
New "inverted" Background Colors (#6354)
- Added 2 new Inverted background colors as requested under issue#4726

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2024-07-22 12:03:23 +02:00
Charles Bochet
d8cadad0fa
Deprecate inject workspace repo (#6353) 2024-07-20 00:43:29 +02:00
Charles Bochet
2e38c3bbc1
Refactor raw queries to use prepared query to avoid security vuln. (#6348)
As per title, we should avoid at all cost using non-prepared query and
NEVER use them whenever the input come from the user.
2024-07-19 22:32:40 +02:00
Charles Bochet
cac0d22285 Fix chromatic pixel tests 2024-07-19 19:42:04 +02:00
Lucas Bordeau
b64e8096d6
Fixed scoped hotkeys (#6322)
- Removed enabled props from useScopedHotkeys becayse it doesn't work
- Moved enter useScopedHotkeys in a handler that we drill down to the
text inputs on the settings form

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-19 19:25:12 +02:00
Jérémy M
de20c564c7
feat: add eslint rule for enforcing WorkspaceService naming convention (#6308)
### Description

This PR introduces a custom ESLint rule named
`inject-workspace-repository`. The purpose of this rule is to enforce
naming conventions for files and classes that use the
`@InjectWorkspaceRepository` decorator or include services ending with
`WorkspaceService` in their constructors.

### Rule Overview

The new ESLint rule checks for the following conditions:

1. **File Naming**:
- Only file ending with `.service.ts` or `.workspace-service.ts` are
checked.
- If a file contains a class using the `@InjectWorkspaceRepository`
decorator or a service ending with `WorkspaceService` in the
constructor, the file name must end with `.workspace-service.ts`.

2. **Class Naming**:
- Classes that use the `@InjectWorkspaceRepository` decorator or include
services ending with `WorkspaceService` in their constructors must have
names that end with `WorkspaceService`.

### How It Works

The rule inspects each TypeScript file to ensure that the naming
conventions are adhered to. It specifically looks for:

- Constructor parameters with the `@InjectWorkspaceRepository`
decorator.
- Constructor parameters with a type annotation ending with
`WorkspaceService`.

When such parameters are found, it checks the class name and the file
name to ensure they conform to the expected patterns.

### Example Code

#### Valid Cases

1. **Correct File and Class Name with Decorator**:
    ```typescript
    // Filename: my.workspace-service.ts
    class MyWorkspaceService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    ```

2. **Service Dependency**:
    ```typescript
    // Filename: another.workspace-service.ts
    class AnotherWorkspaceService {
      constructor(private myWorkspaceService: MyWorkspaceService) {}
    }
    ```

#### Invalid Cases

1. **Incorrect Class Name**:
    ```typescript
    // Filename: my.workspace-service.ts
    class MyService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    ```

2. **Incorrect File Name**:
    ```typescript
    // Filename: my.service.ts
    class MyWorkspaceService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    // Error: File name should end with '.workspace-service.ts'.
    ```

3. **Incorrect File and Class Name**:
    ```typescript
    // Filename: my.service.ts
    class MyService {
      constructor(@InjectWorkspaceRepository() private repository) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    // Error: File name should end with '.workspace-service.ts'.
    ```

4. **Incorrect File Type**:
    ```typescript
    // Filename: another.service.ts
    class AnotherService {
      constructor(private myWorkspaceService: MyWorkspaceService) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    // Error: File name should end with '.workspace-service.ts'.

    ```

5. **Incorrect Class Name with Dependency**:
    ```typescript
    // Filename: another.workspace-service.ts
    class AnotherService {
      constructor(private myWorkspaceService: MyWorkspaceService) {}
    }
    // Error: Class name should end with 'WorkspaceService'.
    ```

### First step

This rule is only a warning for now, and then we'll migrate all the code
that need to be migrated and move from `warn` to `error`.

Fix #6309

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-07-19 19:17:57 +02:00
Charles Bochet
41211dc1a6 Fix linter and yarn.lock not being synced 2024-07-19 18:57:38 +02:00
Lucas Bordeau
187b6f9335
Fix record show page request errors (#6345)
- Removed getCursorFromRecordId
- Get cursor from request
- Fixed problem with navigation and optimistic rendering
2024-07-19 18:43:46 +02:00
Faisal-imtiyaz123
12c33159e0
Fixes Default View Ordering (#6114) (#6326)
fixes #6114

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-07-19 18:27:33 +02:00
Jérémy M
088d061b3e
feat: twenty orm for standard and custom objects (#6178)
### Overview

This PR builds upon #5153, adding the ability to get a repository for
custom objects. The `entitySchema` is now generated for both standard
and custom objects based on metadata stored in the database instead of
the decorated `WorkspaceEntity` in the code. This change ensures that
standard objects with custom fields and relations can also support
custom objects.

### Implementation Details

#### Key Changes:

- **Dynamic Schema Generation:** The `entitySchema` for standard and
custom objects is now dynamically generated from the metadata stored in
the database. This shift allows for greater flexibility and
adaptability, particularly for standard objects with custom fields and
relations.
  
- **Custom Object Repository Retrieval:** A repository for a custom
object can be retrieved using `TwentyORMManager` based on the object's
name. Here's an example of how this can be achieved:

  ```typescript
const repository = await this.twentyORMManager.getRepository('custom');
  /*
* `repository` variable will be typed as follows, ensuring that standard
fields and relations are properly typed:
   * const repository: WorkspaceRepository<CustomWorkspaceEntity & {
   *    [key: string]: any;
   * }>
   */
  const res = await repository.find({});
  ```

Fix #6179

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
2024-07-19 18:23:52 +02:00
Antar Das
a86cc5cb9c
fix: icon visibility on horizontal scroll #6304 (#6315)
https://github.com/user-attachments/assets/5f8741ad-bdab-4ef3-8741-dacbd2381ea3

fix: When scrolling horizontally, table header goes behind the first
frozen column #6304
2024-07-19 18:00:31 +02:00
Weiko
a374922902
Cannot delete label identifier associated field (#6340)
## Context
An object should always have a labelIdentifier (would be its primary key
at least). If the associated field is deleted by a user, it will break
the app. Ideally we should handle that on the DB level but we don't have
a FK for this column yet.
In the meantime I'm adding the validation check in the backend, note
that this is already handle on the FE side since the "archive/delete"
buttons don't appear for such fields so you need to reassign it to
another field first which is the desired behaviour.
2024-07-19 15:57:40 +02:00
Jérémy M
cfb36ec0fb
feat: bump yarn to last stable version (#6081)
This PR bump yarn version to latest stable version
2024-07-19 15:38:03 +02:00
Lucas Bordeau
b38006455d
Fixed sort for Currency type (#6333)
Fixes : #6056 

- Refactored the logic to get order by query variables for field types
- Added a case for Currency field type
2024-07-19 15:27:28 +02:00
Charles Bochet
d488b7f80f Linter fix post merge conflicts 2024-07-19 15:20:25 +02:00