Skip to content

Commit

Permalink
fix: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanStepanok committed Dec 12, 2024
1 parent a3a9dac commit 0d4fdb8
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 28 deletions.
29 changes: 14 additions & 15 deletions Authorization/Authorization/Presentation/Login/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public struct SignInView: View {
.padding(.horizontal, 20)
.accessibilityIdentifier("signin_sso_heading")
}

Divider()

VStack(alignment: .center) {
Expand All @@ -192,9 +192,8 @@ public struct SignInView: View {
.accessibilityIdentifier("signin_sso_login_subtitle")
}
}

VStack(alignment: .center) {

if viewModel.isShowProgress {
HStack(alignment: .center) {
ProgressBar(size: 40, lineWidth: 8)
Expand All @@ -209,7 +208,8 @@ public struct SignInView: View {
action: {
viewModel.router
.showSSOWebBrowser(title: CoreLocalization.SignIn.logInBtn)
})
}
)
.frame(maxWidth: .infinity)
.padding(.top, 20)
.accessibilityIdentifier("signin_SSO_button")
Expand All @@ -219,15 +219,14 @@ public struct SignInView: View {
action: {
viewModel.router
.showSSOWebBrowser(title: CoreLocalization.SignIn.logInBtn)
},
color: .white,
textColor: Theme.Colors.accentColor,
borderColor: Theme.Colors.accentColor)
},
color: .white,
textColor: Theme.Colors.accentColor,
borderColor: Theme.Colors.accentColor)
.frame(maxWidth: .infinity)
.padding(.top, 20)
.accessibilityIdentifier("signin_SSO_button")
}

}
}
}
Expand Down Expand Up @@ -266,7 +265,7 @@ public struct SignInView: View {
.transition(.move(edge: .top))
.onAppear {
doAfter(Theme.Timeout.snackbarMessageLongTimeout) {
viewModel.alertMessage = nil
viewModel.alertMessage = nil
}
}
}
Expand All @@ -279,7 +278,7 @@ public struct SignInView: View {
}.transition(.move(edge: .bottom))
.onAppear {
doAfter(Theme.Timeout.snackbarMessageLongTimeout) {
viewModel.errorMessage = nil
viewModel.errorMessage = nil
}
}
}
Expand All @@ -291,12 +290,12 @@ public struct SignInView: View {
viewModel.trackScreenEvent()
}
}

@ViewBuilder
private var agreements: some View {
if let eulaURL = viewModel.config.agreement.eulaURL,
let tosURL = viewModel.config.agreement.tosURL,
let policy = viewModel.config.agreement.privacyPolicyURL {
let tosURL = viewModel.config.agreement.tosURL,
let policy = viewModel.config.agreement.privacyPolicyURL {
let text = AuthLocalization.SignIn.agreement(
"\(viewModel.config.platformName)",
eulaURL,
Expand All @@ -314,7 +313,7 @@ public struct SignInView: View {
.environment(\.openURL, OpenURLAction(handler: handleURL))
}
}

private func handleURL(_ url: URL) -> OpenURLAction.Result {
viewModel.router.showWebBrowser(title: "", url: url)
return .handled
Expand Down
2 changes: 1 addition & 1 deletion Core/Core/Configuration/Config/DiscoveryConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DiscoveryConfig: NSObject {
public let type: DiscoveryConfigType
public let webview: DiscoveryWebviewConfig
public var isWebViewConfigured: Bool {
return type == .webview && webview.baseURL != nil
type == .webview && webview.baseURL != nil
}

init(dictionary: [String: AnyObject]) {
Expand Down
2 changes: 1 addition & 1 deletion Core/Core/Data/Model/Data_Media.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public extension DataLayer {

public extension DataLayer.CourseMedia {
var domain: CourseMedia {
return CourseMedia(
CourseMedia(
image: CourseImage(
raw: image.raw,
small: image.small,
Expand Down
4 changes: 3 additions & 1 deletion Core/Core/View/Base/FlexibleKeyboardInputView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public struct FlexibleKeyboardInputView: View {
}
)
.onPreferenceChange(ViewSizePreferenceKey.self) { size in
commentSize = size.height
Task { @MainActor in
commentSize = size.height
}
}
.overlay(
TextEditor(text: $commentText)
Expand Down
8 changes: 4 additions & 4 deletions Course/Course.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
CE6386682D07219B00C01D69 /* CourseDateListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6386672D07219B00C01D69 /* CourseDateListView.swift */; };
CE63866A2D0721B600C01D69 /* CompletedBlocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6386692D0721B600C01D69 /* CompletedBlocks.swift */; };
CE63866C2D0721D600C01D69 /* BlockStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63866B2D0721D600C01D69 /* BlockStatusView.swift */; };
CE63866E2D07220600C01D69 /* StyleBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63866D2D07220600C01D69 /* StyleBlock.swift */; };
CE63866E2D07220600C01D69 /* CourseDateStyleBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63866D2D07220600C01D69 /* CourseDateStyleBlock.swift */; };
CE7CAF412CC1563500E0AC9D /* OEXFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = CE7CAF402CC1563500E0AC9D /* OEXFoundation */; };
CEB1E2732CC14EC400921517 /* OEXFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = CEB1E2722CC14EC400921517 /* OEXFoundation */; };
CEBCA4342CC13CDE00076589 /* YouTubePlayerKit in Frameworks */ = {isa = PBXBuildFile; productRef = CEBCA4332CC13CDE00076589 /* YouTubePlayerKit */; };
Expand Down Expand Up @@ -251,7 +251,7 @@
CE6386672D07219B00C01D69 /* CourseDateListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDateListView.swift; sourceTree = "<group>"; };
CE6386692D0721B600C01D69 /* CompletedBlocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletedBlocks.swift; sourceTree = "<group>"; };
CE63866B2D0721D600C01D69 /* BlockStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockStatusView.swift; sourceTree = "<group>"; };
CE63866D2D07220600C01D69 /* StyleBlock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyleBlock.swift; sourceTree = "<group>"; };
CE63866D2D07220600C01D69 /* CourseDateStyleBlock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDateStyleBlock.swift; sourceTree = "<group>"; };
DB205BFA2AE81B1200136EC2 /* CourseDateViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDateViewModelTests.swift; sourceTree = "<group>"; };
DB7D6EAB2ADFCAC40036BB13 /* CourseDatesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CourseDatesView.swift; sourceTree = "<group>"; };
DB7D6EAD2ADFCB4A0036BB13 /* CourseDatesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDatesViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -668,7 +668,7 @@
CE6386622D07215100C01D69 /* Elements */ = {
isa = PBXGroup;
children = (
CE63866D2D07220600C01D69 /* StyleBlock.swift */,
CE63866D2D07220600C01D69 /* CourseDateStyleBlock.swift */,
CE63866B2D0721D600C01D69 /* BlockStatusView.swift */,
CE6386692D0721B600C01D69 /* CompletedBlocks.swift */,
CE6386672D07219B00C01D69 /* CourseDateListView.swift */,
Expand Down Expand Up @@ -996,7 +996,7 @@
BAC0E0DB2B32F0AE006B68A9 /* CourseVideoDownloadBarViewModel.swift in Sources */,
DB7D6EAE2ADFCB4A0036BB13 /* CourseDatesViewModel.swift in Sources */,
067B7B522BED339200D1768F /* SubtitlesView.swift in Sources */,
CE63866E2D07220600C01D69 /* StyleBlock.swift in Sources */,
CE63866E2D07220600C01D69 /* CourseDateStyleBlock.swift in Sources */,
CE63866C2D0721D600C01D69 /* BlockStatusView.swift in Sources */,
02868AE52C19FE0B0003E339 /* DownloadActionView.swift in Sources */,
07DE59862BECB868001CBFBC /* CourseAnalytics.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct BlockStatusView: View {
HStack(alignment: .top) {
block.blockImage?.swiftUIImage
.foregroundColor(Theme.Colors.textPrimary)
StyleBlock(block: block, viewModel: viewModel)
CourseDateStyleBlock(block: block, viewModel: viewModel)
.padding(.bottom, 15)
Spacer()
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct CompletedBlocks: View {
HStack(alignment: .top) {
block.blockImage?.swiftUIImage
.foregroundColor(Theme.Colors.textPrimary)
StyleBlock(block: block, viewModel: viewModel)
CourseDateStyleBlock(block: block, viewModel: viewModel)
.padding(.bottom, 15)
Spacer()
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// StyleBlock.swift
// CourseDateStyleBlock.swift
// Course
//
// Created by Ivan Stepanok on 09.12.2024.
Expand All @@ -9,7 +9,7 @@ import SwiftUI
import Core
import Theme

struct StyleBlock: View {
struct CourseDateStyleBlock: View {
let block: CourseDateBlock
let viewModel: CourseDatesViewModel

Expand Down
6 changes: 4 additions & 2 deletions OpenEdX/DI/ScreenAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ class ScreenAssembly: Assembly {
router.currentCourseTabSelection
)!
)
})
}
)

container.register(
EncodedVideoPlayerViewModel.self,
Expand Down Expand Up @@ -438,7 +439,8 @@ class ScreenAssembly: Assembly {
connectivity: r.resolve(ConnectivityProtocol.self)!,
playerHolder: holder
)
})
}
)

container.register(PlayerDelegateProtocol.self) { r in
PlayerDelegate(pipManager: r.resolve(PipManagerProtocol.self)!)
Expand Down

0 comments on commit 0d4fdb8

Please sign in to comment.