Skip to content

Commit

Permalink
feat: updating the custom endpoint description (IDE-735) (#633)
Browse files Browse the repository at this point in the history
* feat: updating the custom endpoint description

* fix: move the label below the setting
  • Loading branch information
acke authored Nov 6, 2024
1 parent 7ee680b commit 759936f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [2.11.0]
### Changed
- If $/snyk.hasAuthenticated transmits an API URL, this is saved in the settings.
- Added a description of custom endpoints to settings dialog.

## [2.10.0]
### Changed
Expand Down
29 changes: 24 additions & 5 deletions src/main/kotlin/io/snyk/plugin/ui/SnykSettingsDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SnykSettingsDialog(

/** General settings ------------------ */

val generalSettingsPanel = JPanel(UIGridLayoutManager(7, 3, JBUI.emptyInsets(), -1, -1))
val generalSettingsPanel = JPanel(UIGridLayoutManager(8, 3, JBUI.emptyInsets(), -1, -1))
generalSettingsPanel.border = IdeBorderFactory.createTitledBorder("General settings")

rootPanel.add(
Expand Down Expand Up @@ -320,11 +320,30 @@ class SnykSettingsDialog(
),
)

val endpointDescriptionLabel =
JLabel(
"<html>Sets API endpoint to use for Snyk requests. Useful for custom Snyk setups. <br/>" +
"E.g. <code>https://api.eu.snyk.io</code>.</html>",
).apply { font = FontUtil.minusOne(this.font) }

generalSettingsPanel.add(
endpointDescriptionLabel,
baseGridConstraints(
row = 5,
column = 1,
colSpan = 2,
indent = 0,
anchor = UIGridConstraints.ANCHOR_WEST,
fill = UIGridConstraints.FILL_NONE,
hSizePolicy = UIGridConstraints.SIZEPOLICY_CAN_SHRINK or UIGridConstraints.SIZEPOLICY_CAN_GROW,
),
)

ignoreUnknownCACheckBox.text = "Ignore unknown CA"
generalSettingsPanel.add(
ignoreUnknownCACheckBox,
baseGridConstraints(
row = 5,
row = 6,
column = 1,
colSpan = 1,
anchor = UIGridConstraints.ANCHOR_WEST,
Expand All @@ -339,15 +358,15 @@ class SnykSettingsDialog(
generalSettingsPanel.add(
organizationLabel,
baseGridConstraintsAnchorWest(
row = 6,
row = 7,
indent = 0,
),
)

generalSettingsPanel.add(
organizationTextField,
baseGridConstraints(
row = 6,
row = 7,
column = 1,
colSpan = 1,
anchor = UIGridConstraints.ANCHOR_WEST,
Expand All @@ -368,7 +387,7 @@ class SnykSettingsDialog(
generalSettingsPanel.add(
organizationContextHelpLabel,
baseGridConstraintsAnchorWest(
row = 6,
row = 7,
column = 2,
indent = 0,
fill = UIGridConstraints.FILL_NONE,
Expand Down

0 comments on commit 759936f

Please sign in to comment.