-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add copilot section to security page and add copilot #47353
Changes from all commits
277f2bf
4178a21
b4c6799
b87ac4d
487ce45
46562f7
634d36a
3d0c4b2
e91d487
7dbcd0e
ad09ebf
d0f7217
9921cc6
bbbc5ab
04f63f0
636551d
0b07897
4973a9b
79b90ff
234f6ac
811dfac
b05c19e
d3315a6
b773ee6
7cc14d5
71a3533
62cbae8
f5fe988
c6e4242
db4d5be
0d4af25
6cb8bf6
6cd3d8c
8707a05
29bc5c8
2811a5f
34a1485
96a2f42
6665309
d7d9709
177e7f3
27905f2
f5447b8
93d526d
ef39580
f99fc89
33e0f78
47f81cb
d7fc432
5b68626
f445776
9f8c3d3
649c1be
5409da8
6f2a633
9f3c104
b95786c
9de1866
d4cd875
dad63e0
5c3ad4a
13d4aa4
5b0689c
f3e5cd8
70f415b
cdd83ea
7de8ae3
e221c01
98d5685
bd0ba6b
6e2e11f
b8830c4
962ac9c
24119c8
3efb821
ec8d513
7275b65
c302fdf
9392cc8
0591eb8
1627104
27e858d
ba47bae
6a79941
8607b5e
582f153
a20bbef
5a516b2
e4f8dd3
b184413
ba7973d
4d0a93e
85b8a79
7409e30
54762a6
e02d63b
37ab2f1
a98b360
74d5b1b
0d70524
d4606fc
7ff29a6
8935513
44af36e
aa5dabe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,10 @@ import type {GestureResponderEvent, View} from 'react-native'; | |
import useSingleExecution from '@hooks/useSingleExecution'; | ||
import * as ReportActionContextMenu from '@pages/home/report/ContextMenu/ReportActionContextMenu'; | ||
import CONST from '@src/CONST'; | ||
import type * as OnyxCommon from '@src/types/onyx/OnyxCommon'; | ||
import type {MenuItemProps} from './MenuItem'; | ||
import MenuItem from './MenuItem'; | ||
import OfflineWithFeedback from './OfflineWithFeedback'; | ||
|
||
type MenuItemLink = string | (() => Promise<string>); | ||
|
||
|
@@ -14,6 +16,18 @@ type MenuItemWithLink = MenuItemProps & { | |
|
||
/** A unique key for the menu item */ | ||
key?: string; | ||
|
||
/** The pending action for the menu item */ | ||
pendingAction?: OnyxCommon.PendingAction | null; | ||
|
||
/** A function to dismiss the pending action */ | ||
onPendingActionDismiss?: () => void; | ||
|
||
/** The error for the menu item */ | ||
error?: OnyxCommon.Errors | null; | ||
|
||
/** Whether we should force opacity */ | ||
shouldForceOpacity?: boolean; | ||
}; | ||
|
||
type MenuItemListProps = { | ||
|
@@ -45,16 +59,23 @@ function MenuItemList({menuItems = [], shouldUseSingleExecution = false}: MenuIt | |
return ( | ||
<> | ||
{menuItems.map((menuItemProps) => ( | ||
<MenuItem | ||
key={menuItemProps.key ?? menuItemProps.title} | ||
onSecondaryInteraction={menuItemProps.link !== undefined ? (e) => secondaryInteraction(menuItemProps.link, e) : undefined} | ||
ref={popoverAnchor} | ||
shouldBlockSelection={!!menuItemProps.link} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...menuItemProps} | ||
disabled={!!menuItemProps.disabled || isExecuting} | ||
onPress={shouldUseSingleExecution ? singleExecution(menuItemProps.onPress) : menuItemProps.onPress} | ||
/> | ||
<OfflineWithFeedback | ||
pendingAction={menuItemProps.pendingAction} | ||
onClose={menuItemProps.onPendingActionDismiss} | ||
errors={menuItemProps.error} | ||
shouldForceOpacity={menuItemProps.shouldForceOpacity} | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no because they won't be passing |
||
<MenuItem | ||
key={menuItemProps.key ?? menuItemProps.title} | ||
onSecondaryInteraction={menuItemProps.link !== undefined ? (e) => secondaryInteraction(menuItemProps.link, e) : undefined} | ||
ref={popoverAnchor} | ||
shouldBlockSelection={!!menuItemProps.link} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...menuItemProps} | ||
disabled={!!menuItemProps.disabled || isExecuting} | ||
onPress={shouldUseSingleExecution ? singleExecution(menuItemProps.onPress) : menuItemProps.onPress} | ||
/> | ||
</OfflineWithFeedback> | ||
))} | ||
</> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type {DelegateRole} from '@src/types/onyx/Account'; | ||
|
||
type AddDelegateParams = { | ||
delegate: string; | ||
role: DelegateRole; | ||
validateCode: string; | ||
}; | ||
|
||
export default AddDelegateParams; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to move the
key
prop to this component so it prints an error in console nowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i don't understand. OfflineWithFeedback should be passed
key
as a prop?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, since you wrapped
MenuItem
withOfflineWithFeedback
, you have to move thekey
prop fromMenuItem
toOfflineWithFeedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch, let me send a PR