-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: pre-login mobile app exploration #139
feat: pre-login mobile app exploration #139
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #139 +/- ##
========================================
Coverage ? 0
========================================
Files ? 0
Lines ? 0
Branches ? 0
========================================
Hits ? 0
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. |
@saeedbashir please resolve the conflicts. |
Authorization/Authorization/Presentation/Startup/StartupViewModel.swift
Outdated
Show resolved
Hide resolved
de87866
to
38cbec7
Compare
@rnr @volodymyr-chekyrta Can you guys please review this PR? it's resulting in conflicts again and again. |
@@ -29,6 +30,20 @@ public struct SignInView: View { | |||
.resizable() | |||
.edgesIgnoringSafeArea(.top) | |||
}.frame(maxWidth: .infinity, maxHeight: 200) | |||
let config = Container.shared.resolve(ConfigProtocol.self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this break the Preview?
It would be better to pass dependencies to SignInView init or ViewModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, now using it from the viewModel
.
try? await interactor.logOut() | ||
router.showLoginScreen() | ||
analytics.userLogout(force: false) | ||
do { | ||
try await interactor.logOut() | ||
router.showStartupScreen() | ||
analytics.userLogout(force: false) | ||
} catch let error { | ||
if error.isInternetError { | ||
errorMessage = CoreLocalization.Error.slowOrNoInternetConnection | ||
} else { | ||
errorMessage = CoreLocalization.Error.unknownError | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to keep that logic; it's done on purpose.
We must ignore server response for logout for offline and deprecated version cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how this gets changed. I'd only change the method. Reverted the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Maybe some merge issue. idk
OpenEdX/View/MainScreenView.swift
Outdated
@@ -41,7 +41,7 @@ struct MainScreenView: View { | |||
var body: some View { | |||
TabView(selection: $selection) { | |||
ZStack { | |||
DiscoveryView(viewModel: Container.shared.resolve(DiscoveryViewModel.self)!) | |||
DiscoveryView(viewModel: Container.shared.resolve(DiscoveryViewModel.self)!, router: Container.shared.resolve(DiscoveryRouter.self)!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
133 Characters line.
We have to limit it to 80-120 characters.
Let's format it to
DiscoveryView(
viewModel: Container.shared.resolve(DiscoveryViewModel.self)!,
router: Container.shared.resolve(DiscoveryRouter.self)!
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are partially trying to follow this convention
https://google.github.io/swift/#function-calls
When a function call is line-wrapped, each argument is written on its own line.
I know we have places in the project with different formatting, but I hope to follow this one for all new written code.
Could you please format it to this style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, new XCode code formatting Control + M
also format code this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right; it's doing a bit too much 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But just the main point that I wanted to mention is
When a function call is line-wrapped, each argument is written on its own line.
@rnr @eyatsenkoperpetio FYI
Done |
I need a little more time for review; I have a few concerns, trying to understand them. @saeedbashir, could you please help me? Seems I'm missing something. |
@volodymyr-chekyrta It's because I'm building the whole flow so that when the user comes back from the search, the discovery will be there. |
Android appears to have adopted a similar flow, so is this a typical user experience expectation? |
Yes. |
Thank you, got it. I'll provide a few more comments based on this flow |
@@ -19,6 +19,7 @@ public class DiscoveryViewModel: ObservableObject { | |||
|
|||
@Published var courses: [CourseItem] = [] | |||
@Published var showError: Bool = false | |||
@Published var searchQuery: String? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@published is redundant here because this variable does not affect UI changes.
Btw, the DiscoveryViewModel doesn't use this; maybe we can move it to the DiscoveryView?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. moved to DiscoveryView.
Authorization/Authorization/Presentation/Startup/LogistrationBottomView.swift
Outdated
Show resolved
Hide resolved
@volodymyr-chekyrta I've made all the highlighted changes, It's ready for another pass. |
The code looks good to me 👍 When trying to enroll in a course, the user sees an error message. Simulator.Screen.Recording.-.iPhone.14.-.2023-11-30.at.11.04.04.mp4 |
We will be doing that in the second phase. In the second phase, we will be showing the I've added a note for second phase in the PR description. |
Got it, thank you! |
Sure, I've removed it. |
The last commit is from November 24, could you please make sure you pushed the new one? |
I've deleted it under this commit, 3d31b0c |
Description
This PR add's support for pre-login exploration.
Whats Added/Removed
Here is a screen recording of the feature.
startup.screen.mp4
Note: In the second phase we will be showing the Signin and Register buttons on the discovery and course about pages and handling the relevant edge cases, like Enroll button click will redirect the user to register screen if there won't be a session.