-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'twentyhq:main' into fix-9232-cannot-delete-an-account
- Loading branch information
Showing
102 changed files
with
1,953 additions
and
5,870 deletions.
There are no files selected for viewing
6 changes: 5 additions & 1 deletion
6
...u/actions/record-actions/single-record/hooks/useNavigateToNextRecordSingleRecordAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import { SingleRecordActionHookWithObjectMetadataItem } from '@/action-menu/actions/types/SingleRecordActionHook'; | ||
import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext'; | ||
import { useRecordShowPagePagination } from '@/object-record/record-show/hooks/useRecordShowPagePagination'; | ||
import { useContext } from 'react'; | ||
|
||
export const useNavigateToNextRecordSingleRecordAction: SingleRecordActionHookWithObjectMetadataItem = | ||
({ recordId, objectMetadataItem }) => { | ||
const { isInRightDrawer } = useContext(ActionMenuContext); | ||
|
||
const { navigateToNextRecord } = useRecordShowPagePagination( | ||
objectMetadataItem.nameSingular, | ||
recordId, | ||
); | ||
|
||
return { | ||
shouldBeRegistered: true, | ||
shouldBeRegistered: !isInRightDrawer, | ||
onClick: navigateToNextRecord, | ||
}; | ||
}; |
5 changes: 4 additions & 1 deletion
5
...tions/record-actions/single-record/hooks/useNavigateToPreviousRecordSingleRecordAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import { SingleRecordActionHookWithObjectMetadataItem } from '@/action-menu/actions/types/SingleRecordActionHook'; | ||
import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext'; | ||
import { useRecordShowPagePagination } from '@/object-record/record-show/hooks/useRecordShowPagePagination'; | ||
import { useContext } from 'react'; | ||
|
||
export const useNavigateToPreviousRecordSingleRecordAction: SingleRecordActionHookWithObjectMetadataItem = | ||
({ recordId, objectMetadataItem }) => { | ||
const { isInRightDrawer } = useContext(ActionMenuContext); | ||
const { navigateToPreviousRecord } = useRecordShowPagePagination( | ||
objectMetadataItem.nameSingular, | ||
recordId, | ||
); | ||
|
||
return { | ||
shouldBeRegistered: true, | ||
shouldBeRegistered: !isInRightDrawer, | ||
onClick: navigateToPreviousRecord, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...ons/single-record/workflow-run-actions/constants/WorkflowRunsSingleRecordActionsConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { useAddToFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useAddToFavoritesSingleRecordAction'; | ||
import { useNavigateToNextRecordSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useNavigateToNextRecordSingleRecordAction'; | ||
import { useNavigateToPreviousRecordSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useNavigateToPreviousRecordSingleRecordAction'; | ||
import { useRemoveFromFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useRemoveFromFavoritesSingleRecordAction'; | ||
import { SingleRecordActionKeys } from '@/action-menu/actions/record-actions/single-record/types/SingleRecordActionsKey'; | ||
import { ActionAvailableOn } from '@/action-menu/actions/types/ActionAvailableOn'; | ||
import { SingleRecordActionHook } from '@/action-menu/actions/types/SingleRecordActionHook'; | ||
import { | ||
ActionMenuEntry, | ||
ActionMenuEntryScope, | ||
ActionMenuEntryType, | ||
} from '@/action-menu/types/ActionMenuEntry'; | ||
import { | ||
IconChevronDown, | ||
IconChevronUp, | ||
IconHeart, | ||
IconHeartOff, | ||
} from 'twenty-ui'; | ||
|
||
export const WORKFLOW_RUNS_SINGLE_RECORD_ACTIONS_CONFIG: Record< | ||
string, | ||
ActionMenuEntry & { | ||
actionHook: SingleRecordActionHook; | ||
} | ||
> = { | ||
addToFavoritesSingleRecord: { | ||
type: ActionMenuEntryType.Standard, | ||
scope: ActionMenuEntryScope.RecordSelection, | ||
key: SingleRecordActionKeys.ADD_TO_FAVORITES, | ||
label: 'Add to favorites', | ||
shortLabel: 'Add to favorites', | ||
position: 0, | ||
isPinned: true, | ||
Icon: IconHeart, | ||
availableOn: [ | ||
ActionAvailableOn.INDEX_PAGE_SINGLE_RECORD_SELECTION, | ||
ActionAvailableOn.SHOW_PAGE, | ||
], | ||
actionHook: useAddToFavoritesSingleRecordAction, | ||
}, | ||
removeFromFavoritesSingleRecord: { | ||
type: ActionMenuEntryType.Standard, | ||
scope: ActionMenuEntryScope.RecordSelection, | ||
key: SingleRecordActionKeys.REMOVE_FROM_FAVORITES, | ||
label: 'Remove from favorites', | ||
shortLabel: 'Remove from favorites', | ||
isPinned: true, | ||
position: 1, | ||
Icon: IconHeartOff, | ||
availableOn: [ | ||
ActionAvailableOn.INDEX_PAGE_SINGLE_RECORD_SELECTION, | ||
ActionAvailableOn.SHOW_PAGE, | ||
], | ||
actionHook: useRemoveFromFavoritesSingleRecordAction, | ||
}, | ||
navigateToPreviousRecord: { | ||
type: ActionMenuEntryType.Standard, | ||
scope: ActionMenuEntryScope.RecordSelection, | ||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD, | ||
label: 'Navigate to previous record', | ||
shortLabel: '', | ||
position: 2, | ||
isPinned: true, | ||
Icon: IconChevronUp, | ||
availableOn: [ActionAvailableOn.SHOW_PAGE], | ||
actionHook: useNavigateToPreviousRecordSingleRecordAction, | ||
}, | ||
navigateToNextRecord: { | ||
type: ActionMenuEntryType.Standard, | ||
scope: ActionMenuEntryScope.RecordSelection, | ||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD, | ||
label: 'Navigate to next record', | ||
shortLabel: '', | ||
position: 3, | ||
isPinned: true, | ||
Icon: IconChevronDown, | ||
availableOn: [ActionAvailableOn.SHOW_PAGE], | ||
actionHook: useNavigateToNextRecordSingleRecordAction, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/twenty-front/src/modules/dropdown/hooks/useDropdown.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.