From a03adc096eef4de560086f776a7ba83c8ed46b07 Mon Sep 17 00:00:00 2001 From: Ivan Migalev Date: Sat, 4 Jan 2025 18:48:45 +0100 Subject: [PATCH] (IJPL-173684, IJ-CR-152618) What's New: disable content versioning for web content This will prevent such contents from appearing automatically. (cherry picked from commit dddec2df81308c53edd148148e8e04ae6fd6c3b2) GitOrigin-RevId: 43481d6e805286044338fd681d0613254b84cf4d --- .../platform/whatsNew/WhatsNewContent.kt | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt index 0cdf8008a42d..ebddaf27649f 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.whatsNew import com.intellij.ide.IdeBundle @@ -146,29 +146,6 @@ internal class WhatsNewUrlContent(val url: String) : WhatsNewContent() { "LearnMoreStickyScrollEAP", "NewRiderProject", "BlazorHotReloadEAP") } - private val linkRegEx = "^https://www\\.jetbrains\\.com/[a-zA-Z]+/whatsnew(-eap)?/(\\d+)-(\\d+)-(\\d+)/$".toRegex() - - private fun parseUrl(link: String): ContentVersion? { - val parseResult = linkRegEx.matchEntire(link)?.let { - val year = it.groups[it.groups.size - 3]?.value ?: return@let null - val release = it.groups[it.groups.size - 2]?.value ?: return@let null - val eap = it.groups[it.groups.size - 1]?.value?.toInt() ?: return@let null - ContentVersion(year, release, eap, null) - } - - if (parseResult == null) { - LOG.warn("Cannot parse IDE version for What's New content from URL: \"$link\".") - } - - return when { - parseResult != null -> parseResult - ApplicationInfo.getInstance().isEAP -> null - else -> ApplicationInfo.getInstance().let { - ContentVersion(it.majorVersion, it.minorVersion, eap = null, hash = null) - } - } - } - override fun getRequest(dataContext: DataContext?): HTMLEditorProvider.Request { val parameters = HashMap() parameters["var"] = "embed" @@ -199,9 +176,7 @@ internal class WhatsNewUrlContent(val url: String) : WhatsNewContent() { return actionWhiteList } - override fun getVersion(): ContentVersion? { - return parseUrl(url) - } + override fun getVersion(): ContentVersion? = null override suspend fun isAvailable(): Boolean { return checkConnectionAvailable()