Skip to content

Commit 759936f

Browse files
authored
feat: updating the custom endpoint description (IDE-735) (#633)
* feat: updating the custom endpoint description * fix: move the label below the setting
1 parent 7ee680b commit 759936f

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [2.11.0]
44
### Changed
55
- If $/snyk.hasAuthenticated transmits an API URL, this is saved in the settings.
6+
- Added a description of custom endpoints to settings dialog.
67

78
## [2.10.0]
89
### Changed

src/main/kotlin/io/snyk/plugin/ui/SnykSettingsDialog.kt

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class SnykSettingsDialog(
205205

206206
/** General settings ------------------ */
207207

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

211211
rootPanel.add(
@@ -320,11 +320,30 @@ class SnykSettingsDialog(
320320
),
321321
)
322322

323+
val endpointDescriptionLabel =
324+
JLabel(
325+
"<html>Sets API endpoint to use for Snyk requests. Useful for custom Snyk setups. <br/>" +
326+
"E.g. <code>https://api.eu.snyk.io</code>.</html>",
327+
).apply { font = FontUtil.minusOne(this.font) }
328+
329+
generalSettingsPanel.add(
330+
endpointDescriptionLabel,
331+
baseGridConstraints(
332+
row = 5,
333+
column = 1,
334+
colSpan = 2,
335+
indent = 0,
336+
anchor = UIGridConstraints.ANCHOR_WEST,
337+
fill = UIGridConstraints.FILL_NONE,
338+
hSizePolicy = UIGridConstraints.SIZEPOLICY_CAN_SHRINK or UIGridConstraints.SIZEPOLICY_CAN_GROW,
339+
),
340+
)
341+
323342
ignoreUnknownCACheckBox.text = "Ignore unknown CA"
324343
generalSettingsPanel.add(
325344
ignoreUnknownCACheckBox,
326345
baseGridConstraints(
327-
row = 5,
346+
row = 6,
328347
column = 1,
329348
colSpan = 1,
330349
anchor = UIGridConstraints.ANCHOR_WEST,
@@ -339,15 +358,15 @@ class SnykSettingsDialog(
339358
generalSettingsPanel.add(
340359
organizationLabel,
341360
baseGridConstraintsAnchorWest(
342-
row = 6,
361+
row = 7,
343362
indent = 0,
344363
),
345364
)
346365

347366
generalSettingsPanel.add(
348367
organizationTextField,
349368
baseGridConstraints(
350-
row = 6,
369+
row = 7,
351370
column = 1,
352371
colSpan = 1,
353372
anchor = UIGridConstraints.ANCHOR_WEST,
@@ -368,7 +387,7 @@ class SnykSettingsDialog(
368387
generalSettingsPanel.add(
369388
organizationContextHelpLabel,
370389
baseGridConstraintsAnchorWest(
371-
row = 6,
390+
row = 7,
372391
column = 2,
373392
indent = 0,
374393
fill = UIGridConstraints.FILL_NONE,

0 commit comments

Comments
 (0)