Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Apr 19, 2024
2 parents 5c24aed + e8a6f84 commit 9bf3107
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 19 deletions.
10 changes: 6 additions & 4 deletions server/app/admin/reports_admin.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
Trestle.admin(:reports) do
menu do
item :reports, icon: "fas fa-file-alt"
group :tools do
item :reports, icon: "fas fa-file-alt"
end
end

controller do
def index
@reports = Report::AVAILABLE_REPORTS
@reports = Reports::AVAILABLE_REPORTS
end

def show
@report = Report::AVAILABLE_REPORTS.find { |x| params[:name] == x.name }
@report = Reports::AVAILABLE_REPORTS.find { |x| params[:name] == x.name }
end

def generate_report
@report = Report::AVAILABLE_REPORTS.find { |x| params[:name] == x.name }
@report = Reports::AVAILABLE_REPORTS.find { |x| params[:name] == x.name }
report_params = params.permit(@report.inputs.keys).to_h.symbolize_keys
#checkbox will come in as 0 or 1
#cast it to a boolean here so reports dont have to worry about that
Expand Down
4 changes: 3 additions & 1 deletion server/app/admin/utilities_admin.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Trestle.admin(:utilities) do
menu do
item :utilities, icon: "fas fa-cogs"
group :tools do
item :utilities, icon: "fas fa-cogs"
end
end

controller do
Expand Down
2 changes: 1 addition & 1 deletion server/app/graphql/resolvers/quicksearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def resolve(query:, types: nil, highlight_matches: false)
{
id: res.id,
name: format_name(res.name, highlights),
result_type: res.class,
result_type: res.class.base_class,
matching_text: format_highlights(highlights)
}
end
Expand Down
6 changes: 3 additions & 3 deletions server/app/jobs/flag_duplicate_allele_registry_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def perform
duplicates.each do |caid, ids|
variants = Variant.where(id: ids)
variants.each do |variant|
if variant.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.text =~ /This Variant may be a duplicate and may need to be deprecated/ && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if variant.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /This Variant may be a duplicate and may need to be deprecated/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: variant,
organization_id: nil,
comment: "The Allele Registry ID of this Variant is used more than once. This Variant may be a duplicate and may need to be deprecated. The following Variants all resolved to Allele Registry ID \"#{caid}\": #{ids.join(', ')}"
note: "The Allele Registry ID of this Variant is used more than once. This Variant may be a duplicate and may need to be deprecated. The following Variants all resolved to Allele Registry ID \"#{caid}\": #{ids.join(', ')}"
).perform
end
end
Expand Down
2 changes: 1 addition & 1 deletion server/app/jobs/set_allele_registry_id_single_variant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ def perform(variant)
delete_allele_registry_link(old_allele_registry_id)
end
end
GenerateOpenCravatLink.perform_later(self)
GenerateOpenCravatLink.perform_later(variant)
end
end
6 changes: 3 additions & 3 deletions server/app/lib/importer/disease_ontology_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ def url_from_doid(doid)
def add_flags(disease, text)
civicbot_user = User.find(385)
(disease.evidence_items + disease.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.comment == text && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note == text && c.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
comment: text
note: text
).perform
end
end
Expand Down
4 changes: 4 additions & 0 deletions server/app/lib/link_adaptors/factor_variant.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module LinkAdaptors
class FactorVariant < Variant
end
end
4 changes: 4 additions & 0 deletions server/app/lib/link_adaptors/gene_variant.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module LinkAdaptors
class GeneVariant < Variant
end
end
6 changes: 3 additions & 3 deletions server/app/lib/scrapers/human_phenotype_ontology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def self.update
else
civicbot_user = User.find(385)
(p.evidence_items + p.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.text =~ /deprecated HPO term/ && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /deprecated HPO term/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
comment: "This entity uses a deprecated HPO term \"#{name}\" (#{hpo_id})"
note: "This entity uses a deprecated HPO term \"#{name}\" (#{hpo_id})"
).perform
end
end
Expand Down
3 changes: 0 additions & 3 deletions server/app/reports/report.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
class Report
AVAILABLE_REPORTS = [
OrganizationContributions
]

def initialize(params)
setup(**params)
Expand Down
5 changes: 5 additions & 0 deletions server/app/reports/reports.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Reports
AVAILABLE_REPORTS = [
OrganizationContributions
]
end

0 comments on commit 9bf3107

Please sign in to comment.