Move capitalize into twenty-shared (#9414)
capitalize had been moved into twenty-shared. Let's remove the duplicates in server and front !
This commit is contained in:
@ -11,8 +11,8 @@ import { useAllActiveWorkflowVersions } from '@/workflow/hooks/useAllActiveWorkf
|
||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useWorkflowRunRecordActions = ({
|
||||
objectMetadataItem,
|
||||
|
||||
@ -7,9 +7,9 @@ import { useAllActiveWorkflowVersions } from '@/workflow/hooks/useAllActiveWorkf
|
||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useWorkflowRunActions = () => {
|
||||
const isWorkflowEnabled = useIsFeatureEnabled(
|
||||
|
||||
@ -16,7 +16,7 @@ import { NoteTarget } from '@/activities/types/NoteTarget';
|
||||
import { TaskTarget } from '@/activities/types/TaskTarget';
|
||||
import { getJoinObjectNameSingular } from '@/activities/utils/getJoinObjectNameSingular';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const useCreateActivityInDB = ({
|
||||
activityObjectNameSingular,
|
||||
|
||||
@ -2,8 +2,8 @@ import { ApolloCache, StoreObject } from '@apollo/client';
|
||||
|
||||
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
||||
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const triggerAttachRelationOptimisticEffect = ({
|
||||
cache,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ApolloCache, StoreObject } from '@apollo/client';
|
||||
|
||||
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const triggerDetachRelationOptimisticEffect = ({
|
||||
cache,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { SubscriptionCardPrice } from '@/billing/components/SubscriptionCardPrice';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
type SubscriptionCardProps = {
|
||||
type?: string;
|
||||
|
||||
@ -3,7 +3,7 @@ import { useFindManyRecordsSelectedInContextStore } from '@/context-store/hooks/
|
||||
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
|
||||
import { getObjectRecordIdentifier } from '@/object-metadata/utils/getObjectRecordIdentifier';
|
||||
import styled from '@emotion/styled';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
const StyledChip = styled.div`
|
||||
align-items: center;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { AdvancedFilterLogicalOperatorDropdown } from '@/object-record/advanced-filter/components/AdvancedFilterLogicalOperatorDropdown';
|
||||
import { ViewFilterGroup } from '@/views/types/ViewFilterGroup';
|
||||
import styled from '@emotion/styled';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
const StyledText = styled.div`
|
||||
height: ${({ theme }) => theme.spacing(8)};
|
||||
|
||||
@ -10,7 +10,7 @@ import { getRecordNodeFromRecord } from '@/object-record/cache/utils/getRecordNo
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { prefillRecord } from '@/object-record/utils/prefillRecord';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const useCreateOneRecordInCache = <T extends ObjectRecord>({
|
||||
objectMetadataItem,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getConnectionTypename = (objectNameSingular: string) => {
|
||||
return `${capitalize(getObjectTypename(objectNameSingular))}Connection`;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getEdgeTypename = (objectNameSingular: string) => {
|
||||
return `${capitalize(getObjectTypename(objectNameSingular))}Edge`;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getNodeTypename = (objectNameSingular: string) => {
|
||||
return capitalize(getObjectTypename(objectNameSingular));
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getObjectTypename = (objectNameSingular: string) => {
|
||||
return capitalize(objectNameSingular);
|
||||
|
||||
@ -6,8 +6,8 @@ import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFr
|
||||
import { RecordGqlFields } from '@/object-record/graphql/types/RecordGqlFields';
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const getRecordFromCache = <T extends ObjectRecord = ObjectRecord>({
|
||||
objectMetadataItem,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { RecordGqlConnection } from '@/object-record/graphql/types/RecordGqlConnection';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const isObjectRecordConnection = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -2,7 +2,7 @@ import { StoreValue } from '@apollo/client';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { RecordGqlRefConnection } from '@/object-record/cache/types/RecordGqlRefConnection';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const isObjectRecordConnectionWithRefs = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -2,8 +2,8 @@ import { ApolloCache, Modifiers } from '@apollo/client/cache';
|
||||
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const modifyRecordFromCache = <
|
||||
CachedObjectRecord extends ObjectRecord = ObjectRecord,
|
||||
|
||||
@ -6,8 +6,8 @@ import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObje
|
||||
import { getRecordNodeFromRecord } from '@/object-record/cache/utils/getRecordNodeFromRecord';
|
||||
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const updateRecordFromCache = <T extends ObjectRecord>({
|
||||
objectMetadataItems,
|
||||
|
||||
@ -4,7 +4,7 @@ import { NavigationDrawerInput } from '@/ui/navigation/navigation-drawer/compone
|
||||
import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
|
||||
import styled from '@emotion/styled';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
const StyledEditableTitleContainer = styled.div`
|
||||
align-items: flex-start;
|
||||
|
||||
@ -7,8 +7,8 @@ import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObje
|
||||
import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { RecordGqlOperationGqlRecordFields } from '@/object-record/graphql/types/RecordGqlOperationGqlRecordFields';
|
||||
import { getCreateManyRecordsMutationResponseField } from '@/object-record/utils/getCreateManyRecordsMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useCreateManyRecordsMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -8,8 +8,8 @@ import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { RecordGqlOperationGqlRecordFields } from '@/object-record/graphql/types/RecordGqlOperationGqlRecordFields';
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { getCreateOneRecordMutationResponseField } from '@/object-record/utils/getCreateOneRecordMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useCreateOneRecordMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -14,10 +14,10 @@ import { useRefetchAggregateQueries } from '@/object-record/hooks/useRefetchAggr
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { getDeleteManyRecordsMutationResponseField } from '@/object-record/utils/getDeleteManyRecordsMutationResponseField';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { sleep } from '~/utils/sleep';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type useDeleteManyRecordProps = {
|
||||
objectNameSingular: string;
|
||||
|
||||
@ -3,8 +3,8 @@ import gql from 'graphql-tag';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { getDeleteManyRecordsMutationResponseField } from '@/object-record/utils/getDeleteManyRecordsMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useDeleteManyRecordsMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -11,7 +11,7 @@ import { useDeleteOneRecordMutation } from '@/object-record/hooks/useDeleteOneRe
|
||||
import { useRefetchAggregateQueries } from '@/object-record/hooks/useRefetchAggregateQueries';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { getDeleteOneRecordMutationResponseField } from '@/object-record/utils/getDeleteOneRecordMutationResponseField';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
type useDeleteOneRecordProps = {
|
||||
objectNameSingular: string;
|
||||
|
||||
@ -4,8 +4,8 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata
|
||||
import { mapSoftDeleteFieldsToGraphQLQuery } from '@/object-metadata/utils/mapSoftDeleteFieldsToGraphQLQuery';
|
||||
import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { getDeleteOneRecordMutationResponseField } from '@/object-record/utils/getDeleteOneRecordMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useDeleteOneRecordMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -11,9 +11,9 @@ import { useDestroyManyRecordsMutation } from '@/object-record/hooks/useDestroyM
|
||||
import { useRefetchAggregateQueries } from '@/object-record/hooks/useRefetchAggregateQueries';
|
||||
import { getDestroyManyRecordsMutationResponseField } from '@/object-record/utils/getDestroyManyRecordsMutationResponseField';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { sleep } from '~/utils/sleep';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type useDestroyManyRecordProps = {
|
||||
objectNameSingular: string;
|
||||
|
||||
@ -3,8 +3,8 @@ import gql from 'graphql-tag';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { getDestroyManyRecordsMutationResponseField } from '@/object-record/utils/getDestroyManyRecordsMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useDestroyManyRecordsMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -9,8 +9,8 @@ import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordF
|
||||
import { useDestroyOneRecordMutation } from '@/object-record/hooks/useDestroyOneRecordMutation';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { getDestroyOneRecordMutationResponseField } from '@/object-record/utils/getDestroyOneRecordMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type useDestroyOneRecordProps = {
|
||||
objectNameSingular: string;
|
||||
|
||||
@ -3,8 +3,8 @@ import gql from 'graphql-tag';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { getDestroyOneRecordMutationResponseField } from '@/object-record/utils/getDestroyOneRecordMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useDestroyOneRecordMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -23,8 +23,8 @@ import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { OnFindManyRecordsCompleted } from '@/object-record/types/OnFindManyRecordsCompleted';
|
||||
import { filterUniqueRecordEdgesByCursor } from '@/object-record/utils/filterUniqueRecordEdgesByCursor';
|
||||
import { getQueryIdentifier } from '@/object-record/utils/getQueryIdentifier';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
import { cursorFamilyState } from '../states/cursorFamilyState';
|
||||
import { hasNextPageFamilyState } from '../states/hasNextPageFamilyState';
|
||||
|
||||
@ -6,7 +6,7 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
||||
import { isAggregationEnabled } from '@/object-metadata/utils/isAggregationEnabled';
|
||||
import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObjectMetadataToGraphQLQuery';
|
||||
import { getFindDuplicateRecordsQueryResponseField } from '@/object-record/utils/getFindDuplicateRecordsQueryResponseField';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const useFindDuplicateRecordsQuery = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -5,7 +5,7 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata
|
||||
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
||||
import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObjectMetadataToGraphQLQuery';
|
||||
import { RecordGqlOperationGqlRecordFields } from '@/object-record/graphql/types/RecordGqlOperationGqlRecordFields';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const useFindOneRecordQuery = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -12,9 +12,9 @@ import { useRestoreManyRecordsMutation } from '@/object-record/hooks/useRestoreM
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { getRestoreManyRecordsMutationResponseField } from '@/object-record/utils/getRestoreManyRecordsMutationResponseField';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { sleep } from '~/utils/sleep';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type useRestoreManyRecordProps = {
|
||||
objectNameSingular: string;
|
||||
|
||||
@ -3,8 +3,8 @@ import gql from 'graphql-tag';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { getRestoreManyRecordsMutationResponseField } from '@/object-record/utils/getRestoreManyRecordsMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useRestoreManyRecordsMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -12,8 +12,8 @@ import { useUpdateOneRecordMutation } from '@/object-record/hooks/useUpdateOneRe
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { getUpdateOneRecordMutationResponseField } from '@/object-record/utils/getUpdateOneRecordMutationResponseField';
|
||||
import { sanitizeRecordInput } from '@/object-record/utils/sanitizeRecordInput';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type useUpdateOneRecordProps = {
|
||||
objectNameSingular: string;
|
||||
|
||||
@ -8,8 +8,8 @@ import { EMPTY_MUTATION } from '@/object-record/constants/EmptyMutation';
|
||||
import { RecordGqlOperationGqlRecordFields } from '@/object-record/graphql/types/RecordGqlOperationGqlRecordFields';
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { getUpdateOneRecordMutationResponseField } from '@/object-record/utils/getUpdateOneRecordMutationResponseField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useUpdateOneRecordMutation = ({
|
||||
objectNameSingular,
|
||||
|
||||
@ -6,8 +6,8 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
||||
import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObjectMetadataToGraphQLQuery';
|
||||
import { RecordGqlOperationSignature } from '@/object-record/graphql/types/RecordGqlOperationSignature';
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isNonEmptyArray } from '~/utils/isNonEmptyArray';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useGenerateCombinedFindManyRecordsQuery = ({
|
||||
operationSignatures,
|
||||
|
||||
@ -7,8 +7,8 @@ import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObje
|
||||
import { RecordGqlOperationSignature } from '@/object-record/graphql/types/RecordGqlOperationSignature';
|
||||
import { getSearchRecordsQueryResponseField } from '@/object-record/utils/getSearchRecordsQueryResponseField';
|
||||
import { isObjectMetadataItemSearchable } from '@/object-record/utils/isObjectMetadataItemSearchable';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isNonEmptyArray } from '~/utils/isNonEmptyArray';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useGenerateCombinedSearchRecordsQuery = ({
|
||||
operationSignatures,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
import { getOperandLabel, getOperandLabelShort } from '../getOperandLabel';
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import {
|
||||
VariableDateViewFilterValueUnit,
|
||||
} from '@/views/view-filter-value/utils/resolveDateViewFilterValue';
|
||||
import { plural } from 'pluralize';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
export const getRelativeDateDisplayValue = (
|
||||
relativeDate: {
|
||||
direction: VariableDateViewFilterValueDirection;
|
||||
|
||||
@ -12,9 +12,9 @@ import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/
|
||||
import { ViewType } from '@/views/types/ViewType';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined, useIcons } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const RecordIndexPageHeader = () => {
|
||||
const { findObjectMetadataItemByNamePlural } =
|
||||
|
||||
@ -12,9 +12,9 @@ import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadat
|
||||
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
||||
import { buildFindOneRecordForShowPageOperationSignature } from '@/object-record/record-show/graphql/operations/factories/findOneRecordForShowPageOperationSignatureFactory';
|
||||
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useRecordShowPage = (
|
||||
propsObjectNameSingular: string,
|
||||
|
||||
@ -10,8 +10,8 @@ import { useRecordIdsFromFindManyCacheRootQuery } from '@/object-record/record-s
|
||||
import { buildShowPageURL } from '@/object-record/record-show/utils/buildShowPageURL';
|
||||
import { buildIndexTablePageURL } from '@/object-record/record-table/utils/buildIndexTableURL';
|
||||
import { useQueryVariablesFromActiveFieldsOfViewOrDefaultView } from '@/views/hooks/useQueryVariablesFromActiveFieldsOfViewOrDefaultView';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useRecordShowPagePagination = (
|
||||
propsObjectNameSingular: string,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { DEFAULT_SEARCH_REQUEST_LIMIT } from '@/object-record/constants/DefaultSearchRequestLimit';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useLimitPerMetadataItem = ({
|
||||
objectMetadataItems,
|
||||
|
||||
@ -11,8 +11,8 @@ import {
|
||||
} from '@/object-record/relation-picker/hooks/useMultiObjectRecordsQueryResultFormattedAsObjectRecordForSelectArray';
|
||||
import { useOrderByFieldPerMetadataItem } from '@/object-record/relation-picker/hooks/useOrderByFieldPerMetadataItem';
|
||||
import { SelectedObjectRecordId } from '@/object-record/types/SelectedObjectRecordId';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const EMPTY_QUERY = gql`
|
||||
query Empty {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { getOrderByFieldForObjectMetadataItem } from '@/object-metadata/utils/getObjectOrderByField';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useOrderByFieldPerMetadataItem = ({
|
||||
objectMetadataItems,
|
||||
|
||||
@ -3,7 +3,7 @@ import gql from 'graphql-tag';
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { RecordGqlFields } from '@/object-record/graphql/types/RecordGqlFields';
|
||||
import { getAggregateQueryName } from '@/object-record/utils/getAggregateQueryName';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const generateAggregateQuery = ({
|
||||
objectMetadataItem,
|
||||
|
||||
@ -3,7 +3,7 @@ import gql from 'graphql-tag';
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObjectMetadataToGraphQLQuery';
|
||||
import { RecordGqlOperationGqlRecordFields } from '@/object-record/graphql/types/RecordGqlOperationGqlRecordFields';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export type QueryCursorDirection = 'before' | 'after';
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObjectMetadataToGraphQLQuery';
|
||||
import { RecordGqlOperationGqlRecordFields } from '@/object-record/graphql/types/RecordGqlOperationGqlRecordFields';
|
||||
import { getSearchRecordsQueryResponseField } from '@/object-record/utils/getSearchRecordsQueryResponseField';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export type QueryCursorDirection = 'before' | 'after';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const getAggregateQueryName = (
|
||||
objectMetadataNamePlural: string,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
||||
import { AGGREGATE_OPERATIONS } from '@/object-record/record-table/constants/AggregateOperations';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type NameForAggregation = {
|
||||
[T in AGGREGATE_OPERATIONS]?: string;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getCreateManyRecordsMutationResponseField = (
|
||||
objectNamePlural: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getCreateOneRecordMutationResponseField = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getDeleteManyRecordsMutationResponseField = (
|
||||
objectNamePlural: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getDeleteOneRecordMutationResponseField = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getDestroyManyRecordsMutationResponseField = (
|
||||
objectNamePlural: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getDestroyOneRecordMutationResponseField = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getRestoreManyRecordsMutationResponseField = (
|
||||
objectNamePlural: string,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getSearchRecordsQueryResponseField = (objectNamePlural: string) =>
|
||||
`search${capitalize(objectNamePlural)}`;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getUpdateOneRecordMutationResponseField = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -10,8 +10,8 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { ObjectFieldRow } from '@/settings/data-model/graph-overview/components/SettingsDataModelOverviewField';
|
||||
import { SettingsDataModelObjectTypeTag } from '@/settings/data-model/objects/components/SettingsDataModelObjectTypeTag';
|
||||
import { getObjectTypeLabel } from '@/settings/data-model/utils/getObjectTypeLabel';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { FieldMetadataType } from '~/generated/graphql';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
import { ObjectFieldRowWithoutRelation } from '@/settings/data-model/graph-overview/components/SettingsDataModelOverviewFieldWithoutRelation';
|
||||
import '@xyflow/react/dist/style.css';
|
||||
|
||||
@ -6,6 +6,7 @@ import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/Snac
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import {
|
||||
Card,
|
||||
IconGoogle,
|
||||
@ -15,7 +16,6 @@ import {
|
||||
} from 'twenty-ui';
|
||||
import { AuthProviders } from '~/generated-metadata/graphql';
|
||||
import { useUpdateWorkspaceMutation } from '~/generated/graphql';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
const StyledSettingsSecurityOptionsList = styled.div`
|
||||
display: flex;
|
||||
|
||||
@ -11,6 +11,7 @@ import styled from '@emotion/styled';
|
||||
import { ReactNode } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import {
|
||||
IconComponent,
|
||||
MOBILE_VIEWPORT,
|
||||
@ -18,7 +19,6 @@ import {
|
||||
TablerIconsProps,
|
||||
} from 'twenty-ui';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
const DEFAULT_INDENTATION_LEVEL = 1;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
|
||||
|
||||
import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';
|
||||
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export type ViewBarPageTitleProps = {
|
||||
viewBarId: string;
|
||||
|
||||
@ -4,12 +4,12 @@ import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { RUN_WORKFLOW_VERSION } from '@/workflow/graphql/mutations/runWorkflowVersion';
|
||||
import { useMutation } from '@apollo/client';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { IconSettingsAutomation } from 'twenty-ui';
|
||||
import {
|
||||
RunWorkflowVersionMutation,
|
||||
RunWorkflowVersionMutationVariables,
|
||||
} from '~/generated/graphql';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useRunWorkflowVersion = () => {
|
||||
const apolloMetadataClient = useApolloMetadataClient();
|
||||
|
||||
@ -2,8 +2,8 @@ import { WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/W
|
||||
import styled from '@emotion/styled';
|
||||
import { Handle, Position } from '@xyflow/react';
|
||||
import React from 'react';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined, OverflowingTextWithTooltip } from 'twenty-ui';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
type Variant = 'placeholder';
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@ import {
|
||||
|
||||
import { TRIGGER_STEP_ID } from '@/workflow/workflow-trigger/constants/TriggerStepId';
|
||||
import { MarkerType } from '@xyflow/react';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { v4 } from 'uuid';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const generateWorkflowDiagram = ({
|
||||
trigger,
|
||||
|
||||
@ -3,8 +3,8 @@ import {
|
||||
WorkflowTrigger,
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { assertUnreachable } from '@/workflow/utils/assertUnreachable';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const getTriggerStepName = (trigger: WorkflowTrigger): string => {
|
||||
switch (trigger.type) {
|
||||
|
||||
Reference in New Issue
Block a user