-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fixed: Jobs repeatation in moreJobs sections on all pages(#2vjxdha) #296
Conversation
src/views/Product.vue
Outdated
@@ -40,7 +40,7 @@ | |||
<ion-toggle slot="end" :checked="deleteProductsWebhook" @ionChange="updateWebhook($event['detail'].checked, 'DELETE_PRODUCTS')" color="secondary" /> | |||
</ion-item> | |||
</ion-card> | |||
<MoreJobs v-if="moreJobs.length" :jobs="moreJobs" :jobEnums="jobEnums" /> | |||
<MoreJobs v-if="getMoreJobs(jobEnums, 'PRODUCT_SYS_JOB').length" :jobs="getMoreJobs(jobEnums, 'PRODUCT_SYS_JOB').length" :jobEnums="jobEnums" /> |
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.
Define a local property to declare the enumTypeId value.
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.
Done sir
src/views/Orders.vue
Outdated
@@ -500,7 +495,7 @@ export default defineComponent({ | |||
if (this.currentEComStore.productStoreId) { | |||
this.getAutoCancelDays(); | |||
} | |||
this.fetchMoreJobs(); | |||
// this.moreJobs = this.getMoreJobs(this.jobEnums, "ORDER_SYS_JOB"); |
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.
Remove this comment if not needed.
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.
Done sir
src/store/modules/job/getters.ts
Outdated
|
||
return Object.values(jobs) | ||
return Object.keys(state.cached).reduce((orders: any, enumId: any) => { | ||
if(orderJobEnumIds.indexOf(enumId) === -1 && state.cached[enumId]?.enumTypeId === enumTypeId) { |
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.
Instead in place of indexOf, I think using includes will be a good option.
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.
Sure sir
src/store/modules/job/getters.ts
Outdated
return Object.values(jobs) | ||
return Object.keys(state.cached).reduce((orders: any, enumId: any) => { | ||
if(orderJobEnumIds.indexOf(enumId) === -1 && state.cached[enumId]?.enumTypeId === enumTypeId) { | ||
orders.push(state.cached[enumId]) |
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.
I think we should change order
specific variable name, the same getter is being used on all pages.
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.
Right sir. Fixed it.
src/store/modules/job/getters.ts
Outdated
|
||
return Object.values(jobs) | ||
return Object.keys(state.cached).reduce((orders: any, enumId: 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.
return Object.keys(state.cached).reduce((orders: any, enumId: any) => { | |
return Object.keys(state.cached).reduce((orders: any, enumId: string) => { |
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.
done
…action payload(#2vjxdha-n)
src/store/modules/job/getters.ts
Outdated
|
||
return Object.values(jobs) | ||
return Object.keys(state.cached).reduce((jobs: any, enumId: string) => { | ||
if(!orderJobEnumIds.includes(enumId) && state.cached[enumId]?.enumTypeId === enumTypeId) { |
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.
We should first check enumTypeId as it will have many other types of jobs and it is better to avoid includes operation for other types
if(!orderJobEnumIds.includes(enumId) && state.cached[enumId]?.enumTypeId === enumTypeId) { | |
if(state.cached[enumId]?.enumTypeId === enumTypeId && !orderJobEnumIds.includes(enumId)) { |
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.
Done sir
src/views/Inventory.vue
Outdated
"enumTypeId": "INVENTORY_SYS_JOB", | ||
}, | ||
}); | ||
getMoreJobs(jobEnums: any, enumTypeId: string) { |
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.
Why this is needed? we could directly use moreJobs(jobEnums, enumTypeId)
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.
Yes sir. Fixed it.
src/store/modules/job/actions.ts
Outdated
@@ -357,7 +357,7 @@ const actions: ActionTree<JobState, RootState> = { | |||
...payload.inputFields | |||
}, | |||
"noConditionFind": "Y", | |||
"viewSize": (payload.inputFields?.systemJobEnumId?.length * 3) | |||
"viewSize": (payload.inputFields?.systemJobEnumId?.length * 3) || 30 |
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.
We should increase this value
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.
Sure sir. Increased it to 50
…ier to show moreJobs we had a getter which is called inside a method, we can directly call that getter and pass values inside it(#2vjxdha-n)
…returns a value from getter, we should give it name starting with get(#2vjxdha-n)
Related Issues
Closes #257
Short Description and Why It's Useful
We have hardcoded jobs at the top of pages & below we have moreJobs section, earlier hardCoded jobs were are shown in moreJobs section which is wrong. This happened because enumTypeId were same for both. Now fixed it.
Screenshots of Visual Changes before/after (If There Are Any)
IMPORTANT NOTICE - Remember to add changelog entry
Contribution and Currently Important Rules Acceptance