OPENIDE #145 Hide ability share feedback about plugin

(cherry picked from commit 16094f2fe026868ff1b47f7c938ceb7026c8ebd3)

(cherry picked from commit 1d5809cd88)

(cherry picked from commit 329224341b)
(cherry picked from commit f7e53436d7)
(cherry picked from commit a541f2b68c)
This commit is contained in:
Nikita Iarychenko
2025-04-01 11:08:19 +04:00
parent 91907bb594
commit 4d01bd0b13

View File

@@ -1,4 +1,7 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//
// Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru).
// Any modifications are available on the same license terms as the original source code.
@file:Suppress("ReplaceJavaStaticMethodWithKotlinAnalog")
package com.intellij.ide.plugins.newui
@@ -331,13 +334,13 @@ class PluginDetailsPageComponent @JvmOverloads constructor(
AllIcons.General.Information,
IdeBundle.message("plugins.configurable.plugin.unavailable.for.platform", OS.CURRENT))
val feedbackDialogProvider = PlatformFeedbackDialogs.getInstance()
uninstallFeedbackNotification = createFeedbackNotificationPanel { pluginId: String, pluginName: String, project: Project? ->
feedbackDialogProvider.getUninstallFeedbackDialog(pluginId, pluginName, project)
}
disableFeedbackNotification = createFeedbackNotificationPanel { pluginId: String, pluginName: String, project: Project? ->
feedbackDialogProvider.getDisableFeedbackDialog(pluginId, pluginName, project)
}
//val feedbackDialogProvider = PlatformFeedbackDialogs.getInstance()
//uninstallFeedbackNotification = createFeedbackNotificationPanel { pluginId: String, pluginName: String, project: Project? ->
// feedbackDialogProvider.getUninstallFeedbackDialog(pluginId, pluginName, project)
//}
//disableFeedbackNotification = createFeedbackNotificationPanel { pluginId: String, pluginName: String, project: Project? ->
// feedbackDialogProvider.getDisableFeedbackDialog(pluginId, pluginName, project)
//}
rootPanel!!.add(panel!!, BorderLayout.CENTER)
}
@@ -442,8 +445,8 @@ class PluginDetailsPageComponent @JvmOverloads constructor(
val rootPanel = rootPanel!!
rootPanel.remove(controlledByOrgNotification)
rootPanel.remove(platformIncompatibleNotification)
rootPanel.remove(uninstallFeedbackNotification)
rootPanel.remove(disableFeedbackNotification)
//rootPanel.remove(uninstallFeedbackNotification)
//rootPanel.remove(disableFeedbackNotification)
if (!isPluginAvailable) {
if (!isPluginCompatible) {
@@ -457,15 +460,15 @@ class PluginDetailsPageComponent @JvmOverloads constructor(
val plugin = plugin
if (plugin != null && !sentFeedbackPlugins.contains(plugin.pluginId)) {
val foundPlugin = withContext(Dispatchers.IO) { UiPluginManager.getInstance().findPlugin(plugin.pluginId) }
if (foundPlugin != null && pluginModel.isUninstalled(foundPlugin.pluginId)) {
rootPanel.add(uninstallFeedbackNotification!!, BorderLayout.NORTH)
}
else {
val disabledInDiff = withContext(Dispatchers.IO) { pluginModel.isDisabledInDiff(plugin) }
if (disabledInDiff) {
rootPanel.add(disableFeedbackNotification!!, BorderLayout.NORTH)
}
}
//if (foundPlugin != null && pluginModel.isUninstalled(foundPlugin.pluginId)) {
// rootPanel.add(uninstallFeedbackNotification!!, BorderLayout.NORTH)
//}
//else {
// val disabledInDiff = withContext(Dispatchers.IO) { pluginModel.isDisabledInDiff(plugin) }
// if (disabledInDiff) {
// rootPanel.add(disableFeedbackNotification!!, BorderLayout.NORTH)
// }
//}
}
}