Skip to content

Commit

Permalink
Add @disabled to LivebookWeb.Hub.FileSystemFormComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Dec 17, 2024
1 parent ac96e4b commit a6aad6a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/livebook_web/live/hub/edit/personal_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ defmodule LivebookWeb.Hub.Edit.PersonalComponent do
module={LivebookWeb.Hub.FileSystemFormComponent}
id="file-systems"
hub={@hub}
disabled={false}
file_system={@file_system}
file_system_id={@file_system_id}
return_to={~p"/hub/#{@hub.id}"}
Expand Down
1 change: 1 addition & 0 deletions lib/livebook_web/live/hub/edit/team_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
module={LivebookWeb.Hub.FileSystemFormComponent}
id="file-systems"
hub={@hub}
disabled={not @hub.active}
file_system={@file_system}
file_system_id={@file_system_id}
return_to={~p"/hub/#{@hub.id}"}
Expand Down
8 changes: 1 addition & 7 deletions lib/livebook_web/live/hub/file_system_form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
</p>
<% end %>
<div class="flex space-x-2">
<.button
type="submit"
disabled={
not @changeset.valid? or
match?(%Livebook.Hubs.Team{active: false}, @hub)
}
>
<.button type="submit" disabled={@disabled or not @changeset.valid?}>
<.remix_icon icon={@button.icon} />
<span class="font-normal">{@button.label}</span>
</.button>
Expand Down

0 comments on commit a6aad6a

Please sign in to comment.