diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml
index c76142ec81..060397f705 100644
--- a/config/detekt/baseline.xml
+++ b/config/detekt/baseline.xml
@@ -72,7 +72,6 @@
LongMethod:StepQuizCodeBlanksReducer.kt$StepQuizCodeBlanksReducer$private fun handleSuggestionClicked( state: State, message: Message.SuggestionClicked ): StepQuizCodeBlanksReducerResult?
LongMethod:StepQuizCodeBlanksViewStateMapper.kt$StepQuizCodeBlanksViewStateMapper$private fun mapContentState( state: StepQuizCodeBlanksFeature.State.Content ): StepQuizCodeBlanksViewState.Content
LongMethod:StreakFreezeDialogFragment.kt$StreakFreezeDialogFragment$override fun onViewCreated(view: View, savedInstanceState: Bundle?)
- LongMethod:StudyPlanWidgetReducer.kt$StudyPlanWidgetReducer$private fun handleLearningActivitiesWithSectionsFetchSuccess( state: State, message: StudyPlanWidgetFeature.LearningActivitiesWithSectionsFetchResult.Success ): StudyPlanWidgetReducerResult
LongMethod:TrackProgressContent.kt$@Composable fun TrackProgressContent( viewState: ProgressScreenViewState.TrackProgressViewState.Content, onNewMessage: (ProgressScreenFeature.Message) -> Unit, modifier: Modifier = Modifier )
LongParameterList:AppInteractor.kt$AppInteractor$( private val appRepository: AppRepository, private val authInteractor: AuthInteractor, private val currentProfileStateRepository: CurrentProfileStateRepository, private val userStorageInteractor: UserStorageInteractor, private val analyticInteractor: AnalyticInteractor, private val progressesRepository: ProgressesRepository, private val trackRepository: TrackRepository, private val providersRepository: ProvidersRepository, private val projectsRepository: ProjectsRepository, private val shareStreakRepository: ShareStreakRepository, private val pushNotificationsInteractor: PushNotificationsInteractor )
LongParameterList:AuthRemoteDataSourceImpl.kt$AuthRemoteDataSourceImpl$( private val authCacheMutex: Mutex, private val deauthorizationFlow: Flow<UserDeauthorized>, private val authSocialHttpClient: HttpClient, private val authCredentialsHttpClient: HttpClient, private val networkEndpointConfigInfo: NetworkEndpointConfigInfo, private val json: Json, private val settings: Settings )
diff --git a/gradle/app.versions.toml b/gradle/app.versions.toml
index 3d8a5fd06a..29ca6efb62 100644
--- a/gradle/app.versions.toml
+++ b/gradle/app.versions.toml
@@ -2,5 +2,5 @@
minSdk = '24'
targetSdk = '34'
compileSdk = '34'
-versionName = '1.73'
-versionCode = '567'
\ No newline at end of file
+versionName = '1.74'
+versionCode = '570'
\ No newline at end of file
diff --git a/iosHyperskillApp/NotificationServiceExtension/Info.plist b/iosHyperskillApp/NotificationServiceExtension/Info.plist
index cd24d2595f..e1ccaf77c7 100644
--- a/iosHyperskillApp/NotificationServiceExtension/Info.plist
+++ b/iosHyperskillApp/NotificationServiceExtension/Info.plist
@@ -9,9 +9,9 @@
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleVersion
- 594
+ 597
CFBundleShortVersionString
- 1.73
+ 1.74
CFBundlePackageType
$(PRODUCT_BUNDLE_PACKAGE_TYPE)
CFBundleExecutable
diff --git a/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj b/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj
index 565915c2a5..cf1c9052e6 100644
--- a/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj
+++ b/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj
@@ -5821,7 +5821,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
GENERATE_INFOPLIST_FILE = NO;
@@ -5842,7 +5842,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = iosHyperskillAppUITests/Info.plist;
@@ -5863,7 +5863,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = iosHyperskillAppTests/Info.plist;
@@ -5884,7 +5884,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = iosHyperskillAppTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -5905,7 +5905,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
@@ -5934,7 +5934,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -6080,7 +6080,7 @@
CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\"";
DEVELOPMENT_TEAM = UJ4KC2QN7B;
ENABLE_PREVIEWS = YES;
@@ -6116,7 +6116,7 @@
CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 594;
+ CURRENT_PROJECT_VERSION = 597;
DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\"";
DEVELOPMENT_TEAM = UJ4KC2QN7B;
ENABLE_PREVIEWS = YES;
diff --git a/iosHyperskillApp/iosHyperskillApp/Info.plist b/iosHyperskillApp/iosHyperskillApp/Info.plist
index dbf4e37ac4..d3c4fe4160 100644
--- a/iosHyperskillApp/iosHyperskillApp/Info.plist
+++ b/iosHyperskillApp/iosHyperskillApp/Info.plist
@@ -21,7 +21,7 @@
CFBundlePackageType
$(PRODUCT_BUNDLE_PACKAGE_TYPE)
CFBundleShortVersionString
- 1.73
+ 1.74
CFBundleURLTypes
@@ -34,7 +34,7 @@
CFBundleVersion
- 594
+ 597
FirebaseAppDelegateProxyEnabled
FirebaseMessagingAutoInitEnabled
diff --git a/iosHyperskillApp/iosHyperskillApp/Sources/Extensions/SwiftUI/View/View+OnTapWhenDisabled.swift b/iosHyperskillApp/iosHyperskillApp/Sources/Extensions/SwiftUI/View/View+OnTapWhenDisabled.swift
index 0ffff80350..484584dd61 100644
--- a/iosHyperskillApp/iosHyperskillApp/Sources/Extensions/SwiftUI/View/View+OnTapWhenDisabled.swift
+++ b/iosHyperskillApp/iosHyperskillApp/Sources/Extensions/SwiftUI/View/View+OnTapWhenDisabled.swift
@@ -15,31 +15,31 @@ extension View {
}
}
-#if DEBUG
-@available(iOS 17.0, *)
-#Preview {
- @Previewable @State var isButtonDisabled = true
-
- VStack {
- Button(
- action: {
- print("Button tapped!")
- },
- label: {
- Text("Submit")
- .padding()
- .background(isButtonDisabled ? Color.gray : Color.blue)
- .foregroundColor(.white)
- .cornerRadius(8)
- }
- )
- .disabled(isButtonDisabled)
- .onTapWhenDisabled(isDisabled: isButtonDisabled) {
- print("Button is disabled!")
- }
-
- Toggle("Disable View", isOn: $isButtonDisabled)
- .padding()
- }
-}
-#endif
+// #if DEBUG
+// @available(iOS 17.0, *)
+// #Preview {
+// @Previewable @State var isButtonDisabled = true
+//
+// VStack {
+// Button(
+// action: {
+// print("Button tapped!")
+// },
+// label: {
+// Text("Submit")
+// .padding()
+// .background(isButtonDisabled ? Color.gray : Color.blue)
+// .foregroundColor(.white)
+// .cornerRadius(8)
+// }
+// )
+// .disabled(isButtonDisabled)
+// .onTapWhenDisabled(isDisabled: isButtonDisabled) {
+// print("Button is disabled!")
+// }
+//
+// Toggle("Disable View", isOn: $isButtonDisabled)
+// .padding()
+// }
+// }
+// #endif
diff --git a/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/BounceEffect.swift b/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/BounceEffect.swift
index 333a2765c6..1409ff05db 100644
--- a/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/BounceEffect.swift
+++ b/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/BounceEffect.swift
@@ -29,18 +29,18 @@ extension View {
}
}
-#if DEBUG
-@available(iOS 17.0, *)
-#Preview {
- @Previewable @State var isBouncing = false
-
- Button {
- isBouncing.toggle()
- } label: {
- Text("Retry")
- }
- .buttonStyle(RoundedRectangleButtonStyle(style: .violet))
- .bounceEffect(isActive: isBouncing)
- .padding()
-}
-#endif
+// #if DEBUG
+// @available(iOS 17.0, *)
+// #Preview {
+// @Previewable @State var isBouncing = false
+//
+// Button {
+// isBouncing.toggle()
+// } label: {
+// Text("Retry")
+// }
+// .buttonStyle(RoundedRectangleButtonStyle(style: .violet))
+// .bounceEffect(isActive: isBouncing)
+// .padding()
+// }
+// #endif
diff --git a/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/JiggleEffect.swift b/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/JiggleEffect.swift
index 14fe2b9471..1b0020f478 100644
--- a/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/JiggleEffect.swift
+++ b/iosHyperskillApp/iosHyperskillApp/Sources/Views/SwiftUI/Effects/JiggleEffect.swift
@@ -39,18 +39,18 @@ extension View {
}
}
-#if DEBUG
-@available(iOS 17.0, *)
-#Preview {
- @Previewable @State var isJiggling = false
-
- Button {
- isJiggling.toggle()
- } label: {
- Text("Retry")
- }
- .buttonStyle(RoundedRectangleButtonStyle(style: .violet))
- .jiggleEffect(amount: 2, isActive: isJiggling)
- .padding()
-}
-#endif
+// #if DEBUG
+// @available(iOS 17.0, *)
+// #Preview {
+// @Previewable @State var isJiggling = false
+//
+// Button {
+// isJiggling.toggle()
+// } label: {
+// Text("Retry")
+// }
+// .buttonStyle(RoundedRectangleButtonStyle(style: .violet))
+// .jiggleEffect(amount: 2, isActive: isJiggling)
+// .padding()
+// }
+// #endif
diff --git a/iosHyperskillApp/iosHyperskillAppTests/Info.plist b/iosHyperskillApp/iosHyperskillAppTests/Info.plist
index 629164e755..7cf90c84ef 100644
--- a/iosHyperskillApp/iosHyperskillAppTests/Info.plist
+++ b/iosHyperskillApp/iosHyperskillAppTests/Info.plist
@@ -13,8 +13,8 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 1.73
+ 1.74
CFBundleVersion
- 594
+ 597
diff --git a/iosHyperskillApp/iosHyperskillAppUITests/Info.plist b/iosHyperskillApp/iosHyperskillAppUITests/Info.plist
index bc2056bf42..22b89a926a 100644
--- a/iosHyperskillApp/iosHyperskillAppUITests/Info.plist
+++ b/iosHyperskillApp/iosHyperskillAppUITests/Info.plist
@@ -13,8 +13,8 @@
CFBundlePackageType
$(PRODUCT_BUNDLE_PACKAGE_TYPE)
CFBundleShortVersionString
- 1.73
+ 1.74
CFBundleVersion
- 594
+ 597
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeatureKeys.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeatureKeys.kt
index 61f09905b6..b12ff24082 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeatureKeys.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeatureKeys.kt
@@ -11,5 +11,4 @@ internal object FeatureKeys {
const val MOBILE_ONLY_SUBSCRIPTION = "mobile.mobile_only_subscription"
const val MOBILE_USERS_INTERVIEW_WIDGET = "mobile.users_interview_widget"
const val MOBILE_CONTENT_TRIAL = "mobile.content_trial"
- const val MOBILE_PYTHON_ADOPTED_COURSE = "mobile.python_adopted_course"
}
\ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeaturesMap.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeaturesMap.kt
index e06709f594..2009058866 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeaturesMap.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/profile/domain/model/FeaturesMap.kt
@@ -39,7 +39,4 @@ val FeaturesMap.isMobileUsersInterviewWidgetEnabled: Boolean
get() = get(FeatureKeys.MOBILE_USERS_INTERVIEW_WIDGET) ?: false
val FeaturesMap.isMobileContentTrialEnabled: Boolean
- get() = get(FeatureKeys.MOBILE_CONTENT_TRIAL) ?: false
-
-val FeaturesMap.isMobilePythonAdoptedCourseEnabled: Boolean
- get() = get(FeatureKeys.MOBILE_PYTHON_ADOPTED_COURSE) ?: false
\ No newline at end of file
+ get() = get(FeatureKeys.MOBILE_CONTENT_TRIAL) ?: false
\ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetFakeTopicsFeature.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetFakeTopicsFeature.kt
deleted file mode 100644
index bcf324d0fc..0000000000
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetFakeTopicsFeature.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.hyperskill.app.study_plan.widget.presentation
-
-import org.hyperskill.app.core.domain.model.ContentType
-import org.hyperskill.app.learning_activities.domain.model.LearningActivity
-import org.hyperskill.app.learning_activities.domain.model.LearningActivityState
-import org.hyperskill.app.learning_activities.domain.model.LearningActivityType
-import org.hyperskill.app.subscriptions.domain.model.Subscription
-import org.hyperskill.app.subscriptions.domain.model.SubscriptionType
-import org.hyperskill.app.subscriptions.domain.model.isFreemium
-
-internal object StudyPlanWidgetFakeTopicsFeature {
- private const val PYTHON_MOBILE_ADOPTED_TRACK_ID = 139L
-
- private val topicsTitles: List =
- listOf(
- "Advanced conditions",
- "Comments",
- "Boolean data type",
- "Lists",
- "List comprehension",
- "Nested lists",
- "Indexes and slicing",
- "While loop",
- "For loop",
- "Loop control",
- "Advanced strings",
- "Declaring functions",
- "Invoking functions",
- "Lambda functions",
- "Tuples",
- "Sets",
- "Dictionaries",
- "Global vs local scopes",
- "Immutability",
- "Objects",
- "Classes",
- "Class instances",
- "Class methods",
- "Methods and attributes",
- "Magic methods",
- "Inheritance",
- "Polymorphism",
- "Method overriding",
- "Errors and exceptions",
- "Exception handling",
- "User-defined exceptions",
- "Modules",
- "Random module",
- "File modes and permissions",
- "Files in Python",
- "Reading files",
- "Writing files"
- )
-
- val topics: List by lazy {
- topicsTitles.mapIndexed { index, title ->
- LearningActivity(
- id = -index - 1L,
- stateValue = LearningActivityState.TODO.value,
- targetId = null,
- targetType = ContentType.UNKNOWN,
- typeValue = LearningActivityType.LEARN_TOPIC.value,
- title = title,
- topicId = null
- )
- }
- }
- val topicsIds: Set by lazy { topics.map { it.id }.toSet() }
-
- fun isFakeTopicsFeatureAvailable(trackId: Long?, subscription: Subscription): Boolean =
- trackId == PYTHON_MOBILE_ADOPTED_TRACK_ID &&
- (subscription.isFreemium || subscription.type == SubscriptionType.MOBILE_CONTENT_TRIAL)
-}
\ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetReducer.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetReducer.kt
index 4471207862..d0dfda9614 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetReducer.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetReducer.kt
@@ -145,42 +145,8 @@ class StudyPlanWidgetReducer : StateReducer {
state: State,
message: StudyPlanWidgetFeature.LearningActivitiesWithSectionsFetchResult.Success
): StudyPlanWidgetReducerResult {
- val isFakeTopicsFeatureAvailable =
- StudyPlanWidgetFakeTopicsFeature.isFakeTopicsFeatureAvailable(
- trackId = state.profile?.trackId,
- subscription = message.subscription
- )
- val fakeTopics = if (isFakeTopicsFeatureAvailable) {
- StudyPlanWidgetFakeTopicsFeature.topics
- } else {
- emptyList()
- }
-
- val studyPlanSections =
- if (isFakeTopicsFeatureAvailable) {
- message.studyPlanSections.map { section ->
- if (section.type == StudyPlanSectionType.ROOT_TOPICS) {
- section.copy(
- isVisible = true,
- activities = section.activities + fakeTopics.map { it.id }
- )
- } else {
- section
- }
- }
- } else {
- message.studyPlanSections
- }
-
- val learningActivities =
- if (isFakeTopicsFeatureAvailable) {
- message.learningActivities + fakeTopics
- } else {
- message.learningActivities
- }
- val learningActivitiesIds = learningActivities.map { it.id }.toSet()
-
- val visibleSections = getVisibleSections(studyPlanSections, learningActivitiesIds)
+ val learningActivitiesIds = message.learningActivities.map { it.id }.toSet()
+ val visibleSections = getVisibleSections(message.studyPlanSections, learningActivitiesIds)
val currentSectionId = visibleSections.firstOrNull()?.id ?: return state.copy(
studyPlanSections = emptyMap(),
sectionsStatus = ContentStatus.LOADED,
@@ -190,18 +156,15 @@ class StudyPlanWidgetReducer : StateReducer {
val supportedSections = visibleSections
.filter { studyPlanSection ->
- when (studyPlanSection.type) {
- StudyPlanSectionType.NEXT_PROJECT ->
- // ALTAPPS-1186: We should hide next project section for freemium users
- message.subscription.type.isProjectSelectionEnabled
- StudyPlanSectionType.NEXT_TRACK ->
- // ALTAPPS-1355: We should hide next track section for freemium users
- !isFakeTopicsFeatureAvailable
- else -> true
+ // ALTAPPS-1186: We should hide next project section for freemium users
+ if (!message.subscription.type.isProjectSelectionEnabled) {
+ studyPlanSection.type != StudyPlanSectionType.NEXT_PROJECT
+ } else {
+ true
}
}
- val resultStudyPlanSections = supportedSections.associate { studyPlanSection ->
+ val studyPlanSections = supportedSections.associate { studyPlanSection ->
studyPlanSection.id to StudyPlanWidgetFeature.StudyPlanSectionInfo(
studyPlanSection = studyPlanSection,
isExpanded = studyPlanSection.id == currentSectionId,
@@ -216,11 +179,11 @@ class StudyPlanWidgetReducer : StateReducer {
}
val loadedSectionsState = state.copy(
- studyPlanSections = resultStudyPlanSections,
+ studyPlanSections = studyPlanSections,
sectionsStatus = ContentStatus.LOADED,
isRefreshing = false,
learnedTopicsCount = message.learnedTopicsCount,
- activities = learningActivities.associateBy { it.id },
+ activities = message.learningActivities.associateBy { it.id },
subscriptionLimitType = message.subscriptionLimitType
)
@@ -228,7 +191,7 @@ class StudyPlanWidgetReducer : StateReducer {
handleNewActivities(
loadedSectionsState,
sectionId = currentSectionId,
- activities = learningActivities,
+ activities = message.learningActivities,
targetPage = SectionPage.MAIN
)
} else {
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetStateExtensions.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetStateExtensions.kt
index ea5fc568b7..6fa4b24866 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetStateExtensions.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/presentation/StudyPlanWidgetStateExtensions.kt
@@ -109,17 +109,13 @@ internal fun StudyPlanWidgetFeature.State.isActivityLocked(
sectionId: Long,
activityId: Long,
): Boolean {
- if (StudyPlanWidgetFakeTopicsFeature.topicsIds.contains(activityId)) {
- return true
- } else {
- val unlockedActivitiesCount = getUnlockedActivitiesCount(sectionId)
- return unlockedActivitiesCount != null &&
- getLoadedSectionActivities(sectionId)
- .take(unlockedActivitiesCount)
- .map { it.id }
- .contains(activityId)
- .not()
- }
+ val unlockedActivitiesCount = getUnlockedActivitiesCount(sectionId)
+ return unlockedActivitiesCount != null &&
+ getLoadedSectionActivities(sectionId)
+ .take(unlockedActivitiesCount)
+ .map { it.id }
+ .contains(activityId)
+ .not()
}
/**
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/view/mapper/StudyPlanWidgetViewStateMapper.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/view/mapper/StudyPlanWidgetViewStateMapper.kt
index b6b0a83489..88b4c17340 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/view/mapper/StudyPlanWidgetViewStateMapper.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/study_plan/widget/view/mapper/StudyPlanWidgetViewStateMapper.kt
@@ -5,7 +5,6 @@ import org.hyperskill.app.core.view.mapper.date.SharedDateFormatter
import org.hyperskill.app.learning_activities.domain.model.LearningActivity
import org.hyperskill.app.learning_activities.domain.model.LearningActivityState
import org.hyperskill.app.learning_activities.view.mapper.LearningActivityTextsMapper
-import org.hyperskill.app.study_plan.widget.presentation.StudyPlanWidgetFakeTopicsFeature
import org.hyperskill.app.study_plan.widget.presentation.StudyPlanWidgetFeature
import org.hyperskill.app.study_plan.widget.presentation.StudyPlanWidgetFeature.ContentStatus
import org.hyperskill.app.study_plan.widget.presentation.StudyPlanWidgetFeature.PageContentStatus
@@ -107,15 +106,12 @@ class StudyPlanWidgetViewStateMapper(private val dateFormatter: SharedDateFormat
emptyActivitiesState
} else {
val unlockedActivitiesCount = state.getUnlockedActivitiesCount(sectionId)
- val fakeTopicsIds = StudyPlanWidgetFakeTopicsFeature.topicsIds
SectionContent.Content(
sectionItems = loadedActivities.mapIndexed { index, activity ->
- val isLocked = fakeTopicsIds.contains(activity.id) ||
- (unlockedActivitiesCount != null && index + 1 > unlockedActivitiesCount)
mapSectionItem(
activity = activity,
currentActivityId = currentActivityId,
- isLocked = isLocked
+ isLocked = unlockedActivitiesCount != null && index + 1 > unlockedActivitiesCount
)
},
nextPageLoadingState = mapPageContentStatusToViewState(sectionInfo.nextPageContentStatus),
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/root/presentation/WelcomeOnboardingReducer.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/root/presentation/WelcomeOnboardingReducer.kt
index ecd772243a..2fe4aadbd3 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/root/presentation/WelcomeOnboardingReducer.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/root/presentation/WelcomeOnboardingReducer.kt
@@ -83,9 +83,7 @@ internal class WelcomeOnboardingReducer : StateReducer {
WelcomeQuestionnaireType.LEARNING_REASON ->
NavigateTo.WelcomeOnboardingQuestionnaire(WelcomeQuestionnaireType.CODING_EXPERIENCE)
WelcomeQuestionnaireType.CODING_EXPERIENCE ->
- // NavigateTo.ChooseProgrammingLanguage
- // ALTAPPS-1356: Redirect to Python track directly
- NavigateTo.TrackDetails(WelcomeOnboardingTrack.PYTHON)
+ NavigateTo.ChooseProgrammingLanguage
}
)
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsComponentImpl.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsComponentImpl.kt
index 2f451d7efb..a42c5d5042 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsComponentImpl.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsComponentImpl.kt
@@ -17,10 +17,8 @@ internal class WelcomeOnboardingTrackDetailsComponentImpl(
currentProfileStateRepository = appGraph.profileDataComponent.currentProfileStateRepository,
profileRepository = appGraph.profileDataComponent.profileRepository,
analyticInteractor = appGraph.analyticComponent.analyticInteractor,
- featuresDataSource = appGraph.profileDataComponent.featuresDataSource,
logger = appGraph.loggerComponent.logger,
buildVariant = appGraph.commonComponent.buildKonfig.buildVariant,
- resourceProvider = appGraph.commonComponent.resourceProvider,
- platformType = appGraph.commonComponent.platform.platformType
+ resourceProvider = appGraph.commonComponent.resourceProvider
)
}
\ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsFeatureBuilder.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsFeatureBuilder.kt
index 334f8bf3c2..0ec5712f3f 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsFeatureBuilder.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/injection/WelcomeOnboardingTrackDetailsFeatureBuilder.kt
@@ -4,13 +4,10 @@ import co.touchlab.kermit.Logger
import org.hyperskill.app.analytic.domain.interactor.AnalyticInteractor
import org.hyperskill.app.analytic.presentation.wrapWithAnalyticLogger
import org.hyperskill.app.core.domain.BuildVariant
-import org.hyperskill.app.core.domain.platform.PlatformType
import org.hyperskill.app.core.presentation.ActionDispatcherOptions
import org.hyperskill.app.core.presentation.transformState
import org.hyperskill.app.core.view.mapper.ResourceProvider
-import org.hyperskill.app.features.data.source.FeaturesDataSource
import org.hyperskill.app.logging.presentation.wrapWithLogger
-import org.hyperskill.app.profile.domain.model.isMobilePythonAdoptedCourseEnabled
import org.hyperskill.app.profile.domain.repository.CurrentProfileStateRepository
import org.hyperskill.app.profile.domain.repository.ProfileRepository
import org.hyperskill.app.welcome_onboarding.model.WelcomeOnboardingTrack
@@ -34,15 +31,10 @@ internal object WelcomeOnboardingTrackDetailsFeatureBuilder {
currentProfileStateRepository: CurrentProfileStateRepository,
profileRepository: ProfileRepository,
analyticInteractor: AnalyticInteractor,
- featuresDataSource: FeaturesDataSource,
resourceProvider: ResourceProvider,
logger: Logger,
- buildVariant: BuildVariant,
- platformType: PlatformType
+ buildVariant: BuildVariant
): Feature {
- val isMobilePythonAdoptedCourseEnabled = platformType == PlatformType.IOS &&
- featuresDataSource.getFeaturesMap().isMobilePythonAdoptedCourseEnabled
-
val welcomeOnboardingTrackDetailsReducer =
WelcomeOnboardingTrackDetailsReducer()
.wrapWithLogger(buildVariant, logger, LOG_TAG)
@@ -57,10 +49,7 @@ internal object WelcomeOnboardingTrackDetailsFeatureBuilder {
val viewStateMapper = WelcomeOnboardingTrackDetailsViewStateMapper(resourceProvider)
return ReduxFeature(
- initialState = WelcomeOnboardingTrackDetailsFeature.initialState(
- track = track,
- isMobilePythonAdoptedCourseEnabled = isMobilePythonAdoptedCourseEnabled
- ),
+ initialState = WelcomeOnboardingTrackDetailsFeature.initialState(track),
reducer = welcomeOnboardingTrackDetailsReducer
)
.wrapWithActionDispatcher(welcomeOnboardingTrackDetailsActionDispatcher)
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsFeature.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsFeature.kt
index f6d7d3d47e..6b58a3e510 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsFeature.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsFeature.kt
@@ -6,18 +6,13 @@ import org.hyperskill.app.welcome_onboarding.model.WelcomeOnboardingTrack
object WelcomeOnboardingTrackDetailsFeature {
internal data class State(
val track: WelcomeOnboardingTrack,
- val isLoadingShowed: Boolean,
- val isMobilePythonAdoptedCourseEnabled: Boolean
+ val isLoadingShowed: Boolean
)
- internal fun initialState(
- track: WelcomeOnboardingTrack,
- isMobilePythonAdoptedCourseEnabled: Boolean
- ) =
+ internal fun initialState(track: WelcomeOnboardingTrack) =
State(
track = track,
- isLoadingShowed = false,
- isMobilePythonAdoptedCourseEnabled = isMobilePythonAdoptedCourseEnabled
+ isLoadingShowed = false
)
/**
diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsReducer.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsReducer.kt
index d069c81e26..9355802a5c 100644
--- a/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsReducer.kt
+++ b/shared/src/commonMain/kotlin/org/hyperskill/app/welcome_onboarding/track_details/presentation/WelcomeOnboardingTrackDetailsReducer.kt
@@ -20,7 +20,6 @@ internal class WelcomeOnboardingTrackDetailsReducer : StateReducer JAVA_TRACK_ID
WelcomeOnboardingTrack.JAVA_SCRIPT -> JS_TRACK_ID
WelcomeOnboardingTrack.KOTLIN -> KOTLIN_TRACK_ID
- WelcomeOnboardingTrack.PYTHON ->
- if (state.isMobilePythonAdoptedCourseEnabled) PYTHON_TRACK_MOBILE_ADOPTED_ID else PYTHON_TRACK_ID
+ WelcomeOnboardingTrack.PYTHON -> PYTHON_TRACK_ID
WelcomeOnboardingTrack.SQL -> SQL_TRACK_ID
}
}
\ No newline at end of file