[ui] Retire new UI feedback dialog

GitOrigin-RevId: 51c1a00ac6a339061019f0e18f4c9d4296af45b2
This commit is contained in:
Yuriy Artamonov
2024-09-12 15:05:51 +02:00
committed by intellij-monorepo-bot
parent 96090e5b02
commit e604c8ca29
7 changed files with 0 additions and 231 deletions

View File

@@ -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=<html>If you want to share your feedback later, go to the <b>Settings | New UI</b>.</html>
test.action.name=Show Feedback Dialog For New UI

View File

@@ -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
)

View File

@@ -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)
}

View File

@@ -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<NewUIFeedbackSystemData>(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<FeedbackBlock> = 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())
}

View File

@@ -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<NewUIInfoState> {
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
)

View File

@@ -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;

View File

@@ -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<ExperimentalUI>()
/**
* @author Konstantin Bulenkov
*/
private class ExperimentalUIImpl : ExperimentalUI() {
private val epIconMapperSuppressor = ExtensionPointName<Any>("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