-
Notifications
You must be signed in to change notification settings - Fork 84
In Progress Counts in Assined Page and New Session Modal #847
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
base: inventory-count-3.0
Are you sure you want to change the base?
In Progress Counts in Assined Page and New Session Modal #847
Conversation
Banibrata-Manna
commented
Oct 24, 2025
- Show the list of IN_PROGRESS Counts in assigned page and it's sessions,
- Added a base modal template to add new session.
- Added an api service in count service to post the new Count Session for given Count with demo payload.
…dd new session in a count
Summary of ChangesHello @Banibrata-Manna, 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 significantly enhances the cycle count management feature by introducing the ability to view "IN_PROGRESS" counts along with their individual sessions directly on the assigned page. It also provides a streamlined user experience for creating new count sessions through a dedicated modal and integrates the necessary API calls to support this functionality. Highlights
Using Gemini Code AssistThe 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
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 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
|
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.
Code Review
This pull request introduces functionality for displaying 'in-progress' counts and adding new count sessions. While the changes are a good step forward, there are several areas that need attention. A critical issue is the use of hardcoded data in the new session modal, which renders it non-functional for production use. Additionally, there are several instances of debugging console.log statements that should be removed, and opportunities for code improvement in terms of type safety, refactoring, and fixing a potential bug with a v-for key. Addressing these points will significantly improve the quality and robustness of the code.
| function addNewSession() { | ||
| CountService.addSessionInCount({ | ||
| countImportName: "Test Count From Modal", | ||
| statusId: "CYCLE_CNT_CREATED", | ||
| uploadedByUserLogin: "hotwax.user", | ||
| facilityAreaId: "Basement Vault 786", | ||
| createdDate: Date.now(), | ||
| dueDate: Date.now(), | ||
| workEffortId: "M100877" | ||
| }); | ||
| } |
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 addNewSession function uses a hardcoded payload to create a new session. This is not suitable for production and appears to be for demonstration purposes. The data for the new session, particularly the workEffortId, should be passed into this component as a prop. Other details should be collected from the user via form inputs within the modal, which is currently empty.
src/views/Count.vue
Outdated
| </ion-card> | ||
|
|
||
| <ion-card v-for="count in cycleCount" :key="count.inventoryCountImportId" @click="navigateToStoreView(count)" button> | ||
| <ion-card v-for="count in cycleCount" :key="count.inventoryCountImportId"> |
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 :key for the v-for loop is count.inventoryCountImportId. However, the count object is a "work effort" from getAssignedWorkEfforts and may not have this property. A more appropriate and stable key would be count.workEffortId. Using an incorrect or non-unique key can lead to unpredictable rendering behavior in Vue.
<ion-card v-for="count in cycleCount" :key="count.workEffortId">
| params | ||
| }); | ||
| } | ||
| const getInventoryCountImportsByWorkEffort = async (params: any): Promise <any> => { |
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.
| }); | ||
| } | ||
|
|
||
| const addSessionInCount = async (payload: any): Promise<any> => { |
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.
| } | ||
| } | ||
|
|
||
| console.log("These are counts: ", assignedWorkEfforts); |
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.
| <ion-item-group v-for="session in count.sessions" :key="session.inventoryCountImportId"> | ||
| <ion-item> | ||
| <ion-label> | ||
| {{ session.countImportName }} + {{ session.facilityAreaId }} |
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.
| const currentFacility = computed(() => userStore.getCurrentFacility) | ||
| const cycleCountStats = computed(() => (id) => store.getters["count/getCycleCountStats"](id)) | ||
| // const cycleCountStats = computed(() => (id) => store.getters["count/getCycleCountStats"](id)) | ||
| const userProfile = store.getters["user/getUserProfile"]; |
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.
| // TODO: Fetch the status description when the app loads. | ||
| function getSessionStatusDescription(statusId) { | ||
| if (!statusId) { | ||
| return ""; | ||
| } | ||
| if (statusId === "INV_COUNT_CREATED") { | ||
| return "Created"; | ||
| } else if (statusId === "CYCLE_CNT_IN_PRGS") { | ||
| return "In Progress"; | ||
| } else if (statusId === "CYCLE_CNT_IN_CMPLTD") { | ||
| return "Completed"; | ||
| } else { | ||
| return "Cancelled" | ||
| } | ||
| } |
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 getSessionStatusDescription function uses a chain of if/else if statements. This can be refactored into a more readable and maintainable structure using a map or an object lookup. This also makes it easier to add new statuses in the future. The hardcoded status IDs should also be defined as constants.
// TODO: Fetch the status description when the app loads.
const sessionStatusDescriptions: Record<string, string> = {
"INV_COUNT_CREATED": "Created",
"CYCLE_CNT_IN_PRGS": "In Progress",
"CYCLE_CNT_IN_CMPLTD": "Completed",
};
function getSessionStatusDescription(statusId: string): string {
if (!statusId) {
return "";
}
return sessionStatusDescriptions[statusId] || "Cancelled";
}
| currentStatusId: getStatusIdForCountsToBeFetched() | ||
| }; | ||
| await store.dispatch("count/fetchCycleCountsLists", payload); | ||
| console.log("This is store: ", store); |
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.
…tory-count into inventory-count-3.0-assigned-list-page
…tory-count into inventory-count-3.0-assigned-list-page
…ub.com/Banibrata-Manna/inventory-count into inventory-count-3.0-assigned-list-page