Skip to content

Conversation

@SuyashSingh01
Copy link
Contributor

@SuyashSingh01 SuyashSingh01 commented Sep 19, 2025

Related Issues

Issue:dxp-component/375
Issue Link; hotwax/dxp-components#375

Improved:Replaced the Ecomstore to ProductStore at app level.

Short Description and Why It's Useful

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

Contribution and Currently Important Rules Acceptance

@gemini-code-assist
Copy link

Summary of Changes

Hello @SuyashSingh01, 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 focuses on improving code consistency and readability by refactoring variable names across the application. Specifically, it renames instances of 'ecomstore' related variables to 'productStore' to align with existing terminology and reduce potential confusion. This is a purely refactoring change that does not alter the functional behavior of the application but enhances its maintainability and clarity.

Highlights

  • Variable Renaming in user/actions.ts: The variable previousEComStoreId has been renamed to previousProductStoreId within the updateCurrentFacility action. Additionally, eComStoreId has been consistently renamed to productStoreId across the createProductStoreSetting and setProductStoreSetting actions to improve naming consistency.
  • Variable Renaming in utils/index.ts: The variable currentEComStore within the getProductStoreId function has been renamed to currentProductStore to align with the new naming convention.
  • Code Consistency: The changes standardize the naming convention for product store related variables, replacing 'ecomstore' with 'productStore' throughout the affected files for better readability and maintainability.
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

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 refactors variable names from ecomstore to productStore for better consistency, which improves code clarity. The changes in src/store/modules/user/actions.ts are correct and align with this goal. In src/utils/index.ts, I've suggested an improvement to make the getProductStoreId function more robust by adding a null check to prevent potential runtime errors.

Comment on lines +187 to +188
const currentProductStore: any = useUserStore().getCurrentEComStore;
return currentProductStore.productStoreId

Choose a reason for hiding this comment

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

high

While renaming the variable is a good improvement for consistency, this function can be made more robust. The current implementation will throw a TypeError if useUserStore().getCurrentEComStore returns a nullish value, which can be hard to debug. It's better to handle this case explicitly by checking for the value and throwing a more descriptive error. Additionally, the explicit any type can be removed to rely on type inference, improving type safety.

  const currentProductStore = useUserStore().getCurrentEComStore;
  if (!currentProductStore?.productStoreId) {
    throw new Error("Current product store not found or is missing a productStoreId.");
  }
  return currentProductStore.productStoreId;

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.

1 participant