Commit Graph

5126 Commits

Author SHA1 Message Date
95c772664e Refactor triggerUpdateRelationsOptimisticEffect to compute relationship from Metadatas (#9815)
# Introduction
At the moment the relationships are inferred from the record data
structure instead of its metadatas
We should refactor the code that computes or not the necessity to detach
a relation on a mutation

We've refactored the `isObjectRecordConnection` method to be consuming a
`relationDefintion` instead of "typeChecking" at the runtime the data
structure using zod validation schema

Related to #9580
2025-01-24 17:24:23 +01:00
a8552a6a67 Fix Typo in Filename (#9835)
- Rename `mircosoft-apis-oauth-request-code.guard.ts` to
`microsoft-apis-oauth-request-code.guard.ts `
- Update import statement in
`packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-apis-auth.controller.ts`
to reflect the updated filename.
2025-01-24 16:24:41 +01:00
25cb909e17 Improve Docker-Compose Install Experience (#9781)
This PR updates the docker-compose installation documentation and env
sample to improve the setup experience.

- Updates the URLs for raw files to reference main branch, which is
likely where new users will be pulling from initially. This seems to be
the most straightforward option; assume that advanced users who want to
retrieve it from a particular tag will know to change the URL for their
scenario.
- Fixes an improperly stated curl command.
- Adds a note that the PGPASSWORD_SUPERUSER should be URL-safe. This is
required since the value is later concat into a PG_DATABASE_URL as a
URL, and expected to be in proper URL format. Touches on #8597.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-01-24 16:13:28 +01:00
ff41768e8f 250 implement restore context button on command menu (#9836)
Closes https://github.com/twentyhq/core-team-issues/issues/250



https://github.com/user-attachments/assets/9c120188-497d-4273-9137-f8d0de3bd884
2025-01-24 16:10:02 +01:00
29df6e64a0 Fix icon matching + small other fixes on workflows (#9814)
- Record Fields label
- body height fix
- Icons on object picker
- Fix icon matching between nodes and right drawer

<img width="1296" alt="Capture d’écran 2025-01-23 à 18 51 12"
src="https://github.com/user-attachments/assets/ecd5fb00-49cd-416e-96af-9200418294e0"
/>
2025-01-24 15:47:09 +01:00
1a42483aa9 Fix wrong label formatting (#9830)
Fixes
https://discord.com/channels/1130383047699738754/1324785862830985266
## Before
<img width="451" alt="image"
src="https://github.com/user-attachments/assets/53ae96f9-4bbd-40e3-beaa-a5702f2adee4"
/>

## After
<img width="388" alt="image"
src="https://github.com/user-attachments/assets/e36da162-bc60-4596-823b-ffb6ddfed98d"
/>
2025-01-24 15:11:30 +01:00
f23de2fa22 chore(auth): update SAML strategy configuration (#9829)
Added `disableRequestedAuthnContext` flag to SAML auth strategy to align
with compatibility requirements. Adjustments ensure seamless integration
with certain Identity Providers. No functional impact on existing flows.
2025-01-24 14:52:42 +01:00
edd7212f0b feat: add clean suspended workspaces command (#9808)
closes [283
sub-issue](https://github.com/twentyhq/core-team-issues/issues/283) -
[parent issue
](https://github.com/orgs/twentyhq/projects/1/views/3?filterQuery=sprint%3A%40current+assignee%3Aetiennejouan&pane=issue&itemId=93520456&issue=twentyhq%7Ccore-team-issues%7C179)

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-24 11:10:52 +01:00
15814d465a Fix missing events during account connection (#9825)
Fix #8765
2025-01-24 10:10:42 +00:00
8d794374f1 feat: new relation resolver (#9794)
Fix [#240](https://github.com/twentyhq/core-team-issues/issues/240)
2025-01-24 10:38:50 +01:00
5783c41df2 fix(auth): Improve error management with sso + fix microsoft saml (#9799)
Fix #9760 #9758
2025-01-24 10:36:18 +01:00
3c85516f77 fixed ellipsis for calendar events (#9823)
Fixed Missing ellipsis for long calendar event names #5267 introducing
width for the title

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-24 10:33:46 +01:00
6af42b9b9b Fix: Remove default value for name field in CustomWorkspaceEntity (#9805) (#9824)
### Summary
This pull request addresses issue #9805 by removing the default value
`'Untitled'` for the `name` field in the `CustomWorkspaceEntity` class.

### Details
- Removed the default value `'Untitled'` for the `name` field.
- This change ensures that new records do not have an empty or default
name.
- Ensures consistency across different standard object records.

### Issue
This pull request resolves issue #9805.

### Testing
Tested the creation of new records to ensure that the `name` field is
now correctly handled without a default value.

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2025-01-23 19:01:03 +01:00
23400e9679 Normalize the spacing between nodes (#9820)
## Old

![CleanShot 2025-01-23 at 16 38
25@2x](https://github.com/user-attachments/assets/0c8e3b26-5ef4-455a-978e-b430e54b63ba)

![CleanShot 2025-01-23 at 16 38
51@2x](https://github.com/user-attachments/assets/929b73d3-2d7f-45b9-a0fb-62516969bd63)

## New

![CleanShot 2025-01-23 at 17 12
25@2x](https://github.com/user-attachments/assets/670ba386-c643-408d-a682-d279bc81f5c1)
2025-01-23 18:26:51 +01:00
daa8ff1299 148 cant access note without title from kanban board (#9817)
closes https://github.com/twentyhq/core-team-issues/issues/148

- fixes not openable kanban card when identifier empty
- update card behavior (onClick open recordPage)
- fixes right click actionDropdown position

## Before


https://github.com/user-attachments/assets/696194b8-d7fa-4fc1-a6f9-b46241a262e5

![image](https://github.com/user-attachments/assets/63a5f634-2688-41ba-9ac4-51292ef09b7a)

## After


https://github.com/user-attachments/assets/41e296e5-ae16-47f8-b174-7dd21d74188d

![image](https://github.com/user-attachments/assets/7f859764-946e-40d3-9b66-5460edb215f2)
2025-01-23 17:05:35 +00:00
afa2282ea3 Fix left menu highlight (#9821)
Fix #9777

getAppPath doesn't return object/pet/ but actually object/pet so it
needed a small adjustment (pet - 1 = PE is included in PEople)
2025-01-23 17:59:30 +01:00
bf564788c3 fix: board hide button not working (#9818)
Fix #9816
2025-01-23 16:17:46 +00:00
1d7cbcabee fix: scrolling inside the table with scrollbar (#9753)
Fixed- when scrolling inside the table with scrollbar, cursor also
selects rows. Now on scrolling with scrollbar content is scrolled in
respective direction as expected and table rows don't get selected.

fixes issue #6773

---------

Co-authored-by: nitin <142569587+ehconitin@users.noreply.github.com>
Co-authored-by: ehconitin <nitinkoche03@gmail.com>
2025-01-23 15:41:57 +00:00
bbd3af108b bugfix: escape destroyed objects on workers (#9719)
# This PR

- Fixes #9358 

@FelixMalfait please check this workaround

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-01-23 16:29:54 +01:00
bbb0c9a761 Improve the design of workflow nodes (#9810)
- Go over every node in the workflows and fix the styles to conform to
Figma
- Create stories for every node type
2025-01-23 15:12:37 +00:00
337b6a86ab 251 create top bar chips inside the command menu (#9809)
Closes #https://github.com/twentyhq/core-team-issues/issues/251



https://github.com/user-attachments/assets/065c97fe-1daf-4b48-9d57-6bbb96d24ede
2025-01-23 14:44:21 +01:00
cc53cb3b7b Add metered product to checkout session (#9788)
Solves https://github.com/twentyhq/private-issues/issues/238

**TLDR:**
Add metered product in the checkout session when purchasing a
subscription

**In order to test:**

1. Have the environment variable IS_BILLING_ENABLED set to true and add
the other required environment variables for Billing to work
2. Do a database reset (to ensure that the new feature flag is properly
added and that the billing tables are created)
3. Run the command: npx nx run twenty-server:command
billing:sync-plans-data (if you don't do that the products and prices
will not be present in the database)
4. Run the server , the frontend, the worker, and the stripe listen
command (stripe listen --forward-to
http://localhost:3000/billing/webhooks)
5. Buy a subscription for the Acme workspace , in the checkout session
you should see that there is two products
2025-01-23 14:28:13 +01:00
e7ba1c82b4 isMicrosoftAuthEnabled = true (#9812) 2025-01-23 12:22:03 +01:00
2f0fa7ae3e Microsoft-multi-tenant (#9801)
Microsoft fixes
2025-01-23 12:08:08 +01:00
bddca09451 Refactored table filters to consume new currentRecordFilters component state (#9652)
This PR implements a first real use case, now currentRecordFilters
component state acts as the global record filter reference.

It is set by the view initially and can be reset to view filters state
at any point.

This new state is also modified by two new upsertRecordFilter /
removeRecordFilter hooks that will be drop-in replacement of the actual
upsertCombinedViewFilter and removeCombinediewFilter hooks.

This PR implements the logic to manipulate record filters but only reads
it to make the table find many request, all other features are still
relying on the old view filter implementation.

Advanced filters are ignored because they are hidden and because this
effort is made precisely to allow the completion of the advanced filters
feature.
2025-01-23 11:09:44 +01:00
3ab193f298 Remove isServerlessFunctionSettingsEnabled feature flag (#9797)
Removes `isFunctionSettingsEnabled` feature flag
We consider this featureFlag as false for everyone. We decided to keep
the code in the code base for now
2025-01-22 22:39:52 +01:00
e881616822 Fix captcha token not being loaded early enough (#9800)
I've re-investigated the captchaToken being invalid on workspace domain
url in case where email is passed in the URL.
We need to be a bit more granular
2025-01-22 18:11:21 +01:00
5902dbd0b4 Fix signup submit disabled when waiting for captcha without provider (#9796) 2025-01-22 17:49:11 +01:00
d340605578 Fix View Picker broken (#9798)
In this PR:
- fixing a regression introduced in a recent PR (#9735)
- fixing a typing issue in ViewPicker @ehconitin FYI
2025-01-22 17:48:27 +01:00
b662609948 feat: add targetFieldMetadataId and migration script for relations (#9793)
Fix https://github.com/twentyhq/core-team-issues/issues/238 and
https://github.com/twentyhq/core-team-issues/issues/239
2025-01-22 17:01:54 +01:00
984dc4dec0 [MISC] Twenty-emails as package (#9770)
Charles has done everything within
https://github.com/twentyhq/twenty/pull/9754
Last thing to be done is removing the custom module `path` configured in
the `tsconfig.json`

close https://github.com/twentyhq/core-team-issues/issues/282
2025-01-22 16:33:48 +01:00
8ab01ebef4 [BUG] Record settings not saved (#9762)
# Introduction
By initially fixing this Fixes #9381, discovered other behavior that
have been fix.
Overall we encountered a bug that corrupts a workspace and make the
browser + api crash
This issue https://github.com/twentyhq/core-team-issues/issues/25
suggests a refactor that has final save button instead of auto-save

## `labelIdentifierFieldMetadataId` form default value
The default value resulted in being undefined, resulting in react hook
form `labelIdentifierFieldMetadataId` is required field error.

### Fix
Setting default value fallback to `null`  as field is `nullable`

## `SettingsDataModelObjectSettingsFormCard` never triggers form
Unless I'm mistaken in production touching any fields within
`SettingsDataModelObjectSettingsFormCard` would never trigger form
submission until you also modify `SettingsDataModelObjectAboutForm`
fields

### Fix
Provide and apply `onblur` that triggers the form on both
`SettingsDataModelObjectSettingsFormCard` inputs

## Wrong default `labelIdentifierFieldMetadataItem` on first page render
When landing on the page for the first time, if a custom
`labelIdentifierFieldMetadataItem` has been set it won't be computed
within the `PreviewCard`.
Occurs when `labelIdentifierFieldMetadataId` form default value is
undefined, due to `any` injection.

### Fix
In the `getLabelIdentifierFieldMetadataItem` check the
`labelIdentifierFieldMetadataIdFormValue` definition, if undefined
fallback to current `objectMetadata` identifier

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-22 16:32:57 +01:00
80c9ebfd4e Remove isGmailSendEmailScopeEnabled featureFlag (#9787)
as title
2025-01-22 15:53:40 +01:00
d759559506 Fix COUNT operation on view group aggregate header (#9789)
Fixes
[sentry](https://twenty-v7.sentry.io/issues/6235128210/?referrer=discord&notification_uuid=898a081c-f8c7-42b8-b598-7660470a1975&alert_rule_id=15135099&alert_type=issue)

In a [previous work](https://github.com/twentyhq/twenty/pull/9749) I set
the default field to run totalCount aggregate operation on to the "name"
field, which I was wrong think was present on all objects.
2025-01-22 15:05:38 +01:00
8213995887 Open showpage on workflow creation (#9714)
- Created an new component state
`isRecordEditableNameRenamingComponentState`
- Updated `useCreateNewTableRecord` to open the ShowPage on workflow
creation
- Refactored `RecordEditableName` and its components to remove the
useEffect (This was causing the recordName state to be updated after the
focus on `NavigationDrawerInput`, but we want the text so be selected
after the update).
- Introduced a new component `EditableBreadcrumbItem`
- Created an autosizing text input: This is done by a hack using a span
inside a div and the input position is set to absolute and takes the
size of the div. There are two problems that I didn't manage to fix:
If the text is too long, the title overflows, and the letter spacing is
different between the span and the input creating a small offset.


https://github.com/user-attachments/assets/4aa1e177-7458-4691-b0c8-96567b482206


New text input component:


https://github.com/user-attachments/assets/94565546-fe2b-457d-a1d8-907007e0e2ce
2025-01-22 14:44:10 +01:00
441b88b7e1 Seed workflow views and favorites in upgrade to 0.41 (#9785)
- Sync metadata to create workflow entities, since those are not behind
a flag anymore
- Seed workflow views
- Seed workspace favorite for workflow
- Put all steps in upgrade command
2025-01-22 14:40:44 +01:00
26aca9508b Align the workflow visualizer's nodes on the left (#9776)
**This PR implements a new layout for the visualizer, but the dimensions
of the nodes will change soon. I used hard-coded dimensions, like
`40px`, but I'll update them when I work on fixing the nodes' design. I
think we can merge this PR first and then fix the nodes' design.**



https://github.com/user-attachments/assets/580fa812-ee8e-4452-b6ac-ca55ecb31759
2025-01-22 11:03:36 +01:00
7d30b7577d add fetch billing products from tables instead of env variables (#9601)
Solves https://github.com/twentyhq/private-issues/issues/237

**TLDR:**

- Fetches billing products and prices from the tables BilllingProducts
and BillingPrices instead of fetching the product from the environment
variables and the prices from the stripe API.
- Adds new feature flag for this feature
- Fixes calls used to fetch stripe products and prices for the command
Billing Sync Plans Data.


**In order to test:**

1. Have the environment variable IS_BILLING_ENABLED set to true and add
the other required environment variables for Billing to work
2. Do a database reset (to ensure that the new feature flag is properly
added and that the billing tables are created)
3. Run the command: `npx nx run twenty-server:command
billing:sync-plans-data` (if you don't do that the products and prices
will not be present in the database)
4. Run the server , the frontend, the worker, and the stripe listen
command (`stripe listen --forward-to
http://localhost:3000/billing/webhooks`)
5. Buy a subscription for the Acme workspace and play with the project

**Doing**

I think there is some room of progress for the function
formatProductPrices, I used a similar version that was done before, I'll
look into that.
2025-01-21 20:19:29 +01:00
3d2bb03c6d microsoft domain publisher (#9771)
for MS auth and outlook recognition
2025-01-21 18:17:16 +01:00
aef01816d7 fix(recaptcha|sso): recaptcha not generated issue (#9764)
Fix https://github.com/twentyhq/twenty/issues/9759
https://github.com/twentyhq/twenty/issues/9694
https://github.com/twentyhq/twenty/issues/9323
2025-01-21 17:07:20 +00:00
f4779a02ca fix(workspace): ensure proper handling of updates and errors (#9752)
Added `await` to `updateWorkspaceById` in resolver for proper async
handling. Enhanced workspace settings UI with specific error handling
for subdomain conflicts and improved feedback for invalid form values.


Fix
https://github.com/twentyhq/twenty/issues/9709#issuecomment-2597919251
2025-01-21 17:17:58 +01:00
75ba270ba8 fix: handle billingSubscriptions gql field if billing is disabled (#9767)
Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-21 16:47:19 +01:00
34afd73923 refacto(invite|signin): remove unused code + fix signin on invite page. (#9745)
- Replace `window.location.replace` by `useRedirect` hook.
- Remove unused code: `switchWorkspace, addUserByInviteHash...`
- Refacto `Invite` component.
- Fix signin on invite modal.
2025-01-21 16:33:31 +01:00
2e9a77f702 Hide workflows + remove feature flag from entities (#9768)
From now on workflow entities and views will be seed for every new
workspace. What will prevent user to see those is the feature flag used
in frontend. It will prevent workflow objects to be stored in the recoil
state.

Without feature flag, workflows will:
- remain invisible in metadata
- not be accessible through views or show page
- remain invisible on side menu
2025-01-21 15:11:57 +00:00
e82d4d9f8e Document Google OAuth scopes required (#9657)
Attempts to resolve #9656
2025-01-21 16:09:30 +01:00
ed7c48e12a Fix use as draft (#9718)
- remove delete serverless function when archiving workflow version
- update copy serverless function to reset serverless function to old
version
- remove createNewWorkflowVersion and use createDraftFromWorkflowVersion
- fix step update issue and optimistic rendering when generate draft
from active version
2025-01-21 15:44:52 +01:00
d8815d7ebf fix: prevent billingPortal creation if no active subscription (#9701)
Billing portal is created in settings/billing page even if subscription
is canceled, causing server internal error. -> Skip back end request

Bonus : display settings/billing page with disabled button even if
subscription is canceled

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-21 15:01:18 +01:00
47c2c774e3 Add GraphQL Generation Check to CI Workflow (#9742)
This pull request addresses the issue of ensuring that npx nx run
twenty-front:graphql:generate and npx nx run
twenty-front:graphql:generate --configuration=metadata commands are run
to generate the necessary GraphQL files. This prevents changes from
being missed and ending up in subsequent unrelated PRs.

Changes:
Added a step in the ci-server.yml workflow to check for pending GraphQL
generation.
If any GraphQL changes are detected, the CI will fail, and an error
message will be displayed instructing the developer to run the necessary
commands and commit the changes.
This approach is similar to the existing TypeORM migration check and
helps maintain consistency and correctness in the codebase.

Issue Resolved: #9726

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-21 14:43:19 +01:00
dadb7db6cf doc (#9737)
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2025-01-21 14:39:05 +01:00
50f36e345e Lab (#9667)
https://github.com/twentyhq/core-team-issues/issues/76
2025-01-21 14:30:59 +01:00