Skip to content

Commit

Permalink
migrate notes table to use DataTable component fully and remove archi…
Browse files Browse the repository at this point in the history
…ved filter (#843)
  • Loading branch information
syphax-bouazzouni authored Nov 9, 2024
1 parent d18de9a commit fe4c800
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 57 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//
//= require bioportal
//= require admin/licenses
//= require bp_notes
//= require bp_form_complete
//= require bp_admin
//= require concepts
Expand Down
42 changes: 0 additions & 42 deletions app/assets/javascripts/bp_notes.js

This file was deleted.

15 changes: 1 addition & 14 deletions app/views/notes/_notes.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
= add_comment_button(parent_id, parent_type)
.add_proposal.mx-1
= add_proposal_button(parent_id, parent_type)
%div.ont_notes_filter.my-1.d-flex.justify-content-end.align-items-baseline
Filter:
%input#hide_archived_ont.mx-1{:checked => "true", :name => "hide_archived_ont", :type => "checkbox"}
%label{:for => "hide_archived_ont"}= t('notes.filter_hide_archived')
= render_alerts_container("notes_#{parent_type}_list_table_alerts")

.ont_notes_table_container
- cols = [ (current_user_admin? ? 'Action' : nil), 'Subject', 'Author', 'Type', (parent_type.eql?('ontology') ? 'Class' : nil),'Created'].compact
= render TableComponent.new(id:"#{parent_type}_notes") do |t|
= render TableComponent.new(id:"#{parent_type}_notes", searching: true, paging: true, sort_column: @notes.empty? ? nil : (cols.size - 1).to_s, custom_class: 'border rounded p-1') do |t|
- t.header do |row|
- row.create(*cols.map{|col| {th: col}})

Expand All @@ -28,12 +24,3 @@
- else
- @notes.each do |note|
= render partial: 'notes/note_line', locals: {note: note, ontology_acronym: @ontology.acronym, parent_type: parent_type}

:javascript
jQuery(".ontologies.show").ready(function(){
jQuery("#hide_archived_ont").click(function(){
hideOrUnhideArchivedOntNotes();
});

wireOntTable(jQuery("##{notes_table_id}"), #{parent_type.eql?('ontology')}, #{current_user_admin?})
});

0 comments on commit fe4c800

Please sign in to comment.