From 39d8bc1a50b2d8dcf8c815ededf44761a5b12812 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Thu, 15 Feb 2024 11:02:28 +0500 Subject: [PATCH] Revert "chore: learner feedback collection from the mobile app (#1819)" (#1820) This reverts commit 5b53fca62dd600161ddbaf0319cf34dae97c6f40. --- Source/OEXAnalytics+Swift.swift | 2 - Source/ProfileOptionsViewController.swift | 57 ++++------------------- Source/ServerConfiguration.swift | 3 -- 3 files changed, 8 insertions(+), 54 deletions(-) diff --git a/Source/OEXAnalytics+Swift.swift b/Source/OEXAnalytics+Swift.swift index b5b5abf42..e901e00f7 100644 --- a/Source/OEXAnalytics+Swift.swift +++ b/Source/OEXAnalytics+Swift.swift @@ -103,7 +103,6 @@ public enum AnalyticsDisplayName : String { case PrivacyPolicyClicked = "Privacy Policy Clicked" case CookiePolicyClicked = "Cookie Policy Clicked" case DataSellConsentClicked = "Do Not Sell Data Clicked" - case SubmitFeedbackClicked = "Submit feedback clicked" } public enum AnalyticsEventName: String { @@ -195,7 +194,6 @@ public enum AnalyticsEventName: String { case PrivacyPolicyClicked = "edx.bi.app.profile.privacy_policy.clicked" case CookiePolicyClicked = "edx.bi.app.profile.cookie_policy.clicked" case DataSellConsentClicked = "edx.bi.app.profile.do_not_sell_data.clicked" - case SubmitFeedbackClicked = "edx.bi.app.profile.submit_feedback.clicked" } public enum AnalyticsScreenName: String { diff --git a/Source/ProfileOptionsViewController.swift b/Source/ProfileOptionsViewController.swift index 941bf8c95..d2c48c748 100644 --- a/Source/ProfileOptionsViewController.swift +++ b/Source/ProfileOptionsViewController.swift @@ -21,7 +21,7 @@ class ProfileOptionsViewController: UIViewController { case personalInformation case restorePurchase case privacy - case help(Bool, Bool, Bool) + case help(Bool, Bool) case signout case deleteAccount } @@ -139,11 +139,10 @@ class ProfileOptionsViewController: UIViewController { } let feedbackEnabled = environment.config.feedbackEmailAddress() != nil - let submitFeedbackEnabled = environment.serverConfig.feedbackFormURL != nil let faqEnabled = environment.config.faqURL != nil if feedbackEnabled || faqEnabled { - options.append(.help(feedbackEnabled, submitFeedbackEnabled, faqEnabled)) + options.append(.help(feedbackEnabled, faqEnabled)) } options.append(.signout) @@ -218,8 +217,8 @@ extension ProfileOptionsViewController: UITableViewDataSource { case .privacy: return privacyCell(tableView, indexPath: indexPath) - case .help(let feedbackEnabled, let submitFeedbackEnabled, let faqEnabled): - return helpCell(tableView, indexPath: indexPath, feedbackEnabled: feedbackEnabled, submitFeedbackEnabled: submitFeedbackEnabled, faqEnabled: faqEnabled) + case .help(let feedbackEnabled, let faqEnabled): + return helpCell(tableView, indexPath: indexPath, feedbackEnabled: feedbackEnabled, faqEnabled: faqEnabled) case .signout: return signoutCell(tableView, indexPath: indexPath) @@ -272,10 +271,10 @@ extension ProfileOptionsViewController: UITableViewDataSource { return cell } - private func helpCell(_ tableView: UITableView, indexPath: IndexPath, feedbackEnabled: Bool, submitFeedbackEnabled: Bool, faqEnabled: Bool) -> UITableViewCell { + private func helpCell(_ tableView: UITableView, indexPath: IndexPath, feedbackEnabled: Bool, faqEnabled: Bool) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: HelpCell.identifier, for: indexPath) as! HelpCell cell.delegate = self - cell.update(feedbackEnabled: feedbackEnabled, faqEnabled: faqEnabled, submitFeedbackEnabled: submitFeedbackEnabled, platformName: environment.config.platformName()) + cell.update(feedbackEnabled: feedbackEnabled, faqEnabled: faqEnabled, platformName: environment.config.platformName()) return cell } @@ -346,14 +345,6 @@ extension ProfileOptionsViewController: HelpCellDelegate { launchEmailComposer() } - func didTapSubmitFeedback() { - guard let url = environment.serverConfig.feedbackFormURL else { return } - environment.analytics.trackProfileOptionClcikEvent(displayName: AnalyticsDisplayName.SubmitFeedbackCLicked, name: AnalyticsEventName.SubmitFeedbackCLicked) - if UIApplication.shared.canOpenURL(url) { - UIApplication.shared.open(url, options: [:]) - } - } - func didTapFAQ() { guard let faqURL = environment.config.faqURL, let url = URL(string: faqURL) else { return } environment.analytics.trackProfileOptionClcikEvent(displayName: AnalyticsDisplayName.FAQClicked, name: AnalyticsEventName.FAQClicked) @@ -1141,7 +1132,6 @@ class PrivacyCell: UITableViewCell { protocol HelpCellDelegate: AnyObject { func didTapEmail() - func didTapSubmitFeedback() func didTapFAQ() } @@ -1152,7 +1142,6 @@ class HelpCell: UITableViewCell { private var feedbackEnabled: Bool = false private var faqEnabled: Bool = false - private var submitFeedbackEnabled: Bool = false private let lineSpacing: CGFloat = 4 @@ -1210,21 +1199,6 @@ class HelpCell: UITableViewCell { return button }() - private lazy var submitFeedbackButton: UIButton = { - let button = UIButton() - button.layer.borderWidth = 1 - button.layer.borderColor = OEXStyles.shared().neutralXLight().cgColor - button.oex_addAction({ [weak self] _ in - self?.delegate?.didTapSubmitFeedback() - }, for: .touchUpInside) - - let faqButtonTitle = [buttonStyle.attributedString(withText: Strings.ProfileOptions.Help.Heading.feedback), faqButtonIcon] - let attributedText = NSAttributedString.joinInNaturalLayout(attributedStrings: faqButtonTitle) - button.setAttributedTitle(attributedText, for: .normal) - button.accessibilityIdentifier = "HelpCell:submit-feedback-button" - return button - }() - private lazy var supportLabel: UILabel = { let label = UILabel() label.attributedText = subtitleTextStyle.attributedString(withText: Strings.ProfileOptions.Help.Heading.support) @@ -1279,11 +1253,10 @@ class HelpCell: UITableViewCell { fatalError("init(coder:) has not been implemented") } - func update(feedbackEnabled: Bool, faqEnabled: Bool, submitFeedbackEnabled: Bool, platformName: String) { + func update(feedbackEnabled: Bool, faqEnabled: Bool, platformName: String) { self.feedbackEnabled = feedbackEnabled self.faqEnabled = faqEnabled self.platformName = platformName - self.submitFeedbackEnabled = submitFeedbackEnabled setupViews() setupConstrains() } @@ -1295,9 +1268,6 @@ class HelpCell: UITableViewCell { feedbackSupportContainer.addSubview(feedbackLabel) feedbackSupportContainer.addSubview(feedbackSubtitleLabel) feedbackSupportContainer.addSubview(emailFeedbackButton) - if submitFeedbackEnabled { - feedbackSupportContainer.addSubview(submitFeedbackButton) - } contentView.addSubview(feedbackSupportContainer) } @@ -1342,19 +1312,8 @@ class HelpCell: UITableViewCell { make.height.greaterThanOrEqualTo(StandardVerticalMargin * 2) } - if submitFeedbackEnabled { - submitFeedbackButton.snp.makeConstraints { make in - make.top.equalTo(feedbackSubtitleLabel.snp.bottom).offset(StandardVerticalMargin) - make.leading.equalTo(feedbackSupportContainer) - make.trailing.equalTo(feedbackSupportContainer) - make.height.equalTo(StandardVerticalMargin * 5) - } - } - - let constraintView = submitFeedbackEnabled ? submitFeedbackButton : feedbackSubtitleLabel - emailFeedbackButton.snp.makeConstraints { make in - make.top.equalTo(constraintView.snp.bottom).offset(StandardVerticalMargin) + make.top.equalTo(feedbackSubtitleLabel.snp.bottom).offset(StandardVerticalMargin) make.leading.equalTo(feedbackSupportContainer) make.trailing.equalTo(feedbackSupportContainer) make.height.equalTo(StandardVerticalMargin * 5) diff --git a/Source/ServerConfiguration.swift b/Source/ServerConfiguration.swift index 88bb38c9d..6a389e79b 100644 --- a/Source/ServerConfiguration.swift +++ b/Source/ServerConfiguration.swift @@ -23,14 +23,12 @@ public extension ServerConfigProvider { case valuePropEnabled = "value_prop_enabled" case config = "config" case iapConfig = "iap_config" - case feedbackFormURL = "feedback_form_url" } @objc static let shared = ServerConfiguration() private(set) var valuePropEnabled: Bool = false private(set) var iapConfig: IAPConfig? = nil - private(set) var feedbackFormURL: URL? = nil private override init() { super.init() @@ -43,7 +41,6 @@ public extension ServerConfigProvider { let config = try? JSONSerialization.jsonObject(with: configData, options : []) as? Dictionary else { return } valuePropEnabled = config[Keys.valuePropEnabled] as? Bool ?? false - feedbackFormURL = (config[Keys.feedbackFormURL] as? String).flatMap { URL(string:$0)} if let iapDict = config[Keys.iapConfig] as? Dictionary { iapConfig = IAPConfig(dictionary: iapDict)