Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package software.aws.toolkits.jetbrains.services.amazonq

import com.intellij.ide.BrowserUtil
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
Expand Down Expand Up @@ -48,6 +49,7 @@ import software.aws.toolkits.telemetry.Telemetry
import software.aws.toolkits.telemetry.UiTelemetry
import software.aws.toolkits.telemetry.WebviewTelemetry
import java.awt.event.ActionListener
import java.net.URI
import javax.swing.JButton
import javax.swing.JComponent

Expand Down Expand Up @@ -227,6 +229,10 @@ class QWebviewBrowser(val project: Project, private val parentDisposable: Dispos
is BrowserMessage.PublishWebviewTelemetry -> {
publishTelemetry(message)
}

is BrowserMessage.OpenUrl -> {
BrowserUtil.browse(URI(message.externalLink))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo
JsonSubTypes.Type(value = BrowserMessage.SendUiClickTelemetry::class, name = "sendUiClickTelemetry"),
JsonSubTypes.Type(value = BrowserMessage.SwitchProfile::class, name = "switchProfile"),
JsonSubTypes.Type(value = BrowserMessage.PublishWebviewTelemetry::class, name = "webviewTelemetry"),
JsonSubTypes.Type(value = BrowserMessage.OpenUrl::class, name = "openUrl"),
JsonSubTypes.Type(value = BrowserMessage.ListProfiles::class, name = "listProfiles")
)
sealed interface BrowserMessage {
Expand Down Expand Up @@ -60,6 +61,8 @@ sealed interface BrowserMessage {

object Reauth : BrowserMessage

data class OpenUrl(val externalLink: String) : BrowserMessage

data class SwitchProfile(
val profileName: String,
val accountId: String,
Expand Down
11 changes: 9 additions & 2 deletions plugins/core/webview/src/q-ui/components/profileSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
<!-- Title & Subtitle -->
<div id="profile-page" class="profile-header">
<h2 class="title bottom-small-gap">Choose a Q Developer profile</h2>
<p class="profile-subtitle">
<div class="profile-subtitle">
Your administrator has given you access to Q from multiple profiles.
Choose the profile that meets your current working needs. You can change your profile at any time.
</p>
<a @click.prevent="openUrl">More info.</a>
</div>
</div>
<!-- Profile List -->
<div class="profile-list">
Expand Down Expand Up @@ -128,6 +129,12 @@ export default defineComponent({
},
handleSignoutClick() {
window.ideApi.postMessage({command: 'signout'})
},
openUrl() {
window.ideApi.postMessage({
command: 'openUrl',
externalLink: 'https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/subscribe-understanding-profile.html'
})
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package software.aws.toolkits.jetbrains.core.explorer.webview

import com.intellij.ide.BrowserUtil
import com.intellij.ide.ui.LafManagerListener
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.AnActionEvent
Expand Down Expand Up @@ -60,6 +61,7 @@ import software.aws.toolkits.jetbrains.utils.isTookitConnected
import software.aws.toolkits.telemetry.FeatureId
import software.aws.toolkits.telemetry.UiTelemetry
import java.awt.event.ActionListener
import java.net.URI
import javax.swing.JButton
import javax.swing.JComponent

Expand Down Expand Up @@ -251,6 +253,10 @@ class ToolkitWebviewBrowser(val project: Project, private val parentDisposable:
is BrowserMessage.PublishWebviewTelemetry -> {
publishTelemetry(message)
}

is BrowserMessage.OpenUrl -> {
BrowserUtil.browse(URI(message.externalLink))
}
}
}

Expand Down
Loading