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

Develop to master v1.3 #79

Merged
merged 19 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
32 changes: 16 additions & 16 deletions Authorization/Authorization.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -611,7 +611,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -694,7 +694,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -721,7 +721,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -739,7 +739,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -757,7 +757,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -775,7 +775,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -793,7 +793,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -811,7 +811,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -829,7 +829,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L8PG7LC3Y3;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openedx.AuthorizationTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -918,7 +918,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1011,7 +1011,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1109,7 +1109,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1202,7 +1202,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1358,7 +1358,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1393,7 +1393,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct FieldsView: View {
type: .discovery,
fontSize: 90, screenWidth: proxy.size.width)
)
.id(UUID())
.padding(.horizontal, -6)

case .unknown:
Expand Down
33 changes: 18 additions & 15 deletions Authorization/Authorization/Presentation/Login/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ public struct SignInView: View {
VStack(alignment: .leading) {
Text(AuthLocalization.SignIn.logInTitle)
.font(Theme.Fonts.displaySmall)
.foregroundColor(CoreAssets.textPrimary.swiftUIColor)
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 4)
Text(AuthLocalization.SignIn.welcomeBack)
.font(Theme.Fonts.titleSmall)
.foregroundColor(CoreAssets.textPrimary.swiftUIColor)
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 20)

Text(AuthLocalization.SignIn.email)
.font(Theme.Fonts.labelLarge)
.foregroundColor(CoreAssets.textPrimary.swiftUIColor)
.foregroundColor(Theme.Colors.textPrimary)
TextField(AuthLocalization.SignIn.email, text: $email)
.keyboardType(.emailAddress)
.textContentType(.emailAddress)
Expand All @@ -57,42 +57,42 @@ public struct SignInView: View {
.padding(.all, 14)
.background(
Theme.Shapes.textInputShape
.fill(CoreAssets.textInputBackground.swiftUIColor)
.fill(Theme.Colors.textInputBackground)
)
.overlay(
Theme.Shapes.textInputShape
.stroke(lineWidth: 1)
.fill(CoreAssets.textInputStroke.swiftUIColor)
.fill(Theme.Colors.textInputStroke)
)

Text(AuthLocalization.SignIn.password)
.font(Theme.Fonts.labelLarge)
.foregroundColor(CoreAssets.textPrimary.swiftUIColor)
.foregroundColor(Theme.Colors.textPrimary)
.padding(.top, 18)
SecureField(AuthLocalization.SignIn.password, text: $password)
.padding(.all, 14)
.background(
Theme.Shapes.textInputShape
.fill(CoreAssets.textInputBackground.swiftUIColor)
.fill(Theme.Colors.textInputBackground)
)
.overlay(
Theme.Shapes.textInputShape
.stroke(lineWidth: 1)
.fill(CoreAssets.textInputStroke.swiftUIColor)
.fill(Theme.Colors.textInputStroke)
)

HStack {
Button(AuthLocalization.SignIn.registerBtn) {
viewModel.analytics.signUpClicked()
viewModel.trackSignUpClicked()
viewModel.router.showRegisterScreen()
}.foregroundColor(CoreAssets.accentColor.swiftUIColor)
}.foregroundColor(Theme.Colors.accentColor)

Spacer()

Button(AuthLocalization.SignIn.forgotPassBtn) {
viewModel.analytics.forgotPasswordClicked()
viewModel.trackForgotPasswordClicked()
viewModel.router.showForgotPasswordScreen()
}.foregroundColor(CoreAssets.accentColor.swiftUIColor)
}.foregroundColor(Theme.Colors.accentColor)
}
.padding(.top, 10)
if viewModel.isShowProgress {
Expand All @@ -113,7 +113,7 @@ public struct SignInView: View {
}
.padding(.horizontal, 24)
.padding(.top, 50)
}.roundedBackground(CoreAssets.background.swiftUIColor)
}.roundedBackground(Theme.Colors.background)
.scrollAvoidKeyboard(dismissKeyboardByTap: true)

}
Expand All @@ -122,7 +122,7 @@ public struct SignInView: View {
if viewModel.showAlert {
VStack {
Text(viewModel.alertMessage ?? "")
.shadowCardStyle(bgColor: CoreAssets.accentColor.swiftUIColor,
.shadowCardStyle(bgColor: Theme.Colors.accentColor,
textColor: .white)
.padding(.top, 80)
Spacer()
Expand All @@ -149,7 +149,10 @@ public struct SignInView: View {
}
}
}
.background(CoreAssets.background.swiftUIColor.ignoresSafeArea(.all))
.hideNavigationBar()
.navigationBarBackButtonHidden(true)
.navigationBarHidden(true)
.background(Theme.Colors.background.ignoresSafeArea(.all))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,24 @@ public class SignInViewModel: ObservableObject {
}
}

private let interactor: AuthInteractorProtocol
let router: AuthorizationRouter
let analytics: AuthorizationAnalytics

private let interactor: AuthInteractorProtocol
private let analytics: AuthorizationAnalytics
private let validator: Validator

public init(interactor: AuthInteractorProtocol,
router: AuthorizationRouter,
analytics: AuthorizationAnalytics,
validator: Validator) {
public init(
interactor: AuthInteractorProtocol,
router: AuthorizationRouter,
analytics: AuthorizationAnalytics,
validator: Validator
) {
self.interactor = interactor
self.router = router
self.analytics = analytics
self.validator = validator
}

@MainActor
func login(username: String, password: String) async {
guard validator.isValidEmail(username) else {
Expand Down Expand Up @@ -76,4 +79,12 @@ public class SignInViewModel: ObservableObject {
}
}
}

func trackSignUpClicked() {
analytics.signUpClicked()
}

func trackForgotPasswordClicked() {
analytics.forgotPasswordClicked()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SignUpView.swift
// Authorization
//
// Created by  Stepanok Ivan on 24.10.2022.
// Created by Stepanok Ivan on 24.10.2022.
//

import SwiftUI
Expand Down Expand Up @@ -43,12 +43,11 @@ public struct SignUpView: View {
CoreAssets.arrowLeft.swiftUIImage.renderingMode(.template)
.backButtonStyle(color: .white)
})
.foregroundColor(CoreAssets.styledButtonText.swiftUIColor)
.foregroundColor(Theme.Colors.styledButtonText)

}.frame(minWidth: 0,
maxWidth: .infinity,
alignment: .topLeading)
.frameLimit()
}

GeometryReader { proxy in
Expand All @@ -58,11 +57,11 @@ public struct SignUpView: View {

Text(AuthLocalization.SignUp.title)
.font(Theme.Fonts.displaySmall)
.foregroundColor(CoreAssets.textPrimary.swiftUIColor)
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 4)
Text(AuthLocalization.SignUp.subtitle)
.font(Theme.Fonts.titleSmall)
.foregroundColor(CoreAssets.textPrimary.swiftUIColor)
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 20)

let requiredFields = viewModel.fields.filter {$0.field.required}
Expand All @@ -80,7 +79,7 @@ public struct SignUpView: View {
router: viewModel.router,
configuration: viewModel.config,
cssInjector: viewModel.cssInjector,
proxy: proxy)
proxy: proxy).padding(.horizontal, 1)
}, label: {
Text(disclosureGroupOpen
? AuthLocalization.SignUp.hideFields
Expand All @@ -96,9 +95,9 @@ public struct SignUpView: View {
} else {
StyledButton(AuthLocalization.SignUp.createAccountBtn) {
Task {
viewModel.analytics.createAccountClicked()
await viewModel.registerUser()
}
viewModel.trackCreateAccountClicked()
}
.padding(.top, 40)
.padding(.bottom, 80)
Expand All @@ -109,7 +108,7 @@ public struct SignUpView: View {
.padding(.horizontal, 24)
.padding(.top, 24)

}.roundedBackground(CoreAssets.background.swiftUIColor)
}.roundedBackground(Theme.Colors.background)
.onRightSwipeGesture {
viewModel.router.back()
}
Expand All @@ -136,7 +135,8 @@ public struct SignUpView: View {
}
}
}
.background(CoreAssets.background.swiftUIColor.ignoresSafeArea(.all))
.background(Theme.Colors.background.ignoresSafeArea(.all))
.hideNavigationBar()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class SignUpViewModel: ObservableObject {
@Published var fields: [FieldConfiguration] = []

let router: AuthorizationRouter
let analytics: AuthorizationAnalytics
let config: Config
let cssInjector: CSSInjector

private let interactor: AuthInteractorProtocol
private let analytics: AuthorizationAnalytics
private let validator: Validator

public init(
Expand Down Expand Up @@ -106,4 +106,8 @@ public class SignUpViewModel: ObservableObject {
}
}
}

func trackCreateAccountClicked() {
analytics.createAccountClicked()
}
}
Loading