Commit Graph

4028 Commits

Author SHA1 Message Date
Charles Bochet
03c44811ae Release 0.31.1 2024-10-12 17:47:02 +02:00
Charles Bochet
70bbc65e61 Increase test coverage 2024-10-12 17:36:47 +02:00
nitin
cac00e93b8
minor fix - dropdown doesnt close onClick in configure step (#7587) 2024-10-11 21:24:25 +02:00
Lucas Bordeau
fef3d32237
Fixed bugs in ViewBar filtering (#7608)
- Fixed CSS for SortOrFilter chips
- Fixed bug when refreshing with an actor source filter set

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-10-11 20:25:15 +02:00
Charles Bochet
7b96be6f8c
Fix optimistic effect deletedAt (#7606)
In this PR, I'm fixing part of the impact of soft deletion on optimistic
rendering.

## Backend Vision

1) Backend endpoints will not return soft deleted records (having
deletedAt set) by default. To get the softDeleted records, we will pass
a { withSoftDelete: true } additional param in the query.
2) Record relations will NEVER contain softDeleted relations

## Backend current state

Right now, we have the following behavior:
- if the query filters do not mention deletedAt, we don't return
softDeletedRecords
- if the query filters mention deletedAt, we take it into consideration.
Meaning that if we want to have the softDeleted records in any way we
need to do { or: [ deletedAt: NULL, deletedAt: NOT_NULL] }

## Optimistic rendering strategy

1) useDestroyOne/Many is triggering destroyOptimisticEffects (previously
deleteOptimisticEffects)
2) UseDeleteOne/Many and useRestoreOne/Many are actually triggering
updateOptimisticEffects (as they only update deletedAt field) AND we
need updateOptimisticEffects to take into account deletedAt (future
withSoftDelete: true) filter.
2024-10-11 20:23:01 +02:00
nitin
d350143c92
Fix field forms (#7595)
@lucasbordeau 
forms are broken!
revert - #7363 
used useRelationSettingsFormInitialValues hook from that commit.
TODO - figure out a way to change the relation name label from singular
to plural and vice versa, until it is edited.
related issue - #7355

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-11 19:07:56 +02:00
Raphaël Bosi
7e7784f444
Fix icon button disabled border (#7607)
<img width="538" alt="Capture d’écran 2024-10-11 à 17 34 22"
src="https://github.com/user-attachments/assets/c4a0dfb9-65cc-453a-af4b-476acf063504">
2024-10-11 18:08:12 +02:00
Weiko
8cf3262eb3
fix enum default value update when option deleted (#7604)
Fix as isDefined also returns false if value is null and we still want
to allow users to set defaultValue back to null
2024-10-11 17:11:45 +02:00
Thomas Trompette
c91a8c6abf
Check if relation before trying to input relation label (#7605)
Bug introduced by https://github.com/twentyhq/twenty/pull/7363
Input value was not set during edition for field that were not relations

Fixed
<img width="893" alt="Capture d’écran 2024-10-11 à 16 53 56"
src="https://github.com/user-attachments/assets/511077c6-5dff-49a1-b058-24a83d998dcf">
2024-10-11 17:11:11 +02:00
Charles Bochet
0980d6d9c8
Fix GraphQL Api Setters not being applied (#7602)
While rebuilding the new GraphQLAPI (without pg_graphql), we forgot to
include the FieldGetter logic. This logic will soon be moved at ORM
level but we will need to keep it there for now

The bug has many impacts such as the fileToken not being generated and
preventing users from loading files
2024-10-11 17:04:12 +02:00
Raphaël Bosi
0cb9853a55
Fix DropdownMenuInput border (#7603)
<img width="213" alt="Capture d’écran 2024-10-11 à 16 52 27"
src="https://github.com/user-attachments/assets/c4b171e7-9df1-4b75-8cbe-25a2672d7211">
<img width="167" alt="Capture d’écran 2024-10-11 à 16 52 18"
src="https://github.com/user-attachments/assets/9a853e0e-d50a-4d6a-9c27-789fdd2df0ac">
2024-10-11 17:03:57 +02:00
Lucas Bordeau
f15c5ff52f
Fix view bar details missing ObjectFilterDropdownComponentInstanceContext (#7598)
Fix view bar details missing
ObjectFilterDropdownComponentInstanceContext
2024-10-11 16:38:06 +02:00
Chirag Arora
e2179a7911
Like & Re-Tweet oss.gg Launch Tweet (50 Points): Complete (#7589)
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-10-11 16:06:41 +02:00
dostavic
4cc95d4794
fix: Set field type icon as the default icon for new fields (#7352) (#7579)
Closes #7352

**Summary**

Moved the `defaultIconsByFieldType` mapping from the
`SettingsObjectNewFieldConfigure` component to a separate constants
file. This change improves code organization and maintainability without
changing functionality.

**Changes Made**

- **Created a new constants file:** Added `FieldTypeIcons.ts`, located
in `src/pages/settings/data-model/constants/`, to store the mapping of
`FieldMetadataType` to default icons.
    
```
    // FieldTypeIcons.ts
    
    import { FieldMetadataType } from '~/generated-metadata/graphql';
    
    export const defaultIconsByFieldType: Record<FieldMetadataType, string> = {
      [FieldMetadataType.Address]: 'IconLocation',
      [FieldMetadataType.Boolean]: 'IconCheckbox',
      [FieldMetadataType.Currency]: 'IconCurrency',
      [FieldMetadataType.Date]: 'IconCalendar',
      [FieldMetadataType.DateTime]: 'IconClock',
      [FieldMetadataType.Email]: 'IconMail',
      [FieldMetadataType.FullName]: 'IconUser',
      [FieldMetadataType.Link]: 'IconLink',
      [FieldMetadataType.MultiSelect]: 'IconList',
      [FieldMetadataType.Number]: 'IconNumber',
      [FieldMetadataType.Phone]: 'IconPhone',
      [FieldMetadataType.Rating]: 'IconStar',
      [FieldMetadataType.RawJson]: 'IconCode',
      [FieldMetadataType.Relation]: 'IconRelationOneToMany',
      [FieldMetadataType.Select]: 'IconSelect',
      [FieldMetadataType.Text]: 'IconTypography',
      [FieldMetadataType.Uuid]: 'IconKey',
      [FieldMetadataType.Array]: 'IconCodeDots',
      [FieldMetadataType.Emails]: 'IconMail',
      [FieldMetadataType.Links]: 'IconLink',
      [FieldMetadataType.Phones]: 'IconPhone',
      [FieldMetadataType.Actor]: 'IconUsers',
      [FieldMetadataType.Numeric]: 'IconUsers',
      [FieldMetadataType.Position]: 'IconUsers',
      [FieldMetadataType.RichText]: 'IconUsers',
      [FieldMetadataType.TsVector]: 'IconUsers',
      // Add other field types as needed
    };
```
    
- **Updated the import in the component:** In the file
`SettingsObjectNewFieldConfigure.tsx`, imported the mapping from the new
constants file.
    
    
    ```// SettingsObjectNewFieldConfigure.tsx
    
import { defaultIconsByFieldType } from
'~/pages/settings/data-model/constants/FieldTypeIcons';
    
- **Adjusted form configuration:** Modified `defaultValues` in `useForm`
and `useEffect` to use the imported mapping.
    
```
    `const formConfig = useForm<SettingsDataModelNewFieldFormValues>({
      mode: 'onTouched',
      resolver: zodResolver(
        settingsFieldFormSchema(
          activeObjectMetadataItem?.fields.map((value) => value.name),
        ),
      ),
      defaultValues: {
        type: fieldType,
        icon: defaultIconsByFieldType[fieldType] || 'IconUsers',
        label: '',
        description: '',
      },
    });
    
    useEffect(() => {
      formConfig.setValue('icon', defaultIconsByFieldType[fieldType] || 'IconUsers');
    }, [fieldType, formConfig]);`

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-11 15:55:33 +02:00
Bhavesh Mishra
ac380f183f
OSS.GG Submission for design challenge (#7590)
Designed the Logo for Twenty hacktoberfest theme
points - 300
[click here](https://x.com/thefool1135/status/1844693487067034008)

Designed promotional poster for Twenty Crm hacktoberfest theme
points- 300
[click
here](https://drive.google.com/file/d/1cIC1eitvY6zKVTXKq2LnVrS_2Ho9H8-P/view?usp=share_link)


total - points 600
2024-10-11 15:26:35 +02:00
Baptiste Devessier
521dd04d56
Fix issues with Apollo cache in workflow module (#7569)
Fixes #7523
2024-10-11 15:26:25 +02:00
Raphaël Bosi
3761fbf86f
Refactor action menu (#7586)
Introduces effects to set the actionMenuEntries
2024-10-11 15:25:35 +02:00
Aritra Sadhukhan
9b9b34f991
Liked & Re-Tweeted oss.gg Launch Tweet. tagged @twentycrm and said I'll be contributing (#7591)
Side Quest: Like & Re-Tweet oss.gg Launch Tweet. Quote-tweet it tagging
https://github.com/twentycrm to say you’ll be contributing.
Points: 50 Points

<img width="1439" alt="image"
src="https://github.com/user-attachments/assets/cfa206de-1f32-40cf-9908-8ac4c4e3ef99">
2024-10-11 15:25:21 +02:00
gitstart-app[bot]
7ceaa879fe
Avanced Settings: Custom API names for Select & Multi-Select Keys (#7489)
### Description

- text input was changed because it renders an empty div as the right
icon, but the margin and padding affect the layout
- we have duplicated code on ExpandedWidthAnimationVariants.ts, because
of an eslint rule that prevents more than one const definition, can we
ignore the rule?
- 

### Demo


<https://www.loom.com/share/17a37bf5549a4a23ba12343b6046ec6b?sid=4cf297f3-66db-44c9-9a9b-7bde89b90d02>

### Refs

<https://github.com/twentyhq/twenty/issues/6146>

---------

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-11 10:34:31 +02:00
Rizdar
3ecf9552a5
fix: right drawer top bar story, adding some decorator and state setter (#7580)
# Context
Fixes #7496 
Changed the title to `RightDrawerTopBar` instead of
`RightDrawerActivityTopBar`, following the component name.
Add some missing decorator, and add state setter effect.

# Screenshot

![image](https://github.com/user-attachments/assets/0c6ae774-4602-45ef-8b46-457b7c549ba0)

Missing coverages screenshot.
2024-10-11 09:43:23 +02:00
Bhavesh Mishra
650c401433
Oss.gg Side-Quest submission [Multiple] (#7582)
Side Quest: Like & Re-Tweet oss.gg Launch Tweet. Quote-tweet it tagging
@twentycrm to say you’ll be contributing.
Points: 50 Points
![Screenshot 2024-10-11 at 12 33
31 AM](https://github.com/user-attachments/assets/b96f4e96-a630-4a0c-b84c-1bd2429ccc60)

Side Quest: Share a tweet about your favorite feature in Twenty. Tweet
about your favorite feature in Twenty and mention @twentycrm.
Points: 50 Points
[Click here](https://x.com/thefool1135/status/1844456500380696969)

Side Quest: Meme Magic: Craft a meme where the number twenty plays a
role. Tweet it, and tag @twentycrm.
Points: 150 Points
[Click here](https://x.com/thefool1135/status/1844458836402503931)

Side Quest: Gif Magic: Create a gif related to Twenty. Tweet it, and tag
@twentycrm.
Points: 150 Points
[Click here](https://shorturl.at/yln9H)

total points 400
2024-10-11 09:27:55 +02:00
Weiko
17463434d6
improve matching filter error message (#7578)
## Context
This can be thrown when a type is not properly supported by
isRecordMatchingFilter. This should not happen but for some workspaces
with legacy types this should help debugging.
2024-10-10 18:58:25 +02:00
Harshit Singh
43a0006947
fix: Settings card inconsitent for mobile viewports (#7464)
Closes #7457

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 17:43:22 +02:00
Harshit Singh
9277cb7729
fix: Settings Navigation drawer crops elements (#7557)
Closes #7550

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 17:22:07 +02:00
Devansh Baghel
6824e35f3d
Completed two more side quests and added them into their respective files (#7571)
1. Like & Re-Tweet [oss.gg](http://oss.gg/) Launch Tweet (50 Points):
[tweet](https://x.com/DevanshBaghel5/status/1844359648037748954)

![image](https://github.com/user-attachments/assets/480c96b0-0921-4220-b3ac-16026478a3c6)

2. Share a tweet about your favorite feature in Twenty (50 points):
[tweet](https://x.com/DevanshBaghel5/status/1844384722119704972)

![image](https://github.com/user-attachments/assets/927bb68d-ce05-41b3-9901-a2e98cc9042b)

p.s. changes made are only in one commit
([this](4c0edd9369)),
the extra commits were to sync my fork from upstream.

edit: should i squash these commits into one?
2024-10-10 17:14:12 +02:00
Teddy ASSIH
bbc8cd80c9
Solved two oss.gg side quests (#7572)
Solved both Meme Magic (150 Points) and Gif Magic (150 Points) side
quests for oss.gg challenge and added proof of work on the corresponding
lists.
2024-10-10 17:05:42 +02:00
Nabhag Motivaras
539dc9506d
fix: filter and sort options to match order of table columns (#7392)
### ISSUE

- Closes #5960 

### Demo


https://github.com/user-attachments/assets/279b19cf-6841-4a63-82ed-423bc0eb4395

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 17:05:22 +02:00
Ashish Viradiya
2c927cfd7e
Fix focused cell view (#7451)
Fixes https://github.com/twentyhq/twenty/issues/5595
- The portal has been removed, and the focused cell is now rendered
directly within the relevant div/container.
- This ensures that the cell remains correctly positioned within the
table and is properly hidden or unfocused when the user scrolls
horizontally, fixing the issue of overlap or visibility on top of other
elements.

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 17:05:03 +02:00
ShantanuGaur26
bb2e825cfa
Added callback url structure for self hosting (#7570)
Solves https://github.com/twentyhq/twenty/issues/7442

Added callback url structure in google and microsoft auth for self
hosting.


![374160284-da3f62d2-68b5-4e28-a038-819463c6ea46](https://github.com/user-attachments/assets/343943e9-033d-466d-8d68-1a7e7f6faf2e)
2024-10-10 17:01:16 +02:00
Lucas zapico
8162786d7c
docs: enhance REST API OpenAPI spec with nested filter example (#7366) 2024-10-10 16:35:20 +02:00
martmull
c6a676e1d5
Fix zapier tests (#7568)
See title
2024-10-10 16:34:34 +02:00
Devansh Baghel
76bd11b56f
Remove all mentions of papermark from oss.gg/twenty-side-quest directory and fix inconsistency with the notion document (#7566)
Fixes: #7560 

Also created another file for the bug report side quest as it was
mentioned in the [notion
doc](https://bonapara.notion.site/Twenty-side-quests-10c11d84170380479870e751990f4462),
but there was no file that kept track of it. Added my bug report as the
first entry into that file as well.
2024-10-10 16:05:30 +02:00
shubham yadav
bfc13b9647
Add cache-flush step in Twenty upgrade command #7521 (#7553)
Flush Specific Redis Keys After Upgrade Command :----

Changes Made :----
Updated the FlushCacheCommand to allow for selective flushing of keys
that match the pattern engine:*, rather than flushing the entire cache.
Added a new optional parameter to specify the cache keys pattern.
Ensured that the cache is flushed at the end of the upgrade command.

Code Changes :----
Modified FlushCacheCommand to include a method for flushing keys by
pattern.
Added a new function in CacheStorageService to handle the pattern-based
flushing.

---------

Co-authored-by: Weiko <corentin@twenty.com>
2024-10-10 16:05:09 +02:00
Thomas Trompette
9a77386917
Fix workflow statuses (#7555)
Event was not emitted after first version insertion. So initial status
was not set.

Also adding workflow related objects to timeline activities.
2024-10-10 15:36:33 +02:00
martmull
6998eb1e65
Update zapier integration version (#7564)
Update zapier version to deploy into production
2024-10-10 15:35:36 +02:00
martmull
29bd74feea
7203 support emails links phones in zapier inputs 2 (#7562)
## Done
- add `EMAILS`, `PHONES`, `LINKS`, `RICH_TEXT`, `POSITION`, and `ARRAY`
field support in Twenty zapier integration
- fix `twenty-zapier` package tests and requirements

## Emails
<img width="791" alt="image"
src="https://github.com/user-attachments/assets/7987a1a2-6076-4715-9221-d4a1898b7634">

## Links
<img width="797" alt="image"
src="https://github.com/user-attachments/assets/b94ce972-fae2-4953-b9e8-79c0478f5f60">

## Phones
<img width="789" alt="image"
src="https://github.com/user-attachments/assets/7234eaaf-40b8-4772-8880-c58ba47618c5">

## Array
<img width="834" alt="image"
src="https://github.com/user-attachments/assets/99cb6795-e428-40ea-9c3a-d52561c2c6e1">
2024-10-10 15:32:06 +02:00
Weiko
f4bc0c687e
[search] simplify tsvector generated expression and remove deletedAt condition (#7561)
## Context
Because we can't create GIN indexes on primitive types and in this case
both tsvector and deletedAt (date), we had to create an index on the
tsvector only and had to make sure it wouldn't return results for
deleted records.
To handle this, we added a CASE in the generated expression to generate
an empty value if the row has been soft-deleted. This is a bit too
complex and won't allow search on softDeleted records in the future.

What we want to do is to make sure deleted records are not returned by
default by adding a WHERE clause in the search and still keep good
performances by also adding a BTREE index on deletedAt column.

When this was implemented, soft-deleted was not handled properly but now
typeorm query builder exclude soft deleted records by default which
means the WHERE clause is not necessary. As for the BTREE index on
deletedAt, this should be part on a broader effort to add it to all
tables and can be added in a later PR.

This PR simply updates the complex tsVectorExpression to only return the
expression regardless of the deletedAt column. Search won't return
soft-deleted records as explained above and perfs will be improved in an
upcoming version.

## Test
tested locally with reset db + created a new workspace. Since the
feature is not launched yet no more effort should be made.
<img width="1289" alt="Screenshot 2024-10-10 at 15 16 16"
src="https://github.com/user-attachments/assets/d9a6f06b-d738-4f1d-8053-2fa93bd8b4f8">

## Note
Some issues with optimistic rendering, we need to refresh once a record
has been deleted otherwise it will still be returned by the search
2024-10-10 15:30:13 +02:00
Thomas Trompette
c055d167f2
Make workflow objects read only in frontend (#7545)
Expected behavior:
- workflows can be added and deleted. Only name field is editable
- versions and runs cannot be added nor deleted. No fields are editable

Added two new utils for those needs:
- `isReadOnlyObject` the similar logic between remote objects, versions
and runs
- `isFieldReadonlyFromObjectMetadataName` to easily block field edition
from object context
2024-10-10 15:29:43 +02:00
Weiko
66a483c332
Remove graphql twenty orm feature flag (#7556)
## Context
IS_QUERY_RUNNER_TWENTY_ORM_ENABLED has been fully launched in 0.31.0,
the feature flag can be safely removed.

Note: Waiting for 0.31.1
2024-10-10 14:52:35 +02:00
Charles Bochet
a58236e6da
Remove deprecated EMAIL, PHONE, LINK (#7551)
In this PR:
- remove deprecated EMAIL, PHONE, LINK field types (except for Zapier
package as there is another work ongoing)
- remove composite currency filter on currencyCode, actor filter on name
and workspaceMember as the UX is not great yet
2024-10-10 14:14:58 +02:00
Raphaël Bosi
a7d5aa933d
7338 refactor actionbar and contextmenu to use the context store (#7462)
Closes #7338
2024-10-10 13:26:19 +02:00
Harshit Singh
54c328a7e6
fix: Files field fix (#7376)
## Description

Closes #7324 
Closes #7323

- This PR solves the issue - 
- #7324 
- #7323
- On Enter the rename of the file is saved
- Removed renaming of extension

## After Changes Behaviour


https://github.com/user-attachments/assets/f5c47cd4-883e-473e-9cfa-e277f8f630c2

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 10:41:23 +02:00
sid0-0
7b7c67fb64
fix: Handling filename overflow in mobile viewports (#7364)
Fixes #7330
Fixes https://github.com/twentyhq/twenty/issues/7516 

<div style="display: flex">
<img style="max-width:50%"
src="https://github.com/user-attachments/assets/51027a9d-8745-4cc7-9f17-4000e3615e44"/>
<img style="max-width:50%"
src="https://github.com/user-attachments/assets/827f69ba-c581-402f-9498-6b1a4dde7b69"/>
</div>

---------

Co-authored-by: sid0-0 <a@b.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 10:12:38 +02:00
Vinod Rathod
97ab0481e4
Fix for view switcher default icon display (#7029)
Fixes #6947 (View switcher default icon display)

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 10:12:17 +02:00
Marie
b6b7d0e665
Fix field creation (#7547)
In [this](https://github.com/twentyhq/twenty/pull/7522) and
[this](https://github.com/twentyhq/twenty/pull/7543) PR we introduced
the impossibility to save a field that would be non nullable but without
a default value.
The check is actually called on the input while the defaultValue is
added by the service on a "built" fieldMetadata to create or save. So
far all fields created from the app it currently fails as both
isNullable and defaultValue are undefined so falsy at that stage.
2024-10-10 09:38:29 +02:00
Vardhaman Bhandari
c13b29a6ea
Fix hide calender icon if no deadline on task (#7465)
Closes #7402 


![image](https://github.com/user-attachments/assets/46912a22-8dfb-4065-a877-de179fd796d3)

Ensured that the calendar icon is only visible when a deadline is
assigned

---------

Co-authored-by: ehconitin <nitinkoche03@gmail.com>
2024-10-10 13:04:25 +05:30
sid0-0
e45e45d8b2
Prefill Relation Fields with Initiating Object Icon and Name (#7363)
feat: #7355 

Behaviour implemented:
1. Relation field name field is updated when relation type is updated
2. Icon is only prefilled in the beginning
3. If user manually edits the field name, then no subsequent updates are
made to that field upon relation type change.



https://github.com/user-attachments/assets/d372b106-8dcb-458d-8374-a76cd130f091

---------

Co-authored-by: sid0-0 <a@b.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-10-10 08:29:37 +02:00
Harshit Singh
656ab4ed95
fix: Developers page is not optimised for mobile viewport (#7493)
## Description

- This PR solves the issue #7483 
- optimised the developers page for all mobile viewports

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-10-10 08:23:37 +02:00
nitin
c57d8f1346
Breadcrumb DropDown improvement (#7546)
context -
https://github.com/twentyhq/twenty/pull/7397#pullrequestreview-2356581785
P.S. Apologies for the background music in the screen recording—I didn’t
realize my mic was on while capturing it. 😅


https://github.com/user-attachments/assets/0cd31aa7-9ce2-4577-a79a-73c9890f2905

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-09 22:04:56 +02:00
NitinPSingh
855060a308
fix #7486 enable save button on adding options in select/multiselect (#7495)
issue : #7486 

demo 


https://github.com/user-attachments/assets/0b1ed9de-2aa1-4910-bfc7-01732b89367f
2024-10-09 19:39:52 +02:00