## Context
This command was introduced to simplify searchVector expressions that
were added in v0.31.x for existing workspaces.
New search vector columns have been added later during 0.32 development
and should not be migrated, this actually breaks the command because we
run sync-metadata before the upgrade command.
The fix removes the throw since this is expected and return early if the
search vector was not matched with an object that needs migration.
## Test
checkout v0.31.0
reset:db command
checkout this PR
run typeorm migrations
run upgrade 0-32 command
In the expression of our searchVector fields, we use the "simple"
configuration (over the default "english" one), to avoid picking a
language that's irrelevant to the user.
I initially forgot to add the same configuration to the query that is
being sent using ts_query.
Adding it will also allow the search to work for a single character,
while so far a single letter was most of the time considered a "stop
word" (a word with no semantic value, like "a").
## Context
Latest refactoring broke the findOneWithinWorkspace method which is
called during object update, I'm simply reverting this change.
object-metadata-relation.service was naively computing a namePlural
based on the nameSingular while we already had that info in the DB...
Should fix some issues with renaming as well because the original field
was not computed with the right name.
- fix webhook.operation format change from august 2024 not spread in
twenty-zapier
- added a comment so it does not happen again
- add a fix for the new webhook.operations column that would produce
another issue
https://github.com/twentyhq/private-issues/issues/75
**TLDR**
Add twenty-server package, wich contains the last tinybird datasources
and pipes used in analytics.
This new version of the API endpoints, pipes and datasources are
inspired by the implementation of dub.co
(https://github.com/dubinc/dub/blob/main/packages/tinybird/).
It contains the webhooks analytics, serverless functions duration and
serverless functions error count analytics. As well as
**In order to test**
- Follow the instructions in the README.md on twenty-tinybird using your
admin token from twenty_analytics_playground if you want to modify them.
- For a better experience add the extension Tinybird support for VsCode
- If you want more info about datasources and pipes please read the
tinybird docs.
---------
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Fixes: #6105
### Problem
- The dropdown gets clipped when the number of filters increases.
### Solution
- Added scroll property to the ```DropdownMenu```
- Added size middleware to the floating UI hook.
- Provided padding of 20px to the size middleware, so that it maintains
distance from the bottom of the screen.
[Screencast from 2024-10-25
13-47-04.webm](https://github.com/user-attachments/assets/c2315ee2-6092-4c4a-8126-dba7ac3bf49b)
---------
Co-authored-by: martmull <martmull@hotmail.fr>
Closes#7906
Modified the two children(`TextInputV2` and `CountrySelect`) in the
`StyledHalfRowContainer` component to always be equal in size and divide
the available space equally.
The `StyledIconChevronDown` component has a `flex-shrink: 0` to prevent
it from completely disappearing. The same applies for the
`selectedOption.Icon`.
A `p` tag had to be added to the label to correctly handle the text
overflow.
---------
Co-authored-by: Devessier <baptiste@devessier.fr>
Tiptap uses non breaking spaces between nodes (like variables). Those
html characters are not properly handles in emails. Replacing by regular
spaces during parsing.
I tried to fix it in settings but looks like this is only for preserving
those nbsp and not for removal (see
https://github.com/ueberdosis/tiptap/pull/254)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7526](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7526).
---
### Description
We are using standard field and object IDs because there is a problem
when creating them as we would with helpers.
We were creating custom objects and removing them in afterAll, but there
is a problem that causes a conflict in the object IDs if the tests run
at the same time. The solution would be to modify the test command as
mentioned here:
<https://github.com/typeorm/typeorm/issues/6125>
Currently, we are using the standard IDs but we can create the objects
within the test if you want, but we would need to make them run in
sequence
### Demo
![](https://assets-service.gitstart.com/16336/70c5550e-8570-45d7-a613-a3d6b79e7c00.png)
### Refs
#7526
---------
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Closes#7179
The font color of the button has been set to use
`theme.font.color.danger`. This means that the color will be red
regardless of whether the theme is inverted or not, which was the issue
before.
Merge conflicts have been resolved.
## Context
ObjectMetadataService became quite large and handles too many
responsibilities. I'm trying to refactor a bit this part in preparation
of a larger work that will combine object-metadata services and
sync-metadata logic
- Created a STANDARD_OBJECT_ICONS that can be reused in relation
creation to refer to a standard object icon.
- Created a STANDARD_OBJECT_FIELD_IDS that can be used with an object
name to get its standard field ids.
- Moved migration, record and relation creations to dedicated services,
refactored to improve performances and readability
- Refactored some validation logic
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
In this PR
1) (FE) fixing update of name not taken into account if toggle value is
changed in the same transaction
2) (BE) moving same nameSingular and namePlural validation before
effective update
### What type of PR is this? (check all applicable)
- [X] Bug Fix
## Description
This PR include fix required for issue #8058 and #6741 .
- Fixes visibility of currency symbol on hover over field
- Fixes visibility of task icon symbol on hover over field
## Related Tickets & Documents
- Closes#8058
- Closes#6741
---------
Co-authored-by: Félix Malfait <felix@twenty.com>
The recent addition of a "orWhere" condition to[ improve the search algo
quality](https://github.com/twentyhq/twenty/pull/7955) accidentally
broke the filter, being considered an independent "or" wondition while
we still want the filter to apply.
In this PR:
- Add support for manual triggers in the backend
- Add a right drawer to let users select the type of trigger they want
- Create a specific right drawer for database event triggers
- Create a right drawer for manual triggers; let the user select where
the manual trigger should be made available
- Create a default trigger as soon as the user selects the type of
trigger they want. It prevents the user to see empty selects for record
type and event type. By default, the database event trigger will be set
to "company.created". It should be visible enough for users to
understand what happens and choose another record type or event type.
https://github.com/user-attachments/assets/29a21985-1823-4890-9eb3-e4f876459c7a
Fixes: #7959
### Problem
- When searching in the dropdown, the results list would shrink based on
matching items
- This dynamic height change caused the dropdown to flip its position on
each keystroke
### Solution
- Added ```hasMinHeight``` as optional props to the
```DropdownMenuItemsContainer``` to maintain consistent height
- This prevents unwanted position recalculations and flipping while user
types
- The dropdown now stays in its initial position throughout the search
interaction
[Screencast from 2024-10-24
15-43-03.webm](https://github.com/user-attachments/assets/741317b7-fc5e-4874-8221-aa626a1a1747)
Fix#4244 and #4356
This pull request introduces the new "view groups" capability, enabling
the reordering, hiding, and showing of columns in Kanban mode. The core
enhancement includes the addition of a new entity named `ViewGroup`,
which manages column behaviors and interactions.
#### Key Changes:
1. **ViewGroup Entity**:
The newly added `ViewGroup` entity is responsible for handling the
organization and state of columns.
This includes:
- The ability to reorder columns.
- The option to hide or show specific columns based on user preferences.
#### Conclusion:
This PR adds a significant new feature that enhances the flexibility of
Kanban views through the `ViewGroup` entity.
We'll later add the view group logic to table view too.
---------
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Closes#7817
Added role attribute to the div element of the Chip component. This
assigns the role of "button" to the container, which is important for
accessibility. It indicates that this div should be treated as a button
by assistive technologies like screen readers.
---------
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-5491](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-5491).
This ticket was imported from:
[TWNTY-5491](https://github.com/twentyhq/twenty/issues/5491)
---
### Description
**How To Test:**\
1. Reset db using `npx nx database:reset twenty-server` on this PR
1. Run both backend and frontend
2. Navigate to `settings/data-model/objects/ `page
3. Select a `Custom `object from the list or create a new `Custom
`object
4. Navigate to custom object details page and click on edit button
5. Finally edit the object details.
**Issues and bugs**
The Typecheck is failing but we could not see this error locally
There is a bug after updating the label of a custom object. View title
is not updated till refreshing the page. We could not find a consistent
way to update this, should we reload the page after editing an object?
![](https://assets-service.gitstart.com/45430/03cd560f-a4f6-4ce2-9d78-6d3a9f56d197.png)###
Demo
<https://www.loom.com/share/64ecb57efad7498d99085cb11480b5dd?sid=28d0868c-e54f-454d-8432-3f789be9e2b7>
### Refs
#5491
---------
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>
Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7526](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7526).
---
### Description
For workspace members, the deletion of multiple members is a special
case that is not permitted by the method for regular users. As a result,
we ensure that multiple deletions are not processed.
For certain tests, both an account ID and a user ID are required. We are
utilizing Tim's account for all testing purposes, as specified by the
token in `jest-integration.config.ts`. To streamline this process, we
have defined a constant to store and reference the account ID and user
ID during testing.Refs
#7526
### Dem
![](https://assets-service.gitstart.com/16336/4df04650-70ff-4eb6-b43f-25edecc8e66f.png)
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7529](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7529).
---
### Description
- Migrated all button components to `twenty-ui` \
\
`Button`\
`ButtonGroup`\
`ColorPickerButton`\
`FloatingButton`\
`FloatingButtonGroup`\
`FloatingIconButton`\
`FloatingIconButtonGroup`\
`IconButton`\
`IconButtonGroup`\
`LightButton`\
`LightIconButton`\
`LightIconButtonGroup`\
`MainButton`\
\
Fixestwentyhq/private-issues#89
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Fixes: #7897
This PR fixes the flipping of the date-picker in the record's cell even
if there is enough space below the table.
I attached a screencast to show that it's working fine now.
With this, it only flips when there is less space to accommodate the
date-picker comp. Also, I tested this after adding lots of records to
see if the scrolling behaviour is intact or not. And I found no issues,
it's working as expected.
[Screencast from 2024-10-21
13-39-42.webm](https://github.com/user-attachments/assets/615fac80-ae2e-4d26-8f94-55d7ee3f91c2)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7539](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7539).
---
### Description
- Move the utilities/dimensions from twenty-front to twenty-ui and
update imports\
Fixestwentyhq/private-issues#79
---------
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Closes#7499
- Modifies context store states to be component states
- Introduces the concept of `mainContextStore` which will dictate the
available actions inside the command K
- Adds contextual actions inside the right drawer
- Creates a new type of modal variant
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7538](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7538).
---
### Description
- Move animation components to `twenty-ui` \
\
\
Fixes #7538
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Solves:
https://github.com/twentyhq/private-issues/issues/74
**TLDR**
When a serverless function is executed, the result is send to tinybird
event data source.
**In order to test:**
1. Set ANALYTICS_ENABLED to true
2. Put your TINYBIRD_INGEST_TOKEN from twenty_event_playground in your
.env file
3. Don't forget to run the worker
4. Create your serverless function and run it
5. The event should be logged on the event datasource in
twenty_event_playground
**What is the structure of the payload of a serverless function event?**
Here are two examples of the payload:
`{"duration":37,"status":"SUCCESS","functionId":"a9fd87c0-af86-4e17-be3a-a6d3d961678a","functionName":"testingFunction"}`
`
{"duration":34,"status":"ERROR","errorType":"ReferenceError","functionId":"a9fd87c0-af86-4e17-be3a-a6d3d961678a","functionName":"testingFunction"}`
**Possible improvments**
- Change the status(str) to success(bool)
- Enrich data in the payload
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7535](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7535).
---
### Description.
Migrate link components to `twenty-ui` \
\
Fixes#7535
---------
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: Charles Bochet <charles@twenty.com>
## Context
bull-mq connection was not working as intended, the connection parameter
was ignored and was falling back to localhost.
This PR should fix the issue by instantiating a IORedis client following
bullmq documentation https://docs.bullmq.io/guide/connections
I also changed cache-storage module to use IORedis client as well to be
more consistent even though it was not necessary there. We could move
that instantiation to a factory class in the future.
## Test
start server + worker with correct port and wrong port with
cache-storage-type memory/redis and queue-type sync/bull-mq
Solves https://github.com/twentyhq/private-issues/issues/118
**TLDR**
Fix webhook response not sending data to tinybird when the url is not a
link.
**Changes in Tinybird:**
- Add column Success to webhook payload (boolean)
- Changed the parameter WebhookIdRequest to WebhookId in the
getWebhooksResponse api point.
- Those changes can be seen in the tinybird workspace
twenty_analytics_playground
**In order to test**
1. Set ANALYTICS_ENABLED to true
2. Set TINYBIRD_INGEST_TOKEN to your token from the workspace
twenty_analytics_playground
3. Set TINYBIRD_GENERATE_JWT_TOKEN to the admin kwt token from the
workspace twenty_analytics_playground
4. Set TINYBIRD_WORKSPACE_UUID to the UUID of
twenty_analytics_playground
5. Create a Webhook in twenty and set wich events it needs to track
6. Run twenty-worker in order to make the webhooks work.
7. Do your tasks in order to populate the data
8. Look at your webhooks in settings>api and webhooks> your webhook and
the statistics should be displayed
We were previously checking for matching with each search term
independently. Ex searching for "felix malfait" we were searching for
correspondances with "felix" and "malfait".
As a result record A with name "Marie-Claude Mala" and email
"ma.lala@email.com" had a biggest search score than record B "Felix
Malfait" with email felix@email.com for search "felix ma":
for record A we had 0 match with felix and 3 matches with "ma" ("marie",
"mala", "ma")
for record B we had 1 match with felix and 1 match with "ma" (with
"malfait").
So we want to give more weight to a row that would combine matches with
both terms, considering "felix malfait" altogether.
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7531](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7531).
---
### Description
- Migrate the `animated-placeholder` to `twenty-ui` and update all
imports.\
\
Fixestwentyhq/private-issues#87
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7526](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7526).
---
### Description
NoteTargets and MessageThreads are special cases because they do not
have a notable property that we could use in "update" the test cases,\
for NoteTargets we are using the personId, testing the relation, but for
MessageThreads we are using updatedAt. To test the relations for
MessageThreads\
we would need to update another object (Message) because the relation is
ONE_TO_MANY, updating another object in a test that would update the
current tested object sounds incorrect.\
In the NoteTargets, we can update the NoteTarget object because the
relation is MANY_TO_ONE\
for some tests we need an account ID, we are using Tim's account for all
the tests (the token in jest-integration.config.ts), so we are using a
constant to use the account ID
### Refs
#7526
### Demo
![](https://assets-service.gitstart.com/28455/7f1c520e-78e4-43c3-aa89-f6fc09e0a056.png)
---------
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: gitstart-twenty <140154534+gitstart-twenty@users.noreply.github.com>
fixes: #7757
## What does this PR do?
We increased the line height from md to lg and the max height of the
placeholder subtitle text from 2.4 to 2.8 to ensure that letters are no
longer slightly cut off in the placeholder in Functions.
![twenty-placeholder-text](https://github.com/user-attachments/assets/1cfed3c4-6bae-4200-9516-4e1295da170a)
## How should this be tested?
1. Log in
2. Go to Settings
3. Toggle "Advanced" settings
4. Go to Functions
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
Fix: #7100
The `TabList` component, located in
[Tablist](packages/twenty-front/src/modules/ui/layout/tab/components/TabList.tsx),
wraps the Tabs and defines the padding, and is used in multiple places.
The left padding for the Emails and Calendars sections of the Accounts
in Settings has been removed ( list appear when there are multiple
connected accounts ). However, the padding on the Record detail page
remains unchanged.
To address this, prop of css styles is added to `Tablist`, allowing for
the padding of the `TabList` component to be adjusted as required.
Additional styles can also be applied as per requirements individually
for Emails and Calendar section.
<img width="722" alt="Screenshot 2024-10-16 at 5 06 26 AM"
src="https://github.com/user-attachments/assets/3c7648ac-e2a6-4871-b58b-d25b008a06f0">
<img width="789" alt="Screenshot 2024-10-16 at 5 49 18 AM"
src="https://github.com/user-attachments/assets/a6e61b4d-0245-4744-ae87-86fe01a6bc43">
<img width="725" alt="Screenshot 2024-10-16 at 6 22 30 AM"
src="https://github.com/user-attachments/assets/e6a19095-3ee4-431f-ba19-1182552a5c8d">
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
## What it does
### Backend
- [x] Add a mutation to create OIDC and SAML configuration
- [x] Add a mutation to delete an SSO config
- [x] Add a feature flag to toggle SSO
- [x] Add a mutation to activate/deactivate an SSO config
- [x] Add a mutation to delete an SSO config
- [x] Add strategy to use OIDC or SAML
- [ ] Improve error management
### Frontend
- [x] Add section "security" in settings
- [x] Add page to list SSO configurations
- [x] Add page and forms to create OIDC or SAML configuration
- [x] Add field to "connect with SSO" in the signin/signup process
- [x] Trigger auth when a user switch to a workspace with SSO enable
- [x] Add an option on the security page to activate/deactivate the
global invitation link
- [ ] Add new Icons for SSO Identity Providers (okta, Auth0, Azure,
Microsoft)
---------
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
#### Description
This PR resolves issue #7903 regarding the Storybook configuration for
Windows development environments. Previously, the configuration script
generated forward slashes instead of backslashes, leading to errors when
running the command `npx nx run twenty-front:storybook:serve:dev
--configuration=modules` on Windows systems.
#### Changes Made
- Updated the Storybook configuration to ensure that backslashes are
used in file paths for Windows environments, preventing command
execution errors.
#### How to Test
1. **Run Storybook Command**:
- On a Windows machine, execute the command:
```
npx nx run twenty-front:storybook:serve:dev --configuration=modules
```
- Ensure that the command runs successfully without any path-related
errors.
2. **Verify Configuration**:
- Check the Storybook configuration files to confirm that paths are
using backslashes where applicable.
- Test the same command on non-Windows environments to verify that there
are no regressions.
#### Related Issue
- Fixes#7903
In this PR:
- Use a real `<input type="checkbox" />` element in the `<Toggle />`
component
- Create an `accessibility` module in the `twenty-ui` package
- Export the `VISIBILITY_HIDDEN` CSS object to hide visually any element
- Export a `<VisibilityHidden />` component from the `twenty-ui` package
to add visually hidden textual information easily
- Export a `<VisibilityHiddenInput />` component to create custom form
control components easily
- Use a `<label>` element for the "Advanced:" text; it will naturally
toggle the advanced settings
Fixes#7756
---------
Co-authored-by: Devessier <baptiste@devessier.fr>
In this PR:
- Let the `<NavigationDrawerItem />` component render a `<button>` by
default instead of a `<div>`
- Replace `<div>` by `<span>` inside the `<NavigationDrawerItem />` as
`<button>` and `<a>` HTML elements only accept [_phrasing
content_](https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content).
- Fix layout issue: the keyboard icon wasn't put on the right of the
button, I put it back
Fixes#7575
---------
Co-authored-by: Devessier <baptiste@devessier.fr>
TLDR:
Secure connexion between tinybird and twenty using jwt when accessing
datasource from tinybird.
Solves:
https://github.com/twentyhq/private-issues/issues/73
In order to test:
1. Set ANALYTICS_ENABLED to true
2. Set TINYBIRD_JWT_TOKEN to the ADMIN token from the workspace
twenty_analytics_playground
3. Set TINYBIRD_JWT_TOKEN to the datasource or your admin token from the
workspace twenty_analytics_playground
4. Create a Webhook in twenty and set wich events it needs to track
5. Run twenty-worker in order to make the webhooks work.
6. Do your tasks in order to populate the data
7. Enter to settings> webhook>your webhook and the statistics section
should be displayed.
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
## Context
Moving this command to the global command runner for 0.32 upgrade. This
should fix searchVector expression introduced in 0.31 to later handle
soft-deleted + search filter properly.
## Test
```
git co v0.31.0
-- reset DB
git co c--add-simplify-search-vector-expression-to-upgrade-0-32
-- migrate typeorm
-- upgrade 0.32 command
```
search is working and expression is correctly set. Soft deleted records
are not shown as before but it's now possible to override that behavior
via filters.
cc @ijreilly
In this PR:
- Allow the `<ConfirmationModal />` to take additional buttons to
display between the cancel and the confirm buttons.
- Create a modal that's displayed when the user tries wants to use a
workflow version as draft while a draft version already exists. The
displayed modal contains a link to the current draft version and a
button to confirm the overriding of the current draft version.
A demo:
https://github.com/user-attachments/assets/6349f418-1b11-45b3-9f5e-061ca74c2966Closestwentyhq/private-issues#114
@ehconitin following your question I did a quick refactoring of the show
page - we can push it much further but it would be better to start from
this code than from main
Edit: I will merge to avoid conflicts, this is very far from perfect but
still much better than the mess we had before
## Context
Regression on custom index creation where indexFieldMetadatas were not
saved properly in the DB. This is because we recently changed save() to
upsert() in the indexMetadataService and upsert does not handle nesting
insert properly.
I'm suggesting another fix where we separate indexMetadata creation and
index migration creation in 2 different functions. Since the goal was to
be able to recreate the index after being deleted when we changed the
tsvector expression and indexMetadata was actually not deleted, we
didn't need to recreate that part (hence the upsert) and only needed to
run a migration to create the actual index in the workspace schema.
I've updated the different services and now only call
createIndexMigration when we update a search vector expression.
Note: this is also fixing the sync-metadata command when running on a
workspace with a custom object (including the seeded workspace which has
the 'rocket' custom object), failing due to the missing 'searchVector'
indexFieldMetadata
First step of #https://github.com/twentyhq/twenty/issues/3298.
Here we update the search endpoint to allow for a filter argument, which
we currently use in the relation pickers to restrict or exclude ids from
search.
In a future PR we will try to simplify the search logic in the FE
**Before:**
Only last 5 days where displayed on Developers Settings Webhook Usage
Graph.
![image](https://github.com/user-attachments/assets/7b7f2e6b-9637-489e-a7a7-5a3cb70525aa)
**Now**
Added component where you can select the time range where you want to
view the webhook usage. To do better the styling and content depassing .
<img width="652" alt="Screenshot 2024-10-15 at 16 56 45"
src="https://github.com/user-attachments/assets/d06e7f4c-a689-49a0-8839-f015ce36bab9">
**In order to test**
1. Set ANALYTICS_ENABLED to true
2. Set TINYBIRD_TOKEN to your token from the workspace
twenty_analytics_playground
3. Write your client tinybird token in
SettingsDeveloppersWebhookDetail.tsx in line 93
4. Create a Webhook in twenty and set wich events it needs to track
5. Run twenty-worker in order to make the webhooks work.
6. Do your tasks in order to populate the data
7. Enter to settings> webhook>your webhook and the statistics section
should be displayed.
8. Select the desired time range in the dropdown
**To do list**
- Tooltip is truncated when accessing values at the right end of the
graph
- DateTicks needs to follow a more clear standard
- Update this PR with more representative images
When the user presses the cancel button, the server sends the following
response:
![image](https://github.com/user-attachments/assets/cb68cf01-b32c-4680-a811-cd917db88ca9)
{"statusCode": 401, "message": "Unauthorized"}
Now, when the user clicks the cancel button, they are redirected to the
home page for login.
Related Issue
Fixes#7584
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
Hello,
Hope you are doing well.I created a special style for the text to make
sure it stays in one line and wont exceed the width if the text width
will be more then 80px it will ecplise and set ... at the end of the
text.
I created these 2 styles variables and wrap my text in these styles
StyledObjectSummary
StyledEllipsisParagraph
Fixes#7574
#Screens Shots
<img width="1268" alt="Screenshot 2024-10-10 at 10 58 04 PM"
src="https://github.com/user-attachments/assets/2d3ef2c5-c4c8-489b-a205-50a48b986d60">
<img width="530" alt="Screenshot 2024-10-10 at 10 58 20 PM"
src="https://github.com/user-attachments/assets/e0d1cb48-dbc9-427a-99ac-54269c574360">
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
### Description
- We are using gql instead of strings to be able to see the graphql code
highlighted
### Demo
![](https://assets-service.gitstart.com/28455/d06016b9-c62c-4e0d-bb16-3d7dd42c5b6b.png)
Fixes#7526
---------
Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
## PR Summary
This Pull request fixes#7626
Adding Deleted filter from option will add filter label as "Deleted" in
tableFiltersState, But on click of "Remove Deleted filter" "Deleted at"
is used for finding tableFilter id, which results in tableFilter id as
undefined.
Closes#7421
This pull request consolidates Redis connection parameters into a single
`REDIS_URL` environment variable across various configuration files and
code modules. The most important changes include updates to environment
variable files, Docker and Kubernetes configurations, and code modules
to utilize the new `REDIS_URL` format.
### Environment Variable Updates:
*
[`packages/twenty-docker/.env.example`](diffhunk://#diff-f4b5e7acc0dde630eafb2228390ca56bd56db0d183582be6433a9ee808088a4cL8-R8):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL`.
*
[`packages/twenty-server/.env.example`](diffhunk://#diff-c06e244338b33286ea90221635809785352a971de53f647ea65650124ae74ad2L53-R53):
Replaced `REDIS_HOST`, `REDIS_PORT`, `REDIS_USERNAME`, and
`REDIS_PASSWORD` with `REDIS_URL`.
*
[`packages/twenty-server/.env.test`](diffhunk://#diff-def44a08e699c9deca2f72c9f87951de5d33d9ccf5621eab2f34978df8ad0954L16-R16):
Replaced `REDIS_HOST`, `REDIS_PORT`, `REDIS_USERNAME`, and
`REDIS_PASSWORD` with `REDIS_URL`.
### Docker and Kubernetes Configuration Updates:
*
[`packages/twenty-docker/docker-compose.yml`](diffhunk://#diff-545fb51ad66f93f727bb8f8b375dc6858b33348d91d5e51ad931fb0bbc1affeeL28-R28):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL` in multiple
service definitions.
[[1]](diffhunk://#diff-545fb51ad66f93f727bb8f8b375dc6858b33348d91d5e51ad931fb0bbc1affeeL28-R28)
[[2]](diffhunk://#diff-545fb51ad66f93f727bb8f8b375dc6858b33348d91d5e51ad931fb0bbc1affeeL62-R61)
*
[`packages/twenty-docker/k8s/manifests/deployment-server.yaml`](diffhunk://#diff-91623ed4e8b2088947cfa9a5dad76b6013e8db0c150d84347a215fa9ad78bf04L44-R45):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL`.
*
[`packages/twenty-docker/k8s/manifests/deployment-worker.yaml`](diffhunk://#diff-8532debd131ce168a2527fa6a9be6405792178576ee47e2eef0cd9f3ff4a8f8cL43-R44):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL`.
*
[`packages/twenty-docker/k8s/terraform/deployment-server.tf`](diffhunk://#diff-b4c468660ab00bd03589d0d47502c477ca83f7d876ff196534880b02ba46dce0L64-R65):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL`.
*
[`packages/twenty-docker/k8s/terraform/deployment-worker.tf`](diffhunk://#diff-e5d6a1f68d5391e2120aef6261f22f905aa1ce0a567e31b21a27d44f313eaecaL62-R63):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL`.
### Code Module Updates:
*
[`packages/twenty-server/src/engine/core-modules/cache-storage/cache-storage.module-factory.ts`](diffhunk://#diff-06e787a7c8a48022d5909b5df9b8c6ca192521cf32f51d7f561cee937bed6678L23-R35):
Replaced `REDIS_HOST` and `REDIS_PORT` with `REDIS_URL`.
*
[`packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts`](diffhunk://#diff-26ce615693b053eda02aa48aa2e30400381a2588dcb08d4a9dc3b0bf5bdd6fe7L378-R384):
Added validation for `REDIS_URL`.
*
[`packages/twenty-server/src/engine/core-modules/message-queue/message-queue.module-factory.ts`](diffhunk://#diff-7bd644d28bdd86c159c1d71242753df5d5acd91c73c6e60b2e35caa53ed3836bR6):
Replaced `REDIS_HOST`, `REDIS_PORT`, `REDIS_USERNAME`, and
`REDIS_PASSWORD` with `REDIS_URL`.
[[1]](diffhunk://#diff-7bd644d28bdd86c159c1d71242753df5d5acd91c73c6e60b2e35caa53ed3836bR6)
[[2]](diffhunk://#diff-7bd644d28bdd86c159c1d71242753df5d5acd91c73c6e60b2e35caa53ed3836bL35-R41)
### Documentation Updates:
*
[`packages/twenty-website/src/content/developers/self-hosting/self-hosting-var.mdx`](diffhunk://#diff-c4cc78a3ce18b6edb10f1aee8990271e1d2796a8c06c1c6ae3b68db8d52278a3L37-R37):
Updated documentation to reflect the change to `REDIS_URL`.
*
[`packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx`](diffhunk://#diff-c7d757829f6128e1f47aa1955bde561292dce558280511fab66281afa99042a5R102-R112):
Added upgrade instructions for the new `REDIS_URL` variable.
---------
Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Issue Reference: Fixes#7105
Description:
This pull request introduces adjustments to the styling of the
RecordBoardColumnHeader component. The modifications enhance the layout
and visual consistency of the Kanban board headers.
Changes Made:
Margin Adjustment:
Increased the bottom margin from theme.spacing(2) to theme.spacing(6)
for better spacing below the header.
Header Container Enhancements:
Added a background color sourced from the theme
(theme.background.primary) to the header container for improved
visibility and aesthetics.
Set a fixed height of 40px for the header to ensure a consistent size
across different screens.
Applied a fixed position to the header container to keep it visible at
the top during scrolling.
Added padding at the top using theme.spacing(2) for better alignment of
content within the header.
Before :
https://github.com/user-attachments/assets/fd1c2d65-5e50-489a-a388-c0c4e1bd015b
Now :
[now.webm](https://github.com/user-attachments/assets/bd4cfb86-fc14-4902-b84c-99d27b07859e)
---------
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
`isUnique` was passed to TypeORM's column creation API resulting in
double index creation because it's already done via the decorator and
then in `WorkspaceMigrationIndexFactory`
It would be interesting to move it at this field level in a later step,
which is why I also fixed `CompositeColumnActionFactory` to pass
isUnique on the correct columns, even though it's being ignored later on
## Context
This PR removes pg_graphql from the setup. It also updates the local
setup documentation accordingly.
Note: We removed local setup scripts to align with redis installation,
the setup should be much simpler since we don't rely on pg_graphql
anymore.
## Test
tested locally with docker + mac (brew) setup
By default, when custom fields are created, a searchVector field is
created based on the "name" field, which is also the label identifier by
default.
When this label identifier is updated, we want to update the
searchVector field to use this field as searchable field instead, if it
is of "searchable type" (today it is only possible to select a text or
number field as label identifier, while number fields are not
searchable).
## Context
WorkspaceIsUnique decorator allows us to create unique indexes on our
tables. Here Emails is a composite field containing a TEXT subfield. Due
to the fact that TEXT fields are non-nullable and have empty strings as
default values, adding a unique index on a TEXT field or any composite
containing TEXT as subfields will fail and throw if we try to create
more than 1 record that does not specify a value to the TEXT field.
This PR simply removes the index for the time being until we find a
solution
In this PR, I changed the hard-coded width value to a dynamic value
which will be calculated based on the parent container.
This PR closes issue: #7615
## Context
This PR removes workspace-query-runner/builder in preparation for fully
deprecating pg_graphql
next steps: Remove from the setup and make a command to remove comments
on schema/tables related to pg_graphql
This PR:
- Uses `<label>` HTML elements when possible to represent labels
- Uses the new `useId()` React hook to get an identifier to link the
label with its input; it's more suitable than generating a UUID at every
render
Fixes#7281
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
Hello Twenty Team,
If this is not an appropriate PR, please feel to close it. I am hoping
to make larger contributions down the road.
I was getting twenty setup locally, and I had a problem with the install
script. I noticed that `yay` was named as an AUR helper, but `paru` was
not. I use [paru](https://github.com/Morganamilo/paru), and this caused
the setup script to fail.
I made a small change in the if statement that checks if `pg-graphql`
can be installed with `yay`. I included a check for `paru` on the same
line.
Thanks everyone who has made this project what it is.
Issue: Long names in the Members table were overflowing, affecting the
layout.
Fix:
- Trimmed long names with ellipses.
- Added tooltips to display the full content on hover.
- Max-width of the text dynamically set to 90px on large screens, and
60px on mobile.
![image](https://github.com/user-attachments/assets/3b5d1c08-fe0e-4c0b-952a-0fc0f9e513bc)
---------
Co-authored-by: karankhatik <karan13699@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Fixed Nav Item Api & Webhook and Functions stay selected like data model
settings.
Now when clicked stays selected and deos not loose its selection
Fixes#7573https://github.com/user-attachments/assets/4cb78158-8411-4ee1-9bcc-2870344c0c62
---------
Co-authored-by: ehconitin <nitinkoche03@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
Add support for indexes on composite fields and unicity constraint on
indexes
This pull request includes several changes across multiple files to
improve error handling, enforce unique constraints, and update database
migrations. The most important changes include updating error messages
for snack bars, adding a new command to enforce unique constraints, and
updating database migrations to include new fields and constraints.
### Error Handling Improvements:
*
[`packages/twenty-front/src/modules/error-handler/components/PromiseRejectionEffect.tsx`](diffhunk://#diff-e7dc05ced8e4730430f5c7fcd0c75b3aa723da438c26e0bef8130b614427dd9aL23-R23):
Updated error messages in `enqueueSnackBar` to use `error.message`
directly.
*
[`packages/twenty-front/src/modules/object-metadata/hooks/useFindManyObjectMetadataItems.ts`](diffhunk://#diff-74c126d6bc7a5ed6b63be994d298df6669058034bfbc367b11045f9f31a3abe6L44-R46):
Simplified error messages in `enqueueSnackBar`.
*
[`packages/twenty-front/src/modules/object-record/hooks/useFindDuplicateRecords.ts`](diffhunk://#diff-af23a1d99639a66c251f87473e63e2b7bceaa4ee4f70fedfa0fcffe5c7d79181L56-R58):
Simplified error messages in `enqueueSnackBar`.
*
[`packages/twenty-front/src/modules/object-record/hooks/useHandleFindManyRecordsError.ts`](diffhunk://#diff-da04296cbe280202a1eaf6b1244a30490d4f400411bee139651172c59719088eL22-R24):
Simplified error messages in `enqueueSnackBar`.
### New Command for Unique Constraints:
*
[`packages/twenty-server/src/database/commands/upgrade-version/0-31/0-31-enforce-unique-constraints.command.ts`](diffhunk://#diff-8337096c8c80dd2619a5ba691ae5145101f8ae0368a75192a050047e8c6ab7cbR1-R159):
Added a new command to enforce unique constraints on company domain
names and person emails.
*
[`packages/twenty-server/src/database/commands/upgrade-version/0-31/0-31-upgrade-version.command.ts`](diffhunk://#diff-20215e9981a53c7566e9cbff96715685125878f5bcb84fe461a7440f2e68f6fcR13-R14):
Integrated the new `EnforceUniqueConstraintsCommand` into the upgrade
process.
[[1]](diffhunk://#diff-20215e9981a53c7566e9cbff96715685125878f5bcb84fe461a7440f2e68f6fcR13-R14)
[[2]](diffhunk://#diff-20215e9981a53c7566e9cbff96715685125878f5bcb84fe461a7440f2e68f6fcR31)
[[3]](diffhunk://#diff-20215e9981a53c7566e9cbff96715685125878f5bcb84fe461a7440f2e68f6fcR64-R68)
*
[`packages/twenty-server/src/database/commands/upgrade-version/0-31/0-31-upgrade-version.module.ts`](diffhunk://#diff-da52814efc674c25ed55645f8ee2561013641a407f88423e705dd6c77b405527R7):
Registered the new `EnforceUniqueConstraintsCommand` in the module.
[[1]](diffhunk://#diff-da52814efc674c25ed55645f8ee2561013641a407f88423e705dd6c77b405527R7)
[[2]](diffhunk://#diff-da52814efc674c25ed55645f8ee2561013641a407f88423e705dd6c77b405527R24)
### Database Migrations:
*
[`packages/twenty-server/src/database/typeorm/metadata/migrations/1726757368824-migrationDebt.ts`](diffhunk://#diff-c450aeae7bc0ef4416a0ade2dc613ca3f688629f35d2a32f90a09c3f494febdcR1-R53):
Added a migration to update the `relationMetadata_ondeleteaction_enum`
and set default values.
*
[`packages/twenty-server/src/database/typeorm/metadata/migrations/1726757368825-addIsUniqueToIndexMetadata.ts`](diffhunk://#diff-8f1e14bd7f6835ec2c3bb39bcc51e3c318a3008d576a981e682f4c985e746fbfR1-R19):
Added a migration to include the `isUnique` field in `indexMetadata`.
*
[`packages/twenty-server/src/database/typeorm/metadata/migrations/1726762935841-addCompostiveColumnToIndexFieldMetadata.ts`](diffhunk://#diff-7c96b7276c7722d41ff31de23b2de4d6e09adfdc74815356ba63bc96a2669440R1-R19):
Added a migration to include the `compositeColumn` field in
`indexFieldMetadata`.
*
[`packages/twenty-server/src/database/typeorm/metadata/migrations/1726766871572-addWhereToIndexMetadata.ts`](diffhunk://#diff-26651295a975eb50e672dce0e4e274e861f66feb1b68105eee5a04df32796190R1-R14):
Added a migration to include the `indexWhereClause` field in
`indexMetadata`.
### GraphQL Exception Handling:
*
[`packages/twenty-server/src/engine/api/graphql/workspace-query-runner/utils/workspace-query-runner-graphql-api-exception-handler.util.ts`](diffhunk://#diff-58445eb362dc89e31107777d39b592d7842d2ab09a223012ccd055da325270a8R1-R4):
Enhanced exception handling for `QueryFailedError` to provide more
specific error messages for unique constraint violations.
[[1]](diffhunk://#diff-58445eb362dc89e31107777d39b592d7842d2ab09a223012ccd055da325270a8R1-R4)
[[2]](diffhunk://#diff-58445eb362dc89e31107777d39b592d7842d2ab09a223012ccd055da325270a8R23-R59)
*
[`packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/create-many-resolver.factory.ts`](diffhunk://#diff-233d58ab2333586dd45e46e33d4f07e04a4b8adde4a11a48e25d86985e5a7943L58-R58):
Updated the `workspaceQueryRunnerGraphqlApiExceptionHandler` call to
include context.
*
[`packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/factories/create-one-resolver.factory.ts`](diffhunk://#diff-68b803f0762c407f5d2d1f5f8d389655a60654a2dd2394a81318655dcd44dc43L58-R58):
Updated the `workspaceQueryRunnerGraphqlApiExceptionHandler` call to
include context.
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
- Fixed CSS for SortOrFilter chips
- Fixed bug when refreshing with an actor source filter set
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
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.
@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>
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
### 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>
## 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.
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>
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>