Skip to content
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: details page for pre-order catalog (#85zt0m4qc) #128

Closed
wants to merge 18 commits into from
Closed

Implemented: details page for pre-order catalog (#85zt0m4qc) #128

wants to merge 18 commits into from

Conversation

alsoK2maan
Copy link
Contributor

Related Issues

Closes #125

Short Description and Why It's Useful

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

IMPORTANT NOTICE - Remember to update CHANGELOG.md with description of your change

Contribution and Currently Important Rules Acceptance

src/services/OrderService.ts Outdated Show resolved Hide resolved
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved

requests.push(JobService.fetchJobInformation(params).catch((error: any) => error))

resp = await Promise.all(requests)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use allSettled()

if (!hasError(resp[1])) {
const pendingJobs = Object.values(resp[1].data.docs.reduce((jobs: [any], job: any) => {
// keeping the job with the highest runTime
if (!jobs[job.systemJobEnumId] || job.runTime > jobs[job.systemJobEnumId].runTime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should sort by runtime and then || job.runTime > jobs[job.systemJobEnumId].runTime will not be required

@@ -124,6 +125,9 @@ const actions: ActionTree<UserState, RootState> = {
}
commit(types.USER_CURRENT_ECOM_STORE_UPDATED, userPrefStore);
commit(types.USER_INFO_UPDATED, userProfile);
this.dispatch('util/getServiceStatusDesc')
await dispatch('getReserveInvConfig', userPrefStore.productStoreId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Get this config on page load

*/
async updatePreOrdPhyInvHoldStatus({ dispatch, state }, payload) {
// Handled initial programmatical update
// When storing boolean values, it is stored as string. Further comparison needs conversion
Copy link
Contributor

Choose a reason for hiding this comment

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

This should handled from UI

/**
Update preorder physical inventory hold config
*/
async updatePreOrdPhyInvHoldStatus({ dispatch, state }, payload) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
async updatePreOrdPhyInvHoldStatus({ dispatch, state }, payload) {
async updatePreOrdPhyInvHoldConfig({ dispatch, state }, payload) {

@@ -153,6 +157,8 @@ const actions: ActionTree<UserState, RootState> = {
'userPrefTypeId': 'SELECTED_BRAND',
'userPrefValue': payload.eComStore.productStoreId
});
await dispatch('getReserveInvConfig', payload.eComStore.productStoreId)
await dispatch('getPreOrdPhyInvHoldConfig', payload.eComStore.productStoreId)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should clear here

</div>

<div>
<ion-card v-if="pOAndATPDetails.isLoaded && pOSummary.isLoaded">
Copy link
Contributor

Choose a reason for hiding this comment

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

isLoaded use purpose specific properties to handle it

@alsoK2maan alsoK2maan changed the title [WIP] Implemented: details page for pre-order catalog (#85zt0m4qc) Implemented: details page for pre-order catalog (#85zt0m4qc) May 25, 2023
@alsoK2maan alsoK2maan marked this pull request as ready for review May 25, 2023 06:20
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved
src/store/modules/job/actions.ts Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
// get last active PO ID if active PO ID is not found
payload = {
"inputFields": {
"productId": this.$route.params.variantId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure that if user hits the URL without variantId, there are no API calls

src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
src/services/UtilService.ts Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Show resolved Hide resolved
src/views/catalog-product-details.vue Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
// fetch fromDate only for active POs in pre-order/back-order category
if (this.poSummary.isActivePo) {
if (this.poSummary.categoryId) {
let resp: any = await OrderService.getPoFromDate({
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to check if we could use fromDate field from ProductCategoryDcsnRsn

// TODO - internationalize header after getting generic strings
if (!hasError(resp)) {
const fromDate = resp.data.docs[0].fromDate
if (this.configsByStores.length > this.poSummary.listedCount) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to simplify this logic, use flags to determine decision variable and then prepare messages

src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
src/views/catalog-product-details.vue Outdated Show resolved Hide resolved
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.

Create detail screen for pre-order catalog
3 participants