Skip to content

Commit 7eedb86

Browse files
authored
Merge pull request #1106 from StepicOrg/hotfix/1.207
Hotfix 1.207
2 parents 103845b + 2f6646f commit 7eedb86

20 files changed

+61
-34
lines changed

Stepic.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12958,7 +12958,7 @@
1295812958
CODE_SIGN_IDENTITY = "iPhone Developer";
1295912959
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1296012960
CODE_SIGN_STYLE = Automatic;
12961-
CURRENT_PROJECT_VERSION = 405;
12961+
CURRENT_PROJECT_VERSION = 406;
1296212962
DEBUG_INFORMATION_FORMAT = dwarf;
1296312963
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1296412964
INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist";
@@ -12983,7 +12983,7 @@
1298312983
CODE_SIGN_IDENTITY = "iPhone Developer";
1298412984
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1298512985
CODE_SIGN_STYLE = Automatic;
12986-
CURRENT_PROJECT_VERSION = 405;
12986+
CURRENT_PROJECT_VERSION = 406;
1298712987
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1298812988
INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist";
1298912989
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
@@ -13125,7 +13125,7 @@
1312513125
CODE_SIGN_IDENTITY = "iPhone Developer";
1312613126
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1312713127
CODE_SIGN_STYLE = Automatic;
13128-
CURRENT_PROJECT_VERSION = 405;
13128+
CURRENT_PROJECT_VERSION = 406;
1312913129
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1313013130
ENABLE_BITCODE = YES;
1313113131
INFOPLIST_FILE = "Stepic/Info-Production.plist";
@@ -13155,7 +13155,7 @@
1315513155
CODE_SIGN_IDENTITY = "iPhone Developer";
1315613156
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1315713157
CODE_SIGN_STYLE = Automatic;
13158-
CURRENT_PROJECT_VERSION = 405;
13158+
CURRENT_PROJECT_VERSION = 406;
1315913159
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1316013160
ENABLE_BITCODE = YES;
1316113161
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
@@ -13246,7 +13246,7 @@
1324613246
CODE_SIGN_IDENTITY = "iPhone Developer";
1324713247
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1324813248
CODE_SIGN_STYLE = Automatic;
13249-
CURRENT_PROJECT_VERSION = 405;
13249+
CURRENT_PROJECT_VERSION = 406;
1325013250
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1325113251
ENABLE_BITCODE = YES;
1325213252
INFOPLIST_FILE = "Stepic/Info-Develop.plist";
@@ -13298,7 +13298,7 @@
1329813298
CODE_SIGN_IDENTITY = "iPhone Developer";
1329913299
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1330013300
CODE_SIGN_STYLE = Automatic;
13301-
CURRENT_PROJECT_VERSION = 405;
13301+
CURRENT_PROJECT_VERSION = 406;
1330213302
DEBUG_INFORMATION_FORMAT = dwarf;
1330313303
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1330413304
INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist";
@@ -13379,7 +13379,7 @@
1337913379
CODE_SIGN_IDENTITY = "iPhone Developer";
1338013380
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1338113381
CODE_SIGN_STYLE = Automatic;
13382-
CURRENT_PROJECT_VERSION = 405;
13382+
CURRENT_PROJECT_VERSION = 406;
1338313383
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1338413384
ENABLE_BITCODE = YES;
1338513385
INFOPLIST_FILE = "Stepic/Info-Develop.plist";
@@ -13427,7 +13427,7 @@
1342713427
CODE_SIGN_IDENTITY = "iPhone Developer";
1342813428
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1342913429
CODE_SIGN_STYLE = Automatic;
13430-
CURRENT_PROJECT_VERSION = 405;
13430+
CURRENT_PROJECT_VERSION = 406;
1343113431
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1343213432
INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist";
1343313433
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
@@ -13947,7 +13947,7 @@
1394713947
CODE_SIGN_IDENTITY = "iPhone Developer";
1394813948
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1394913949
CODE_SIGN_STYLE = Automatic;
13950-
CURRENT_PROJECT_VERSION = 405;
13950+
CURRENT_PROJECT_VERSION = 406;
1395113951
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1395213952
ENABLE_BITCODE = YES;
1395313953
INFOPLIST_FILE = "Stepic/Info-Release.plist";
@@ -14001,7 +14001,7 @@
1400114001
CODE_SIGN_IDENTITY = "iPhone Developer";
1400214002
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1400314003
CODE_SIGN_STYLE = Automatic;
14004-
CURRENT_PROJECT_VERSION = 405;
14004+
CURRENT_PROJECT_VERSION = 406;
1400514005
DEBUG_INFORMATION_FORMAT = dwarf;
1400614006
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1400714007
INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist";
@@ -14083,7 +14083,7 @@
1408314083
CODE_SIGN_IDENTITY = "iPhone Developer";
1408414084
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1408514085
CODE_SIGN_STYLE = Automatic;
14086-
CURRENT_PROJECT_VERSION = 405;
14086+
CURRENT_PROJECT_VERSION = 406;
1408714087
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1408814088
ENABLE_BITCODE = YES;
1408914089
INFOPLIST_FILE = "Stepic/Info-Release.plist";
@@ -14131,7 +14131,7 @@
1413114131
CODE_SIGN_IDENTITY = "iPhone Developer";
1413214132
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1413314133
CODE_SIGN_STYLE = Automatic;
14134-
CURRENT_PROJECT_VERSION = 405;
14134+
CURRENT_PROJECT_VERSION = 406;
1413514135
DEVELOPMENT_TEAM = UJ4KC2QN7B;
1413614136
INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist";
1413714137
IPHONEOS_DEPLOYMENT_TARGET = 11.0;

Stepic/Info-Develop.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</dict>
6363
</array>
6464
<key>CFBundleVersion</key>
65-
<string>405</string>
65+
<string>406</string>
6666
<key>FacebookAppID</key>
6767
<string>171127739724012</string>
6868
<key>FacebookDisplayName</key>

Stepic/Info-Production.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</dict>
6363
</array>
6464
<key>CFBundleVersion</key>
65-
<string>405</string>
65+
<string>406</string>
6666
<key>FacebookAppID</key>
6767
<string>171127739724012</string>
6868
<key>FacebookDisplayName</key>

Stepic/Info-Release.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</dict>
6363
</array>
6464
<key>CFBundleVersion</key>
65-
<string>405</string>
65+
<string>406</string>
6666
<key>FacebookAppID</key>
6767
<string>171127739724012</string>
6868
<key>FacebookDisplayName</key>

Stepic/Legacy/Model/RemoteConfig/RemoteConfig.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ The price includes commission from App Store and VAT. By paying for access to th
4141
Key.isCourseRevenueAvailable.rawValue: NSNumber(value: false),
4242
Key.purchaseFlow.rawValue: NSString(string: Self.defaultCoursePurchaseFlowType.rawValue),
4343
Key.purchaseFlowDisclaimerRussian.rawValue: NSString(string: Self.defaultPurchaseFlowDisclaimerRussian),
44-
Key.purchaseFlowDisclaimerEnglish.rawValue: NSString(string: Self.defaultPurchaseFlowDisclaimerEnglish)
44+
Key.purchaseFlowDisclaimerEnglish.rawValue: NSString(string: Self.defaultPurchaseFlowDisclaimerEnglish),
45+
Key.purchaseFlowPromoCodeEnabled.rawValue: NSNumber(value: false)
4546
]
4647

4748
var showStreaksNotificationTrigger: ShowStreaksNotificationTrigger {
@@ -121,6 +122,10 @@ The price includes commission from App Store and VAT. By paying for access to th
121122
}
122123
}
123124

125+
var isPurchaseFlowPromoCodeEnabled: Bool {
126+
self.getNSStringValueFromDelegateOrRemoteConfigForKey(.purchaseFlowPromoCodeEnabled)?.boolValue ?? false
127+
}
128+
124129
init(delegate: RemoteConfigDelegate? = nil) {
125130
self.delegate = delegate
126131

@@ -235,6 +240,7 @@ The price includes commission from App Store and VAT. By paying for access to th
235240
case purchaseFlow = "purchase_flow_ios"
236241
case purchaseFlowDisclaimerRussian = "purchase_flow_ios_disclaimer_ru"
237242
case purchaseFlowDisclaimerEnglish = "purchase_flow_ios_disclaimer_en"
243+
case purchaseFlowPromoCodeEnabled = "purchase_flow_ios_promocode_enabled"
238244

239245
var valueDataType: ValueDataType {
240246
switch self {
@@ -256,6 +262,8 @@ The price includes commission from App Store and VAT. By paying for access to th
256262
return .string
257263
case .purchaseFlowDisclaimerRussian, .purchaseFlowDisclaimerEnglish:
258264
return .string
265+
case .purchaseFlowPromoCodeEnabled:
266+
return .string
259267
}
260268
}
261269

Stepic/Sources/Modules/CourseInfoSubmodules/CourseInfoPurchaseModal/CourseInfoPurchaseModalAssembly.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ final class CourseInfoPurchaseModalAssembly: Assembly {
4141
iapService: IAPService.shared,
4242
analytics: StepikAnalytics.shared
4343
)
44-
let viewController = CourseInfoPurchaseModalViewController(interactor: interactor)
44+
let viewController = CourseInfoPurchaseModalViewController(
45+
interactor: interactor,
46+
isPromoCodeAvailable: RemoteConfig.shared.isPurchaseFlowPromoCodeEnabled
47+
)
4548

4649
presenter.viewController = viewController
4750
interactor.moduleOutput = self.moduleOutput

Stepic/Sources/Modules/CourseInfoSubmodules/CourseInfoPurchaseModal/CourseInfoPurchaseModalViewController.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ final class CourseInfoPurchaseModalViewController: PanModalPresentableViewContro
1616

1717
private var state: CourseInfoPurchaseModal.ViewControllerState
1818

19+
private let isPromoCodeAvailable: Bool
20+
1921
private var hasLoadedData: Bool {
2022
switch self.state {
2123
case .loading, .error:
@@ -69,10 +71,12 @@ final class CourseInfoPurchaseModalViewController: PanModalPresentableViewContro
6971

7072
init(
7173
interactor: CourseInfoPurchaseModalInteractorProtocol,
72-
initialState: CourseInfoPurchaseModal.ViewControllerState = .loading
74+
initialState: CourseInfoPurchaseModal.ViewControllerState = .loading,
75+
isPromoCodeAvailable: Bool
7376
) {
7477
self.interactor = interactor
7578
self.state = initialState
79+
self.isPromoCodeAvailable = isPromoCodeAvailable
7680
super.init()
7781
}
7882

@@ -82,7 +86,10 @@ final class CourseInfoPurchaseModalViewController: PanModalPresentableViewContro
8286
}
8387

8488
override func loadView() {
85-
let view = CourseInfoPurchaseModalView(frame: UIScreen.main.bounds)
89+
let view = CourseInfoPurchaseModalView(
90+
frame: UIScreen.main.bounds,
91+
isPromoCodeAvailable: self.isPromoCodeAvailable
92+
)
8693
self.view = view
8794
view.delegate = self
8895
}

Stepic/Sources/Modules/CourseInfoSubmodules/CourseInfoPurchaseModal/Views/CourseInfoPurchaseModalView.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ final class CourseInfoPurchaseModalView: UIView {
2929

3030
let appearance: Appearance
3131

32+
private let isPromoCodeAvailable: Bool
33+
3234
private lazy var headerView = CourseInfoPurchaseModalHeaderView()
3335

3436
private lazy var coverView = CourseInfoPurchaseModalCourseCoverView()
@@ -89,9 +91,12 @@ final class CourseInfoPurchaseModalView: UIView {
8991

9092
init(
9193
frame: CGRect = .zero,
92-
appearance: Appearance = Appearance()
94+
appearance: Appearance = Appearance(),
95+
isPromoCodeAvailable: Bool
9396
) {
9497
self.appearance = appearance
98+
self.isPromoCodeAvailable = isPromoCodeAvailable
99+
95100
super.init(frame: frame)
96101

97102
self.setupView()
@@ -244,7 +249,9 @@ extension CourseInfoPurchaseModalView: ProgrammaticallyInitializableViewProtocol
244249
strongSelf.delegate?.courseInfoPurchaseModalViewDidClickCloseButton(strongSelf)
245250
}
246251

247-
self.promoCodeView.delegate = self
252+
if self.isPromoCodeAvailable {
253+
self.promoCodeView.delegate = self
254+
}
248255

249256
self.disclaimerView.onLinkClick = { [weak self] link in
250257
guard let strongSelf = self else {
@@ -302,7 +309,9 @@ extension CourseInfoPurchaseModalView: ProgrammaticallyInitializableViewProtocol
302309

303310
self.scrollableStackView.addArrangedView(self.headerView)
304311
self.scrollableStackView.addArrangedView(self.coverView)
305-
self.scrollableStackView.addArrangedView(self.promoCodeView)
312+
if self.isPromoCodeAvailable {
313+
self.scrollableStackView.addArrangedView(self.promoCodeView)
314+
}
306315
self.scrollableStackView.addArrangedView(self.disclaimerView)
307316
self.scrollableStackView.addArrangedView(self.actionButtonsView)
308317
self.scrollableStackView.addArrangedView(self.purchaseErrorView)

StepicTests/Info-Develop.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>405</string>
22+
<string>406</string>
2323
</dict>
2424
</plist>

StepicTests/Info-Production.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>405</string>
22+
<string>406</string>
2323
</dict>
2424
</plist>

0 commit comments

Comments
 (0)