Skip to content

Commit

Permalink
fix: revert customer module flag removal (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvenga authored Jan 11, 2024
1 parent a5298b5 commit 15d2e6e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ 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 they connect to processors, configure payment routing and test a payment, all in one flow.

#### Customers Module

The `customers_module` feature flag enables the customers module in dashboard. Users can see the customers and their details via enabling this flag.

---

## Deployment
Expand Down
3 changes: 2 additions & 1 deletion config/FeatureFlag.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"generate_report": false,
"forgot_password": false,
"user_journey_analytics": false,
"surcharge": false
"surcharge": false,
"customers_module": false
}
2 changes: 2 additions & 0 deletions src/entryPoints/hyperswitch/FeatureFlagUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type featureFlag = {
forgetPassword: bool,
userJourneyAnalytics: bool,
surcharge: bool,
customersModule: bool,
}

let featureFlagType = (featureFlags: Js.Json.t) => {
Expand Down Expand Up @@ -53,6 +54,7 @@ let featureFlagType = (featureFlags: Js.Json.t) => {
forgetPassword: dict->getBool("forgot_password", false),
userJourneyAnalytics: dict->getBool("user_journey_analytics", false),
surcharge: dict->getBool("surcharge", false),
customersModule: dict->getBool("customers_module", false),
}
typedFeatureFlag
}
16 changes: 9 additions & 7 deletions src/entryPoints/hyperswitch/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,15 @@ let make = () => {
renderShow={id => <ShowDisputes id />}
/>
| list{"customers", ...remainingPath} =>
<EntityScaffold
entityName="Customers"
remainingPath
access=ReadWrite
renderList={() => <Customers />}
renderShow={id => <ShowCustomers id />}
/>
<FeatureFlagEnabledComponent isEnabled=featureFlagDetails.customersModule>
<EntityScaffold
entityName="Customers"
remainingPath
access=ReadWrite
renderList={() => <Customers />}
renderShow={id => <ShowCustomers id />}
/>
</FeatureFlagEnabledComponent>
| list{"routing", ...remainingPath} =>
<EntityScaffold
entityName="Routing"
Expand Down
9 changes: 6 additions & 3 deletions src/entryPoints/hyperswitch/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ let customers = SubLevelLink({
searchOptions: [("View customers", "")],
})

let operations = isOperationsEnabled => {
let operations = (isOperationsEnabled, customersModule) => {
isOperationsEnabled
? Section({
name: "Operations",
icon: "hswitch-operations",
showSection: true,
links: [payments, refunds, disputes, customers],
links: customersModule
? [payments, refunds, disputes, customers]
: [payments, refunds, disputes],
})
: emptyComponent
}
Expand Down Expand Up @@ -328,11 +330,12 @@ let getHyperSwitchAppSidebars = (
userJourneyAnalytics: userJourneyAnalyticsFlag,
surcharge: isSurchargeEnabled,
isLiveMode,
customersModule,
} = featureFlagDetails
let sidebar = [
productionAccess->productionAccessComponent,
default->home,
default->operations,
default->operations(customersModule),
default->analytics(userJourneyAnalyticsFlag),
default->connectors(isLiveMode),
default->workflow(isSurchargeEnabled),
Expand Down

0 comments on commit 15d2e6e

Please sign in to comment.