Skip to content

Commit

Permalink
Merge branch 'main' into support-oss-auth-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 authored Dec 6, 2023
2 parents a29ee04 + bf6bde8 commit 8e44839
Show file tree
Hide file tree
Showing 28 changed files with 154 additions and 107 deletions.
3 changes: 3 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ else
echo "~~~~**** Error: Commit Signature Missing. ****~~~~"
echo "Please make sure to sign your commits. You can sign your commit by using the '-S' option with 'git commit'."
echo "Example: git commit -S -m 'Your commit message'"
echo "Signing commits is crucial for verifying contributions. Consult GitHub's documentation on commit signature verification for guidance: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits"
exit 1
fi

# If the commit message matches the convention, the script exits successfully.
echo
echo "*****~~~~~ Commit hook completed ~~~~~~*****"
echo
exit 0
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ Or did you test this change manually (provide relevant screenshots)?
- [ ] I ran `npm run re:build`
- [ ] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ env-config.js
yarn.lock
#package-lock.json
user_data.sh
*.pem
*.pem
.bsb.lock
80 changes: 74 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ The `home_page` feature flag controls whether the dashboard home page is enabled

The `test_live_toggle` feature flag enables users to toggle between test and live modes when signing in. When enabled, users will see an option during sign-in to actively switch between test and live environments.

#### Test Live Mode
#### Is Live Mode

The `test_live_mode` feature flag enables displaying the current mode - test or live - that the user is accessing. When enabled, it will show a visual indicator within the dashboard signaling whether the user is currently in a test environment or live production environment.
The `is_live_mode` feature flag enables the live mode - that the user is accessing. When enabled, it will show a visual indicator within the dashboard signaling whether the user is currently in a test environment or live production environment.

#### Magic Link

Expand All @@ -152,10 +152,6 @@ The `production_access` feature flag enables a flow for users to request live pr

The `quick_start` feature flag enables the simplified onboarding flow for new users, where he connects to processors, configure payment routing and testing a payment, all in one flow.

#### Open SDK

The `open_sdk` feature flag enables access to the Checkout Page web SDK from within the dashboard. When enabled, developers can preview the SDK from within the dashboard and make payments.

---

## Deployment
Expand Down Expand Up @@ -267,10 +263,82 @@ curl https://raw.githubusercontent.com/juspay/hyperswitch-control-center/main/aw

---

## Versioning

For a detailed list of changes made in each version, please refer to the [CHANGELOG](./CHANGELOG.md) file.

---

## Contributing

We welcome contributions from the community! If you would like to contribute to Hyperswitch, please follow our contribution guidelines.

### Commit Conventions

We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for our commit messages. Each commit message should have a structured format:

`<type>(<subject>): <description>`

The commit message should begin with one of the following keywords followed by a colon: 'feat', 'fix', 'chore', 'refactor', 'docs', 'test' or 'style'. For example, it should be formatted like this: `feat: <subject> - <description>`

### Signing Commits

All commits should be signed to verify the authenticity of contributors. Follow the steps below to sign your commits:

1. Generate a GPG key if you haven't already:

```bash
gpg --gen-key
```

2. List your GPG keys and copy the GPG key ID::

```bash
gpg --list-secret-keys --keyid-format LONG
```

#### Identify the GPG key you want to add to your GitHub account.

a. Run the following command to export your GPG public key in ASCII-armored format:

```bash
gpg --armor --export <GPG_KEY_ID>
Replace <GPG_KEY_ID> with the actual key ID.
```

b. Copy the entire output, including the lines that start with "-----BEGIN PGP PUBLIC KEY BLOCK-----" and "-----END PGP PUBLIC KEY BLOCK-----".

c. Go to your GitHub Settings.

d. Click on "SSH and GPG keys" in the left sidebar.

e. Click the "New GPG key" button.

f. Paste your GPG public key into the provided text box.

g. Click the "Add GPG key" button.

h. Now your GPG public key is associated with your GitHub account, and you can sign your commits for added security.

3. Configure Git to use your GPG key:

```bash
git config --global user.signingkey <GPG_KEY_ID>
```

4. Set Git to sign all your commits by default:

```bash
git config --global commit.gpgSign true
```

5. Commit your changes with the -S option to sign the commit:
```bash
git commit -S -m "your commit message"
```

For further assistance, please refer to the [GitHub documentation on signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).

---

## License
Expand Down
3 changes: 1 addition & 2 deletions config/FeatureFlag.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"test_live_toggle": false,
"test_live_mode": false,
"is_live_mode": false,
"magic_link": false,
"production_access": false,
"quick_start": false,
"open_sdk": false,
"switch_merchant": false,
"audit_trail": false,
"system_metrics": false,
Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/hyperswitch/EntryPointUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module ContextWrapper = {
}
}

let renderDashboardApp = (~uiConfig=UIConfig.defaultUIConfig, children) => {
let renderDashboardApp = (~uiConfig, children) => {
switch ReactDOM.querySelector("#app") {
| Some(container) =>
open ReactDOM.Client
Expand Down
6 changes: 2 additions & 4 deletions src/entryPoints/hyperswitch/FeatureFlagUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ type featureFlag = {
testLiveToggle: bool,
magicLink: bool,
quickStart: bool,
openSDK: bool,
switchMerchant: bool,
testLiveMode: bool,
isLiveMode: bool,
auditTrail: bool,
systemMetrics: bool,
sampleData: bool,
Expand All @@ -33,9 +32,8 @@ let featureFlagType = (featureFlags: Js.Json.t) => {
testLiveToggle: dict->getBool("test_live_toggle", false),
magicLink: dict->getBool("magic_link", false),
quickStart: dict->getBool("quick_start", false),
openSDK: dict->getBool("open_sdk", false),
switchMerchant: dict->getBool("switch_merchant", false),
testLiveMode: dict->getBool("test_live_mode", false),
isLiveMode: dict->getBool("is_live_mode", false),
auditTrail: dict->getBool("audit_trail", false),
systemMetrics: dict->getBool("system_metrics", false),
sampleData: dict->getBool("sample_data", false),
Expand Down
8 changes: 4 additions & 4 deletions src/entryPoints/hyperswitch/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ let make = () => {
let getEnumDetails = EnumVariantHook.useFetchEnumDetails()
let verificationDays = getFromMerchantDetails("verification")->LogicUtils.getIntFromString(-1)
let userRole = getFromUserDetails("user_role")
let modeText = featureFlagDetails.testLiveMode ? "Live Mode" : "Test Mode"
let modeText = featureFlagDetails.isLiveMode ? "Live Mode" : "Test Mode"
let titleComingSoonMessage = "Coming Soon!"
let subtitleComingSoonMessage = "We are currently working on this page."
let modeStyles = featureFlagDetails.testLiveMode
let modeStyles = featureFlagDetails.isLiveMode
? "bg-hyperswitch_green_trans border-hyperswitch_green_trans text-hyperswitch_green"
: "bg-orange-600/80 border-orange-500 text-grey-700"

Expand Down Expand Up @@ -125,7 +125,7 @@ let make = () => {
let _featureFlag = await fetchInitialEnums()
}

if featureFlagDetails.testLiveMode {
if featureFlagDetails.isLiveMode {
getAgreementEnum()->ignore
} else {
setDashboardPageState(_ => #HOME)
Expand Down Expand Up @@ -331,7 +331,7 @@ let make = () => {
<Recon />
</FeatureFlagEnabledComponent>
| list{"sdk"} =>
<FeatureFlagEnabledComponent isEnabled=featureFlagDetails.openSDK>
<FeatureFlagEnabledComponent isEnabled={!featureFlagDetails.isLiveMode}>
<SDKPage />
</FeatureFlagEnabledComponent>
| list{"3ds"} => <HSwitchThreeDS />
Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/hyperswitch/HyperSwitchEntry.res
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module HyperSwitchEntryComponent = {

let setPageName = pageTitle => {
let page = pageTitle->LogicUtils.snakeToTitle
let title = featureFlagDetails.testLiveMode
let title = featureFlagDetails.isLiveMode
? `${page} - Dashboard`
: `${page} - Dashboard [Test]`
DOMUtils.document.title = title
Expand Down
10 changes: 0 additions & 10 deletions src/entryPoints/hyperswitch/Provider/GlobalProvider.res
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ let defaultValue = {
setShowProdIntentForm: _ => (),
integrationDetails: defaultIntegrationValue,
setIntegrationDetails: _ => (),
tabIndexForDevelopers: 0,
setTabIndexForDevelopers: _ => (),
dashboardPageState: #DEFAULT,
setDashboardPageState: _ => (),
permissionInfo: [],
Expand All @@ -23,19 +21,13 @@ let defaultValue = {
let defaultContext = React.createContext(defaultValue)

module Provider = {
let makeProps = (~value, ~children, ()) =>
{
"value": value,
"children": children,
}
let make = React.Context.provider(defaultContext)
}

@react.component
let make = (~children) => {
let (showFeedbackModal, setShowFeedbackModal) = React.useState(_ => false)
let (showProdIntentForm, setShowProdIntentForm) = React.useState(_ => false)
let (tabIndexForDevelopers, setTabIndexForDevelopers) = React.useState(_ => 0)
let (dashboardPageState, setDashboardPageState) = React.useState(_ => #DEFAULT)
let (permissionInfo, setPermissionInfo) = React.useState(_ => [])
let (isProdIntentCompleted, setIsProdIntentCompleted) = React.useState(_ => false)
Expand All @@ -56,8 +48,6 @@ let make = (~children) => {
integrationDetails,
showProdIntentForm,
setShowProdIntentForm,
tabIndexForDevelopers,
setTabIndexForDevelopers,
dashboardPageState,
setDashboardPageState,
permissionInfo,
Expand Down
12 changes: 0 additions & 12 deletions src/entryPoints/hyperswitch/Provider/ProviderHelper.res
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ let itemToObjMapperForGetInfo = dict => {
}
}

let getDefaultValueOfGetInfo = {
module_: "",
description: "",
permissions: [
{
enum_name: "",
description: "",
isPermissionAllowed: false,
},
],
}

let getDefaultValueOfEnum = {
{
enum_name: "",
Expand Down
2 changes: 0 additions & 2 deletions src/entryPoints/hyperswitch/Provider/ProviderTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ type contextType = {
setShowFeedbackModal: (bool => bool) => unit,
showProdIntentForm: bool,
setShowProdIntentForm: (bool => bool) => unit,
tabIndexForDevelopers: int,
setTabIndexForDevelopers: (int => int) => unit,
dashboardPageState: dashboardPageStateTypes,
setDashboardPageState: (dashboardPageStateTypes => dashboardPageStateTypes) => unit,
integrationDetails: integrationDetailsType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ let make = (
~connector,
~bodyType,
~isPayoutFlow,
~isLiveMode={featureFlagDetails.testLiveMode},
~isLiveMode={featureFlagDetails.isLiveMode},
(),
)
setScreenState(_ => Loading)
Expand Down Expand Up @@ -396,7 +396,7 @@ let make = (
~connector,
~bodyType,
~isPayoutFlow,
~isLiveMode={featureFlagDetails.testLiveMode},
~isLiveMode={featureFlagDetails.isLiveMode},
(),
)->ignoreFields(connectorID, verifyConnectorIgnoreField)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module RenderConnectorInputFields = {
~selectedConnector,
~dict=details,
~fieldName=formName,
~isLiveMode={featureFlagDetails.testLiveMode},
~isLiveMode={featureFlagDetails.isLiveMode},
)}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HyperSwitch/Connectors/ConnectorList.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module NewProcessorCards = {
->LogicUtils.safeParse
->FeatureFlagUtils.featureFlagType

let connectorsAvailableForIntegration = featureFlagDetails.testLiveMode
let connectorsAvailableForIntegration = featureFlagDetails.isLiveMode
? ConnectorUtils.connectorListForLive
: isPayoutFlow
? ConnectorUtils.payoutConnectorList
Expand Down
Loading

0 comments on commit 8e44839

Please sign in to comment.