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

MOB-271 : ask for feedback from settings menu #99

Merged
merged 1 commit into from
Feb 28, 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
4 changes: 4 additions & 0 deletions dydx/dydxPresenters/dydxPresenters.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
277E90192B1EA3C3005CCBCB /* dydxRewardsSummaryPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277E90182B1EA3C3005CCBCB /* dydxRewardsSummaryPresenter.swift */; };
277E90332B1FAE9A005CCBCB /* dydxRewardsHelpViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277E90322B1FAE9A005CCBCB /* dydxRewardsHelpViewPresenter.swift */; };
277E908B2B2118AE005CCBCB /* dydxRewardsHistoryViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277E908A2B2118AE005CCBCB /* dydxRewardsHistoryViewPresenter.swift */; };
278A4D1E2B8EA95A003898EB /* dydxCollectFeedbackActionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278A4D1D2B8EA95A003898EB /* dydxCollectFeedbackActionBuilder.swift */; };
27C027532AFD761300E92CCB /* dydxSettingsHelpRowViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C027522AFD761300E92CCB /* dydxSettingsHelpRowViewPresenter.swift */; };
27DB2EA32AC1E7B20047BC39 /* dydxTradeRestrictedViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27DB2EA22AC1E7B20047BC39 /* dydxTradeRestrictedViewPresenter.swift */; };
314BBDE9F332ECA910BC414E /* Pods_iOS_dydxPresenters.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1551C00FFF41C29CFC5BD94 /* Pods_iOS_dydxPresenters.framework */; };
Expand Down Expand Up @@ -476,6 +477,7 @@
277E90182B1EA3C3005CCBCB /* dydxRewardsSummaryPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxRewardsSummaryPresenter.swift; sourceTree = "<group>"; };
277E90322B1FAE9A005CCBCB /* dydxRewardsHelpViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxRewardsHelpViewPresenter.swift; sourceTree = "<group>"; };
277E908A2B2118AE005CCBCB /* dydxRewardsHistoryViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxRewardsHistoryViewPresenter.swift; sourceTree = "<group>"; };
278A4D1D2B8EA95A003898EB /* dydxCollectFeedbackActionBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxCollectFeedbackActionBuilder.swift; sourceTree = "<group>"; };
27C027522AFD761300E92CCB /* dydxSettingsHelpRowViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxSettingsHelpRowViewPresenter.swift; sourceTree = "<group>"; };
27DB2EA22AC1E7B20047BC39 /* dydxTradeRestrictedViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxTradeRestrictedViewPresenter.swift; sourceTree = "<group>"; };
64487FFE2AA248340068DD87 /* dydxAlertsWorker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = dydxAlertsWorker.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -733,6 +735,7 @@
children = (
0243A76029BE572C00A083FE /* dydxCancelOrderActionBuilder.swift */,
0262F2D429DB4891009889E2 /* WalletAction.swift */,
278A4D1D2B8EA95A003898EB /* dydxCollectFeedbackActionBuilder.swift */,
);
path = Actions;
sourceTree = "<group>";
Expand Down Expand Up @@ -1786,6 +1789,7 @@
02A565B22A5E32790035469F /* dydxSystemAlertsProvider.swift in Sources */,
024FEB412ACB60690087A55E /* dydxMarketOrderbookPresenter.swift in Sources */,
270E7E242A5F6B1B00136793 /* dydxTradeInputSideViewPresenter.swift in Sources */,
278A4D1E2B8EA95A003898EB /* dydxCollectFeedbackActionBuilder.swift in Sources */,
2741E3732A689740000FA190 /* dydxDirectionColorPreferenceViewBuilder.swift in Sources */,
0236F12D296B91BD00EB995F /* dydxPortfolioOrdersViewPresenter.swift in Sources */,
0280B3A629CB63E10017D64A /* dydxOnboardWelcomeViewBuilder.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
"/action/share": {
"destination":"PlatformRouting.ShareActionBuilder"
},
"/action/collect_feedback": {
"destination":"dydxPresenters.dydxCollectFeedbackActionBuilder"
},
"/action/wallet/connect": {
"destination":"dydxPresenters.WalletActionBuilder"
},
Expand Down
8 changes: 8 additions & 0 deletions dydx/dydxPresenters/dydxPresenters/_Features/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
"link" : {
"text" : "{APP_SCHEME}:///settings/direction_color_preference"
}
},
{
"title" : {
"text" : "APP.HELP_MODAL.PROVIDE_FEEDBACK"
},
"link" : {
"text" : "{APP_SCHEME}:///action/collect_feedback?context=settings"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
"link" : {
"text" : "{APP_SCHEME}:///settings/debug_theme_viewer"
}
},
{
"title" : {
"text" : "APP.HELP_MODAL.PROVIDE_FEEDBACK"
},
"link" : {
"text" : "{APP_SCHEME}:///action/collect_feedback?context=settings"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// dydxCollectFeedbackActionBuilder.swift
// dydxPresenters
//
// Created by Michael Maguire on 2/27/24.
//

import RoutingKit
import Utilities
import UIToolkits
import dydxStateManager

public class dydxCollectFeedbackActionBuilder: NSObject, ObjectBuilderProtocol {
public func build<T>() -> T? {
let action = dydxCollectFeedbackAction()
return action as? T
}
}

open class dydxCollectFeedbackAction: NSObject, NavigableProtocol {
private var completion: RoutingCompletionBlock?
open func navigate(to request: RoutingRequest?, animated: Bool, completion: RoutingCompletionBlock?) {
switch request?.path {
case "/action/collect_feedback":
if let feedbackUrl = URL(string: AbacusStateManager.shared.environment?.links?.feedback ?? "") {
let data: [String: String]?
if let shareSource = request?.params?["context"] as? String {
data = ["source_context": shareSource]
} else {
data = nil
}
Router.shared?.navigate(to: feedbackUrl, completion: { _, success in
completion?(nil, success)
})
Tracking.shared?.log(event: "CollectFeedbackDisplayed", data: data)
completion?(nil, true)
} else {
completion?(nil, false)
}
default:
completion?(nil, false)
}
}
}
Loading