-
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.
Nextflow Samplesheet: File Selector (#879)
* start file selector * tie in params for selector dialog and rendering file cell * streamline param passing between actions, add paired attachment auto selection * add ability to handle no attachment selection * fix regex filtering, more cleanup * move filtering to sample rather than samplesheet * rework logic to use pipeline for pattern * streamline params, fix ordering * start migrating logic to accept non-fastq files as well * make other file types useable with file selector * start adding translations, add empty state for file selector * add frontend validation for samplesheet file cells * make full div clickable on samplesheet, add hover state * fix tailwind classes for error submission state * fix some older arguments * cleanup * further cleanup, fixing styling * add ui tests * some cleanup * cleanup * fix tests, fix required headers, move file selector under WE module * generalize nextflow component error * cleanup * run normalize * add controller tests * fix translation in test * fix translations, move file filtering methods to concern, add unrelated asserts for flakes * change required_properties default value * run normalize * fix test * cleanup * rework some of the required_properties logic * add wrapper for file selector dialog * further fix file selector dialog * make submit btn of file selector dialog part of dialog, add stimulus logic, make radio buttons sticky for horizontal scrolling * fix dialog id ambiguity, fix tests with now moved submit button out of original selector * add type and format to file selector, add non-pe selection autopopulate fastq_2 to no file * revert form button changes
- Loading branch information
1 parent
a6a42bf
commit ef00f5a
Showing
25 changed files
with
1,096 additions
and
176 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
33 changes: 33 additions & 0 deletions
33
app/components/nextflow/samplesheet/file_cell_component.html.erb
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,33 @@ | ||
<%= link_to new_workflow_executions_file_selector_path( | ||
"file_selector[attachable_id]": @attachable.id, | ||
"file_selector[attachable_type]": @attachable.class.to_s, | ||
"file_selector[index]": @index, | ||
"file_selector[selected_id]": @selected.empty? ? nil : @selected[:id], | ||
"file_selector[property]": @property, | ||
"file_selector[required_properties]": @required_properties, | ||
"file_selector[file_type]": @file_type, | ||
"file_selector[file_selector_arguments]": @file_selector_arguments | ||
), | ||
data: { | ||
turbo_stream: "true", | ||
} do %> | ||
<div | ||
id="<%="#{@attachable.id}_#{@property}" %>" | ||
class=" | ||
w-full focus:ring-primary-500 focus:border-primary-500 p-2 dark:bg-inherit | ||
bg-inherit dark:placeholder-slate-400 text-inherit | ||
text-sm dark:focus:ring-primary-500 dark:focus:border-primary-500 cursor-pointer | ||
hover:border-slate-300 border-transparent border-2 | ||
" | ||
data-file-cell-required="<%= @required_properties.present? && @required_properties.include?(@property) ? "true" : "false" %>" | ||
> | ||
<% unless @selected.empty? %> | ||
<input | ||
type="hidden" | ||
name="workflow_execution[samples_workflow_executions_attributes][<%= @index%>][samplesheet_params][<%= @property %>]" | ||
value= <%= @selected[:global_id]%> | ||
> | ||
<% end %> | ||
<%= @selected.empty? ? t(".no_selected_file") : @selected[:filename] %> | ||
</div> | ||
<% end %> |
22 changes: 22 additions & 0 deletions
22
app/components/nextflow/samplesheet/file_cell_component.rb
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Nextflow | ||
module Samplesheet | ||
# Render a single cell of a Nextflow samplesheet for a property that requires a file | ||
class FileCellComponent < Component | ||
attr_reader :attachable, :property, :selected, :index, :required_properties, :file_type, :file_selector_arguments | ||
|
||
# rubocop: disable Metrics/ParameterLists | ||
def initialize(attachable, property, selected, index, required_properties, file_type, **file_selector_arguments) | ||
@attachable = attachable | ||
@property = property | ||
@selected = selected | ||
@index = index | ||
@required_properties = required_properties | ||
@file_type = file_type | ||
@file_selector_arguments = file_selector_arguments | ||
end | ||
# rubocop: enable Metrics/ParameterLists | ||
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
Oops, something went wrong.