-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
<!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation Fix Part of #4938: Configure profile new creation and migration of existing profiles. ## When Onboarding V2 is Enabled: ### Sole Learner Onboarding Once the learner has created a profile, and have landed on the introduction screen, the profile is marked as `started_profile_oboarding`, and a corresponding event log is added. This configuration facilitates the user resuming onboarding, if they didn't complete it the first time round. After selecting the audio language, the profile is logged in, and routed to the home screen. On the home screen, the profile is updated to indicate `completed_profile_oboarding` and 3 events are expected for the first time login flow, in order: 1. Open home event 2. Profile Onboarding Completed event 3. App Onboarding Completed event The App Onboarding Completed event is only logged for the first profile on the device, while the Profile Onboarding Completed event is logged for every profile on first login. ### Supervisor Profile Onboarding From the Profile Type screen, the supervisor flow launches the profile chooser screen, showing the Admin profile, which on click launches the homescreen. The same 3 events as above are expected for the first time login flow. ### Login Routing Returning users should be routed to an appropriate landing page as follows: A sole learner profile will be routed directly to their home screen Returning admin profiles and non-solo learner profiles will always be routed to the profile selection screen A sole learner who started, but did not finish onboarding would be routed to the Introduction Screen. Returning sole and none-sole learners created when the feature flag was disabled, would be directed to the onboarding screen. Profile migration happens in place when profiles are fetched by the controller. ### Profile Creation and Migration For migration purposes, the `getProfile()` function has been updated to compute the `profileType` field when the feature flag is enabled. Existing Admin profiles will be migrated to have the SUPERVISOR type, existing Admin profiles with no pins set will be migrated to have the SOLE_LEARNER type while the remaining accounts will be of the ADDITIONAL_LEARNER type. New profiles created will also contain the respective enum type based on the intended categorization. Flag off then on: [device-2024-06-21-073957.webm](https://github.com/oppia/oppia-android/assets/59600948/7584ce32-305b-4743-878e-64c94dc52e66) Flag on then off: [device-2024-06-21-074114.webm](https://github.com/oppia/oppia-android/assets/59600948/87860084-c75c-4b6c-a37f-c2459a3e7794) ### Misc - There are general Kdoc formatting fixes all over the place. - `ProfileTestHelper` Has been modified to create a sole, pinless admin profile. - There are other minor changes to fix tests that have been impacted by changes in this PR. - The changes in `DeprecationController` are purely visual to make the code more readable. - `ClassroomListFragmentTest` required refactor to support toggling multiple feature flags. ### Profile Onboarding Events |Onborading Flow v1| Onboarding Flow v2| |---|---| |<img src="https://github.com/oppia/oppia-android/assets/59600948/990c1c0a-ce71-4685-b986-bb4396ce28e6" width="350">|<img src="https://github.com/oppia/oppia-android/assets/59600948/c5eca79b-36d9-4a9c-a685-e0d7df3c399a" width="350">| ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). --------- Co-authored-by: Ben Henning <[email protected]>
- Loading branch information
1 parent
2f68639
commit 2eeec89
Showing
46 changed files
with
2,212 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/java/org/oppia/android/app/home/ExitProfileListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.oppia.android.app.home | ||
|
||
import org.oppia.android.app.model.ProfileType | ||
|
||
/** Listener for when a user wishes to exit their profile. */ | ||
interface ExitProfileListener { | ||
/** | ||
* Called when back press is clicked on the HomeScreen. | ||
* | ||
* Routing behaviour may change based on [ProfileType] | ||
*/ | ||
fun exitProfile(profileType: ProfileType) | ||
} |
Oops, something went wrong.