add new @WorkspaceIsSearchable decorator + updates services + add migration command (#10507)
closes https://github.com/twentyhq/core-team-issues/issues/345
This commit is contained in:
@ -24,7 +24,7 @@ const documents = {
|
||||
"\n \n query GetManyDatabaseConnections($input: RemoteServerTypeInput!) {\n findManyRemoteServersByType(input: $input) {\n ...RemoteServerFields\n }\n }\n": types.GetManyDatabaseConnectionsDocument,
|
||||
"\n \n query GetManyRemoteTables($input: FindManyRemoteTablesInput!) {\n findDistantTablesWithStatus(input: $input) {\n ...RemoteTableFields\n }\n }\n": types.GetManyRemoteTablesDocument,
|
||||
"\n \n query GetOneDatabaseConnection($input: RemoteServerIdInput!) {\n findOneRemoteServerById(input: $input) {\n ...RemoteServerFields\n }\n }\n": types.GetOneDatabaseConnectionDocument,
|
||||
"\n mutation CreateOneObjectMetadataItem($input: CreateOneObjectInput!) {\n createOneObject(input: $input) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n": types.CreateOneObjectMetadataItemDocument,
|
||||
"\n mutation CreateOneObjectMetadataItem($input: CreateOneObjectInput!) {\n createOneObject(input: $input) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n isSearchable\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n": types.CreateOneObjectMetadataItemDocument,
|
||||
"\n mutation CreateOneFieldMetadataItem($input: CreateOneFieldMetadataInput!) {\n createOneField(input: $input) {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n settings\n defaultValue\n options\n }\n }\n": types.CreateOneFieldMetadataItemDocument,
|
||||
"\n mutation CreateOneRelationMetadataItem(\n $input: CreateOneRelationMetadataInput!\n ) {\n createOneRelationMetadata(input: $input) {\n id\n relationType\n fromObjectMetadataId\n toObjectMetadataId\n fromFieldMetadataId\n toFieldMetadataId\n createdAt\n updatedAt\n }\n }\n": types.CreateOneRelationMetadataItemDocument,
|
||||
"\n mutation UpdateOneFieldMetadataItem(\n $idToUpdate: UUID!\n $updatePayload: UpdateFieldInput!\n ) {\n updateOneField(input: { id: $idToUpdate, update: $updatePayload }) {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n settings\n isLabelSyncedWithName\n }\n }\n": types.UpdateOneFieldMetadataItemDocument,
|
||||
@ -32,7 +32,7 @@ const documents = {
|
||||
"\n mutation DeleteOneObjectMetadataItem($idToDelete: UUID!) {\n deleteOneObject(input: { id: $idToDelete }) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n": types.DeleteOneObjectMetadataItemDocument,
|
||||
"\n mutation DeleteOneFieldMetadataItem($idToDelete: UUID!) {\n deleteOneField(input: { id: $idToDelete }) {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n settings\n }\n }\n": types.DeleteOneFieldMetadataItemDocument,
|
||||
"\n mutation DeleteOneRelationMetadataItem($idToDelete: UUID!) {\n deleteOneRelation(input: { id: $idToDelete }) {\n id\n }\n }\n": types.DeleteOneRelationMetadataItemDocument,
|
||||
"\n query ObjectMetadataItems {\n objects(paging: { first: 1000 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n shortcut\n isLabelSyncedWithName\n duplicateCriteria\n indexMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n name\n indexWhereClause\n indexType\n isUnique\n indexFieldMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n order\n fieldMetadataId\n }\n }\n }\n }\n }\n }\n fieldsList {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n isUnique\n createdAt\n updatedAt\n defaultValue\n options\n settings\n isLabelSyncedWithName\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n": types.ObjectMetadataItemsDocument,
|
||||
"\n query ObjectMetadataItems {\n objects(paging: { first: 1000 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n shortcut\n isLabelSyncedWithName\n isSearchable\n duplicateCriteria\n indexMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n name\n indexWhereClause\n indexType\n isUnique\n indexFieldMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n order\n fieldMetadataId\n }\n }\n }\n }\n }\n }\n fieldsList {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n isUnique\n createdAt\n updatedAt\n defaultValue\n options\n settings\n isLabelSyncedWithName\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n": types.ObjectMetadataItemsDocument,
|
||||
"\n fragment ServerlessFunctionFields on ServerlessFunction {\n id\n name\n description\n runtime\n timeoutSeconds\n syncStatus\n latestVersion\n latestVersionInputSchema\n publishedVersions\n createdAt\n updatedAt\n }\n": types.ServerlessFunctionFieldsFragmentDoc,
|
||||
"\n \n mutation CreateOneServerlessFunctionItem(\n $input: CreateServerlessFunctionInput!\n ) {\n createOneServerlessFunction(input: $input) {\n ...ServerlessFunctionFields\n }\n }\n": types.CreateOneServerlessFunctionItemDocument,
|
||||
"\n \n mutation DeleteOneServerlessFunction($input: ServerlessFunctionIdInput!) {\n deleteOneServerlessFunction(input: $input) {\n ...ServerlessFunctionFields\n }\n }\n": types.DeleteOneServerlessFunctionDocument,
|
||||
@ -106,7 +106,7 @@ export function graphql(source: "\n \n query GetOneDatabaseConnection($input:
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n mutation CreateOneObjectMetadataItem($input: CreateOneObjectInput!) {\n createOneObject(input: $input) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n"): (typeof documents)["\n mutation CreateOneObjectMetadataItem($input: CreateOneObjectInput!) {\n createOneObject(input: $input) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n"];
|
||||
export function graphql(source: "\n mutation CreateOneObjectMetadataItem($input: CreateOneObjectInput!) {\n createOneObject(input: $input) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n isSearchable\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n"): (typeof documents)["\n mutation CreateOneObjectMetadataItem($input: CreateOneObjectInput!) {\n createOneObject(input: $input) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n isSearchable\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
@ -138,7 +138,7 @@ export function graphql(source: "\n mutation DeleteOneRelationMetadataItem($idT
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n query ObjectMetadataItems {\n objects(paging: { first: 1000 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n shortcut\n isLabelSyncedWithName\n duplicateCriteria\n indexMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n name\n indexWhereClause\n indexType\n isUnique\n indexFieldMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n order\n fieldMetadataId\n }\n }\n }\n }\n }\n }\n fieldsList {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n isUnique\n createdAt\n updatedAt\n defaultValue\n options\n settings\n isLabelSyncedWithName\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"): (typeof documents)["\n query ObjectMetadataItems {\n objects(paging: { first: 1000 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n shortcut\n isLabelSyncedWithName\n duplicateCriteria\n indexMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n name\n indexWhereClause\n indexType\n isUnique\n indexFieldMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n order\n fieldMetadataId\n }\n }\n }\n }\n }\n }\n fieldsList {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n isUnique\n createdAt\n updatedAt\n defaultValue\n options\n settings\n isLabelSyncedWithName\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query ObjectMetadataItems {\n objects(paging: { first: 1000 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n shortcut\n isLabelSyncedWithName\n isSearchable\n duplicateCriteria\n indexMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n name\n indexWhereClause\n indexType\n isUnique\n indexFieldMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n order\n fieldMetadataId\n }\n }\n }\n }\n }\n }\n fieldsList {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n isUnique\n createdAt\n updatedAt\n defaultValue\n options\n settings\n isLabelSyncedWithName\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"): (typeof documents)["\n query ObjectMetadataItems {\n objects(paging: { first: 1000 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n shortcut\n isLabelSyncedWithName\n isSearchable\n duplicateCriteria\n indexMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n name\n indexWhereClause\n indexType\n isUnique\n indexFieldMetadatas(paging: { first: 100 }) {\n edges {\n node {\n id\n createdAt\n updatedAt\n order\n fieldMetadataId\n }\n }\n }\n }\n }\n }\n fieldsList {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n isUnique\n createdAt\n updatedAt\n defaultValue\n options\n settings\n isLabelSyncedWithName\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1147,6 +1147,7 @@ export type Object = {
|
||||
isCustom: Scalars['Boolean'];
|
||||
isLabelSyncedWithName: Scalars['Boolean'];
|
||||
isRemote: Scalars['Boolean'];
|
||||
isSearchable: Scalars['Boolean'];
|
||||
isSystem: Scalars['Boolean'];
|
||||
labelIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
|
||||
labelPlural: Scalars['String'];
|
||||
@ -1199,6 +1200,7 @@ export type ObjectFilter = {
|
||||
isActive?: InputMaybe<BooleanFieldComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
isRemote?: InputMaybe<BooleanFieldComparison>;
|
||||
isSearchable?: InputMaybe<BooleanFieldComparison>;
|
||||
isSystem?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<ObjectFilter>>;
|
||||
};
|
||||
|
||||
@ -7,7 +7,6 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
|
||||
import { EMPTY_QUERY } from '@/object-record/constants/EmptyQuery';
|
||||
import { useGenerateCombinedSearchRecordsQuery } from '@/object-record/multiple-objects/hooks/useGenerateCombinedSearchRecordsQuery';
|
||||
import { MultiObjectRecordQueryResult } from '@/object-record/multiple-objects/types/MultiObjectRecordQueryResult';
|
||||
import { isObjectMetadataItemSearchableInCombinedRequest } from '@/object-record/utils/isObjectMetadataItemSearchableInCombinedRequest';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
export const useMultiObjectSearch = ({
|
||||
@ -21,14 +20,11 @@ export const useMultiObjectSearch = ({
|
||||
}) => {
|
||||
const objectMetadataItems = useRecoilValue(objectMetadataItemsState);
|
||||
|
||||
const selectableObjectMetadataItems = objectMetadataItems
|
||||
.filter(({ isSystem, isRemote }) => !isSystem && !isRemote)
|
||||
.filter(({ nameSingular }) => {
|
||||
return !excludedObjects?.includes(nameSingular as CoreObjectNameSingular);
|
||||
})
|
||||
.filter((objectMetadataItem) =>
|
||||
isObjectMetadataItemSearchableInCombinedRequest(objectMetadataItem),
|
||||
);
|
||||
const selectableObjectMetadataItems = objectMetadataItems.filter(
|
||||
({ nameSingular, isSearchable }) =>
|
||||
!excludedObjects?.includes(nameSingular as CoreObjectNameSingular) &&
|
||||
isSearchable,
|
||||
);
|
||||
|
||||
const { limitPerMetadataItem } = useLimitPerMetadataItem({
|
||||
objectMetadataItems,
|
||||
|
||||
@ -13,6 +13,7 @@ export const CREATE_ONE_OBJECT_METADATA_ITEM = gql`
|
||||
icon
|
||||
isCustom
|
||||
isActive
|
||||
isSearchable
|
||||
createdAt
|
||||
updatedAt
|
||||
labelIdentifierFieldMetadataId
|
||||
@ -98,6 +99,7 @@ export const UPDATE_ONE_OBJECT_METADATA_ITEM = gql`
|
||||
icon
|
||||
isCustom
|
||||
isActive
|
||||
isSearchable
|
||||
createdAt
|
||||
updatedAt
|
||||
labelIdentifierFieldMetadataId
|
||||
@ -119,6 +121,7 @@ export const DELETE_ONE_OBJECT_METADATA_ITEM = gql`
|
||||
icon
|
||||
isCustom
|
||||
isActive
|
||||
isSearchable
|
||||
createdAt
|
||||
updatedAt
|
||||
labelIdentifierFieldMetadataId
|
||||
|
||||
@ -23,6 +23,7 @@ export const FIND_MANY_OBJECT_METADATA_ITEMS = gql`
|
||||
imageIdentifierFieldMetadataId
|
||||
shortcut
|
||||
isLabelSyncedWithName
|
||||
isSearchable
|
||||
duplicateCriteria
|
||||
indexMetadatas(paging: { first: 100 }) {
|
||||
edges {
|
||||
|
||||
@ -13,6 +13,7 @@ export const query = gql`
|
||||
icon
|
||||
isCustom
|
||||
isActive
|
||||
isSearchable
|
||||
createdAt
|
||||
updatedAt
|
||||
labelIdentifierFieldMetadataId
|
||||
@ -79,6 +80,7 @@ export const responseData = {
|
||||
icon: '',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSearchable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
labelIdentifierFieldMetadataId: '20202020-72ba-4e11-a36d-e17b544541e1',
|
||||
|
||||
@ -13,6 +13,7 @@ export const query = gql`
|
||||
icon
|
||||
isCustom
|
||||
isActive
|
||||
isSearchable
|
||||
createdAt
|
||||
updatedAt
|
||||
labelIdentifierFieldMetadataId
|
||||
@ -34,6 +35,7 @@ export const responseData = {
|
||||
icon: '',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSearchable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
labelIdentifierFieldMetadataId: '20202020-72ba-4e11-a36d-e17b544541e1',
|
||||
|
||||
@ -21,6 +21,7 @@ describe('useLimitPerMetadataItem', () => {
|
||||
isCustom: true,
|
||||
isSystem: true,
|
||||
isRemote: false,
|
||||
isSearchable: true,
|
||||
labelPlural: 'labelPlural',
|
||||
labelSingular: 'labelSingular',
|
||||
namePlural: 'namePlural',
|
||||
|
||||
@ -20,6 +20,7 @@ export const objectMetadataItemSchema = z.object({
|
||||
isCustom: z.boolean(),
|
||||
isRemote: z.boolean(),
|
||||
isSystem: z.boolean(),
|
||||
isSearchable: z.boolean(),
|
||||
labelIdentifierFieldMetadataId: z.string().uuid(),
|
||||
labelPlural: metadataLabelSchema(),
|
||||
labelSingular: metadataLabelSchema(),
|
||||
|
||||
@ -17,6 +17,7 @@ const mockObjectMetadataItem: ObjectMetadataItem = {
|
||||
labelSingular: 'Company',
|
||||
labelPlural: 'Companies',
|
||||
isCustom: false,
|
||||
isSearchable: false,
|
||||
labelIdentifierFieldMetadataId: '20202020-dd4a-4ea4-bb7b-1c7300491b65',
|
||||
isActive: true,
|
||||
createdAt: new Date().toISOString(),
|
||||
|
||||
@ -6,7 +6,6 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
||||
import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObjectMetadataToGraphQLQuery';
|
||||
import { RecordGqlOperationSignature } from '@/object-record/graphql/types/RecordGqlOperationSignature';
|
||||
import { getSearchRecordsQueryResponseField } from '@/object-record/utils/getSearchRecordsQueryResponseField';
|
||||
import { isObjectMetadataItemSearchable } from '@/object-record/utils/isObjectMetadataItemSearchable';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isNonEmptyArray } from '~/utils/isNonEmptyArray';
|
||||
|
||||
@ -55,8 +54,8 @@ export const useGenerateCombinedSearchRecordsQuery = ({
|
||||
);
|
||||
|
||||
const filteredQueryKeyWithObjectMetadataItemArray =
|
||||
queryKeyWithObjectMetadataItemArray.filter(({ objectMetadataItem }) =>
|
||||
isObjectMetadataItemSearchable(objectMetadataItem),
|
||||
queryKeyWithObjectMetadataItemArray.filter(
|
||||
({ objectMetadataItem }) => objectMetadataItem.isSearchable,
|
||||
);
|
||||
|
||||
return gql`
|
||||
|
||||
@ -29,6 +29,7 @@ const objectMetadataItemWithPositionField: ObjectMetadataItem = {
|
||||
isSystem: false,
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isSearchable: false,
|
||||
labelPlural: 'object1s',
|
||||
labelSingular: 'object1',
|
||||
isLabelSyncedWithName: true,
|
||||
|
||||
@ -18,6 +18,7 @@ describe('buildRecordGqlFieldsAggregateForView', () => {
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isRemote: false,
|
||||
isSearchable: false,
|
||||
labelIdentifierFieldMetadataId: '06b33746-5293-4d07-9f7f-ebf5ad396064',
|
||||
imageIdentifierFieldMetadataId: null,
|
||||
isLabelSyncedWithName: true,
|
||||
|
||||
@ -12,6 +12,7 @@ describe('generateAggregateQuery', () => {
|
||||
labelIdentifierFieldMetadataId: '20202020-72ba-4e11-a36d-e17b544541e1',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSearchable: false,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
fields: [],
|
||||
@ -50,6 +51,7 @@ describe('generateAggregateQuery', () => {
|
||||
labelIdentifierFieldMetadataId: '20202020-72ba-4e11-a36d-e17b544541e1',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSearchable: false,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
fields: [],
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
|
||||
const SEARCHABLE_STANDARD_OBJECTS_NAMES_PLURAL = [
|
||||
'companies',
|
||||
'people',
|
||||
'opportunities',
|
||||
];
|
||||
export const isObjectMetadataItemSearchable = (
|
||||
objectMetadataItem: ObjectMetadataItem,
|
||||
) => {
|
||||
return (
|
||||
objectMetadataItem.isCustom ||
|
||||
SEARCHABLE_STANDARD_OBJECTS_NAMES_PLURAL.includes(
|
||||
objectMetadataItem.namePlural,
|
||||
)
|
||||
);
|
||||
};
|
||||
@ -1,17 +0,0 @@
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
|
||||
const SEARCHABLE_STANDARD_OBJECTS_IN_COMBINED_REQUEST_NAMES_PLURAL = [
|
||||
'companies',
|
||||
'people',
|
||||
'opportunities',
|
||||
];
|
||||
export const isObjectMetadataItemSearchableInCombinedRequest = (
|
||||
objectMetadataItem: ObjectMetadataItem,
|
||||
) => {
|
||||
return (
|
||||
objectMetadataItem.isCustom ||
|
||||
SEARCHABLE_STANDARD_OBJECTS_IN_COMBINED_REQUEST_NAMES_PLURAL.includes(
|
||||
objectMetadataItem.namePlural,
|
||||
)
|
||||
);
|
||||
};
|
||||
@ -31,6 +31,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "0171f47e-f1e8-4e28-949e-b0a8e1a17356",
|
||||
@ -501,6 +502,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "f8ffb39e-dafb-4b61-b2be-e5b41a548ef0",
|
||||
@ -856,6 +858,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "d1d1ff00-7330-4c8d-b9b6-ae9f713e5c38",
|
||||
@ -1516,6 +1519,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "61946ba1-4743-4ced-a6d7-0d06a8c12f07",
|
||||
@ -2207,6 +2211,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "db996c62-eb44-4381-bcc2-46989d681f3a",
|
||||
@ -3025,6 +3030,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "585c1f2f-21d0-49d6-9d63-f830010a79da",
|
||||
@ -3987,6 +3993,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "28d93256-a262-422a-8f19-fbe1329fedfb",
|
||||
@ -4434,6 +4441,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "9db27f2b-a332-4017-9f55-142d877b2fee",
|
||||
@ -4925,6 +4933,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "08b10273-9750-4bc6-9f83-8cbad795bf18",
|
||||
@ -5809,6 +5818,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "f14938c3-58cc-4896-85a7-cea1c6fe9d0f",
|
||||
@ -5976,6 +5986,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "029ea2ee-6ffe-45a5-93f2-85cefc83f019",
|
||||
@ -6372,6 +6383,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "6572b4bf-c981-4db9-8f90-309522762cc2",
|
||||
@ -6686,6 +6698,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "dba26a5c-e28a-46cc-b864-6e44ccc75cc7",
|
||||
@ -7601,6 +7614,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "cbf8a777-7bea-4fc6-94e5-a5183bc5567b",
|
||||
@ -7807,6 +7821,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "f5dbede2-acbb-43b9-82a0-c7bff8155a3f",
|
||||
@ -8288,6 +8303,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "1d9070ea-776b-4a86-b5ec-08f57d84a87d",
|
||||
@ -8538,6 +8554,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "c8e0cf61-e509-4019-82a4-41482cb9f875",
|
||||
@ -8906,6 +8923,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "a74894a3-4065-4b87-ab17-3252c709235b",
|
||||
@ -9115,6 +9133,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "7a9d535e-6665-4de0-a301-d3ffaf94e1fb",
|
||||
@ -10507,6 +10526,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "b3df551f-1afb-4a2b-b899-3b49d111b16b",
|
||||
@ -10820,6 +10840,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "7a836cd1-9002-44c6-8ce4-17558bb97a34",
|
||||
@ -11059,6 +11080,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "6f4cc8ad-8342-4e36-b689-2474d767885f",
|
||||
@ -11719,6 +11741,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "dafe5e84-56d7-4cb8-a11e-7423e9e1c414",
|
||||
@ -12063,6 +12086,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "002c37a7-caa7-48de-b453-c409528fb789",
|
||||
@ -12807,6 +12831,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "321ef6c3-e01f-4080-9e8e-938810622ed8",
|
||||
@ -13426,6 +13451,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "d4ee3d39-1df1-46a4-a9aa-569119458656",
|
||||
@ -14235,6 +14261,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "9a08e8f4-4cf2-4586-b188-4542fe24c4e0",
|
||||
@ -15282,6 +15309,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "91acce03-f503-4d7b-99ae-03898590baf6",
|
||||
@ -16586,6 +16614,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "a325a92e-c357-43cd-9a9f-042bbb5f8cd0",
|
||||
@ -17112,6 +17141,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:40.039Z",
|
||||
updatedAt: "2025-02-11T09:14:40.043Z",
|
||||
labelIdentifierFieldMetadataId: "5bdf1a3a-986b-48d0-87c4-8fa683f005f3",
|
||||
@ -17722,6 +17752,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "84cc32f8-52cf-4988-873d-43860a6ca370",
|
||||
@ -17905,6 +17936,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "43b566c4-0d50-47c8-818a-b2b0475181a4",
|
||||
@ -18316,6 +18348,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "f9ef48ef-c0a1-49cc-ad51-35a4e2a8a6e0",
|
||||
@ -18935,6 +18968,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "ed8938cf-bb8d-46a0-8f8c-1e2132978716",
|
||||
@ -19418,6 +19452,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "ed2a4301-ae23-41ad-85e7-04e7082c478e",
|
||||
@ -20027,6 +20062,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "2df3fe9d-60af-46a9-917f-dec16c0a9c33",
|
||||
@ -20315,6 +20351,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isSearchable: true,
|
||||
createdAt: "2025-02-11T09:14:39.321Z",
|
||||
updatedAt: "2025-02-11T09:14:39.327Z",
|
||||
labelIdentifierFieldMetadataId: "0c3bb20e-2d2d-4c1b-a1aa-5a44d7e55818",
|
||||
@ -21261,6 +21298,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isSearchable: false,
|
||||
createdAt: "2025-02-11T09:14:32.715Z",
|
||||
updatedAt: "2025-02-11T09:14:32.715Z",
|
||||
labelIdentifierFieldMetadataId: "251826b3-199d-44f8-93ce-5165f17701b3",
|
||||
|
||||
@ -2,17 +2,17 @@ import chalk from 'chalk';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { WorkspaceDataSource } from 'src/engine/twenty-orm/datasource/workspace.datasource';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
|
||||
export abstract class BatchActiveWorkspacesMigrationCommandRunner<
|
||||
export abstract class BatchMaintainedWorkspacesMigrationCommandRunner<
|
||||
Options extends
|
||||
ActiveWorkspacesMigrationCommandOptions = ActiveWorkspacesMigrationCommandOptions,
|
||||
> extends ActiveWorkspacesMigrationCommandRunner<Options> {
|
||||
MaintainedWorkspacesMigrationCommandOptions = MaintainedWorkspacesMigrationCommandOptions,
|
||||
> extends MaintainedWorkspacesMigrationCommandRunner<Options> {
|
||||
constructor(
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
protected readonly twentyORMGlobalManager: TwentyORMGlobalManager,
|
||||
@ -20,7 +20,7 @@ export abstract class BatchActiveWorkspacesMigrationCommandRunner<
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParams: string[],
|
||||
_options: Options,
|
||||
activeWorkspaceIds: string[],
|
||||
@ -10,16 +10,16 @@ import {
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
|
||||
export type ActiveWorkspacesMigrationCommandOptions =
|
||||
export type MaintainedWorkspacesMigrationCommandOptions =
|
||||
MigrationCommandOptions & {
|
||||
workspaceId?: string;
|
||||
startFromWorkspaceId?: string;
|
||||
workspaceCountLimit?: number;
|
||||
};
|
||||
|
||||
export abstract class ActiveWorkspacesMigrationCommandRunner<
|
||||
export abstract class MaintainedWorkspacesMigrationCommandRunner<
|
||||
Options extends
|
||||
ActiveWorkspacesMigrationCommandOptions = ActiveWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandOptions = MaintainedWorkspacesMigrationCommandOptions,
|
||||
> extends MigrationCommandRunner<Options> {
|
||||
private workspaceIds: string[] = [];
|
||||
private startFromWorkspaceId: string | undefined;
|
||||
@ -124,14 +124,14 @@ export abstract class ActiveWorkspacesMigrationCommandRunner<
|
||||
this.logger.log(chalk.yellow('Dry run mode: No changes will be applied'));
|
||||
}
|
||||
|
||||
await this.runMigrationCommandOnActiveWorkspaces(
|
||||
await this.runMigrationCommandOnMaintainedWorkspaces(
|
||||
passedParams,
|
||||
options,
|
||||
activeWorkspaceIds,
|
||||
);
|
||||
}
|
||||
|
||||
protected abstract runMigrationCommandOnActiveWorkspaces(
|
||||
protected abstract runMigrationCommandOnMaintainedWorkspaces(
|
||||
passedParams: string[],
|
||||
options: Options,
|
||||
activeWorkspaceIds: string[],
|
||||
@ -6,9 +6,9 @@ import { In, Repository } from 'typeorm';
|
||||
|
||||
import { isCommandLogger } from 'src/database/commands/logger';
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { WorkspaceMetadataVersionService } from 'src/engine/metadata-modules/workspace-metadata-version/services/workspace-metadata-version.service';
|
||||
@ -20,7 +20,7 @@ import { ViewWorkspaceEntity } from 'src/modules/view/standard-objects/view.work
|
||||
name: 'upgrade-0.42:fix-body-v2-view-field-position',
|
||||
description: 'Make bodyV2 field position to match body field position',
|
||||
})
|
||||
export class FixBodyV2ViewFieldPositionCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class FixBodyV2ViewFieldPositionCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@ -32,9 +32,9 @@ export class FixBodyV2ViewFieldPositionCommand extends ActiveWorkspacesMigration
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesMigrationCommandOptions,
|
||||
options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log('Running command to fix bodyV2 field position');
|
||||
|
||||
@ -4,11 +4,11 @@ import chalk from 'chalk';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { CommandLogger } from 'src/database/commands/logger';
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { settings } from 'src/engine/constants/settings';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
@ -20,7 +20,7 @@ import { ViewWorkspaceEntity } from 'src/modules/view/standard-objects/view.work
|
||||
description: 'Limit amount of view field.',
|
||||
version: '0.42',
|
||||
})
|
||||
export class LimitAmountOfViewFieldCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class LimitAmountOfViewFieldCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
protected readonly logger: CommandLogger;
|
||||
|
||||
constructor(
|
||||
@ -95,9 +95,9 @@ export class LimitAmountOfViewFieldCommand extends ActiveWorkspacesMigrationComm
|
||||
}
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesMigrationCommandOptions,
|
||||
options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log(`Running limit-amount-of-view-field command`);
|
||||
|
||||
@ -7,11 +7,11 @@ import { FieldMetadataType, isDefined } from 'twenty-shared';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { isCommandLogger } from 'src/database/commands/logger';
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
@ -59,7 +59,7 @@ type ProcessRichTextFieldsArgs = {
|
||||
};
|
||||
|
||||
type MigrateRichTextFieldCommandOptions =
|
||||
ActiveWorkspacesMigrationCommandOptions & {
|
||||
MaintainedWorkspacesMigrationCommandOptions & {
|
||||
force?: boolean;
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ type MigrateRichTextFieldCommandOptions =
|
||||
description: 'Migrate RICH_TEXT fields to new composite structure',
|
||||
version: '0.42',
|
||||
})
|
||||
export class MigrateRichTextFieldCommand extends ActiveWorkspacesMigrationCommandRunner<MigrateRichTextFieldCommandOptions> {
|
||||
export class MigrateRichTextFieldCommand extends MaintainedWorkspacesMigrationCommandRunner<MigrateRichTextFieldCommandOptions> {
|
||||
private options: MigrateRichTextFieldCommandOptions;
|
||||
|
||||
constructor(
|
||||
@ -99,7 +99,7 @@ export class MigrateRichTextFieldCommand extends ActiveWorkspacesMigrationComman
|
||||
return val ?? false;
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: MigrateRichTextFieldCommandOptions,
|
||||
workspaceIds: string[],
|
||||
|
||||
@ -5,11 +5,11 @@ import { FieldMetadataType } from 'twenty-shared';
|
||||
import { IsNull, Repository } from 'typeorm';
|
||||
|
||||
import { CommandLogger } from 'src/database/commands/logger';
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { WorkspaceMetadataVersionService } from 'src/engine/metadata-modules/workspace-metadata-version/services/workspace-metadata-version.service';
|
||||
@ -20,7 +20,7 @@ import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.
|
||||
description: 'Add context to actor composite type.',
|
||||
version: '0.42',
|
||||
})
|
||||
export class StandardizationOfActorCompositeContextTypeCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class StandardizationOfActorCompositeContextTypeCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
protected readonly logger;
|
||||
|
||||
constructor(
|
||||
@ -40,9 +40,9 @@ export class StandardizationOfActorCompositeContextTypeCommand extends ActiveWor
|
||||
this.logger.setVerbose(false);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesMigrationCommandOptions,
|
||||
options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log(`Running add-context-to-actor-composite-type command`);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { MigrationCommandModule } from 'src/database/commands/migration-command/miration-command.module';
|
||||
import { MigrationCommandModule } from 'src/database/commands/migration-command/migration-command.module';
|
||||
import { FixBodyV2ViewFieldPositionCommand } from 'src/database/commands/upgrade-version/0-42/0-42-fix-body-v2-view-field-position.command';
|
||||
import { LimitAmountOfViewFieldCommand } from 'src/database/commands/upgrade-version/0-42/0-42-limit-amount-of-view-field';
|
||||
import { MigrateRichTextFieldCommand } from 'src/database/commands/upgrade-version/0-42/0-42-migrate-rich-text-field.command';
|
||||
|
||||
@ -5,11 +5,11 @@ import { Repository } from 'typeorm';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { isCommandLogger } from 'src/database/commands/logger';
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { FieldMetadataDefaultOption } from 'src/engine/metadata-modules/field-metadata/dtos/options.input';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
@ -29,7 +29,7 @@ import { ViewWorkspaceEntity } from 'src/modules/view/standard-objects/view.work
|
||||
description: 'Add tasks assigned to me view',
|
||||
version: '0.43',
|
||||
})
|
||||
export class AddTasksAssignedToMeViewCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class AddTasksAssignedToMeViewCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@ -43,9 +43,9 @@ export class AddTasksAssignedToMeViewCommand extends ActiveWorkspacesMigrationCo
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesMigrationCommandOptions,
|
||||
options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log('Running command to create many to one relations');
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import chalk from 'chalk';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
|
||||
@MigrationCommand({
|
||||
name: 'migrate-is-searchable-for-custom-object-metadata',
|
||||
description: 'Set isSearchable true for custom object metadata',
|
||||
version: '0.43',
|
||||
})
|
||||
export class MigrateIsSearchableForCustomObjectMetadataCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
protected readonly twentyORMGlobalManager: TwentyORMGlobalManager,
|
||||
@InjectRepository(ObjectMetadataEntity, 'metadata')
|
||||
protected readonly objectMetadataRepository: Repository<ObjectMetadataEntity>,
|
||||
) {
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
_options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log(
|
||||
chalk.green(
|
||||
'Running command to set isSearchable true for custom object metadata',
|
||||
),
|
||||
);
|
||||
|
||||
for (const [index, workspaceId] of workspaceIds.entries()) {
|
||||
await this.processWorkspace(workspaceId, index, workspaceIds.length);
|
||||
}
|
||||
|
||||
this.logger.log(chalk.green('Command completed!'));
|
||||
}
|
||||
|
||||
private async processWorkspace(
|
||||
workspaceId: string,
|
||||
index: number,
|
||||
total: number,
|
||||
): Promise<void> {
|
||||
try {
|
||||
this.logger.log(
|
||||
`Running command for workspace ${workspaceId} ${index + 1}/${total}`,
|
||||
);
|
||||
|
||||
await this.objectMetadataRepository.update(
|
||||
{
|
||||
workspaceId,
|
||||
isCustom: true,
|
||||
},
|
||||
{
|
||||
isSearchable: true,
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.log(
|
||||
chalk.red(`Error in workspace ${workspaceId} - ${error.message}`),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,11 +7,11 @@ import { In, Repository } from 'typeorm';
|
||||
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
|
||||
import { isCommandLogger } from 'src/database/commands/logger';
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
@ -26,7 +26,7 @@ import { isFieldMetadataOfType } from 'src/engine/utils/is-field-metadata-of-typ
|
||||
description: 'Migrate relations to field metadata',
|
||||
version: '0.43',
|
||||
})
|
||||
export class MigrateRelationsToFieldMetadataCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class MigrateRelationsToFieldMetadataCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@ -37,9 +37,9 @@ export class MigrateRelationsToFieldMetadataCommand extends ActiveWorkspacesMigr
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesMigrationCommandOptions,
|
||||
options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log('Running command to create many to one relations');
|
||||
|
||||
@ -3,11 +3,11 @@ import { InjectRepository } from '@nestjs/typeorm';
|
||||
import chalk from 'chalk';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import {
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
@ -24,7 +24,7 @@ import { SEARCH_FIELDS_FOR_TASKS } from 'src/modules/task/standard-objects/task.
|
||||
description: 'Migrate search vector on note and task entities',
|
||||
version: '0.43',
|
||||
})
|
||||
export class MigrateSearchVectorOnNoteAndTaskEntitiesCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class MigrateSearchVectorOnNoteAndTaskEntitiesCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@ -40,9 +40,9 @@ export class MigrateSearchVectorOnNoteAndTaskEntitiesCommand extends ActiveWorks
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesMigrationCommandOptions,
|
||||
options: MaintainedWorkspacesMigrationCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log(
|
||||
|
||||
@ -3,7 +3,7 @@ import { InjectRepository } from '@nestjs/typeorm';
|
||||
import chalk from 'chalk';
|
||||
import { In, Repository } from 'typeorm';
|
||||
|
||||
import { BatchActiveWorkspacesMigrationCommandRunner } from 'src/database/commands/migration-command/batch-active-workspaces-migration-command.runner';
|
||||
import { BatchMaintainedWorkspacesMigrationCommandRunner } from 'src/database/commands/migration-command/batch-maintained-workspaces-migration-command.runner';
|
||||
import { MigrationCommand } from 'src/database/commands/migration-command/decorators/migration-command.decorator';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
@ -17,7 +17,7 @@ import { ViewOpenRecordInType } from 'src/modules/view/standard-objects/view.wor
|
||||
'Update default view record opening on workflow objects to record page',
|
||||
version: '0.43',
|
||||
})
|
||||
export class UpdateDefaultViewRecordOpeningOnWorkflowObjectsCommand extends BatchActiveWorkspacesMigrationCommandRunner {
|
||||
export class UpdateDefaultViewRecordOpeningOnWorkflowObjectsCommand extends BatchMaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { MigrationCommandModule } from 'src/database/commands/migration-command/miration-command.module';
|
||||
import { MigrationCommandModule } from 'src/database/commands/migration-command/migration-command.module';
|
||||
import { StandardizationOfActorCompositeContextTypeCommand } from 'src/database/commands/upgrade-version/0-42/0-42-standardization-of-actor-composite-context-type';
|
||||
import { AddTasksAssignedToMeViewCommand } from 'src/database/commands/upgrade-version/0-43/0-43-add-tasks-assigned-to-me-view.command';
|
||||
import { MigrateIsSearchableForCustomObjectMetadataCommand } from 'src/database/commands/upgrade-version/0-43/0-43-migrate-is-searchable-for-custom-object-metadata.command';
|
||||
import { MigrateRelationsToFieldMetadataCommand } from 'src/database/commands/upgrade-version/0-43/0-43-migrate-relations-to-field-metadata.command';
|
||||
import { MigrateSearchVectorOnNoteAndTaskEntitiesCommand } from 'src/database/commands/upgrade-version/0-43/0-43-migrate-search-vector-on-note-and-task-entities.command';
|
||||
import { UpdateDefaultViewRecordOpeningOnWorkflowObjectsCommand } from 'src/database/commands/upgrade-version/0-43/0-43-update-default-view-record-opening-on-workflow-objects.command';
|
||||
@ -33,6 +34,7 @@ import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/wor
|
||||
providers: [
|
||||
AddTasksAssignedToMeViewCommand,
|
||||
MigrateSearchVectorOnNoteAndTaskEntitiesCommand,
|
||||
MigrateIsSearchableForCustomObjectMetadataCommand,
|
||||
UpdateDefaultViewRecordOpeningOnWorkflowObjectsCommand,
|
||||
StandardizationOfActorCompositeContextTypeCommand,
|
||||
MigrateRelationsToFieldMetadataCommand,
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddIsSearchableColumnInObjectMetadataTable1740478150675
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddIsSearchableColumnInObjectMetadataTable1740478150675';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."objectMetadata" ADD "isSearchable" boolean NOT NULL DEFAULT false`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "isSearchable"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,7 @@ export const mockPersonObjectMetadata = (
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isAuditLogged: true,
|
||||
isSearchable: true,
|
||||
duplicateCriteria: duplicateCriteria,
|
||||
fromRelations: [],
|
||||
toRelations: [],
|
||||
|
||||
@ -6,6 +6,7 @@ import { WorkspaceResolverBuilderMethodNames } from 'src/engine/api/graphql/work
|
||||
import { ObjectMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/object-metadata.interface';
|
||||
|
||||
import { FindDuplicatesResolverFactory } from 'src/engine/api/graphql/workspace-resolver-builder/factories/find-duplicates-resolver.factory';
|
||||
import { SearchResolverFactory } from 'src/engine/api/graphql/workspace-resolver-builder/factories/search-resolver-factory';
|
||||
|
||||
@Injectable()
|
||||
export class WorkspaceResolverBuilderService {
|
||||
@ -18,6 +19,8 @@ export class WorkspaceResolverBuilderService {
|
||||
switch (methodName) {
|
||||
case FindDuplicatesResolverFactory.methodName:
|
||||
return isDefined(objectMetadata.duplicateCriteria);
|
||||
case SearchResolverFactory.methodName:
|
||||
return objectMetadata.isSearchable;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -7,22 +7,22 @@ import { Command } from 'nest-commander';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { BillingCustomer } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
|
||||
import { StripeSubscriptionService } from 'src/engine/core-modules/billing/stripe/services/stripe-subscription.service';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
|
||||
interface SyncCustomerDataCommandOptions
|
||||
extends ActiveWorkspacesMigrationCommandOptions {}
|
||||
extends MaintainedWorkspacesMigrationCommandOptions {}
|
||||
|
||||
@Command({
|
||||
name: 'billing:sync-customer-data',
|
||||
description: 'Sync customer data from Stripe for all active workspaces',
|
||||
})
|
||||
export class BillingSyncCustomerDataCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class BillingSyncCustomerDataCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@ -34,7 +34,7 @@ export class BillingSyncCustomerDataCommand extends ActiveWorkspacesMigrationCom
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: SyncCustomerDataCommandOptions,
|
||||
workspaceIds: string[],
|
||||
|
||||
@ -20,6 +20,7 @@ const mockObjectMetadata: ObjectMetadataInterface = {
|
||||
isActive: true,
|
||||
isRemote: false,
|
||||
isAuditLogged: true,
|
||||
isSearchable: true,
|
||||
};
|
||||
|
||||
describe('objectRecordChangedValues', () => {
|
||||
|
||||
@ -18,6 +18,7 @@ export const mockObjectMetadataItemsWithFieldMaps: ObjectMetadataItemWithFieldMa
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isAuditLogged: true,
|
||||
isSearchable: true,
|
||||
fromRelations: [],
|
||||
toRelations: [],
|
||||
labelIdentifierFieldMetadataId: 'nameFieldMetadataId',
|
||||
@ -76,6 +77,7 @@ export const mockObjectMetadataItemsWithFieldMaps: ObjectMetadataItemWithFieldMa
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isAuditLogged: true,
|
||||
isSearchable: true,
|
||||
fromRelations: [],
|
||||
toRelations: [],
|
||||
labelIdentifierFieldMetadataId: 'nameFieldMetadataId',
|
||||
@ -153,6 +155,7 @@ export const mockObjectMetadataItemsWithFieldMaps: ObjectMetadataItemWithFieldMa
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isAuditLogged: true,
|
||||
isSearchable: true,
|
||||
fromRelations: [],
|
||||
toRelations: [],
|
||||
labelIdentifierFieldMetadataId: 'nameFieldMetadataId',
|
||||
@ -230,6 +233,7 @@ export const mockObjectMetadataItemsWithFieldMaps: ObjectMetadataItemWithFieldMa
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isAuditLogged: true,
|
||||
isSearchable: false,
|
||||
fromRelations: [],
|
||||
toRelations: [],
|
||||
labelIdentifierFieldMetadataId: '',
|
||||
|
||||
@ -19,7 +19,7 @@ describe('GlobalSearchService', () => {
|
||||
});
|
||||
|
||||
describe('filterObjectMetadataItems', () => {
|
||||
it('should return searchable object metadata items -- TODO isSearchable only', () => {
|
||||
it('should return searchable object metadata items', () => {
|
||||
const objectMetadataItems = service.filterObjectMetadataItems(
|
||||
mockObjectMetadataItemsWithFieldMaps,
|
||||
[],
|
||||
|
||||
@ -22,20 +22,9 @@ export class GlobalSearchService {
|
||||
excludedObjectNameSingulars: string[] | undefined,
|
||||
) {
|
||||
return objectMetadataItemWithFieldMaps.filter(
|
||||
({ nameSingular, isSystem, isRemote, isCustom }) => {
|
||||
if (excludedObjectNameSingulars?.includes(nameSingular)) {
|
||||
return false;
|
||||
}
|
||||
//TODO - #345 issue - IsSearchable decorator
|
||||
if (isSystem || isRemote) {
|
||||
return false;
|
||||
}
|
||||
|
||||
({ nameSingular, isSearchable }) => {
|
||||
return (
|
||||
isCustom ||
|
||||
['company', 'person', 'opportunity', 'note', 'task'].includes(
|
||||
nameSingular,
|
||||
)
|
||||
!excludedObjectNameSingulars?.includes(nameSingular) && isSearchable
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@ -24,6 +24,7 @@ export interface ObjectMetadataInterface {
|
||||
isActive: boolean;
|
||||
isRemote: boolean;
|
||||
isAuditLogged: boolean;
|
||||
isSearchable: boolean;
|
||||
duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
|
||||
labelIdentifierFieldMetadataId?: string | null;
|
||||
imageIdentifierFieldMetadataId?: string | null;
|
||||
|
||||
@ -69,6 +69,9 @@ export class ObjectMetadataDTO {
|
||||
@FilterableField()
|
||||
isSystem: boolean;
|
||||
|
||||
@FilterableField()
|
||||
isSearchable: boolean;
|
||||
|
||||
@HideField()
|
||||
workspaceId: string;
|
||||
|
||||
|
||||
@ -70,6 +70,9 @@ export class ObjectMetadataEntity implements ObjectMetadataInterface {
|
||||
@Column({ default: true })
|
||||
isAuditLogged: boolean;
|
||||
|
||||
@Column({ default: false })
|
||||
isSearchable: boolean;
|
||||
|
||||
@Column({ type: 'jsonb', nullable: true })
|
||||
duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
|
||||
|
||||
|
||||
@ -120,6 +120,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
isCustom: !objectMetadataInput.isRemote,
|
||||
isSystem: false,
|
||||
isRemote: objectMetadataInput.isRemote,
|
||||
isSearchable: !objectMetadataInput.isRemote,
|
||||
fields: objectMetadataInput.isRemote
|
||||
? []
|
||||
: buildDefaultFieldsForCustomObject(objectMetadataInput.workspaceId),
|
||||
|
||||
@ -37,6 +37,11 @@ export function WorkspaceEntity(
|
||||
'workspace:duplicate-criteria-metadata-args',
|
||||
target,
|
||||
);
|
||||
const isSearchable =
|
||||
TypedReflect.getMetadata(
|
||||
'workspace:is-searchable-metadata-args',
|
||||
target,
|
||||
) ?? false;
|
||||
|
||||
const objectName = convertClassNameToObjectMetadataName(target.name);
|
||||
|
||||
@ -57,6 +62,7 @@ export function WorkspaceEntity(
|
||||
isSystem,
|
||||
gate,
|
||||
duplicateCriteria,
|
||||
isSearchable,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
import { TypedReflect } from 'src/utils/typed-reflect';
|
||||
|
||||
export function WorkspaceIsSearchable() {
|
||||
return function (target: any): void {
|
||||
TypedReflect.defineMetadata(
|
||||
'workspace:is-searchable-metadata-args',
|
||||
true,
|
||||
target,
|
||||
);
|
||||
};
|
||||
}
|
||||
@ -72,4 +72,9 @@ export interface WorkspaceEntityMetadataArgs {
|
||||
* Duplicate criteria.
|
||||
*/
|
||||
readonly duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
|
||||
|
||||
/**
|
||||
* Is searchable object.
|
||||
*/
|
||||
readonly isSearchable: boolean;
|
||||
}
|
||||
|
||||
@ -4,9 +4,9 @@ import { Command, Option } from 'nest-commander';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
ActiveWorkspacesMigrationCommandOptions,
|
||||
ActiveWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/active-workspaces-migration-command.runner';
|
||||
MaintainedWorkspacesMigrationCommandOptions,
|
||||
MaintainedWorkspacesMigrationCommandRunner,
|
||||
} from 'src/database/commands/migration-command/maintained-workspaces-migration-command.runner';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
@ -16,7 +16,7 @@ import { WorkspaceSyncMetadataService } from 'src/engine/workspace-manager/works
|
||||
import { SyncWorkspaceLoggerService } from './services/sync-workspace-logger.service';
|
||||
|
||||
interface RunWorkspaceMigrationsOptions
|
||||
extends ActiveWorkspacesMigrationCommandOptions {
|
||||
extends MaintainedWorkspacesMigrationCommandOptions {
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ interface RunWorkspaceMigrationsOptions
|
||||
name: 'workspace:sync-metadata',
|
||||
description: 'Sync metadata',
|
||||
})
|
||||
export class SyncWorkspaceMetadataCommand extends ActiveWorkspacesMigrationCommandRunner {
|
||||
export class SyncWorkspaceMetadataCommand extends MaintainedWorkspacesMigrationCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@ -37,7 +37,7 @@ export class SyncWorkspaceMetadataCommand extends ActiveWorkspacesMigrationComma
|
||||
super(workspaceRepository, twentyORMGlobalManager);
|
||||
}
|
||||
|
||||
async runMigrationCommandOnActiveWorkspaces(
|
||||
async runMigrationCommandOnMaintainedWorkspaces(
|
||||
_passedParam: string[],
|
||||
options: RunWorkspaceMigrationsOptions,
|
||||
workspaceIds: string[],
|
||||
|
||||
@ -20,6 +20,7 @@ import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-
|
||||
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
|
||||
import { WorkspaceIsDeprecated } from 'src/engine/twenty-orm/decorators/workspace-is-deprecated.decorator';
|
||||
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
||||
import { WorkspaceIsSearchable } from 'src/engine/twenty-orm/decorators/workspace-is-searchable.decorator';
|
||||
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
||||
import { WorkspaceIsUnique } from 'src/engine/twenty-orm/decorators/workspace-is-unique.decorator';
|
||||
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
|
||||
@ -59,6 +60,7 @@ export const SEARCH_FIELDS_FOR_COMPANY: FieldTypeAndNameMetadata[] = [
|
||||
labelIdentifierStandardId: COMPANY_STANDARD_FIELD_IDS.name,
|
||||
})
|
||||
@WorkspaceDuplicateCriteria([['name'], ['domainNamePrimaryLinkUrl']])
|
||||
@WorkspaceIsSearchable()
|
||||
export class CompanyWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: COMPANY_STANDARD_FIELD_IDS.name,
|
||||
|
||||
@ -16,6 +16,7 @@ import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-enti
|
||||
import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-field-index.decorator';
|
||||
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
|
||||
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
||||
import { WorkspaceIsSearchable } from 'src/engine/twenty-orm/decorators/workspace-is-searchable.decorator';
|
||||
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
||||
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
|
||||
import { NOTE_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||
@ -48,6 +49,7 @@ export const SEARCH_FIELDS_FOR_NOTES: FieldTypeAndNameMetadata[] = [
|
||||
shortcut: 'N',
|
||||
labelIdentifierStandardId: NOTE_STANDARD_FIELD_IDS.title,
|
||||
})
|
||||
@WorkspaceIsSearchable()
|
||||
export class NoteWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: NOTE_STANDARD_FIELD_IDS.position,
|
||||
|
||||
@ -18,6 +18,7 @@ import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field
|
||||
import { WorkspaceIsDeprecated } from 'src/engine/twenty-orm/decorators/workspace-is-deprecated.decorator';
|
||||
import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator';
|
||||
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
||||
import { WorkspaceIsSearchable } from 'src/engine/twenty-orm/decorators/workspace-is-searchable.decorator';
|
||||
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
||||
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
|
||||
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
|
||||
@ -53,6 +54,7 @@ export const SEARCH_FIELDS_FOR_OPPORTUNITY: FieldTypeAndNameMetadata[] = [
|
||||
labelIdentifierStandardId: OPPORTUNITY_STANDARD_FIELD_IDS.name,
|
||||
})
|
||||
@WorkspaceIsNotAuditLogged()
|
||||
@WorkspaceIsSearchable()
|
||||
export class OpportunityWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: OPPORTUNITY_STANDARD_FIELD_IDS.name,
|
||||
|
||||
@ -21,6 +21,7 @@ import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-
|
||||
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
|
||||
import { WorkspaceIsDeprecated } from 'src/engine/twenty-orm/decorators/workspace-is-deprecated.decorator';
|
||||
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
||||
import { WorkspaceIsSearchable } from 'src/engine/twenty-orm/decorators/workspace-is-searchable.decorator';
|
||||
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
||||
import { WorkspaceIsUnique } from 'src/engine/twenty-orm/decorators/workspace-is-unique.decorator';
|
||||
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
|
||||
@ -68,6 +69,7 @@ export const SEARCH_FIELDS_FOR_PERSON: FieldTypeAndNameMetadata[] = [
|
||||
['linkedinLinkPrimaryLinkUrl'],
|
||||
['emailsPrimaryEmail'],
|
||||
])
|
||||
@WorkspaceIsSearchable()
|
||||
export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: PERSON_STANDARD_FIELD_IDS.name,
|
||||
|
||||
@ -16,6 +16,7 @@ import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-enti
|
||||
import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-field-index.decorator';
|
||||
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
|
||||
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
|
||||
import { WorkspaceIsSearchable } from 'src/engine/twenty-orm/decorators/workspace-is-searchable.decorator';
|
||||
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
|
||||
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
|
||||
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
|
||||
@ -51,6 +52,7 @@ export const SEARCH_FIELDS_FOR_TASKS: FieldTypeAndNameMetadata[] = [
|
||||
shortcut: 'T',
|
||||
labelIdentifierStandardId: TASK_STANDARD_FIELD_IDS.title,
|
||||
})
|
||||
@WorkspaceIsSearchable()
|
||||
export class TaskWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceField({
|
||||
standardId: TASK_STANDARD_FIELD_IDS.position,
|
||||
|
||||
@ -15,6 +15,7 @@ export interface ReflectMetadataTypeMap {
|
||||
['workspace:is-unique-metadata-args']: true;
|
||||
['workspace:duplicate-criteria-metadata-args']: WorkspaceEntityDuplicateCriteria[];
|
||||
['environment-variables']: EnvironmentVariablesMetadataMap;
|
||||
['workspace:is-searchable-metadata-args']: boolean;
|
||||
}
|
||||
|
||||
export class TypedReflect {
|
||||
|
||||
Reference in New Issue
Block a user