Skip to content

Commit

Permalink
remove debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
euler-room committed Dec 5, 2024
1 parent 807e3fe commit e5a7f86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ def validate_path!
end

def set_sorting_params(parameters)
Rails.logger.debug("Sorting params: #{parameters}")
@sorting_params = {
col: parameters&.[](:col),
direction: !parameters&.[](:direction),
grouped?: parameters&.[](:grouped?)
col: parameters&.[](:col) || DEFAULT_SORTING_PARAMS[:col],
direction: !parameters&.[](:direction) || DEFAULT_SORTING_PARAMS[:direction],
grouped?: parameters&.[](:grouped?) || DEFAULT_SORTING_PARAMS[:grouped?]
}
end

Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def directory
parse_path("#{directory_params[:dir_path]}")
validate_path!

Rails.logger.debug("Sorting params: #{@sorting_params}")
set_sorting_params(directory_params[:sorting_params] || DEFAULT_SORTING_PARAMS )
set_files
render( partial: 'projects/directory',
Expand Down
24 changes: 4 additions & 20 deletions apps/dashboard/app/helpers/projects_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,42 +67,26 @@ def project_size
# end

def column_head_link(column, sorting_params)
a = link_to(
link_to(
link_text(column, sorting_params),
target_path(column, sorting_params),
title: tool_tip,
class: "text-dark",
data: data_attributes
)

Rails.logger.debug("\n\n\n\n\n============== #{column} ===================")
Rails.logger.debug("Column head link: #{a}")
Rails.logger.debug("========================================\n\n\n\n\n")
a
end

def direction(column, sorting_params)
if column.to_s == sorting_params[:col].to_s
Rails.logger.debug("\n\n\n\n\n______________--------============-----------______________")
Rails.logger.debug(" COLUMN: #{column}")
Rails.logger.debug(" is #{column.to_s == sorting_params[:col] ? 'EQUAL' : 'NOT EQUAL'} to")
Rails.logger.debug(" SP COL: #{sorting_params[:col]}")
Rails.logger.debug(" RETURNING: descending") if column.to_s == sorting_params[:col].to_s && sorting_params[:direction] == ascending

Rails.logger.debug("--------------========____________===========--------------\n\n\n\n\n")
end
if column.to_s == sorting_params[:col].to_s
!sorting_params[:direction]
end
return !sorting_params[:direction] if column.to_s == sorting_params[:col].to_s
ascending
end

def link_text(column, sorting_params)
col_title = t("dashboard.#{column.to_s}")
if column.to_s == sorting_params[:col]
"#{col_title} #{fa_icon( direction(column, sorting_params) == ascending ? 'sort-up' : 'sort-down', classes: 'fa-md')}".html_safe
"#{col_title} #{ fa_icon(direction(column, sorting_params) == ascending ? 'sort-up' : 'sort-down', classes: 'fa-md') }".html_safe
else
"#{col_title} #{fa_icon('sort', classes: 'fa-md')}".html_safe
"#{col_title} #{ fa_icon('sort', classes: 'fa-md') }".html_safe
end
end

Expand Down

0 comments on commit e5a7f86

Please sign in to comment.