Commit Graph

5062 Commits

Author SHA1 Message Date
2c8954a44d fix(session-storage): add typing and trust proxy setting (#9725)
Added explicit typing for session storage options to improve type
safety. Enabled 'trust proxy' to ensure proper client IP and protocol
detection behind proxies. These changes improve security and reliability
in session handling.
2025-01-20 10:05:34 +00:00
7ed2c12e7a Workflow e2e tests – 1st batch (#9713)
- Clean Playwright's configuration:
  - Remove artificial 500ms delay between each step
- Group all tests under a `chrome` project relying on a `setup` project
to get an authentication state which all tests can reuse
- Changes on the `Sign up with invite link via email` test:
- Generate a new email for each test trial, as previously it was failing
when run many times
- Make deleting the account part of the test; if we write other tests
for account sign-up, we'll prefer to delete the accounts with an HTTP
call to speed up things
- Added some assertions to ensure we reached steps when expected, as we
removed the 500ms delay between each step, and it made some assertions
fail
- Wrote new tests for workflows:
- Created `Create workflow`, a test asserting we can create a workflow
from the record table
- Created `Create simple workflow`, a test asserting we can create a
simple flow; I will add more assertions to this test and write other
tests once this first PR is approved
- I make HTTP calls to delete and destroy workflows after they run to
keep the database clean
- Added a data-testid to ensure we focus elements from the Cmd+K; our
selectors are not strong – see `getByRole('textbox')` – and I preferred
to scope them to a root element
  - Added an `aria-label` to a button

---------

Co-authored-by: prastoin <paul@twenty.com>
2025-01-20 10:59:01 +01:00
d50294d39a Update trigger selection design (#9717)
https://github.com/user-attachments/assets/62bc705a-2f69-4ce7-986f-0208154c9965
2025-01-20 10:54:27 +01:00
056cb7c66d Translation followup (#9735)
Address PR comments and more progress on translation
2025-01-19 13:29:19 +01:00
052331685f Add more translations (#9733) 2025-01-18 17:38:05 +01:00
152902d1be New useNavigateApp (#9729)
Todo : 
- replace all instances of useNavigate(
- remove getSettingsPagePath
- add eslint rule to enfore usage of useNavigateApp instead of
useNavigate
2025-01-18 13:58:12 +01:00
8572471973 Introduce IsScrollable on ScrollWrapper (#9724)
It's beautiful!

Using same techniques as for the Header! Was not that easy but looks
very nice now!
2025-01-17 19:26:34 +01:00
18dea07344 Create many steps in a row (#9727)
Fixes
https://discord.com/channels/1130383047699738754/1329099124515274823
2025-01-17 18:12:11 +01:00
06033040d8 remove swc folder (#9723) 2025-01-17 16:35:50 +01:00
3f372c0edf Revert "Fix last record row cells are cropped when selected (#9678)" (#9722)
This reverts commit 446bbdbd96.
2025-01-17 16:32:36 +01:00
6bd0244045 Fix date type update (#9700)
This PR fixes a problem with how TypeORM handles date without time. 

A date without time that is stored in PostgreSQL database as `date` type
gets returned as an ISO string date with a timezone that can shift its
date part in an unwanted way.

In short DB stores `2025-01-01`, TypeORM query builder returns
`2024-12-31T23:00:00Z` which gets parsed as `2024-12-31` on the front
end field.

We don't want to handle timezone here because we are manipulating a date
without its time part, so this PR adds a step that counteracts what
TypeORM does and returns `2025-01-01T00:00:00.000Z` so that the front
can parse it correctly.

@Weiko We might want to check other places of the backend where date
types are returned by TypeORM, we might have the same problem, this PR
only fixes it for updateOne resolver return.

- Fixed date persist on frontend which was shifting the date to a
different day due to timezone issue
- Fixed date returned by the backend update logic, which was shifting
the date by the timezone offset (so this PR adds back the offset so that
it stays at 00:00:00Z time)
2025-01-17 16:19:49 +01:00
b6b5fd1759 refactor(auth): remove redundant workspace lookup logic (#9716)
Removed unnecessary workspace lookup in `findWorkspaceForSignInUp` when
using password-based auth. Updated tests to validate the refactored
behavior and ensure no regressions in workspace resolution for different
auth scenarios.
2025-01-17 14:59:54 +01:00
2efc71b5cb Add first real translations + translation.io (#9715) 2025-01-17 14:59:19 +01:00
f8f9bb2b78 Serverless function timeout concerns (#9689)
closes https://github.com/twentyhq/core-team-issues/issues/242
- unify timeout behavior between local and lambda
- add timeout in serverless entity
- set timeout default to 300s (5min)
2025-01-17 13:49:02 +00:00
679429447d fix(auth): update onboarding activation for specific users (#9702)
Adjust onboarding activation to trigger only for new users with
pictures. This prevents unnecessary activation steps for other user
types, streamlining the flow.
2025-01-17 14:31:24 +01:00
f38a25412e Add more translations (#9707)
As per title
2025-01-17 12:50:28 +01:00
55feeaeef1 [CI][FIX] Storybook coverage configuration injection per scope (#9711)
# Introduction
Running `storybook` with `configuration=pages` outputs a coverage that
is not replicated afterwards by the `storybook:coverage` command.
```sh
npx nx storybook:serve-and-test:static twenty-front --configuration=pages --shard=1/1 --checkCoverage=true
# ...
[TEST] Test Suites: 40 passed, 40 total
[TEST] Tests:       52 passed, 52 total
[TEST] Snapshots:   0 total
[TEST] Time:        84.786 s
[TEST] Ran all test suites.
[TEST] Coverage file (13067196 bytes) written to .nyc_output/coverage.json
[TEST] > nx storybook:coverage twenty-front --coverageDir=coverage/storybook --checkCoverage=true
[TEST] 
[TEST] 
[TEST] > nx run twenty-front:"storybook:coverage" --coverageDir=coverage/storybook --checkCoverage=true
[TEST] 
[TEST] > npx nyc report --reporter=lcov --reporter=text-summary -t coverage/storybook --report-dir coverage/storybook --check-coverage=true --cwd=packages/twenty-front
[TEST] 
[TEST] 
[TEST] =============================== Coverage summary ===============================
[TEST] Statements   : 70.45% ( 775/1100 )
[TEST] Branches     : 45.39% ( 197/434 )
[TEST] Functions    : 63.52% ( 209/329 )
[TEST] Lines        : 71.28% ( 767/1076 )
[TEST] ================================================================================
[TEST] 
```

```sh
> npx nyc report --reporter=lcov --reporter=text-summary -t coverage/storybook --report-dir coverage/storybook --check-coverage=true --cwd=packages/twenty-front


=============================== Coverage summary ===============================
Statements   : 37.4% ( 9326/24931 )
Branches     : 22.99% ( 2314/10063 )
Functions    : 28.27% ( 2189/7741 )
Lines        : 37.81% ( 9261/24488 )
================================================================================
ERROR: Coverage for lines (37.81%) does not meet global threshold (39%)
ERROR: Coverage for branches (22.99%) does not meet global threshold (23%)
ERROR: Coverage for statements (37.4%) does not meet global threshold (39%)
Warning: command "npx nyc report --reporter=lcov --reporter=text-summary -t coverage/storybook --report-dir coverage/storybook --check-coverage=true --cwd=packages/twenty-front" exited with non-zero status code
```

## Fix
Persist configuration scope arg to the `check-coverage` command

## Question
Should we add a step in the `ci-front` what would merge all
`performance,modules,pages` coverage and calculate the `global` coverage
? => I think that this has no plus value as we still compute each of
them individualy
2025-01-17 12:42:32 +01:00
0357797612 [CI] Add performance to merge coverage matrix strategy job (#9708)
# Introduction
It seems like I've just oversight adding it back while debugging

# Centralization
Please note that we only have access to the following context within a
job matrix properties:
```
Available expression contexts: github, inputs, vars, needs
```
We could centralize the `storybook_scope` as a job `outputs` in order to
avoid this to re-occurs.
2025-01-17 11:17:39 +01:00
b2a0eb6620 [Microsoft Outlook] fix + error handling (#9696)
- bettter error handling
- small fix in the amount of items Microsoft graph api accepts
2025-01-17 11:04:49 +01:00
22ee77145a [CI] ci-server reorder twenty-shared build after cache restoration (#9672)
# Introduction
Unless I'm mistaken we can win few seconds `~12s` by reordering the
`twenty-shared` build step after the cache restoration in order for `nx`
to hit it if possible.

[Related
run](https://github.com/twentyhq/twenty/actions/runs/12809421832/job/35714544486)
2025-01-17 08:06:30 +01:00
7acb68929f Progress on translations (#9703)
Start adding a few translations on setting pages, introduce
pseudo-locale, switch to dynamic import, add eslint rule
2025-01-16 23:34:54 +01:00
f44b31573a Set up localization with feature flag control (#9649)
Refers #8128 

Changes Introduced:
- Added i18n configuration.
- Added a feature flag for localization.
- Enabled language switching based on the flag.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-01-16 21:00:56 +01:00
b81ffcc77c Add viewId to recordIndexId (#9647)
Before the `recordIndexId` was the name plural. This caused problems
because the component states were the same for every view of an object.
When we switched from one view to another, some states weren't reset.
This PR fixes this by:
- Creating an effect at the same level of page change effect to set the
`currentViewId` inside the object `contextStore`
- Adding the `currentViewId` to the `recordIndexId`

Follow ups:
- We need to get rid of
`packages/twenty-front/src/modules/views/states/currentViewIdComponentState.ts`
and use the context store instead
2025-01-16 18:41:19 +01:00
a248e891ae Upgrade to 0.40 guide (#9695) 2025-01-16 17:48:45 +01:00
6540057c98 fix(auth): return early in workspace access check (#9697)
Ensure early return in `hasUserAccessToWorkspaceOrThrow` for existing
users during sign-in. This prevents further unnecessary execution when
access validation is complete.
2025-01-16 17:36:53 +01:00
f621af1732 fix: date input click outside (#9676)
cc @lucasbordeau

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2025-01-16 17:35:59 +01:00
1df0603aaa Fix filter displayed value from query params (#9693)
Filter displayed value that use query params was broken. Recently we
added a new type of filters using the schema `{ selectedRecordIds:
string[] }` while before we were using `string[]` directly.
In that case, when fetching relation record name, we need to fix the
findManyRecord query.

Before
<img width="1512" alt="Capture d’écran 2025-01-16 à 16 10 33"
src="https://github.com/user-attachments/assets/36dc8c4f-91a4-438f-8480-bc237745a59e"
/>

After
<img width="1512" alt="Capture d’écran 2025-01-16 à 16 04 43"
src="https://github.com/user-attachments/assets/544512a3-0ef9-4d3e-993b-a4416737ab53"
/>
2025-01-16 17:16:42 +01:00
0ff8637469 Add create new record action to workflows (#9692)
- Added create new record action to `WorkflowActionsConfig`

As @FelixMalfait suggested
[here](https://github.com/twentyhq/core-team-issues/issues/72), we
should introduce an inheritance system for actions.
2025-01-16 17:10:16 +01:00
2eb98bf966 0.40 changelog (#9688)
![0
40-group-by](https://github.com/user-attachments/assets/0e013739-af86-4650-9508-98b233064c4c)
![0
40-aggregates](https://github.com/user-attachments/assets/d9af1a60-c67c-40e9-9ecc-f84d52512c8a)
2025-01-16 16:50:50 +01:00
ad0dc7d664 fix(auth): streamline SSO auth callback logic (#9668)
Removed unused UserService dependency and simplified authCallback
function by using destructured parameters. Added checks for user email
and integrated invitation lookup and access validation for enhanced SSO
sign-in/up flow.
2025-01-16 16:07:06 +01:00
91eac86520 fix empty actor field (#9677)
<img width="300" alt="Screenshot 2025-01-16 at 14 19 18"
src="https://github.com/user-attachments/assets/1d8558b1-cab2-4256-9ab8-cc085dced7cd"
/>
<img width="300" alt="Screenshot 2025-01-16 at 14 19 24"
src="https://github.com/user-attachments/assets/e7100be8-be76-4bed-b149-658cd996adb1"
/>

closes #9180

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-16 15:28:06 +01:00
7ec48b93eb Use main apollo client for workflows (#9675)
We were using metadata client by legacy. Architecture is not great for
Core engine: workflows are available both in data and metadata client.
It makes more sense to use the data client since workflows are part of
standard objects
2025-01-16 15:21:29 +01:00
df93b5b311 fix: increase font height and decrease gap in TrialCard (#9686)
### Context

Fix design to match 'Choose Your Trial' [figma
design](https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=52632-204440&t=mRMsJYiGtmCmWrs6-4)

<img width="331" alt="Screenshot 2025-01-16 at 15 04 30"
src="https://github.com/user-attachments/assets/b582ee71-2b1a-4003-ac0a-e39028fe432a"
/>

[Bug bash link

](https://discord.com/channels/1130383047699738754/1329445193300312084/1329445193300312084)

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-16 15:20:21 +01:00
446bbdbd96 Fix last record row cells are cropped when selected (#9678)
Before
<img width="432" alt="Capture d’écran 2025-01-16 à 14 52 34"
src="https://github.com/user-attachments/assets/0d23c48a-ad27-49ee-9194-7ae12397f928"
/>

After
<img width="503" alt="Capture d’écran 2025-01-16 à 14 51 55"
src="https://github.com/user-attachments/assets/c8b1c8d1-8655-48f0-81fc-d451878e0d10"
/>

---------

Co-authored-by: Weiko <corentin@twenty.com>
2025-01-16 15:14:06 +01:00
f545bd1c40 Treat suspended workspace as workspaces that need to be synced (#9669)
In this PR:
- migrate WorkspaceActivationStatus to twenty-shared (and update case to
make FE and BE consistent)
- introduce isWorkspaceActiveOrSuspended in twenty-shared
- refactor the code to use it (when we fetch data on the FE, we want to
keep SUSPENDED workspace working + when we sync workspaces we want it
too)
2025-01-16 15:01:04 +01:00
4a0b89d094 Update GetClientConfigQuery type (#9673)
Co-authored-by: Weiko <corentin@twenty.com>
2025-01-16 14:49:20 +01:00
5982a5a8ba Aggregate queries and field metadata deletion (#9660) 2025-01-16 14:46:56 +01:00
560f715c37 [CI][NITPICK]: Rename prerequisites jobs to changed-files-check (#9670)
Related to https://github.com/twentyhq/twenty/pull/9643

Renaming `prerequisites` jobs to a more accurate `changed-files-check`
2025-01-16 14:09:59 +01:00
f8ddc02b8e [CI] Refactor changed files integration (#9643)
# BEFORE
[run](https://github.com/twentyhq/twenty/actions/runs/12806801953)

![image](https://github.com/user-attachments/assets/f0a8ffe3-3fc0-42ca-b2ee-8a980606b5dd)
# AFTER
[run](https://github.com/twentyhq/twenty/actions/runs/12807034402)

![image](https://github.com/user-attachments/assets/5117c680-6804-416b-a8c8-bf00614ca453)

## Motivations:
- less workflow to whitelist as blocking for PRs
- less if condition per step

cons:
- quite verbose
- need to manually sync the `ci-NAME-status-check` needs list to any
other existing and should be dep jobs

## Version migration
Migrated to the latest `changed-files@45` version, getting rid of the
`set-output` usage warnings

## Tests runs:

With mutation:
- [Success
flow](https://github.com/twentyhq/twenty/actions/runs/12791958651/job/35661546343)
- [server-setup failure
flow](https://github.com/twentyhq/twenty/actions/runs/12792225779)
- [Other job failure
flow](https://github.com/twentyhq/twenty/actions/runs/12792313463), one
of the `inner` job failed
- [Manual cancel
flow](https://github.com/twentyhq/twenty/actions/runs/12792313463)
`ci-server-status-check` also has the `cancelled` status
- [Matrix
failure](https://github.com/twentyhq/twenty/actions/runs/12806883553)

Without mutation:
- [Nothing to do
flow](https://github.com/twentyhq/twenty/actions/runs/12792098384),
skipped `inner` job but `ci-server-status-check` still succeeded

## Notes
### Linter
We should setup a `yml` prettier and linter for the `.github/worfklows`
folder
### Centralized `ci-NAME-status-check` logic
Unfortunately I couldn't achieve to either make a `composite` action or
a `reusable-workflow`, as I could not access the correct layer to run
the `always` but also acessing the `needs` context
2025-01-16 13:37:28 +01:00
4503ee3fbd bugfix: fix navigation between onboarding screens (#9637)
# This PR

- Fixes #9565

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-16 11:24:03 +01:00
6a738181b4 [CI][NITPICK] .yml to yaml github workflows (#9664)
# Introduction
Applying the most present `yaml` file extension to all
`.github/workflows/` files

## Notes
Regarding the `restore-cache` and `save-cache` composite actions github
agnostically searches for any `DockerFile` `action.yml` and
`action.yaml` within the target folder when invoking composite actions
as follows:
```yml
      - name: Restore storybook build cache
        if: steps.changed-files.outputs.any_changed == 'true'
        uses: ./.github/workflows/actions/restore-cache
        with: 
          key: ${{ env.STORYBOOK_BUILD_CACHE_KEY }}
```
2025-01-16 11:21:00 +01:00
9a82fb980b fix: record group chevron alignment (#9661)
<img width="142" alt="Screenshot 2025-01-16 at 10 23 07 AM"
src="https://github.com/user-attachments/assets/07ea1d2f-0172-4f8e-94e4-bfeb87f4092a"
/>
<img width="153" alt="Screenshot 2025-01-16 at 10 22 37 AM"
src="https://github.com/user-attachments/assets/685bd859-cc51-4d52-8c3f-aba83056e92c"
/>

Fix Chevron alignment and CheckBox alignment
2025-01-16 11:20:39 +01:00
f74b12adb8 fix: group by disabled in dark mode wrong color (#9662)
<img width="255" alt="Screenshot 2025-01-16 at 10 51 50 AM"
src="https://github.com/user-attachments/assets/c171401e-6c19-42f1-975b-fdb33b0a0789"
/>
2025-01-16 11:15:03 +01:00
26058f3e25 Update ChooseYourPlan page with new trial period options (#9628)
### Context
- Update /plan-required page to let users get free trial without credit
card plan
- Update usePageChangeEffectNavigateLocation to redirect paused and
canceled subscription (suspended workspace) to /settings/billing page

### To do

- [x] Update usePageChangeEffectNavigateLocation test
- [x] Update ChooseYourPlan sb test



closes #9520

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
2025-01-16 11:10:36 +01:00
c79cb14132 Refetch query on draft creation (#9650)
After hitting use as draft, we redirect the user to the workflow page.
If the user already accessed that page, the workflow and its current
version will be stored in cache. So we also need to update that cache.

I tried to update it manually but it was more complex than expected.
Steps and trigger are not fully defined objects.

I ended with a simple refetch query that I wanted to avoid but that is
at least fully working with minimum logic.
2025-01-16 10:46:23 +01:00
34ddeade83 Documentation + docker-compose.yml update (#9653)
Related to #9469 #9455 #9419 #8943
2025-01-16 10:43:27 +01:00
5bae5a9f7c fix: filter dark mode (#9659)
Fix dark mode color of dropdown menu in Filter
2025-01-16 10:29:35 +01:00
f5b0926b63 feat: record group chevron button (#9645)
This ticket is related to this Discord post
https://discord.com/channels/1130383047699738754/1328756649657110559
2025-01-16 10:03:05 +01:00
f077efd171 Outlook integration (#9631)
Get Partial messages
2025-01-16 09:50:01 +01:00
789ff30dc7 fix(sso|auth): fix sso signinup (#9651)
Renamed `user` to `payload` for better context clarity and updated
related references. Adjusted the login token generation to use
`workspace.id`, improving readability and maintainability of the code.
2025-01-15 19:27:05 +01:00