Skip to content

Conversation

@BrunaCubos
Copy link
Collaborator

What's the purpose of this pull request?

This pull request improves the Quick Order drawer experience by fixing CSV file upload error handling, removing leftover debug code, and ensuring the attachment button behavior is fully driven by CMS configuration.

How it works?

  • The FileUploadCard component now reacts to the hasError prop from its parent via a useEffect.

  • When CSV parsing fails, the upload state is automatically set to error.

  • Parsing errors are mapped to the invalid-structure error type, displaying the message:
    "Invalid structure. Check missing headers or columns and try again."

  • Selecting a new file automatically clears the previous error state.

  • The SearchInput component now uses the attachmentButton configuration provided by CMS instead of hardcoded values.

  • The attachment button respects the enabled flag from the Navbar section configuration.

  • Icon and aria-label values are passed dynamically from CMS (attachmentButtonIcon and attachmentButtonAriaLabel).

  • Removed the hardcoded showAttachmentButton={true} and replaced it with a CMS-driven prop.

How to test it?

  • Navigate to the store homepage
  • Click the attachment button in the search input (if enabled)
  • Upload an invalid CSV file (missing headers, wrong format, corrupted file)
  • Expected: The FileUploadStatus component displays an error state
  • Expected: Error message shows
    "Invalid structure. Check missing headers or columns and try again."
  • Select a new file
    Expected: The error state is cleared

Starters Deploy Preview

References

Checklist

You may erase this after checking them all 😉

PR Title and Commit Messages

  • PR title and commit messages follow the Conventional Commits specification
    • Available prefixes: feat, fix, chore, docs, style, refactor, ci and test

PR Description

  • Added a label according to the PR goal - breaking change, bug, contributing, performance, documentation..

Dependencies

  • Committed the pnpm-lock.yaml file when there were changes to the packages

Documentation

-[ x] PR description

  • For documentation changes, ping @Mariana-Caetano to review and update (Or submit a doc request)

BrunaCubos and others added 30 commits November 10, 2025 11:23
- Introduced `FileUploadCard` for file selection and upload functionality, including drag-and-drop support.
- Added `FileUploadStatus` to display upload progress and error handling.
- Updated index files to export new components and types.
- Enhanced `SearchInputField` to include an attachment button that triggers the file upload card.
- Added styles for both new components to ensure proper UI integration.
@BrunaCubos BrunaCubos requested a review from a team as a code owner December 17, 2025 14:39
@BrunaCubos BrunaCubos requested review from hellofanny and renatamottam and removed request for a team December 17, 2025 14:39
@BrunaCubos BrunaCubos changed the title Feat/quick order integration feat: quick order upload integration Dec 17, 2025
@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 17, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

REGRA.MD Outdated
@@ -0,0 +1,167 @@
B2B Faststore - Quick Order by File
Copy link
Contributor

Choose a reason for hiding this comment

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

Remover

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removido!

Untitled Outdated
@@ -0,0 +1,2 @@
packages:
Copy link
Contributor

Choose a reason for hiding this comment

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

Acredito que isso tb deve ser removido

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ajustado!

@BrunaCubos
Copy link
Collaborator Author

Planilha usada para integraçao:
FastStore Starter Template.csv

- Replaced native input elements with custom Input and Button components for consistency.
- Simplified accepted file types in FileUploadCard to only '.csv'.
- Added TODO comment for file size formatting in FileUploadStatus.
- Adjusted SCSS variable formatting for improved readability.
- Updated `useFileUpload` to use `FileRejection` type for better type safety.
- Introduced `UploadFileDropdown` component with improved CSV file handling using `useCSVParser` hook.
- Simplified error handling and template generation for CSV uploads.
- Added lazy loading for `UploadFileDropdown` in `SearchInput` component.
brunass and others added 2 commits December 17, 2025 17:30
…d.tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@BrunaCubos BrunaCubos closed this Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants