Commit Graph

5155 Commits

Author SHA1 Message Date
7cb259d692 [CI] Refactor yarn-install composite action (#9613)
# Introduction
Unless I'm mistaken in the existing `yarn-install` composite action
`dependencies` are cached twice.

## Cached through `setup-node`
As we're providing `yarn` value to cache inputs.
Setup node will cache the global `.yarn`
```yml
    - name: Setup Node.js and get yarn cache
      uses: actions/setup-node@v3
      with:
        node-version: 18
        cache: yarn
```

## Programmatic `node_modules` caching
We even manually still cache `node_modules` folder using:
```yml
    - name: Cache node modules
      id: node-modules-cache
      uses: actions/cache@v3
      with:
        path: |
          node_modules
          packages/*/node_modules
        key: root-node_modules-${{ hashFiles('yarn.lock') }}
        restore-keys: root-node_modules-
```
By the way it seems like that the `yarn.lock` file is useless as the
restore-key pattern omits it
This could, unless I'm mistaken, leads to invalid cache restore

## Runtime
The current infra results in the following install deps logs:
```sh
Prepare all required actions
Getting action download info
Download action repository 'actions/setup-node@v3' (SHA:1a444[2](https://github.com/twentyhq/twenty/actions/runs/12770942233/job/35596946506#step:6:2)cacd436585916779262731d5b162bc6ec7)
Download action repository 'actions/cache@v[3](https://github.com/twentyhq/twenty/actions/runs/12770942233/job/35596946506#step:6:3)' (SHA:f4b3439a656ba812b8cb417d2d49f9c810103092)
Run ./.github/workflows/actions/yarn-install
Run actions/setup-node@v3
Found in cache @ /opt/hostedtoolcache/node/18.20.5/x6[4](https://github.com/twentyhq/twenty/actions/runs/12770942233/job/35596946506#step:6:4)
Environment details
/usr/local/bin/yarn --version
4.4.0
/usr/local/bin/yarn config get cacheFolder
/home/runner/.yarn/berry/cache
/usr/local/bin/yarn config get enableGlobalCache
true
Cache Size: ~421 MB (441369819 B)
/usr/bin/tar -xf /home/runner/work/_temp/883eae34-9b21-4684-96[5](https://github.com/twentyhq/twenty/actions/runs/12770942233/job/35596946506#step:6:5)8-cdb937f62965/cache.tzst -P -C /home/runner/work/twenty/twenty --use-compress-program unzstd
Cache restored successfully
Cache restored from key: node-cache-Linux-yarn-a8c18b6600f1bc685e60192f39a0a0c5c51b918829090129d3787302789547fc
Run actions/cache@v3
Cache Size: ~506 MB (530305961 B)
/usr/bin/tar -xf /home/runner/work/_temp/becd3767-ac80-4ca9-8d[21](https://github.com/twentyhq/twenty/actions/runs/12770942233/job/35596946506#step:6:23)-93fa61e3070c/cache.tzst -P -C /home/runner/work/twenty/twenty --use-compress-program unzstd
Cache restored successfully
Cache restored from key: root-node_modules-a8c18b6600f1bc685e60192f39a0a0c5c51b918829090129d378730[27](https://github.com/twentyhq/twenty/actions/runs/12770942233/job/35596946506#step:6:30)89547fc
```
Where we can see in details that a cache is hit twice.
```
Cache Size: ~421 MB (441369819 B)
Cache Size: ~506 MB (530305961 B)
```

## Suggestion
We should stick to only one deps caching mechanism.
Also caching the node_modules folder is not
[recommended](611465405c/examples.md (node---npm)).
That's why I would factorize our caching to the `setup-node` scope only.

## The cache-primary-key crafting
Within the cache-primary-key we will inject the following metrics:
- Node version, as we're caching `node_modules` directly in this way to
avoid cache desync in case we upgrade node.
- Hash of the lockfile, in this way if the lockfile comes to mutate we
will re-install the deps from scratch, in this way no need to
programmatically listen for `changed-files` on the `package.json` and
the `lockfile`
- Strict installation with `check-cache` and `enableHardenedMode` to
true and obviously the `--immutable` flag ( note adding the
`--immutable-cache` by principle even if on paper is overkill as a cache
restoration and install should never occurs )
2025-01-15 15:46:53 +01:00
77a11d30d3 Make calendar event details readonly (#9638)
Before:


https://github.com/user-attachments/assets/870aee34-58b4-48bc-b90f-ce17d61da26e


After:


https://github.com/user-attachments/assets/498d46f9-bd4e-400f-a645-076a86999479
2025-01-15 15:30:45 +01:00
4fdea61f1d fix(auth): handle missing invitation during sign-up (#9572)
Add validation to throw an exception when a sign-up is attempted without
a valid invitation. Updated the test suite to cover this case and ensure
proper error handling with appropriate exceptions.

Fix https://github.com/twentyhq/twenty/issues/9566
https://github.com/twentyhq/twenty/issues/9564
2025-01-15 15:26:51 +01:00
f828e75b72 Aggregate queries follow up (#9636)
In this PR 

- [X] Fix missing IconCheck for count all on kanban headers:
https://discord.com/channels/1130383047699738754/1319330910361096242/1319330910361096242
- [X] Fix aggregate cell height:
https://discord.com/channels/1130383047699738754/1328749516488441997/1328749516488441997
- [X] Fix aggregate bar should extend fully to the right:
https://discord.com/channels/1130383047699738754/1328750532193681569/1328750532193681569
- [X] Fix first aggregate cell should fully spread to the left:
https://discord.com/channels/1130383047699738754/1326614678788374638/1326614678788374638
2025-01-15 15:25:10 +01:00
ff93fd3c74 190 display ctrl instead of for windows users (#9617)
Closes https://github.com/twentyhq/core-team-issues/issues/190

<img width="226" alt="Capture d’écran 2025-01-15 à 12 07 12"
src="https://github.com/user-attachments/assets/b9a13746-2629-477a-9795-cda03c63f8f6"
/>

To test, update the user agent in your browser dev tools:
<img width="459" alt="Capture d’écran 2025-01-15 à 12 14 29"
src="https://github.com/user-attachments/assets/4371d5fc-fd3c-403d-beaa-7ba58019d3c9"
/>
2025-01-15 12:53:18 +00:00
9ba510eb3f [CI] Always save cache agnostically of the actions/restore cache-hit output (#9635)
## Motivations
This is not because we've hit the `actions/cache/restore` cache that NX
won't be re-building sub commands.
Which means the grain to save or not the cache should be extracted from
nx sub commands and not from the `actions/cache` outputs.

We should investigate on the way to retrieve this granularity level

From the moment we will be saving everything, which could result
sometimes in duplicating cache instances.
We should keep in mind that our cache occurrences have a 1 day retention
date, is low cost and pretty fast to perform
2025-01-15 11:59:17 +01:00
eae300a95d fix: add hover effect on record table action row (#9633)
Related to this discord follow up
https://discord.com/channels/1130383047699738754/1328751649174585427
2025-01-15 11:42:21 +01:00
5fb6b18b18 77 create new record action and remove old behavior (#9598)
Closes https://github.com/twentyhq/core-team-issues/issues/77
2025-01-15 11:39:37 +01:00
765dedab0a Ensure users can set the empty value for the FormPhoneFieldInput (#9632)
Fixes
https://discord.com/channels/1130383047699738754/1328729510547296288
2025-01-15 11:33:36 +01:00
5d0ec9116f Fix delete workspace-member avatar (#9630)
## Context
avatarUrl is a TEXT field type so non nullable, which means if we try to
run a mutation with null it will either fail or be ignored. Here this is
the second option, done in sanitizeRecordInput where when a
fieldMetadata has isNullable=false and the value is null, we return
undefined. This caused the mutation to send an empty input and not
remove the avatar
2025-01-15 11:26:39 +01:00
fc484bde2d [Outlook integration] part 2 : GetMessages (#9612)
### Introducing

- mock files in order to setup unit test on parsing outlook messages
- special spec files for development purposes : dev.spec files. They are
CI skipped with xdescribe but very useful for iterating on new messages
format
- main functionality : getMessages. We use microsoft default client to
do so, using the $batch endpoint to group calls by 20

### documentation
final touch to add troubleshooting tips
2025-01-15 09:48:57 +01:00
eaa68424f5 Fix/record group index and seed (#9605)
- [x] [Disable group by on default view Options
menu](https://discord.com/channels/1130383047699738754/1328421803399446568)
- [x] Add default seed for view group
2025-01-15 09:37:15 +01:00
1a5b3ef2f8 for docker installs, override SIGN_IN_PREFILLED=false (#9627)
fixes #9231
2025-01-15 08:11:39 +01:00
c543a930cd Improve workflow arrows' design (#9619)
Old design:

![CleanShot_2024-11-12_at_17 37
33](https://github.com/user-attachments/assets/1fcaba6d-f23c-4679-b038-d051abeb0bbd)


New design:

![CleanShot 2025-01-14 at 18 22
10@2x](https://github.com/user-attachments/assets/a683163d-2e3c-42ed-8abd-1f1fd31bf7db)
2025-01-14 22:38:44 +01:00
f2bee55e6c Remove missing log (#9621)
Forgot one log to remove
2025-01-14 17:42:33 +00:00
9360a6b1de Clean logs from console.time (#9620)
As title. We do not need those anymore.
2025-01-14 18:32:54 +01:00
42ddc09f74 Add command to tag workspace as suspended or as deleted (#9610)
In this PR:
- remove old versions upgrade commands
- add a 0.40 upgrade command to loop over all INACTIVE workspaces and
either: update to SUSPENDED (if workspaceSchema exists), update them to
SUSPENDED + deletedAt (if workspaceSchema does not exist anymore)

Note: why updating the deleted one to SUSPENDED? Because I plan to
remove INACTIVE case in the enum in 0.41

Tests made on production like database:
- dry-mode
- singleWorkspaceId
- 3 cases : suspended, deleted+suspended, deleted+suspended+delete all
data
2025-01-14 18:23:42 +01:00
87be542185 Fix workflow run output empty (#9616)
- catch error on action execution. We will log the error and return it
in the step
- catch error on workflow run
- remove the catch in the action. All actions should simply throw and
let the executor do the job

<img width="1512" alt="Capture d’écran 2025-01-14 à 17 35 53"
src="https://github.com/user-attachments/assets/dcf79567-a309-45f1-a640-c50b7ac4769b"
/>
2025-01-14 17:18:40 +00:00
3e8fee7ff7 Fix overflowing aggregate value on kanban header (#9614)
before


![image](https://github.com/user-attachments/assets/d7a98f27-ec66-4341-8c49-1b0626e923db)

after

<img width="232" alt="image"
src="https://github.com/user-attachments/assets/5bdd286e-b60c-42f1-aaca-d1d6ee6e82aa"
/>
2025-01-14 17:46:47 +01:00
8fb9cb4f5f Fix command menu avatar url (#9611)
Closes #9488
2025-01-14 15:37:14 +00:00
d133d7f10e [CI] Migrate to ubuntu 24.04 runners (#9607)
## Introduction
Our GitHub Runners provider just
[released](https://depot.dev/changelog/2024-07-12-ubuntu-24-04-github-actions-runner-beta)
ubuntu-24.04 runners lately

## Cache primary key factorization
Refactored the calculation of the cache-primary-key prefix to avoid
duplication

## Runs
- twenty-front lint
https://github.com/twentyhq/twenty/actions/runs/12770312293/job/35595272862
- twenty-server
https://github.com/twentyhq/twenty/actions/runs/12770218595
2025-01-14 16:18:45 +01:00
b83793f9dc Fix placeholders in select (#9608)
Before
<img width="537" alt="Capture d’écran 2025-01-14 à 14 36 59"
src="https://github.com/user-attachments/assets/b29cc4da-ac67-4ea7-83dd-03e1e68e7938"
/>
<img width="537" alt="Capture d’écran 2025-01-14 à 14 37 05"
src="https://github.com/user-attachments/assets/7645e905-0421-48e8-8f91-f1bb6064bb18"
/>


After
<img width="537" alt="Capture d’écran 2025-01-14 à 14 35 36"
src="https://github.com/user-attachments/assets/8b059fb5-9137-46e5-8c81-105e254831c2"
/>
<img width="537" alt="Capture d’écran 2025-01-14 à 14 35 44"
src="https://github.com/user-attachments/assets/aa0a754b-2fb7-4985-8154-e69ddef10596"
/>
<img width="537" alt="Capture d’écran 2025-01-14 à 14 35 56"
src="https://github.com/user-attachments/assets/d90d1f89-1480-4de9-b02b-519370a27bfe"
/>
<img width="537" alt="Capture d’écran 2025-01-14 à 14 36 11"
src="https://github.com/user-attachments/assets/67c25d62-d509-4e23-b2b6-c44d3b7cd37a"
/>
2025-01-14 15:30:47 +01:00
6ab9b79bf3 Moving record filter related types, hooks and utils into record-filter module (#9604)
This PR is only moving and renaming types, hooks and utils to
record-filter module folder.

- Moved and renamed types from object filter modules to record filter…-
Moved and renamed types from object filter modules to record filter
module
- Moved useApplyRecordFilter to record filter module
- Renamed util getOperandsForFilterDefinition to
getRecordFilterOperandsForRecordFilterDefinition
2025-01-14 14:21:05 +00:00
508feb4e7e Introduce SUSPENDED Activation Status (#9609)
We are introducing a new workspace activationStatus "SUSPENDED". This
status represents a workspace which is SUSPENDED (either manually by the
admin or in case if IS_BILLING_ENABLED if the subscription is unpaid |
canceled | paused).

We will keep making sure these workspaces are healthy but prevent the
user from using it (they will be redirected to the billing page)
2025-01-14 14:52:45 +01:00
c9b91dcfaa Fix error when deleting the trigger of an activated workflow version (#9606)
Fixes
https://discord.com/channels/1130383047699738754/1328375628512100412
2025-01-14 14:34:51 +01:00
b815de3e26 [FIX][CI] cache-hit incorrectly computed (#9603)
## Introduction
The `cache-hit` value should be a string boolean, but it seems like not
to always be the case ?

## Related runs
- twenty-server first attempt saves cache second retrieves it
https://github.com/twentyhq/twenty/actions/runs/12768260350
- twenty-front
https://github.com/twentyhq/twenty/actions/runs/12767064201
2025-01-14 14:18:33 +01:00
4719fe6ed9 Fix form date time field right border when variable picker is provided and field is readonly (#9600) 2025-01-14 13:58:52 +01:00
f151963e66 fixs #9456 : Workspace switcher font weight (#9591)
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
2025-01-14 11:52:19 +00:00
5d09bd4b93 [CI][NITPICK] Remove input types invalid syntax (#9596)
## Introduction
Unless I'm mistaken neither the `inputs.type` or `inputs.type` syntax
exists for `composite actions`.
By default it seems like any `Composite action` inputs are considered as
`string`.
```yml
name: Nx Affected CI
inputs:
  parallel:
    required: false
    types: [number]
    default: 3
  tag:
    required: false
    types: [string]
  tasks:
    required: true
    types: [string]
```

## Suggestion
To avoid misunderstanding of our composite actions inputs signature I
would recommend removing any `type` props but also default any inputs as
`strings`

## Misc
- Please find related GitHub community discussion
https://github.com/orgs/community/discussions/65588
2025-01-14 12:23:37 +01:00
459d0b18cf Simplify docker compose (#9602)
Seems like Spilo doesn't take into account the password?!
2025-01-14 12:19:57 +01:00
35d165dbe9 Fix header dropdown button style (#9599) 2025-01-14 12:13:26 +01:00
6fc691beb0 [CI] Refactor composite action task-cache (#9583)
## Introduction
In this previous PR https://github.com/twentyhq/twenty/pull/9448 we've
refactored the storybook build caching flow to be using the new
[actions/cache](https://github.com/actions/cache) `restore` and `save`
functions, which significantly improve caching operations duration.

In this way, in this PR, we've standardize both of the `restore` and
`save` by refactoring the `task-cache` composite action. By creating two
new composite actions `save-cache` and `restore-cache` that centralize
the paths to cache and the way to compute the primary key.

## Misc
- **If no cache** is hit, then a job duration will long for its task
duration and nothing else, previously the cache upload would sometimes
take up to 3 mins.
- **if cache** is hit, then mainly the only time consuming step is the
dependencies installation ( which is theory is also cached, in fact
twice. We will be having a look on this issue in an upcoming PR )
2025-01-14 12:06:23 +01:00
90d984d27d Remove signin prefill from docker compose (#9597)
I think this was affecting the 1-click install
2025-01-14 11:46:17 +01:00
f0287d273d Add containsAny filter comparators in rest api (#9595)
- add missing `containsAny` filter comparator to filter multiSelect
fields
- fix app break if object with same name created
- fix flash when clicking on choose plan
### Before


https://github.com/user-attachments/assets/71709912-63e8-40f8-bc52-3ec0a62746bb


### After



https://github.com/user-attachments/assets/93ee02c2-e3d9-4bab-8b6a-62813fd40b2b
2025-01-14 11:40:02 +01:00
5eeee6a7ed Add readonly mode to form fields - 2nd part (#9582)
In this PR, I implemented or confirmed that the read-only mode works for
the following fields:

- [x] FormUuidFieldInput
- [x] FormRawJsonFieldInput
- [x] FormPhoneFieldInput
- [x] FormEmailsFieldInput
- [x] FormLinksFieldInput
- [x] FormAddressFieldInput
- [x] FormFullNameFieldInput
2025-01-14 11:34:26 +01:00
21a6dff2c9 1-click install take latest version from docker (#9592)
There was a small issue where if you used the 1-click install script
right after it was tagged on Github but before it was built and
published to Docker hub, then it would fail
2025-01-14 10:20:47 +01:00
21e2295ade Support old relation filter value format (#9590)
Fix production bug caused by old relation filter value.

**Draft, not tested yet at all, working on it right now.**

---------

Co-authored-by: ad-elias <elias@autodiligence.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2025-01-13 21:45:39 +01:00
e893c4dcce Workflow fast follows batch (#9587)
- Add icon chevron on select
- Fix event step label
- Fix generate function output
2025-01-13 18:31:15 +01:00
f9a90a6561 Fix featureFlag not matching gql type (#9585)
## Context

<img width="1349" alt="Screenshot 2025-01-13 at 17 18 24"
src="https://github.com/user-attachments/assets/4f5da0e9-0245-41c6-bde2-4d52e0ba34ed"
/>

Feature flags are stored in DB and then cast as FeatureFlag gql type
from its corresponding enum.
This means if a value from the DB does not match that enum type, the gql
server will reject the call when returning the object in the resolver.
(see screenshot above)

To solve that, we want to do 2 things:
- The ORM should still return the feature flag even if it's not valid,
this is actually in the DB so we don't want to "hide" that, however we
now have a warning message.
- The service is not changed for the same reason, the limitation comes
from gql behaviour so this is not the goal of the service nor the ORM to
act on it (except the warning message)
- The resolver should be updated, here we want to filter-out non-valid
feature flags so it does not break the API.

Because featureFlags used to be auto-generated by nestjsquery and we
want to change its behavior, I had to manually create a resolveField for
featureFlags and remove the auto-generated one. That means we lose some
features such as filter/sort coming from nestjs-query pagination (which
is something we will want to implement once we will remove nestjs-query
but that's a whole other subject)
2025-01-13 18:30:16 +01:00
55bae60f69 Fix wrong domainName for redirect url (#9586)
Closes https://github.com/twentyhq/twenty/issues/9097

Fixes the redirect url of stripe `checkout` and `billingPortal` sessions

## Before


https://github.com/user-attachments/assets/4ccab325-41e1-494e-854a-9d9a72e534f1

## After


https://github.com/user-attachments/assets/740b07f4-84b0-4670-a5b6-2684fde640c8
2025-01-13 17:03:01 +00:00
17850b76ab Aggregate queries follow up (#9581)
In this PR

- fixing Collapse on view groups views: aggregate bar should be included
in the collapse (@magrinj )
- respect the html table pattern: the aggregate bar is now a <tr>
element included in a <table> (before that, it was a <tr> not included
in anything)
- add a top-border on the aggregate bar
- introduce short labels for the on-cell value display (display "Empty"
instead of "Count empty" to lighten the interface)
- remove the feature flag !
2025-01-13 17:20:35 +01:00
739611afa8 Migrate copilot to command menu (#9522)
Open copilot chat inside command menu


https://github.com/user-attachments/assets/60d83a77-6e96-4daa-98b0-33b7c1157d9a
2025-01-13 17:12:31 +01:00
86c4decdbd Refactored sort dropdown hooks (#9584)
- Removed useObjectSortDropdown hook
- Removed useSortDropdown hook
2025-01-13 17:07:05 +01:00
530a18558b 9426 migrate workflow pages to command menu (#9515)
Closes twentyhq/core-team-issues#53 

- Removes command menu top bar text input when the user is not on root
page
- Fixes bug when resetting command menu context
- Added animations on command menu open and close
- Refactored workflow visualizer code to remove unnecessary rerenders
and props drilling


https://github.com/user-attachments/assets/1da3adb8-220b-407b-9279-30354d3100d3
2025-01-13 16:53:57 +01:00
330addbc0b Refech code after code update (#9577)
- fixes code step update, then close code step, then open code step,
code not up to date
2025-01-13 15:53:56 +01:00
9ebe519e66 Finalize the readonly for a few form fields #1 (#9524)
There are many fields so I will cut my work in several small PRs.

Here, I updated the following fields:

- [x] `FormBooleanFieldInput`
- [x] `FormCurrencyFieldInput`
- [x] `FormNumberFieldInput`
- [x] `FormDateFieldInput`
- [x] `FormDateTimeFieldInput`
- [x] `FormMultiSelectFieldInput`
- [x] `FormSelectFieldInput`

The updates in the components are relatively small. I wrote Storybook
tests, and this is why the PR is quite big.

The changes in the components should mostly the same.

I added a disabled state to some inputs.

I created a specialized `VariableChip` as its styles started diverging
from the original `SortOrFilterChip`.
2025-01-13 15:07:41 +01:00
b81879dead fix: drop record group feature flag (#9575) 2025-01-13 14:50:27 +01:00
6314cdb36c fix: remove sticky shadow from RecordTableActionRow (#9576) 2025-01-13 14:48:33 +01:00
cc2d6154e7 fix: table acton row wrong stroke (#9574)
As requested by @Bonapara the stroke of `RecordTableActionRow` should be
in `sm` instead of `md`.
2025-01-13 14:42:37 +01:00
719344f980 Refactor record sort dropdown (#9578)
- Refactored all sort dropdown states to V2
- Added ObjectSortDropdownComponentInstanceContext
- Cleaned some constants
2025-01-13 14:42:02 +01:00