Skip to content

Commit

Permalink
clean admin routes
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 4, 2024
1 parent 4684adc commit 218d2fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
6 changes: 3 additions & 3 deletions app/controllers/agents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create
success_message = 'New Agent added successfully'
streams = [alert_success(id: alert_id) { success_message }]

streams << prepend('agents_table_content', partial: 'agents/show_line', locals: { agent: new_agent })
streams << prepend('agents_table_content', partial: 'agents/agent', locals: { agent: new_agent })
streams << replace_agent_form(new_agent, agent_id: nil, frame_id: params[:id],
parent_id: parent_id, name_prefix: name_prefix,
deletable: deletable
Expand Down Expand Up @@ -101,7 +101,7 @@ def update
table_line_id = agent_table_line_id(agent_id(agent))
agent = LinkedData::Client::Models::Agent.find(agent.id.split('/').last)
streams = [alert_success(id: alert_id) { success_message },
replace(table_line_id, partial: 'agents/show_line', locals: { agent: agent })
replace(table_line_id, partial: 'agents/agent', locals: { agent: agent })
]

streams << replace_agent_form(agent, agent_id: agent_id(agent.id), name_prefix: params[:name_prefix] , parent_id: parent_id, deletable: deletable) if params[:parent_id]
Expand Down Expand Up @@ -137,7 +137,7 @@ def update_agent_usages
table_line_id = agent_table_line_id(agent_id(agent))
agent.usages = new_usages
streams = [alert_success(id: alert_id) { success_message },
replace(table_line_id, partial: 'agents/show_line', locals: { agent: agent })
replace(table_line_id, partial: 'agents/agent', locals: { agent: agent })
]

render_turbo_stream(*streams)
Expand Down
29 changes: 10 additions & 19 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
match 'groups/synchronize_groups' => 'groups#synchronize_groups', via: [:post]
resources :groups, only: [:index, :create, :new, :edit, :update, :destroy]
resources :categories, only: [:index, :create, :new, :edit, :update, :destroy]
post 'clearcache', to: 'clearcache'
post 'resetcache', to: 'resetcache'
post 'clear_goo_cache', to: 'clear_goo_cache'
post 'clear_http_cache', to: 'clear_http_cache'
get 'ontologies_report', to: 'ontologies_report'
post 'refresh_ontologies_report', to: 'refresh_ontologies_report'
delete 'ontologies', to: 'delete_ontologies'
put 'ontologies', to: 'process_ontologies'
get 'ontologies/:acronym/log', to: 'admin#parse_log'
get 'update_check_enabled', to: 'update_check_enabled'
end

resources :subscriptions
Expand Down Expand Up @@ -179,25 +189,6 @@

get 'jambalaya/:ontology/:id' => 'visual#jam', :as => :jam

# Admin
match '/admin/clearcache' => 'admin#clearcache', via: [:post]
match '/admin/resetcache' => 'admin#resetcache', via: [:post]
match '/admin/clear_goo_cache' => 'admin#clear_goo_cache', via: [:post]
match '/admin/clear_http_cache' => 'admin#clear_http_cache', via: [:post]
match '/admin/ontologies_report' => 'admin#ontologies_report', via: [:get]
match '/admin/refresh_ontologies_report' => 'admin#refresh_ontologies_report', via: [:post]
match '/admin/ontologies' => 'admin#delete_ontologies', via: [:delete]
match '/admin/ontologies' => 'admin#process_ontologies', via: [:put]
match '/admin/ontologies/:acronym/submissions/:id' => 'admin#delete_submission', via: [:delete]
match '/admin/ontologies/:acronym/submissions' => 'admin#submissions', via: [:get]
match '/admin/ontologies/:acronym/log' => 'admin#parse_log', via: [:get]
match '/admin/update_info' => 'admin#update_info', via: [:get]
match '/admin/update_check_enabled' => 'admin#update_check_enabled', via: [:get]
match '/admin/users' => 'admin#users', via: [:get]

# Ontolobridge
# post '/ontolobridge/:save_new_term_instructions' => 'ontolobridge#save_new_term_instructions'

###########################################################################################################
# Install the default route as the lowest priority.
get '/:controller(/:action(/:id))'
Expand Down

0 comments on commit 218d2fc

Please sign in to comment.