Skip to content

Commit

Permalink
fix: removing unused feature flags (#1920)
Browse files Browse the repository at this point in the history
  • Loading branch information
susrithasabbini authored Dec 16, 2024
1 parent 4ed41ca commit 1a55514
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 38 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ In Live mode, current users are not allowed to sign up. Users must be created ma

The `email` feature flag enables user sign-in and sign-up using magic links instead of passwords. When enabled, users can request a magic link via email that logs them into their account or creates a new account if they are signing up.

#### Quick Start

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.

### Surcharge

The `surcharge` feature flag enables the ability to apply surcharges to payments. When enabled, you can create advanced rules based on payment parameters like amount, currency, and payment method to enforce surcharges as needed.
Expand Down
2 changes: 0 additions & 2 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ configure_pmts=false
branding=false
live_users_counter=false
granularity=false
custom_webhook_headers=false
compliance_certificate=false
pm_authentication_processor=true
performance_monitor=false
Expand All @@ -50,7 +49,6 @@ new_analytics_smart_retries=false
new_analytics_refunds=false
down_time=false
tax_processor=true
transaction_view=false
x_feature_route=false
tenant_user=false
[default.merchant_config]
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/auth/auth.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ describe("Auth Module", () => {
branding: false,
live_users_counter: false,
granularity: false,
custom_webhook_headers: false,
compliance_certificate: false,
user_management_revamp: false,
pm_authentication_processor: true,
Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/AuthModule/TwoFaAuth/TwoFaElements.res
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module ShowRecoveryCodes = {
@react.component
let make = (~recoveryCodes) => {
<div
className="border border-gray-200 rounded-md bg-jp-gray-100 py-6 px-12 flex gap-8 flex justify-evenly">
className="border border-gray-200 rounded-md bg-jp-gray-100 py-6 px-12 flex gap-8 justify-evenly">
<div className="grid grid-cols-2 gap-4">
{recoveryCodes
->Array.map(recoveryCode =>
Expand Down
6 changes: 0 additions & 6 deletions src/entryPoints/FeatureFlagUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ type featureFlag = {
default: bool,
testLiveToggle: bool,
email: bool,
quickStart: bool,
isLiveMode: bool,
auditTrail: bool,
systemMetrics: bool,
Expand All @@ -34,7 +33,6 @@ type featureFlag = {
branding: bool,
liveUsersCounter: bool,
granularity: bool,
customWebhookHeaders: bool,
complianceCertificate: bool,
pmAuthenticationProcessor: bool,
performanceMonitor: bool,
Expand All @@ -43,7 +41,6 @@ type featureFlag = {
newAnalyticsRefunds: bool,
downTime: bool,
taxProcessor: bool,
transactionView: bool,
xFeatureRoute: bool,
tenantUser: bool,
}
Expand All @@ -55,7 +52,6 @@ let featureFlagType = (featureFlags: JSON.t) => {
default: dict->getBool("default", true),
testLiveToggle: dict->getBool("test_live_toggle", false),
email: dict->getBool("email", false),
quickStart: dict->getBool("quick_start", false),
isLiveMode: dict->getBool("is_live_mode", false),
auditTrail: dict->getBool("audit_trail", false),
systemMetrics: dict->getBool("system_metrics", false),
Expand All @@ -81,7 +77,6 @@ let featureFlagType = (featureFlags: JSON.t) => {
branding: dict->getBool("branding", false),
liveUsersCounter: dict->getBool("live_users_counter", false),
granularity: dict->getBool("granularity", false),
customWebhookHeaders: dict->getBool("custom_webhook_headers", false),
complianceCertificate: dict->getBool("compliance_certificate", false),
pmAuthenticationProcessor: dict->getBool("pm_authentication_processor", false),
performanceMonitor: dict->getBool("performance_monitor", false),
Expand All @@ -90,7 +85,6 @@ let featureFlagType = (featureFlags: JSON.t) => {
newAnalyticsRefunds: dict->getBool("new_analytics_refunds", false),
downTime: dict->getBool("down_time", false),
taxProcessor: dict->getBool("tax_processor", false),
transactionView: dict->getBool("transaction_view", false),
xFeatureRoute: dict->getBool("x_feature_route", false),
tenantUser: dict->getBool("tenant_user", false),
}
Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ let make = () => {
setShowModal={setShowFeedbackModal}
/>
</RenderIf>
<RenderIf condition={!featureFlagDetails.isLiveMode || featureFlagDetails.quickStart}>
<RenderIf condition={!featureFlagDetails.isLiveMode}>
<ProdIntentForm />
</RenderIf>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/entryPoints/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ let useGetSidebarValues = (~isReconEnabled: bool) => {
surcharge: isSurchargeEnabled,
isLiveMode,
threedsAuthenticator,
quickStart,
disputeAnalytics,
configurePmts,
complianceCertificate,
Expand All @@ -688,7 +687,7 @@ let useGetSidebarValues = (~isReconEnabled: bool) => {
let isNewAnalyticsEnable =
newAnalytics && useIsFeatureEnabledForMerchant(merchantSpecificConfig.newAnalytics)
let sidebar = [
productionAccessComponent(quickStart, userHasAccess, hasAnyGroupAccess),
productionAccessComponent(isLiveMode, userHasAccess, hasAnyGroupAccess),
default->home,
default->operations(~userHasResourceAccess, ~isPayoutsEnabled=payOut, ~userEntity),
default->connectors(
Expand Down
11 changes: 4 additions & 7 deletions src/screens/Transaction/Disputes/Disputes.res
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ let make = () => {
let (offset, setOffset) = React.useState(_ => 0)
let (filters, setFilters) = React.useState(_ => None)

let {generateReport, transactionView} =
HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {generateReport} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {updateTransactionEntity} = OMPSwitchHooks.useUserInfo()
let {userInfo: {transactionEntity}, checkUserEntity} = React.useContext(
UserInfoProvider.defaultContext,
Expand Down Expand Up @@ -107,11 +106,9 @@ let make = () => {
</RenderIf>
</div>
</div>
<RenderIf condition={transactionView}>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Disputes />
</div>
</RenderIf>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Disputes />
</div>
<div className="flex-1"> {filtersUI} </div>
<PageLoaderWrapper screenState customUI>
<div className="flex flex-col gap-4">
Expand Down
11 changes: 4 additions & 7 deletions src/screens/Transaction/Order/Orders.res
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ let make = (~previewOnly=false) => {
let pageDetailDict = Recoil.useRecoilValueFromAtom(LoadedTable.table_pageDetails)
let pageDetail = pageDetailDict->Dict.get("Orders")->Option.getOr(defaultValue)
let (offset, setOffset) = React.useState(_ => pageDetail.offset)
let {generateReport, transactionView} =
HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {generateReport} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

let fetchOrders = () => {
if !previewOnly {
Expand Down Expand Up @@ -147,11 +146,9 @@ let make = (~previewOnly=false) => {
</RenderIf>
</div>
</div>
<RenderIf condition={transactionView}>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Orders />
</div>
</RenderIf>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Orders />
</div>
<div className="flex">
<RenderIf condition={!previewOnly}>
<div className="flex-1"> {filtersUI} </div>
Expand Down
11 changes: 4 additions & 7 deletions src/screens/Transaction/Refunds/Refund.res
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ let make = () => {
None
}, (offset, filters, searchText))

let {generateReport, transactionView} =
HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {generateReport} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

<ErrorBoundary>
<div className="min-h-[50vh]">
Expand All @@ -82,11 +81,9 @@ let make = () => {
</RenderIf>
</div>
</div>
<RenderIf condition={transactionView}>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Refunds />
</div>
</RenderIf>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Refunds />
</div>
<div className="flex justify-between gap-3">
<div className="flex-1">
<RemoteTableFilters
Expand Down

0 comments on commit 1a55514

Please sign in to comment.