-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLI-1788 SLI-1784 SLI-1796 Create Walkthrough for SonarQube for IDE #1280
SLI-1788 SLI-1784 SLI-1796 Create Walkthrough for SonarQube for IDE #1280
Conversation
6b802ef
to
514515f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SonarLintWalkthroughToolWindow file is huge and very hard to follow, and I feel like has lots of duplications. I would suggest to either deduplicate common logic and object creations by extracting them to methods, or separate each walkthrough step in a separate file.
I also added some suggestions about wording and capitalization.
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
SONARQUBE_FOR_IDE + " supports the analysis of 15+ languages including Python, Java, Javascript, IaC domains along with secrets " + | ||
"detection. " + | ||
"<a href=\"" + RULE_SECTION_LINK + "\">Learn more</a>.<br><br>" + | ||
"Detect issues while you code in an open files or run the analysis on more file in the <a href=\"#reportView\">report view</a>" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Detect issues while you code in an open files or run the analysis on more file in the <a href=\"#reportView\">report view</a>" + | |
"Detect issues in open files while you code, or run the analysis of more files from the <a href=\"#reportView\">Report view</a>" + |
"<a href=\"" + RULE_SECTION_LINK + "\">Learn more</a>.<br><br>" + | ||
"Detect issues while you code in an open files or run the analysis on more file in the <a href=\"#reportView\">report view</a>" + | ||
".<br><br>" + | ||
"Open a file and start your clean code journey.</body></html>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Open a file and start your clean code journey.</body></html>"); | |
"Open a file and start your Clean Code journey.</body></html>"); |
"Apply the same set of rules as your team by using " + SONARQUBE_FOR_IDE + " in Connected Mode with SonarQube Cloud or SonarQube " + | ||
"Server" + | ||
".<br><br>" + | ||
"With connected mode, benefit from advanced analysis like <a href=\"#taintVulnerabilities\">Taint Vulnerabilities</a> and open " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"With connected mode, benefit from advanced analysis like <a href=\"#taintVulnerabilities\">Taint Vulnerabilities</a> and open " + | |
"With Connected Mode, benefit from advanced analysis like <a href=\"#taintVulnerabilities\">Taint Vulnerabilities</a> and open " + |
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second Sophio here that this needs some de-duplication and documentation as well.
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/SonarLintWalkthroughToolWindow.java
Outdated
Show resolved
Hide resolved
062931f
to
03ec2a6
Compare
Quality Gate failedFailed conditions See analysis details on SonarQube Catch issues before they fail your Quality Gate with our IDE extension SonarQube IDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been a long-standing practice to create new classes in Kotlin rather than Java. I'd recommend doing so, as it would help increase the code's readability (Swing is quite heavy to write).
I'd also move every related page to a dedicated directory, as the UI package is already quite packed.
Other than that, there are a few more comments (most of them are applicable to all the **Page
classes), but the result is already quite visible and working, it's almost good!
src/main/java/org/sonarlint/intellij/ui/ConnectWithYourTeamPage.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/ConnectWithYourTeamPage.java
Outdated
Show resolved
Hide resolved
var font = UIUtil.getLabelFont(); | ||
learnAsYouCodePagePanel = new JPanel(new BorderLayout()); | ||
|
||
var icon = new ImageIcon(Objects.requireNonNull(getClass().getResource("/images/sonarqube-for-ide-mark.png"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, get the image icon from SonarLintIcon. Also I'd recommend using SVG as much as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the new images arrive I will convert if there are not in svg
src/main/java/org/sonarlint/intellij/ui/LearnAsYouCodePage.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
private static JEditorPane createWelcomePageText(Font font, Project project) { | ||
var descriptionPane = new JEditorPane(SonarLintWalkthroughToolWindow.EDITOR_PANE_TYPE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be personal, but I'm not a big fan of using huge blocks of HTML in Java Swing components. I'd rather have a clean layout and structure with proper layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used SwingHelper.createHtmlViewer as discussed
src/main/java/org/sonarlint/intellij/ui/LearnAsYouCodePage.java
Outdated
Show resolved
Hide resolved
|
||
descriptionPane.addHyperlinkListener(new HyperlinkAdapter() { | ||
@Override | ||
protected void hyperlinkActivated(HyperlinkEvent e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this link management a bit dirty, I think breaking down the big HTML block into Swing components would help with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed I used SwingHelper.createHtmlViewer
src/main/java/org/sonarlint/intellij/OpenWelcomePageOnceOneProjectOpened.java
Show resolved
Hide resolved
8c281e1
to
29ae573
Compare
src/main/java/org/sonarlint/intellij/ui/walkthrough/SonarLintWalkthroughToolWindow.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/ReachOutToUsPanel.kt
Outdated
Show resolved
Hide resolved
29ae573
to
552828c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another round of comments following the kotlin refactoring, it's looking better!
src/main/java/org/sonarlint/intellij/ui/walkthrough/LearnAsYouCodePanel.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/LearnAsYouCodePanel.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/LearnAsYouCodePanel.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/LearnAsYouCodePanel.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/LearnAsYouCodePanel.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/SonarLintWalkthroughUtils.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/SonarLintWalkthroughUtils.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/SonarLintWalkthroughUtils.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/documentation/SonarLintDocumentation.kt
Show resolved
Hide resolved
60b1159
to
37ae04a
Compare
4e9449f
to
535e78b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge it in the feature branch for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please fix these two typos.
src/main/java/org/sonarlint/intellij/ui/walkthrough/WelcomePanel.kt
Outdated
Show resolved
Hide resolved
src/main/java/org/sonarlint/intellij/ui/walkthrough/ReachOutToUsPanel.kt
Outdated
Show resolved
Hide resolved
535e78b
to
d7c3a42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Quality Gate passedIssues Measures |
514c750
into
feature/ef/intellij-walkthrough
4 Page walkthrough the let user get familiar with the SonarQube IDE functionalities