-
Notifications
You must be signed in to change notification settings - Fork 1
Add message for auto defended disputes #679
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
Conversation
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.
Hello @glad-adyen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello team, gemini-code-assist here to provide a summary of this pull request. This PR addresses issue CXP-3693
by introducing a new informational alert within the Dispute Management component. The purpose of this alert is to clearly indicate to the user when a specific dispute has been automatically defended by the system. This involves adding a new flag to the dispute data structure, updating the UI logic to check for this flag and display the appropriate alert, and adding the necessary translation strings for the new message.
Highlights
- New 'autodefended' flag: A new boolean property
autodefended
has been added to theDefense
type in the API schema and is used in mock data to indicate if a dispute was automatically defended. - Auto-defended alert UI: A new alert mode
autoDefended
is introduced in theDisputeDataAlert
component. This mode displays a 'HIGHLIGHT' type, 'TIP' variant alert with a specific message when theautodefended
flag is true on a dispute. - Alert display logic: The logic in the
DisputeData
component is updated to prioritize showing theautoDefended
alert if the dispute'sdefense.autodefended
property is true, before checking for other alert conditions likecontactSupport
ornotDefended
. - Translation strings: New translation keys and English strings (
disputes.alert.autoDefended
) have been added to support the new alert message.
Changelog
Click here to see the changelog
- mocks/mock-data/disputes.ts
- Added
autodefended: false
to default dispute defense mock data.
- Added
- src/components/external/DisputeManagement/components/DisputesData/DisputeData.tsx
- Added
autoDefended
to theDisputeDataAlertMode
type. - Added a new case for
autoDefended
in theDisputeDataAlert
component to render the new alert. - Changed the alert type for
notDefended
fromSUCCESS
toHIGHLIGHT
. - Added logic in
DisputeData
to check fordispute?.defense?.autodefended === true
and set the alert mode toautoDefended
.
- Added
- src/translations/en-US.instructions.json
- Added instruction text for the new
disputes.alert.autoDefended
translation key.
- Added instruction text for the new
- src/translations/en-US.json
- Added the English translation string for
disputes.alert.autoDefended
: "This chargeback was defended automatically.".
- Added the English translation string for
- src/types/api/resources/DisputesResource.ts
- Added the
autodefended: boolean;
property to theDefense
interface. - Made the
reason
property in theDefense
interface optional (string?
).
- Added the
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
An alert appears,
Dispute defended, no fears,
Code change brings good news.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request successfully introduces an informational alert for disputes that are automatically defended. The changes are well-targeted, modifying mock data, component logic, type definitions, and translation files to support this new feature.
I've identified a few areas for discussion and potential improvement, primarily concerning a change to an existing alert type, a modification to an API type definition, and the addition of tests for the new functionality. Addressing these points will help ensure the robustness and clarity of the changes.
Summary of Findings
- Alert Type Change for 'notDefended' Case: The alert type for 'notDefended' disputes was changed from
SUCCESS
toHIGHLIGHT
inDisputeData.tsx
. Clarification is requested on whether this was an intentional part of the PR's scope. - Optional Defense Reason: The
reason
field in theDefense
type definition (DisputesResource.ts
) was made optional. Further context on this change is needed to understand its full implications, especially if it relates to auto-defended disputes or other scenarios. - Testing for New Functionality: The new 'autoDefended' alert functionality in
DisputeData.tsx
would benefit from dedicated unit tests to ensure its correctness and prevent regressions.
Merge Readiness
The pull request is a good step towards displaying information for auto-defended disputes. However, before merging, I recommend addressing the points raised in the review comments, particularly clarifying the intentionality of the notDefended
alert change, the reasoning behind making the defense reason
optional, and considering the addition of tests for the new alert logic. Once these medium-severity items are addressed, the PR should be in a better state for merging. As I am an AI assistant, I am not authorized to approve pull requests; please ensure further review and approval from team members.
src/components/external/DisputeManagement/components/DisputesData/DisputeData.tsx
Outdated
Show resolved
Hide resolved
src/components/external/DisputeManagement/components/DisputesData/DisputeData.tsx
Outdated
Show resolved
Hide resolved
fce201e
to
4edf4f2
Compare
# Conflicts: # src/components/external/DisputeManagement/components/DisputesData/DisputeData.tsx # src/translations/en-US.instructions.json # src/translations/en-US.json
4edf4f2
to
00c97cd
Compare
c0bb369
to
7073142
Compare
# Conflicts: # mocks/mock-server/disputes.ts # src/components/external/DisputeManagement/components/DisputesData/DisputeData.tsx # stories/mocked/disputeManagement.stories.tsx
2f5587a
to
dc07101
Compare
Summary
This PR adds info alert for disputes that are automatically defended.
In addition, it also introduces the following changes:
SUCCESS
toHIGHLIGHT
.Respond by
detail field for undefended chargebacks that cannot be defended.Expired on
detail field for chargebacks lost without action.Fixed issue: CXP-3693: Add message for Auto defended disputes