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

Action bar - order and payment [last subscription cycle] #163

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rrbambokian
Copy link
Contributor

What does this PR do? *

New action bar behaviors for the last subscription's cycle.

How to test it? *

  • Login in workspace
  • Visit a specific subscription details screen
  • Then, check 'contextual primary actions' section on Figma layout and compare with the orders and payments action bar present in the workspace

Related to / Depends on *

@rrbambokian rrbambokian requested a review from a team as a code owner March 9, 2021 15:26
@rrbambokian rrbambokian requested a review from a team March 9, 2021 15:26
@rrbambokian rrbambokian requested a review from a team as a code owner March 9, 2021 15:26
@rrbambokian rrbambokian requested review from silviasfon and felipetofoli and removed request for a team March 9, 2021 15:26
@rrbambokian rrbambokian changed the title Feature/order action bar Action bar - order and payment [last subscription cycle] Mar 9, 2021
Comment on lines +256 to +259
orderStatus: string | undefined
orderDeliveryDate: string | undefined
orderTrackingUrl: string | undefined
bankSlipUrl: string | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe passing the full order to this guy is a better approach instead of multiple props.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checking DetailsPage, the ActionBar is called like this:

<ActionBar
  status={subscription.status}
  isSkipped={subscription.isSkipped}
  address={subscription.shippingAddress}
  payment={subscription.purchaseSettings.paymentMethod}
  onUpdateAction={this.handleUpdateAction}
  nextPurchaseDate={subscription.nextPurchaseDate}
  orderStatus={subscription.lastExecution?.order?.status}
  orderDeliveryDate={
    subscription.lastExecution?.order?.status === 'invoiced'
      ? orderLogisticsInfo.length > 0 &&
        orderLogisticsInfo[0].shippingEstimateDate
      : undefined
  }
  orderTrackingUrl={
    subscription.lastExecution?.order?.status === 'invoiced'
      ? orderPackages.length > 0 && orderPackages[0].trackingUrl
      : undefined
  }
  bankSlipUrl={orderTransactions?.[0].payments?.[0]?.url}
/>

there are conditions in some parameters.. do you think it's better this way or passes the entire subscription object to handle it inside the action bar?

Comment on lines +115 to +116
} else if (action === 'orderDispatched' && !!orderTrackingUrl) {
window.open(orderTrackingUrl)
Copy link
Contributor

Choose a reason for hiding this comment

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

Displaying an anchor tag is a better approach instead of calling through javascript and you can do it on the ActionBar component itself instead of doing it on the parent component

Copy link
Contributor Author

@rrbambokian rrbambokian Aug 17, 2021

Choose a reason for hiding this comment

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

hmm I get it.. but based on the generic structure defined in this handleUpdateAction method, that the effects are generated from the action param, isn't it preferable to keep the navigations that way?

Comment on lines +123 to +124
} else if (action === 'nextPurchase') {
this.handleChangeEdit(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do?

@sonarcloud
Copy link

sonarcloud bot commented Apr 19, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

2 participants