Skip to content

Commit db4a9f3

Browse files
authored
Merge branch 'main' into feat/8240-email-verification
2 parents 7d3f3de + 8e0c9fb commit db4a9f3

File tree

8 files changed

+69
-14
lines changed

8 files changed

+69
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,43 @@
11
name: Yarn Install
2+
inputs:
3+
node-version:
4+
required: false
5+
default: '18'
26

37
runs:
48
using: "composite"
59
steps:
10+
- name: Cache primary key builder
11+
id: globals
12+
shell: bash
13+
run: |
14+
echo "ACTION_SHELL=bash" >> "${GITHUB_OUTPUT}"
15+
echo "CACHE_KEY_PREFIX=node_modules-cache-node-${{ inputs.node-version }}-${{ hashFiles('yarn.lock') }}" >> "${GITHUB_OUTPUT}"
16+
echo 'PATH_TO_CACHE<<EOF' >> $GITHUB_OUTPUT
17+
echo "node_modules" >> $GITHUB_OUTPUT
18+
echo "packages/*/node_modules" >> $GITHUB_OUTPUT
19+
echo 'EOF' >> $GITHUB_OUTPUT
620
- name: Setup Node.js and get yarn cache
7-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
822
with:
9-
node-version: "18"
10-
cache: yarn
11-
- name: Cache node modules
12-
id: node-modules-cache
13-
uses: actions/cache@v3
23+
node-version: ${{ inputs.node-version }}
24+
- name: Restore node_modules
25+
id: cache-node-modules
26+
uses: actions/cache/restore@v4
1427
with:
15-
path: |
16-
node_modules
17-
packages/*/node_modules
18-
key: root-node_modules-${{ hashFiles('yarn.lock') }}
19-
restore-keys: root-node_modules-
28+
key: ${{ steps.globals.outputs.CACHE_KEY_PREFIX }}-${{github.sha}}
29+
restore-keys: ${{ steps.globals.outputs.CACHE_KEY_PREFIX }}-
30+
path: ${{ steps.globals.outputs.PATH_TO_CACHE }}
2031
- name: Install Dependencies
21-
shell: bash
22-
run: yarn --immutable --check-cache
23-
if: steps.node-modules-cache.outputs.cache-hit != 'true'
32+
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' && steps.cache-node-modules.outputs.cache-matched-key == '' }}
33+
shell: ${{ steps.globals.outputs.ACTION_SHELL }}
34+
run: |
35+
yarn config set enableHardenedMode true
36+
yarn --immutable --immutable-cache --check-cache
37+
- name: Save cache
38+
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' && steps.cache-node-modules.outputs.cache-matched-key == '' }}
39+
uses: actions/cache/save@v4
40+
with:
41+
key: ${{ steps.cache-node-modules.outputs.cache-primary-key }}
42+
path: ${{ steps.globals.outputs.PATH_TO_CACHE }}
43+

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/create-workspace-views.ts

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const createWorkspaceViews = async (
2525
'position',
2626
'icon',
2727
'kanbanFieldMetadataId',
28+
'kanbanAggregateOperation',
29+
'kanbanAggregateOperationFieldMetadataId',
2830
])
2931
.values(
3032
viewDefinitionsWithId.map(
@@ -37,6 +39,8 @@ export const createWorkspaceViews = async (
3739
position,
3840
icon,
3941
kanbanFieldMetadataId,
42+
kanbanAggregateOperation,
43+
kanbanAggregateOperationFieldMetadataId,
4044
}) => ({
4145
id,
4246
name,
@@ -46,6 +50,8 @@ export const createWorkspaceViews = async (
4650
position,
4751
icon,
4852
kanbanFieldMetadataId,
53+
kanbanAggregateOperation,
54+
kanbanAggregateOperationFieldMetadataId,
4955
}),
5056
),
5157
)
@@ -63,6 +69,7 @@ export const createWorkspaceViews = async (
6369
'isVisible',
6470
'size',
6571
'viewId',
72+
'aggregateOperation',
6673
])
6774
.values(
6875
viewDefinition.fields.map((field) => ({
@@ -71,6 +78,7 @@ export const createWorkspaceViews = async (
7178
isVisible: field.isVisible,
7279
size: field.size,
7380
viewId: viewDefinition.id,
81+
aggregateOperation: field.aggregateOperation,
7482
})),
7583
)
7684
.execute();

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/types/view-definition.interface.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
2+
13
export interface ViewDefinition {
24
id?: string;
35
name: string;
@@ -7,11 +9,14 @@ export interface ViewDefinition {
79
position: number;
810
icon?: string;
911
kanbanFieldMetadataId?: string;
12+
kanbanAggregateOperation?: AGGREGATE_OPERATIONS;
13+
kanbanAggregateOperationFieldMetadataId?: string;
1014
fields?: {
1115
fieldMetadataId: string;
1216
position: number;
1317
isVisible: boolean;
1418
size: number;
19+
aggregateOperation?: AGGREGATE_OPERATIONS;
1520
}[];
1621
filters?: {
1722
fieldMetadataId: string;

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/views/companies-all.view.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
22

3+
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
34
import {
45
BASE_OBJECT_STANDARD_FIELD_IDS,
56
COMPANY_STANDARD_FIELD_IDS,
@@ -37,6 +38,7 @@ export const seedCompaniesAllView = (
3738
position: 1,
3839
isVisible: true,
3940
size: 100,
41+
aggregateOperation: AGGREGATE_OPERATIONS.count,
4042
},
4143
{
4244
fieldMetadataId:
@@ -73,6 +75,7 @@ export const seedCompaniesAllView = (
7375
position: 5,
7476
isVisible: true,
7577
size: 150,
78+
aggregateOperation: AGGREGATE_OPERATIONS.max,
7679
},
7780
{
7881
fieldMetadataId:
@@ -82,6 +85,7 @@ export const seedCompaniesAllView = (
8285
position: 6,
8386
isVisible: true,
8487
size: 170,
88+
aggregateOperation: AGGREGATE_OPERATIONS.percentageEmpty,
8589
},
8690
{
8791
fieldMetadataId:
@@ -91,6 +95,7 @@ export const seedCompaniesAllView = (
9195
position: 7,
9296
isVisible: true,
9397
size: 170,
98+
aggregateOperation: AGGREGATE_OPERATIONS.countNotEmpty,
9499
},
95100
],
96101
};

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/views/opportunities-all.view.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
22

3+
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
34
import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
45
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
56

@@ -32,6 +33,7 @@ export const opportunitiesAllView = (
3233
position: 1,
3334
isVisible: true,
3435
size: 150,
36+
aggregateOperation: AGGREGATE_OPERATIONS.avg,
3537
},
3638
{
3739
fieldMetadataId:
@@ -48,6 +50,7 @@ export const opportunitiesAllView = (
4850
position: 3,
4951
isVisible: true,
5052
size: 150,
53+
aggregateOperation: AGGREGATE_OPERATIONS.min,
5154
},
5255
{
5356
fieldMetadataId:

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/views/opportunity-by-stage.view.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
22

3+
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
34
import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
45
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
56

@@ -18,6 +19,11 @@ export const opportunitiesByStageView = (
1819
objectMetadataStandardIdToIdMap[STANDARD_OBJECT_IDS.opportunity].fields[
1920
OPPORTUNITY_STANDARD_FIELD_IDS.stage
2021
],
22+
kanbanAggregateOperation: AGGREGATE_OPERATIONS.min,
23+
kanbanAggregateOperationFieldMetadataId:
24+
objectMetadataStandardIdToIdMap[STANDARD_OBJECT_IDS.opportunity].fields[
25+
OPPORTUNITY_STANDARD_FIELD_IDS.amount
26+
],
2127
filters: [],
2228
fields: [
2329
{

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/views/opportunity-table-by-stage.view.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
22

3+
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
34
import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
45
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
56

@@ -35,6 +36,7 @@ export const opportunitiesTableByStageView = (
3536
position: 1,
3637
isVisible: true,
3738
size: 150,
39+
aggregateOperation: AGGREGATE_OPERATIONS.avg,
3840
},
3941
{
4042
fieldMetadataId:
@@ -51,6 +53,7 @@ export const opportunitiesTableByStageView = (
5153
position: 3,
5254
isVisible: true,
5355
size: 150,
56+
aggregateOperation: AGGREGATE_OPERATIONS.max,
5457
},
5558
{
5659
fieldMetadataId:
@@ -59,6 +62,7 @@ export const opportunitiesTableByStageView = (
5962
position: 4,
6063
isVisible: true,
6164
size: 150,
65+
aggregateOperation: AGGREGATE_OPERATIONS.count,
6266
},
6367
{
6468
fieldMetadataId:

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/views/people-all.view.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
22

3+
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
34
import {
45
BASE_OBJECT_STANDARD_FIELD_IDS,
56
PERSON_STANDARD_FIELD_IDS,
@@ -37,6 +38,7 @@ export const peopleAllView = (
3738
position: 1,
3839
isVisible: true,
3940
size: 150,
41+
aggregateOperation: AGGREGATE_OPERATIONS.countUniqueValues,
4042
},
4143
{
4244
fieldMetadataId:
@@ -64,6 +66,7 @@ export const peopleAllView = (
6466
position: 4,
6567
isVisible: true,
6668
size: 150,
69+
aggregateOperation: AGGREGATE_OPERATIONS.percentageEmpty,
6770
},
6871
{
6972
fieldMetadataId:
@@ -73,6 +76,7 @@ export const peopleAllView = (
7376
position: 5,
7477
isVisible: true,
7578
size: 150,
79+
aggregateOperation: AGGREGATE_OPERATIONS.min,
7680
},
7781
{
7882
fieldMetadataId:

0 commit comments

Comments
 (0)