diff --git a/.standard_todo.yml b/.standard_todo.yml index 700cf513c3..65f5c6c716 100644 --- a/.standard_todo.yml +++ b/.standard_todo.yml @@ -707,14 +707,6 @@ ignore: - config/deploy.rb: - Style/StringLiterals - Style/PercentLiteralDelimiters -- config/environments/development.rb: - - Style/StringLiterals -- config/environments/production.rb: - - Style/StringLiterals - - Style/GlobalStdStream -- config/environments/test.rb: - - Style/StringLiterals - - Layout/ExtraSpacing - config/initializers/active_admin.rb: - Style/StringLiterals - Layout/CommentIndentation diff --git a/config/environments/development.rb b/config/environments/development.rb index 7a9f6c3a8c..3a1bfb06a1 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,13 +16,13 @@ # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? + if Rails.root.join("tmp", "caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" + "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 459e6f1ea9..a2176b575f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,7 +16,7 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' @@ -67,7 +67,7 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) + logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end @@ -75,5 +75,5 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - config.action_controller.asset_host = '//supplychains.trase.earth' + config.action_controller.asset_host = "//mongabay.trase.earth" end diff --git a/config/environments/test.rb b/config/environments/test.rb index 93ed4f1b78..fe4da18372 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -19,11 +19,11 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store diff --git a/doc/gh-pages/api/trase_internal_api.oas3.yaml b/doc/gh-pages/api/trase_internal_api.oas3.yaml index 27ec67a845..8819f7a8c4 100644 --- a/doc/gh-pages/api/trase_internal_api.oas3.yaml +++ b/doc/gh-pages/api/trase_internal_api.oas3.yaml @@ -4,9 +4,9 @@ info: version: "3.0" contact: name: Trase Public API - url: https://supplychains.trase.earth/ + url: https://mongabay.trase.earth/ email: info@trase.earth - termsOfService: https://supplychains.trase.earth/terms-of-use.html + termsOfService: https://mongabay.trase.earth/terms-of-use.html license: name: MIT License description: Trase Internal API V3 @@ -1896,7 +1896,7 @@ paths: info: $ref: "#/components/schemas/DashboardsMetaInfoNodeValues" servers: - - url: https://supplychains.trase.earth/api/v3 + - url: https://mongabay.trase.earth/api/v3 components: parameters: country_id_query_param: diff --git a/doc/gh-pages/api/trase_public_api.oas2.json b/doc/gh-pages/api/trase_public_api.oas2.json index 9f3f201ebf..1eb43894c5 100644 --- a/doc/gh-pages/api/trase_public_api.oas2.json +++ b/doc/gh-pages/api/trase_public_api.oas2.json @@ -3,7 +3,7 @@ "info": { "title": "Trase Public API", "version": "1.0", - "description": "This is a first version of a public API for [Trase](https://supplychains.trase.earth/).\n\n# Introduction\n\nThe Trase Public API allows to access trade flows data of forest risk commodities.\n\n# Entities\n\nThe API will expose the following entities present in Trase:\n1. attributes: quantitative and qualitative attributes (indicators)\n2. commodities: forest risk commodities\n3. countries: source countries for commodities\n4. flows: models the list of nodes in a supply chain (path) from source to destination\n5. nodes: entities participating in the supply chain. Each has a \"node type\", e.g. MUNICIPALITY, EXPORTER, but they are also grouped in the system by a more generic \"role\":\n\ta. sources: source nodes, such as municipalities in Brazil or departments in Paraguay\n\tb. traders: exporters / importers of commodities\n\tc. destinations: destination nodes, such as importing countries\n6. node types: the roles of nodes at particular positions in supply chains per country / commodity combination\n\n# Discovering node identifiers\n\nWe assume one of the typical scenarios is one where the point of entry into the data will be a source, an exporter, an importer or a destination. All of these entities are nodes, but int Trase we group them by \"role\" in the supply chain.\n\nIn the first step, users would use the sources / exporters / importers / destinations endpoints, which allow to discover the identifiers of entities by searching by name and existing natural identifiers (e.g. iso code). For now we need to work around the fact that nodes in the system don't have standardised identifiers, which would allow to skip this step.\n\nThose endpoints will also allow to discover the availability of indicators. Then in the next step users can use those identifiers to pull data for a particular node.\n\n# Retrieving attribute values\n\nIt is possible to retrieve full flows data using the flows endpoint.\n\nIt is also possible to retrieve data filtered by a particular node, which includes both values of attributes for flows in which the node participates (flow attributes), as well as values of some attributes which are not calculated from flows (node attributes).\n\n# Sample usage - retrieving flow data for country / commodity\n\nUse the commodities endpoint to discover identifiers of available commodities. You can also at the same time retrieve ids of countries from which the commodities are sourced.\n\n/api/public/commodities?include=countries\n\nCountries can be retireved using the countries endpoint.\n\nNow using the attributes endpoint, find out what sttributes are available for Brazil beef:\n\n/api/public/attributes?commodity=BEEF&country=BR\n\nVolume data is available for years 2015-2017. Request flows data for 2016-2017:\n\n/api/public/flows?commodity=BEEF&country=BR&start_year=2016&end_year=2017&page=1\n\nData is paginated.\n\n# Sample usage - retrieving data about a node\n\nDiscover the identifier of the sourcing place.\n\n/api/public/nodes/sources?country=BR&commodity=BEEF&name=SORRISO\n\nData is available for years 2003-2017. Request data for 2017:\n\n/api/public/nodes/{id of SORRISO}/data?year=2017" + "description": "This is a first version of a public API for [Trase](https://mongabay.trase.earth/).\n\n# Introduction\n\nThe Trase Public API allows to access trade flows data of forest risk commodities.\n\n# Entities\n\nThe API will expose the following entities present in Trase:\n1. attributes: quantitative and qualitative attributes (indicators)\n2. commodities: forest risk commodities\n3. countries: source countries for commodities\n4. flows: models the list of nodes in a supply chain (path) from source to destination\n5. nodes: entities participating in the supply chain. Each has a \"node type\", e.g. MUNICIPALITY, EXPORTER, but they are also grouped in the system by a more generic \"role\":\n\ta. sources: source nodes, such as municipalities in Brazil or departments in Paraguay\n\tb. traders: exporters / importers of commodities\n\tc. destinations: destination nodes, such as importing countries\n6. node types: the roles of nodes at particular positions in supply chains per country / commodity combination\n\n# Discovering node identifiers\n\nWe assume one of the typical scenarios is one where the point of entry into the data will be a source, an exporter, an importer or a destination. All of these entities are nodes, but int Trase we group them by \"role\" in the supply chain.\n\nIn the first step, users would use the sources / exporters / importers / destinations endpoints, which allow to discover the identifiers of entities by searching by name and existing natural identifiers (e.g. iso code). For now we need to work around the fact that nodes in the system don't have standardised identifiers, which would allow to skip this step.\n\nThose endpoints will also allow to discover the availability of indicators. Then in the next step users can use those identifiers to pull data for a particular node.\n\n# Retrieving attribute values\n\nIt is possible to retrieve full flows data using the flows endpoint.\n\nIt is also possible to retrieve data filtered by a particular node, which includes both values of attributes for flows in which the node participates (flow attributes), as well as values of some attributes which are not calculated from flows (node attributes).\n\n# Sample usage - retrieving flow data for country / commodity\n\nUse the commodities endpoint to discover identifiers of available commodities. You can also at the same time retrieve ids of countries from which the commodities are sourced.\n\n/api/public/commodities?include=countries\n\nCountries can be retireved using the countries endpoint.\n\nNow using the attributes endpoint, find out what sttributes are available for Brazil beef:\n\n/api/public/attributes?commodity=BEEF&country=BR\n\nVolume data is available for years 2015-2017. Request flows data for 2016-2017:\n\n/api/public/flows?commodity=BEEF&country=BR&start_year=2016&end_year=2017&page=1\n\nData is paginated.\n\n# Sample usage - retrieving data about a node\n\nDiscover the identifier of the sourcing place.\n\n/api/public/nodes/sources?country=BR&commodity=BEEF&name=SORRISO\n\nData is available for years 2003-2017. Request data for 2017:\n\n/api/public/nodes/{id of SORRISO}/data?year=2017" }, "host": "staging.trase.earth", "paths": { diff --git a/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml b/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml index f6e8b3cb62..775f213e57 100644 --- a/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml +++ b/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml @@ -4,13 +4,13 @@ info: version: "1.0" contact: name: Trase Public API - url: https://supplychains.trase.earth/ + url: https://mongabay.trase.earth/ email: info@trase.earth - termsOfService: https://supplychains.trase.earth/terms-of-use.html + termsOfService: https://mongabay.trase.earth/terms-of-use.html license: name: MIT License description: >- - This is a first version of the public API for [Trase](http://supplychains.trase.earth). + This is a first version of the public API for [Trase](http://mongabay.trase.earth). # Introduction @@ -107,7 +107,7 @@ info: /api/public/nodes/11113/data?year=2017 servers: - - url: https://supplychains.trase.earth/api/public + - url: https://mongabay.trase.earth/api/public paths: /countries: get: diff --git a/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml b/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml index 41faaa8dc8..dbb9f17ea7 100644 --- a/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml +++ b/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml @@ -4,13 +4,13 @@ info: version: "1.1" contact: name: Trase Public API - url: https://supplychains.trase.earth/ + url: https://mongabay.trase.earth/ email: info@trase.earth - termsOfService: https://supplychains.trase.earth/terms-of-use.html + termsOfService: https://mongabay.trase.earth/terms-of-use.html license: name: MIT License description: >- - This is a DRAFT version 1.1 of the public API for [Trase](http://supplychains.trase.earth). + This is a DRAFT version 1.1 of the public API for [Trase](http://mongabay.trase.earth). # Introduction @@ -107,7 +107,7 @@ info: /api/public/nodes/11113/data?year=2017 servers: - - url: https://supplychains.trase.earth/api/public + - url: https://mongabay.trase.earth/api/public paths: /countries: get: diff --git a/frontend/.env.sample b/frontend/.env.sample index 4e423c3ab8..2359968e9c 100644 --- a/frontend/.env.sample +++ b/frontend/.env.sample @@ -1,7 +1,7 @@ PORT=3000 NODE_ENV=development -API_V3_URL=//supplychains.trase.earth -UNIT_LAYERS_API_URL=//supplychains.trase.earth +API_V3_URL=//mongabay.trase.earth +UNIT_LAYERS_API_URL=//mongabay.trase.earth UNIT_LAYERS_DATA_ENV=production GOOGLE_ANALYTICS_KEY=G-NVLPKWKFMY diff --git a/frontend/.storybook/theme.js b/frontend/.storybook/theme.js index 9dc6272d37..38b2399fcb 100644 --- a/frontend/.storybook/theme.js +++ b/frontend/.storybook/theme.js @@ -32,6 +32,6 @@ export default create({ inputBorderRadius: 4, brandTitle: 'Trase', - brandUrl: 'https://supplychains.trase.earth', - brandImage: 'https://supplychains.trase.earth/images/logos/logo-trase-nav.png' + brandUrl: 'https://mongabay.trase.earth', + brandImage: 'https://mongabay.trase.earth/images/logos/logo-trase-nav.png' }); diff --git a/frontend/config/webpack.config.prod.js b/frontend/config/webpack.config.prod.js index af2231116d..abb5237321 100644 --- a/frontend/config/webpack.config.prod.js +++ b/frontend/config/webpack.config.prod.js @@ -25,7 +25,7 @@ module.exports = merge(webpackBaseConfig, { }), new webpack.optimize.ModuleConcatenationPlugin(), new SWPrecacheWebpackPlugin({ - cacheId: 'supplychains.trase.earth', + cacheId: 'mongabay.trase.earth', filename: 'service-worker.js', minify: true, staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/, /\.html$/], diff --git a/frontend/html/includes/_head.ejs b/frontend/html/includes/_head.ejs index ca3378dbab..6e9981a07e 100644 --- a/frontend/html/includes/_head.ejs +++ b/frontend/html/includes/_head.ejs @@ -23,12 +23,12 @@ - + - + - +