diff --git a/Common/src/main/java/com/tabnineCommon/capabilities/Capability.java b/Common/src/main/java/com/tabnineCommon/capabilities/Capability.java index 2d2a261c..cc4b9e0f 100644 --- a/Common/src/main/java/com/tabnineCommon/capabilities/Capability.java +++ b/Common/src/main/java/com/tabnineCommon/capabilities/Capability.java @@ -23,4 +23,8 @@ public enum Capability { FORCE_REGISTRATION, @SerializedName("plugin.feature.tabnine_chat") TABNINE_CHAT, + @SerializedName("preview") + PREVIEW_CAPABILITY, + @SerializedName("preview_ended") + PREVIEW_ENDED_CAPABILITY, } diff --git a/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledComponents.kt b/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledComponents.kt index 15ac1b2c..d4c67cde 100644 --- a/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledComponents.kt +++ b/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledComponents.kt @@ -7,8 +7,20 @@ import javax.swing.JEditorPane import javax.swing.event.HyperlinkEvent import javax.swing.event.HyperlinkListener +const val PREVIEW_ENDED_MESSAGE = """ +
+The preview period for Tabnine Chat has now ended. We hope you found our plugin valuable for your coding projects and enjoyed using it.
+To continue enjoying Tabnine Chat and explore its full range of features, we invite you to consider subscribing to one of our plans. Detailed information about our pricing and the additional benefits of a subscription can be found on our pricing page.
+If you have any questions or need assistance, our support team is always ready to help. Thank you for your understanding and support!
+We understand that waiting for this awesome feature isn’t easy, but we guarantee it will be worth it.
@@ -19,7 +31,7 @@ const val FEATURE_MISSING = """ """ const val PLEASE_LOGIN = """ - +We understand that waiting for this awesome feature isn’t easy, but we guarantee it will be worth it.
@@ -31,7 +43,7 @@ const val PLEASE_LOGIN = """ """ const val NEED_TO_BE_PART_OF_A_TEAM = """ - +To use Tabnine chat please make sure you are part of a team.
@@ -43,6 +55,7 @@ const val NEED_TO_BE_PART_OF_A_TEAM = """ fun createChatDisabledJPane(chatDisabledReason: ChatDisabledReason): JEditorPane { val htmlContent = when (chatDisabledReason) { ChatDisabledReason.AUTHENTICATION_REQUIRED -> PLEASE_LOGIN + ChatDisabledReason.PREVIEW_ENDED -> PREVIEW_ENDED_MESSAGE ChatDisabledReason.FEATURE_REQUIRED -> FEATURE_MISSING ChatDisabledReason.PART_OF_A_TEAM_REQUIRED -> NEED_TO_BE_PART_OF_A_TEAM } diff --git a/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledReason.kt b/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledReason.kt index d0f9a82b..33aca54f 100644 --- a/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledReason.kt +++ b/Common/src/main/java/com/tabnineCommon/chat/ChatDisabledReason.kt @@ -24,6 +24,7 @@ data class ChatState private constructor( enum class ChatDisabledReason { AUTHENTICATION_REQUIRED, + PREVIEW_ENDED, FEATURE_REQUIRED, PART_OF_A_TEAM_REQUIRED, } diff --git a/Tabnine/src/main/java/com/tabnine/chat/ChatEnabledState.kt b/Tabnine/src/main/java/com/tabnine/chat/ChatEnabledState.kt index eddfcbc7..6dd19673 100644 --- a/Tabnine/src/main/java/com/tabnine/chat/ChatEnabledState.kt +++ b/Tabnine/src/main/java/com/tabnine/chat/ChatEnabledState.kt @@ -50,10 +50,12 @@ class ChatEnabledState private constructor() : ChatFrame.UseChatEnabledState, val isLoggedIn = binaryState.isLoggedIn ?: return val hasCapability = - capabilities.anyEnabled(Capability.ALPHA, Capability.TABNINE_CHAT) + capabilities.anyEnabled(Capability.ALPHA, Capability.TABNINE_CHAT, Capability.PREVIEW_CAPABILITY) if (isLoggedIn && hasCapability) { set(ChatState.enabled()) + } else if (capabilities.isEnabled(Capability.PREVIEW_ENDED_CAPABILITY)) { + set(ChatState.disabled(ChatDisabledReason.PREVIEW_ENDED)) } else if (isLoggedIn) { set(ChatState.disabled(ChatDisabledReason.FEATURE_REQUIRED)) } else {