Open amnambiar opened 5 months ago
The updates across several files primarily focus on enhancing the payment and registration processes within an application. Changes include the restructuring of data handling in payment details, modifications in registration logic to incorporate fee calculations, and updates to state management in Redux slices. The modifications aim to streamline user interactions and backend processes related to user registration and payment verification.
File Path | Change Summary |
---|---|
README.md |
Updated shields percentage values in the project documentation. |
src/.../PaymentDetailsVerification.tsx |
Modified data object structure in Props and updated display logic for payment details. |
src/.../RegisterSection.tsx src/pages/landing/index.tsx |
Updated registration logic, replaced onSubmit with onClickPay , added new state variables and props related to payment and form submission. |
src/store/slices/auth.slice.ts src/store/slices/profile.slice.ts |
Enhanced profile management by fetching and handling profile balance. |
src/store/slices/register.slice.ts |
Revised fee calculation logic, removed redundant functions, and adjusted registration payment handling. |
src/store/slices/tiers.slice.ts |
Extended the Tier interface with new properties for better tier management. |
src/store/slices/tiers.slice.ts (1)
`15-17`: Added properties `type`, `duration`, and `description` to the `Tier` interface enhance the data structure and provide more detailed information about each tier. Ensure that these new fields are properly utilized wherever the `Tier` type is used throughout the application.README.md (1)
`5-5`: Updated coverage percentages in the testing tool section. Ensure these values are accurate and reflect the current state of the codebase's test coverage.src/store/slices/auth.slice.ts (2)
`4-4`: Imported `fetchProfileBalance` from `profile.slice.ts`. Verify that this function is used appropriately within this slice and that there are no unresolved dependencies. --- `22-22`: Dispatched `fetchProfileBalance({})` after fetching active subscriptions. This ensures that the profile balance is updated immediately after checking for active subscriptions, which is crucial for maintaining accurate state information.src/components/PaymentConfirmation/PaymentDetailsVerification.tsx (2)
`14-15`: Modified the `data` object in the `Props` interface to include `balance: number` instead of `fee: BigNum`. This change aligns with the new requirements to handle user balances directly in the payment details verification. --- `49-50`: Updated display logic for payment details to show amounts in USD and ADA differently based on the new structure of the `data` object. This enhancement improves the clarity of payment information presented to the user.src/pages/landing/index.tsx (5)
`12-12`: Imported `calculateFee` from `store/slices/register.slice` along with other functions. Ensure that `calculateFee` is used appropriately within this component to handle fee calculations accurately. --- `38-47`: Added new state variables `price`, `profileBalance`, `detailsToBeVerified`, `submitForm`, and `form`. These variables are essential for managing the state related to user registration and payment processes. Verify that they are used consistently and correctly throughout the component. --- `61-76`: Updated `handleRegistration` function to include logic for calculating fees and setting verification details based on the selected tier and user input. This update is crucial for handling the registration process accurately and efficiently. --- `82-89`: Updated `onPaymentDetailsVerified` function to handle payment registration and form submission. This function now correctly handles the workflow of verifying payment details and proceeding with user registration. --- `103-103`: Included a new prop `onClickPay` in the `RegisterSection` component call. This change ensures that the custom payment handling function is used, which is important for integrating the new payment logic.src/pages/landing/components/RegisterSection.tsx (2)
`19-20`: Replaced the `onSubmit` function with `onClickPay` in the `Props` interface and added a new boolean property `submitForm`. These changes are crucial for integrating the new payment handling logic into the registration process. --- `69-69`: Updated the `onSubmit` function within the `RegisterSection` component to call `onClickPay` instead of `onSubmit`. This update ensures that the custom payment handling function is used, which is important for the new payment logic.src/store/slices/register.slice.ts (3)
`67-70`: Modified the `calculateFee` function to accept two `number` parameters instead of `BigNum`. This change simplifies the function's interface and aligns with the new requirements for handling fees based on numerical values directly. --- `129-136`: Updated the `register` function to use `profileBalance` directly and pass it along with `subscription.price` to `calculateFee`. This update is crucial for integrating the new payment logic into the registration process. --- `151-159`: Updated the `payForRegister` function to include a `balance` parameter and handle payment based on the balance status. This function now correctly handles the workflow of making payments based on the user's balance, which is important for the new payment logic.src/store/slices/profile.slice.ts (2)
`87-87`: Added a `profileBalance` field to the `ProfileState` interface. This field is essential for keeping track of the user's profile balance, which is crucial for the new payment handling logic. --- `240-248`: Introduced the `fetchProfileBalance` async thunk to fetch profile balance data. This function is crucial for updating the user's profile balance in the state, which is important for the new payment logic.
Lines | Statements | Branches | Functions |
---|---|---|---|
6.34% (149/2350) | 1.39% (19/1361) | 4.43% (22/496) |
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
6 | 0 :zzz: | 0 :x: | 0 :fire: | 18.408s :stopwatch: |
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---|---|---|---|---|---|
All files | 6.34 | 1.39 | 4.43 | 6.03 | |
src | 0 | 100 | 0 | 0 | |
index.tsx | 0 | 100 | 0 | 0 | 2–78 |
src/app | 0 | 0 | 0 | 0 | |
App.tsx | 0 | 0 | 0 | 0 | 1–136 |
src/components/Avatar | 90.9 | 40 | 100 | 100 | |
index.tsx | 90.9 | 40 | 100 | 100 | 14–24 |
src/components/CertificationMetadataForm | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–177 |
src/components/CertificationMetadataForm/components | 0 | 0 | 0 | 0 | |
AuditReportForm.tsx | 0 | 100 | 0 | 0 | 3–66 |
FeedbackModal.tsx | 0 | 0 | 0 | 0 | 3–44 |
ReportScriptForm.tsx | 0 | 0 | 0 | 0 | 1–158 |
ReportScriptFormConfirmModal.tsx | 0 | 100 | 0 | 0 | 3–31 |
src/components/CreateCertificate | 0 | 0 | 0 | 0 | |
CreateCertificate.tsx | 0 | 0 | 0 | 0 | 1–196 |
src/components/CustomSwitch | 0 | 0 | 0 | 0 | |
CustomSwitch.tsx | 0 | 0 | 0 | 0 | 1–53 |
src/components/LogsView | 0 | 0 | 0 | 0 | |
LogsView.tsx | 0 | 0 | 0 | 0 | 1–107 |
LogsViewEntry.tsx | 0 | 100 | 0 | 0 | 1–15 |
src/components/PaymentConfirmation | 0 | 0 | 0 | 0 | |
PaymentDetailsVerification.tsx | 0 | 0 | 0 | 0 | 2–71 |
src/components/ProgressCard | 0 | 0 | 0 | 0 | |
CircularProgressBar.tsx | 0 | 0 | 0 | 0 | 1–40 |
ProgressCard.tsx | 0 | 0 | 0 | 0 | 1–44 |
src/components/ReconnectWallet | 0 | 100 | 0 | 0 | |
ReconnectWallet.tsx | 0 | 100 | 0 | 0 | 1–31 |
src/components/RepoAccessStatus | 0 | 0 | 0 | 0 | |
RepoAccessStatus.tsx | 0 | 0 | 0 | 0 | 2–28 |
src/components/Snackbar | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–56 |
src/components/StatusIcon | 0 | 0 | 0 | 0 | |
StatusIcon.tsx | 0 | 0 | 0 | 0 | 4–18 |
src/components/Table | 0 | 0 | 0 | 0 | |
Table.tsx | 0 | 0 | 0 | 0 | 1–216 |
src/components/Table/components/ColViz | 0 | 0 | 0 | 0 | |
ColViz.tsx | 0 | 0 | 0 | 0 | 1–112 |
src/components/charts/PieChart | 0 | 0 | 0 | 0 | |
PieChart.tsx | 0 | 0 | 0 | 0 | 2–32 |
src/compositions/InputGroup | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 3–35 |
src/compositions/InputGroup/components | 0 | 0 | 0 | 0 | |
Container.tsx | 0 | 0 | 0 | 0 | 3–19 |
Input.tsx | 0 | 0 | 0 | 0 | 3–59 |
src/compositions/Timeline | 0 | 100 | 0 | 0 | |
Timeline.tsx | 0 | 100 | 0 | 0 | 3–23 |
src/compositions/Timeline/components/TimelineItem | 12.38 | 0 | 0 | 9.41 | |
TimelineItem.tsx | 0 | 0 | 0 | 0 | 3–70 |
timeline.helper.tsx | 16.04 | 0 | 0 | 11.76 | 20, 32, 36–57, 64–74, 79–142 |
src/pages/certification | 21.95 | 0 | 0 | 16.16 | |
Certification.helper.tsx | 27.83 | 0 | 0 | 20.51 | 95–100, 104–112, 116–128, 135, 145, 149–150, 154, 158–162, 167–168, 173–174, 183–227 |
Certification.tsx | 0 | 0 | 0 | 0 | 2–81 |
src/pages/certification/certification-result | 0 | 0 | 0 | 0 | |
CertificationResult.tsx | 0 | 0 | 0 | 0 | 1–153 |
FullReportTable.tsx | 0 | 0 | 0 | 0 | 1–61 |
fullReportTable.helper.tsx | 0 | 0 | 0 | 0 | 1–126 |
src/pages/certification/components | 0 | 0 | 0 | 0 | |
FailedStatus.tsx | 0 | 0 | 0 | 0 | 1–41 |
FileCoverageContainer.tsx | 0 | 0 | 0 | 0 | 2–96 |
ResultContainer.tsx | 0 | 0 | 0 | 0 | 2–114 |
SuccessCard.tsx | 0 | 0 | 0 | 0 | 1–89 |
UnitTestFailureCard.tsx | 0 | 0 | 0 | 0 | 1–35 |
src/pages/certification/components/AuditorRunTestForm | 0 | 0 | 0 | 0 | |
AuditorRunTestForm.tsx | 0 | 0 | 0 | 0 | 1–312 |
src/pages/certification/components/DownloadResult | 0 | 100 | 0 | 0 | |
DownloadResult.tsx | 0 | 100 | 0 | 0 | 1–20 |
src/pages/certification/components/TimelineView | 0 | 0 | 0 | 0 | |
TimelineView.tsx | 0 | 0 | 0 | 0 | 1–235 |
src/pages/home | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–195 |
src/pages/landing | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–99 |
src/pages/landing/components | 48.38 | 19.35 | 46.42 | 47.95 | |
ConnectSection.tsx | 76 | 50 | 50 | 73.68 | 46, 70–71, 75–76, 80, 85–94, 125–129 |
RegisterModal.tsx | 0 | 0 | 0 | 0 | 3–43 |
RegisterSection.tsx | 0 | 0 | 0 | 0 | 1–161 |
SubscriptionSection.tsx | 100 | 100 | 100 | 100 | |
src/pages/metrics | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–112 |
src/pages/metrics/components | 0 | 0 | 0 | 0 | |
AuditorReportsChart.tsx | 0 | 0 | 0 | 0 | 2–73 |
MetricWidget.tsx | 0 | 100 | 0 | 0 | 3–37 |
RunTimesChart.tsx | 0 | 0 | 0 | 0 | 2–78 |
SubscriptionsChart.tsx | 0 | 100 | 0 | 0 | 2–59 |
src/pages/profile | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–103 |
src/pages/reportUpload | 0 | 100 | 0 | 0 | |
index.tsx | 0 | 100 | 0 | 0 | 3–19 |
src/pages/session | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–54 |
src/pages/session/components | 29.26 | 2.7 | 15.38 | 29.41 | |
AppBar.tsx | 88.88 | 50 | 57.14 | 86.95 | 25, 29, 33 |
AppLayout.tsx | 0 | 0 | 0 | 0 | 2–44 |
NavBar.tsx | 0 | 0 | 0 | 0 | 2–115 |
src/pages/support-commands | 0 | 0 | 0 | 0 | |
config.tsx | 0 | 100 | 100 | 0 | 1–72 |
index.tsx | 0 | 0 | 0 | 0 | 1–177 |
src/pages/support-commands/components | 0 | 0 | 0 | 0 | |
Card.tsx | 0 | 0 | 0 | 0 | 1–32 |
DeleteUserModal.tsx | 0 | 100 | 0 | 0 | 3–60 |
UserDetailsModal.tsx | 0 | 0 | 0 | 0 | 1–112 |
src/pages/support-commands/details | 0 | 0 | 0 | 0 | |
index.tsx | 0 | 0 | 0 | 0 | 1–200 |
src/pages/testingHistory | 0 | 100 | 0 | 0 | |
index.tsx | 0 | 100 | 0 | 0 | 1–37 |
src/pages/testingHistory/components | 0 | 0 | 0 | 0 | |
AppTable.tsx | 0 | 0 | 0 | 0 | 1–269 |
HistoryContainer.tsx | 0 | 0 | 0 | 0 | 1–64 |
src/utils | 100 | 80 | 100 | 100 | |
test-utils.tsx | 100 | 80 | 100 | 100 | 22 |
Pull request template
Description
https://input-output.atlassian.net/browse/PLT-9671
Checklist
Summary by CodeRabbit
New Features
onClickPay
functionality in the registration process for enhanced user interaction.Bug Fixes
Documentation
Refactor
onSubmit
withonClickPay
in registration component for clarity.getUserBalance
function, optimizing balance handling.Chores