Skip to content

Commit

Permalink
remove ont_viewer data jquery code
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 2, 2024
1 parent 49cd530 commit c3c89cd
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 48 deletions.
4 changes: 1 addition & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ UI_URL=http://localhost:3000
API_URL=http://localhost:9393
API_KEY=

UI_THEME=bioportal
UI_THEME=ontoportal

BIOMIXER_URL=
BIOMIXER_APIKEY=
Expand Down Expand Up @@ -39,5 +39,3 @@ OP_API_URL="https://data.bioontology.org"
API_IMAGE_REPOSITORY=agroportal
## Image tag/version from which the ontoportal api will be built
API_IMAGE_TAG=master


3 changes: 1 addition & 2 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
jQuery(document).data().bp.ontolobridge_ontologies =
<%=$NEW_TERM_REQUEST_ONTOLOGIES.to_json.html_safe%> ||
[];
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_chart = {};
</script>

Expand All @@ -60,4 +59,4 @@
<%= turbo_frame_tag :cookies_modal, src: cookies_path if cookies[:cookies_accepted].nil? && !(Rails.env.development? || Rails.env.test?) %>

<div class="flex-grow-1">
<%= render partial: 'layouts/notices' %>
<%= render partial: 'layouts/notices' %>
20 changes: 0 additions & 20 deletions app/views/layouts/_ontology_viewer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,6 @@

= render :partial =>'layouts/header'
%div#bd.bg-white.ontology-viewer
:javascript
// Ontology viewer vars
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_viewer.ontology_id = jQuery(document).data().bp.ontology.acronym;
jQuery(document).data().bp.ont_viewer.ontology_version_id = jQuery(document).data().bp.submission_latest.submissionId;
jQuery(document).data().bp.ont_viewer.ontology_name = "#{@ontology.name}";
jQuery(document).data().bp.ont_viewer.org_site = "#{$ORG_SITE}";
jQuery(document).data().bp.ont_viewer.concept_id = "#{params[:conceptid] || (@concept ? @concept.id : 'root')}";
jQuery(document).data().bp.ont_viewer.content_section = "#{sanitize(h(content_section))}";
jQuery(document).data().bp.ont_viewer.concept_param = "#{"conceptid=\#{params[:conceptid]}" unless params[:conceptid].nil? || params[:conceptid].empty?}";
jQuery(document).data().bp.ont_viewer.concept_name = "#{@concept.prefLabel unless @concept.nil?}";
jQuery(document).data().bp.ont_viewer.metadata_only = "#{@ontology.summaryOnly}";
jQuery(document).data().bp.ont_viewer.current_purl = "#{@current_purl}";
jQuery(document).data().bp.ont_viewer.purl_prefix = "#{($PURL_ENABLED ? $PURL_PREFIX+"/"[email protected] : '')}";
jQuery(document).data().bp.ont_viewer.concept_name_title = (jQuery(document).data().bp.ont_viewer.concept_name == "") ?
"" : " - " + jQuery(document).data().bp.ont_viewer.concept_name;




= modal_frame_container

= render partial: 'concepts/perma_link_modal'
Expand Down
2 changes: 0 additions & 2 deletions app/views/layouts/appliance.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
jQuery(document).data({bp: {config: #{bp_config_json.html_safe}, user: #{(session[:user] || {}).to_hash.to_json.html_safe}}});
jQuery(document).data().bp.ontology = #{@ontology.to_json.html_safe} || {};
jQuery(document).data().bp.submission_latest = #{@submission_latest.to_json.html_safe} || {};
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_chart = {};

%body{:class => "#{controller_name} #{action_name}"}
Expand All @@ -35,4 +34,3 @@
= yield

= render partial: "layouts/footer"

3 changes: 1 addition & 2 deletions app/views/layouts/component_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
jQuery(document).data().bp.ontolobridge_ontologies =
<%=$NEW_TERM_REQUEST_ONTOLOGIES.to_json.html_safe%> ||
[];
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_chart = {};
</script>
</head>
Expand All @@ -57,4 +56,4 @@


</body>
</html>
</html>
3 changes: 1 addition & 2 deletions app/views/layouts/component_preview_not_centred.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
jQuery(document).data().bp.ontolobridge_ontologies =
<%=$NEW_TERM_REQUEST_ONTOLOGIES.to_json.html_safe%> ||
[];
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_chart = {};
</script>
</head>
Expand All @@ -53,4 +52,4 @@
<%= yield %> <!-- rendered preview will be injected here -->
<%= javascript_include_tag "application" %>
</body>
</html>
</html>
2 changes: 0 additions & 2 deletions app/views/layouts/popup.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
jQuery(document).data({bp: {config: <%=bp_config_json.html_safe%>, user: <%=(session[:user] || {}).to_hash.to_json.html_safe%>}});
jQuery(document).data().bp.ontology = <%=@ontology.to_json.html_safe%> || {};
jQuery(document).data().bp.submission_latest = <%=@submission_latest.to_json.html_safe%> || {};
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_chart = {};
</script>
<%= csrf_meta_tag %>
Expand Down Expand Up @@ -63,4 +62,3 @@

</body>
</html>

3 changes: 1 addition & 2 deletions app/views/layouts/tool.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
= javascript_include_tag "vendor"
:javascript
jQuery(document).data({bp: {config: {ui_url: ''}, user: {}}});
jQuery(document).data().bp.ont_viewer = {};
jQuery(document).data().bp.ont_chart = {};
%body{class: " #{controller_name} #{action_name}", style: 'background-color: var(--light-color);'}
Expand All @@ -39,4 +38,4 @@
= yield


= javascript_include_tag "application"
= javascript_include_tag "application"
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Application < Rails::Application
# config.time_zone = "Central Time (US & Canada)"
config.exceptions_app = self.routes


config.autoload_paths += %W[#{config.root}/app/lib/kgcl]

config.settings = config_for :settings
# Initialize configuration for KGCL change request functionality.
Expand Down
3 changes: 1 addition & 2 deletions config/bioportal_config_env.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ $FOOTER_LINKS = {



$UI_THEME = ENV['UI_THEME'] || 'bioportal'
$UI_THEME = ENV['UI_THEME'] || 'ontoportal'
$HOSTNAME = ENV['API_URL']

if $HOSTNAME
Expand All @@ -337,4 +337,3 @@ if $HOSTNAME
require_relative "bioportal_config_development_#{$HOSTNAME}"
end
end

19 changes: 10 additions & 9 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
match 'cookies', to: 'home#set_cookies', via: [:post, :get]

root to: 'home#index'
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?

get'/tools', to: 'home#tools'
get 'auth/:provider/callback', to: 'login#create_omniauth'
Expand Down Expand Up @@ -142,8 +142,8 @@
get 'statistics/index'

# Error pages
match "/404", to: "errors#not_found", via: :all
match "/500", to: "errors#internal_server_error", via: :all
match '/404', to: 'errors#not_found', via: :all
match '/500', to: 'errors#internal_server_error', via: :all

# Robots.txt
get '/robots.txt' => 'robots#index'
Expand Down Expand Up @@ -186,16 +186,16 @@
get '/ajax/classes/date_sorted_list' => 'concepts#show_date_sorted_list'
get '/ajax/properties/children' => 'properties#show_children'
get '/ajax/properties/tree' => 'concepts#property_tree'
get 'ajax/schemes/label', to: "schemes#show_label"
get 'ajax/collections/label', to: "collections#show_label"
get 'ajax/label_xl/label', to: "label_xl#show_label"
get 'ajax/label_xl', to: "label_xl#show"
get 'ajax/schemes/label', to: 'schemes#show_label'
get 'ajax/collections/label', to: 'collections#show_label'
get 'ajax/label_xl/label', to: 'label_xl#show_label'
get 'ajax/label_xl', to: 'label_xl#show'
get '/ajax/biomixer' => 'concepts#biomixer'
get '/ajax/fair_score/html' => 'fair_score#details_html'
get '/ajax/submission/show_licenses/:id' => 'ontologies#show_licenses'
get '/ajax/fair_score/json' => 'fair_score#details_json'
get '/ajax/ontologies', to: "ontologies#ajax_ontologies"
get '/ajax/agents', to: "agents#ajax_agents"
get '/ajax/ontologies', to: 'ontologies#ajax_ontologies'
get '/ajax/agents', to: 'agents#ajax_agents'
get '/ajax/images/show' => 'application#show_image_modal'

# User
Expand All @@ -217,4 +217,5 @@
get 'check_resolvability' => 'check_resolvability#index'
get 'check_url_resolvability' => 'check_resolvability#check_resolvability'

mount Lookbook::Engine, at: '/lookbook'
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2020_09_21_120918) do
ActiveRecord::Schema[7.0].define(version: 2023_11_30_210229) do
create_table "analytics", id: :integer, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "segment"
t.string "action"
Expand Down

0 comments on commit c3c89cd

Please sign in to comment.