Skip to content

Commit

Permalink
Merge pull request openedx#450 from saeedbashir/saeed/fixes
Browse files Browse the repository at this point in the history
fix: APIs path and archive fix
  • Loading branch information
saeedbashir authored Jun 7, 2024
2 parents d380551 + a4a85d5 commit 0933ddd
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 51 deletions.
4 changes: 2 additions & 2 deletions Core/Core/Network/AuthEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ enum AuthEndpoint: EndPointType {
case .getAuthCookies:
return "/oauth2/login/"
case .getRegisterFields:
return "user_api/v1/account/registration/"
return "/user_api/v1/account/registration/"
case .registerUser:
return "user_api/v1/account/registration/"
return "/user_api/v1/account/registration/"
case .validateRegistrationFields:
return "/api/user/v1/validation/registration"
case .resetPassword:
Expand Down
38 changes: 20 additions & 18 deletions Course/Course/Presentation/Video/PlayerViewControllerHolder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,25 @@ public class PlayerViewControllerHolder: PlayerViewControllerHolderProtocol {
}
}

extension AVPlayerViewController: PlayerControllerProtocol {
public func play() {
player?.play()
}

public func pause() {
player?.pause()
}

public func seekTo(to date: Date) {
player?.seek(to: date)
}

public func stop() {
player?.replaceCurrentItem(with: nil)
}
}

#if DEBUG
extension PlayerViewControllerHolder {
static var mock: PlayerViewControllerHolder {
PlayerViewControllerHolder(
Expand All @@ -198,21 +217,4 @@ extension PlayerViewControllerHolder {
)
}
}

extension AVPlayerViewController: PlayerControllerProtocol {
public func play() {
player?.play()
}

public func pause() {
player?.pause()
}

public func seekTo(to date: Date) {
player?.seek(to: date)
}

public func stop() {
player?.replaceCurrentItem(with: nil)
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -140,27 +140,6 @@ public class YoutubePlayerViewControllerHolder: PlayerViewControllerHolderProtoc
}
}

extension YoutubePlayerViewControllerHolder {
static var mock: YoutubePlayerViewControllerHolder {
YoutubePlayerViewControllerHolder(
url: URL(string: "")!,
blockID: "",
courseID: "",
selectedCourseTab: 0,
videoResolution: .zero,
pipManager: PipManagerProtocolMock(),
playerTracker: PlayerTrackerProtocolMock(url: URL(string: "")),
playerDelegate: nil,
playerService: PlayerService(
courseID: "",
blockID: "",
interactor: CourseInteractor.mock,
router: CourseRouterMock()
)
)
}
}

extension YouTubePlayer: PlayerControllerProtocol {
public func play() {
self.play(completion: nil)
Expand All @@ -181,3 +160,26 @@ extension YouTubePlayer: PlayerControllerProtocol {
self.stop(completion: nil)
}
}

#if DEBUG
extension YoutubePlayerViewControllerHolder {
static var mock: YoutubePlayerViewControllerHolder {
YoutubePlayerViewControllerHolder(
url: URL(string: "")!,
blockID: "",
courseID: "",
selectedCourseTab: 0,
videoResolution: .zero,
pipManager: PipManagerProtocolMock(),
playerTracker: PlayerTrackerProtocolMock(url: URL(string: "")),
playerDelegate: nil,
playerService: PlayerService(
courseID: "",
blockID: "",
interactor: CourseInteractor.mock,
router: CourseRouterMock()
)
)
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct CategoryFilterView: View {
Text(option.text)
.font(Theme.Fonts.titleSmall)
.foregroundColor(
option == selectedOption ? Theme.Colors.white : (
option == selectedOption ? Theme.Colors.slidingSelectedTextColor : (
colorScheme == .light ? Theme.Colors.accentColor : .white
)
)
Expand Down
14 changes: 8 additions & 6 deletions Dashboard/Dashboard/Presentation/Elements/PrimaryCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ public struct PrimaryCardView: View {
.renderingMode(.template)
.resizable()
.frame(width: 24, height: 24)
.foregroundStyle(
selected ? Theme.Colors.white : Theme.Colors.textPrimary
)
.foregroundStyle(foregroundColor(selected))
.padding(12)

VStack(alignment: .leading, spacing: 6) {
Expand All @@ -190,20 +188,20 @@ public struct PrimaryCardView: View {
.font(Theme.Fonts.labelSmall)
.multilineTextAlignment(.leading)
.lineLimit(1)
.foregroundStyle(selected ? Theme.Colors.white : Theme.Colors.textPrimary)
.foregroundStyle(foregroundColor(selected))
}
Text(title)
.font(Theme.Fonts.titleSmall)
.multilineTextAlignment(.leading)
.lineLimit(1)
.foregroundStyle(selected ? Theme.Colors.white : Theme.Colors.textPrimary)
.foregroundStyle(foregroundColor(selected))
}
.padding(.top, 2)
}
}
Spacer()
CoreAssets.chevronRight.swiftUIImage
.foregroundStyle(selected ? Theme.Colors.white : Theme.Colors.textPrimary)
.foregroundStyle(foregroundColor(selected))
.padding(8)
}
.padding(.top, 8)
Expand All @@ -212,6 +210,10 @@ public struct PrimaryCardView: View {
})
}

private func foregroundColor(_ selected: Bool) -> SwiftUI.Color {
return selected ? Theme.Colors.primaryButtonTextColor : Theme.Colors.textPrimary
}

private var courseBanner: some View {
return KFImage(URL(string: courseImage))
.onFailureImage(CoreAssets.noCourseImage.image)
Expand Down
6 changes: 3 additions & 3 deletions Profile/Profile/Data/Network/ProfileEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ enum ProfileEndpoint: EndPointType {
var path: String {
switch self {
case .getUserProfile(let username):
return "api/user/v1/accounts/\(username)"
return "/api/user/v1/accounts/\(username)"
case .logOut:
return "oauth2/revoke_token/"
return "/oauth2/revoke_token/"
case let .updateUserProfile(username, _):
return "api/user/v1/accounts/\(username)"
return "/api/user/v1/accounts/\(username)"
case let .uploadProfilePicture(username, _):
return "/api/user/v1/accounts/\(username)/image"
case .deleteProfilePicture(username: let username):
Expand Down

0 comments on commit 0933ddd

Please sign in to comment.