Skip to content

Commit

Permalink
Merge pull request #929 from ElixirTeSS/source-improvements
Browse files Browse the repository at this point in the history
Source improvements & fixes
  • Loading branch information
fbacall authored Feb 28, 2024
2 parents 39dbca7 + cb6d5da commit e874ee1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/models/source.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Source < ApplicationRecord
include LogParameterChanges
include HasTestJob
include HasAssociatedNodes

APPROVAL_STATUS = {
0 => :not_approved,
Expand Down Expand Up @@ -43,6 +44,9 @@ class Source < ApplicationRecord
string :content_provider do
self.content_provider.try(:title)
end
string :node, multiple: true do
associated_nodes.pluck(:name)
end
string :approval_status do
I18n.t("sources.approval_status.#{approval_status}")
end
Expand All @@ -66,7 +70,9 @@ def ingestor_class
end

def self.facet_fields
%w( content_provider method enabled approval_status )
field_list = %w( content_provider node method enabled approval_status )
field_list.delete('node') unless TeSS::Config.feature['nodes']
field_list
end

def self.check_exists(source_params)
Expand Down
2 changes: 1 addition & 1 deletion app/views/bioschemas/_preview_button.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
<% end %>
</div>

<%= f.submit('Preview', class: 'btn btn-primary', formtarget: '_blank') %>
<%= f.submit('Preview', class: 'btn btn-primary', formtarget: '_blank', data: { disable_with: false }) %>
<% end %>
1 change: 1 addition & 0 deletions app/views/sources/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<hr>
<%= render partial: 'common/masonry_grid', locals: { objects: @sources } %>

<%= render partial: "search/common/pagination_bar", locals: { resources: @sources } %>
</div>

</div>

0 comments on commit e874ee1

Please sign in to comment.