From ad89f35108dd0a4f7aa70e332d0002fedf1e8bf5 Mon Sep 17 00:00:00 2001 From: sergiomarrocoli Date: Mon, 23 Jan 2023 17:19:52 +0000 Subject: [PATCH 1/6] Revert "Merge pull request #21 from unepwcmc/dependabot/bundler/kaminari-1.2.1" This reverts commit 06b5e6194dbfcfc2c3fb952a96efb95a87f8cc36, reversing changes made to 2865cff2eebe167ee4a8f45a30a2c89b59ad3e90. --- Gemfile.lock | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5bd636f..1da0b27 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,8 +53,8 @@ GEM descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - builder (3.2.4) bcrypt_pbkdf (1.1.0) + builder (3.2.2) byebug (3.1.2) columnize (~> 0.8) debugger-linecache (~> 1.2) @@ -75,7 +75,6 @@ GEM coercible (1.0.0) descendants_tracker (~> 0.0.1) columnize (0.9.0) - crass (1.0.6) concurrent-ruby (1.1.9) database_cleaner (1.5.1) debugger-linecache (1.2.0) @@ -117,27 +116,17 @@ GEM i18n (0.9.5) concurrent-ruby (~> 1.0) ice_nine (0.11.2) - json (1.8.6) - kaminari (1.2.1) - activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) - actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) - activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) + json (1.8.3) + kaminari (0.16.3) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) kramdown (1.9.0) - loofah (2.5.0) - crass (~> 1.0.2) + loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.3) mime-types (>= 1.16, < 3) mime-types (2.99) - mini_portile2 (2.4.0) + mini_portile2 (2.0.0) minitest (5.9.0) minitest-around (0.3.2) minitest (~> 5.0) @@ -149,12 +138,13 @@ GEM net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) pg (0.18.4) pony (1.11) mail (>= 2.0) rabl (0.11.8) activesupport (>= 2.3.14) - rack (1.6.13) + rack (1.6.4) rack-accept (0.4.5) rack (>= 0.4) rack-cors (0.4.0) @@ -166,12 +156,12 @@ GEM rack (>= 1.1.0) rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) railties (4.2.5.1) actionpack (= 4.2.5.1) activesupport (= 4.2.5.1) @@ -191,9 +181,9 @@ GEM net-scp (>= 1.1.2) net-ssh (>= 2.8.0) thor (0.19.1) - thread_safe (0.3.6) + thread_safe (0.3.5) tilt (2.0.2) - tzinfo (1.2.7) + tzinfo (1.2.2) thread_safe (~> 0.1) virtus (1.0.5) axiom-types (~> 0.1) From 32fcefe2501546caa5f0620203785acab2576455 Mon Sep 17 00:00:00 2001 From: maxime Date: Tue, 24 Jan 2023 17:05:04 +0000 Subject: [PATCH 2/6] chore: update recipients email --- config/secrets.yml.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/secrets.yml.erb b/config/secrets.yml.erb index 4b912fa..d590a39 100644 --- a/config/secrets.yml.erb +++ b/config/secrets.yml.erb @@ -34,7 +34,6 @@ production: <<: *mailer notifications_recipients: - protectedareas@unep-wcmc.org - - edward.lewis@unep-wcmc.org - Osgur.McDermott-Long@unep-wcmc.org - - Sara.Pruckner@unep-wcmc.org + - alanah.lewis@unep-wcmc.org subject_prefix: "Protected Planet API - " From c0117a58ea78595285c8970855c680ee6ef5b340 Mon Sep 17 00:00:00 2001 From: sergiomarrocoli Date: Wed, 8 Mar 2023 22:47:19 +0000 Subject: [PATCH 3/6] feat: add additional geom count fields to country API reponse --- api/v3/views/country.rabl | 4 +++- db | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/v3/views/country.rabl b/api/v3/views/country.rabl index 5f69d7a..cfa24b9 100644 --- a/api/v3/views/country.rabl +++ b/api/v3/views/country.rabl @@ -48,7 +48,9 @@ if @current_user.access_to?(Country, :country_statistic) :percentage_pa_marine_cover, :marine_area, :polygons_count, :points_count, :percentage_oecms_pa_marine_cover, :oecms_pa_land_area, - :oecms_pa_marine_area, :percentage_oecms_pa_land_cover + :oecms_pa_marine_area, :percentage_oecms_pa_land_cover, + :oecm_polygon_count, :oecm_point_count, + :protected_area_polygon_count, :protected_area_point_count end end diff --git a/db b/db index 8665cdd..334b1a9 160000 --- a/db +++ b/db @@ -1 +1 @@ -Subproject commit 8665cdde184024a825fd74e3d0b3f17fd22a2bbf +Subproject commit 334b1a95d6c9d319c2bb0618c0549c6409214cbe From eb04a2aa8aa1a94c1ccfb1442cfb77bbb69da036 Mon Sep 17 00:00:00 2001 From: sergiomarrocoli Date: Thu, 9 Mar 2023 08:37:29 +0000 Subject: [PATCH 4/6] feat: update api documentation --- api/v3/views/country.rabl | 6 +++--- web/views/documentation/countries.md | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/api/v3/views/country.rabl b/api/v3/views/country.rabl index cfa24b9..4a36cfc 100644 --- a/api/v3/views/country.rabl +++ b/api/v3/views/country.rabl @@ -47,10 +47,10 @@ if @current_user.access_to?(Country, :country_statistic) :land_area, :percentage_pa_land_cover, :percentage_pa_marine_cover, :marine_area, :polygons_count, :points_count, - :percentage_oecms_pa_marine_cover, :oecms_pa_land_area, - :oecms_pa_marine_area, :percentage_oecms_pa_land_cover, :oecm_polygon_count, :oecm_point_count, - :protected_area_polygon_count, :protected_area_point_count + :protected_area_polygon_count, :protected_area_point_count, + :percentage_oecms_pa_marine_cover, :oecms_pa_land_area, + :oecms_pa_marine_area, :percentage_oecms_pa_land_cover end end diff --git a/web/views/documentation/countries.md b/web/views/documentation/countries.md index a52b9f3..2639ac0 100644 --- a/web/views/documentation/countries.md +++ b/web/views/documentation/countries.md @@ -44,6 +44,10 @@ Sample response: "marine_area": 1829405.068391, "polygons_count": 16, "points_count": 16, + "oecm_polygon_count": 42, + "oecm_point_count": 136, + "protected_area_polygon_count": 265, + "protected_area_point_count": 8, "percentage_oecms_pa_marine_cover": 3.628933257, "oecms_pa_land_area": 51650.29769, "oecms_pa_marine_area": 66591.94832, @@ -130,6 +134,10 @@ Sample response: "marine_area": null, "polygons_count": 0, "points_count": 2 + "oecm_polygon_count": 0, + "oecm_point_count": 0, + "protected_area_polygon_count": 10772, + "protected_area_point_count": 2 }, "pame_statistics": { "assessments": 20, @@ -235,6 +243,10 @@ Sample response: "marine_area": 10201208.33913, "polygons_count": 1, "points_count": 37, + "oecm_polygon_count": 0, + "oecm_point_count": 0, + "protected_area_polygon_count": 42770, + "protected_area_point_count": 56, "percentage_oecms_pa_marine_cover": 3.628933257, "oecms_pa_land_area": 51650.29769, "oecms_pa_marine_area": 66591.94832, From 554d81e4b3caf2573d6677e4e2a03f1be8a14edd Mon Sep 17 00:00:00 2001 From: pazolka Date: Fri, 10 Mar 2023 15:23:46 +0000 Subject: [PATCH 5/6] feat: Dockerfile for api service --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7441c65 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ruby:2.3.0 +# Install node for asset building +RUN apt-get update -qq && apt-get install -y --force-yes build-essential libpq-dev nodejs +# install npm +RUN apt-get install -y --force-yes -qq npm +RUN ln -s /usr/bin/nodejs /usr/bin/node +# install bower +RUN npm install --global bower +RUN mkdir /ProtectedPlanetApi +WORKDIR /ProtectedPlanetApi +ADD Gemfile /ProtectedPlanetApi/Gemfile +ADD Gemfile.lock /ProtectedPlanetApi/Gemfile.lock +ADD config.ru /ProtectedPlanetApi/config.ru +ADD bower.json /ProtectedPlanetApi/bower.json +RUN gem install bundler -v 1.12.5 && bundle _1.12.5_ install +RUN bower install --allow-root +COPY . /ProtectedPlanetApi +EXPOSE 9292 +CMD ["rackup"] \ No newline at end of file From 57b2b80cba8fe66b7f75f6b2d2589cee44574d18 Mon Sep 17 00:00:00 2001 From: sergiomarrocoli Date: Mon, 13 Mar 2023 12:00:45 +0000 Subject: [PATCH 6/6] chore: update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a502ff..7ca9e5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 0.4.2 +**Add new fields to Countries JSON** +* Add :oecm_polygon_count, :oecm_point_count, :protected_area_polygon_count, :protected_area_point_count +* Add Dockerfile +* Update documentation + ### 0.4.1 **Add new fields to Countries JSON** * Add :percentage_oecms_pa_marine_cover, :oecms_pa_land_area, :oecms_pa_marine_area, :percentage_oecms_pa_land_cover