diff --git a/changelog.d/316.added.md b/changelog.d/316.added.md new file mode 100644 index 00000000..f02670e1 --- /dev/null +++ b/changelog.d/316.added.md @@ -0,0 +1 @@ +Added dropdown menu action that redirects to the plugin docs. \ No newline at end of file diff --git a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt index 3b6a45d3..21887a53 100644 --- a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt +++ b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt @@ -19,7 +19,8 @@ import java.util.* import javax.swing.JComponent const val DISCORD_URL = "https://discord.gg/metalbear" -const val MIRRORD_FOR_TEAMS_URL = "https://app.metalbear.co/" +const val MIRRORD_FOR_TEAMS_URL = "https://app.metalbear.co/?utm_medium=intellij&utm_source=ui_action" +const val DOCS_URL = "https://mirrord.dev/docs/using-mirrord/intellij-plugin/?utm_medium=intellij&utm_source=ui_action" /** * Copied from internal [com.intellij.execution.ui.TogglePopupAction]. @@ -164,6 +165,12 @@ class MirrordDropDown : TogglePopupAction(), DumbAware { } } + private class DocsAction : AnAction("Documentation") { + override fun actionPerformed(e: AnActionEvent) { + BrowserUtil.browse(DOCS_URL) + } + } + override fun getActionGroup(e: AnActionEvent): ActionGroup { val project = e.project ?: throw Error("mirrord requires an open project") val service = project.service() @@ -180,6 +187,7 @@ class MirrordDropDown : TogglePopupAction(), DumbAware { } addSeparator("Help") + add(DocsAction()) add(DiscordAction()) } } diff --git a/test-workspace/pyproject.toml b/test-workspace/pyproject.toml index f2f15fe0..5db9ebf1 100644 --- a/test-workspace/pyproject.toml +++ b/test-workspace/pyproject.toml @@ -4,6 +4,7 @@ version = "0.1.0" description = "" authors = [""] readme = "README.md" +package-mode = false [tool.poetry.dependencies] python = "^3.11"