-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: Recon screens #2052
Open
susrithasabbini
wants to merge
73
commits into
main
Choose a base branch
from
recon-order-data-screen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Recon screens #2052
Changes from 42 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
ecd12d0
feat: Recon Configuration Setup
susrithasabbini eefe204
feat: Recon Configuration Setup
susrithasabbini 595400d
chore: Removed comments
susrithasabbini 31ae6e3
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini eeffc48
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 6123760
feat: Recon Configuration Setup
susrithasabbini 3e6bb94
feat: Recon Configuration Setup
susrithasabbini d512811
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini f2fc35a
Merge branch 'recon-order-data-screen' of github.com:juspay/hyperswit…
JeevaRamu0104 2852648
chore: Reconciliation Configurations
susrithasabbini 2a7be42
chore: Changed Dimensions according to figma
susrithasabbini 8609cf1
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 51ec61e
chore: Overflow of footer modified
susrithasabbini 763ee06
chore: Configurations and APIs
susrithasabbini 0d80191
Merge branch 'recon-order-data-screen' of github.com:juspay/hyperswit…
JeevaRamu0104 070b5af
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini e61e0a6
chore: update build script
JeevaRamu0104 8565587
chore: update build script
JeevaRamu0104 d577570
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini ebdceee
chore: Added file input to the order data api connection
susrithasabbini 112dba1
chore: Removed duplicate recon v2 product feature
susrithasabbini f2ce181
chore: Added APIs for BASE and PSP files
susrithasabbini 273940f
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini bf55b34
Merge branch 'recon-order-data-screen' of github.com:juspay/hyperswit…
JeevaRamu0104 03d7411
chore: update recon
JeevaRamu0104 fdc36a8
Merge branch 'recon-order-data-screen' of github.com:juspay/hyperswit…
JeevaRamu0104 efef2e5
chore: Added Approve Base and PSP config APIs
susrithasabbini a34ab7b
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 8231233
chore: Changed date in request
susrithasabbini 414b283
feat: Added Reports Page
susrithasabbini 1913354
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 069dd23
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 4f9e974
chore: UI enhancements
susrithasabbini 236dc1a
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini f9883b5
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 2c9762b
chore: Onboarding page changes according to figma
susrithasabbini 3a30f00
Merge branch 'recon-order-data-screen' of github.com:juspay/hyperswit…
JeevaRamu0104 880ab6c
chore: update recon
JeevaRamu0104 dcb0de3
Merge branch 'main' into recon-order-data-screen
susrithasabbini a11cd45
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini b192e60
chore: Formatted
susrithasabbini 9d07204
Merge branch 'recon-order-data-screen' of https://github.com/juspay/h…
susrithasabbini cf5e7cd
chore: Analyltics for PAYU
susrithasabbini d18eb14
chore: Analyltics for PAYU
susrithasabbini d778021
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 3d0da7e
chore: Added formatters for the analytics cards
susrithasabbini a795132
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini c292ba9
Merge branch 'main' into recon-order-data-screen
susrithasabbini ff6c032
feat: Added BarGraph for Recon Success Rate
susrithasabbini 2f1eaf5
fix: Added transformation before uploading the data files
susrithasabbini 2d18109
Merge branch 'main' into recon-order-data-screen
susrithasabbini 118f692
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini eac3b25
Merge branch 'recon-order-data-screen' of https://github.com/juspay/h…
susrithasabbini 3efb26e
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini ab89f48
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 57d5533
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini dd396fe
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini ac6ed5d
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini ac23e51
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 4f078e8
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 4b4c0d1
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 6785500
feat: New Recon design
susrithasabbini 02efe48
feat: New Recon design
susrithasabbini 5890231
fix: Solid icons for recon
susrithasabbini 713d176
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 40f9b02
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini e708466
feat: Added date range selection for recon reports and analytics
susrithasabbini 9003939
feat: Added Recon History Page and OMS
susrithasabbini a405147
chore: Changed the side bar naming
susrithasabbini 4a50e8d
chore: Handled error cases
susrithasabbini 9811fb4
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini c06696a
Merge branch 'main' of https://github.com/juspay/hyperswitch-control-…
susrithasabbini 917cb9f
refactor: Used Vertical Step Indicator from fragments
susrithasabbini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ primary_color="#006DF9" | |
primary_hover_color="#005ED6" | ||
sidebar_color="#242F48" | ||
[default.endpoints] | ||
api_url="http://localhost:9000/api" | ||
api_url="http://localhost:8000/api" | ||
sdk_url="http://localhost:9050/HyperLoader.js" | ||
logo_url="" | ||
favicon_url="" | ||
|
@@ -16,14 +16,14 @@ dss_certificate_url="" | |
[default.features] | ||
test_live_toggle=false | ||
is_live_mode=false | ||
email=false | ||
email=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't it be false by default |
||
quick_start=false | ||
audit_trail=false | ||
system_metrics=false | ||
sample_data=false | ||
frm=false | ||
payout=true | ||
recon=false | ||
recon=true | ||
test_processors=true | ||
feedback=false | ||
mixpanel=false | ||
|
@@ -55,7 +55,7 @@ force_cookies=false | |
x_feature_route=false | ||
tenant_user=false | ||
dev_click_to_pay=false | ||
dev_recon_v2_product=false | ||
dev_recon_v2_product=true | ||
maintainence_alert="" | ||
[default.merchant_config] | ||
[default.merchant_config.new_analytics] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@react.component | ||
let make = () => { | ||
<ReconReports /> | ||
} |
228 changes: 168 additions & 60 deletions
228
src/reconScreens/ReconConfiguration/ConnectOrderData/ConnectOrderDataHelper.res
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,187 @@ | ||
open HSwitchUtils | ||
let p1RegularText = getTextClass((P1, Regular)) | ||
|
||
module SelectSource = { | ||
@react.component | ||
let make = (~currentStep, ~setCurrentStep) => { | ||
open ConnectOrderDataUtils | ||
open ConnectOrderDataTypes | ||
|
||
open ReconConfigurationUtils | ||
open TempAPIUtils | ||
let stepConfig = useStepConfig(~step=currentStep->getSubsectionFromStep) | ||
let (selectedStep, setSelectedStep) = React.useState(_ => Hyperswitch) | ||
<div className="flex flex-col h-full"> | ||
<div className="flex flex-col gap-3 flex-grow p-2 md:p-7"> | ||
<p className="text-medium text-grey-800 font-semibold mb-5"> | ||
{"Select your order data source"->React.string} | ||
</p> | ||
<div className="flex flex-col gap-4"> | ||
{orderDataStepsArr | ||
->Array.map(step => { | ||
let stepName = step->getSelectedStepName | ||
let description = step->getSelectedStepDescription | ||
let isSelected = selectedStep === step | ||
<ReconConfigurationHelper.StepCard | ||
key={stepName} | ||
stepName={stepName} | ||
description={description} | ||
isSelected={isSelected} | ||
iconName={step->getIconName} | ||
onClick={_ => setSelectedStep(_ => step)} | ||
/> | ||
}) | ||
->React.array} | ||
let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Success) | ||
|
||
let onSubmit = async () => { | ||
try { | ||
setScreenState(_ => PageLoaderWrapper.Loading) | ||
let _ = await stepConfig() | ||
setCurrentStep(prev => getNextStep(prev)) | ||
} catch { | ||
| Exn.Error(e) => | ||
let err = Exn.message(e)->Option.getOr("Failed to Fetch!") | ||
setScreenState(_ => PageLoaderWrapper.Error(err)) | ||
} | ||
} | ||
|
||
<PageLoaderWrapper screenState={screenState}> | ||
<div className="flex flex-col h-full"> | ||
<div className="flex flex-col gap-3 flex-grow p-2 md:p-7"> | ||
<p className="text-medium text-grey-800 font-semibold mb-5"> | ||
{"Select your order data source"->React.string} | ||
</p> | ||
<div className="flex flex-col gap-4"> | ||
{orderDataStepsArr | ||
->Array.map(step => { | ||
let stepName = step->getSelectedStepName | ||
let description = step->getSelectedStepDescription | ||
let isSelected = selectedStep === step | ||
<ReconConfigurationHelper.StepCard | ||
key={stepName} | ||
stepName={stepName} | ||
description={description} | ||
isSelected={isSelected} | ||
iconName={step->getIconName} | ||
onClick={_ => setSelectedStep(_ => step)} | ||
/> | ||
}) | ||
->React.array} | ||
</div> | ||
</div> | ||
<div className="flex justify-end items-center border-t"> | ||
<ReconConfigurationHelper.Footer | ||
currentStep={currentStep} buttonName="Continue" onSubmit={_ => onSubmit()->ignore} | ||
/> | ||
</div> | ||
</div> | ||
<div className="flex justify-end items-center border-t"> | ||
<ReconConfigurationHelper.Footer | ||
currentStep={currentStep} setCurrentStep={setCurrentStep} buttonName="Continue" | ||
/> | ||
</div> | ||
</div> | ||
</PageLoaderWrapper> | ||
} | ||
} | ||
|
||
module SetupAPIConnection = { | ||
@react.component | ||
let make = (~currentStep, ~setCurrentStep) => { | ||
<div className="flex flex-col h-full"> | ||
<div className="flex flex-col gap-4 flex-grow p-2 md:p-7"> | ||
<p className="text-medium text-grey-800 font-semibold mb-5"> | ||
{"Setup Your API Connection"->React.string} | ||
</p> | ||
<div className="flex gap-6"> | ||
<FormRenderer.FieldRenderer | ||
field={FormRenderer.makeFieldInfo( | ||
~label="Endpoint URL", | ||
~name="endPointURL", | ||
~placeholder="https://", | ||
~isRequired=true, | ||
~customInput=InputFields.textInput(~customWidth="w-18-rem"), | ||
)} | ||
/> | ||
<FormRenderer.FieldRenderer | ||
field={FormRenderer.makeFieldInfo( | ||
~label="Auth Key", | ||
~name="authKey", | ||
~placeholder="***********", | ||
~isRequired=true, | ||
~customInput=InputFields.textInput(~customWidth="w-18-rem"), | ||
)} | ||
open ReconConfigurationUtils | ||
open LogicUtils | ||
open TempAPIUtils | ||
|
||
let (fileUploadedDict, setFileUploadedDict) = React.useState(_ => Dict.make()) | ||
let uploadEvidenceType = "Basefile"->String.toLowerCase->titleToSnake | ||
let showToast = ToastState.useShowToast() | ||
let stepConfig = useStepConfig(~step=currentStep->getSubsectionFromStep, ~fileUploadedDict) | ||
let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Success) | ||
|
||
let toast = (message, toastType) => { | ||
showToast(~message, ~toastType) | ||
} | ||
|
||
let onSubmit = async () => { | ||
if fileUploadedDict->Dict.get(uploadEvidenceType)->Option.isNone { | ||
toast("Please upload a file", ToastError) | ||
} else { | ||
try { | ||
setScreenState(_ => PageLoaderWrapper.Loading) | ||
let _ = await stepConfig() | ||
setCurrentStep(prev => getNextStep(prev)) | ||
} catch { | ||
| Exn.Error(e) => | ||
let err = Exn.message(e)->Option.getOr("Failed to Fetch!") | ||
setScreenState(_ => PageLoaderWrapper.Error(err)) | ||
} | ||
} | ||
} | ||
|
||
let handleBrowseChange = (event, uploadEvidenceType) => { | ||
let target = ReactEvent.Form.target(event) | ||
let fileDict = | ||
[ | ||
("uploadedFile", target["files"]["0"]->Identity.genericTypeToJson), | ||
("fileName", target["files"]["0"]["name"]->JSON.Encode.string), | ||
]->getJsonFromArrayOfJson | ||
|
||
setFileUploadedDict(prev => { | ||
let arr = prev->Dict.toArray | ||
let newDict = [(uploadEvidenceType, fileDict)]->Array.concat(arr)->Dict.fromArray | ||
newDict | ||
}) | ||
} | ||
<PageLoaderWrapper screenState={screenState}> | ||
<div className="flex flex-col h-full"> | ||
<div className="flex flex-col gap-4 flex-grow p-2 md:p-7"> | ||
<p className="text-medium text-grey-800 font-semibold mb-5"> | ||
{"Setup Your API Connection"->React.string} | ||
</p> | ||
<div className="flex items-center"> | ||
{if fileUploadedDict->Dict.get(uploadEvidenceType)->Option.isNone { | ||
<label> | ||
<p className="cursor-pointer text-gray-500"> | ||
<div className="flex gap-2 border border-gray-500 rounded-lg p-2 items-center"> | ||
<Icon name="plus" size=14 /> | ||
<p> {"Upload base file"->React.string} </p> | ||
</div> | ||
<input | ||
type_="file" | ||
accept=".csv" | ||
onChange={ev => ev->handleBrowseChange(uploadEvidenceType)} | ||
required=true | ||
hidden=true | ||
/> | ||
</p> | ||
</label> | ||
} else { | ||
let fileName = | ||
fileUploadedDict->getDictfromDict(uploadEvidenceType)->getString("fileName", "") | ||
let truncatedFileName = truncateFileNameWithEllipses(~fileName, ~maxTextLength=10) | ||
|
||
<div className="flex gap-4 items-center "> | ||
<p className={`${p1RegularText} text-grey-700`}> | ||
{truncatedFileName->React.string} | ||
</p> | ||
<Icon | ||
name="cross-skeleton" | ||
className="cursor-pointer" | ||
size=12 | ||
onClick={_ => { | ||
setFileUploadedDict(prev => { | ||
let prevCopy = prev->Dict.copy | ||
prevCopy->Dict.delete(uploadEvidenceType) | ||
prevCopy | ||
}) | ||
}} | ||
/> | ||
</div> | ||
}} | ||
</div> | ||
<div className="flex gap-6"> | ||
<FormRenderer.FieldRenderer | ||
field={FormRenderer.makeFieldInfo( | ||
~label="Endpoint URL", | ||
~name="endPointURL", | ||
~placeholder="https://", | ||
~isRequired=true, | ||
~customInput=InputFields.textInput(~customWidth="w-18-rem"), | ||
)} | ||
/> | ||
<FormRenderer.FieldRenderer | ||
field={FormRenderer.makeFieldInfo( | ||
~label="Auth Key", | ||
~name="authKey", | ||
~placeholder="***********", | ||
~isRequired=true, | ||
~customInput=InputFields.textInput(~customWidth="w-18-rem"), | ||
)} | ||
/> | ||
</div> | ||
<h1 className="text-sm font-medium text-blue-500 mt-2 px-1.5"> | ||
{"Learn where to find these values ->"->React.string} | ||
</h1> | ||
</div> | ||
<div className="flex justify-end items-center border-t"> | ||
<ReconConfigurationHelper.Footer | ||
currentStep={currentStep} buttonName="Validate" onSubmit={_ => onSubmit()->ignore} | ||
/> | ||
</div> | ||
<h1 className="text-sm font-medium text-blue-500 mt-2 px-1.5"> | ||
{"Learn where to find these values ->"->React.string} | ||
</h1> | ||
</div> | ||
<div className="flex justify-end items-center border-t"> | ||
<ReconConfigurationHelper.Footer | ||
currentStep={currentStep} setCurrentStep={setCurrentStep} buttonName="Continue" | ||
/> | ||
</div> | ||
</div> | ||
</PageLoaderWrapper> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this
9050
port number also need to point to local host port number right ??