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: transaction view feature flag #1472

Merged
merged 1 commit into from
Sep 25, 2024
Merged
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
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
Loading