-
Notifications
You must be signed in to change notification settings - Fork 33
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
Implemented functionality to save auto cancel days(#2cxr1cx) #218
Conversation
make a service (updateProductStore) and add a save button to the UI to save changes when user updates auto cancel days settings.
…r handling (#2cxr1cx) used perform find to get the auto cancel days and added toast when auto cancel days are updated
…nt ecom store(#2cxr1cx)
src/views/Orders.vue
Outdated
@@ -274,6 +280,26 @@ export default defineComponent({ | |||
await this.store.dispatch('webhook/unsubscribeWebhook', { webhookId: webhook?.id, shopifyConfigId: this.shopifyConfigId }) | |||
} | |||
}, | |||
async updateAutoCancelDays(){ | |||
if(this.autoCancelDays != this.updatedAutoCancelDays){ |
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 check if selected product store is not the None while setting and getting
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.
Made the requested change.
src/views/Orders.vue
Outdated
isDesktop: isPlatform('desktop') | ||
isDesktop: isPlatform('desktop'), | ||
autoCancelDays: '', | ||
updatedAutoCancelDays: '' |
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 could have variable names as autoCancelDays
and currentAutoCancelDays
. Also, instead of checking in update method we should either disable the save button if both the values are same
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.
Made the requested change.
src/views/Orders.vue
Outdated
} | ||
} | ||
} else { | ||
showToast(translate('None product store selected.')); |
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.
showToast(translate('None product store selected.')); | |
showToast(translate('Unable to update auto cancel days. None product store selected.')); |
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.
Updated toast message.
src/views/Orders.vue
Outdated
showToast(translate("Auto cancel days updated")); | ||
this.autoCancelDays = this.updatedAutoCancelDays; | ||
} else { | ||
showToast(translate("Unable to edit auto cancel days")); |
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.
showToast(translate("Unable to edit auto cancel days")); | |
showToast(translate("Unable to update auto cancel days")); |
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.
Updated toast message.
…days is not changed(#2cxr1cx)
Related Issues
Closes #
Short Description and Why It's Useful
Screenshots of Visual Changes before/after (If There Are Any)
IMPORTANT NOTICE - Remember to add changelog entry
Contribution and Currently Important Rules Acceptance