Aggregate queries - add seeds (#9640)
as per title adding seeds on table views, kanban views, view groups
This commit is contained in:
@ -25,6 +25,8 @@ export const createWorkspaceViews = async (
|
||||
'position',
|
||||
'icon',
|
||||
'kanbanFieldMetadataId',
|
||||
'kanbanAggregateOperation',
|
||||
'kanbanAggregateOperationFieldMetadataId',
|
||||
])
|
||||
.values(
|
||||
viewDefinitionsWithId.map(
|
||||
@ -37,6 +39,8 @@ export const createWorkspaceViews = async (
|
||||
position,
|
||||
icon,
|
||||
kanbanFieldMetadataId,
|
||||
kanbanAggregateOperation,
|
||||
kanbanAggregateOperationFieldMetadataId,
|
||||
}) => ({
|
||||
id,
|
||||
name,
|
||||
@ -46,6 +50,8 @@ export const createWorkspaceViews = async (
|
||||
position,
|
||||
icon,
|
||||
kanbanFieldMetadataId,
|
||||
kanbanAggregateOperation,
|
||||
kanbanAggregateOperationFieldMetadataId,
|
||||
}),
|
||||
),
|
||||
)
|
||||
@ -63,6 +69,7 @@ export const createWorkspaceViews = async (
|
||||
'isVisible',
|
||||
'size',
|
||||
'viewId',
|
||||
'aggregateOperation',
|
||||
])
|
||||
.values(
|
||||
viewDefinition.fields.map((field) => ({
|
||||
@ -71,6 +78,7 @@ export const createWorkspaceViews = async (
|
||||
isVisible: field.isVisible,
|
||||
size: field.size,
|
||||
viewId: viewDefinition.id,
|
||||
aggregateOperation: field.aggregateOperation,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||
|
||||
export interface ViewDefinition {
|
||||
id?: string;
|
||||
name: string;
|
||||
@ -7,11 +9,14 @@ export interface ViewDefinition {
|
||||
position: number;
|
||||
icon?: string;
|
||||
kanbanFieldMetadataId?: string;
|
||||
kanbanAggregateOperation?: AGGREGATE_OPERATIONS;
|
||||
kanbanAggregateOperationFieldMetadataId?: string;
|
||||
fields?: {
|
||||
fieldMetadataId: string;
|
||||
position: number;
|
||||
isVisible: boolean;
|
||||
size: number;
|
||||
aggregateOperation?: AGGREGATE_OPERATIONS;
|
||||
}[];
|
||||
filters?: {
|
||||
fieldMetadataId: string;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
||||
|
||||
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||
import {
|
||||
BASE_OBJECT_STANDARD_FIELD_IDS,
|
||||
COMPANY_STANDARD_FIELD_IDS,
|
||||
@ -37,6 +38,7 @@ export const seedCompaniesAllView = (
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 100,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.count,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -73,6 +75,7 @@ export const seedCompaniesAllView = (
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.max,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -82,6 +85,7 @@ export const seedCompaniesAllView = (
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 170,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.percentageEmpty,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -91,6 +95,7 @@ export const seedCompaniesAllView = (
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 170,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.countNotEmpty,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
||||
|
||||
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||
import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||
|
||||
@ -32,6 +33,7 @@ export const opportunitiesAllView = (
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.avg,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -48,6 +50,7 @@ export const opportunitiesAllView = (
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.min,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
||||
|
||||
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||
import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||
|
||||
@ -18,6 +19,11 @@ export const opportunitiesByStageView = (
|
||||
objectMetadataStandardIdToIdMap[STANDARD_OBJECT_IDS.opportunity].fields[
|
||||
OPPORTUNITY_STANDARD_FIELD_IDS.stage
|
||||
],
|
||||
kanbanAggregateOperation: AGGREGATE_OPERATIONS.min,
|
||||
kanbanAggregateOperationFieldMetadataId:
|
||||
objectMetadataStandardIdToIdMap[STANDARD_OBJECT_IDS.opportunity].fields[
|
||||
OPPORTUNITY_STANDARD_FIELD_IDS.amount
|
||||
],
|
||||
filters: [],
|
||||
fields: [
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
||||
|
||||
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||
import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||
|
||||
@ -35,6 +36,7 @@ export const opportunitiesTableByStageView = (
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.avg,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -51,6 +53,7 @@ export const opportunitiesTableByStageView = (
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.max,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -59,6 +62,7 @@ export const opportunitiesTableByStageView = (
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.count,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
||||
|
||||
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||
import {
|
||||
BASE_OBJECT_STANDARD_FIELD_IDS,
|
||||
PERSON_STANDARD_FIELD_IDS,
|
||||
@ -37,6 +38,7 @@ export const peopleAllView = (
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.countUniqueValues,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -64,6 +66,7 @@ export const peopleAllView = (
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.percentageEmpty,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
@ -73,6 +76,7 @@ export const peopleAllView = (
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS.min,
|
||||
},
|
||||
{
|
||||
fieldMetadataId:
|
||||
|
||||
Reference in New Issue
Block a user