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',
|
'position',
|
||||||
'icon',
|
'icon',
|
||||||
'kanbanFieldMetadataId',
|
'kanbanFieldMetadataId',
|
||||||
|
'kanbanAggregateOperation',
|
||||||
|
'kanbanAggregateOperationFieldMetadataId',
|
||||||
])
|
])
|
||||||
.values(
|
.values(
|
||||||
viewDefinitionsWithId.map(
|
viewDefinitionsWithId.map(
|
||||||
@ -37,6 +39,8 @@ export const createWorkspaceViews = async (
|
|||||||
position,
|
position,
|
||||||
icon,
|
icon,
|
||||||
kanbanFieldMetadataId,
|
kanbanFieldMetadataId,
|
||||||
|
kanbanAggregateOperation,
|
||||||
|
kanbanAggregateOperationFieldMetadataId,
|
||||||
}) => ({
|
}) => ({
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
@ -46,6 +50,8 @@ export const createWorkspaceViews = async (
|
|||||||
position,
|
position,
|
||||||
icon,
|
icon,
|
||||||
kanbanFieldMetadataId,
|
kanbanFieldMetadataId,
|
||||||
|
kanbanAggregateOperation,
|
||||||
|
kanbanAggregateOperationFieldMetadataId,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -63,6 +69,7 @@ export const createWorkspaceViews = async (
|
|||||||
'isVisible',
|
'isVisible',
|
||||||
'size',
|
'size',
|
||||||
'viewId',
|
'viewId',
|
||||||
|
'aggregateOperation',
|
||||||
])
|
])
|
||||||
.values(
|
.values(
|
||||||
viewDefinition.fields.map((field) => ({
|
viewDefinition.fields.map((field) => ({
|
||||||
@ -71,6 +78,7 @@ export const createWorkspaceViews = async (
|
|||||||
isVisible: field.isVisible,
|
isVisible: field.isVisible,
|
||||||
size: field.size,
|
size: field.size,
|
||||||
viewId: viewDefinition.id,
|
viewId: viewDefinition.id,
|
||||||
|
aggregateOperation: field.aggregateOperation,
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.execute();
|
.execute();
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { AGGREGATE_OPERATIONS } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
|
||||||
|
|
||||||
export interface ViewDefinition {
|
export interface ViewDefinition {
|
||||||
id?: string;
|
id?: string;
|
||||||
name: string;
|
name: string;
|
||||||
@ -7,11 +9,14 @@ export interface ViewDefinition {
|
|||||||
position: number;
|
position: number;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
kanbanFieldMetadataId?: string;
|
kanbanFieldMetadataId?: string;
|
||||||
|
kanbanAggregateOperation?: AGGREGATE_OPERATIONS;
|
||||||
|
kanbanAggregateOperationFieldMetadataId?: string;
|
||||||
fields?: {
|
fields?: {
|
||||||
fieldMetadataId: string;
|
fieldMetadataId: string;
|
||||||
position: number;
|
position: number;
|
||||||
isVisible: boolean;
|
isVisible: boolean;
|
||||||
size: number;
|
size: number;
|
||||||
|
aggregateOperation?: AGGREGATE_OPERATIONS;
|
||||||
}[];
|
}[];
|
||||||
filters?: {
|
filters?: {
|
||||||
fieldMetadataId: string;
|
fieldMetadataId: string;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
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 {
|
import {
|
||||||
BASE_OBJECT_STANDARD_FIELD_IDS,
|
BASE_OBJECT_STANDARD_FIELD_IDS,
|
||||||
COMPANY_STANDARD_FIELD_IDS,
|
COMPANY_STANDARD_FIELD_IDS,
|
||||||
@ -37,6 +38,7 @@ export const seedCompaniesAllView = (
|
|||||||
position: 1,
|
position: 1,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 100,
|
size: 100,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.count,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -73,6 +75,7 @@ export const seedCompaniesAllView = (
|
|||||||
position: 5,
|
position: 5,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.max,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -82,6 +85,7 @@ export const seedCompaniesAllView = (
|
|||||||
position: 6,
|
position: 6,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 170,
|
size: 170,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.percentageEmpty,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -91,6 +95,7 @@ export const seedCompaniesAllView = (
|
|||||||
position: 7,
|
position: 7,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 170,
|
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 { 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 { 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';
|
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,
|
position: 1,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.avg,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -48,6 +50,7 @@ export const opportunitiesAllView = (
|
|||||||
position: 3,
|
position: 3,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.min,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
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 { 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';
|
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[
|
objectMetadataStandardIdToIdMap[STANDARD_OBJECT_IDS.opportunity].fields[
|
||||||
OPPORTUNITY_STANDARD_FIELD_IDS.stage
|
OPPORTUNITY_STANDARD_FIELD_IDS.stage
|
||||||
],
|
],
|
||||||
|
kanbanAggregateOperation: AGGREGATE_OPERATIONS.min,
|
||||||
|
kanbanAggregateOperationFieldMetadataId:
|
||||||
|
objectMetadataStandardIdToIdMap[STANDARD_OBJECT_IDS.opportunity].fields[
|
||||||
|
OPPORTUNITY_STANDARD_FIELD_IDS.amount
|
||||||
|
],
|
||||||
filters: [],
|
filters: [],
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
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 { 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';
|
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,
|
position: 1,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.avg,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -51,6 +53,7 @@ export const opportunitiesTableByStageView = (
|
|||||||
position: 3,
|
position: 3,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.max,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -59,6 +62,7 @@ export const opportunitiesTableByStageView = (
|
|||||||
position: 4,
|
position: 4,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.count,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ObjectMetadataStandardIdToIdMap } from 'src/engine/metadata-modules/object-metadata/interfaces/object-metadata-standard-id-to-id-map';
|
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 {
|
import {
|
||||||
BASE_OBJECT_STANDARD_FIELD_IDS,
|
BASE_OBJECT_STANDARD_FIELD_IDS,
|
||||||
PERSON_STANDARD_FIELD_IDS,
|
PERSON_STANDARD_FIELD_IDS,
|
||||||
@ -37,6 +38,7 @@ export const peopleAllView = (
|
|||||||
position: 1,
|
position: 1,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.countUniqueValues,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -64,6 +66,7 @@ export const peopleAllView = (
|
|||||||
position: 4,
|
position: 4,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.percentageEmpty,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
@ -73,6 +76,7 @@ export const peopleAllView = (
|
|||||||
position: 5,
|
position: 5,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
size: 150,
|
size: 150,
|
||||||
|
aggregateOperation: AGGREGATE_OPERATIONS.min,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldMetadataId:
|
fieldMetadataId:
|
||||||
|
|||||||
Reference in New Issue
Block a user