From abb668d4250c0b149a8b17efeb23aea0dc8cc782 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Tue, 28 May 2024 19:50:32 +0700 Subject: [PATCH] Shared remove short theory experiment (#1064) --- .../app/profile/domain/model/FeatureKeys.kt | 1 - .../app/profile/domain/model/FeaturesMap.kt | 3 -- .../app/step/injection/StepComponentImpl.kt | 1 - .../app/step/injection/StepFeatureBuilder.kt | 3 -- .../step/presentation/StepActionDispatcher.kt | 40 ------------------- 5 files changed, 48 deletions(-) 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 9e00df5785..f77c16ddd1 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 @@ -10,7 +10,6 @@ internal object FeatureKeys { const val MOBILE_LEADERBOARDS = "mobile_leaderboards" const val MOBILE_ONLY_SUBSCRIPTION = "mobile.mobile_only_subscription" const val MOBILE_USERS_INTERVIEW_WIDGET = "mobile.users_interview_widget" - const val MOBILE_SHORT_THEORY = "mobile.short_theory" const val MOBILE_GPT_CODE_GENERATION_WITH_ERRORS_FORCED_ONBOARDING = "mobile.gpt_code_generation_with_errors_forced_onboarding_v2" } \ 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 7fb97e0773..ffed641981 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 @@ -29,8 +29,5 @@ val FeaturesMap.isMobileOnlySubscriptionEnabled: Boolean val FeaturesMap.isMobileUsersInterviewWidgetEnabled: Boolean get() = get(FeatureKeys.MOBILE_USERS_INTERVIEW_WIDGET) ?: false -val FeaturesMap.isMobileShortTheoryEnabled: Boolean - get() = get(FeatureKeys.MOBILE_SHORT_THEORY) ?: false - val FeaturesMap.isMobileGptCodeGenerationWithErrorsEnabled: Boolean get() = get(FeatureKeys.MOBILE_GPT_CODE_GENERATION_WITH_ERRORS_FORCED_ONBOARDING) ?: false \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepComponentImpl.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepComponentImpl.kt index 536762a73f..18767ce602 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepComponentImpl.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepComponentImpl.kt @@ -28,7 +28,6 @@ internal class StepComponentImpl( stepInteractor = appGraph.buildStepDataComponent().stepInteractor, stepCompletedFlow = appGraph.stepCompletionFlowDataComponent.stepCompletedFlow, nextLearningActivityStateRepository = appGraph.stateRepositoriesComponent.nextLearningActivityStateRepository, - currentProfileStateRepository = appGraph.profileDataComponent.currentProfileStateRepository, analyticInteractor = appGraph.analyticComponent.analyticInteractor, sentryInteractor = appGraph.sentryComponent.sentryInteractor, stepCompletionReducer = stepCompletionComponent.stepCompletionReducer, diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepFeatureBuilder.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepFeatureBuilder.kt index deadcaad11..f6ce3a0572 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepFeatureBuilder.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/step/injection/StepFeatureBuilder.kt @@ -7,7 +7,6 @@ import org.hyperskill.app.core.presentation.ActionDispatcherOptions import org.hyperskill.app.core.presentation.transformState import org.hyperskill.app.learning_activities.domain.repository.NextLearningActivityStateRepository import org.hyperskill.app.logging.presentation.wrapWithLogger -import org.hyperskill.app.profile.domain.repository.CurrentProfileStateRepository import org.hyperskill.app.sentry.domain.interactor.SentryInteractor import org.hyperskill.app.step.domain.interactor.StepInteractor import org.hyperskill.app.step.domain.model.StepRoute @@ -37,7 +36,6 @@ internal object StepFeatureBuilder { stepRoute: StepRoute, stepInteractor: StepInteractor, nextLearningActivityStateRepository: NextLearningActivityStateRepository, - currentProfileStateRepository: CurrentProfileStateRepository, analyticInteractor: AnalyticInteractor, stepCompletedFlow: StepCompletedFlow, sentryInteractor: SentryInteractor, @@ -59,7 +57,6 @@ internal object StepFeatureBuilder { stepCompletedFlow = stepCompletedFlow, stepInteractor = stepInteractor, nextLearningActivityStateRepository = nextLearningActivityStateRepository, - currentProfileStateRepository = currentProfileStateRepository, analyticInteractor = analyticInteractor, sentryInteractor = sentryInteractor, logger.withTag(LOG_TAG) diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/step/presentation/StepActionDispatcher.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/step/presentation/StepActionDispatcher.kt index f2d528ab68..ccf24fca44 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/step/presentation/StepActionDispatcher.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/step/presentation/StepActionDispatcher.kt @@ -21,13 +21,10 @@ import org.hyperskill.app.analytic.domain.interactor.AnalyticInteractor import org.hyperskill.app.core.domain.DataSourceType import org.hyperskill.app.core.presentation.ActionDispatcherOptions import org.hyperskill.app.learning_activities.domain.repository.NextLearningActivityStateRepository -import org.hyperskill.app.profile.domain.model.isMobileShortTheoryEnabled -import org.hyperskill.app.profile.domain.repository.CurrentProfileStateRepository import org.hyperskill.app.sentry.domain.interactor.SentryInteractor import org.hyperskill.app.sentry.domain.model.transaction.HyperskillSentryTransactionBuilder import org.hyperskill.app.sentry.domain.withTransaction import org.hyperskill.app.step.domain.interactor.StepInteractor -import org.hyperskill.app.step.domain.model.Step import org.hyperskill.app.step.presentation.StepFeature.Action import org.hyperskill.app.step.presentation.StepFeature.InternalAction import org.hyperskill.app.step.presentation.StepFeature.InternalMessage @@ -40,7 +37,6 @@ internal class StepActionDispatcher( stepCompletedFlow: StepCompletedFlow, private val stepInteractor: StepInteractor, private val nextLearningActivityStateRepository: NextLearningActivityStateRepository, - private val currentProfileStateRepository: CurrentProfileStateRepository, private val analyticInteractor: AnalyticInteractor, private val sentryInteractor: SentryInteractor, private val logger: Logger @@ -95,46 +91,10 @@ internal class StepActionDispatcher( val step = stepInteractor .getStep(action.stepRoute.stepId) .getOrThrow() - .let { applyMobileShortTheoryFeature(it) } Message.StepLoaded.Success(step) }.let(onNewMessage) } - private suspend fun applyMobileShortTheoryFeature(step: Step): Step { - val isMobileShortTheoryEnabled = currentProfileStateRepository - .getState(forceUpdate = false) - .getOrNull() - ?.features - ?.isMobileShortTheoryEnabled - ?: false - - return if (isMobileShortTheoryEnabled && step.id == 38627L) { - step.copy( - block = step.block.copy( - text = """ -

Ever wondered why Java's logo is a steaming cup of coffee? Just as coffee fuels our day, Java powers the tech world with its robust and versatile features! So, grab your cup of coffee and join us on this exciting journey into the world of Java!

-
What is Java
-

Java language was designed by James Gosling in 1995 to be simple and powerful. It borrows syntax from C and C++, and complements it with automatic memory management, and other powerful features. Java's core principle is "Write Once, Run Anywhere" (WORA), which means that any Java program is platform-independent and can run on any operating system without modifications.

-
Where is Java Applied
-

Waking up you immediately interact with an application built with Java — your phone alarm. When you work or develop your pet projects, Java forms the backbone of development tools like IntelliJ IDEA. Even when relaxing with Netflix, Spotify, or Minecraft, you rely on Java power. Java is like a silent friend, aiding us and making our lives easier in numerous ways, from the moment we wake up till we call it a day. What amazing and helpful Java application are you going to create?

-
A sample of Java
-

Let's start with the classic "Hello, World!" program, a friendly greeting from your computer:

-
public class HelloWorld {
-                public static void main(String[] args) {
-                    System.out.println("Hello, World!");
-                }
-            }
-

This program simply prints the phrase "Hello, World!" to the console. Don't worry if it looks a bit cryptic now. We'll dive deeper into its logic during the practice part of this topic.

-
Conclusion
-

Java is a high-level object-oriented programming language. Its clear syntax, platform independence, and automatic memory management contribute to its popularity. Become a part of the vast Java community by practicing the language basics now. Don't hesitate to experiment, ask for help if you're stuck, and embrace mistakes as they fuel your learning!

- """.trimIndent() - ) - ) - } else { - step - } - } - private suspend fun handleUpdateNextLearningActivityStateAction( action: InternalAction.UpdateNextLearningActivityState ) {