Skip to content

Conversation

@Nirvan-Bobde30
Copy link
Contributor

Related Issues

#307

Short Description and Why It's Useful

  • added empty state in purchase order review page and handled chip state when file is re-uploaded .

Screenshots of Visual Changes before/after (If There Are Any)

image

Contribution and Currently Important Rules Acceptance

@gemini-code-assist
Copy link

Summary of Changes

Hello @Nirvan-Bobde30, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience on the purchase order review page by introducing an empty state display when no purchase orders are present. Additionally, it improves the file upload workflow by ensuring that any previously selected field mappings are cleared upon a new file upload or an upload error, preventing stale data and potential mapping issues.

Highlights

  • Empty State Implementation: An empty state message 'No purchase orders found' has been added to the purchase order review page, improving user feedback when no data is available.
  • Mapping State Reset: The selected mapping ID and field mappings are now automatically reset when a file is re-uploaded or if a file upload fails, ensuring a clean state for new uploads.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds an empty state for the purchase order review page and ensures that the mapping chip state is reset when a new file is uploaded. The changes are logical and address the described issues. I've provided a couple of suggestions in src/views/PurchaseOrder.vue to improve code maintainability by reducing duplication and ensuring consistent state management, particularly in error handling scenarios.

Comment on lines +116 to +120
this.selectedMappingId = "";
this.fieldMapping = Object.keys(this.fields).reduce((map, field) => {
map[field] = "";
return map;
}, {});

Choose a reason for hiding this comment

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

medium

This logic to reset the mapping state is also present in the ionViewDidEnter lifecycle hook (lines 103-107). To improve maintainability and adhere to the Don't Repeat Yourself (DRY) principle, consider extracting this block of code into a separate method and calling it from both parse and ionViewDidEnter.

For example, you could create a resetMappingState method:

resetMappingState() {
  this.selectedMappingId = "";
  this.fieldMapping = Object.keys(this.fields).reduce((map, field) => {
    map[field] = "";
    return map;
  }, {});
}

Then you can simply call this.resetMappingState(); here and in other places where this logic is needed, like the catch block.

}
} catch {
this.content = []
this.selectedMappingId = "";

Choose a reason for hiding this comment

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

medium

In case of an error during file parsing, it's good practice to reset the entire mapping state for consistency, not just selectedMappingId. This should include resetting fieldMapping as well, similar to the logic in the try block. This ensures the UI is in a clean and predictable state after an error. This also reinforces the benefit of extracting this logic to a shared method.

          this.selectedMappingId = "";
          this.fieldMapping = Object.keys(this.fields).reduce((map, field) => {
            map[field] = "";
            return map;
          }, {});

@dt2patel dt2patel closed this Dec 12, 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.

2 participants