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

Not found SKUs message logic added #124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GabrielBarross
Copy link
Contributor

What is the purpose of this pull request?

Based on the last affiliates-commission-service PR, we are adding two new graphQL operations to be used by the front end.
When a client uploads a new commissions spreadsheet, the back end will return if some of the IDs were not found by our catalog API, and by clicking on verifying the SKUs the client will be able to know if some error happened

What problem is this solving?

Better user experience

How to test it?

Accessing the link below and uploading some spreadsheets
https://commissionstest--bibiafiliados.myvtex.com/admin/affiliates-commissions

Screenshots or example usage

commisionsWarning

commisionsSuccess

How does this PR make you feel? 🔗

Types of changes

  • Chore (non-breaking change which doesn't change any functionalities)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

@GabrielBarross GabrielBarross requested a review from a team as a code owner November 8, 2022 21:09
@GabrielBarross GabrielBarross self-assigned this Nov 8, 2022
@GabrielBarross GabrielBarross requested review from matcastro and removed request for a team November 8, 2022 21:09
@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Nov 8, 2022

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

Fails
🚫

We follow keepachangelog standards.

Please, change the file CHANGELOG.md adding a small summary of your changes under the [Unreleased] section. Example:

 ## [Unreleased]

+ ### Fixed
+ - Issue with image sizing in the SKU Selector.

Possible types of changes:

  • Added for new features.
  • Changed for changes in existing functionality.
  • Deprecated for soon-to-be removed features.
  • Removed for now removed features.
  • Fixed for any bug fixes.
  • Security in case of vulnerabilities.

Generated by 🚫 dangerJS against d358d5b

Comment on lines +15 to +27
return (
<>
{notFound === true ? (
<Alert variant="warning">
{intl.formatMessage(messages.affiliateCommissionWarning)}
</Alert>
) : (
<Alert variant="positive">
{intl.formatMessage(messages.affiliateCommissionSuccess)}
</Alert>
)}
</>
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use prevent return in this case I think it's a better idea.

Suggested change
return (
<>
{notFound === true ? (
<Alert variant="warning">
{intl.formatMessage(messages.affiliateCommissionWarning)}
</Alert>
) : (
<Alert variant="positive">
{intl.formatMessage(messages.affiliateCommissionSuccess)}
</Alert>
)}
</>
)
if (notFound) {
return (
<Alert variant="warning">
{intl.formatMessage(messages.affiliateCommissionWarning)}
</Alert>
)
}
return (
<Alert variant="positive">
{intl.formatMessage(messages.affiliateCommissionSuccess)}
</Alert>
)

Comment on lines +152 to +154
{dataSKUs?.getNotFoundCommissions !== undefined ? (
<CommissionsNotFound notFound={dataSKUs.getNotFoundCommissions} />
) : null}
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
{dataSKUs?.getNotFoundCommissions !== undefined ? (
<CommissionsNotFound notFound={dataSKUs.getNotFoundCommissions} />
) : null}
{dataSKUs?.getNotFoundCommissions && <CommissionsNotFound notFound={dataSKUs.getNotFoundCommissions} />}

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.

4 participants