Skip to content

Commit 0c86f75

Browse files
authored
Revert "Shared: Python adopted course selection (#1181)" (#1198)
^ALTAPPS-1361 This reverts commit c49c6f6.
1 parent 307d9fb commit 0c86f75

File tree

7 files changed

+12
-38
lines changed

7 files changed

+12
-38
lines changed

shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeatureKeys.kt

-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ internal object FeatureKeys {
1111
const val MOBILE_ONLY_SUBSCRIPTION = "mobile.mobile_only_subscription"
1212
const val MOBILE_USERS_INTERVIEW_WIDGET = "mobile.users_interview_widget"
1313
const val MOBILE_CONTENT_TRIAL = "mobile.content_trial"
14-
const val MOBILE_PYTHON_ADOPTED_COURSE = "mobile.python_adopted_course"
1514
}

shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeaturesMap.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,4 @@ val FeaturesMap.isMobileUsersInterviewWidgetEnabled: Boolean
3939
get() = get(FeatureKeys.MOBILE_USERS_INTERVIEW_WIDGET) ?: false
4040

4141
val FeaturesMap.isMobileContentTrialEnabled: Boolean
42-
get() = get(FeatureKeys.MOBILE_CONTENT_TRIAL) ?: false
43-
44-
val FeaturesMap.isMobilePythonAdoptedCourseEnabled: Boolean
45-
get() = get(FeatureKeys.MOBILE_PYTHON_ADOPTED_COURSE) ?: false
42+
get() = get(FeatureKeys.MOBILE_CONTENT_TRIAL) ?: false

shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/root/presentation/WelcomeOnboardingReducer.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ internal class WelcomeOnboardingReducer : StateReducer<State, Message, Action> {
8383
WelcomeQuestionnaireType.LEARNING_REASON ->
8484
NavigateTo.WelcomeOnboardingQuestionnaire(WelcomeQuestionnaireType.CODING_EXPERIENCE)
8585
WelcomeQuestionnaireType.CODING_EXPERIENCE ->
86-
// NavigateTo.ChooseProgrammingLanguage
87-
// ALTAPPS-1356: Redirect to Python track directly
88-
NavigateTo.TrackDetails(WelcomeOnboardingTrack.PYTHON)
86+
NavigateTo.ChooseProgrammingLanguage
8987
}
9088
)
9189

shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsComponentImpl.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ internal class WelcomeOnboardingTrackDetailsComponentImpl(
1717
currentProfileStateRepository = appGraph.profileDataComponent.currentProfileStateRepository,
1818
profileRepository = appGraph.profileDataComponent.profileRepository,
1919
analyticInteractor = appGraph.analyticComponent.analyticInteractor,
20-
featuresDataSource = appGraph.profileDataComponent.featuresDataSource,
2120
logger = appGraph.loggerComponent.logger,
2221
buildVariant = appGraph.commonComponent.buildKonfig.buildVariant,
23-
resourceProvider = appGraph.commonComponent.resourceProvider,
24-
platformType = appGraph.commonComponent.platform.platformType
22+
resourceProvider = appGraph.commonComponent.resourceProvider
2523
)
2624
}

shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsFeatureBuilder.kt

+2-13
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ import co.touchlab.kermit.Logger
44
import org.hyperskill.app.analytic.domain.interactor.AnalyticInteractor
55
import org.hyperskill.app.analytic.presentation.wrapWithAnalyticLogger
66
import org.hyperskill.app.core.domain.BuildVariant
7-
import org.hyperskill.app.core.domain.platform.PlatformType
87
import org.hyperskill.app.core.presentation.ActionDispatcherOptions
98
import org.hyperskill.app.core.presentation.transformState
109
import org.hyperskill.app.core.view.mapper.ResourceProvider
11-
import org.hyperskill.app.features.data.source.FeaturesDataSource
1210
import org.hyperskill.app.logging.presentation.wrapWithLogger
13-
import org.hyperskill.app.profile.domain.model.isMobilePythonAdoptedCourseEnabled
1411
import org.hyperskill.app.profile.domain.repository.CurrentProfileStateRepository
1512
import org.hyperskill.app.profile.domain.repository.ProfileRepository
1613
import org.hyperskill.app.welcome_onboarding.model.WelcomeOnboardingTrack
@@ -34,15 +31,10 @@ internal object WelcomeOnboardingTrackDetailsFeatureBuilder {
3431
currentProfileStateRepository: CurrentProfileStateRepository,
3532
profileRepository: ProfileRepository,
3633
analyticInteractor: AnalyticInteractor,
37-
featuresDataSource: FeaturesDataSource,
3834
resourceProvider: ResourceProvider,
3935
logger: Logger,
40-
buildVariant: BuildVariant,
41-
platformType: PlatformType
36+
buildVariant: BuildVariant
4237
): Feature<ViewState, Message, Action> {
43-
val isMobilePythonAdoptedCourseEnabled = platformType == PlatformType.IOS &&
44-
featuresDataSource.getFeaturesMap().isMobilePythonAdoptedCourseEnabled
45-
4638
val welcomeOnboardingTrackDetailsReducer =
4739
WelcomeOnboardingTrackDetailsReducer()
4840
.wrapWithLogger(buildVariant, logger, LOG_TAG)
@@ -57,10 +49,7 @@ internal object WelcomeOnboardingTrackDetailsFeatureBuilder {
5749
val viewStateMapper = WelcomeOnboardingTrackDetailsViewStateMapper(resourceProvider)
5850

5951
return ReduxFeature(
60-
initialState = WelcomeOnboardingTrackDetailsFeature.initialState(
61-
track = track,
62-
isMobilePythonAdoptedCourseEnabled = isMobilePythonAdoptedCourseEnabled
63-
),
52+
initialState = WelcomeOnboardingTrackDetailsFeature.initialState(track),
6453
reducer = welcomeOnboardingTrackDetailsReducer
6554
)
6655
.wrapWithActionDispatcher(welcomeOnboardingTrackDetailsActionDispatcher)

shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsFeature.kt

+3-8
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@ import org.hyperskill.app.welcome_onboarding.model.WelcomeOnboardingTrack
66
object WelcomeOnboardingTrackDetailsFeature {
77
internal data class State(
88
val track: WelcomeOnboardingTrack,
9-
val isLoadingShowed: Boolean,
10-
val isMobilePythonAdoptedCourseEnabled: Boolean
9+
val isLoadingShowed: Boolean
1110
)
1211

13-
internal fun initialState(
14-
track: WelcomeOnboardingTrack,
15-
isMobilePythonAdoptedCourseEnabled: Boolean
16-
) =
12+
internal fun initialState(track: WelcomeOnboardingTrack) =
1713
State(
1814
track = track,
19-
isLoadingShowed = false,
20-
isMobilePythonAdoptedCourseEnabled = isMobilePythonAdoptedCourseEnabled
15+
isLoadingShowed = false
2116
)
2217

2318
/**

shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsReducer.kt

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ internal class WelcomeOnboardingTrackDetailsReducer : StateReducer<State, Messag
2020
private const val JS_TRACK_ID = 32L
2121
private const val KOTLIN_TRACK_ID = 69L
2222
private const val PYTHON_TRACK_ID = 6L
23-
private const val PYTHON_TRACK_MOBILE_ADOPTED_ID = 139L
2423
private const val SQL_TRACK_ID = 31L
2524
}
2625

@@ -42,7 +41,7 @@ internal class WelcomeOnboardingTrackDetailsReducer : StateReducer<State, Messag
4241
InternalAction.LogAnalyticEvent(
4342
WelcomeOnboardingSelectTrackClickedHSAnalyticEvent(state.track)
4443
),
45-
InternalAction.SelectTrack(getTrackId(state))
44+
InternalAction.SelectTrack(getTrackId(state.track))
4645
)
4746

4847
private fun handleSelectTrackSuccess(state: State): WelcomeOnboardingTrackDetailsReducerResult =
@@ -51,13 +50,12 @@ internal class WelcomeOnboardingTrackDetailsReducer : StateReducer<State, Messag
5150
private fun handleSelectTrackFailed(state: State): WelcomeOnboardingTrackDetailsReducerResult =
5251
state.copy(isLoadingShowed = false) to setOf(Action.ViewAction.ShowTrackSelectionError)
5352

54-
private fun getTrackId(state: State): Long =
55-
when (state.track) {
53+
private fun getTrackId(track: WelcomeOnboardingTrack): Long =
54+
when (track) {
5655
WelcomeOnboardingTrack.JAVA -> JAVA_TRACK_ID
5756
WelcomeOnboardingTrack.JAVA_SCRIPT -> JS_TRACK_ID
5857
WelcomeOnboardingTrack.KOTLIN -> KOTLIN_TRACK_ID
59-
WelcomeOnboardingTrack.PYTHON ->
60-
if (state.isMobilePythonAdoptedCourseEnabled) PYTHON_TRACK_MOBILE_ADOPTED_ID else PYTHON_TRACK_ID
58+
WelcomeOnboardingTrack.PYTHON -> PYTHON_TRACK_ID
6159
WelcomeOnboardingTrack.SQL -> SQL_TRACK_ID
6260
}
6361
}

0 commit comments

Comments
 (0)