Skip to content
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

chore: Remove unused feature flags and codeblocks #1931

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ The `frm` feature flag enables the Fraud and Risk Management (FRM) module within

The `sample_data` feature flag enables the ability to load simulated sample data into the dashboard for preview purposes. When enabled, dummy transactions, analytics, and reporting data can be generated.

#### System Metrics

The `system_metrics` feature flag unlocks access to system monitoring and metrics pages within the dashboard. When enabled, users can view technical performance data like payment latency, uptime, API response times, error rates, and more.

#### Audit trail

The `audit_trail` feature flag enables access to payment and refund audit logs within the dashboard. When turned on, users can view detailed trails showing the history of transactions including status changes, approvals, edits, and more.
Expand All @@ -140,10 +136,6 @@ The `email` feature flag enables user sign-in and sign-up using magic links inst

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.

### User Journey

Enabling `user_journey_analytics` grants access to the user journey module within the analytics section of the dashboard. This feature provides comprehensive graphical representations of payment analytics, facilitating a deeper understanding of user behavior and usage patterns.

### Branding

Enabling `branding` feature flag enables customization of branding elements like logos, colors.
Expand Down
4 changes: 0 additions & 4 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ is_live_mode=false
email=false
quick_start=false
audit_trail=false
system_metrics=false
sample_data=false
frm=false
payout=true
Expand All @@ -28,8 +27,6 @@ test_processors=true
feedback=false
mixpanel=false
generate_report=false
user_journey_analytics=false
authentication_analytics=false
surcharge=false
dispute_evidence_upload=false
paypal_automatic_flow=false
Expand All @@ -39,7 +36,6 @@ global_search_filters=false
dispute_analytics=false
configure_pmts=false
branding=false
live_users_counter=false
granularity=false
compliance_certificate=false
pm_authentication_processor=true
Expand Down
4 changes: 0 additions & 4 deletions cypress/e2e/auth/auth.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ describe("Auth Module", () => {
email: true,
quick_start: false,
audit_trail: false,
system_metrics: false,
sample_data: false,
frm: false,
payout: true,
Expand All @@ -80,8 +79,6 @@ describe("Auth Module", () => {
feedback: false,
mixpanel: false,
generate_report: false,
user_journey_analytics: false,
authentication_analytics: false,
surcharge: false,
dispute_evidence_upload: false,
paypal_automatic_flow: false,
Expand All @@ -90,7 +87,6 @@ describe("Auth Module", () => {
dispute_analytics: false,
configure_pmts: false,
branding: false,
live_users_counter: false,
granularity: false,
compliance_certificate: false,
user_management_revamp: false,
Expand Down
8 changes: 0 additions & 8 deletions src/entryPoints/FeatureFlagUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type featureFlag = {
email: bool,
isLiveMode: bool,
auditTrail: bool,
systemMetrics: bool,
sampleData: bool,
frm: bool,
payOut: bool,
Expand All @@ -20,8 +19,6 @@ type featureFlag = {
generateReport: bool,
mixpanel: bool,
mixpanelToken: string,
userJourneyAnalytics: bool,
authenticationAnalytics: bool,
surcharge: bool,
disputeEvidenceUpload: bool,
paypalAutomaticFlow: bool,
Expand All @@ -31,7 +28,6 @@ type featureFlag = {
disputeAnalytics: bool,
configurePmts: bool,
branding: bool,
liveUsersCounter: bool,
granularity: bool,
complianceCertificate: bool,
pmAuthenticationProcessor: bool,
Expand All @@ -54,7 +50,6 @@ let featureFlagType = (featureFlags: JSON.t) => {
email: dict->getBool("email", 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),
frm: dict->getBool("frm", false),
payOut: dict->getBool("payout", false),
Expand All @@ -64,8 +59,6 @@ let featureFlagType = (featureFlags: JSON.t) => {
generateReport: dict->getBool("generate_report", false),
mixpanel: dict->getBool("mixpanel", false),
mixpanelToken: dict->getString("mixpanel_token", ""),
userJourneyAnalytics: dict->getBool("user_journey_analytics", false),
authenticationAnalytics: dict->getBool("authentication_analytics", false),
surcharge: dict->getBool("surcharge", false),
disputeEvidenceUpload: dict->getBool("dispute_evidence_upload", false),
paypalAutomaticFlow: dict->getBool("paypal_automatic_flow", false),
Expand All @@ -75,7 +68,6 @@ let featureFlagType = (featureFlags: JSON.t) => {
disputeAnalytics: dict->getBool("dispute_analytics", false),
configurePmts: dict->getBool("configure_pmts", false),
branding: dict->getBool("branding", false),
liveUsersCounter: dict->getBool("live_users_counter", false),
granularity: dict->getBool("granularity", false),
complianceCertificate: dict->getBool("compliance_certificate", false),
pmAuthenticationProcessor: dict->getBool("pm_authentication_processor", false),
Expand Down
29 changes: 1 addition & 28 deletions src/entryPoints/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ let make = () => {
merchantDetailsTypedValue.recon_status === Active
}, [merchantDetailsTypedValue.merchant_id])

let isLiveUsersCounterEnabled = featureFlagDetails.liveUsersCounter
let hyperSwitchAppSidebars = SidebarValues.useGetSidebarValues(~isReconEnabled)
sessionExpired := false

Expand Down Expand Up @@ -134,13 +133,6 @@ let make = () => {
}}
/>
</div>
{switch url.path->urlPath {
| list{"home"} =>
<RenderIf condition=isLiveUsersCounterEnabled>
<ActivePaymentsCounter />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have you removed the component rendering <ActivePaymentsCounter />
you can just remove the feature flag and renderif condition

</RenderIf>
| _ => React.null
}}
</div>
<div
className="w-full h-screen overflow-x-scroll xl:overflow-x-hidden overflow-y-scroll">
Expand Down Expand Up @@ -208,25 +200,6 @@ let make = () => {
/>
</AccessControl>
| list{"users", ..._} => <UserManagementContainer />
| list{"analytics-user-journey"} =>
<AccessControl
isEnabled={featureFlagDetails.userJourneyAnalytics &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here also

Comment on lines -212 to -213
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have we removed the component ?

[#Organization, #Merchant]->checkUserEntity}
authorization={userHasAccess(~groupAccess=AnalyticsView)}>
<FilterContext key="UserJourneyAnalytics" index="UserJourneyAnalytics">
<UserJourneyAnalytics />
</FilterContext>
</AccessControl>
| list{"analytics-authentication"} =>
<AccessControl
isEnabled={featureFlagDetails.authenticationAnalytics &&
[#Organization, #Merchant]->checkUserEntity}
authorization={userHasAccess(~groupAccess=AnalyticsView)}>
<FilterContext
key="AuthenticationAnalytics" index="AuthenticationAnalytics">
<AuthenticationAnalytics />
</FilterContext>
</AccessControl>
| list{"developer-api-keys"} =>
<AccessControl
// TODO: Remove `MerchantDetailsManage` permission in future
Expand All @@ -239,7 +212,7 @@ let make = () => {
</AccessControl>
| list{"developer-system-metrics"} =>
<AccessControl
isEnabled={isInternalUser && featureFlagDetails.systemMetrics}
isEnabled={isInternalUser}
authorization={userHasAccess(~groupAccess=AnalyticsView)}>
<FilterContext key="SystemMetrics" index="SystemMetrics">
<SystemMetricsAnalytics />
Expand Down
43 changes: 3 additions & 40 deletions src/entryPoints/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -292,41 +292,15 @@ let refundAnalytics = SubLevelLink({
searchOptions: [("View analytics", "")],
})

let userJourneyAnalytics = SubLevelLink({
name: "User Journey",
link: `/analytics-user-journey`,
access: Access,
iconTag: "betaTag",
searchOptions: [("View analytics", "")],
})

let authenticationAnalytics = SubLevelLink({
name: "Authentication",
link: `/analytics-authentication`,
access: Access,
iconTag: "betaTag",
searchOptions: [("View analytics", "")],
})

let analytics = (
isAnalyticsEnabled,
userJourneyAnalyticsFlag,
authenticationAnalyticsFlag,
disputeAnalyticsFlag,
performanceMonitorFlag,
newAnalyticsflag,
~userHasResourceAccess,
) => {
let links = [paymentAnalytcis, refundAnalytics]

if userJourneyAnalyticsFlag {
links->Array.push(userJourneyAnalytics)
}

if authenticationAnalyticsFlag {
links->Array.push(authenticationAnalytics)
}

if disputeAnalyticsFlag {
links->Array.push(disputeAnalytics)
}
Expand Down Expand Up @@ -525,13 +499,7 @@ let paymentSettings = userHasResourceAccess => {
})
}

let developers = (
isDevelopersEnabled,
systemMetrics,
~userHasResourceAccess,
~checkUserEntity,
~roleId,
) => {
let developers = (isDevelopersEnabled, ~userHasResourceAccess, ~checkUserEntity, ~roleId) => {
let isInternalUser = roleId->HyperSwitchUtils.checkIsInternalUser
let isProfileUser = checkUserEntity([#Profile])
let apiKeys = apiKeys(userHasResourceAccess)
Expand All @@ -540,7 +508,7 @@ let developers = (

let defaultDevelopersOptions = [paymentSettings]

if isInternalUser && systemMetrics {
if isInternalUser {
defaultDevelopersOptions->Array.push(systemMetric)
}
if !isProfileUser {
Expand Down Expand Up @@ -666,9 +634,6 @@ let useGetSidebarValues = (~isReconEnabled: bool) => {
payOut,
recon,
default,
systemMetrics,
userJourneyAnalytics: userJourneyAnalyticsFlag,
authenticationAnalytics: authenticationAnalyticsFlag,
surcharge: isSurchargeEnabled,
isLiveMode,
threedsAuthenticator,
Expand Down Expand Up @@ -700,8 +665,6 @@ let useGetSidebarValues = (~isReconEnabled: bool) => {
~userHasResourceAccess,
),
default->analytics(
userJourneyAnalyticsFlag,
authenticationAnalyticsFlag,
disputeAnalytics,
performanceMonitorFlag,
isNewAnalyticsEnable,
Expand All @@ -714,7 +677,7 @@ let useGetSidebarValues = (~isReconEnabled: bool) => {
~userEntity,
),
recon->reconAndSettlement(isReconEnabled, checkUserEntity, userHasResourceAccess),
default->developers(systemMetrics, ~userHasResourceAccess, ~checkUserEntity, ~roleId),
default->developers(~userHasResourceAccess, ~checkUserEntity, ~roleId),
settings(~isConfigurePmtsEnabled=configurePmts, ~userHasResourceAccess, ~complianceCertificate),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ module OverviewInfo = {

@react.component
let make = () => {
let {systemMetrics} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()

<div className="flex flex-col gap-4">
Expand All @@ -207,7 +206,7 @@ let make = () => {
<RenderIf condition={userHasAccess(~groupAccess=AnalyticsView) === Access}>
<PaymentOverview />
</RenderIf>
<RenderIf condition={systemMetrics}>
<RenderIf condition={userHasAccess(~groupAccess=AnalyticsView) === Access}>
<SystemMetricsInsights />
</RenderIf>
</div>
Expand Down
Loading