Inline desktop external links
This commit is contained in:
1
AUDIT.md
1
AUDIT.md
@@ -44,6 +44,7 @@ after each item.
|
||||
- [x] `desktop/server.ex`
|
||||
- [x] `desktop/shell_live/code_entity_editor.ex`
|
||||
- [x] `scripting/runtime.ex`
|
||||
- [x] `desktop/external_links.ex`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
defmodule BDS.Desktop.ExternalLinks do
|
||||
@moduledoc false
|
||||
|
||||
@github_url "https://github.com/rfc1437/bDS2"
|
||||
@github_issues_url "#{@github_url}/issues"
|
||||
|
||||
@spec github_url() :: String.t()
|
||||
def github_url, do: @github_url
|
||||
|
||||
@spec github_issues_url() :: String.t()
|
||||
def github_issues_url, do: @github_issues_url
|
||||
end
|
||||
@@ -2,7 +2,7 @@ defmodule BDS.Desktop.MenuBar do
|
||||
@moduledoc false
|
||||
|
||||
use BDS.Desktop.MenuCompat
|
||||
alias BDS.Desktop.{ExternalLinks, ShellData, Shutdown, UILocale}
|
||||
alias BDS.Desktop.{ShellData, Shutdown, UILocale}
|
||||
alias BDS.UI.Commands
|
||||
alias BDS.UI.MenuBar, as: ShellMenuBar
|
||||
alias Desktop.OS
|
||||
@@ -59,7 +59,7 @@ defmodule BDS.Desktop.MenuBar do
|
||||
end
|
||||
|
||||
def handle_event("view_on_github", menu) do
|
||||
OS.launch_default_browser(ExternalLinks.github_url())
|
||||
OS.launch_default_browser("https://github.com/rfc1437/bDS2")
|
||||
{:noreply, menu}
|
||||
end
|
||||
|
||||
@@ -78,7 +78,7 @@ defmodule BDS.Desktop.MenuBar do
|
||||
end
|
||||
|
||||
def handle_event("report_issue", menu) do
|
||||
OS.launch_default_browser(ExternalLinks.github_issues_url())
|
||||
OS.launch_default_browser("https://github.com/rfc1437/bDS2/issues")
|
||||
{:noreply, menu}
|
||||
end
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ defmodule BDS.Desktop.ShellLive do
|
||||
|
||||
alias BDS.{AI, Blogmark, BoundedAtoms, Metadata}
|
||||
alias BDS.CliSync.Watcher
|
||||
alias BDS.Desktop.{ExternalLinks, FilePicker, FolderPicker, ShellData, UILocale}
|
||||
alias BDS.Desktop.{FilePicker, FolderPicker, ShellData, UILocale}
|
||||
|
||||
alias BDS.Desktop.ShellLive.{
|
||||
Bridges,
|
||||
@@ -1326,12 +1326,12 @@ defmodule BDS.Desktop.ShellLive do
|
||||
end
|
||||
|
||||
defp handle_socket_menu_action(socket, :view_on_github) do
|
||||
OS.launch_default_browser(ExternalLinks.github_url())
|
||||
OS.launch_default_browser("https://github.com/rfc1437/bDS2")
|
||||
socket
|
||||
end
|
||||
|
||||
defp handle_socket_menu_action(socket, :report_issue) do
|
||||
OS.launch_default_browser(ExternalLinks.github_issues_url())
|
||||
OS.launch_default_browser("https://github.com/rfc1437/bDS2/issues")
|
||||
socket
|
||||
end
|
||||
|
||||
|
||||
@@ -169,13 +169,6 @@ defmodule BDS.DesktopTest do
|
||||
assert_receive :quit_requested
|
||||
end
|
||||
|
||||
test "desktop external links point at the bDS2 GitHub project and issue tracker" do
|
||||
assert BDS.Desktop.ExternalLinks.github_url() == "https://github.com/rfc1437/bDS2"
|
||||
|
||||
assert BDS.Desktop.ExternalLinks.github_issues_url() ==
|
||||
"https://github.com/rfc1437/bDS2/issues"
|
||||
end
|
||||
|
||||
test "icon menu quit requests app-owned shutdown" do
|
||||
previous_module = Application.get_env(:bds, :desktop_shutdown_module)
|
||||
previous_pid = Application.get_env(:bds, :desktop_shutdown_test_pid)
|
||||
|
||||
Reference in New Issue
Block a user