diff --git a/python/BUILD.bazel b/python/BUILD.bazel index c10be6a5f7a3..9f5683f8da86 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -286,8 +286,6 @@ jvm_library( "//platform/ui.jcef", "//libraries/io", "//platform/util/progress", - "//platform/feedback", - "//libraries/kotlinx/datetime", "//platform/platform-impl/remote", "//platform/platform-impl/ui", "//libraries/jackson/module-kotlin:libraries-jackson-module-kotlin", diff --git a/python/intellij.python.community.impl.iml b/python/intellij.python.community.impl.iml index 8ccbc573142b..ed87e3a22b3c 100644 --- a/python/intellij.python.community.impl.iml +++ b/python/intellij.python.community.impl.iml @@ -165,8 +165,6 @@ - - diff --git a/python/pluginResources/intellij.python.community.impl.xml b/python/pluginResources/intellij.python.community.impl.xml index 4f2902ff951d..9ed0712680c8 100644 --- a/python/pluginResources/intellij.python.community.impl.xml +++ b/python/pluginResources/intellij.python.community.impl.xml @@ -704,10 +704,6 @@ - - - - - - diff --git a/python/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties index 0f947f5a8cd8..31c8b5c07ed0 100644 --- a/python/pluginResources/messages/PyBundle.properties +++ b/python/pluginResources/messages/PyBundle.properties @@ -1657,18 +1657,6 @@ action.PipUpdateEnvAction.FloatingToolbar.text=Install All action.PipEnvLockDependenciesAction.text=Generate a Pipfile.lock action.PipEnvInstallDependenciesAction.text=Install Dependencies -python.survey.user.job.notification.group=PyCharm Job Survey -python.survey.user.job.notification.title=Feedback In IDE -python.survey.user.job.notification.content=Tell us about your Python development experience. Just one question. - -python.survey.user.job.dialog.title=Feedback -python.survey.user.job.dialog.blocks.top=Python development -python.survey.user.job.dialog.blocks.checkbox.group=What do you use Python for? -python.survey.user.job.dialog.blocks.checkbox.data=Data analysis -python.survey.user.job.dialog.blocks.checkbox.ml=Machine learning -python.survey.user.job.dialog.blocks.checkbox.web=Web development -python.survey.user.job.dialog.blocks.checkbox.scripts=Writing automation scripts / parsers / tests / system administration -python.survey.user.job.dialog.blocks.checkbox.other=Other validation.invalid.name=Invalid name dialog.message.command.could.not.complete=Command could not be completed successfully. \ Please see the command's output for information about resolving this problem. diff --git a/python/src/com/jetbrains/python/statistics/feedback/PyCharmJobSurveyUtils.kt b/python/src/com/jetbrains/python/statistics/feedback/PyCharmJobSurveyUtils.kt deleted file mode 100644 index 74b9b9efec5c..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PyCharmJobSurveyUtils.kt +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.openapi.components.BaseState -import com.intellij.openapi.project.Project -import com.intellij.openapi.startup.ProjectActivity -import kotlinx.datetime.Clock -import kotlinx.datetime.LocalDateTime -import kotlinx.datetime.TimeZone -import kotlinx.datetime.toJavaLocalDateTime -import kotlinx.datetime.toLocalDateTime -import java.time.Duration - - -class PythonJobSurveyState : BaseState() { - var firstLaunch by string() -} - -class PythonFirstLaunchChecker : ProjectActivity { - override suspend fun execute(project: Project) { - val state = PythonJobSurveyService.getInstance().state ?: return - if (state.firstLaunch == null) { - val dateTime = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()) - state.firstLaunch = LocalDateTime.Formats.ISO.format(dateTime) - } - } -} - - -fun shouldShowSurvey(): Boolean { - val firstLaunch = PythonJobSurveyService.getInstance().state?.firstLaunch ?: return false - val dateTime = LocalDateTime.Formats.ISO.parse(firstLaunch) - // Start checking on the third day of usage - return Duration.between(dateTime.toJavaLocalDateTime(), java.time.LocalDateTime.now()).toDays() >= 3 -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/statistics/feedback/PyCharmUxSurvey.kt b/python/src/com/jetbrains/python/statistics/feedback/PyCharmUxSurvey.kt deleted file mode 100644 index 1de9803aed62..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PyCharmUxSurvey.kt +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.openapi.application.ApplicationInfo -import com.intellij.openapi.components.BaseState -import com.intellij.openapi.components.Service -import com.intellij.openapi.components.SimplePersistentStateComponent -import com.intellij.openapi.components.State -import com.intellij.openapi.components.Storage -import com.intellij.openapi.components.service -import com.intellij.openapi.project.Project -import com.intellij.platform.feedback.ExternalFeedbackSurveyConfig -import com.intellij.platform.feedback.ExternalFeedbackSurveyType -import com.intellij.platform.feedback.FeedbackSurvey -import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification -import com.intellij.platform.ide.impl.customization.currentOsNameForIntelliJSupport -import com.intellij.util.PlatformUtils -import com.intellij.util.Urls -import com.jetbrains.python.PyBundle -import kotlinx.datetime.LocalDate - -internal class PyCharmUxSurvey : FeedbackSurvey() { - override val feedbackSurveyType: ExternalFeedbackSurveyType<*> = - ExternalFeedbackSurveyType(PyCharmUxSurveyConfig()) -} - -private class PyCharmUxSurveyConfig : ExternalFeedbackSurveyConfig { - override val surveyId: String = "pycharm_ux_survey_2026" - - override val lastDayOfFeedbackCollection: LocalDate = LocalDate( - year = 2026, - monthNumber = 3, - dayOfMonth = 31, - ) - - override val requireIdeEAP: Boolean = false - - override fun getUrlToSurvey(project: Project): String = - Urls.newFromEncoded("https://surveys.jetbrains.com/s3/pycharm-ux-survey") - .addParameters( - mapOf( - "build" to ApplicationInfo.getInstance().getBuild().asStringWithoutProductCode(), - "os" to currentOsNameForIntelliJSupport(), - ) - ) - .toExternalForm() - - override fun createNotification(project: Project, forTest: Boolean): RequestFeedbackNotification = - RequestFeedbackNotification( - "Feedback in IDE", - PyBundle.message("pycharm.statistics.feedback.ux.survey.title"), - PyBundle.message("pycharm.statistics.feedback.ux.survey.content") - ) - - override fun updateStateAfterNotificationShowed(project: Project) { - service().state.wasShown = true - } - - override fun checkIdeIsSuitable(): Boolean = - PlatformUtils.isPyCharm() && !PlatformUtils.isDataSpell() - - override fun checkExtraConditionSatisfied(project: Project): Boolean = - !service().state.wasShown - - override fun updateStateAfterRespondActionInvoked(project: Project) { - // no op - } -} - -@Service -@State(name = "PyCharmUxSurveyStore", storages = [Storage("pycharm-ux-survey.xml")]) -private class PyCharmUxSurveyStore : SimplePersistentStateComponent(State()) { - class State : BaseState() { - var wasShown by property(false) - } -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/statistics/feedback/PythonJobStatisticsCollector.kt b/python/src/com/jetbrains/python/statistics/feedback/PythonJobStatisticsCollector.kt deleted file mode 100644 index 8bbc68969c40..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PythonJobStatisticsCollector.kt +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - - -import com.intellij.internal.statistic.eventLog.EventLogGroup -import com.intellij.internal.statistic.eventLog.events.EventFields -import com.intellij.internal.statistic.eventLog.events.EventId2 -import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector - -object PythonJobStatisticsCollector : CounterUsagesCollector() { - private val GROUP = EventLogGroup("python.job.statistics", 2) - private val USE_FOR = EventFields.StringList("use_for", listOf("data_analysis", "ml", "web_dev", "scripts")) - private val OTHER = EventFields.StringValidatedByInlineRegexp("other", "[\\w\\s,.!?-]{1,25}") - private val JOB_EVENT: EventId2, String?> = GROUP.registerEvent("job.survey.triggered", USE_FOR, OTHER) - - @JvmStatic - fun logJobEvent(useFor: List, other: String?) { - JOB_EVENT.log(useFor, other) - } - - override fun getGroup(): EventLogGroup { - return GROUP - } -} diff --git a/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurvey.kt b/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurvey.kt deleted file mode 100644 index e33fecadca01..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurvey.kt +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.platform.feedback.FeedbackSurvey -import com.intellij.platform.feedback.InIdeFeedbackSurveyConfig -import com.intellij.platform.feedback.InIdeFeedbackSurveyType - -class PythonJobSurvey : FeedbackSurvey() { - override val feedbackSurveyType: InIdeFeedbackSurveyType = - InIdeFeedbackSurveyType(PythonJobSurveyConfig()) -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurveyConfig.kt b/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurveyConfig.kt deleted file mode 100644 index cd64aba79589..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurveyConfig.kt +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.openapi.project.Project -import com.intellij.platform.feedback.InIdeFeedbackSurveyConfig -import com.intellij.platform.feedback.dialog.BlockBasedFeedbackDialog -import com.intellij.platform.feedback.dialog.SystemDataJsonSerializable -import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification -import com.intellij.util.PlatformUtils -import com.jetbrains.python.PyBundle.message -import kotlinx.datetime.LocalDate - -class PythonJobSurveyConfig : InIdeFeedbackSurveyConfig { - - override fun createFeedbackDialog(project: Project, forTest: Boolean): BlockBasedFeedbackDialog { - return PythonUserJobFeedbackDialog(project, forTest) - } - - override val surveyId: String = "python_user_job_survey" - override val requireIdeEAP: Boolean = false - override val lastDayOfFeedbackCollection: LocalDate - get() = LocalDate(2025, 4, 30) - - override fun checkIdeIsSuitable(): Boolean = PlatformUtils.isPyCharmPro() - override fun checkExtraConditionSatisfied(project: Project): Boolean = shouldShowSurvey() - - override fun createNotification(project: Project, forTest: Boolean): RequestFeedbackNotification { - return RequestFeedbackNotification( - message("python.survey.user.job.notification.group"), - message("python.survey.user.job.notification.title"), - message("python.survey.user.job.notification.content"), - ) - } - - override fun updateStateAfterNotificationShowed(project: Project) { - - } - - override fun updateStateAfterDialogClosedOk(project: Project) { - - } -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurveyService.kt b/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurveyService.kt deleted file mode 100644 index 5f7a941ebab8..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PythonJobSurveyService.kt +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.openapi.components.PersistentStateComponent -import com.intellij.openapi.components.Service -import com.intellij.openapi.components.State -import com.intellij.openapi.components.Storage -import com.intellij.openapi.components.service - -@Service(Service.Level.APP) -@State(name="PythonJobSurveyService", storages = [Storage("pycharm-job-survey-service.xml")]) -class PythonJobSurveyService : PersistentStateComponent { - private var state = PythonJobSurveyState() - - override fun getState(): PythonJobSurveyState? = state - - override fun loadState(state: PythonJobSurveyState) { - this.state = state - } - - companion object { - @JvmStatic - fun getInstance(): PythonJobSurveyService = service() - } -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/statistics/feedback/PythonShowJobSurveyAction.kt b/python/src/com/jetbrains/python/statistics/feedback/PythonShowJobSurveyAction.kt deleted file mode 100644 index aa59f0dfa9b3..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PythonShowJobSurveyAction.kt +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.openapi.actionSystem.AnAction -import com.intellij.openapi.actionSystem.AnActionEvent - -class PythonShowJobSurveyAction : AnAction() { - override fun actionPerformed(e: AnActionEvent) { - PythonJobSurvey().showNotification(e.project!!, true) - } -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/statistics/feedback/PythonUserJobFeedbackDialog.kt b/python/src/com/jetbrains/python/statistics/feedback/PythonUserJobFeedbackDialog.kt deleted file mode 100644 index a4c67ffef820..000000000000 --- a/python/src/com/jetbrains/python/statistics/feedback/PythonUserJobFeedbackDialog.kt +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.statistics.feedback - -import com.intellij.openapi.project.Project -import com.intellij.platform.feedback.dialog.CommonBlockBasedFeedbackDialog -import com.intellij.platform.feedback.dialog.uiBlocks.CheckBoxGroupBlock -import com.intellij.platform.feedback.dialog.uiBlocks.CheckBoxItemData -import com.intellij.platform.feedback.dialog.uiBlocks.FeedbackBlock -import com.intellij.platform.feedback.dialog.uiBlocks.TopLabelBlock -import com.jetbrains.python.PyBundle.message - -class PythonUserJobFeedbackDialog( - project: Project?, - forTest: Boolean, -) : CommonBlockBasedFeedbackDialog(project, forTest) { - - override val myFeedbackReportId: String - get() = "python_user_job_survey" - - - override val myTitle: String - get() = message("python.survey.user.job.dialog.title") - - - val items = listOf( - CheckBoxItemData(message("python.survey.user.job.dialog.blocks.checkbox.data"), "data_analysis"), - CheckBoxItemData(message("python.survey.user.job.dialog.blocks.checkbox.ml"), "ml"), - CheckBoxItemData(message("python.survey.user.job.dialog.blocks.checkbox.web"), "web_dev"), - CheckBoxItemData(message("python.survey.user.job.dialog.blocks.checkbox.scripts"), "scripts"), - ) - - override val myBlocks: List = listOf( - TopLabelBlock(message("python.survey.user.job.dialog.blocks.top")), - CheckBoxGroupBlock(message("python.survey.user.job.dialog.blocks.checkbox.group"), items, "python_job_checkbox") - .addOtherTextField(message("python.survey.user.job.dialog.blocks.checkbox.other")) - .requireAnswer(), - ) - - override fun sendFeedbackData() { - super.sendFeedbackData() - - val builder = StringBuilder() - (myBlocks[1] as CheckBoxGroupBlock).collectBlockTextDescription(builder) - val selectedItems = items.filter { it.property }.map { it.jsonElementName } - val other = builder.toString() - .lines()[5].substringAfter(message("python.survey.user.job.dialog.blocks.checkbox.other") + ": ").take(25) - - PythonJobStatisticsCollector.logJobEvent(selectedItems, other) - } - - init { - init() - } -} \ No newline at end of file