Skip to content

Commit

Permalink
chore: transaction view feature flag (#1472)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitanjli525 authored Sep 25, 2024
1 parent 0d3433e commit 8b48ef4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ performance_monitor=false
new_analytics=false
down_time=false
tax_processor=true
transaction_view=false
2 changes: 2 additions & 0 deletions src/entryPoints/FeatureFlagUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type featureFlag = {
newAnalytics: bool,
downTime: bool,
taxProcessor: bool,
transactionView: bool,
}

let featureFlagType = (featureFlags: JSON.t) => {
Expand Down Expand Up @@ -75,6 +76,7 @@ let featureFlagType = (featureFlags: JSON.t) => {
newAnalytics: dict->getBool("new_analytics", false),
downTime: dict->getBool("down_time", false),
taxProcessor: dict->getBool("tax_processor", false),
transactionView: dict->getBool("transaction_view", false),
}
typedFeatureFlag
}
11 changes: 7 additions & 4 deletions src/screens/Order/Orders.res
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ 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} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {generateReport, transactionView} =
HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom

let fetchOrders = () => {
if !previewOnly {
Expand Down Expand Up @@ -142,9 +143,11 @@ let make = (~previewOnly=false) => {
</RenderIf>
</div>
</div>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Orders />
</div>
<RenderIf condition={transactionView}>
<div className="flex gap-6 justify-around">
<TransactionView entity=TransactionViewTypes.Orders />
</div>
</RenderIf>
<div className="flex">
<RenderIf condition={!previewOnly}>
<div className="flex-1"> {filtersUI} </div>
Expand Down

0 comments on commit 8b48ef4

Please sign in to comment.