mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-16 16:36:26 +08:00
Git integration copy/UX refinements (#3074)
This commit is contained in:
parent
871a0a0c67
commit
95cfe753f3
3 changed files with 16 additions and 8 deletions
|
@ -73,7 +73,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
|
||||||
checked_value={:git}
|
checked_value={:git}
|
||||||
disabled={@mode == :edit}
|
disabled={@mode == :edit}
|
||||||
>
|
>
|
||||||
Configure a read-only Git repository as a Livebook file storage. You will need a valid SSH key to access your Git repository.
|
Configure a Git repository as a read-only Livebook file storage. You will need a valid SSH key to access your Git repository.
|
||||||
</.radio_card_input>
|
</.radio_card_input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -91,7 +91,11 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
|
||||||
<.file_system_form_fields {assigns} />
|
<.file_system_form_fields {assigns} />
|
||||||
|
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<.button type="submit" disabled={@disabled or not @form.source.valid?}>
|
<.button
|
||||||
|
type="submit"
|
||||||
|
disabled={@disabled or not @form.source.valid?}
|
||||||
|
>
|
||||||
|
<.spinner class="hidden phx-submit-loading:block mr-1" />
|
||||||
<.remix_icon icon={@button.icon} />
|
<.remix_icon icon={@button.icon} />
|
||||||
<span class="font-normal">{@button.label}</span>
|
<span class="font-normal">{@button.label}</span>
|
||||||
</.button>
|
</.button>
|
||||||
|
@ -145,7 +149,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
|
||||||
<.text_field
|
<.text_field
|
||||||
field={@form[:repo_url]}
|
field={@form[:repo_url]}
|
||||||
label="Repository URL"
|
label="Repository URL"
|
||||||
placeholder="git@[provider]:[username]/[repo_name].git"
|
placeholder="git@[provider_host]:[owner]/[repo_name].git"
|
||||||
/>
|
/>
|
||||||
<.text_field
|
<.text_field
|
||||||
field={@form[:branch]}
|
field={@form[:branch]}
|
||||||
|
@ -154,9 +158,8 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
|
||||||
/>
|
/>
|
||||||
<.password_field field={@form[:key]} label="SSH Private Key" />
|
<.password_field field={@form[:key]} label="SSH Private Key" />
|
||||||
<p class="text-xs text-gray-700">
|
<p class="text-xs text-gray-700">
|
||||||
You can use your own SSH Private Key or you can set up the Deploy Key
|
An SSH private key with repository access. You may use a personal key or a deploy key.
|
||||||
only for this repository. Check the documentation from your
|
See your Git provider’s documentation to create a deploy key.
|
||||||
version control system to create your Deploy Key.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -71,7 +71,10 @@ defmodule LivebookWeb.OpenLive.FileComponent do
|
||||||
|
|
||||||
defp open_button_tooltip_attrs(file, file_info) do
|
defp open_button_tooltip_attrs(file, file_info) do
|
||||||
if regular?(file, file_info) and not writable?(file_info) do
|
if regular?(file, file_info) and not writable?(file_info) do
|
||||||
[class: "tooltip top", "data-tooltip": "This file is write-protected, please fork instead"]
|
[
|
||||||
|
class: "tooltip top",
|
||||||
|
"data-tooltip": "This file is write-protected, fork to create an editable copy"
|
||||||
|
]
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
|
@ -99,7 +99,9 @@ defmodule LivebookWeb.OpenLiveTest do
|
||||||
|> has_element?()
|
|> has_element?()
|
||||||
|
|
||||||
assert view
|
assert view
|
||||||
|> element(~s{[data-tooltip="This file is write-protected, please fork instead"]})
|
|> element(
|
||||||
|
~s{[data-tooltip="This file is write-protected, fork to create an editable copy"]}
|
||||||
|
)
|
||||||
|> has_element?()
|
|> has_element?()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue