Skip to content

Commit

Permalink
Merge branch 'main' into update-ui-connector-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 authored Oct 8, 2024
2 parents 2db9137 + 0cda40b commit b2d0d0e
Show file tree
Hide file tree
Showing 65 changed files with 1,048 additions and 211 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,55 @@ All notable changes to this project will be documented in this file. See [conven

- - -

## 2024.10.08.0

### Features

- Add auto retries in payment settings ([#1551](https://github.com/juspay/hyperswitch-control-center/pull/1551)) ([`78479fa`](https://github.com/juspay/hyperswitch-control-center/commit/78479fade99cc04b115a8c40924ade9c9ae38606))

### Miscellaneous Tasks

- Ran prettier command to format unformatted file ([#1566](https://github.com/juspay/hyperswitch-control-center/pull/1566)) ([`66e2063`](https://github.com/juspay/hyperswitch-control-center/commit/66e206350e60989068206c29ffd63d30fad7f094))

**Full Changelog:** [`2024.10.07.1...2024.10.08.0`](https://github.com/juspay/hyperswitch-control-center/compare/2024.10.07.1...2024.10.08.0)

- - -

## 2024.10.07.1

### Features

- Payments overview section ([#1552](https://github.com/juspay/hyperswitch-control-center/pull/1552)) ([`06dae63`](https://github.com/juspay/hyperswitch-control-center/commit/06dae6364e3cb481a1321bb302f29f4052b8c338))

### Bug Fixes

- Prod x feature deployment ([#127](https://github.com/juspay/hyperswitch-control-center/pull/127)) ([`6a9e9ab`](https://github.com/juspay/hyperswitch-control-center/commit/6a9e9abd0c492e59eebe5c4ad4c0b1e47a736513))
- Api not getting called due to user permission data not updated ([#1565](https://github.com/juspay/hyperswitch-control-center/pull/1565)) ([`ad7d230`](https://github.com/juspay/hyperswitch-control-center/commit/ad7d23080039e77758fd52330bad664590d6d4f3))

### Refactors

- Code changes ([#1550](https://github.com/juspay/hyperswitch-control-center/pull/1550)) ([`ba9ead3`](https://github.com/juspay/hyperswitch-control-center/commit/ba9ead301fc0d2d2a01c2e2410fb8dd88a4e3551))

**Full Changelog:** [`2024.10.07.0...2024.10.07.1`](https://github.com/juspay/hyperswitch-control-center/compare/2024.10.07.0...2024.10.07.1)

- - -

## 2024.10.07.0

### Features

- Compare function ([#1542](https://github.com/juspay/hyperswitch-control-center/pull/1542)) ([`938ccc7`](https://github.com/juspay/hyperswitch-control-center/commit/938ccc7bc2e83cf149b6c9660d28dd3275b6a128))
- Added graphs header ([#1539](https://github.com/juspay/hyperswitch-control-center/pull/1539)) ([`583ddf2`](https://github.com/juspay/hyperswitch-control-center/commit/583ddf2f3672d2bc04cabd9e6b6eb848e1e5dfca))
- Add scroll for merchant, org, and profile dropdowns ([#1537](https://github.com/juspay/hyperswitch-control-center/pull/1537)) ([`3bee31c`](https://github.com/juspay/hyperswitch-control-center/commit/3bee31cbb86952b4ece81902f7f9ff0d6cd6670c))

### Testing

- Creation of dummy connector using cypress ([#1497](https://github.com/juspay/hyperswitch-control-center/pull/1497)) ([`f040964`](https://github.com/juspay/hyperswitch-control-center/commit/f040964457cdd557bf5c8a414d72ce265a51e741))

**Full Changelog:** [`2024.10.04.0...2024.10.07.0`](https://github.com/juspay/hyperswitch-control-center/compare/2024.10.04.0...2024.10.07.0)

- - -

## 2024.10.04.0

### Miscellaneous Tasks
Expand Down
1 change: 1 addition & 0 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ new_analytics=false
down_time=false
tax_processor=true
transaction_view=false
x_feature_route=false
72 changes: 72 additions & 0 deletions cypress/e2e/connector/connector.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
describe("connector", () => {
const username = `cypress${Math.round(+new Date() / 1000)}@gmail.com`;
const password = "Cypress98#";

// Login before each testcase
beforeEach(() => {
cy.visit("http://localhost:9000/dashboard/login");
cy.url().should("include", "/login");
cy.get("[data-testid=card-header]").should(
"contain",
"Hey there, Welcome back!",
);
cy.get("[data-testid=card-subtitle]")
.should("contain", "Sign up")
.click({ force: true });
cy.url().should("include", "/register");
cy.get("[data-testid=auth-submit-btn]").should("exist");
cy.get("[data-testid=tc-text]").should("exist");
cy.get("[data-testid=footer]").should("exist");

cy.get("[data-testid=email]").type(username);
cy.get("[data-testid=password]").type(password);
cy.get('button[type="submit"]').click({ force: true });
cy.get("[data-testid=skip-now]").click({ force: true });

cy.url().should("include", "/dashboard/home");
});

it("Create a dummy connector", () => {
cy.url().should("include", "/dashboard/home");

cy.get('[data-form-label="Business name"]').should("exist");
cy.get("[data-testid=merchant_name]").type("test_business");
cy.get("[data-button-for=startExploring]").click();
cy.reload(true);
cy.get("[data-testid=connectors]").click();
cy.get("[data-testid=paymentprocessors]").click();
cy.contains("Payment Processors").should("be.visible");
cy.contains("Connect a Dummy Processor").should("be.visible");
cy.get("[data-button-for=connectNow]").click({
force: true,
});
cy.get('[data-component="modal:Connect a Dummy Processor"]', {
timeout: 10000,
})
.find("button")
.should("have.length", 4);
cy.contains("Stripe Dummy").should("be.visible");
cy.get('[data-testid="stripe_test"]').find("button").click({ force: true });
cy.url().should("include", "/dashboard/connectors");
cy.contains("Credentials").should("be.visible");
cy.get("[name=connector_account_details\\.api_key]")
.clear()
.type("dummy_api_key");
cy.get("[name=connector_label]").clear().type("stripe_test_default_label");
cy.get("[data-button-for=connectAndProceed]").click();
cy.get("[data-testid=credit_select_all]").click();
cy.get("[data-testid=credit_mastercard]").click();
cy.get("[data-testid=debit_cartesbancaires]").click();
cy.get("[data-testid=pay_later_klarna]").click();
cy.get("[data-testid=wallet_we_chat_pay]").click();
cy.get("[data-button-for=proceed]").click();
cy.get('[data-toast="Connector Created Successfully!"]', {
timeout: 10000,
}).click();
cy.get("[data-button-for=done]").click();
cy.url().should("include", "/dashboard/connectors");
cy.contains("stripe_test_default_label")
.scrollIntoView()
.should("be.visible");
});
});
45 changes: 45 additions & 0 deletions public/hyperswitch/assets/smart-retry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/AdvancedSearchComponent.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ let make = (~children, ~setData=?, ~entity: EntityType.entityType<'colType, 't>,
let initialValueJson = JSON.Encode.object(Dict.make())
let showToast = ToastState.useShowToast()
let (showModal, setShowModal) = React.useState(_ => false)
let {xFeatureRoute} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

let onSubmit = (values, form: ReactFinalForm.formApi) => {
open Promise

fetchApi(url, ~bodyStr=JSON.stringify(values), ~method_=Post)
fetchApi(url, ~bodyStr=JSON.stringify(values), ~method_=Post, ~xFeatureRoute)
->then(res => res->Fetch.Response.json)
->then(json => {
let jsonData = json->JSON.Decode.object->Option.flatMap(dict => dict->Dict.get("rows"))
Expand Down
3 changes: 2 additions & 1 deletion src/components/AdvancedSearchModal.res
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module AdvanceSearch = {
let fetchApi = AuthHooks.useApiFetcher()
let initialValueJson = JSON.Encode.object(Dict.make())
let showToast = ToastState.useShowToast()
let {xFeatureRoute} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

let onSubmit = (values, _) => {
let otherQueries = switch values->JSON.Decode.object {
Expand All @@ -41,7 +42,7 @@ module AdvanceSearch = {
let finalUrl = otherQueries->isNonEmptyString ? `${url}?${otherQueries}` : url

open Promise
fetchApi(finalUrl, ~bodyStr=JSON.stringify(initialValueJson), ~method_=Get)
fetchApi(finalUrl, ~bodyStr=JSON.stringify(initialValueJson), ~method_=Get, ~xFeatureRoute)
->then(res => res->Fetch.Response.json)
->then(json => {
switch JSON.Classify.classify(json) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomizeNotificationsModal.res
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let make = (
~headerAlignmentClass="flex-row",
~customIcon=None,
) => {
let customHeight = btnRequired === false ? `h-full` : `h-screen`
let customHeight = btnRequired ? `h-screen` : `h-full`
let customButton =
<Button
text=submitButtonText
Expand Down
4 changes: 4 additions & 0 deletions src/components/DynamicChart.res
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ let makeEntity = (
let useChartFetch = (~setStatusDict) => {
let fetchApi = AuthHooks.useApiFetcher()
let addLogsAroundFetch = AnalyticsLogUtilsHook.useAddLogsAroundFetch()
let {xFeatureRoute} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

let fetchChartData = (updatedChartBody: array<fetchDataConfig>, setState) => {
open Promise

Expand All @@ -244,6 +246,7 @@ let useChartFetch = (~setStatusDict) => {
~method_=Post,
~bodyStr=item.body,
~headers=[("QueryType", "Chart")]->Dict.fromArray,
~xFeatureRoute,
)
->addLogsAroundFetch(~logTitle="Chart Data Api", ~setStatusDict)
->then(json => {
Expand All @@ -258,6 +261,7 @@ let useChartFetch = (~setStatusDict) => {
~method_=Post,
~bodyStr=legendBody,
~headers=[("QueryType", "Chart")]->Dict.fromArray,
~xFeatureRoute,
)
->addLogsAroundFetch(~logTitle="Chart Data Api", ~setStatusDict)
->then(
Expand Down
4 changes: 4 additions & 0 deletions src/components/DynamicSingleStat.res
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ let make = (
~formaPayload: option<singleStatBodyEntity => string>=?,
) => {
open LogicUtils
let {xFeatureRoute} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

let {filterValueJson} = React.useContext(FilterContext.filterContext)
let fetchApi = AuthHooks.useApiFetcher()
let getAllFilter = filterValueJson
Expand Down Expand Up @@ -304,6 +306,7 @@ let make = (
~method_=Post,
~bodyStr=singleStatBody,
~headers=[("QueryType", "SingleStat")]->Dict.fromArray,
~xFeatureRoute,
)
->addLogsAroundFetch(~logTitle="SingleStat Data Api")
->then(json => resolve((`${urlConfig.prefix->Option.getOr("")}${uri}`, json)))
Expand Down Expand Up @@ -377,6 +380,7 @@ let make = (
~method_=Post,
~bodyStr=singleStatBodyMakerFn(singleStatBodyEntity),
~headers=[("QueryType", "SingleStatTimeseries")]->Dict.fromArray,
~xFeatureRoute,
)
->addLogsAroundFetch(~logTitle="SingleStatTimeseries Data Api")
->then(
Expand Down
3 changes: 2 additions & 1 deletion src/components/DynamicTable.res
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ let make = (
filterCheck,
filterForRow,
} = entity
let {xFeatureRoute} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let tableName =
prefixAddition->Option.getOr(false)
? title->(String.replaceRegExp(_, %re("/ /g"), "-"))->String.toLowerCase->Some
Expand Down Expand Up @@ -236,7 +237,7 @@ let make = (
}
let uri = uri ++ getNewUrl(defaultFilters)
setTableDataLoading(_ => true)
fetchApi(uri, ~bodyStr=JSON.stringify(finalJson), ~headers, ~method_=method)
fetchApi(uri, ~bodyStr=JSON.stringify(finalJson), ~headers, ~method_=method, ~xFeatureRoute)
->then(resp => {
let status = resp->Fetch.Response.status
if status >= 300 {
Expand Down
Loading

0 comments on commit b2d0d0e

Please sign in to comment.