Skip to content

Commit

Permalink
chore: Display only all or none for metadata field templates
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsadam committed Jan 17, 2024
1 parent 0901fa0 commit e73b76f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 6 additions & 5 deletions app/controllers/projects/samples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,18 @@ def load_samples
Sample.where(project_id: @project.id)
end

def all_metadata_fields
@all_metadata_fields = @project.namespace.metadata_summary
end

def templates
@templates = [{ id: 0, label: 'None' }, { id: 1, label: 'Template 1' },
{ id: 2, label: 'Template 2' }]
@templates = [{ id: 0, label: 'None' }, { id: 1, label: 'All' }]
end

def template
@template = case params[:template]
when '1'
%w[WGS_id country earliest_date]
when '2'
%w[WGS_id NCBI_ACCESSION country patient_age patient_sex earliest_date]
@project.namespace.metadata_summary.keys
else
%w[]
end
Expand Down
4 changes: 0 additions & 4 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e73b76f

Please sign in to comment.