-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENHC0010033] List samples within clone dialog (#640)
* adding infinite scrolling * playing with the idea of adding a loading skeleton like with lazy loading * adding the selected samples scrollable list to the clone samples dialog * adding tests * starting refactoring * more refactoring * displaying total selected count * adding missing french translations * trying to fix a test * trying to fix a test * trying to fix a test * trying to fix a test * trying to fix a test * trying to fix a test * reordering assertions * renaming default_skeleton
- Loading branch information
Showing
9 changed files
with
203 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,77 @@ | ||
<%= viral_dialog(open: open) do |dialog| %> | ||
<%= dialog.with_header(title: t(".title")) %> | ||
<%= dialog.with_section do %> | ||
<div | ||
data-controller="infinite-scroll" | ||
data-infinite-scroll-selection-outlet='#samples-table' | ||
data-infinite-scroll-field-name-value="transfer[sample_ids][]" | ||
data-infinite-scroll-paged-field-name-value="sample_ids[]" | ||
> | ||
<%= form_with( | ||
<%= turbo_frame_tag "transfer_samples_dialog_content" do %> | ||
<div | ||
data-controller="infinite-scroll" | ||
data-infinite-scroll-selection-outlet='#samples-table' | ||
data-infinite-scroll-field-name-value="transfer[sample_ids][]" | ||
data-infinite-scroll-paged-field-name-value="sample_ids[]" | ||
> | ||
<%= form_with( | ||
url: list_namespace_project_samples_path, | ||
data: { "infinite-scroll-target": "pageForm" } | ||
) do %> | ||
<div data-infinite-scroll-target="pageFormContent"></div> | ||
<% end %> | ||
<div | ||
class="overflow-y-auto max-h-[300px] mb-4" | ||
data-action="scroll->infinite-scroll#scroll" | ||
data-infinite-scroll-target="scrollable" | ||
> | ||
<%= turbo_frame_tag "list_select_samples" do %> | ||
<div role="status" class="max-w-sm animate-pulse"> | ||
<% 4.times do %> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[330px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[300px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px] mb-2.5"></div> | ||
<% end %> | ||
<span class="sr-only"><%= t(:".loading") %></span> | ||
</div> | ||
<div data-infinite-scroll-target="pageFormContent"></div> | ||
<% end %> | ||
</div> | ||
|
||
<%= turbo_frame_tag "transfer_samples_dialog_content" do %> | ||
<%= form_for(:transfer, url: namespace_project_samples_transfer_path, method: :post, | ||
<div class="grid gap-4"> | ||
<p | ||
data-infinite-scroll-target="summary" | ||
class=" | ||
text-base leading-relaxed text-slate-500 dark:text-slate-400 | ||
" | ||
> | ||
<%= t(".description") %> | ||
</p> | ||
<div> | ||
<div class="block mb-1 text-sm font-medium text-slate-900 dark:text-white"> | ||
<%= t(".samples") %> | ||
</div> | ||
<div | ||
class=" | ||
overflow-y-auto max-h-[300px] border border-slate-300 rounded-md block w-full | ||
p-2.5 dark:bg-slate-800 dark:border-slate-600 | ||
" | ||
data-action="scroll->infinite-scroll#scroll" | ||
data-infinite-scroll-target="scrollable" | ||
> | ||
<%= turbo_frame_tag "list_select_samples" do %> | ||
<%= render partial: "shared/loading/samples_list_skeleton" %> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<%= form_for(:transfer, url: namespace_project_samples_transfer_path, method: :post, | ||
data: { | ||
controller: "spinner", | ||
action:"turbo:submit-start->spinner#submitStart turbo:submit-end->spinner#submitEnd" | ||
} | ||
) do |form| %> | ||
<div class="grid gap-4"> | ||
<div class="form-field"> | ||
<%= form.label :new_project_id, t(".new_project_id") %> | ||
<%= form.collection_select(:new_project_id, @projects, :id, :full_path) %> | ||
</div> | ||
<div class="hidden" data-infinite-scroll-target="all"></div> | ||
<div> | ||
<%= form.submit t(".submit_button"), | ||
class: "button button--size-default button--state-primary", | ||
disabled: @projects.count.zero?, | ||
data: { | ||
action: "click->infinite-scroll#clear", | ||
"spinner-target": "submit", | ||
"turbo-submits-with": t(:".loading"), | ||
} %> | ||
<div class="grid gap-4"> | ||
<div class="form-field"> | ||
<%= form.label :new_project_id, t(".new_project_id") %> | ||
<%= form.collection_select(:new_project_id, @projects, :id, :full_path) %> | ||
</div> | ||
<div class="hidden" data-infinite-scroll-target="all"></div> | ||
<div> | ||
<%= form.submit t(".submit_button"), | ||
class: "button button--size-default button--state-primary", | ||
disabled: @projects.count.zero?, | ||
data: { | ||
action: "click->infinite-scroll#clear", | ||
"spinner-target": "submit", | ||
} %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
|
||
<div | ||
role="status" | ||
id="spinner" | ||
class=" | ||
hidden backdrop-blur-sm absolute h-full w-full -translate-x-1/2 -translate-y-1/2 | ||
top-2/4 left-1/2 grid place-items-center | ||
" | ||
> | ||
<div class="grid place-items-center"> | ||
<%= viral_icon(name: :loading, classes: "animate-spin text-primary-500") %> | ||
<span class="text-black dark:text-white"><%= t(:".spinner") %>.</span> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= render partial: "shared/loading/spinner", | ||
locals: { | ||
spinner_message: t(".spinner_message"), | ||
} %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div role="status" class="max-w-sm animate-pulse"> | ||
<% 4.times do %> | ||
<div class="py-1"> | ||
<div class="h-4 bg-gray-200 rounded w-1/2 mb-2"></div> | ||
<div class="h-3 bg-gray-200 rounded w-2/3"></div> | ||
</div> | ||
<% end %> | ||
<span class="sr-only"><%= t(:".loading") %></span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div | ||
role="status" | ||
id="spinner" | ||
class=" | ||
hidden backdrop-blur-sm absolute h-full w-full -translate-x-1/2 -translate-y-1/2 | ||
top-2/4 left-1/2 grid place-items-center | ||
" | ||
> | ||
<div class="grid place-items-center"> | ||
<%= viral_icon(name: :loading, classes: "animate-spin text-primary-500") %> | ||
<span class="text-black dark:text-white"><%= spinner_message %>.</span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.