diff --git a/platform/feedback/resources/messages/NewUIFeedbackMessagesBundle.properties b/platform/feedback/resources/messages/NewUIFeedbackMessagesBundle.properties deleted file mode 100644 index b8be94921d4c..000000000000 --- a/platform/feedback/resources/messages/NewUIFeedbackMessagesBundle.properties +++ /dev/null @@ -1,31 +0,0 @@ -dialog.top.title=Feedback -dialog.title=Share feedback about new UI -dialog.description=It\u2019s been a few days since you started using the new UI. Your opinion is very\nvaluable to us. -dialog.rating.label=What is your overall impression about the new UI? -dialog.rating.required=Choose a rating -dialog.like_most.textarea.label=What do you like most about the new UI so far? -dialog.dislike.textarea.label=What do you dislike about the new UI? -dialog.email.checkbox.label=I allow JetBrains to contact me regarding my feedback by email -dialog.email.textfield.placeholder=Email -dialog.email.textfield.required=Enter your email -dialog.ok.label=Send Feedback -dialog.cancel.label=No, thanks - -dialog.system.info.isNewUIEnabled=Is New UI now enabled: -dialog.system.info.enableNewUIDate=Enable New UI date: -dialog.system.info.disableNewUIDate=Disable New UI date: - -dialog.zendesk.title=Share feedback about new UI -dialog.zendesk.description=It\u2019s been a few days since you started using the new UI. Your opinion is very valuable to us. -dialog.zendesk.rating.label=What is your overall impression about the new UI? -dialog.zendesk.like_most.textarea.label=What do you like most about the new UI so far? -dialog.zendesk.dislike.textarea.label=What do you dislike about the new UI? - -notification.request.feedback.title=Share feedback about the new UI -notification.request.feedback.content=Please answer a few questions. It will take about 2 minutes. -notification.request.feedback.give_feedback=Leave Feedback -notification.request.feedback.cancel.feedback=No, thanks - -notification.cancel.feedback.content=If you want to share your feedback later, go to the Settings | New UI. - -test.action.name=Show Feedback Dialog For New UI \ No newline at end of file diff --git a/platform/feedback/src/com/intellij/platform/feedback/newUi/CancelFeedbackNotification.kt b/platform/feedback/src/com/intellij/platform/feedback/newUi/CancelFeedbackNotification.kt deleted file mode 100644 index ed2073d5e875..000000000000 --- a/platform/feedback/src/com/intellij/platform/feedback/newUi/CancelFeedbackNotification.kt +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.intellij.platform.feedback.newUi - -import com.intellij.notification.Notification -import com.intellij.notification.NotificationType - -class CancelFeedbackNotification : Notification( - "Feedback In IDE", - "", - NewUIFeedbackBundle.message("notification.cancel.feedback.content"), - NotificationType.INFORMATION -) \ No newline at end of file diff --git a/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIFeedbackBundle.kt b/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIFeedbackBundle.kt deleted file mode 100644 index 1946239d4dfa..000000000000 --- a/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIFeedbackBundle.kt +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.intellij.platform.feedback.newUi - -import com.intellij.DynamicBundle -import org.jetbrains.annotations.NonNls -import org.jetbrains.annotations.PropertyKey - -@NonNls -private const val BUNDLE = "messages.NewUIFeedbackMessagesBundle" - -internal object NewUIFeedbackBundle : DynamicBundle(BUNDLE) { - @Suppress("SpreadOperator") - fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = getMessage(key, *params) -} \ No newline at end of file diff --git a/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIFeedbackDialog.kt b/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIFeedbackDialog.kt deleted file mode 100644 index 182a1fdf898b..000000000000 --- a/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIFeedbackDialog.kt +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.intellij.platform.feedback.newUi - -import com.intellij.openapi.project.Project -import com.intellij.platform.feedback.dialog.BlockBasedFeedbackDialogWithEmail -import com.intellij.platform.feedback.dialog.CommonFeedbackSystemData -import com.intellij.platform.feedback.dialog.SystemDataJsonSerializable -import com.intellij.platform.feedback.dialog.showFeedbackSystemInfoDialog -import com.intellij.platform.feedback.dialog.uiBlocks.* -import com.intellij.ui.NewUiValue -import kotlinx.datetime.LocalDateTime -import kotlinx.serialization.Serializable -import kotlinx.serialization.json.Json -import kotlinx.serialization.json.JsonElement -import kotlinx.serialization.json.encodeToJsonElement -import javax.swing.Action -import javax.swing.Action.NAME - -class NewUIFeedbackDialog( - project: Project?, - forTest: Boolean -) : BlockBasedFeedbackDialogWithEmail(project, forTest) { - - /** Increase the additional number when feedback format is changed */ - override val myFeedbackJsonVersion: Int = super.myFeedbackJsonVersion + 1 - - override val zendeskTicketTitle: String = "New UI in-IDE Feedback" - override val zendeskFeedbackType: String = "New UI in-IDE Feedback" - override val myFeedbackReportId: String = "new_ui_feedback" - - override val myTitle: String = NewUIFeedbackBundle.message("dialog.top.title") - override val myBlocks: List = listOf( - TopLabelBlock(NewUIFeedbackBundle.message("dialog.title")), - DescriptionBlock(NewUIFeedbackBundle.message("dialog.description")), - RatingBlock(NewUIFeedbackBundle.message("dialog.rating.label"), "rating"), - TextAreaBlock(NewUIFeedbackBundle.message("dialog.like_most.textarea.label"), "like_most"), - TextAreaBlock(NewUIFeedbackBundle.message("dialog.dislike.textarea.label"), "dislike") - ) - - override val mySystemInfoData: NewUIFeedbackSystemData by lazy { - val state = NewUIInfoService.getInstance().state - createNewUIFeedbackSystemInfoData(NewUiValue.isEnabled(), state.enableNewUIDate, state.disableNewUIDate) - } - override val myShowFeedbackSystemInfoDialog: () -> Unit = { - showNewUIFeedbackSystemInfoDialog(myProject, mySystemInfoData) - } - - init { - init() - } - - override fun doCancelAction() { - super.doCancelAction() - CancelFeedbackNotification().notify(myProject) - } - - override fun getCancelAction(): Action { - val cancelAction = super.getCancelAction() - cancelAction.putValue(NAME, NewUIFeedbackBundle.message("dialog.cancel.label")) - return cancelAction - } -} - -@Serializable -data class NewUIFeedbackSystemData( - val isNewUINowEnabled: Boolean, - val enableNewUIDate: LocalDateTime?, - val disableNewUIDate: LocalDateTime?, - val commonSystemInfo: CommonFeedbackSystemData -) : SystemDataJsonSerializable { - override fun toString(): String { - return buildString { - appendLine(NewUIFeedbackBundle.message("dialog.system.info.isNewUIEnabled")) - appendLine() - appendLine(if (isNewUINowEnabled) "True" else "False") - appendLine() - appendLine(NewUIFeedbackBundle.message("dialog.system.info.enableNewUIDate")) - appendLine() - appendLine(enableNewUIDate?.date.toString()) - appendLine() - appendLine(NewUIFeedbackBundle.message("dialog.system.info.disableNewUIDate")) - appendLine() - appendLine(disableNewUIDate?.date.toString()) - appendLine() - commonSystemInfo.toString() - } - } - - override fun serializeToJson(json: Json): JsonElement { - return json.encodeToJsonElement(this) - } -} - -private fun showNewUIFeedbackSystemInfoDialog(project: Project?, - systemInfoData: NewUIFeedbackSystemData -) = showFeedbackSystemInfoDialog(project, systemInfoData.commonSystemInfo) { - row(NewUIFeedbackBundle.message("dialog.system.info.isNewUIEnabled")) { - label(if (systemInfoData.isNewUINowEnabled) "True" else "False") //NON-NLS - } - row(NewUIFeedbackBundle.message("dialog.system.info.enableNewUIDate")) { - label(systemInfoData.enableNewUIDate?.date.toString()) - } - row(NewUIFeedbackBundle.message("dialog.system.info.disableNewUIDate")) { - label(systemInfoData.disableNewUIDate?.date.toString()) - } -} - -private fun createNewUIFeedbackSystemInfoData(isNewUINowEnabled: Boolean, - enableNewUIDate: LocalDateTime?, - disableNewUIDate: LocalDateTime?): NewUIFeedbackSystemData { - return NewUIFeedbackSystemData(isNewUINowEnabled, enableNewUIDate, disableNewUIDate, - CommonFeedbackSystemData.getCurrentData()) -} \ No newline at end of file diff --git a/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIInfoService.kt b/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIInfoService.kt deleted file mode 100644 index 6c6c555a2b01..000000000000 --- a/platform/feedback/src/com/intellij/platform/feedback/newUi/NewUIInfoService.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.intellij.platform.feedback.newUi - -import com.intellij.openapi.components.* -import com.intellij.ui.ExperimentalUI -import kotlinx.datetime.Clock -import kotlinx.datetime.LocalDateTime -import kotlinx.datetime.TimeZone -import kotlinx.datetime.toLocalDateTime -import kotlinx.serialization.Serializable - -@Service(Service.Level.APP) -@State(name = "NewUIInfoState", - storages = [Storage(StoragePathMacros.NON_ROAMABLE_FILE, deprecated = true), Storage("NewUIInfoService.xml")]) -class NewUIInfoService : PersistentStateComponent { - companion object { - @JvmStatic - fun getInstance(): NewUIInfoService = service() - } - - private var state = NewUIInfoState() - - override fun getState(): NewUIInfoState = state - - override fun loadState(state: NewUIInfoState) { - this.state = state - } - - fun updateEnableNewUIDate() { - if (state.enableNewUIDate == null) { - state.enableNewUIDate = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()) - } - } - - fun updateDisableNewUIDate() { - if (state.disableNewUIDate == null) { - state.disableNewUIDate = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()) - } - } -} - -@Serializable -data class NewUIInfoState( - var numberNotificationShowed: Int = 0, - var feedbackSent: Boolean = false, - var enableNewUIDate: LocalDateTime? = if (ExperimentalUI.isNewUI()) - Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()) - else null, - var disableNewUIDate: LocalDateTime? = null -) \ No newline at end of file diff --git a/platform/feedback/src/com/intellij/platform/feedback/newUi/package-info.java b/platform/feedback/src/com/intellij/platform/feedback/newUi/package-info.java deleted file mode 100644 index e91e7c1311cd..000000000000 --- a/platform/feedback/src/com/intellij/platform/feedback/newUi/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -@ApiStatus.Internal -package com.intellij.platform.feedback.newUi; - -import org.jetbrains.annotations.ApiStatus; \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/ui/ExperimentalUIImpl.kt b/platform/lang-impl/src/com/intellij/ui/ExperimentalUIImpl.kt index 7c9df48ed5ac..17d166921425 100644 --- a/platform/lang-impl/src/com/intellij/ui/ExperimentalUIImpl.kt +++ b/platform/lang-impl/src/com/intellij/ui/ExperimentalUIImpl.kt @@ -23,16 +23,12 @@ import com.intellij.openapi.util.IconLoader import com.intellij.openapi.util.IconPathPatcher import com.intellij.openapi.util.SystemInfo import com.intellij.openapi.util.registry.EarlyAccessRegistryManager -import com.intellij.platform.feedback.newUi.NewUIInfoService import com.intellij.ui.ExperimentalUI.Companion.isNewUI import java.util.concurrent.atomic.AtomicBoolean private val LOG: Logger get() = logger() -/** - * @author Konstantin Bulenkov - */ private class ExperimentalUIImpl : ExperimentalUI() { private val epIconMapperSuppressor = ExtensionPointName("com.intellij.iconMapperSuppressor") private var shouldUnsetNewUiSwitchKey: Boolean = true @@ -63,7 +59,6 @@ private class ExperimentalUIImpl : ExperimentalUI() { isResetLaf.set(true) enabled = false - NewUIInfoService.getInstance().updateDisableNewUIDate() LOG.info("=== UI: new -> old ===") } @@ -73,7 +68,6 @@ private class ExperimentalUIImpl : ExperimentalUI() { enabled = true setNewUiUsed() - NewUIInfoService.getInstance().updateEnableNewUIDate() if (!DistractionFreeModeController.shouldMinimizeCustomHeader()) { UISettings.getInstance().hideToolStripes = false