Skip to content
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
be9b2b9
refactor: migrate 'Add Attachment' flows to AttachmentModalScreen
chrispader Aug 29, 2025
25471a5
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 4, 2025
96d4dd5
fix: add ReportAddAttachmentModal route
chrispader Sep 4, 2025
2cfac05
fix: remove validation logic in ReportAttachmentModalContent
chrispader Sep 4, 2025
000fd32
fix: remove onConfirm callback from ReportAttachmentModalContent
chrispader Sep 4, 2025
667ef39
fix: ReportAttachmentModalContent
chrispader Sep 4, 2025
d8b1bb9
fix: wrong screen name
chrispader Sep 4, 2025
89b9b1a
refactor: simplify threeDotsMenuItems prop implementation
chrispader Sep 8, 2025
844976a
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 8, 2025
358dd96
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 13, 2025
248939d
fix: integrate file upload validation into useFilesValidation
chrispader Sep 13, 2025
c9351f2
refactor: rename CONST keys for AttachmentModal validation errors
chrispader Sep 15, 2025
c55551b
fix: error modal not shown
chrispader Sep 15, 2025
6178d2b
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 15, 2025
6c02057
rename test names
chrispader Sep 16, 2025
2afa420
refactor: move `validateAttachment` logic to `AttachmentValidation` lib
chrispader Sep 16, 2025
4a63bd4
test: update tests according to changes in FileUtils
chrispader Sep 16, 2025
ca2820d
fix: attachment file validation
chrispader Sep 16, 2025
d4ac8be
refactor: move CONST keys for more order
chrispader Sep 16, 2025
0adee50
feat: check for HEIC or HEIF image errors
chrispader Sep 16, 2025
e3955ce
refactor: remove unnecessary prop
chrispader Sep 16, 2025
4100f35
feat: add files to validation results
chrispader Sep 16, 2025
beb2ded
refactor: useFilesValidation
chrispader Sep 16, 2025
829e146
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 17, 2025
34f848e
refactor: revert attachment validation changes
chrispader Sep 17, 2025
2896fff
fix: TS error and improve isPdfFile function
chrispader Sep 17, 2025
5d682e5
fix: invalid prop
chrispader Sep 17, 2025
6484736
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 18, 2025
1133d83
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 20, 2025
438d06d
fix: add missing displayName
chrispader Sep 20, 2025
68d6ffe
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 23, 2025
bfae2ab
refactor: move attachment validation to ReportActionCompose
chrispader Sep 23, 2025
1987deb
refactor: replace ExtraModels prop with ExtraContent in container
chrispader Sep 23, 2025
4f45a88
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 24, 2025
e15abfc
fix: file validation and source extraction in "Add attachment"
chrispader Sep 24, 2025
1adcbcc
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 24, 2025
3080cd3
fix: allow pasting multiple files
chrispader Sep 24, 2025
32259c9
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Sep 28, 2025
376ae6d
refactor: rename onPasteFile prop
chrispader Sep 28, 2025
852b073
fix: don't validate receipts by default
chrispader Sep 28, 2025
c32652e
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Oct 2, 2025
905e232
Merge branch 'main' into pr/69523
chrispader Oct 7, 2025
80a2d46
fix: add missing `isAttachmentLoaded` logic
chrispader Oct 7, 2025
aa0443b
Merge branch 'main' into @chrispader/add-attachment-modal-refactor
chrispader Oct 8, 2025
605f622
refactor: prefer early return
chrispader Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,12 @@ const ROUTES = {
route: 'attachment',
getRoute: (params?: ReportAttachmentsRouteParams) => getAttachmentModalScreenRoute('attachment', params),
},
REPORT_ADD_ATTACHMENT: {
route: 'r/:reportID/attachment/add',
getRoute: (reportID: string, params?: ReportAddAttachmentRouteParams) => {
return getAttachmentModalScreenRoute(`r/${reportID}/attachment/add`, params);
},
},
EDIT_CURRENCY_REQUEST: {
route: 'r/:threadReportID/edit/currency',
getRoute: (threadReportID: string, currency: string, backTo: string) => `r/${threadReportID}/edit/currency?currency=${currency}&backTo=${backTo}` as const,
Expand Down Expand Up @@ -3276,11 +3282,13 @@ export {PUBLIC_SCREENS_ROUTES, SHARED_ROUTE_PARAMS, VERIFY_ACCOUNT};
export default ROUTES;

type ReportAttachmentsRoute = typeof ROUTES.ATTACHMENTS.route;
type AttachmentRoutes = ReportAttachmentsRoute;
type ReportAddAttachmentRoute = `r/${string}/attachment/add`;
type AttachmentRoutes = ReportAttachmentsRoute | ReportAddAttachmentRoute;

type ReportAttachmentsRouteParams = RootNavigatorParamList[typeof SCREENS.ATTACHMENTS];
type ReportAddAttachmentRouteParams = RootNavigatorParamList[typeof SCREENS.REPORT_ADD_ATTACHMENT];

function getAttachmentModalScreenRoute(url: AttachmentRoutes, params?: ReportAttachmentsRouteParams) {
function getAttachmentModalScreenRoute(url: AttachmentRoutes, params?: ReportAttachmentsRouteParams | ReportAddAttachmentRouteParams) {
if (!params?.source) {
return url;
}
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const PROTECTED_SCREENS = {
HOME: 'Home',
CONCIERGE: 'Concierge',
ATTACHMENTS: 'Attachments',
REPORT_ADD_ATTACHMENT: 'ReportAddAttachment',
TRACK_EXPENSE: 'TrackExpense',
SUBMIT_EXPENSE: 'SubmitExpense',
} as const;
Expand Down
303 changes: 0 additions & 303 deletions src/components/AttachmentComposerModal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Composer/implementation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function Composer(
// If paste contains files, then trigger file management
if (event.clipboardData?.files.length && event.clipboardData.files.length > 0) {
// Prevent the default so we do not post the file name into the text box
onPasteFile(event.clipboardData.files[0]);
onPasteFile(Array.from(event.clipboardData.files));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now allows pasting multiple files from clipboard into the Composer

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Composer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ComposerProps = Omit<TextInputProps, 'onClear'> & {
onChangeText?: (numberOfLines: string) => void;

/** Callback method to handle pasting a file */
onPasteFile?: (file: FileObject) => void;
onPasteFile?: (files: FileObject | FileObject[]) => void;

/** General styles to apply to the text input */
// eslint-disable-next-line react/forbid-prop-types
Expand Down
Loading
Loading