Skip to content

Commit

Permalink
Merge pull request #1153 from hyperskill/release/1.68
Browse files Browse the repository at this point in the history
Release 1.68
  • Loading branch information
ivan-magda authored Aug 19, 2024
2 parents 33d5125 + 9d9a4c5 commit cfc8353
Show file tree
Hide file tree
Showing 56 changed files with 630 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,16 @@ private class PaywallPreviewProvider : PreviewParameterProvider<ViewState> {
isToolbarVisible = true,
contentState = ViewStateContent.Content(
buyButtonText = PaywallPreviewDefaults.BUY_BUTTON_TEXT,
priceText = "$11.99 / month"
priceText = "$11.99 / month",
trialText = null
)
),
ViewState(
isToolbarVisible = false,
contentState = ViewStateContent.Content(
buyButtonText = PaywallPreviewDefaults.BUY_BUTTON_TEXT,
priceText = PaywallPreviewDefaults.PRICE_TEXT
priceText = PaywallPreviewDefaults.PRICE_TEXT,
trialText = null
)
),
ViewState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ abstract class DefaultStepQuizFragment :
is StepQuizFeature.Action.ViewAction.StepQuizCodeBlanksViewAction -> {
// no op
}
StepQuizFeature.Action.ViewAction.HighlightCallToActionButton -> {
// no op
}
StepQuizFeature.Action.ViewAction.UnhighlightCallToActionButton -> {
// no op
}
}
}

Expand Down
1 change: 1 addition & 0 deletions config/detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<ID>CyclomaticComplexMethod:ProfileReducer.kt$ProfileReducer$override fun reduce(state: State, message: Message): ReducerResult</ID>
<ID>CyclomaticComplexMethod:StepQuizActionDispatcher.kt$StepQuizActionDispatcher$override suspend fun doSuspendableAction(action: Action)</ID>
<ID>CyclomaticComplexMethod:StepQuizCodeBlanksReducer.kt$StepQuizCodeBlanksReducer$private fun handleDeleteButtonClicked( state: State ): StepQuizCodeBlanksReducerResult?</ID>
<ID>CyclomaticComplexMethod:StepQuizCodeBlanksReducer.kt$StepQuizCodeBlanksReducer$private fun handleSuggestionClicked( state: State, message: Message.SuggestionClicked ): StepQuizCodeBlanksReducerResult?</ID>
<ID>CyclomaticComplexMethod:StepQuizHintsReducer.kt$StepQuizHintsReducer$override fun reduce(state: State, message: Message): StepQuizHintsReducerResult</ID>
<ID>CyclomaticComplexMethod:StepQuizReducer.kt$StepQuizReducer$override fun reduce(state: State, message: Message): StepQuizReducerResult</ID>
<ID>CyclomaticComplexMethod:StepQuizReplyValidator.kt$StepQuizReplyValidator$fun validate(dataset: Dataset?, reply: Reply, stepBlockName: String): ReplyValidationResult</ID>
Expand Down
4 changes: 2 additions & 2 deletions gradle/app.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
minSdk = '24'
targetSdk = '34'
compileSdk = '34'
versionName = '1.67'
versionCode = '521'
versionName = '1.68'
versionCode = '527'
4 changes: 2 additions & 2 deletions iosHyperskillApp/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleVersion</key>
<string>548</string>
<string>555</string>
<key>CFBundleShortVersionString</key>
<string>1.67</string>
<string>1.68</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleExecutable</key>
Expand Down
16 changes: 8 additions & 8 deletions iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5657,7 +5657,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
GENERATE_INFOPLIST_FILE = NO;
Expand All @@ -5678,7 +5678,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = iosHyperskillAppUITests/Info.plist;
Expand All @@ -5699,7 +5699,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = iosHyperskillAppTests/Info.plist;
Expand All @@ -5720,7 +5720,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = iosHyperskillAppTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -5741,7 +5741,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
Expand Down Expand Up @@ -5770,7 +5770,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand Down Expand Up @@ -5916,7 +5916,7 @@
CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\"";
DEVELOPMENT_TEAM = UJ4KC2QN7B;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -5952,7 +5952,7 @@
CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 548;
CURRENT_PROJECT_VERSION = 555;
DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\"";
DEVELOPMENT_TEAM = UJ4KC2QN7B;
ENABLE_PREVIEWS = YES;
Expand Down
4 changes: 2 additions & 2 deletions iosHyperskillApp/iosHyperskillApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.67</string>
<string>1.68</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>548</string>
<string>555</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>FirebaseMessagingAutoInitEnabled</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum Strings {
static let gitHubAccount = sharedStrings.auth_github_account_text.localized()
static let appleAccount = sharedStrings.auth_apple_account_text.localized()
static let emailText = sharedStrings.auth_email_text.localized()
static let moreOptionsButton = sharedStrings.auth_more_options_btn.localized()
}

// MARK: Credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ final class AuthSocialViewModel: FeatureViewModel<

private let authSocialErrorMapper: AuthSocialErrorMapper

let availableSocialAuthProviders = SocialAuthProvider.allCases.filter(\.isSupported)

var authSocialErrorMessage: String? {
guard let errorState = state as? AuthSocialFeatureStateError else {
return nil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import SwiftUI

struct AuthSocialControlsView: View {
let socialAuthProviders: [SocialAuthProvider]
let isInSignUpMode: Bool

let errorMessage: String?

let isContinueWithEmailAvailable: Bool

let onSocialAuthProviderClick: ((SocialAuthProvider) -> Void)
let onContinueWithEmailClick: (() -> Void)

@State private var isShowingMoreOptions = false

private var socialAuthProviders: [SocialAuthProvider] {
let providers: [SocialAuthProvider] =
if isInSignUpMode {
isShowingMoreOptions ? [.google, .apple, .jetbrains, .github] : [.google, .apple]
} else {
[.jetbrains, .google, .github, .apple]
}
return providers.filter(\.isSupported)
}

var body: some View {
VStack(spacing: LayoutInsets.smallInset) {
ForEach(socialAuthProviders, id: \.rawValue) { provider in
Expand All @@ -26,7 +36,19 @@ struct AuthSocialControlsView: View {
AuthCredentialsErrorView(message: errorMessage)
}

if isContinueWithEmailAvailable {
if isInSignUpMode {
if !isShowingMoreOptions {
Button(
Strings.Auth.Social.moreOptionsButton,
action: {
withAnimation {
isShowingMoreOptions = true
}
}
)
.padding(.top)
}
} else {
Button(
Strings.Auth.Social.emailText,
action: onContinueWithEmailClick
Expand Down Expand Up @@ -69,18 +91,16 @@ struct AuthSocialControlsView_Previews: PreviewProvider {
static var previews: some View {
Group {
AuthSocialControlsView(
socialAuthProviders: SocialAuthProvider.allCases,
isInSignUpMode: false,
errorMessage: "Error message",
isContinueWithEmailAvailable: true,
onSocialAuthProviderClick: { _ in },
onContinueWithEmailClick: {}
)
.preferredColorScheme(.light)

AuthSocialControlsView(
socialAuthProviders: SocialAuthProvider.allCases,
isInSignUpMode: false,
errorMessage: "Error message",
isContinueWithEmailAvailable: true,
onSocialAuthProviderClick: { _ in },
onContinueWithEmailClick: {}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ struct AuthSocialView: View {
.padding(horizontalSizeClass == .regular ? .bottom : .vertical, appearance.logoWidthHeight)

AuthSocialControlsView(
socialAuthProviders: viewModel.availableSocialAuthProviders,
isInSignUpMode: isInSignUpMode,
errorMessage: viewModel.authSocialErrorMessage,
isContinueWithEmailAvailable: !isInSignUpMode,
onSocialAuthProviderClick: viewModel.signIn(with:),
onContinueWithEmailClick: {
viewModel.logClickedContinueWithEmailEvent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct PaywallContentView: View {
private(set) var appearance = Appearance()

let buyButtonText: String
let buyFootnoteText: String?

let onBuyButtonTap: () -> Void
let onTermsOfServiceButtonTap: () -> Void
Expand Down Expand Up @@ -56,6 +57,7 @@ struct PaywallContentView: View {
PaywallFooterView(
appearance: .init(spacing: appearance.interitemSpacing),
buyButtonText: buyButtonText,
buyFootnoteText: buyFootnoteText,
onBuyButtonTap: onBuyButtonTap,
onTermsOfServiceButtonTap: onTermsOfServiceButtonTap
)
Expand All @@ -67,6 +69,16 @@ struct PaywallContentView: View {
#Preview {
PaywallContentView(
buyButtonText: "Subscribe for $11.99/month",
buyFootnoteText: nil,
onBuyButtonTap: {},
onTermsOfServiceButtonTap: {}
)
}

#Preview {
PaywallContentView(
buyButtonText: "Subscribe for $11.99/month",
buyFootnoteText: "Then $11.99 per month",
onBuyButtonTap: {},
onTermsOfServiceButtonTap: {}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ import SwiftUI
extension PaywallFooterView {
struct Appearance {
var spacing = LayoutInsets.defaultInset
var interitemSpacing = LayoutInsets.smallInset
}
}

struct PaywallFooterView: View {
private(set) var appearance = Appearance()

let buyButtonText: String
let buyFootnoteText: String?

let onBuyButtonTap: () -> Void
let onTermsOfServiceButtonTap: () -> Void

private let feedbackGenerator = FeedbackGenerator(feedbackType: .selection)

var body: some View {
actionButtons
content
.padding()
.background(
TransparentBlurView()
Expand All @@ -26,17 +28,25 @@ struct PaywallFooterView: View {
.fixedSize(horizontal: false, vertical: true)
}

@MainActor private var actionButtons: some View {
@MainActor private var content: some View {
VStack(alignment: .center, spacing: appearance.spacing) {
Button(
buyButtonText,
action: {
feedbackGenerator.triggerFeedback()
onBuyButtonTap()
VStack(alignment: .center, spacing: appearance.interitemSpacing) {
Button(
buyButtonText,
action: {
feedbackGenerator.triggerFeedback()
onBuyButtonTap()
}
)
.buttonStyle(.primary)
.shineEffect()

if let buyFootnoteText {
Text(buyFootnoteText)
.font(.footnote.bold())
.foregroundColor(.newSecondaryText)
}
)
.buttonStyle(.primary)
.shineEffect()
}

Button(
Strings.Paywall.termsOfServiceButton,
Expand All @@ -56,12 +66,14 @@ struct PaywallFooterView: View {
VStack {
PaywallFooterView(
buyButtonText: "Subscribe for $11.99/month",
buyFootnoteText: nil,
onBuyButtonTap: {},
onTermsOfServiceButtonTap: {}
)

PaywallFooterView(
buyButtonText: "Subscribe for $11.99/month",
buyFootnoteText: "Then $11.99 per month",
onBuyButtonTap: {},
onTermsOfServiceButtonTap: {}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct PaywallView: View {
case .content(let content):
PaywallContentView(
buyButtonText: content.buyButtonText,
buyFootnoteText: content.trialText,
onBuyButtonTap: viewModel.doBuySubscription,
onTermsOfServiceButtonTap: viewModel.doTermsOfServicePresentation
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ struct StepQuizNameView: View {

var body: some View {
Text(text)
.font(.caption)
.foregroundColor(.tertiaryText)
.font(.headline)
.foregroundColor(.primaryText)
}
}

struct StepQuizTitleView_Previews: PreviewProvider {
static var previews: some View {
StepQuizNameView(text: "Select one option from the list")
.previewLayout(.sizeThatFits)
.padding()
}
#if DEBUG
#Preview {
StepQuizNameView(
text: "Select one option from the list"
)
.padding()
}
#endif
Loading

0 comments on commit cfc8353

Please sign in to comment.