index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/generated-metadata/gql.ts
/* eslint-disable */ import * as types from './graphql'; import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; /** * Map of all GraphQL operations in the project. * * This map has several performance disadvantages: * 1. It is not tree-shakeable, so it will include all operations in...
1,600
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/generated-metadata/graphql.ts
/* eslint-disable */ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe<T> = T | null; export type InputMaybe<T> = Maybe<T>; export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }; export type MakeOptional<T, K extends keyof T> = Omit<T, ...
1,601
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/generated-metadata/index.ts
export * from "./gql";
1,602
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/generated/graphql.tsx
import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; export type Maybe<T> = T | null; export type InputMaybe<T> = Maybe<T>; export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }; export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe...
1,603
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/hooks/useCombinedRefs.ts
import React, { Ref, RefCallback } from 'react'; import { isFunction } from '@sniptt/guards'; export const useCombinedRefs = <T>(...refs: (Ref<T> | undefined)[]): RefCallback<T> => (node: T) => { for (const ref of refs) { if (isFunction(ref)) { ref(node); } else if (ref !== null && ref !== ...
1,604
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/hooks/useFirstMountState.ts
import { useRef } from 'react'; export const useFirstMountState = (): boolean => { // eslint-disable-next-line twenty/no-state-useref const isFirst = useRef(true); if (isFirst.current) { isFirst.current = false; return true; } return isFirst.current; };
1,605
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/hooks/useIsMatchingLocation.ts
import { matchPath, useLocation } from 'react-router-dom'; import { parse } from 'url'; import { AppBasePath } from '@/types/AppBasePath'; export const useIsMatchingLocation = () => { const location = useLocation(); return (path: string, basePath?: AppBasePath) => { const constructedPath = basePath ? p...
1,606
0
petrpan-code/twentyhq/twenty/front/src
petrpan-code/twentyhq/twenty/front/src/hooks/useUpdateEffect.ts
import { DependencyList, EffectCallback, useEffect } from 'react'; import { useFirstMountState } from './useFirstMountState'; export const useUpdateEffect = ( effect: EffectCallback, deps?: DependencyList, ) => { const isFirst = useFirstMountState(); useEffect(() => { if (!isFirst) { return effect(...
1,607
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment/Comment.tsx
import styled from '@emotion/styled'; import { Comment as CommentType } from '@/activities/types/Comment'; import { CommentHeader } from './CommentHeader'; type CommentProps = { comment: CommentType; actionBar?: React.ReactNode; }; const StyledContainer = styled.div` align-items: flex-start; display: flex; ...
1,608
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment/CommentCounter.tsx
import React from 'react'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { IconComment } from '@/ui/display/icon'; const StyledCommentIcon = styled.div` align-items: center; color: ${({ theme }) => theme.font.color.light}; display: flex; gap: ${({ theme }) => theme.sp...
1,609
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment/CommentHeader.tsx
import { Tooltip } from 'react-tooltip'; import styled from '@emotion/styled'; import { Comment } from '@/activities/types/Comment'; import { Avatar } from '@/users/components/Avatar'; import { beautifyExactDateTime, beautifyPastDateRelativeToNow, } from '~/utils/date-utils'; const StyledContainer = styled.div` ...
1,610
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment/__stories__/Comment.stories.tsx
import { Meta, StoryObj } from '@storybook/react'; import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator'; import { ActivityActionBar } from '../../right-drawer/components/ActivityActionBar'; import { Comment } from '../Comment'; import { mockComment, mockCommentWithLongValues } from './mock-co...
1,611
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment/__stories__/CommentHeader.stories.tsx
import { Meta, StoryObj } from '@storybook/react'; import { DateTime } from 'luxon'; import { ActivityActionBar } from '@/activities/right-drawer/components/ActivityActionBar'; import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator'; import { avatarUrl } from '~/testing/mock-data/users'; import {...
1,612
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment
petrpan-code/twentyhq/twenty/front/src/modules/activities/comment/__stories__/mock-comment.ts
import { DateTime } from 'luxon'; import { Comment } from '@/activities/types/Comment'; export const mockComment: Pick< Comment, 'id' | 'author' | 'createdAt' | 'body' | 'updatedAt' | 'activityId' > = { id: 'fake_comment_1_uuid', body: 'Hello, this is a comment.', author: { id: 'fake_comment_1_author_uu...
1,613
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityBodyEditor.tsx
import { useEffect, useMemo, useState } from 'react'; import { BlockNoteEditor } from '@blocknote/core'; import { useBlockNote } from '@blocknote/react'; import styled from '@emotion/styled'; import debounce from 'lodash.debounce'; import { Activity } from '@/activities/types/Activity'; import { useUpdateOneObjectReco...
1,614
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityComments.tsx
import styled from '@emotion/styled'; import { isNonEmptyString } from '@sniptt/guards'; import { useRecoilValue } from 'recoil'; import { v4 } from 'uuid'; import { Comment } from '@/activities/comment/Comment'; import { Activity } from '@/activities/types/Activity'; import { Comment as CommentType } from '@/activiti...
1,615
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityCreateButton.tsx
import { IconCheckbox, IconNotes, IconTimelineEvent, } from '@/ui/display/icon/index'; import { Button } from '@/ui/input/button/components/Button'; import { ButtonGroup } from '@/ui/input/button/components/ButtonGroup'; type ActivityCreateButtonProps = { onNoteClick?: () => void; onTaskClick?: () => void; ...
1,616
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityEditor.tsx
import React, { useCallback, useRef, useState } from 'react'; import styled from '@emotion/styled'; import { ActivityBodyEditor } from '@/activities/components/ActivityBodyEditor'; import { ActivityComments } from '@/activities/components/ActivityComments'; import { ActivityTypeDropdown } from '@/activities/components...
1,617
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityTargetChips.tsx
import styled from '@emotion/styled'; import { CompanyChip } from '@/companies/components/CompanyChip'; import { PersonChip } from '@/people/components/PersonChip'; import { getLogoUrlFromDomainName } from '~/utils'; const StyledContainer = styled.div` display: flex; flex-wrap: wrap; gap: ${({ theme }) => theme...
1,618
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityTitle.tsx
import styled from '@emotion/styled'; import { ActivityType } from '@/activities/types/Activity'; import { Checkbox, CheckboxShape, CheckboxSize, } from '@/ui/input/components/Checkbox'; const StyledEditableTitleInput = styled.input<{ completed: boolean; value: string; }>` background: transparent; bord...
1,619
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/components/ActivityTypeDropdown.tsx
import { useTheme } from '@emotion/react'; import { Activity } from '@/activities/types/Activity'; import { Chip, ChipAccent, ChipSize, ChipVariant, } from '@/ui/display/chip/components/Chip'; import { IconCheckbox, IconNotes } from '@/ui/display/icon'; type ActivityTypeDropdownProps = { activity: Pick<Acti...
1,620
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/hooks/useHandleCheckableActivityTargetChange.ts
import { ActivityTarget } from '@/activities/types/ActivityTarget'; import { useCreateOneObjectRecord } from '@/object-record/hooks/useCreateOneObjectRecord'; import { useDeleteOneObjectRecord } from '@/object-record/hooks/useDeleteOneObjectRecord'; export const useHandleCheckableActivityTargetChange = ({ activityId...
1,621
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/hooks/useOpenActivityRightDrawer.ts
import { useRecoilState } from 'recoil'; import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer'; import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope'; import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages'; import { useSetHot...
1,622
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/hooks/useOpenCreateActivityDrawer.ts
import { isNonEmptyString } from '@sniptt/guards'; import { useRecoilState, useRecoilValue } from 'recoil'; import { Activity, ActivityType } from '@/activities/types/Activity'; import { ActivityTarget } from '@/activities/types/ActivityTarget'; import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspa...
1,623
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/hooks/useOpenCreateActivityDrawerForSelectedRowIds.ts
import { useRecoilCallback } from 'recoil'; import { ActivityType } from '@/activities/types/Activity'; import { selectedRowIdsSelector } from '@/ui/object/record-table/states/selectors/selectedRowIdsSelector'; import { ActivityTargetableEntity, ActivityTargetableEntityType, } from '../types/ActivityTargetableEnt...
1,624
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/inline-cell
petrpan-code/twentyhq/twenty/front/src/modules/activities/inline-cell/components/ActivityTargetInlineCellEditMode.tsx
import { useCallback, useMemo, useState } from 'react'; import { useQuery } from '@apollo/client'; import styled from '@emotion/styled'; import { useHandleCheckableActivityTargetChange } from '@/activities/hooks/useHandleCheckableActivityTargetChange'; import { ActivityTarget } from '@/activities/types/ActivityTarget'...
1,625
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/inline-cell
petrpan-code/twentyhq/twenty/front/src/modules/activities/inline-cell/components/ActivityTargetsInlineCell.tsx
import { ActivityTargetChips } from '@/activities/components/ActivityTargetChips'; import { ActivityTargetInlineCellEditMode } from '@/activities/inline-cell/components/ActivityTargetInlineCellEditMode'; import { ActivityTarget } from '@/activities/types/ActivityTarget'; import { GraphQLActivity } from '@/activities/ty...
1,626
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes/components/NoteCard.tsx
import { useMemo } from 'react'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { useOpenActivityRightDrawer } from '@/activities/hooks/useOpenActivityRightDrawer'; import { ActivityTargetsInlineCell } from '@/activities/inline-cell/components/ActivityTargetsInlineCell'; import...
1,627
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes/components/NoteList.tsx
import { ReactElement } from 'react'; import styled from '@emotion/styled'; import { Note } from '@/activities/types/Note'; import { NoteCard } from './NoteCard'; type NoteListProps = { title: string; notes: Note[]; button?: ReactElement | false; }; const StyledContainer = styled.div` align-items: flex-star...
1,628
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes/components/Notes.tsx
import styled from '@emotion/styled'; import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer'; import { NoteList } from '@/activities/notes/components/NoteList'; import { useNotes } from '@/activities/notes/hooks/useNotes'; import { ActivityTargetableEntity } from '@/activities/typ...
1,629
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes
petrpan-code/twentyhq/twenty/front/src/modules/activities/notes/hooks/useNotes.ts
import { Note } from '@/activities/types/Note'; import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords'; import { ActivityTargetableEntity } from '../../types/ActivityTargetableEntity'; export const useNotes = (entity: ActivityTargetableEntity) => { const { objects: activityTargets...
1,630
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer/components/ActivityActionBar.tsx
import { useRecoilState } from 'recoil'; import { useDeleteOneObjectRecord } from '@/object-record/hooks/useDeleteOneObjectRecord'; import { IconTrash } from '@/ui/display/icon'; import { LightIconButton } from '@/ui/input/button/components/LightIconButton'; import { isRightDrawerOpenState } from '@/ui/layout/right-dr...
1,631
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer/components/RightDrawerActivity.tsx
import React from 'react'; import styled from '@emotion/styled'; import { useRecoilState } from 'recoil'; import { ActivityEditor } from '@/activities/components/ActivityEditor'; import { Activity } from '@/activities/types/Activity'; import { useFindOneObjectRecord } from '@/object-record/hooks/useFindOneObjectRecord...
1,632
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer/components
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer/components/create/RightDrawerCreateActivity.tsx
import { useRecoilValue } from 'recoil'; import { viewableActivityIdState } from '@/activities/states/viewableActivityIdState'; import { RightDrawerActivity } from '../RightDrawerActivity'; export const RightDrawerCreateActivity = () => { const viewableActivityId = useRecoilValue(viewableActivityIdState); retur...
1,633
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer/components
petrpan-code/twentyhq/twenty/front/src/modules/activities/right-drawer/components/edit/RightDrawerEditActivity.tsx
import { useRecoilValue } from 'recoil'; import { viewableActivityIdState } from '@/activities/states/viewableActivityIdState'; import { RightDrawerActivity } from '../RightDrawerActivity'; export const RightDrawerEditActivity = () => { const viewableActivityId = useRecoilValue(viewableActivityIdState); return ...
1,634
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/states/activityTargetableEntityArrayState.ts
import { atom } from 'recoil'; import { ActivityTargetableEntity } from '../types/ActivityTargetableEntity'; export const activityTargetableEntityArrayState = atom< ActivityTargetableEntity[] >({ key: 'activities/targetable-entity-array', default: [], });
1,635
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/states/viewableActivityIdState.ts
import { atom } from 'recoil'; export const viewableActivityIdState = atom<string | null>({ key: 'activities/viewable-activity-id', default: null, });
1,636
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/states
petrpan-code/twentyhq/twenty/front/src/modules/activities/states/recoil-scope-contexts/TasksRecoilScopeContext.ts
import { createContext } from 'react'; export const TasksRecoilScopeContext = createContext<string | null>(null);
1,637
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/table
petrpan-code/twentyhq/twenty/front/src/modules/activities/table/components/CellCommentChip.tsx
import styled from '@emotion/styled'; import { CommentChip, CommentChipProps } from './CommentChip'; type CellCommentChipProps = CommentChipProps; // TODO: tie those fixed values to the other components in the cell const StyledCellWrapper = styled.div``; export const CellCommentChip = ({ count, onClick }: CellComme...
1,638
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/table
petrpan-code/twentyhq/twenty/front/src/modules/activities/table/components/CommentChip.tsx
import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { IconComment } from '@/ui/display/icon'; export type CommentChipProps = { count: number; onClick?: (event: React.MouseEvent<HTMLDivElement>) => void; }; const StyledChip = styled.div` align-items: center; backdrop-filter...
1,639
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/table/components
petrpan-code/twentyhq/twenty/front/src/modules/activities/table/components/__stories__/CommentChip.stories.tsx
import styled from '@emotion/styled'; import { Meta, StoryObj } from '@storybook/react'; import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator'; import { CommentChip } from '../CommentChip'; const meta: Meta<typeof CommentChip> = { title: 'Modules/Comments/CommentChip', component: CommentCh...
1,640
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/__stories__/TaskGroups.stories.tsx
import { Meta, StoryObj } from '@storybook/react'; import { TasksRecoilScopeContext } from '@/activities/states/recoil-scope-contexts/TasksRecoilScopeContext'; import { TaskGroups } from '@/activities/tasks/components/TaskGroups'; import { ObjectFilterDropdownScope } from '@/ui/object/object-filter-dropdown/scopes/Obj...
1,641
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/__stories__/TaskList.stories.tsx
import { MemoryRouter } from 'react-router-dom'; import { Meta, StoryObj } from '@storybook/react'; import { TaskList } from '@/activities/tasks/components/TaskList'; import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedActi...
1,642
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/components/AddTaskButton.tsx
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer'; import { ActivityTargetableEntity } from '@/activities/types/ActivityTargetableEntity'; import { IconPlus } from '@/ui/display/icon'; import { Button } from '@/ui/input/button/components/Button'; export const AddTaskButton = ...
1,643
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/components/EntityTasks.tsx
import styled from '@emotion/styled'; import { TasksRecoilScopeContext } from '@/activities/states/recoil-scope-contexts/TasksRecoilScopeContext'; import { TaskGroups } from '@/activities/tasks/components/TaskGroups'; import { ActivityTargetableEntity } from '@/activities/types/ActivityTargetableEntity'; import { Obje...
1,644
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/components/PageAddTaskButton.tsx
import { isNonEmptyString } from '@sniptt/guards'; import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer'; import { PageAddButton } from '@/ui/layout/page/PageAddButton'; import { useFilter } from '@/ui/object/object-filter-dropdown/hooks/useFilter'; export const PageAddTaskButto...
1,645
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/components/TaskGroups.tsx
import styled from '@emotion/styled'; import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer'; import { TasksRecoilScopeContext } from '@/activities/states/recoil-scope-contexts/TasksRecoilScopeContext'; import { useTasks } from '@/activities/tasks/hooks/useTasks'; import { Activit...
1,646
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/components/TaskList.tsx
import { ReactElement } from 'react'; import styled from '@emotion/styled'; import { Activity } from '@/activities/types/Activity'; import { GraphQLActivity } from '@/activities/types/GraphQLActivity'; import { TaskRow } from './TaskRow'; type TaskListProps = { title?: string; tasks: Omit<Activity, 'assigneeId'>...
1,647
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/components/TaskRow.tsx
import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { isNonEmptyString } from '@sniptt/guards'; import { ActivityTargetChips } from '@/activities/components/ActivityTargetChips'; import { useOpenActivityRightDrawer } from '@/activities/hooks/useOpenActivityRightDrawer'; import { Act...
1,648
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/hooks/useCompleteTask.ts
import { useCallback } from 'react'; import { Activity } from '@/activities/types/Activity'; import { useUpdateOneObjectRecord } from '@/object-record/hooks/useUpdateOneObjectRecord'; type Task = Pick<Activity, 'id' | 'completedAt'>; export const useCompleteTask = (task: Task) => { const { updateOneObject } = useU...
1,649
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts
import { DateTime } from 'luxon'; import { useRecoilValue } from 'recoil'; import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords'; import { parseDate } from '~/utils/date-utils'; export const us...
1,650
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks
petrpan-code/twentyhq/twenty/front/src/modules/activities/tasks/hooks/useTasks.ts
import { isNonEmptyString } from '@sniptt/guards'; import { DateTime } from 'luxon'; import { undefined } from 'zod'; import { Activity } from '@/activities/types/Activity'; import { ActivityTargetableEntity } from '@/activities/types/ActivityTargetableEntity'; import { useFindManyObjectRecords } from '@/object-record...
1,651
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline/components/Timeline.tsx
import React from 'react'; import styled from '@emotion/styled'; import { ActivityCreateButton } from '@/activities/components/ActivityCreateButton'; import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer'; import { Activity } from '@/activities/types/Activity'; import { ActivityTa...
1,652
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline/components/TimelineActivity.tsx
import { Tooltip } from 'react-tooltip'; import styled from '@emotion/styled'; import { isNonEmptyString } from '@sniptt/guards'; import { useOpenActivityRightDrawer } from '@/activities/hooks/useOpenActivityRightDrawer'; import { useCompleteTask } from '@/activities/tasks/hooks/useCompleteTask'; import { Activity } f...
1,653
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline/components/TimelineActivityCardFooter.tsx
import { isNonEmptyArray } from '@apollo/client/utilities'; import styled from '@emotion/styled'; import CommentCounter from '@/activities/comment/CommentCounter'; import { Activity } from '@/activities/types/Activity'; import { UserChip } from '@/users/components/UserChip'; import { WorkspaceMember } from '@/workspac...
1,654
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline/components/TimelineActivityTitle.tsx
import styled from '@emotion/styled'; import { ActivityType } from '@/activities/types/Activity'; import { OverflowingTextWithTooltip } from '@/ui/display/tooltip/OverflowingTextWithTooltip'; import { Checkbox, CheckboxShape } from '@/ui/input/components/Checkbox'; const StyledTitleContainer = styled.div` color: ${...
1,655
0
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline
petrpan-code/twentyhq/twenty/front/src/modules/activities/timeline/components/TimelineItemsContainer.tsx
import React from 'react'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { ActivityForDrawer } from '@/activities/types/ActivityForDrawer'; import { IconCircleDot } from '@/ui/display/icon'; import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper'; impor...
1,656
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/Activity.ts
import { ActivityTarget } from '@/activities/types/ActivityTarget'; import { Comment } from '@/activities/types/Comment'; import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember'; export type ActivityType = 'Task' | 'Note'; export type Activity = { __typename: 'Activity'; id: string; createdAt...
1,657
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/ActivityForDrawer.ts
import { Activity } from '@/activities/types/Activity'; export type ActivityForDrawer = Activity;
1,658
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/ActivityTarget.ts
import { Activity } from '@/activities/types/Activity'; import { Company } from '@/companies/types/Company'; import { Person } from '@/people/types/Person'; export type ActivityTarget = { id: string; createdAt: string; updatedAt: string; companyId: string | null; personId: string | null; activity: Pick<Act...
1,659
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/ActivityTargetableEntity.ts
export type ActivityTargetableEntityType = 'Person' | 'Company'; export type ActivityTargetableEntity = { id: string; type: ActivityTargetableEntityType; relatedEntities?: ActivityTargetableEntity[]; };
1,660
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/ActivityTargetableEntityForSelect.ts
import { EntityForSelect } from '@/ui/input/relation-picker/types/EntityForSelect'; import { ActivityTargetableEntityType } from './ActivityTargetableEntity'; export type ActivityTargetableEntityForSelect = EntityForSelect & { entityType: ActivityTargetableEntityType; };
1,661
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/Comment.ts
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember'; export type Comment = { id: string; createdAt: string; body: string; updatedAt: string; activityId: string; author: Pick<WorkspaceMember, 'id' | 'name' | 'avatarUrl'>; };
1,662
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/GraphQLActivity.ts
import { ActivityTarget } from '@/activities/types/ActivityTarget'; import { Comment } from '@/activities/types/Comment'; import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember'; export type ActivityType = 'Task' | 'Note'; type ActivityTargetNode = { node: ActivityTarget; }; type CommentNode = {...
1,663
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/Note.ts
import { Activity } from '@/activities/types/Activity'; export type Note = Activity & { type: 'Note'; };
1,664
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/types/Task.ts
import { Activity } from '@/activities/types/Activity'; export type Task = Activity & { type: 'Task'; };
1,665
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/utils/flatMapAndSortEntityForSelectArrayByName.ts
import { EntityForSelect } from '@/ui/input/relation-picker/types/EntityForSelect'; export const flatMapAndSortEntityForSelectArrayOfArrayByName = < T extends EntityForSelect, >( entityForSelectArray: T[][], ) => { const sortByName = (a: T, b: T) => a.name.localeCompare(b.name); return entityForSelectArray.fl...
1,666
0
petrpan-code/twentyhq/twenty/front/src/modules/activities
petrpan-code/twentyhq/twenty/front/src/modules/activities/utils/getTargetableEntitiesWithParents.ts
import { ActivityTargetableEntity } from '../types/ActivityTargetableEntity'; export const getTargetableEntitiesWithParents = ( entities: ActivityTargetableEntity[], ): ActivityTargetableEntity[] => { const entitiesWithRelations: ActivityTargetableEntity[] = []; for (const entity of entities ?? []) { entitie...
1,667
0
petrpan-code/twentyhq/twenty/front/src/modules/analytics/graphql
petrpan-code/twentyhq/twenty/front/src/modules/analytics/graphql/queries/createEvent.ts
import { gql } from '@apollo/client'; export const CREATE_EVENT = gql` mutation CreateEvent($type: String!, $data: JSON!) { createEvent(type: $type, data: $data) { success } } `;
1,668
0
petrpan-code/twentyhq/twenty/front/src/modules/analytics
petrpan-code/twentyhq/twenty/front/src/modules/analytics/hooks/useEventTracker.ts
import { useCallback } from 'react'; import { useRecoilState } from 'recoil'; import { telemetryState } from '@/client-config/states/telemetryState'; import { useCreateEventMutation } from '~/generated/graphql'; interface EventLocation { pathname: string; } export interface EventData { location: EventLocation; }...
1,669
0
petrpan-code/twentyhq/twenty/front/src/modules/analytics
petrpan-code/twentyhq/twenty/front/src/modules/analytics/hooks/useTrackEvent.ts
import { EventData, useEventTracker } from './useEventTracker'; export const useTrackEvent = (eventType: string, eventData: EventData) => { const eventTracker = useEventTracker(); return eventTracker(eventType, eventData); };
1,670
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/components/ApolloProvider.tsx
import { ApolloProvider as ApolloProviderBase } from '@apollo/client'; import { useApolloFactory } from '@/apollo/hooks/useApolloFactory'; export const ApolloProvider = ({ children }: React.PropsWithChildren) => { const apolloClient = useApolloFactory(); // This will attach the right apollo client to Apollo Dev ...
1,671
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/hooks/useApolloFactory.ts
import { useMemo, useRef } from 'react'; import { useNavigate } from 'react-router-dom'; import { InMemoryCache, NormalizedCacheObject } from '@apollo/client'; import { useRecoilState } from 'recoil'; import { tokenPairState } from '@/auth/states/tokenPairState'; import { isDebugModeState } from '@/client-config/state...
1,672
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/hooks/useOptimisticEffect.ts
import { ApolloCache, DocumentNode, OperationVariables, useApolloClient, } from '@apollo/client'; import { isNonEmptyArray } from '@sniptt/guards'; import { useRecoilCallback } from 'recoil'; import { EMPTY_QUERY, useObjectMetadataItem, } from '@/object-metadata/hooks/useObjectMetadataItem'; import { Objec...
1,673
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/hooks/useOptimisticEvict.ts
import { useApolloClient } from '@apollo/client'; export const useOptimisticEvict = () => { const cache = useApolloClient().cache; const performOptimisticEvict = ( typename: string, fieldName: string, fieldValue: string, ) => { const serializedCache = cache.extract(); Object.values(serializ...
1,674
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/states/optimisticEffectState.ts
import { atom } from 'recoil'; import { OptimisticEffect } from '../types/internal/OptimisticEffect'; export const optimisticEffectState = atom< Record<string, OptimisticEffect<unknown>> >({ key: 'optimisticEffectState', default: {}, });
1,675
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/types/OptimisticEffectDefinition.ts
import { DocumentNode } from 'graphql'; import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { OptimisticEffectResolver } from './OptimisticEffectResolver'; export type OptimisticEffectDefinition = { key: string; query?: DocumentNode; typename: string; resolver: OptimisticE...
1,676
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/types/OptimisticEffectResolver.ts
import { OperationVariables } from '@apollo/client'; export type OptimisticEffectResolver = ({ currentData, newData, variables, }: { currentData: any; //TODO: Change when decommissioning v1 newData: any; //TODO: Change when decommissioning v1 variables: OperationVariables; }) => void;
1,677
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/types
petrpan-code/twentyhq/twenty/front/src/modules/apollo/optimistic-effect/types/internal/OptimisticEffect.ts
import { ApolloCache, DocumentNode, OperationVariables } from '@apollo/client'; import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; type OptimisticEffectWriter<T> = ({ cache, newData, variables, query, }: { cache: ApolloCache<T>; query: DocumentNode; newData: T; variables:...
1,678
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/services/apollo.factory.ts
/* eslint-disable no-loop-func */ import { ApolloClient, ApolloClientOptions, ApolloLink, fromPromise, ServerError, ServerParseError, } from '@apollo/client'; import { GraphQLErrors } from '@apollo/client/errors'; import { setContext } from '@apollo/client/link/context'; import { onError } from '@apollo/cli...
1,679
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/types/apolloManager.interface.ts
import { ApolloClient } from '@apollo/client'; import { AuthTokenPair } from '~/generated/graphql'; export interface ApolloManager<TCacheShape> { getClient(): ApolloClient<TCacheShape>; updateTokenPair(tokenPair: AuthTokenPair | null): void; }
1,680
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/types/operation-type.ts
export enum OperationType { Query = 'query', Mutation = 'mutation', Subscription = 'subscription', Error = 'error', }
1,681
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/utils/format-title.ts
import { OperationType } from '../types/operation-type'; const operationTypeColors = { // eslint-disable-next-line twenty/no-hardcoded-colors query: '#03A9F4', // eslint-disable-next-line twenty/no-hardcoded-colors mutation: '#61A600', // eslint-disable-next-line twenty/no-hardcoded-colors subscription: '#...
1,682
0
petrpan-code/twentyhq/twenty/front/src/modules/apollo
petrpan-code/twentyhq/twenty/front/src/modules/apollo/utils/index.ts
import { ApolloLink, gql, Operation } from '@apollo/client'; import { logDebug } from '~/utils/logDebug'; import { logError } from '~/utils/logError'; import formatTitle from './format-title'; const getGroup = (collapsed: boolean) => collapsed ? console.groupCollapsed.bind(console) : console.group.bind(con...
1,683
0
petrpan-code/twentyhq/twenty/front/src/modules/attachments
petrpan-code/twentyhq/twenty/front/src/modules/attachments/types/Attachment.ts
export type Attachment = { id: string; createdAt: Date; updatedAt: Date; deletedAt: Date | null; };
1,684
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/components/Logo.tsx
import styled from '@emotion/styled'; import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI'; type LogoProps = { workspaceLogo?: string | null; }; const StyledContainer = styled.div` height: 48px; margin-bottom: ${({ theme }) => theme.spacing(4)}; margin-top: ${({ theme }) =...
1,685
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/components/Modal.tsx
import React from 'react'; import styled from '@emotion/styled'; import { Modal as UIModal } from '@/ui/layout/modal/components/Modal'; const StyledContent = styled(UIModal.Content)` align-items: center; width: calc(400px - ${({ theme }) => theme.spacing(10 * 2)}); `; type AuthModalProps = { children: React.Reac...
1,686
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/components/SubTitle.tsx
import { JSX, ReactNode } from 'react'; import styled from '@emotion/styled'; type SubTitleProps = { children: ReactNode; }; const StyledSubTitle = styled.div` color: ${({ theme }) => theme.font.color.secondary}; `; export const SubTitle = ({ children }: SubTitleProps): JSX.Element => ( <StyledSubTitle>{childr...
1,687
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/components/Title.tsx
import React from 'react'; import styled from '@emotion/styled'; import { AnimatedEaseIn } from '@/ui/utilities/animation/components/AnimatedEaseIn'; type TitleProps = React.PropsWithChildren & { animate?: boolean; }; const StyledTitle = styled.div` color: ${({ theme }) => theme.font.color.primary}; font-size:...
1,688
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/fragments/authFragments.ts
import { gql } from '@apollo/client'; export const AUTH_TOKEN = gql` fragment AuthTokenFragment on AuthToken { token expiresAt } `; export const AUTH_TOKENS = gql` fragment AuthTokensFragment on AuthTokenPair { accessToken { ...AuthTokenFragment } refreshToken { ...AuthTokenFragm...
1,689
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/mutations/challenge.ts
import { gql } from '@apollo/client'; export const CHALLENGE = gql` mutation Challenge($email: String!, $password: String!) { challenge(email: $email, password: $password) { loginToken { ...AuthTokenFragment } } } `;
1,690
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/mutations/generateApiKeyToken.ts
import { gql } from '@apollo/client'; export const GENERATE_ONE_API_KEY_TOKEN = gql` mutation GenerateApiKeyToken($apiKeyId: String!, $expiresAt: String!) { generateApiKeyToken(apiKeyId: $apiKeyId, expiresAt: $expiresAt) { token } } `;
1,691
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/mutations/impersonate.ts
import { gql } from '@apollo/client'; // TODO: Fragments should be used instead of duplicating the user fields ! export const IMPERSONATE = gql` mutation Impersonate($userId: String!) { impersonate(userId: $userId) { user { ...UserQueryFragment } tokens { ...AuthTokensFragment ...
1,692
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/mutations/renewToken.ts
import { gql } from '@apollo/client'; export const RENEW_TOKEN = gql` mutation RenewToken($refreshToken: String!) { renewToken(refreshToken: $refreshToken) { tokens { ...AuthTokensFragment } } } `;
1,693
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/mutations/signUp.ts
import { gql } from '@apollo/client'; export const SIGN_UP = gql` mutation SignUp( $email: String! $password: String! $workspaceInviteHash: String ) { signUp( email: $email password: $password workspaceInviteHash: $workspaceInviteHash ) { loginToken { ...AuthToke...
1,694
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/mutations/verify.ts
import { gql } from '@apollo/client'; export const VERIFY = gql` mutation Verify($loginToken: String!) { verify(loginToken: $loginToken) { user { ...UserQueryFragment } tokens { ...AuthTokensFragment } } } `;
1,695
0
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql
petrpan-code/twentyhq/twenty/front/src/modules/auth/graphql/queries/checkUserExists.ts
import { gql } from '@apollo/client'; export const CHECK_USER_EXISTS = gql` query CheckUserExists($email: String!) { checkUserExists(email: $email) { exists } } `;
1,696
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/hooks/useAuth.ts
import { useCallback } from 'react'; import { useApolloClient } from '@apollo/client'; import { snapshot_UNSTABLE, useGotoRecoilSnapshot, useRecoilState, useSetRecoilState, } from 'recoil'; import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; import { currentWorkspaceState }...
1,697
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/hooks/useIsLogged.ts
import { useRecoilState, useRecoilValue } from 'recoil'; import { isVerifyPendingState } from '@/auth/states/isVerifyPendingState'; import { tokenPairState } from '../states/tokenPairState'; export const useIsLogged = (): boolean => { const [tokenPair] = useRecoilState(tokenPairState); const isVerifyPending = us...
1,698
0
petrpan-code/twentyhq/twenty/front/src/modules/auth
petrpan-code/twentyhq/twenty/front/src/modules/auth/hooks/useOnboardingStatus.ts
import { useRecoilValue } from 'recoil'; import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState'; import { useIsLogged } from '../hooks/useIsLogged'; import { getOnboardingStatus, OnboardingStatus, } from ...
1,699