Skip to content

Commit

Permalink
Added redirect to docs (#319)
Browse files Browse the repository at this point in the history
* Added redirect

* Change action name

* Fix changelog

* Added utm medium

* Added utm_source

* Fixed poetry in E2E
  • Loading branch information
Razz4780 authored Jan 7, 2025
1 parent 1ff38d8 commit fdb221f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/316.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added dropdown menu action that redirects to the plugin docs.
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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<MirrordProjectService>()
Expand All @@ -180,6 +187,7 @@ class MirrordDropDown : TogglePopupAction(), DumbAware {
}

addSeparator("Help")
add(DocsAction())
add(DiscordAction())
}
}
Expand Down
1 change: 1 addition & 0 deletions test-workspace/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.0"
description = ""
authors = [""]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.11"
Expand Down

0 comments on commit fdb221f

Please sign in to comment.