Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion lib/synkade_web/components/layouts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ defmodule SynkadeWeb.Layouts do

<div class="px-3 mb-1 flex items-center justify-between">
<span class="ops-label text-primary/70">Projects</span>
<.link navigate="/projects" title="Add project" class="text-primary/50 hover:text-primary transition-colors">
<.link navigate="/projects/new" title="Add project" class="text-primary/50 hover:text-primary transition-colors">
<.icon name="hero-plus" class="size-3.5" />
</.link>
</div>
Expand Down
14 changes: 11 additions & 3 deletions lib/synkade_web/live/projects_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule SynkadeWeb.ProjectsLive do
alias Synkade.Settings.Project

@impl true
def mount(_params, _session, socket) do
def mount(params, _session, socket) do
scope = socket.assigns.current_scope

if connected?(socket) do
Expand All @@ -17,6 +17,14 @@ defmodule SynkadeWeb.ProjectsLive do

orc_state = Jobs.get_state(scope)

{editing, form} =
if params["new"] do
changeset = Settings.change_project(%Project{})
{:new, to_form(changeset)}
else
{nil, nil}
end

{:ok,
socket
|> assign(:page_title, "Projects")
Expand All @@ -27,8 +35,8 @@ defmodule SynkadeWeb.ProjectsLive do
|> SynkadeWeb.Sidebar.assign_sidebar(scope)
|> assign(:db_projects, Settings.list_projects(scope))
|> assign(:agents, Settings.list_agents(scope))
|> assign(:editing, nil)
|> assign(:form, nil)}
|> assign(:editing, editing)
|> assign(:form, form)}
end

@impl true
Expand Down
1 change: 1 addition & 0 deletions lib/synkade_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ defmodule SynkadeWeb.Router do
on_mount: [{SynkadeWeb.UserAuth, :require_authenticated}, {SynkadeWeb.Picker, :picker}] do
live "/", DashboardLive
live "/projects/:name", DashboardLive
live "/projects/new", ProjectsLive
live "/issues", IssuesLive
live "/issues/:id", IdeLive
live "/chat/:project_name", IdeLive
Expand Down