Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3516703144 | ||
|
|
31111faeb9 |
@@ -202,6 +202,14 @@ jobs:
|
||||
with:
|
||||
tag: scope:frontend
|
||||
tasks: ${{ matrix.task }}
|
||||
- name: Check for coverage threshold failure
|
||||
if: always() && steps.run-task.outcome == 'failure' && matrix.task == 'test'
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::error::The test task failed. If no individual test is failing, this is likely a coverage threshold not being met."
|
||||
echo ""
|
||||
echo "To debug locally, run: npx nx run twenty-front:test:ci"
|
||||
exit 1
|
||||
- name: Save ${{ matrix.task }} cache
|
||||
uses: ./.github/actions/save-cache
|
||||
with:
|
||||
|
||||
+4
-4
@@ -91,10 +91,10 @@
|
||||
"@storybook/react-vite": "^10.1.11",
|
||||
"@storybook/test-runner": "^0.24.2",
|
||||
"@stylistic/eslint-plugin": "^1.5.0",
|
||||
"@swc-node/register": "1.11.1",
|
||||
"@swc-node/register": "1.8.0",
|
||||
"@swc/cli": "^0.3.12",
|
||||
"@swc/core": "1.15.11",
|
||||
"@swc/helpers": "~0.5.18",
|
||||
"@swc/core": "1.13.3",
|
||||
"@swc/helpers": "~0.5.2",
|
||||
"@swc/jest": "^0.2.39",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
@@ -137,7 +137,7 @@
|
||||
"@typescript-eslint/parser": "^8.39.0",
|
||||
"@typescript-eslint/utils": "^8.39.0",
|
||||
"@typescript/native-preview": "^7.0.0-dev.20260116.1",
|
||||
"@vitejs/plugin-react-swc": "4.2.3",
|
||||
"@vitejs/plugin-react-swc": "3.11.0",
|
||||
"@vitest/browser-playwright": "^4.0.18",
|
||||
"@vitest/coverage-istanbul": "^4.0.18",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
## Base documentation
|
||||
|
||||
- Documentation: https://docs.twenty.com/developers/extend/capabilities/apps
|
||||
- Rich app example: https://github.com/twentyhq/twenty/tree/main/packages/twenty-sdk/src/cli/__tests__/apps/rich-app
|
||||
|
||||
## Common Pitfalls
|
||||
|
||||
- Creating an object without an index view associated. Unless this is a technical object, user will need to visualize it.
|
||||
- Creating a view without a navigationMenuItem associated. This will make the view available on the left sidebar.
|
||||
@@ -36,10 +36,6 @@ yarn twenty function:execute # Execute a function with JSON payload
|
||||
yarn twenty app:uninstall # Uninstall app from workspace
|
||||
```
|
||||
|
||||
## LLMs instructions
|
||||
|
||||
Main docs and pitfalls are available in LLMS.md file.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Twenty applications, take a look at the following resources:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lingui/cli": "^5.1.2",
|
||||
"@lingui/swc-plugin": "^5.11.0",
|
||||
"@lingui/swc-plugin": "^5.6.0",
|
||||
"@lingui/vite-plugin": "^5.1.2",
|
||||
"@react-email/preview-server": "5.1.0",
|
||||
"@tiptap/core": "^3.4.2",
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lingui/cli": "^5.1.2",
|
||||
"@lingui/swc-plugin": "^5.11.0",
|
||||
"@lingui/swc-plugin": "^5.6.0",
|
||||
"@lingui/vite-plugin": "^5.1.2",
|
||||
"@playwright/test": "^1.56.1",
|
||||
"@tiptap/suggestion": "3.4.2",
|
||||
|
||||
@@ -1045,7 +1045,7 @@ export type CreateNavigationMenuItemInput = {
|
||||
icon?: InputMaybe<Scalars['String']>;
|
||||
link?: InputMaybe<Scalars['String']>;
|
||||
name?: InputMaybe<Scalars['String']>;
|
||||
position?: InputMaybe<Scalars['Float']>;
|
||||
position?: InputMaybe<Scalars['Int']>;
|
||||
targetObjectMetadataId?: InputMaybe<Scalars['UUID']>;
|
||||
targetRecordId?: InputMaybe<Scalars['UUID']>;
|
||||
userWorkspaceId?: InputMaybe<Scalars['UUID']>;
|
||||
@@ -3378,12 +3378,6 @@ export type ObjectPermissionInput = {
|
||||
objectMetadataId: Scalars['UUID'];
|
||||
};
|
||||
|
||||
export type ObjectRecordCount = {
|
||||
__typename?: 'ObjectRecordCount';
|
||||
objectNamePlural: Scalars['String'];
|
||||
totalCount: Scalars['Int'];
|
||||
};
|
||||
|
||||
export type ObjectRecordEvent = {
|
||||
__typename?: 'ObjectRecordEvent';
|
||||
action: DatabaseEventAction;
|
||||
@@ -3757,7 +3751,6 @@ export type Query = {
|
||||
navigationMenuItem?: Maybe<NavigationMenuItem>;
|
||||
navigationMenuItems: Array<NavigationMenuItem>;
|
||||
object: Object;
|
||||
objectRecordCounts: Array<ObjectRecordCount>;
|
||||
objects: ObjectConnection;
|
||||
pieChartData: PieChartDataOutput;
|
||||
skill?: Maybe<Skill>;
|
||||
@@ -4570,11 +4563,13 @@ export type UpdateLogicFunctionFromSourceInput = {
|
||||
};
|
||||
|
||||
export type UpdateLogicFunctionFromSourceInputUpdates = {
|
||||
checksum?: InputMaybe<Scalars['String']>;
|
||||
cronTriggerSettings?: InputMaybe<Scalars['JSON']>;
|
||||
databaseEventTriggerSettings?: InputMaybe<Scalars['JSON']>;
|
||||
description?: InputMaybe<Scalars['String']>;
|
||||
handlerName?: InputMaybe<Scalars['String']>;
|
||||
httpRouteTriggerSettings?: InputMaybe<Scalars['JSON']>;
|
||||
isBuildUpToDate?: InputMaybe<Scalars['Boolean']>;
|
||||
isTool?: InputMaybe<Scalars['Boolean']>;
|
||||
name?: InputMaybe<Scalars['String']>;
|
||||
sourceHandlerCode?: InputMaybe<Scalars['String']>;
|
||||
@@ -4588,7 +4583,7 @@ export type UpdateNavigationMenuItemInput = {
|
||||
icon?: InputMaybe<Scalars['String']>;
|
||||
link?: InputMaybe<Scalars['String']>;
|
||||
name?: InputMaybe<Scalars['String']>;
|
||||
position?: InputMaybe<Scalars['Float']>;
|
||||
position?: InputMaybe<Scalars['Int']>;
|
||||
};
|
||||
|
||||
export type UpdateObjectPayload = {
|
||||
@@ -5961,11 +5956,6 @@ export type ObjectMetadataItemsQueryVariables = Exact<{ [key: string]: never; }>
|
||||
|
||||
export type ObjectMetadataItemsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', edges: Array<{ __typename?: 'ObjectEdge', node: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, isCustom: boolean, isRemote: boolean, isActive: boolean, isSystem: boolean, isUIReadOnly: boolean, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId?: string | null, imageIdentifierFieldMetadataId?: string | null, applicationId: string, shortcut?: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, duplicateCriteria?: Array<Array<string>> | null, indexMetadataList: Array<{ __typename?: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause?: string | null, indexType: IndexType, isUnique: boolean, isCustom?: boolean | null, indexFieldMetadataList: Array<{ __typename?: 'IndexField', id: string, fieldMetadataId: string, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename?: 'Field', id: string, type: FieldMetadataType, name: string, label: string, description?: string | null, icon?: string | null, isCustom?: boolean | null, isActive?: boolean | null, isSystem?: boolean | null, isUIReadOnly?: boolean | null, isNullable?: boolean | null, isUnique?: boolean | null, createdAt: string, updatedAt: string, defaultValue?: any | null, options?: any | null, settings?: any | null, isLabelSyncedWithName?: boolean | null, morphId?: string | null, applicationId: string, relation?: { __typename?: 'Relation', type: RelationType, sourceObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'Field', id: string, name: string }, targetFieldMetadata: { __typename?: 'Field', id: string, name: string } } | null, morphRelations?: Array<{ __typename?: 'Relation', type: RelationType, sourceObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'Field', id: string, name: string }, targetFieldMetadata: { __typename?: 'Field', id: string, name: string } }> | null }> } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } };
|
||||
|
||||
export type ObjectRecordCountsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type ObjectRecordCountsQuery = { __typename?: 'Query', objectRecordCounts: Array<{ __typename?: 'ObjectRecordCount', objectNamePlural: string, totalCount: number }> };
|
||||
|
||||
export type SkipBookOnboardingStepMutationVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
@@ -11452,41 +11442,6 @@ export function useObjectMetadataItemsLazyQuery(baseOptions?: Apollo.LazyQueryHo
|
||||
export type ObjectMetadataItemsQueryHookResult = ReturnType<typeof useObjectMetadataItemsQuery>;
|
||||
export type ObjectMetadataItemsLazyQueryHookResult = ReturnType<typeof useObjectMetadataItemsLazyQuery>;
|
||||
export type ObjectMetadataItemsQueryResult = Apollo.QueryResult<ObjectMetadataItemsQuery, ObjectMetadataItemsQueryVariables>;
|
||||
export const ObjectRecordCountsDocument = gql`
|
||||
query ObjectRecordCounts {
|
||||
objectRecordCounts {
|
||||
objectNamePlural
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useObjectRecordCountsQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useObjectRecordCountsQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useObjectRecordCountsQuery` 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 } = useObjectRecordCountsQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useObjectRecordCountsQuery(baseOptions?: Apollo.QueryHookOptions<ObjectRecordCountsQuery, ObjectRecordCountsQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useQuery<ObjectRecordCountsQuery, ObjectRecordCountsQueryVariables>(ObjectRecordCountsDocument, options);
|
||||
}
|
||||
export function useObjectRecordCountsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ObjectRecordCountsQuery, ObjectRecordCountsQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useLazyQuery<ObjectRecordCountsQuery, ObjectRecordCountsQueryVariables>(ObjectRecordCountsDocument, options);
|
||||
}
|
||||
export type ObjectRecordCountsQueryHookResult = ReturnType<typeof useObjectRecordCountsQuery>;
|
||||
export type ObjectRecordCountsLazyQueryHookResult = ReturnType<typeof useObjectRecordCountsLazyQuery>;
|
||||
export type ObjectRecordCountsQueryResult = Apollo.QueryResult<ObjectRecordCountsQuery, ObjectRecordCountsQueryVariables>;
|
||||
export const SkipBookOnboardingStepDocument = gql`
|
||||
mutation SkipBookOnboardingStep {
|
||||
skipBookOnboardingStep {
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} Objekte"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}ste} other {{num}de}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount, plural, zero {لا كائنات} one {كائن وا
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objectes"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}r} other {{num}è}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objektů"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}.} few {{num}.} many {{num}.} other {{num}.}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objekter"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}ste} other {{num}te}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} Objekte"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}.} other {{num}.}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} Αντικείμενα"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}η} other {{num}η}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -306,11 +306,6 @@ msgstr "{morphRelationCount} Objects"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr "{numberOfSelectedItems} workspace members"
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objetos"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}º} other {{num}.º}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objektia"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}.} other {{num}.}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objets"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}er} other {{num}e}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} אובייקטים"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num} ראשון} two {{num} שני} many {{num} ־ות} other {{num} ־ות}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objektum"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}-ik} other {{num}-ik}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} oggetti"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} 個のオブジェクト"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, other {{num}番目}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "객체 {morphRelationCount}개"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, other {{num}번째}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objecten"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}e} other {{num}e}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objekter"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}.} other {{num}.}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount, plural, one {# obiekt} few {# obiekty} many {# obie
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}sz} two {{num}gi} few {{num}ci} other {{num}ty}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -306,11 +306,6 @@ msgstr ""
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objetos"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}º} other {{num}º}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} Objetos"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}º} other {{num}º}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} obiecte"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}st} few {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
Binary file not shown.
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} објеката"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}ст} few {{num}нд} other {{num}ти}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} objekt"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}:a} other {{num}e}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} Nesne"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}'inci} other {{num}'inci}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} об’єктів"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, one {{num}-й} few {{num}-й} many {{num}-й} other {{num}-й}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} Đối tượng"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, other {{num}}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} 个对象"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, other {{num}th}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -311,11 +311,6 @@ msgstr "{morphRelationCount} 個物件"
|
||||
msgid "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{num}th}}"
|
||||
msgstr "{num, selectordinal, other {{num} 第}}"
|
||||
|
||||
#. js-lingui-id: fTSz8d
|
||||
#: src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
|
||||
msgid "{numberOfSelectedItems} workspace members"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: 7kYa/u
|
||||
#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
|
||||
msgid "{objectLabelPlural} ({totalCount})"
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useCloseActionMenu } from '@/action-menu/hooks/useCloseActionMenu';
|
||||
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||
import { useModal } from '@/ui/layout/modal/hooks/useModal';
|
||||
import { isModalOpenedComponentState } from '@/ui/layout/modal/states/isModalOpenedComponentState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { type ButtonAccent } from 'twenty-ui/input';
|
||||
|
||||
export type ActionModalProps = {
|
||||
@@ -49,7 +49,7 @@ export const ActionModal = ({
|
||||
|
||||
const modalId = `${actionConfig?.key}-action-modal-${actionMenuType}`;
|
||||
|
||||
const isModalOpened = useRecoilComponentValueV2(
|
||||
const isModalOpened = useRecoilComponentValue(
|
||||
isModalOpenedComponentState,
|
||||
modalId,
|
||||
);
|
||||
|
||||
+4
-4
@@ -2,9 +2,9 @@ import { type ActionDisplayProps } from '@/action-menu/actions/display/component
|
||||
import { getActionLabel } from '@/action-menu/utils/getActionLabel';
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { SelectableListComponentInstanceContext } from '@/ui/layout/selectable-list/states/contexts/SelectableListComponentInstanceContext';
|
||||
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
|
||||
import { isSelectedItemIdComponentFamilySelector } from '@/ui/layout/selectable-list/states/selectors/isSelectedItemIdComponentFamilySelector';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentFamilyValueV2';
|
||||
import { useRecoilComponentFamilyValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { MenuItem } from 'twenty-ui/navigation';
|
||||
@@ -31,8 +31,8 @@ export const ActionDropdownItem = ({
|
||||
SelectableListComponentInstanceContext,
|
||||
);
|
||||
|
||||
const isSelected = useRecoilComponentFamilyValueV2(
|
||||
isSelectedItemIdComponentFamilyState,
|
||||
const isSelected = useRecoilComponentFamilyValue(
|
||||
isSelectedItemIdComponentFamilySelector,
|
||||
action.key,
|
||||
selectableListInstanceId,
|
||||
);
|
||||
|
||||
+1
-2
@@ -218,11 +218,10 @@ describe('useRelatedRecordActions', () => {
|
||||
expect(result.current['create-related-company'].position).toBe(19);
|
||||
});
|
||||
|
||||
it('should filter out hidden system fields', () => {
|
||||
it('should filter out system fields', () => {
|
||||
const fields = [
|
||||
{
|
||||
type: 'RELATION',
|
||||
name: 'position',
|
||||
relation: {
|
||||
type: 'ONE_TO_MANY',
|
||||
targetObjectMetadata: {
|
||||
|
||||
+1
-2
@@ -6,7 +6,6 @@ import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';
|
||||
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField';
|
||||
import { isRecordReadOnly } from '@/object-record/read-only/utils/isRecordReadOnly';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import React from 'react';
|
||||
@@ -36,7 +35,7 @@ export const useRelatedRecordActions = ({
|
||||
(field) =>
|
||||
field.type === 'RELATION' &&
|
||||
field.relation?.type === 'ONE_TO_MANY' &&
|
||||
!isHiddenSystemField(field),
|
||||
!field.isSystem,
|
||||
);
|
||||
|
||||
let currentPosition = startPosition;
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useContext } from 'react';
|
||||
@@ -62,7 +61,7 @@ export const RecordIndexActionMenuDropdown = () => {
|
||||
'more-actions',
|
||||
];
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
+4
-4
@@ -15,8 +15,8 @@ import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotke
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useComponentInstanceStateContext } from '@/ui/utilities/state/component-state/hooks/useComponentInstanceStateContext';
|
||||
import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useRecoilCallback, useRecoilValue } from 'recoil';
|
||||
import { AppPath } from 'twenty-shared/types';
|
||||
@@ -49,7 +49,7 @@ export const RecordShowRightDrawerOpenRecordButton = ({
|
||||
targetObjectId: recordId,
|
||||
});
|
||||
|
||||
const activeTabIdInRightDrawer = useRecoilComponentValueV2(
|
||||
const activeTabIdInRightDrawer = useRecoilComponentValue(
|
||||
activeTabIdComponentState,
|
||||
tabListComponentId,
|
||||
);
|
||||
@@ -58,7 +58,7 @@ export const RecordShowRightDrawerOpenRecordButton = ({
|
||||
targetObjectId: recordId,
|
||||
});
|
||||
|
||||
const setActiveTabIdInRecordPage = useSetRecoilComponentStateV2(
|
||||
const setActiveTabIdInRecordPage = useSetRecoilComponentState(
|
||||
activeTabIdComponentState,
|
||||
tabListComponentIdInRecordPage,
|
||||
);
|
||||
|
||||
@@ -17,12 +17,12 @@ import { ActivityList } from '@/activities/components/ActivityList';
|
||||
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
|
||||
import { useModal } from '@/ui/layout/modal/hooks/useModal';
|
||||
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
|
||||
import { assertIsDefinedOrThrow } from 'twenty-shared/utils';
|
||||
import { assertIsDefinedOrThrow, isDefined } from 'twenty-shared/utils';
|
||||
import { IconDownload, IconX } from 'twenty-ui/display';
|
||||
import { IconButton } from 'twenty-ui/input';
|
||||
import {
|
||||
PermissionFlagType,
|
||||
FeatureFlagKey,
|
||||
PermissionFlagType,
|
||||
} from '~/generated-metadata/graphql';
|
||||
import { AttachmentRow } from './AttachmentRow';
|
||||
|
||||
@@ -212,15 +212,20 @@ export const AttachmentList = ({
|
||||
/>
|
||||
) : (
|
||||
<ActivityList>
|
||||
{attachments.map((attachment) => (
|
||||
<AttachmentRow
|
||||
key={attachment.id}
|
||||
attachment={attachment}
|
||||
onPreview={
|
||||
isAttachmentPreviewEnabled ? handlePreview : undefined
|
||||
}
|
||||
/>
|
||||
))}
|
||||
{attachments
|
||||
.filter(
|
||||
(attachment) =>
|
||||
!isFilesFieldMigrated || isDefined(attachment.file?.[0]),
|
||||
)
|
||||
.map((attachment) => (
|
||||
<AttachmentRow
|
||||
key={attachment.id}
|
||||
attachment={attachment}
|
||||
onPreview={
|
||||
isAttachmentPreviewEnabled ? handlePreview : undefined
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</ActivityList>
|
||||
)}
|
||||
</StyledDropZoneContainer>
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { useObjectPermissionsForObject } from '@/object-record/hooks/useObjectPermissionsForObject';
|
||||
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import groupBy from 'lodash.groupby';
|
||||
import { IconPlus } from 'twenty-ui/display';
|
||||
@@ -55,7 +55,7 @@ export const TaskGroups = ({ targetableObject }: TaskGroupsProps) => {
|
||||
activityObjectNameSingular: CoreObjectNameSingular.Task,
|
||||
});
|
||||
|
||||
const activeTabId = useRecoilComponentValueV2(activeTabIdComponentState);
|
||||
const activeTabId = useRecoilComponentValue(activeTabIdComponentState);
|
||||
|
||||
const isLoading =
|
||||
(activeTabId !== 'done' && tasksLoading) ||
|
||||
|
||||
@@ -26,7 +26,7 @@ import { isThinkingStepPartActive } from '@/ai/utils/isThinkingStepPartActive';
|
||||
import { type ThinkingStepPart } from '@/ai/utils/thinkingStepPart';
|
||||
import { TabList } from '@/ui/layout/tab-list/components/TabList';
|
||||
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
@@ -277,7 +277,7 @@ const ThinkingToolStepRow = ({
|
||||
? unwrappedResult.data.result
|
||||
: unwrappedOutput;
|
||||
const toolTabListComponentInstanceId = `ai-thinking-tool-tabs-${part.toolCallId ?? rawToolName}-${rowIndex}`;
|
||||
const activeToolTabId = useRecoilComponentValueV2(
|
||||
const activeToolTabId = useRecoilComponentValue(
|
||||
activeTabIdComponentState,
|
||||
toolTabListComponentInstanceId,
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AI_CHAT_SCROLL_WRAPPER_ID } from '@/ai/constants/AiChatScrollWrapperId';
|
||||
import { useScrollWrapperHTMLElement } from '@/ui/utilities/scroll/hooks/useScrollWrapperHTMLElement';
|
||||
import { scrollWrapperScrollBottomComponentState } from '@/ui/utilities/scroll/states/scrollWrapperScrollBottomComponentState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
const SCROLL_BOTTOM_THRESHOLD_PX = 10;
|
||||
@@ -11,7 +11,7 @@ export const useAgentChatScrollToBottom = () => {
|
||||
AI_CHAT_SCROLL_WRAPPER_ID,
|
||||
);
|
||||
|
||||
const scrollBottom = useRecoilComponentValueV2(
|
||||
const scrollBottom = useRecoilComponentValue(
|
||||
scrollWrapperScrollBottomComponentState,
|
||||
AI_CHAT_SCROLL_WRAPPER_ID,
|
||||
);
|
||||
|
||||
@@ -14,12 +14,9 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
||||
import { recordStoreFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreFamilySelector';
|
||||
import { getTabListInstanceIdFromPageLayoutId } from '@/page-layout/utils/getTabListInstanceIdFromPageLayoutId';
|
||||
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
|
||||
import { useStore } from 'jotai';
|
||||
import { coreViewFromViewIdFamilySelector } from '@/views/states/selectors/coreViewFromViewIdFamilySelector';
|
||||
|
||||
export const useGetBrowsingContext = () => {
|
||||
const store = useStore();
|
||||
|
||||
const getBrowsingContext = useRecoilCallback(
|
||||
({ snapshot }) =>
|
||||
(): BrowsingContext | null => {
|
||||
@@ -87,11 +84,13 @@ export const useGetBrowsingContext = () => {
|
||||
if (isDefined(pageLayoutId)) {
|
||||
const tabListInstanceId =
|
||||
getTabListInstanceIdFromPageLayoutId(pageLayoutId);
|
||||
const activeTabId = store.get(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: tabListInstanceId,
|
||||
}),
|
||||
);
|
||||
const activeTabId = snapshot
|
||||
.getLoadable(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: tabListInstanceId,
|
||||
}),
|
||||
)
|
||||
.getValue();
|
||||
|
||||
return {
|
||||
...recordContext,
|
||||
@@ -155,7 +154,7 @@ export const useGetBrowsingContext = () => {
|
||||
|
||||
return null;
|
||||
},
|
||||
[store],
|
||||
[],
|
||||
);
|
||||
|
||||
return { getBrowsingContext };
|
||||
|
||||
+10
-8
@@ -3,8 +3,8 @@ import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilte
|
||||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
|
||||
import { navigationDrawerExpandedMemorizedStateV2 } from '@/ui/navigation/states/navigationDrawerExpandedMemorizedStateV2';
|
||||
import { useGoToHotkeys } from '@/ui/utilities/hotkey/hooks/useGoToHotkeys';
|
||||
import { useStore } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { AppPath, SettingsPath } from 'twenty-shared/types';
|
||||
import { getAppPath, getSettingsPath } from 'twenty-shared/utils';
|
||||
|
||||
@@ -12,15 +12,17 @@ export const GotoHotkeysEffectsProvider = () => {
|
||||
const { activeNonSystemObjectMetadataItems } =
|
||||
useFilteredObjectMetadataItems();
|
||||
|
||||
const store = useStore();
|
||||
|
||||
useGoToHotkeys({
|
||||
key: 's',
|
||||
location: getSettingsPath(SettingsPath.ProfilePage),
|
||||
preNavigateFunction: useCallback(() => {
|
||||
store.set(isNavigationDrawerExpandedState.atom, true);
|
||||
store.set(navigationDrawerExpandedMemorizedStateV2.atom, true);
|
||||
}, [store]),
|
||||
preNavigateFunction: useRecoilCallback(
|
||||
({ set }) =>
|
||||
() => {
|
||||
set(isNavigationDrawerExpandedState, true);
|
||||
jotaiStore.set(navigationDrawerExpandedMemorizedStateV2.atom, true);
|
||||
},
|
||||
[],
|
||||
),
|
||||
});
|
||||
|
||||
return activeNonSystemObjectMetadataItems.map((objectMetadataItem) => {
|
||||
|
||||
+4
-4
@@ -2,8 +2,8 @@ import { SLASH_MENU_LIST_ID } from '@/ui/input/constants/SlashMenuListId';
|
||||
import { type SuggestionItem } from '@/blocknote-editor/types/types';
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
|
||||
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
|
||||
import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentFamilyValueV2';
|
||||
import { isSelectedItemIdComponentFamilySelector } from '@/ui/layout/selectable-list/states/selectors/isSelectedItemIdComponentFamilySelector';
|
||||
import { useRecoilComponentFamilyValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue';
|
||||
import { MenuItemSuggestion } from 'twenty-ui/navigation';
|
||||
|
||||
export type CustomSlashMenuListItemProps = {
|
||||
@@ -15,8 +15,8 @@ export const CustomSlashMenuListItem = ({
|
||||
}: CustomSlashMenuListItemProps) => {
|
||||
const { resetSelectedItem } = useSelectableList(SLASH_MENU_LIST_ID);
|
||||
|
||||
const isSelectedItem = useRecoilComponentFamilyValueV2(
|
||||
isSelectedItemIdComponentFamilyState,
|
||||
const isSelectedItem = useRecoilComponentFamilyValue(
|
||||
isSelectedItemIdComponentFamilySelector,
|
||||
item.title,
|
||||
);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import { sentryConfigState } from '@/client-config/states/sentryConfigState';
|
||||
import { supportChatState } from '@/client-config/states/supportChatState';
|
||||
import { type ClientConfig } from '@/client-config/types/ClientConfig';
|
||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||
import { useStore } from 'jotai';
|
||||
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
|
||||
import { useCallback } from 'react';
|
||||
import { useRecoilState, useSetRecoilState } from 'recoil';
|
||||
import { isAttachmentPreviewEnabledStateV2 } from '@/client-config/states/isAttachmentPreviewEnabledStateV2';
|
||||
@@ -130,8 +130,6 @@ export const useClientConfig = (): UseClientConfigResult => {
|
||||
|
||||
const setAppVersion = useSetRecoilStateV2(appVersionState);
|
||||
|
||||
const store = useStore();
|
||||
|
||||
const fetchClientConfig = useCallback(async () => {
|
||||
setClientConfigApiStatus((prev) => ({
|
||||
...prev,
|
||||
@@ -193,7 +191,7 @@ export const useClientConfig = (): UseClientConfigResult => {
|
||||
setGoogleMessagingEnabled(clientConfig?.isGoogleMessagingEnabled);
|
||||
setGoogleCalendarEnabled(clientConfig?.isGoogleCalendarEnabled);
|
||||
setIsAttachmentPreviewEnabled(clientConfig?.isAttachmentPreviewEnabled);
|
||||
store.set(
|
||||
jotaiStore.set(
|
||||
isAttachmentPreviewEnabledStateV2.atom,
|
||||
clientConfig?.isAttachmentPreviewEnabled,
|
||||
);
|
||||
@@ -254,7 +252,6 @@ export const useClientConfig = (): UseClientConfigResult => {
|
||||
setSentryConfig,
|
||||
setSupportChat,
|
||||
setAllowRequestsToTwentyIcons,
|
||||
store,
|
||||
]);
|
||||
|
||||
return {
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ import { COMMAND_MENU_LIST_SELECTABLE_LIST_ID } from '@/command-menu/constants/C
|
||||
import { hasUserSelectedCommandState } from '@/command-menu/states/hasUserSelectedCommandState';
|
||||
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { useEffect } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
@@ -16,7 +16,7 @@ export const CommandMenuDefaultSelectionEffect = ({
|
||||
COMMAND_MENU_LIST_SELECTABLE_LIST_ID,
|
||||
);
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
COMMAND_MENU_LIST_SELECTABLE_LIST_ID,
|
||||
);
|
||||
|
||||
@@ -4,8 +4,8 @@ import { IconArrowUpRight, type IconComponent } from 'twenty-ui/display';
|
||||
import { MenuItem } from 'twenty-ui/navigation';
|
||||
|
||||
import { useCommandMenuOnItemClick } from '@/command-menu/hooks/useCommandMenuOnItemClick';
|
||||
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
|
||||
import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentFamilyValueV2';
|
||||
import { isSelectedItemIdComponentFamilySelector } from '@/ui/layout/selectable-list/states/selectors/isSelectedItemIdComponentFamilySelector';
|
||||
import { useRecoilComponentFamilyValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue';
|
||||
|
||||
export type CommandMenuItemProps = {
|
||||
label: string;
|
||||
@@ -44,8 +44,8 @@ export const CommandMenuItem = ({
|
||||
Icon = IconArrowUpRight;
|
||||
}
|
||||
|
||||
const isSelectedItemId = useRecoilComponentFamilyValueV2(
|
||||
isSelectedItemIdComponentFamilyState,
|
||||
const isSelectedItemId = useRecoilComponentFamilyValue(
|
||||
isSelectedItemIdComponentFamilySelector,
|
||||
id,
|
||||
);
|
||||
|
||||
|
||||
+2
-2
@@ -4,10 +4,10 @@ import { TextInput } from '@/ui/input/components/TextInput';
|
||||
import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
|
||||
import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';
|
||||
import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
|
||||
import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';
|
||||
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRef, useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { type IconComponent } from 'twenty-ui/display';
|
||||
import {
|
||||
@@ -45,7 +45,7 @@ export const CommandMenuItemNumberInput = ({
|
||||
const [draftValue, setDraftValue] = useState(value);
|
||||
const [hasError, setHasError] = useState(false);
|
||||
|
||||
const currentFocusId = useRecoilValueV2(currentFocusIdSelector);
|
||||
const currentFocusId = useRecoilValue(currentFocusIdSelector);
|
||||
const isNumberInputCurrentlyFocused = currentFocusId === focusId;
|
||||
|
||||
const { pushFocusItemToFocusStack } = usePushFocusItemToFocusStack();
|
||||
|
||||
+2
-2
@@ -4,10 +4,10 @@ import { TextInput } from '@/ui/input/components/TextInput';
|
||||
import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
|
||||
import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';
|
||||
import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
|
||||
import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';
|
||||
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRef, useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { type IconComponent } from 'twenty-ui/display';
|
||||
|
||||
type CommandMenuItemTextInputProps = {
|
||||
@@ -37,7 +37,7 @@ export const CommandMenuItemTextInput = ({
|
||||
const focusId = `${id}-input`;
|
||||
const [draftValue, setDraftValue] = useState(value);
|
||||
|
||||
const currentFocusId = useRecoilValueV2(currentFocusIdSelector);
|
||||
const currentFocusId = useRecoilValue(currentFocusIdSelector);
|
||||
const isTextInputCurrentlyFocused = currentFocusId === focusId;
|
||||
|
||||
const { pushFocusItemToFocusStack } = usePushFocusItemToFocusStack();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
|
||||
import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentFamilyValueV2';
|
||||
import { isSelectedItemIdComponentFamilySelector } from '@/ui/layout/selectable-list/states/selectors/isSelectedItemIdComponentFamilySelector';
|
||||
import { useRecoilComponentFamilyValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue';
|
||||
import { MenuItemToggle, type MenuItemToggleProps } from 'twenty-ui/navigation';
|
||||
|
||||
export type CommandMenuItemToggleProps = MenuItemToggleProps & {
|
||||
@@ -7,8 +7,8 @@ export type CommandMenuItemToggleProps = MenuItemToggleProps & {
|
||||
};
|
||||
|
||||
export const CommandMenuItemToggle = (props: CommandMenuItemToggleProps) => {
|
||||
const isSelectedItemId = useRecoilComponentFamilyValueV2(
|
||||
isSelectedItemIdComponentFamilyState,
|
||||
const isSelectedItemId = useRecoilComponentFamilyValue(
|
||||
isSelectedItemIdComponentFamilySelector,
|
||||
props.id,
|
||||
);
|
||||
|
||||
|
||||
+15
-14
@@ -11,7 +11,6 @@ import { RootStackingContextZIndices } from '@/ui/layout/constants/RootStackingC
|
||||
import { PAGE_HEADER_COMMAND_MENU_BUTTON_CLICK_OUTSIDE_ID } from '@/ui/layout/page-header/constants/PageHeaderCommandMenuButtonClickOutsideId';
|
||||
import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
|
||||
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
|
||||
import { useStore } from 'jotai';
|
||||
import { useSetRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilStateV2';
|
||||
import { WORKFLOW_DIAGRAM_CREATE_STEP_NODE_CLICK_OUTSIDE_ID } from '@/workflow/workflow-diagram/constants/WorkflowDiagramCreateStepNodeClickOutsideId';
|
||||
import { WORKFLOW_DIAGRAM_STEP_NODE_BASE_CLICK_OUTSIDE_ID } from '@/workflow/workflow-diagram/constants/WorkflowDiagramStepNodeClickOutsideId';
|
||||
@@ -20,7 +19,8 @@ import { useTheme } from '@emotion/react';
|
||||
|
||||
import styled from '@emotion/styled';
|
||||
import { motion } from 'framer-motion';
|
||||
import { useCallback, useRef } from 'react';
|
||||
import { useRef } from 'react';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { LINK_CHIP_CLICK_OUTSIDE_ID } from 'twenty-ui/components';
|
||||
import { useIsMobile } from 'twenty-ui/utilities';
|
||||
|
||||
@@ -58,19 +58,20 @@ export const CommandMenuOpenContainer = ({
|
||||
isSidePanelAnimatingStateV2,
|
||||
);
|
||||
|
||||
const store = useStore();
|
||||
const handleClickOutside = useRecoilCallback(
|
||||
({ snapshot }) =>
|
||||
(event: MouseEvent | TouchEvent) => {
|
||||
const currentFocusId = snapshot
|
||||
.getLoadable(currentFocusIdSelector)
|
||||
.getValue();
|
||||
|
||||
const handleClickOutside = useCallback(
|
||||
(event: MouseEvent | TouchEvent) => {
|
||||
const currentFocusId = store.get(currentFocusIdSelector.atom);
|
||||
|
||||
if (currentFocusId === SIDE_PANEL_FOCUS_ID) {
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
closeCommandMenu();
|
||||
}
|
||||
},
|
||||
[closeCommandMenu, store],
|
||||
if (currentFocusId === SIDE_PANEL_FOCUS_ID) {
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
closeCommandMenu();
|
||||
}
|
||||
},
|
||||
[closeCommandMenu],
|
||||
);
|
||||
|
||||
useListenClickOutside({
|
||||
|
||||
@@ -10,7 +10,7 @@ import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
||||
import { addToNavPayloadRegistryStateV2 } from '@/navigation-menu-item/states/addToNavPayloadRegistryStateV2';
|
||||
import { useCloseAnyOpenDropdown } from '@/ui/layout/dropdown/hooks/useCloseAnyOpenDropdown';
|
||||
import { emitSidePanelOpenEvent } from '@/ui/layout/right-drawer/utils/emitSidePanelOpenEvent';
|
||||
import { useStore } from 'jotai';
|
||||
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
|
||||
import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useCallback } from 'react';
|
||||
@@ -23,8 +23,6 @@ export const useCommandMenu = () => {
|
||||
const { removeFocusItemFromFocusStackById } =
|
||||
useRemoveFocusItemFromFocusStackById();
|
||||
|
||||
const store = useStore();
|
||||
|
||||
const closeCommandMenu = useRecoilCallback(
|
||||
({ set, snapshot }) =>
|
||||
() => {
|
||||
@@ -33,9 +31,9 @@ export const useCommandMenu = () => {
|
||||
.getValue();
|
||||
|
||||
if (isCommandMenuOpened) {
|
||||
store.set(addToNavPayloadRegistryStateV2.atom, new Map());
|
||||
jotaiStore.set(addToNavPayloadRegistryStateV2.atom, new Map());
|
||||
set(isCommandMenuOpenedState, false);
|
||||
store.set(isCommandMenuOpenedStateV2.atom, false);
|
||||
jotaiStore.set(isCommandMenuOpenedStateV2.atom, false);
|
||||
set(isCommandMenuClosingState, true);
|
||||
closeAnyOpenDropdown();
|
||||
removeFocusItemFromFocusStackById({
|
||||
@@ -43,7 +41,7 @@ export const useCommandMenu = () => {
|
||||
});
|
||||
}
|
||||
},
|
||||
[closeAnyOpenDropdown, removeFocusItemFromFocusStackById, store],
|
||||
[closeAnyOpenDropdown, removeFocusItemFromFocusStackById],
|
||||
);
|
||||
|
||||
const openCommandMenu = useCallback(() => {
|
||||
|
||||
+5
-7
@@ -26,7 +26,7 @@ import { getShowPageTabListComponentId } from '@/ui/layout/show-page/utils/getSh
|
||||
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
|
||||
import { WORKFLOW_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID } from '@/workflow/workflow-steps/workflow-actions/code-action/constants/WorkflowLogicFunctionTabListComponentId';
|
||||
import { WorkflowLogicFunctionTabId } from '@/workflow/workflow-steps/workflow-actions/code-action/types/WorkflowLogicFunctionTabId';
|
||||
import { useStore } from 'jotai';
|
||||
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
@@ -39,8 +39,6 @@ export const useCommandMenuCloseAnimationCompleteCleanup = () => {
|
||||
|
||||
const { closeDropdown } = useCloseDropdown();
|
||||
|
||||
const store = useStore();
|
||||
|
||||
const commandMenuCloseAnimationCompleteCleanup = useRecoilCallback(
|
||||
({ snapshot, set }) =>
|
||||
() => {
|
||||
@@ -108,7 +106,7 @@ export const useCommandMenuCloseAnimationCompleteCleanup = () => {
|
||||
instanceId: '',
|
||||
});
|
||||
set(isCommandMenuOpenedState, false);
|
||||
store.set(isCommandMenuOpenedStateV2.atom, false);
|
||||
jotaiStore.set(isCommandMenuOpenedStateV2.atom, false);
|
||||
set(commandMenuSearchState, '');
|
||||
set(commandMenuNavigationMorphItemsByPageState, new Map());
|
||||
set(commandMenuNavigationStackState, []);
|
||||
@@ -117,7 +115,7 @@ export const useCommandMenuCloseAnimationCompleteCleanup = () => {
|
||||
|
||||
emitSidePanelCloseEvent();
|
||||
set(isCommandMenuClosingState, false);
|
||||
store.set(
|
||||
set(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: WORKFLOW_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID,
|
||||
}),
|
||||
@@ -127,7 +125,7 @@ export const useCommandMenuCloseAnimationCompleteCleanup = () => {
|
||||
for (const [pageId, morphItems] of snapshot
|
||||
.getLoadable(commandMenuNavigationMorphItemsByPageState)
|
||||
.getValue()) {
|
||||
store.set(
|
||||
set(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: getShowPageTabListComponentId({
|
||||
pageId,
|
||||
@@ -138,7 +136,7 @@ export const useCommandMenuCloseAnimationCompleteCleanup = () => {
|
||||
);
|
||||
}
|
||||
},
|
||||
[closeDropdown, resetContextStoreStates, resetSelectedItem, store],
|
||||
[closeDropdown, resetContextStoreStates, resetSelectedItem],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -8,15 +8,12 @@ import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState
|
||||
import { hasUserSelectedCommandState } from '@/command-menu/states/hasUserSelectedCommandState';
|
||||
import { getShowPageTabListComponentId } from '@/ui/layout/show-page/utils/getShowPageTabListComponentId';
|
||||
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
|
||||
import { useStore } from 'jotai';
|
||||
import { isNonEmptyArray } from '@sniptt/guards';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const useCommandMenuHistory = () => {
|
||||
const { closeCommandMenu } = useCommandMenu();
|
||||
|
||||
const store = useStore();
|
||||
|
||||
const goBackFromCommandMenu = useRecoilCallback(
|
||||
({ snapshot, set }) => {
|
||||
return () => {
|
||||
@@ -56,7 +53,7 @@ export const useCommandMenuHistory = () => {
|
||||
|
||||
const morphItems = currentMorphItems.get(removedItem.pageId);
|
||||
if (isNonEmptyArray(morphItems)) {
|
||||
store.set(
|
||||
set(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: getShowPageTabListComponentId({
|
||||
pageId: removedItem.pageId,
|
||||
@@ -72,68 +69,62 @@ export const useCommandMenuHistory = () => {
|
||||
set(hasUserSelectedCommandState, false);
|
||||
};
|
||||
},
|
||||
[closeCommandMenu, store],
|
||||
[closeCommandMenu],
|
||||
);
|
||||
|
||||
const navigateCommandMenuHistory = useRecoilCallback(
|
||||
({ snapshot, set }) => {
|
||||
return (pageIndex: number) => {
|
||||
const currentNavigationStack = snapshot
|
||||
.getLoadable(commandMenuNavigationStackState)
|
||||
.getValue();
|
||||
const navigateCommandMenuHistory = useRecoilCallback(({ snapshot, set }) => {
|
||||
return (pageIndex: number) => {
|
||||
const currentNavigationStack = snapshot
|
||||
.getLoadable(commandMenuNavigationStackState)
|
||||
.getValue();
|
||||
|
||||
const newNavigationStack = currentNavigationStack.slice(
|
||||
0,
|
||||
pageIndex + 1,
|
||||
const newNavigationStack = currentNavigationStack.slice(0, pageIndex + 1);
|
||||
|
||||
set(commandMenuNavigationStackState, newNavigationStack);
|
||||
|
||||
const newNavigationStackItem = newNavigationStack.at(-1);
|
||||
|
||||
if (!isDefined(newNavigationStackItem)) {
|
||||
throw new Error(
|
||||
`No command menu navigation stack item found for index ${pageIndex}`,
|
||||
);
|
||||
}
|
||||
|
||||
set(commandMenuNavigationStackState, newNavigationStack);
|
||||
set(commandMenuPageState, newNavigationStackItem.page);
|
||||
set(commandMenuPageInfoState, {
|
||||
title: newNavigationStackItem.pageTitle,
|
||||
Icon: newNavigationStackItem.pageIcon,
|
||||
instanceId: newNavigationStackItem.pageId,
|
||||
});
|
||||
const currentMorphItems = snapshot
|
||||
.getLoadable(commandMenuNavigationMorphItemsByPageState)
|
||||
.getValue();
|
||||
|
||||
const newNavigationStackItem = newNavigationStack.at(-1);
|
||||
|
||||
if (!isDefined(newNavigationStackItem)) {
|
||||
throw new Error(
|
||||
`No command menu navigation stack item found for index ${pageIndex}`,
|
||||
for (const [pageId, morphItems] of currentMorphItems.entries()) {
|
||||
if (!newNavigationStack.some((item) => item.pageId === pageId)) {
|
||||
set(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: getShowPageTabListComponentId({
|
||||
pageId,
|
||||
targetObjectId: morphItems[0].recordId,
|
||||
}),
|
||||
}),
|
||||
null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
set(commandMenuPageState, newNavigationStackItem.page);
|
||||
set(commandMenuPageInfoState, {
|
||||
title: newNavigationStackItem.pageTitle,
|
||||
Icon: newNavigationStackItem.pageIcon,
|
||||
instanceId: newNavigationStackItem.pageId,
|
||||
});
|
||||
const currentMorphItems = snapshot
|
||||
.getLoadable(commandMenuNavigationMorphItemsByPageState)
|
||||
.getValue();
|
||||
const newMorphItems = new Map(
|
||||
Array.from(currentMorphItems.entries()).filter(([pageId]) =>
|
||||
newNavigationStack.some((item) => item.pageId === pageId),
|
||||
),
|
||||
);
|
||||
|
||||
for (const [pageId, morphItems] of currentMorphItems.entries()) {
|
||||
if (!newNavigationStack.some((item) => item.pageId === pageId)) {
|
||||
store.set(
|
||||
activeTabIdComponentState.atomFamily({
|
||||
instanceId: getShowPageTabListComponentId({
|
||||
pageId,
|
||||
targetObjectId: morphItems[0].recordId,
|
||||
}),
|
||||
}),
|
||||
null,
|
||||
);
|
||||
}
|
||||
}
|
||||
set(commandMenuNavigationMorphItemsByPageState, newMorphItems);
|
||||
|
||||
const newMorphItems = new Map(
|
||||
Array.from(currentMorphItems.entries()).filter(([pageId]) =>
|
||||
newNavigationStack.some((item) => item.pageId === pageId),
|
||||
),
|
||||
);
|
||||
|
||||
set(commandMenuNavigationMorphItemsByPageState, newMorphItems);
|
||||
|
||||
set(hasUserSelectedCommandState, false);
|
||||
};
|
||||
},
|
||||
[store],
|
||||
);
|
||||
set(hasUserSelectedCommandState, false);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return {
|
||||
goBackFromCommandMenu,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
||||
import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId';
|
||||
import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
|
||||
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
|
||||
import { useStore } from 'jotai';
|
||||
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { type IconComponent } from 'twenty-ui/display';
|
||||
import { v4 } from 'uuid';
|
||||
@@ -36,8 +36,6 @@ export const useNavigateCommandMenu = () => {
|
||||
|
||||
const { pushFocusItemToFocusStack } = usePushFocusItemToFocusStack();
|
||||
|
||||
const store = useStore();
|
||||
|
||||
const openCommandMenu = useRecoilCallback(
|
||||
({ snapshot, set }) =>
|
||||
() => {
|
||||
@@ -74,14 +72,13 @@ export const useNavigateCommandMenu = () => {
|
||||
});
|
||||
|
||||
set(isCommandMenuOpenedState, true);
|
||||
store.set(isCommandMenuOpenedStateV2.atom, true);
|
||||
jotaiStore.set(isCommandMenuOpenedStateV2.atom, true);
|
||||
set(hasUserSelectedCommandState, false);
|
||||
},
|
||||
[
|
||||
copyContextStoreStates,
|
||||
commandMenuCloseAnimationCompleteCleanup,
|
||||
pushFocusItemToFocusStack,
|
||||
store,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
|
||||
import { viewableRichTextComponentStateV2 } from '@/command-menu/pages/rich-text-page/states/viewableRichTextComponentStateV2';
|
||||
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
||||
import { useStore } from 'jotai';
|
||||
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useCallback } from 'react';
|
||||
import { IconPencil } from 'twenty-ui/display';
|
||||
@@ -9,8 +9,6 @@ import { IconPencil } from 'twenty-ui/display';
|
||||
export const useRichTextCommandMenu = () => {
|
||||
const { navigateCommandMenu, openCommandMenu } = useCommandMenu();
|
||||
|
||||
const store = useStore();
|
||||
|
||||
const openRichTextInCommandMenu = useCallback(
|
||||
({
|
||||
activityId,
|
||||
@@ -19,7 +17,7 @@ export const useRichTextCommandMenu = () => {
|
||||
activityId: string;
|
||||
activityObjectNameSingular: string;
|
||||
}) => {
|
||||
store.set(viewableRichTextComponentStateV2.atom, {
|
||||
jotaiStore.set(viewableRichTextComponentStateV2.atom, {
|
||||
activityId,
|
||||
activityObjectNameSingular,
|
||||
});
|
||||
@@ -31,7 +29,7 @@ export const useRichTextCommandMenu = () => {
|
||||
pageIcon: IconPencil,
|
||||
});
|
||||
},
|
||||
[navigateCommandMenu, openCommandMenu, store],
|
||||
[navigateCommandMenu, openCommandMenu],
|
||||
);
|
||||
|
||||
const editRichText = useCallback(
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import { RightDrawerFooter } from '@/ui/layout/right-drawer/components/RightDraw
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useId } from 'react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
@@ -43,7 +42,7 @@ export const WidgetSettingsFooter = ({
|
||||
closeDropdown(dropdownId);
|
||||
};
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { MenuItemSelect } from 'twenty-ui/navigation';
|
||||
|
||||
@@ -40,7 +40,7 @@ export const ChartAggregateOperationSelectableListItem = ({
|
||||
DropdownComponentInstanceContext,
|
||||
);
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { MenuItemSelect } from 'twenty-ui/navigation';
|
||||
import { AxisNameDisplay } from '~/generated-metadata/graphql';
|
||||
|
||||
@@ -34,7 +34,7 @@ export const ChartAxisNameSelectionDropdownContent = () => {
|
||||
DropdownComponentInstanceContext,
|
||||
);
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
|
||||
import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useState } from 'react';
|
||||
import { capitalize, isDefined } from 'twenty-shared/utils';
|
||||
@@ -35,7 +35,7 @@ export const ChartColorSelectionDropdownContent = () => {
|
||||
DropdownComponentInstanceContext,
|
||||
);
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { useState } from 'react';
|
||||
@@ -44,7 +44,7 @@ export const ChartDataSourceDropdownContent = () => {
|
||||
DropdownComponentInstanceContext,
|
||||
);
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
|
||||
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { MenuItemSelect } from 'twenty-ui/navigation';
|
||||
@@ -107,7 +107,7 @@ export const ChartDateGranularitySelectionDropdownContent = ({
|
||||
DropdownComponentInstanceContext,
|
||||
);
|
||||
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
const selectedItemId = useRecoilComponentValue(
|
||||
selectedItemIdComponentState,
|
||||
dropdownId,
|
||||
);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user