From 685d342170f240b6da084e183bd0aaa2fbe74fa9 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Sat, 28 Oct 2023 19:13:48 +0200 Subject: [PATCH] Migrate view field to new data model - Part 2 (#2270) * Migrate view field to new data model * Migrate view fields to new model --- front/src/generated-metadata/gql.ts | 4 +- front/src/generated-metadata/graphql.ts | 71 +- front/src/generated/graphql.tsx | 1263 +---------------- .../ActivityAssigneeEditableField.tsx | 4 +- .../components/ActivityEditorDateField.tsx | 4 +- .../tasks/hooks/useCurrentUserDueTaskCount.ts | 7 +- .../companies/__stories__/mock-data.ts | 10 +- .../companies/components/CompanyBoardCard.tsx | 8 +- .../companiesAvailableFieldDefinitions.tsx | 72 +- .../hooks/useUpdateCompanyBoardColumns.ts | 6 +- .../table/components/CompanyTable.tsx | 33 +- .../table/components/CompanyTableEffect.tsx | 66 +- .../components/MetadataObjectNavItems.tsx | 40 +- .../metadata/components/ObjectShowPage.tsx | 2 +- .../metadata/components/ObjectTable.tsx | 28 +- .../metadata/components/ObjectTableEffect.tsx | 4 +- .../hooks/useCreateNewTempCustomObject.ts | 208 --- .../hooks/useFindManyMetadataObjects.ts | 9 +- .../metadata/hooks/useFindManyObjects.ts | 7 +- .../hooks/useFindOneMetadataObject.ts | 14 +- .../metadata/hooks/useUpdateOneObject.ts | 29 +- .../formatMetadataFieldAsColumnDefinition.ts | 10 +- .../peopleAvailableFieldDefinitions.tsx | 54 +- .../people/table/components/PeopleTable.tsx | 10 +- .../table/components/PersonTableEffect.tsx | 59 +- .../pipelineAvailableFieldDefinitions.tsx | 24 +- .../pipeline/graphql/queries/getPipelines.ts | 2 +- .../pipeline/hooks/usePipelineStages.ts | 2 +- .../data/data-table/components/ColumnHead.tsx | 2 +- .../components/ColumnHeadWithDropdown.tsx | 4 +- .../data-table/components/DataTableCell.tsx | 2 +- .../DataTableColumnDropdownMenu.tsx | 2 +- .../data-table/components/DataTableEffect.tsx | 2 - .../data-table/components/DataTableHeader.tsx | 28 +- .../DataTableHeaderPlusButtonContent.tsx | 4 +- .../data-table/components/DataTableRow.tsx | 4 +- .../data-table/hooks/useMoveViewColumns.ts | 12 +- .../data/data-table/hooks/useTableColumns.ts | 51 +- .../TableOptionsDropdownContent.tsx | 12 +- .../hiddenTableColumnsScopedSelector.ts | 4 +- .../savedTableColumnsByKeyFamilySelector.ts | 2 +- .../tableColumnsByKeyScopedSelector.ts | 2 +- .../visibleTableColumnsScopedSelector.ts | 8 +- .../data/data-table/types/ColumnDefinition.ts | 3 +- .../ui/data/field/hooks/useIsFieldEmpty.ts | 4 +- .../__stories__/DateFieldDisplay.stories.tsx | 4 +- .../DoubleTextFieldDisplay.stories.tsx | 4 +- .../__stories__/EmailFieldDisplay.stories.tsx | 4 +- .../__stories__/MoneyFieldDisplay.stories.tsx | 4 +- .../NumberFieldDisplay.stories.tsx | 4 +- .../__stories__/PhoneFieldDisplay.stories.tsx | 4 +- .../__stories__/TextFieldDisplay.stories.tsx | 4 +- .../__stories__/URLFieldDisplay.stories.tsx | 4 +- .../__stories__/BooleanFieldInput.stories.tsx | 4 +- .../__stories__/ChipFieldInput.stories.tsx | 4 +- .../__stories__/DateFieldInput.stories.tsx | 4 +- .../DoubleTextChipFieldInput.stories.tsx | 4 +- .../DoubleTextFieldInput.stories.tsx | 4 +- .../__stories__/EmailFieldInput.stories.tsx | 4 +- .../__stories__/MoneyFieldInput.stories.tsx | 4 +- .../__stories__/NumberFieldInput.stories.tsx | 4 +- .../__stories__/PhoneFieldInput.stories.tsx | 4 +- .../ProbabilityFieldInput.stories.tsx | 4 +- .../RelationFieldInput.stories.tsx | 4 +- .../__stories__/TextFieldInput.stories.tsx | 4 +- .../__stories__/URLFieldInput.stories.tsx | 4 +- .../isEntityFieldEmptyFamilySelector.ts | 2 +- .../ui/data/field/types/FieldDefinition.ts | 4 +- .../FilterDropdownEntitySearchSelect.tsx | 2 +- .../FilterDropdownOperandSelect.tsx | 2 +- .../SingleEntityFilterDropdownButton.tsx | 2 +- .../selectedOperandInDropdownScopedState.ts | 2 +- .../modules/ui/data/filter/types/Filter.ts | 2 +- .../ui/data/filter/types/FilterOperand.ts | 2 +- .../ui/data/filter/utils/getOperandLabel.ts | 2 +- .../filter/utils/getOperandsForFilterType.ts | 2 +- .../filter/utils/turnFilterIntoWhereClause.ts | 3 +- .../BoardOptionsDropdownContent.tsx | 4 +- .../layout/board/components/EntityBoard.tsx | 7 +- .../layout/board/hooks/useBoardCardFields.ts | 9 +- .../ui/layout/board/hooks/useBoardColumns.ts | 2 +- .../boardCardFieldsByKeyScopedSelector.ts | 2 +- .../hiddenBoardCardFieldsScopedSelector.ts | 4 +- ...savedBoardCardFieldsByKeyFamilySelector.ts | 2 +- .../board/types/BoardColumnDefinition.ts | 2 +- .../board/types/BoardFieldDefinition.ts | 2 +- .../views/components/ViewBarEffect.tsx | 217 ++- .../ViewFieldsVisibilityDropdownSection.tsx | 31 +- .../graphql/fragments/viewFieldFragment.ts | 12 - .../views/graphql/mutations/createView.ts | 10 - .../graphql/mutations/createViewFields.ts | 9 - .../graphql/mutations/createViewFilters.ts | 9 - .../graphql/mutations/createViewSorts.ts | 9 - .../views/graphql/mutations/deleteView.ts | 10 - .../graphql/mutations/deleteViewFilters.ts | 9 - .../graphql/mutations/deleteViewSorts.ts | 9 - .../views/graphql/mutations/updateView.ts | 10 - .../graphql/mutations/updateViewField.ts | 12 - .../graphql/mutations/updateViewFilter.ts | 16 - .../views/graphql/mutations/updateViewSort.ts | 14 - .../views/graphql/queries/getViewFields.ts | 12 - .../views/graphql/queries/getViewFilters.ts | 13 - .../views/graphql/queries/getViewSorts.ts | 11 - .../modules/views/graphql/queries/getViews.ts | 10 - .../views/hooks/internal/useViewFields.ts | 94 +- .../views/hooks/internal/useViewFilters.ts | 98 +- .../views/hooks/internal/useViewSorts.ts | 86 +- .../modules/views/hooks/internal/useViews.ts | 60 +- front/src/modules/views/hooks/useView.ts | 20 +- .../src/modules/views/hooks/useViewStates.ts | 18 +- front/src/modules/views/scopes/ViewScope.tsx | 8 +- .../init-effect/ViewScopeInitEffect.tsx | 13 +- .../currentViewFieldsScopedFamilyState.ts | 6 +- .../states/onViewFieldsChangeScopedState.ts | 7 +- .../savedViewFieldsScopedFamilyState.ts | 6 +- ...savedViewFieldByKeyScopedFamilySelector.ts | 7 +- .../views/states/viewTypeScopedState.ts | 3 +- front/src/modules/views/types/ViewField.ts | 2 - .../views/types/ViewFieldForVisibility.ts | 11 - .../modules/views/types/ViewFilterOperand.ts | 9 + .../modules/views/types/ViewSortDirection.ts | 4 + front/src/modules/views/types/ViewType.ts | 4 + .../utils/columnDefinitionToViewField.ts | 16 + .../utils/viewFieldsToColumnDefinitions.ts | 36 + front/src/pages/companies/CompanyShow.tsx | 4 +- .../constants/companyShowFieldDefinition.tsx | 28 +- front/src/pages/people/PersonShow.tsx | 4 +- .../constants/personShowFieldDefinition.tsx | 32 +- front/src/pages/tasks/TasksEffect.tsx | 2 +- front/src/testing/graphqlMocks.ts | 53 +- front/src/testing/mock-data/companies.ts | 57 +- front/src/testing/mock-data/people.ts | 39 +- front/src/testing/mock-data/pipelines.ts | 12 +- server/src/ability/ability.factory.ts | 32 +- server/src/ability/ability.module.ts | 63 +- .../handlers/view-field.ability-handler.ts | 87 -- .../handlers/view-filter.ability-handler.ts | 122 -- .../handlers/view-sort.ability-handler.ts | 122 -- .../ability/handlers/view.ability-handler.ts | 95 -- server/src/core/core.module.ts | 2 - .../resolvers/pipeline-stage.resolver.ts | 6 +- .../resolvers/view-field.resolver.spec.ts | 32 - .../view/resolvers/view-field.resolver.ts | 108 -- .../view/resolvers/view-filter.resolver.ts | 102 -- .../view/resolvers/view-sort.resolver.spec.ts | 32 - .../core/view/resolvers/view-sort.resolver.ts | 102 -- .../src/core/view/resolvers/view.resolver.ts | 194 --- server/src/core/view/seed-data/views.json | 124 -- .../view/services/view-field.service.spec.ts | 28 - .../core/view/services/view-field.service.ts | 39 - .../core/view/services/view-filter.service.ts | 39 - .../view/services/view-sort.service.spec.ts | 28 - .../core/view/services/view-sort.service.ts | 39 - server/src/core/view/services/view.service.ts | 68 - server/src/core/view/view.module.ts | 29 - .../services/workspace.service.spec.ts | 5 - .../workspace/services/workspace.service.ts | 11 - server/src/core/workspace/workspace.module.ts | 2 - .../migration.sql | 52 + server/src/database/schema.prisma | 117 +- server/src/database/seeds/index.ts | 2 - server/src/database/seeds/pipelines.ts | 22 +- server/src/database/seeds/views.ts | 201 --- .../view-fields/view-fields.metadata.json | 11 - .../view-fields/view-fields.seeds.json | 90 +- .../standard-objects/views/views.seeds.json | 12 +- .../1697618012-addViewFieldTable.ts | 5 - .../utils/prisma-select/model-select-map.ts | 4 - 168 files changed, 960 insertions(+), 4568 deletions(-) delete mode 100644 front/src/modules/metadata/hooks/useCreateNewTempCustomObject.ts delete mode 100644 front/src/modules/views/graphql/fragments/viewFieldFragment.ts delete mode 100644 front/src/modules/views/graphql/mutations/createView.ts delete mode 100644 front/src/modules/views/graphql/mutations/createViewFields.ts delete mode 100644 front/src/modules/views/graphql/mutations/createViewFilters.ts delete mode 100644 front/src/modules/views/graphql/mutations/createViewSorts.ts delete mode 100644 front/src/modules/views/graphql/mutations/deleteView.ts delete mode 100644 front/src/modules/views/graphql/mutations/deleteViewFilters.ts delete mode 100644 front/src/modules/views/graphql/mutations/deleteViewSorts.ts delete mode 100644 front/src/modules/views/graphql/mutations/updateView.ts delete mode 100644 front/src/modules/views/graphql/mutations/updateViewField.ts delete mode 100644 front/src/modules/views/graphql/mutations/updateViewFilter.ts delete mode 100644 front/src/modules/views/graphql/mutations/updateViewSort.ts delete mode 100644 front/src/modules/views/graphql/queries/getViewFields.ts delete mode 100644 front/src/modules/views/graphql/queries/getViewFilters.ts delete mode 100644 front/src/modules/views/graphql/queries/getViewSorts.ts delete mode 100644 front/src/modules/views/graphql/queries/getViews.ts delete mode 100644 front/src/modules/views/types/ViewFieldForVisibility.ts create mode 100644 front/src/modules/views/types/ViewFilterOperand.ts create mode 100644 front/src/modules/views/types/ViewSortDirection.ts create mode 100644 front/src/modules/views/types/ViewType.ts create mode 100644 front/src/modules/views/utils/columnDefinitionToViewField.ts create mode 100644 front/src/modules/views/utils/viewFieldsToColumnDefinitions.ts delete mode 100644 server/src/ability/handlers/view-field.ability-handler.ts delete mode 100644 server/src/ability/handlers/view-filter.ability-handler.ts delete mode 100644 server/src/ability/handlers/view-sort.ability-handler.ts delete mode 100644 server/src/ability/handlers/view.ability-handler.ts delete mode 100644 server/src/core/view/resolvers/view-field.resolver.spec.ts delete mode 100644 server/src/core/view/resolvers/view-field.resolver.ts delete mode 100644 server/src/core/view/resolvers/view-filter.resolver.ts delete mode 100644 server/src/core/view/resolvers/view-sort.resolver.spec.ts delete mode 100644 server/src/core/view/resolvers/view-sort.resolver.ts delete mode 100644 server/src/core/view/resolvers/view.resolver.ts delete mode 100644 server/src/core/view/seed-data/views.json delete mode 100644 server/src/core/view/services/view-field.service.spec.ts delete mode 100644 server/src/core/view/services/view-field.service.ts delete mode 100644 server/src/core/view/services/view-filter.service.ts delete mode 100644 server/src/core/view/services/view-sort.service.spec.ts delete mode 100644 server/src/core/view/services/view-sort.service.ts delete mode 100644 server/src/core/view/services/view.service.ts delete mode 100644 server/src/core/view/view.module.ts create mode 100644 server/src/database/migrations/20231028153754_refactor_views_positions/migration.sql delete mode 100644 server/src/database/seeds/views.ts diff --git a/front/src/generated-metadata/gql.ts b/front/src/generated-metadata/gql.ts index 87e608cc6..fc139c467 100644 --- a/front/src/generated-metadata/gql.ts +++ b/front/src/generated-metadata/gql.ts @@ -19,7 +19,7 @@ const documents = { "\n mutation UpdateOneMetadataObject(\n $idToUpdate: ID!\n $updatePayload: UpdateObjectInput!\n ) {\n updateOneObject(input: { id: $idToUpdate, update: $updatePayload }) {\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 }\n }\n": types.UpdateOneMetadataObjectDocument, "\n mutation DeleteOneMetadataObject($idToDelete: ID!) {\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 }\n }\n": types.DeleteOneMetadataObjectDocument, "\n mutation DeleteOneMetadataField($idToDelete: ID!) {\n deleteOneField(input: { id: $idToDelete }) {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n": types.DeleteOneMetadataFieldDocument, - "\n query MetadataObjects {\n objects(paging: { first: 100 }) {\n edges {\n node {\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 fields(paging: { first: 100 }) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n": types.MetadataObjectsDocument, + "\n query MetadataObjects {\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 isActive\n createdAt\n updatedAt\n fields(paging: { first: 1000 }) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n": types.MetadataObjectsDocument, }; /** @@ -63,7 +63,7 @@ export function graphql(source: "\n mutation DeleteOneMetadataField($idToDelete /** * 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 MetadataObjects {\n objects(paging: { first: 100 }) {\n edges {\n node {\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 fields(paging: { first: 100 }) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n"): (typeof documents)["\n query MetadataObjects {\n objects(paging: { first: 100 }) {\n edges {\n node {\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 fields(paging: { first: 100 }) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n"]; +export function graphql(source: "\n query MetadataObjects {\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 isActive\n createdAt\n updatedAt\n fields(paging: { first: 1000 }) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n"): (typeof documents)["\n query MetadataObjects {\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 isActive\n createdAt\n updatedAt\n fields(paging: { first: 1000 }) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/front/src/generated-metadata/graphql.ts b/front/src/generated-metadata/graphql.ts index 0b730b809..c7672dcff 100644 --- a/front/src/generated-metadata/graphql.ts +++ b/front/src/generated-metadata/graphql.ts @@ -582,11 +582,11 @@ export type PipelineStage = { color: Scalars['String']['output']; createdAt: Scalars['DateTime']['output']; id: Scalars['ID']['output']; - index?: Maybe; name: Scalars['String']['output']; pipeline: Pipeline; pipelineId: Scalars['String']['output']; pipelineProgresses?: Maybe>; + position?: Maybe; type: Scalars['String']['output']; updatedAt: Scalars['DateTime']['output']; }; @@ -700,69 +700,6 @@ export type UserSettings = { user?: Maybe; }; -export type View = { - __typename?: 'View'; - fields?: Maybe>; - filters?: Maybe>; - id: Scalars['ID']['output']; - name: Scalars['String']['output']; - objectId: Scalars['String']['output']; - sorts?: Maybe>; - type: ViewType; -}; - -export type ViewField = { - __typename?: 'ViewField'; - index: Scalars['Float']['output']; - isVisible: Scalars['Boolean']['output']; - key: Scalars['String']['output']; - name: Scalars['String']['output']; - objectId: Scalars['String']['output']; - size?: Maybe; - view: View; - viewId: Scalars['String']['output']; -}; - -export type ViewFilter = { - __typename?: 'ViewFilter'; - displayValue: Scalars['String']['output']; - key: Scalars['String']['output']; - name: Scalars['String']['output']; - operand: ViewFilterOperand; - value: Scalars['String']['output']; - view: View; - viewId: Scalars['String']['output']; -}; - -export enum ViewFilterOperand { - Contains = 'Contains', - DoesNotContain = 'DoesNotContain', - GreaterThan = 'GreaterThan', - Is = 'Is', - IsNot = 'IsNot', - IsNotNull = 'IsNotNull', - LessThan = 'LessThan' -} - -export type ViewSort = { - __typename?: 'ViewSort'; - direction: ViewSortDirection; - key: Scalars['String']['output']; - name: Scalars['String']['output']; - view: View; - viewId: Scalars['String']['output']; -}; - -export enum ViewSortDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum ViewType { - Pipeline = 'Pipeline', - Table = 'Table' -} - export type WebHook = { __typename?: 'WebHook'; createdAt: Scalars['DateTime']['output']; @@ -791,10 +728,6 @@ export type Workspace = { pipelineStages?: Maybe>; pipelines?: Maybe>; updatedAt: Scalars['DateTime']['output']; - viewFields?: Maybe>; - viewFilters?: Maybe>; - viewSorts?: Maybe>; - views?: Maybe>; webHooks?: Maybe>; workspaceMember?: Maybe>; }; @@ -929,4 +862,4 @@ export const UpdateOneMetadataFieldDocument = {"kind":"Document","definitions":[ export const UpdateOneMetadataObjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOneMetadataObject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idToUpdate"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"updatePayload"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateObjectInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOneObject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idToUpdate"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"update"},"value":{"kind":"Variable","name":{"kind":"Name","value":"updatePayload"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode; export const DeleteOneMetadataObjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteOneMetadataObject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteOneObject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode; export const DeleteOneMetadataFieldDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteOneMetadataField"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteOneField"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"placeholder"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode; -export const MetadataObjectsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MetadataObjects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"placeholder"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const MetadataObjectsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MetadataObjects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1000"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1000"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"placeholder"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx index 934512a4d..bf31c91ee 100644 --- a/front/src/generated/graphql.tsx +++ b/front/src/generated/graphql.tsx @@ -1208,27 +1208,6 @@ export type EnumPipelineProgressableTypeFilter = { notIn?: InputMaybe>; }; -export type EnumViewFilterOperandFilter = { - equals?: InputMaybe; - in?: InputMaybe>; - not?: InputMaybe; - notIn?: InputMaybe>; -}; - -export type EnumViewSortDirectionFilter = { - equals?: InputMaybe; - in?: InputMaybe>; - not?: InputMaybe; - notIn?: InputMaybe>; -}; - -export type EnumViewTypeFilter = { - equals?: InputMaybe; - in?: InputMaybe>; - not?: InputMaybe; - notIn?: InputMaybe>; -}; - export type Favorite = { __typename?: 'Favorite'; company?: Maybe; @@ -1397,10 +1376,6 @@ export type Mutation = { createFavoriteForPerson: Favorite; createManyCompany: AffectedRows; createManyPerson: AffectedRows; - createManyView: AffectedRows; - createManyViewField: AffectedRows; - createManyViewFilter: AffectedRows; - createManyViewSort: AffectedRows; createOneActivity: Activity; createOneApiKey: ApiKeyToken; createOneComment: Comment; @@ -1410,8 +1385,6 @@ export type Mutation = { createOnePerson: Person; createOnePipelineProgress: PipelineProgress; createOnePipelineStage: PipelineStage; - createOneView: View; - createOneViewField: ViewField; createOneWebHook: WebHook; deleteCurrentWorkspace: Workspace; deleteFavorite: Favorite; @@ -1419,13 +1392,9 @@ export type Mutation = { deleteManyCompany: AffectedRows; deleteManyPerson: AffectedRows; deleteManyPipelineProgress: AffectedRows; - deleteManyView: AffectedRows; - deleteManyViewFilter: AffectedRows; - deleteManyViewSort: AffectedRows; deleteOneField: FieldDeleteResponse; deleteOneObject: ObjectDeleteResponse; deleteOnePipelineStage: PipelineStage; - deleteOneView: View; deleteOneWebHook: WebHook; deleteUserAccount: User; deleteWorkspaceMember: WorkspaceMember; @@ -1441,10 +1410,6 @@ export type Mutation = { updateOnePerson?: Maybe; updateOnePipelineProgress?: Maybe; updateOnePipelineStage?: Maybe; - updateOneView: View; - updateOneViewField: ViewField; - updateOneViewFilter: ViewFilter; - updateOneViewSort: ViewSort; updateUser: User; updateWorkspace: Workspace; uploadAttachment: Scalars['String']; @@ -1502,30 +1467,6 @@ export type MutationCreateManyPersonArgs = { }; -export type MutationCreateManyViewArgs = { - data: Array; - skipDuplicates?: InputMaybe; -}; - - -export type MutationCreateManyViewFieldArgs = { - data: Array; - skipDuplicates?: InputMaybe; -}; - - -export type MutationCreateManyViewFilterArgs = { - data: Array; - skipDuplicates?: InputMaybe; -}; - - -export type MutationCreateManyViewSortArgs = { - data: Array; - skipDuplicates?: InputMaybe; -}; - - export type MutationCreateOneActivityArgs = { data: ActivityCreateInput; }; @@ -1561,16 +1502,6 @@ export type MutationCreateOnePipelineStageArgs = { }; -export type MutationCreateOneViewArgs = { - data: ViewCreateInput; -}; - - -export type MutationCreateOneViewFieldArgs = { - data: ViewFieldCreateInput; -}; - - export type MutationCreateOneWebHookArgs = { data: WebHookCreateInput; }; @@ -1601,31 +1532,11 @@ export type MutationDeleteManyPipelineProgressArgs = { }; -export type MutationDeleteManyViewArgs = { - where?: InputMaybe; -}; - - -export type MutationDeleteManyViewFilterArgs = { - where?: InputMaybe; -}; - - -export type MutationDeleteManyViewSortArgs = { - where?: InputMaybe; -}; - - export type MutationDeleteOnePipelineStageArgs = { where: PipelineStageWhereUniqueInput; }; -export type MutationDeleteOneViewArgs = { - where: ViewWhereUniqueInput; -}; - - export type MutationDeleteOneWebHookArgs = { where: WebHookWhereUniqueInput; }; @@ -1694,30 +1605,6 @@ export type MutationUpdateOnePipelineStageArgs = { }; -export type MutationUpdateOneViewArgs = { - data: ViewUpdateInput; - where: ViewWhereUniqueInput; -}; - - -export type MutationUpdateOneViewFieldArgs = { - data: ViewFieldUpdateInput; - where: ViewFieldWhereUniqueInput; -}; - - -export type MutationUpdateOneViewFilterArgs = { - data: ViewFilterUpdateInput; - where: ViewFilterWhereUniqueInput; -}; - - -export type MutationUpdateOneViewSortArgs = { - data: ViewSortUpdateInput; - where: ViewSortWhereUniqueInput; -}; - - export type MutationUpdateUserArgs = { data: UserUpdateInput; where: UserWhereUniqueInput; @@ -1831,27 +1718,6 @@ export type NestedEnumPipelineProgressableTypeFilter = { notIn?: InputMaybe>; }; -export type NestedEnumViewFilterOperandFilter = { - equals?: InputMaybe; - in?: InputMaybe>; - not?: InputMaybe; - notIn?: InputMaybe>; -}; - -export type NestedEnumViewSortDirectionFilter = { - equals?: InputMaybe; - in?: InputMaybe>; - not?: InputMaybe; - notIn?: InputMaybe>; -}; - -export type NestedEnumViewTypeFilter = { - equals?: InputMaybe; - in?: InputMaybe>; - not?: InputMaybe; - notIn?: InputMaybe>; -}; - export type NestedFloatFilter = { equals?: InputMaybe; gt?: InputMaybe; @@ -2382,11 +2248,11 @@ export type PipelineStage = { color: Scalars['String']; createdAt: Scalars['DateTime']; id: Scalars['ID']; - index?: Maybe; name: Scalars['String']; pipeline: Pipeline; pipelineId: Scalars['String']; pipelineProgresses?: Maybe>; + position?: Maybe; type: Scalars['String']; updatedAt: Scalars['DateTime']; }; @@ -2395,10 +2261,10 @@ export type PipelineStageCreateInput = { color: Scalars['String']; createdAt?: InputMaybe; id?: InputMaybe; - index?: InputMaybe; name: Scalars['String']; pipeline: PipelineCreateNestedOneWithoutPipelineStagesInput; pipelineProgresses?: InputMaybe; + position?: InputMaybe; type: Scalars['String']; updatedAt?: InputMaybe; }; @@ -2421,11 +2287,11 @@ export type PipelineStageOrderByWithRelationInput = { color?: InputMaybe; createdAt?: InputMaybe; id?: InputMaybe; - index?: InputMaybe; name?: InputMaybe; pipeline?: InputMaybe; pipelineId?: InputMaybe; pipelineProgresses?: InputMaybe; + position?: InputMaybe; type?: InputMaybe; updatedAt?: InputMaybe; }; @@ -2440,9 +2306,9 @@ export enum PipelineStageScalarFieldEnum { CreatedAt = 'createdAt', DeletedAt = 'deletedAt', Id = 'id', - Index = 'index', Name = 'name', PipelineId = 'pipelineId', + Position = 'position', Type = 'type', UpdatedAt = 'updatedAt', WorkspaceId = 'workspaceId' @@ -2452,10 +2318,10 @@ export type PipelineStageUpdateInput = { color?: InputMaybe; createdAt?: InputMaybe; id?: InputMaybe; - index?: InputMaybe; name?: InputMaybe; pipeline?: InputMaybe; pipelineProgresses?: InputMaybe; + position?: InputMaybe; type?: InputMaybe; updatedAt?: InputMaybe; }; @@ -2477,11 +2343,11 @@ export type PipelineStageWhereInput = { color?: InputMaybe; createdAt?: InputMaybe; id?: InputMaybe; - index?: InputMaybe; name?: InputMaybe; pipeline?: InputMaybe; pipelineId?: InputMaybe; pipelineProgresses?: InputMaybe; + position?: InputMaybe; type?: InputMaybe; updatedAt?: InputMaybe; }; @@ -2541,10 +2407,6 @@ export type Query = { findManyPipelineProgress: Array; findManyPipelineStage: Array; findManyUser: Array; - findManyView: Array; - findManyViewField: Array; - findManyViewFilter: Array; - findManyViewSort: Array; findManyWebHook: Array; findManyWorkspaceMember: Array; findUniqueCompany: Company; @@ -2645,46 +2507,6 @@ export type QueryFindManyUserArgs = { }; -export type QueryFindManyViewArgs = { - cursor?: InputMaybe; - distinct?: InputMaybe>; - orderBy?: InputMaybe>; - skip?: InputMaybe; - take?: InputMaybe; - where?: InputMaybe; -}; - - -export type QueryFindManyViewFieldArgs = { - cursor?: InputMaybe; - distinct?: InputMaybe>; - orderBy?: InputMaybe>; - skip?: InputMaybe; - take?: InputMaybe; - where?: InputMaybe; -}; - - -export type QueryFindManyViewFilterArgs = { - cursor?: InputMaybe; - distinct?: InputMaybe>; - orderBy?: InputMaybe>; - skip?: InputMaybe; - take?: InputMaybe; - where?: InputMaybe; -}; - - -export type QueryFindManyViewSortArgs = { - cursor?: InputMaybe; - distinct?: InputMaybe>; - orderBy?: InputMaybe>; - skip?: InputMaybe; - take?: InputMaybe; - where?: InputMaybe; -}; - - export type QueryFindManyWebHookArgs = { cursor?: InputMaybe; distinct?: InputMaybe>; @@ -3010,421 +2832,6 @@ export type Verify = { user: User; }; -export type View = { - __typename?: 'View'; - fields?: Maybe>; - filters?: Maybe>; - id: Scalars['ID']; - name: Scalars['String']; - objectId: Scalars['String']; - sorts?: Maybe>; - type: ViewType; -}; - -export type ViewCreateInput = { - fields?: InputMaybe; - filters?: InputMaybe; - id?: InputMaybe; - name: Scalars['String']; - objectId: Scalars['String']; - sorts?: InputMaybe; - type: ViewType; -}; - -export type ViewCreateManyInput = { - id?: InputMaybe; - name: Scalars['String']; - objectId: Scalars['String']; - type: ViewType; -}; - -export type ViewCreateNestedOneWithoutFieldsInput = { - connect?: InputMaybe; -}; - -export type ViewField = { - __typename?: 'ViewField'; - index: Scalars['Float']; - isVisible: Scalars['Boolean']; - key: Scalars['String']; - name: Scalars['String']; - objectId: Scalars['String']; - size?: Maybe; - view: View; - viewId: Scalars['String']; -}; - -export type ViewFieldCreateInput = { - index: Scalars['Float']; - isVisible: Scalars['Boolean']; - key: Scalars['String']; - name: Scalars['String']; - objectId: Scalars['String']; - size?: InputMaybe; - view: ViewCreateNestedOneWithoutFieldsInput; -}; - -export type ViewFieldCreateManyInput = { - index: Scalars['Float']; - isVisible: Scalars['Boolean']; - key: Scalars['String']; - name: Scalars['String']; - objectId: Scalars['String']; - size?: InputMaybe; - viewId: Scalars['String']; -}; - -export type ViewFieldCreateNestedManyWithoutViewInput = { - connect?: InputMaybe>; -}; - -export type ViewFieldListRelationFilter = { - every?: InputMaybe; - none?: InputMaybe; - some?: InputMaybe; -}; - -export type ViewFieldOrderByRelationAggregateInput = { - _count?: InputMaybe; -}; - -export type ViewFieldOrderByWithRelationInput = { - index?: InputMaybe; - isVisible?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - objectId?: InputMaybe; - size?: InputMaybe; - view?: InputMaybe; - viewId?: InputMaybe; -}; - -export enum ViewFieldScalarFieldEnum { - Index = 'index', - IsVisible = 'isVisible', - Key = 'key', - Name = 'name', - ObjectId = 'objectId', - Size = 'size', - ViewId = 'viewId', - WorkspaceId = 'workspaceId' -} - -export type ViewFieldUpdateInput = { - index?: InputMaybe; - isVisible?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - objectId?: InputMaybe; - size?: InputMaybe; - view?: InputMaybe; -}; - -export type ViewFieldUpdateManyWithoutViewNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewFieldUpdateManyWithoutWorkspaceNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewFieldViewIdKeyCompoundUniqueInput = { - key: Scalars['String']; - viewId: Scalars['String']; -}; - -export type ViewFieldWhereInput = { - AND?: InputMaybe>; - NOT?: InputMaybe>; - OR?: InputMaybe>; - index?: InputMaybe; - isVisible?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - objectId?: InputMaybe; - size?: InputMaybe; - view?: InputMaybe; - viewId?: InputMaybe; -}; - -export type ViewFieldWhereUniqueInput = { - viewId_key?: InputMaybe; -}; - -export type ViewFilter = { - __typename?: 'ViewFilter'; - displayValue: Scalars['String']; - key: Scalars['String']; - name: Scalars['String']; - operand: ViewFilterOperand; - value: Scalars['String']; - view: View; - viewId: Scalars['String']; -}; - -export type ViewFilterCreateManyInput = { - displayValue: Scalars['String']; - key: Scalars['String']; - name: Scalars['String']; - operand: ViewFilterOperand; - value: Scalars['String']; - viewId: Scalars['String']; -}; - -export type ViewFilterCreateNestedManyWithoutViewInput = { - connect?: InputMaybe>; -}; - -export type ViewFilterListRelationFilter = { - every?: InputMaybe; - none?: InputMaybe; - some?: InputMaybe; -}; - -export enum ViewFilterOperand { - Contains = 'Contains', - DoesNotContain = 'DoesNotContain', - GreaterThan = 'GreaterThan', - Is = 'Is', - IsNot = 'IsNot', - IsNotNull = 'IsNotNull', - LessThan = 'LessThan' -} - -export type ViewFilterOrderByRelationAggregateInput = { - _count?: InputMaybe; -}; - -export type ViewFilterOrderByWithRelationInput = { - displayValue?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - operand?: InputMaybe; - value?: InputMaybe; - view?: InputMaybe; - viewId?: InputMaybe; -}; - -export enum ViewFilterScalarFieldEnum { - DisplayValue = 'displayValue', - Key = 'key', - Name = 'name', - Operand = 'operand', - Value = 'value', - ViewId = 'viewId', - WorkspaceId = 'workspaceId' -} - -export type ViewFilterUpdateInput = { - displayValue?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - operand?: InputMaybe; - value?: InputMaybe; - view?: InputMaybe; -}; - -export type ViewFilterUpdateManyWithoutViewNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewFilterUpdateManyWithoutWorkspaceNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewFilterViewIdKeyCompoundUniqueInput = { - key: Scalars['String']; - viewId: Scalars['String']; -}; - -export type ViewFilterWhereInput = { - AND?: InputMaybe>; - NOT?: InputMaybe>; - OR?: InputMaybe>; - displayValue?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - operand?: InputMaybe; - value?: InputMaybe; - view?: InputMaybe; - viewId?: InputMaybe; -}; - -export type ViewFilterWhereUniqueInput = { - viewId_key?: InputMaybe; -}; - -export type ViewOrderByWithRelationInput = { - fields?: InputMaybe; - filters?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - objectId?: InputMaybe; - sorts?: InputMaybe; - type?: InputMaybe; -}; - -export type ViewRelationFilter = { - is?: InputMaybe; - isNot?: InputMaybe; -}; - -export enum ViewScalarFieldEnum { - Id = 'id', - Name = 'name', - ObjectId = 'objectId', - Type = 'type', - WorkspaceId = 'workspaceId' -} - -export type ViewSort = { - __typename?: 'ViewSort'; - direction: ViewSortDirection; - key: Scalars['String']; - name: Scalars['String']; - view: View; - viewId: Scalars['String']; -}; - -export type ViewSortCreateManyInput = { - direction: ViewSortDirection; - key: Scalars['String']; - name: Scalars['String']; - viewId: Scalars['String']; -}; - -export type ViewSortCreateNestedManyWithoutViewInput = { - connect?: InputMaybe>; -}; - -export enum ViewSortDirection { - Asc = 'asc', - Desc = 'desc' -} - -export type ViewSortListRelationFilter = { - every?: InputMaybe; - none?: InputMaybe; - some?: InputMaybe; -}; - -export type ViewSortOrderByRelationAggregateInput = { - _count?: InputMaybe; -}; - -export type ViewSortOrderByWithRelationInput = { - direction?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - view?: InputMaybe; - viewId?: InputMaybe; -}; - -export enum ViewSortScalarFieldEnum { - Direction = 'direction', - Key = 'key', - Name = 'name', - ViewId = 'viewId', - WorkspaceId = 'workspaceId' -} - -export type ViewSortUpdateInput = { - direction?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - view?: InputMaybe; -}; - -export type ViewSortUpdateManyWithoutViewNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewSortUpdateManyWithoutWorkspaceNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewSortViewIdKeyCompoundUniqueInput = { - key: Scalars['String']; - viewId: Scalars['String']; -}; - -export type ViewSortWhereInput = { - AND?: InputMaybe>; - NOT?: InputMaybe>; - OR?: InputMaybe>; - direction?: InputMaybe; - key?: InputMaybe; - name?: InputMaybe; - view?: InputMaybe; - viewId?: InputMaybe; -}; - -export type ViewSortWhereUniqueInput = { - viewId_key?: InputMaybe; -}; - -export enum ViewType { - Pipeline = 'Pipeline', - Table = 'Table' -} - -export type ViewUpdateInput = { - fields?: InputMaybe; - filters?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - objectId?: InputMaybe; - sorts?: InputMaybe; - type?: InputMaybe; -}; - -export type ViewUpdateManyWithoutWorkspaceNestedInput = { - connect?: InputMaybe>; - disconnect?: InputMaybe>; - set?: InputMaybe>; -}; - -export type ViewUpdateOneRequiredWithoutFieldsNestedInput = { - connect?: InputMaybe; -}; - -export type ViewUpdateOneRequiredWithoutFiltersNestedInput = { - connect?: InputMaybe; -}; - -export type ViewUpdateOneRequiredWithoutSortsNestedInput = { - connect?: InputMaybe; -}; - -export type ViewWhereInput = { - AND?: InputMaybe>; - NOT?: InputMaybe>; - OR?: InputMaybe>; - fields?: InputMaybe; - filters?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - objectId?: InputMaybe; - sorts?: InputMaybe; - type?: InputMaybe; -}; - -export type ViewWhereUniqueInput = { - id?: InputMaybe; -}; - export type WebHook = { __typename?: 'WebHook'; createdAt: Scalars['DateTime']; @@ -3500,10 +2907,6 @@ export type Workspace = { pipelineStages?: Maybe>; pipelines?: Maybe>; updatedAt: Scalars['DateTime']; - viewFields?: Maybe>; - viewFilters?: Maybe>; - viewSorts?: Maybe>; - views?: Maybe>; webHooks?: Maybe>; workspaceMember?: Maybe>; }; @@ -3676,10 +3079,6 @@ export type WorkspaceUpdateInput = { pipelineStages?: InputMaybe; pipelines?: InputMaybe; updatedAt?: InputMaybe; - viewFields?: InputMaybe; - viewFilters?: InputMaybe; - viewSorts?: InputMaybe; - views?: InputMaybe; webHooks?: InputMaybe; workspaceMember?: InputMaybe; }; @@ -4156,7 +3555,7 @@ export type GetPipelinesQueryVariables = Exact<{ }>; -export type GetPipelinesQuery = { __typename?: 'Query', findManyPipeline: Array<{ __typename?: 'Pipeline', id: string, name: string, pipelineProgressableType: PipelineProgressableType, pipelineStages?: Array<{ __typename?: 'PipelineStage', id: string, name: string, color: string, index?: number | null }> | null }> }; +export type GetPipelinesQuery = { __typename?: 'Query', findManyPipeline: Array<{ __typename?: 'Pipeline', id: string, name: string, pipelineProgressableType: PipelineProgressableType, pipelineStages?: Array<{ __typename?: 'PipelineStage', id: string, name: string, color: string, position?: number | null }> | null }> }; export type SearchActivityQueryVariables = Exact<{ where?: InputMaybe; @@ -4266,118 +3665,6 @@ export type GetUsersQueryVariables = Exact<{ [key: string]: never; }>; export type GetUsersQuery = { __typename?: 'Query', findManyUser: Array<{ __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null }> }; -export type ViewFieldFragmentFragment = { __typename?: 'ViewField', index: number, isVisible: boolean, key: string, name: string, size?: number | null, viewId: string }; - -export type CreateViewMutationVariables = Exact<{ - data: ViewCreateInput; -}>; - - -export type CreateViewMutation = { __typename?: 'Mutation', view: { __typename?: 'View', id: string, name: string } }; - -export type CreateViewFieldsMutationVariables = Exact<{ - data: Array | ViewFieldCreateManyInput; -}>; - - -export type CreateViewFieldsMutation = { __typename?: 'Mutation', createManyViewField: { __typename?: 'AffectedRows', count: number } }; - -export type CreateViewFiltersMutationVariables = Exact<{ - data: Array | ViewFilterCreateManyInput; -}>; - - -export type CreateViewFiltersMutation = { __typename?: 'Mutation', createManyViewFilter: { __typename?: 'AffectedRows', count: number } }; - -export type CreateViewSortsMutationVariables = Exact<{ - data: Array | ViewSortCreateManyInput; -}>; - - -export type CreateViewSortsMutation = { __typename?: 'Mutation', createManyViewSort: { __typename?: 'AffectedRows', count: number } }; - -export type DeleteViewMutationVariables = Exact<{ - where: ViewWhereUniqueInput; -}>; - - -export type DeleteViewMutation = { __typename?: 'Mutation', view: { __typename?: 'View', id: string, name: string } }; - -export type DeleteViewFiltersMutationVariables = Exact<{ - where: ViewFilterWhereInput; -}>; - - -export type DeleteViewFiltersMutation = { __typename?: 'Mutation', deleteManyViewFilter: { __typename?: 'AffectedRows', count: number } }; - -export type DeleteViewSortsMutationVariables = Exact<{ - where: ViewSortWhereInput; -}>; - - -export type DeleteViewSortsMutation = { __typename?: 'Mutation', deleteManyViewSort: { __typename?: 'AffectedRows', count: number } }; - -export type UpdateViewMutationVariables = Exact<{ - data: ViewUpdateInput; - where: ViewWhereUniqueInput; -}>; - - -export type UpdateViewMutation = { __typename?: 'Mutation', view: { __typename?: 'View', id: string, name: string } }; - -export type UpdateViewFieldMutationVariables = Exact<{ - data: ViewFieldUpdateInput; - where: ViewFieldWhereUniqueInput; -}>; - - -export type UpdateViewFieldMutation = { __typename?: 'Mutation', updateOneViewField: { __typename?: 'ViewField', index: number, isVisible: boolean, key: string, name: string, size?: number | null, viewId: string } }; - -export type UpdateViewFilterMutationVariables = Exact<{ - data: ViewFilterUpdateInput; - where: ViewFilterWhereUniqueInput; -}>; - - -export type UpdateViewFilterMutation = { __typename?: 'Mutation', viewFilter: { __typename?: 'ViewFilter', displayValue: string, key: string, name: string, operand: ViewFilterOperand, value: string } }; - -export type UpdateViewSortMutationVariables = Exact<{ - data: ViewSortUpdateInput; - where: ViewSortWhereUniqueInput; -}>; - - -export type UpdateViewSortMutation = { __typename?: 'Mutation', viewSort: { __typename?: 'ViewSort', direction: ViewSortDirection, key: string, name: string } }; - -export type GetViewFieldsQueryVariables = Exact<{ - where?: InputMaybe; - orderBy?: InputMaybe | ViewFieldOrderByWithRelationInput>; -}>; - - -export type GetViewFieldsQuery = { __typename?: 'Query', viewFields: Array<{ __typename?: 'ViewField', index: number, isVisible: boolean, key: string, name: string, size?: number | null, viewId: string }> }; - -export type GetViewFiltersQueryVariables = Exact<{ - where?: InputMaybe; -}>; - - -export type GetViewFiltersQuery = { __typename?: 'Query', viewFilters: Array<{ __typename?: 'ViewFilter', displayValue: string, key: string, name: string, operand: ViewFilterOperand, value: string }> }; - -export type GetViewSortsQueryVariables = Exact<{ - where?: InputMaybe; -}>; - - -export type GetViewSortsQuery = { __typename?: 'Query', viewSorts: Array<{ __typename?: 'ViewSort', direction: ViewSortDirection, key: string, name: string }> }; - -export type GetViewsQueryVariables = Exact<{ - where?: InputMaybe; -}>; - - -export type GetViewsQuery = { __typename?: 'Query', views: Array<{ __typename?: 'View', id: string, name: string }> }; - export type WorkspaceMemberFieldsFragmentFragment = { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null }; export type DeleteCurrentWorkspaceMutationVariables = Exact<{ [key: string]: never; }>; @@ -4656,16 +3943,6 @@ export const UserFieldsFragmentFragmentDoc = gql` lastName } `; -export const ViewFieldFragmentFragmentDoc = gql` - fragment ViewFieldFragment on ViewField { - index - isVisible - key - name - size - viewId -} - `; export const WorkspaceMemberFieldsFragmentFragmentDoc = gql` fragment workspaceMemberFieldsFragment on WorkspaceMember { id @@ -6685,7 +5962,7 @@ export const GetPipelinesDocument = gql` id name color - index + position } } } @@ -7310,530 +6587,6 @@ export function useGetUsersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions; export type GetUsersLazyQueryHookResult = ReturnType; export type GetUsersQueryResult = Apollo.QueryResult; -export const CreateViewDocument = gql` - mutation CreateView($data: ViewCreateInput!) { - view: createOneView(data: $data) { - id - name - } -} - `; -export type CreateViewMutationFn = Apollo.MutationFunction; - -/** - * __useCreateViewMutation__ - * - * To run a mutation, you first call `useCreateViewMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateViewMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [createViewMutation, { data, loading, error }] = useCreateViewMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useCreateViewMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateViewDocument, options); - } -export type CreateViewMutationHookResult = ReturnType; -export type CreateViewMutationResult = Apollo.MutationResult; -export type CreateViewMutationOptions = Apollo.BaseMutationOptions; -export const CreateViewFieldsDocument = gql` - mutation CreateViewFields($data: [ViewFieldCreateManyInput!]!) { - createManyViewField(data: $data) { - count - } -} - `; -export type CreateViewFieldsMutationFn = Apollo.MutationFunction; - -/** - * __useCreateViewFieldsMutation__ - * - * To run a mutation, you first call `useCreateViewFieldsMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateViewFieldsMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [createViewFieldsMutation, { data, loading, error }] = useCreateViewFieldsMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useCreateViewFieldsMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateViewFieldsDocument, options); - } -export type CreateViewFieldsMutationHookResult = ReturnType; -export type CreateViewFieldsMutationResult = Apollo.MutationResult; -export type CreateViewFieldsMutationOptions = Apollo.BaseMutationOptions; -export const CreateViewFiltersDocument = gql` - mutation CreateViewFilters($data: [ViewFilterCreateManyInput!]!) { - createManyViewFilter(data: $data) { - count - } -} - `; -export type CreateViewFiltersMutationFn = Apollo.MutationFunction; - -/** - * __useCreateViewFiltersMutation__ - * - * To run a mutation, you first call `useCreateViewFiltersMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateViewFiltersMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [createViewFiltersMutation, { data, loading, error }] = useCreateViewFiltersMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useCreateViewFiltersMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateViewFiltersDocument, options); - } -export type CreateViewFiltersMutationHookResult = ReturnType; -export type CreateViewFiltersMutationResult = Apollo.MutationResult; -export type CreateViewFiltersMutationOptions = Apollo.BaseMutationOptions; -export const CreateViewSortsDocument = gql` - mutation CreateViewSorts($data: [ViewSortCreateManyInput!]!) { - createManyViewSort(data: $data) { - count - } -} - `; -export type CreateViewSortsMutationFn = Apollo.MutationFunction; - -/** - * __useCreateViewSortsMutation__ - * - * To run a mutation, you first call `useCreateViewSortsMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateViewSortsMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [createViewSortsMutation, { data, loading, error }] = useCreateViewSortsMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useCreateViewSortsMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateViewSortsDocument, options); - } -export type CreateViewSortsMutationHookResult = ReturnType; -export type CreateViewSortsMutationResult = Apollo.MutationResult; -export type CreateViewSortsMutationOptions = Apollo.BaseMutationOptions; -export const DeleteViewDocument = gql` - mutation DeleteView($where: ViewWhereUniqueInput!) { - view: deleteOneView(where: $where) { - id - name - } -} - `; -export type DeleteViewMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteViewMutation__ - * - * To run a mutation, you first call `useDeleteViewMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteViewMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteViewMutation, { data, loading, error }] = useDeleteViewMutation({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useDeleteViewMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteViewDocument, options); - } -export type DeleteViewMutationHookResult = ReturnType; -export type DeleteViewMutationResult = Apollo.MutationResult; -export type DeleteViewMutationOptions = Apollo.BaseMutationOptions; -export const DeleteViewFiltersDocument = gql` - mutation DeleteViewFilters($where: ViewFilterWhereInput!) { - deleteManyViewFilter(where: $where) { - count - } -} - `; -export type DeleteViewFiltersMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteViewFiltersMutation__ - * - * To run a mutation, you first call `useDeleteViewFiltersMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteViewFiltersMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteViewFiltersMutation, { data, loading, error }] = useDeleteViewFiltersMutation({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useDeleteViewFiltersMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteViewFiltersDocument, options); - } -export type DeleteViewFiltersMutationHookResult = ReturnType; -export type DeleteViewFiltersMutationResult = Apollo.MutationResult; -export type DeleteViewFiltersMutationOptions = Apollo.BaseMutationOptions; -export const DeleteViewSortsDocument = gql` - mutation DeleteViewSorts($where: ViewSortWhereInput!) { - deleteManyViewSort(where: $where) { - count - } -} - `; -export type DeleteViewSortsMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteViewSortsMutation__ - * - * To run a mutation, you first call `useDeleteViewSortsMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteViewSortsMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteViewSortsMutation, { data, loading, error }] = useDeleteViewSortsMutation({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useDeleteViewSortsMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteViewSortsDocument, options); - } -export type DeleteViewSortsMutationHookResult = ReturnType; -export type DeleteViewSortsMutationResult = Apollo.MutationResult; -export type DeleteViewSortsMutationOptions = Apollo.BaseMutationOptions; -export const UpdateViewDocument = gql` - mutation UpdateView($data: ViewUpdateInput!, $where: ViewWhereUniqueInput!) { - view: updateOneView(data: $data, where: $where) { - id - name - } -} - `; -export type UpdateViewMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateViewMutation__ - * - * To run a mutation, you first call `useUpdateViewMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateViewMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateViewMutation, { data, loading, error }] = useUpdateViewMutation({ - * variables: { - * data: // value for 'data' - * where: // value for 'where' - * }, - * }); - */ -export function useUpdateViewMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateViewDocument, options); - } -export type UpdateViewMutationHookResult = ReturnType; -export type UpdateViewMutationResult = Apollo.MutationResult; -export type UpdateViewMutationOptions = Apollo.BaseMutationOptions; -export const UpdateViewFieldDocument = gql` - mutation UpdateViewField($data: ViewFieldUpdateInput!, $where: ViewFieldWhereUniqueInput!) { - updateOneViewField(data: $data, where: $where) { - ...ViewFieldFragment - } -} - ${ViewFieldFragmentFragmentDoc}`; -export type UpdateViewFieldMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateViewFieldMutation__ - * - * To run a mutation, you first call `useUpdateViewFieldMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateViewFieldMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateViewFieldMutation, { data, loading, error }] = useUpdateViewFieldMutation({ - * variables: { - * data: // value for 'data' - * where: // value for 'where' - * }, - * }); - */ -export function useUpdateViewFieldMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateViewFieldDocument, options); - } -export type UpdateViewFieldMutationHookResult = ReturnType; -export type UpdateViewFieldMutationResult = Apollo.MutationResult; -export type UpdateViewFieldMutationOptions = Apollo.BaseMutationOptions; -export const UpdateViewFilterDocument = gql` - mutation UpdateViewFilter($data: ViewFilterUpdateInput!, $where: ViewFilterWhereUniqueInput!) { - viewFilter: updateOneViewFilter(data: $data, where: $where) { - displayValue - key - name - operand - value - } -} - `; -export type UpdateViewFilterMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateViewFilterMutation__ - * - * To run a mutation, you first call `useUpdateViewFilterMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateViewFilterMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateViewFilterMutation, { data, loading, error }] = useUpdateViewFilterMutation({ - * variables: { - * data: // value for 'data' - * where: // value for 'where' - * }, - * }); - */ -export function useUpdateViewFilterMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateViewFilterDocument, options); - } -export type UpdateViewFilterMutationHookResult = ReturnType; -export type UpdateViewFilterMutationResult = Apollo.MutationResult; -export type UpdateViewFilterMutationOptions = Apollo.BaseMutationOptions; -export const UpdateViewSortDocument = gql` - mutation UpdateViewSort($data: ViewSortUpdateInput!, $where: ViewSortWhereUniqueInput!) { - viewSort: updateOneViewSort(data: $data, where: $where) { - direction - key - name - } -} - `; -export type UpdateViewSortMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateViewSortMutation__ - * - * To run a mutation, you first call `useUpdateViewSortMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateViewSortMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateViewSortMutation, { data, loading, error }] = useUpdateViewSortMutation({ - * variables: { - * data: // value for 'data' - * where: // value for 'where' - * }, - * }); - */ -export function useUpdateViewSortMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateViewSortDocument, options); - } -export type UpdateViewSortMutationHookResult = ReturnType; -export type UpdateViewSortMutationResult = Apollo.MutationResult; -export type UpdateViewSortMutationOptions = Apollo.BaseMutationOptions; -export const GetViewFieldsDocument = gql` - query GetViewFields($where: ViewFieldWhereInput, $orderBy: [ViewFieldOrderByWithRelationInput!]) { - viewFields: findManyViewField(where: $where, orderBy: $orderBy) { - ...ViewFieldFragment - } -} - ${ViewFieldFragmentFragmentDoc}`; - -/** - * __useGetViewFieldsQuery__ - * - * To run a query within a React component, call `useGetViewFieldsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetViewFieldsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetViewFieldsQuery({ - * variables: { - * where: // value for 'where' - * orderBy: // value for 'orderBy' - * }, - * }); - */ -export function useGetViewFieldsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetViewFieldsDocument, options); - } -export function useGetViewFieldsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetViewFieldsDocument, options); - } -export type GetViewFieldsQueryHookResult = ReturnType; -export type GetViewFieldsLazyQueryHookResult = ReturnType; -export type GetViewFieldsQueryResult = Apollo.QueryResult; -export const GetViewFiltersDocument = gql` - query GetViewFilters($where: ViewFilterWhereInput) { - viewFilters: findManyViewFilter(where: $where) { - displayValue - key - name - operand - value - } -} - `; - -/** - * __useGetViewFiltersQuery__ - * - * To run a query within a React component, call `useGetViewFiltersQuery` and pass it any options that fit your needs. - * When your component renders, `useGetViewFiltersQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetViewFiltersQuery({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useGetViewFiltersQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetViewFiltersDocument, options); - } -export function useGetViewFiltersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetViewFiltersDocument, options); - } -export type GetViewFiltersQueryHookResult = ReturnType; -export type GetViewFiltersLazyQueryHookResult = ReturnType; -export type GetViewFiltersQueryResult = Apollo.QueryResult; -export const GetViewSortsDocument = gql` - query GetViewSorts($where: ViewSortWhereInput) { - viewSorts: findManyViewSort(where: $where) { - direction - key - name - } -} - `; - -/** - * __useGetViewSortsQuery__ - * - * To run a query within a React component, call `useGetViewSortsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetViewSortsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetViewSortsQuery({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useGetViewSortsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetViewSortsDocument, options); - } -export function useGetViewSortsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetViewSortsDocument, options); - } -export type GetViewSortsQueryHookResult = ReturnType; -export type GetViewSortsLazyQueryHookResult = ReturnType; -export type GetViewSortsQueryResult = Apollo.QueryResult; -export const GetViewsDocument = gql` - query GetViews($where: ViewWhereInput) { - views: findManyView(where: $where) { - id - name - } -} - `; - -/** - * __useGetViewsQuery__ - * - * To run a query within a React component, call `useGetViewsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetViewsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetViewsQuery({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useGetViewsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetViewsDocument, options); - } -export function useGetViewsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetViewsDocument, options); - } -export type GetViewsQueryHookResult = ReturnType; -export type GetViewsLazyQueryHookResult = ReturnType; -export type GetViewsQueryResult = Apollo.QueryResult; export const DeleteCurrentWorkspaceDocument = gql` mutation DeleteCurrentWorkspace { deleteCurrentWorkspace { diff --git a/front/src/modules/activities/editable-fields/components/ActivityAssigneeEditableField.tsx b/front/src/modules/activities/editable-fields/components/ActivityAssigneeEditableField.tsx index d5ed19562..f060fadd5 100644 --- a/front/src/modules/activities/editable-fields/components/ActivityAssigneeEditableField.tsx +++ b/front/src/modules/activities/editable-fields/components/ActivityAssigneeEditableField.tsx @@ -23,8 +23,8 @@ export const ActivityAssigneeEditableField = ({ entityId: activity.id, recoilScopeId: 'assignee', fieldDefinition: { - key: 'assignee', - name: 'Assignee', + fieldId: 'assignee', + label: 'Assignee', Icon: IconUserCircle, type: 'relation', metadata: { diff --git a/front/src/modules/activities/editable-fields/components/ActivityEditorDateField.tsx b/front/src/modules/activities/editable-fields/components/ActivityEditorDateField.tsx index 472fb72d0..95b25cc98 100644 --- a/front/src/modules/activities/editable-fields/components/ActivityEditorDateField.tsx +++ b/front/src/modules/activities/editable-fields/components/ActivityEditorDateField.tsx @@ -21,8 +21,8 @@ export const ActivityEditorDateField = ({ entityId: activityId, recoilScopeId: 'activityDueAt', fieldDefinition: { - key: 'activityDueAt', - name: 'Due date', + fieldId: 'activityDueAt', + label: 'Due date', Icon: IconCalendar, type: 'date', metadata: { diff --git a/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts b/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts index 5aa2a8427..c282fe3a7 100644 --- a/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts +++ b/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts @@ -3,11 +3,8 @@ import { useRecoilState } from 'recoil'; import { currentUserState } from '@/auth/states/currentUserState'; import { turnFilterIntoWhereClause } from '@/ui/data/filter/utils/turnFilterIntoWhereClause'; -import { - ActivityType, - useGetActivitiesQuery, - ViewFilterOperand, -} from '~/generated/graphql'; +import { ViewFilterOperand } from '@/views/types/ViewFilterOperand'; +import { ActivityType, useGetActivitiesQuery } from '~/generated/graphql'; import { parseDate } from '~/utils/date-utils'; export const useCurrentUserTaskCount = () => { diff --git a/front/src/modules/companies/__stories__/mock-data.ts b/front/src/modules/companies/__stories__/mock-data.ts index 3c3efac4a..4ff4bd00e 100644 --- a/front/src/modules/companies/__stories__/mock-data.ts +++ b/front/src/modules/companies/__stories__/mock-data.ts @@ -7,31 +7,31 @@ export const pipeline = { { id: 'pipeline-stage-1', name: 'New', - index: 0, + position: 0, color: 'red', }, { id: 'pipeline-stage-2', name: 'Screening', - index: 1, + position: 1, color: 'purple', }, { id: 'pipeline-stage-3', name: 'Meeting', - index: 2, + position: 2, color: 'sky', }, { id: 'pipeline-stage-4', name: 'Proposal', - index: 3, + position: 3, color: 'turquoise', }, { id: 'pipeline-stage-5', name: 'Customer', - index: 4, + position: 4, color: 'yellow', }, ], diff --git a/front/src/modules/companies/components/CompanyBoardCard.tsx b/front/src/modules/companies/components/CompanyBoardCard.tsx index 6686279a9..1025c7ac7 100644 --- a/front/src/modules/companies/components/CompanyBoardCard.tsx +++ b/front/src/modules/companies/components/CompanyBoardCard.tsx @@ -222,14 +222,14 @@ export const CompanyBoardCard = () => { {visibleBoardCardFields.map((viewField) => ( - + [] = [ { - key: 'name', - name: 'Name', + fieldId: 'name', + label: 'Name', Icon: IconBuildingSkyscraper, size: 180, - index: 0, + position: 0, type: 'chip', metadata: { urlFieldName: 'domainName', @@ -45,11 +45,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition basePathToShowPage: '/companies/', } satisfies ColumnDefinition, { - key: 'domainName', - name: 'URL', + fieldId: 'domainName', + label: 'URL', Icon: IconLink, size: 100, - index: 1, + position: 1, type: 'url', metadata: { fieldName: 'domainName', @@ -60,11 +60,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition 'The company website URL. We use this url to fetch the company icon.', } satisfies ColumnDefinition, { - key: 'accountOwner', - name: 'Account Owner', + fieldId: 'accountOwner', + label: 'Account Owner', Icon: IconUserCircle, size: 150, - index: 2, + position: 2, type: 'relation', metadata: { fieldName: 'accountOwner', @@ -82,11 +82,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition }, } satisfies ColumnDefinition, { - key: 'createdAt', - name: 'Creation', + fieldId: 'createdAt', + label: 'Creation', Icon: IconCalendarEvent, size: 150, - index: 3, + position: 3, type: 'date', metadata: { fieldName: 'createdAt', @@ -95,11 +95,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition infoTooltipContent: "Date when the company's record was created.", } satisfies ColumnDefinition, { - key: 'employees', - name: 'Employees', + fieldId: 'employees', + label: 'Employees', Icon: IconUsers, size: 150, - index: 4, + position: 4, type: 'number', metadata: { fieldName: 'employees', @@ -110,11 +110,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition infoTooltipContent: 'Number of employees in the company.', } satisfies ColumnDefinition, { - key: 'linkedin', - name: 'LinkedIn', + fieldId: 'linkedin', + label: 'LinkedIn', Icon: IconBrandLinkedin, size: 170, - index: 5, + position: 5, type: 'url', metadata: { fieldName: 'linkedinUrl', @@ -124,11 +124,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition infoTooltipContent: 'The company Linkedin account.', } satisfies ColumnDefinition, { - key: 'address', - name: 'Address', + fieldId: 'address', + label: 'Address', Icon: IconMap, size: 170, - index: 6, + position: 6, type: 'text', metadata: { fieldName: 'address', @@ -138,11 +138,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition infoTooltipContent: 'The company address.', } satisfies ColumnDefinition, { - key: 'idealCustomerProfile', - name: 'ICP', + fieldId: 'idealCustomerProfile', + label: 'ICP', Icon: IconTarget, size: 150, - index: 7, + position: 7, type: 'boolean', metadata: { fieldName: 'idealCustomerProfile', @@ -152,11 +152,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition 'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you.', } satisfies ColumnDefinition, { - key: 'annualRecurringRevenue', - name: 'ARR', + fieldId: 'annualRecurringRevenue', + label: 'ARR', Icon: IconMoneybag, size: 150, - index: 8, + position: 8, type: 'moneyAmount', metadata: { fieldName: 'annualRecurringRevenue', @@ -166,11 +166,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition 'Annual Recurring Revenue: The actual or estimated annual revenue of the company.', } satisfies ColumnDefinition, { - key: 'xUrl', - name: 'Twitter', + fieldId: 'xUrl', + label: 'Twitter', Icon: IconBrandX, size: 150, - index: 9, + position: 9, type: 'url', metadata: { fieldName: 'xUrl', @@ -184,11 +184,11 @@ export const companiesAvailableFieldDefinitions: ColumnDefinition export const suppliersAvailableColumnDefinitions: ColumnDefinition[] = [ { - key: 'name', - name: 'Name', + fieldId: 'name', + label: 'Name', Icon: IconBuildingSkyscraper, size: 180, - index: 0, + position: 0, type: 'text', metadata: { fieldName: 'name', @@ -199,11 +199,11 @@ export const suppliersAvailableColumnDefinitions: ColumnDefinition, { - key: 'city', - name: 'City', + fieldId: 'city', + label: 'City', Icon: IconBuildingSkyscraper, size: 180, - index: 0, + position: 0, type: 'text', metadata: { fieldName: 'city', diff --git a/front/src/modules/companies/hooks/useUpdateCompanyBoardColumns.ts b/front/src/modules/companies/hooks/useUpdateCompanyBoardColumns.ts index 2ceed24e8..50fff9caa 100644 --- a/front/src/modules/companies/hooks/useUpdateCompanyBoardColumns.ts +++ b/front/src/modules/companies/hooks/useUpdateCompanyBoardColumns.ts @@ -92,8 +92,8 @@ export const useUpdateCompanyBoard = () => const pipelineStages = pipeline?.pipelineStages ?? []; const orderedPipelineStages = [...pipelineStages].sort((a, b) => { - if (!a.index || !b.index) return 0; - return a.index - b.index; + if (!a.position || !b.position) return 0; + return a.position - b.position; }); const newBoardColumns: BoardColumnDefinition[] = @@ -110,7 +110,7 @@ export const useUpdateCompanyBoard = () => colorCode: isThemeColor(pipelineStage.color) ? pipelineStage.color : undefined, - index: pipelineStage.index ?? 0, + position: pipelineStage.position ?? 0, }; }); if (currentBoardColumns.length === 0) { diff --git a/front/src/modules/companies/table/components/CompanyTable.tsx b/front/src/modules/companies/table/components/CompanyTable.tsx index 7dccb26f7..e3081f729 100644 --- a/front/src/modules/companies/table/components/CompanyTable.tsx +++ b/front/src/modules/companies/table/components/CompanyTable.tsx @@ -1,5 +1,7 @@ import styled from '@emotion/styled'; +import { useRecoilCallback, useSetRecoilState } from 'recoil'; +import { companiesAvailableFieldDefinitions } from '@/companies/constants/companiesAvailableFieldDefinitions'; import { getCompaniesOptimisticEffectDefinition } from '@/companies/graphql/optimistic-effect-definitions/getCompaniesOptimisticEffectDefinition'; import { useCompanyTableActionBarEntries } from '@/companies/hooks/useCompanyTableActionBarEntries'; import { useCompanyTableContextMenuEntries } from '@/companies/hooks/useCompanyTableContextMenuEntries'; @@ -9,10 +11,13 @@ import { DataTableEffect } from '@/ui/data/data-table/components/DataTableEffect import { TableContext } from '@/ui/data/data-table/contexts/TableContext'; import { useUpsertDataTableItem } from '@/ui/data/data-table/hooks/useUpsertDataTableItem'; import { TableOptionsDropdown } from '@/ui/data/data-table/options/components/TableOptionsDropdown'; +import { tableColumnsScopedState } from '@/ui/data/data-table/states/tableColumnsScopedState'; import { ViewBar } from '@/views/components/ViewBar'; import { useViewFields } from '@/views/hooks/internal/useViewFields'; import { useView } from '@/views/hooks/useView'; import { ViewScope } from '@/views/scopes/ViewScope'; +import { columnDefinitionsToViewFields } from '@/views/utils/columnDefinitionToViewField'; +import { viewFieldsToColumnDefinitions } from '@/views/utils/viewFieldsToColumnDefinitions'; import { UpdateOneCompanyMutationVariables, useGetCompaniesQuery, @@ -26,13 +31,18 @@ import CompanyTableEffect from './CompanyTableEffect'; export const CompanyTable = () => { const tableViewScopeId = 'company-table'; + const setTableColumns = useSetRecoilState( + tableColumnsScopedState('companies'), + ); const [updateEntityMutation] = useUpdateOneCompanyMutation(); const upsertDataTableItem = useUpsertDataTableItem(); const [getWorkspaceMember] = useGetWorkspaceMembersLazyQuery(); const { persistViewFields } = useViewFields(tableViewScopeId); - const { setCurrentViewFields } = useView({ viewScopeId: tableViewScopeId }); + const { setCurrentViewFields, currentViewId } = useView({ + viewScopeId: tableViewScopeId, + }); const { setContextMenuEntries } = useCompanyTableContextMenuEntries(); const { setActionBarEntries } = useCompanyTableActionBarEntries(); @@ -77,14 +87,25 @@ export const CompanyTable = () => { `; return ( - + { + setTableColumns( + viewFieldsToColumnDefinitions( + viewFields, + companiesAvailableFieldDefinitions, + ), + ); + }} + onViewFiltersChange={() => {}} + > { - setCurrentViewFields?.(columns); - persistViewFields(columns); - }, + onColumnsChange: useRecoilCallback(() => (columns) => { + setCurrentViewFields?.(columnDefinitionsToViewFields(columns)); + persistViewFields(columnDefinitionsToViewFields(columns)); + }), }} > { setViewType, setViewObjectId, } = useView(); - const { currentViewFields, currentViewSorts, currentViewFilters } = - useViewInternalStates(); - - const [, setTableColumns] = useRecoilScopedState( - tableColumnsScopedState, - TableRecoilScopeContext, - ); - - const [, setTableSorts] = useRecoilScopedState( - tableSortsScopedState, - TableRecoilScopeContext, - ); - - const [, setTableFilters] = useRecoilScopedState( - tableFiltersScopedState, - TableRecoilScopeContext, - ); const [, setAvailableTableColumns] = useRecoilScopedState( availableTableColumnsScopedState, @@ -57,33 +36,32 @@ const CompanyTableEffect = () => { setAvailableFilters, setAvailableSorts, setAvailableTableColumns, - setTableColumns, setViewObjectId, setViewType, ]); - useEffect(() => { - if (currentViewFields) { - setTableColumns([...currentViewFields].sort((a, b) => a.index - b.index)); - } - }, [currentViewFields, setTableColumns]); + // useEffect(() => { + // if (currentViewFields) { + // setTableColumns([...currentViewFields].sort((a, b) => a.index - b.index)); + // } + // }, [currentViewFields, setTableColumns]); - useEffect(() => { - if (currentViewSorts) { - setTableSorts(currentViewSorts); - } - }, [currentViewFields, currentViewSorts, setTableColumns, setTableSorts]); + // useEffect(() => { + // if (currentViewSorts) { + // setTableSorts(currentViewSorts); + // } + // }, [currentViewFields, currentViewSorts, setTableColumns, setTableSorts]); - useEffect(() => { - if (currentViewFilters) { - setTableFilters(currentViewFilters); - } - }, [ - currentViewFields, - currentViewFilters, - setTableColumns, - setTableFilters, - setTableSorts, - ]); + // useEffect(() => { + // if (currentViewFilters) { + // setTableFilters(currentViewFilters); + // } + // }, [ + // currentViewFields, + // currentViewFilters, + // setTableColumns, + // setTableFilters, + // setTableSorts, + // ]); return <>; }; diff --git a/front/src/modules/metadata/components/MetadataObjectNavItems.tsx b/front/src/modules/metadata/components/MetadataObjectNavItems.tsx index 32a43e69b..9241a61a4 100644 --- a/front/src/modules/metadata/components/MetadataObjectNavItems.tsx +++ b/front/src/modules/metadata/components/MetadataObjectNavItems.tsx @@ -1,52 +1,30 @@ import { useNavigate } from 'react-router-dom'; -import { IconArchive } from '@/ui/display/icon'; import { IconBuildingSkyscraper } from '@/ui/display/icon'; -import { Button } from '@/ui/input/button/components/Button'; -import { IconButton } from '@/ui/input/button/components/IconButton'; import NavItem from '@/ui/navigation/navbar/components/NavItem'; import { capitalize } from '~/utils/string/capitalize'; -import { useCreateNewTempsCustomObject } from '../hooks/useCreateNewTempCustomObject'; -import { useDeleteOneMetadataObject } from '../hooks/useDeleteOneMetadataObject'; import { useFindManyMetadataObjects } from '../hooks/useFindManyMetadataObjects'; export const MetadataObjectNavItems = () => { const { metadataObjects } = useFindManyMetadataObjects(); - const createNewTempCustomObject = useCreateNewTempsCustomObject(); - - const { deleteOneMetadataObject } = useDeleteOneMetadataObject(); - const navigate = useNavigate(); return ( <> -