Skip to content

Commit

Permalink
SLI-1790 Promote SQC free plan inside the IDE extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
nquinquenel committed Dec 27, 2024
1 parent 0626f6e commit f382529
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,9 @@
<html.disable class="java.lang.Boolean" value="false"/>
</clientProperties>
</component>
<component id="6000f" class="javax.swing.JEditorPane" binding="sonarCloudFree" custom-create="true">
<constraints>
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="150" height="50"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
<grid id="67a8a" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="67a8a" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand All @@ -150,7 +142,7 @@
<grid id="2a5be" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -194,14 +186,6 @@
</constraints>
<properties/>
</component>
<component id="47aa" class="javax.swing.JEditorPane" binding="sonarQubeFree" custom-create="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="150" height="50"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
</children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
import org.sonarlint.intellij.telemetry.LinkTelemetry;

import static org.sonarlint.intellij.common.util.SonarLintUtils.SONARCLOUD_URL;
import static org.sonarlint.intellij.telemetry.LinkTelemetry.COMPARE_SERVER_PRODUCTS;
import static org.sonarlint.intellij.telemetry.LinkTelemetry.SONARCLOUD_PRODUCT_PAGE;
import static org.sonarlint.intellij.telemetry.LinkTelemetry.SONARQUBE_EDITIONS_DOWNLOADS;
import static org.sonarlint.intellij.telemetry.LinkTelemetry.SONARCLOUD_FREE_SIGNUP_PAGE;

public class ServerStep extends AbstractWizardStepEx {
private static final int NAME_MAX_LENGTH = 50;
Expand All @@ -70,8 +68,6 @@ public class ServerStep extends AbstractWizardStepEx {
private JButton proxyButton;
private JEditorPane sonarQubeDescription;
private JEditorPane sonarCloudDescription;
private JEditorPane sonarCloudFree;
private JEditorPane sonarQubeFree;
private JEditorPane compareProducts;
private ErrorPainter errorPainter;

Expand Down Expand Up @@ -101,14 +97,8 @@ protected void textChanged(DocumentEvent e) {
"and extends the CI/CD workflow to systematically help developers and organizations deliver Clean Code.";
sonarCloudDescription.setText(cloudMainText);

initEditorPane(sonarCloudFree, "<a href=\"" + SONARCLOUD_PRODUCT_PAGE.getUrl() + "\">SonarQube Cloud</a> is entirely free for open source projects",
SONARCLOUD_PRODUCT_PAGE);

initEditorPane(sonarQubeFree, "SonarQube Server offers a free <a href=\"" + SONARQUBE_EDITIONS_DOWNLOADS.getUrl() + "\">Community Build</a>",
SONARQUBE_EDITIONS_DOWNLOADS);

initEditorPane(compareProducts, "Discover which option is the best for your team <a href=\"" + COMPARE_SERVER_PRODUCTS.getUrl() + "\">here</a>",
COMPARE_SERVER_PRODUCTS);
initEditorPane(compareProducts, "Explore SonarQube Cloud with our <a href=\"" + SONARCLOUD_FREE_SIGNUP_PAGE.getUrl() + "\">free tier</a>",
SONARCLOUD_FREE_SIGNUP_PAGE);

if (!editing) {
sonarqubeIcon.addMouseListener(new MouseInputAdapter() {
Expand Down Expand Up @@ -274,8 +264,6 @@ private void createUIComponents() {
sonarqubeText = SwingHelper.createHtmlViewer(false, null, null, null);
sonarQubeDescription = SwingHelper.createHtmlViewer(false, null, null, null);
sonarCloudDescription = SwingHelper.createHtmlViewer(false, null, null, null);
sonarCloudFree = SwingHelper.createHtmlViewer(false, null, null, null);
sonarQubeFree = SwingHelper.createHtmlViewer(false, null, null, null);
compareProducts = SwingHelper.createHtmlViewer(false, null, null, null);

var text = new JBTextField();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ object SonarLintDocumentation {

object Marketing {
private const val BASE_MARKETING_URL = "https://www.sonarsource.com"
const val COMPARE_SERVER_PRODUCTS_LINK = "$BASE_MARKETING_URL/open-source-editions"
const val SONARQUBE_EDITIONS_DOWNLOADS_LINK = "$BASE_MARKETING_URL/products/sonarqube/downloads"
const val SONARCLOUD_PRODUCT_LINK = "$BASE_MARKETING_URL/products/sonarcloud"
const val SONARCLOUD_PRODUCT_SIGNUP_LINK = "$BASE_MARKETING_URL/products/sonarcloud/signup/"
const val SONARCLOUD_PRODUCT_SIGNUP_LINK = "$BASE_MARKETING_URL/products/sonarcloud/signup-free/"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class SonarLintProjectNotifications(private val myProject: Project) {
content,
NotificationType.INFORMATION
).apply {
addAction(OpenTrackedLinkAction("Try SonarQube Cloud for free", LinkTelemetry.SONARCLOUD_SIGNUP_PAGE))
addAction(OpenTrackedLinkAction("Try SonarQube Cloud for free", LinkTelemetry.SONARCLOUD_FREE_SIGNUP_PAGE))
addAction(OpenTrackedLinkAction("Download SonarQube Server", LinkTelemetry.SONARQUBE_EDITIONS_DOWNLOADS))
addAction(OpenInBrowserAction("Learn more", null, CONNECTED_MODE_BENEFITS_LINK))
addAction(DontAskAgainAction())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ import org.sonarlint.intellij.documentation.SonarLintDocumentation
import org.sonarlint.intellij.documentation.SonarLintDocumentation.Intellij.RULE_SECTION_LINK

enum class LinkTelemetry(
val linkId: String,
private val linkId: String,
val url: String
) {

SONARCLOUD_SIGNUP_PAGE("sonarCloudSignUpPage", SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_SIGNUP_LINK),
SONARCLOUD_FREE_SIGNUP_PAGE("sonarqubeCloudFreeSignUp", SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_SIGNUP_LINK),
CONNECTED_MODE_DOCS("connectedModeDocs", SonarLintDocumentation.Intellij.CONNECTED_MODE_LINK),
COMPARE_SERVER_PRODUCTS("compareServerProducts", SonarLintDocumentation.Marketing.COMPARE_SERVER_PRODUCTS_LINK),
SONARQUBE_EDITIONS_DOWNLOADS("sonarQubeEditionsDownloads", SonarLintDocumentation.Marketing.SONARQUBE_EDITIONS_DOWNLOADS_LINK),
SONARCLOUD_PRODUCT_PAGE("sonarCloudProductPage", SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_LINK),
RULE_SELECTION_PAGE("rulesSelectionDocs", RULE_SECTION_LINK);

fun browseWithTelemetry() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class HelpLabelUtils {
"SonarQube Cloud complements SonarQube for IDE by detecting more across the whole project.",
"Try SonarQube Cloud for free", true
) {
LinkTelemetry.SONARCLOUD_SIGNUP_PAGE.browseWithTelemetry()
LinkTelemetry.SONARCLOUD_FREE_SIGNUP_PAGE.browseWithTelemetry()
}

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class SonarLintDocumentationTests {

SonarLintDocumentation.SonarCloud.SMART_NOTIFICATIONS,

SonarLintDocumentation.Marketing.COMPARE_SERVER_PRODUCTS_LINK,
SonarLintDocumentation.Marketing.SONARQUBE_EDITIONS_DOWNLOADS_LINK,
SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_LINK,
SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_SIGNUP_LINK,
Expand Down

0 comments on commit f382529

Please sign in to comment.