-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[TS migration] Migrate AttachmentCarousel to typescript #36658
[TS migration] Migrate AttachmentCarousel to typescript #36658
Conversation
src/components/Attachments/AttachmentCarousel/CarouselActions.tsx
Outdated
Show resolved
Hide resolved
src/components/Attachments/AttachmentCarousel/CarouselActions.tsx
Outdated
Show resolved
Hide resolved
src/components/Attachments/AttachmentCarousel/extractAttachmentsFromReport.ts
Outdated
Show resolved
Hide resolved
src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.tsx
Outdated
Show resolved
Hide resolved
src/components/Attachments/AttachmentView/AttachmentViewPdf/types.ts
Outdated
Show resolved
Hide resolved
isSingleItem={items.length === 1} | ||
index={index} |
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.
why those props were removed?
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.
It's no longer used by CarouselItem, probably smb forgot to remove this.
/** URL to full-sized attachment, SVG function, or numeric static image on native platforms */ | ||
source: AttachmentsPropTypes.attachmentSourcePropType.isRequired, | ||
type AttachmentViewProps = AttachmentViewOnyxProps & | ||
Omit<Attachment, 'isAuthTokenRequired'> & { |
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.
Instead of omitting isAuthTokenRequired from Attachment. Make that prop optional in Attachment
/** The id of the report action related to the attachment */ | ||
reportActionID: PropTypes.string, | ||
/** Extra styles to pass to View wrapper */ | ||
containerStyles?: Array<StyleProp<ViewStyle>>; |
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.
containerStyles?: Array<StyleProp<ViewStyle>>; | |
containerStyles?: StyleProp<ViewStyle>; |
/** The id of the transaction related to the attachment */ | ||
transactionID?: string; |
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.
/** The id of the transaction related to the attachment */ | |
transactionID?: string; |
Already defined in Attachment
|
||
isHovered?: boolean; | ||
|
||
optionalVideoDuration?: number; |
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.
optionalVideoDuration?: number; |
Attachment has prop duration
let's use it instead
|
||
/** Whether the video is currently being hovered over */ | ||
isHovered: PropTypes.bool, | ||
isHovered?: boolean; |
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.
isHovered?: boolean; |
Pick from AttachmentViewProps
|
||
type AttachmentViewPdfProps = Pick<AttachmentViewProps, 'file' | 'onPress' | 'isUsedInCarousel' | 'isFocused' | 'onToggleKeyboard'> & { | ||
encryptedSourceUrl: string; | ||
onToggleKeyboard?: (shouldFadeOut: boolean) => void; |
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.
onToggleKeyboard?: (shouldFadeOut: boolean) => void; |
Already defined
@SzymczakJ We have a failing performance test. Can you please merge |
@s77rt had to merge it twice but it passed 😄 |
@SzymczakJ Thank you! |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25152 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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.
Just some minor comments/questions.
src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx
Show resolved
Hide resolved
src/components/Attachments/types.ts
Outdated
import type {FileObject} from '@components/AttachmentModal'; | ||
import type IconAsset from '@src/types/utils/IconAsset'; | ||
|
||
// This can be either a string, function, or number |
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.
This comment doesn't really add any value. The line below makes that clear. If we think this is an interesting or important point, it'd be good to add "why".
@puneetlath fixed your comments! |
@puneetlath looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
All the tests did pass. |
Details
Fixed Issues
$ #25152
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android.web.mov
iOS: Native
ios.mov
iOS: mWeb Safari
iosweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov