Skip to content

Commit

Permalink
Fix images in 'Authenticate' panel (#3980)
Browse files Browse the repository at this point in the history
Image was available in the sandbox, but were not getting bundled into the final artifact
  • Loading branch information
rli authored Nov 9, 2023
1 parent c4df8da commit bbba98f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Fix issue where images in 'Authenticate' panel do not show up"
}
13 changes: 4 additions & 9 deletions jetbrains-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,11 @@ artifacts {
add("gatewayArtifacts", gatewayJar)
}

val codewhispererReadmeAssets = tasks.register<Sync>("codewhispererReadmeAssets") {
from("${project.projectDir}/assets")
into("$buildDir/assets")
}

tasks.prepareSandbox {
dependsOn(codewhispererReadmeAssets)
from(codewhispererReadmeAssets) {
into("aws-toolkit-jetbrains/assets")
}
// you probably do not want to modify this.
// this affects the IDE sandbox / build for `:jetbrains-core`, but will not propogate to the build generated by `:intellij`
// (which is what is ultimately published to the marketplace)
// without additional effort
}

tasks.testJar {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class GettingStartedPanel(
}
}

image(AwsToolkit.pluginPath().resolve("assets").resolve("codecatalyst.png").toString())
image("/gettingstarted/codecatalyst.png")

row {
text(message("caws.getstarted.panel.description"))
Expand Down Expand Up @@ -533,7 +533,7 @@ class GettingStartedPanel(
}
}

image(AwsToolkit.pluginPath().resolve("assets").resolve("explorer.png").toString())
image("/gettingstarted/explorer.png")

row {
text(message("aws.getstarted.resource.panel_description"))
Expand Down Expand Up @@ -741,7 +741,7 @@ class GettingStartedPanel(
}
}

image(AwsToolkit.pluginPath().resolve("assets").resolve("codewhisperer.png").toString())
image("/gettingstarted/codewhisperer.png")

row {
text(message("codewhisperer.gettingstarted.panel.comment"))
Expand Down Expand Up @@ -1050,7 +1050,8 @@ class GettingStartedPanel(

protected fun Panel.image(path: String) {
row {
val image = ImageIcon(path).image
// `this` is a [Row], so class needs to be specified or we get the wrong classloader
val image = ImageIcon(GettingStartedPanel::class.java.getResource(path)).image
// need to account for margin introduced by indent
// Image.SCALE_DEFAULT is the only valid parameter for gifs
.getScaledInstance(PANEL_WIDTH - (indentSize * 2), -1, if (path.endsWith("gif")) Image.SCALE_DEFAULT else Image.SCALE_SMOOTH)
Expand Down

0 comments on commit bbba98f

Please sign in to comment.