diff --git a/app/assets/stylesheets/_forms.scss b/app/assets/stylesheets/_forms.scss index 90b5fb420..19543c399 100644 --- a/app/assets/stylesheets/_forms.scss +++ b/app/assets/stylesheets/_forms.scss @@ -66,6 +66,11 @@ label { padding-top: 10px; } } + +.blinded { + line-height: 2.6em; +} + .blinded, .blinded i { color: $gray2; } diff --git a/app/models/box.rb b/app/models/box.rb index 8c62e8212..c14d72dc1 100644 --- a/app/models/box.rb +++ b/app/models/box.rb @@ -89,7 +89,7 @@ def detach_from_context # Returns the full list of sample attributes that can be blinded. def self.blind_attribute_names - %i[batch_number concentration replicate virus_lineage isolate_name] + %i[batch_number concentration replicate virus_lineage isolate_name reference_gene target_organism_taxonomy_id pango_lineage who_label] end # Returns true if a sample attribute should be blinded for the current box. diff --git a/app/views/samples/_form.haml b/app/views/samples/_form.haml index 237bc4e16..52e6f9344 100644 --- a/app/views/samples/_form.haml +++ b/app/views/samples/_form.haml @@ -66,16 +66,20 @@ .span.unit (μl) = f.form_field :reference_gene do - = autocomplete_field(f, "sample[reference_gene]", :reference_gene, @navigation_context.institution, class: "input-x-large") + - @sample_form.blinded_attribute(:reference_gene) do + = autocomplete_field(f, "sample[reference_gene]", :reference_gene, @navigation_context.institution, class: "input-x-large") = f.form_field :target_organism_taxonomy_id do - = autocomplete_field(f, "sample[target_organism_taxonomy_id]", :target_organism_taxonomy_id, @navigation_context.institution, class: "input-x-large") + - @sample_form.blinded_attribute(:target_organism_taxonomy_id) do + = autocomplete_field(f, "sample[target_organism_taxonomy_id]", :target_organism_taxonomy_id, @navigation_context.institution, class: "input-x-large") = f.form_field :pango_lineage do - = autocomplete_field(f, "sample[pango_lineage]", :pango_lineage, @navigation_context.institution, class: "input-x-large") + - @sample_form.blinded_attribute(:pango_lineage) do + = autocomplete_field(f, "sample[pango_lineage]", :pango_lineage, @navigation_context.institution, class: "input-x-large") = f.form_field :who_label do - = autocomplete_field(f, "sample[who_label]", :who_label, @navigation_context.institution, class: "input-x-large") + - @sample_form.blinded_attribute(:who_label) do + = autocomplete_field(f, "sample[who_label]", :who_label, @navigation_context.institution, class: "input-x-large") = f.form_field :concentration do - @sample_form.blinded_attribute(:concentration) do diff --git a/spec/controllers/samples_controller_spec.rb b/spec/controllers/samples_controller_spec.rb index 557d4fdee..e8e6b613f 100644 --- a/spec/controllers/samples_controller_spec.rb +++ b/spec/controllers/samples_controller_spec.rb @@ -193,6 +193,10 @@ assert_select "input[name='sample[replicate]']", count: 0 assert_select "input[name='sample[virus_lineage]']", count: 0 assert_select "input[name='sample[isolate_name]']", count: 0 + assert_select "input[name='sample[reference_gene]']", count: 0 + assert_select "input[name='sample[target_organism_taxonomy_id]']", count: 0 + assert_select "input[name='sample[pango_lineage]']", count: 0 + assert_select "input[name='sample[who_label]']", count: 0 end end end