Skip to content

Commit

Permalink
Merge branch 'main' into jdc-1955-inat-import
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCohen committed Aug 28, 2024
2 parents 5cfefa1 + 85ad133 commit 60584cf
Show file tree
Hide file tree
Showing 117 changed files with 1,966 additions and 1,849 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Run tests
env:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bundle exec rails test:all
run: bundle exec rails test

# https://github.com/marketplace/actions/coveralls-github-action
- name: Coveralls GitHub Action
Expand Down
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude

require:
- rubocop-performance
Expand Down Expand Up @@ -178,7 +181,7 @@ Rails/WhereExists:
Style/AccessorGrouping:
# https://github.com/MushroomObserver/mushroom-observer/pull/988
Enabled: false
# The followin Exclude in case we re-enable the cop
# The following are Exclude in case we re-enable the cop
# Exclude files that individually comment accessors
# else Rubocop concatenates the accessors and comments on a single line.
# Disabling Style/AccessorGrouping around the accessors doesn't
Expand Down
14 changes: 6 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit`
# on 2024-08-01 19:59:56 UTC using RuboCop version 1.65.1.
# `rubocop --auto-gen-config --no-exclude-limit`
# on 2024-08-08 16:15:46 UTC using RuboCop version 1.65.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -277,7 +277,7 @@ Metrics/AbcSize:
- 'script/refresh_sitemap'
- 'script/update_ip_stats.rb'

# Offense count: 32
# Offense count: 31
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Expand All @@ -287,7 +287,6 @@ Metrics/BlockLength:
- 'app/controllers/concerns/descriptions/moves.rb'
- 'app/controllers/concerns/descriptions/publish.rb'
- 'app/extensions/symbol_extensions.rb'
- 'app/helpers/forms_helper.rb'
- 'app/views/controllers/api2/_image.xml.builder'
- 'app/views/controllers/api2/_name.xml.builder'
- 'app/views/controllers/api2/_observation.xml.builder'
Expand Down Expand Up @@ -320,7 +319,7 @@ Metrics/ClassLength:
- 'app/models/abstract_model.rb'
- 'app/models/description.rb'

# Offense count: 122
# Offense count: 121
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
Expand Down Expand Up @@ -403,7 +402,7 @@ Metrics/CyclomaticComplexity:
- 'script/bulk_name_change'
- 'script/update_ip_stats.rb'

# Offense count: 20
# Offense count: 19
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
Expand All @@ -416,7 +415,6 @@ Metrics/MethodLength:
- 'app/controllers/locations_controller.rb'
- 'app/controllers/names/eol_data/preview_controller.rb'
- 'app/extensions/symbol_extensions.rb'
- 'app/helpers/forms_helper.rb'
- 'app/helpers/pagination_helper.rb'
- 'app/models/image.rb'
- 'app/models/language_exporter.rb'
Expand Down Expand Up @@ -446,7 +444,7 @@ Metrics/ParameterLists:
- 'test/controllers/projects/members_controller_test.rb'
- 'test/models/collapsible_map_test.rb'

# Offense count: 94
# Offense count: 93
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ gem("blankslate")
# Simple version models and tables for classes
# Use our own fork, which stores enum attrs as integers in the db
gem("mo_acts_as_versioned", ">= 0.6.6",
git: "https://github.com/MushroomObserver/acts_as_versioned/")
git: "https://github.com/MushroomObserver/acts_as_versioned")

# Use ActiveModel has_secure_password
gem("bcrypt")
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GIT
remote: https://github.com/MushroomObserver/acts_as_versioned/
remote: https://github.com/MushroomObserver/acts_as_versioned
revision: 56891f7f915610e9f884e3a932bfb6934303b3b8
specs:
mo_acts_as_versioned (0.6.6)
Expand Down Expand Up @@ -78,7 +78,7 @@ GEM
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
brakeman (6.1.2)
brakeman (6.2.1)
racc
browser (6.0.0)
builder (3.3.0)
Expand All @@ -99,7 +99,7 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
chunky_png (1.4.0)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
Expand Down Expand Up @@ -145,7 +145,7 @@ GEM
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
fugit (1.11.0)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
globalid (1.2.1)
Expand Down Expand Up @@ -308,7 +308,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.4)
rexml (3.3.6)
strscan
rqrcode (2.2.0)
chunky_png (~> 1.0)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $LOGO_BG_COLOR: yellow;
$LOGO_HOVER_FG_COLOR: purple;
$LOGO_HOVER_BG_COLOR: yellow;

$LEFT_BAR_BORDER_COLOR: #545555; // gray
$LEFT_BAR_BORDER_COLOR: #535354; // gray
$LEFT_BAR_BORDER_RADIUS: 0px;
$LEFT_BAR_HEADER_FG_COLOR: black;
$LEFT_BAR_HEADER_BG_COLOR: yellow;
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/Agaricus.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "defaults";

$augustus_cap: #EaCe93; // #ECCF95
$brasiliensis_gills_1: #A06463;
$augustus_cap: #ECCF95;
$brasiliensis_gills_1: #BF6262; // #A06463
$brasiliensis_gills_2: #743931;
$campestris_cap: #F6F0F2;
$cupreobrunneus_gills: #3B2821;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Amanita.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $calyptroderma_middle_cap: #c18346;
$muscaria_background: #cc2616;
$muscaria_foreground: #fff8c6;
$velosa_background: #dd9d5f;
$velosa_light_veil: #fbead3; // faebd4
$velosa_light_veil: #f9e8d3; // faebd4
$velosa_dark_veil: #f4d5a6;
$novinupta_background: #d1afa5;
$pachycolea_background: #383138;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/BlackOnWhite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$LOGO_BORDER_COLOR: #DDDDDD;
$LEFT_BAR_BORDER_COLOR: #DDDDDD;
$TOP_BAR_BORDER_COLOR: #DFDfDD;
$TOP_BAR_BORDER_COLOR: #D9D9D9;
$LIST_BORDER_COLOR: #DDDDDD;
$BUTTON_HOVER_BORDER_COLOR: #CCCCCC;
$BUTTON_BG_COLOR: #CCCCCC;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Cantharellaceae.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $tubaeformis_hymenium: #c2914c;
$tubaeformis_bright_stipe: #ffb230;
$tubaeformis_dark_stipe: #4b2e0c;
$tubaeformis_light_stipe: #e5bb67;
$cornucopioides_dark_hymenium: #11120b; // image 465 #10110b
$cornucopioides_dark_hymenium: #13120d; // image 465 #10110b
$cornucopioides_light_hymenium: #9b9690;
$cornucopioides_dark_cap: #4f4337;
$cornucopioides_light_cap: #826c57;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Hygrocybe.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$conica_stain: #35362d; // #37372f
$conica_stain: #34342c; // #37372f
$conica_cap_red: #a31404;
$conica_cap_orange: #dd6226;
$conica_cap_yellow: #ffbf01;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Sudo.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$BODY_BG_COLOR: #DE7500; // #DD7700
$BODY_BG_COLOR: #DE7201; // #DD7700

$LOGO_BORDER_COLOR: black;
$LOGO_BORDER_WIDTH: 2px; // vs 1px in default
Expand Down
23 changes: 18 additions & 5 deletions app/assets/stylesheets/mo/_autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,29 @@
.has-id-indicator {
display: none;
}
.create-button {
display: inline-block;
}

.has-id {
.has-id-indicator {
display: inline-block;
}
}

.keep-btn {
display: none;
}
.create {
.keep-btn {
display: inline-block;
}
}

// initially we may not have id, but we also don't offer create
// until they've typed something
.create-button {
display: none;
}
.offer-create {
.create-button {
display: none;
display: inline-block;
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/mo/_help_tooltips.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $help-block-max-width: 600px;

.help-block {
color: $WELL_FG_COLOR;
max-width: $help-block-max-width;
// max-width: $help-block-max-width;
}

.tooltip-inner {
Expand Down
6 changes: 4 additions & 2 deletions app/assets/stylesheets/mo/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@
}

// This is for the stateful icon_link_to helper
.icon-link {
.icon-link,
.panel-collapse-trigger {
.active-icon, .active-label {
display: none;
}
&.active {
&.active,
&.collapsed {
.link-icon:not(.active-icon),
.sr-only:not(.active-label) {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/mo/_maps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// thumbnail & google map styles
//

.observation-form-map {
.form-map {
height: 400px;
width: 100%;
background-position: center center;
Expand Down
9 changes: 8 additions & 1 deletion app/controllers/admin/blocked_ips_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Admin
class BlockedIpsController < AdminController
# This page allows editing of blocked ips via params
# params[:add_okay] and params[:add_bad]
# GETting this page with params[:report] will show info about a chosen IP
# Using params[:report] will show info about a chosen IP
def edit
@ip = params[:report] if validate_ip!(params[:report])
@blocked_ips = sort_by_ip(IpStats.read_blocked_ips)
Expand All @@ -14,6 +14,7 @@ def edit

# Render the page after an update
def update
strip_params!
process_blocked_ips_commands
@blocked_ips = sort_by_ip(IpStats.read_blocked_ips)
@okay_ips = sort_by_ip(IpStats.read_okay_ips)
Expand All @@ -23,6 +24,12 @@ def update

private

def strip_params!
[:add_bad, :remove_bad, :add_okay, :remove_okay].each do |param|
params[param] = params[param].strip if params[param]
end
end

def sort_by_ip(ips)
ips.sort_by do |ip|
ip.to_s.split(".").map { |n| n.to_i + 1000 }.map(&:to_s).join(" ")
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,12 @@ def flash_object_errors(obj)
def save_with_log(obj)
type_sym = obj.class.to_s.underscore.to_sym
if obj.save
flash_notice(:runtime_created_at.t(type: type_sym))
notice = if obj.respond_to?(:text_name) && (name = obj.text_name)
:runtime_created_name.t(type: type_sym, value: name)
else
:runtime_created_at.t(type: type_sym)
end
flash_notice(notice)
true
else
flash_error(:runtime_no_save.t(type: type_sym))
Expand Down
Loading

0 comments on commit 60584cf

Please sign in to comment.