Skip to content

Commit

Permalink
Switched to retirement domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnieszka Figiel committed Jan 25, 2024
1 parent a76d65f commit 5c244d6
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 42 deletions.
8 changes: 0 additions & 8 deletions .standard_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -67,13 +67,13 @@
# 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

# 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
4 changes: 2 additions & 2 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions doc/gh-pages/api/trase_internal_api.oas3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/gh-pages/api/trase_public_api.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions doc/gh-pages/api/trase_public_api_1.0.oas3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions doc/gh-pages/api/trase_public_api_1.1.oas3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions frontend/.storybook/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
2 changes: 1 addition & 1 deletion frontend/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$/],
Expand Down
6 changes: 3 additions & 3 deletions frontend/html/includes/_head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<meta name="twitter:site" content="@TraseEarth" />
<meta name="twitter:title" content="<%= title %>" data-react-helmet="true">
<meta name="twitter:description" content="<%= description %>" data-react-helmet="true" />
<meta name="twitter:image" content="https://supplychains.trase.earth/card-image.png">
<meta name="twitter:image" content="https://mongabay.trase.earth/card-image.png">
<meta name="twitter:image:alt" content="TRASE - Transparency for sustainable economies">
<meta property="og:url" content="https://supplychains.trase.earth/" />
<meta property="og:url" content="https://mongabay.trase.earth/" />
<meta property="og:title" content="<%= title %>" data-react-helmet="true" />
<meta property="og:description" content="<%= description %>" data-react-helmet="true" />
<meta property="og:image" content="http://supplychains.trase.earth/card-image.png" />
<meta property="og:image" content="http://mongabay.trase.earth/card-image.png" />
<title translate="no"><%= title %></title>
<meta name="description" content="<%= description %>" data-react-helmet="true" />
<link rel="preload" as="font" href="/fonts/DecimaMonoPro.woff2" type="font/woff2" crossorigin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function VersioningModal({ data, context }) {
SEI-PCS approach to map subnational trade flows can be found for each of the countries
and commodities in{' '}
<a
href="https://supplychains.trase.earth/about"
href="https://mongabay.trase.earth/about"
target="_blank"
rel="noopener noreferrer"
title="Methods and data"
Expand Down
4 changes: 2 additions & 2 deletions frontend/scripts/tests/widgets/actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jest.mock('utils/getURLFromParams', () => ({

describe('test prepareWidget helper function', () => {
const someEndpoint = 'someEndpoint';
const rawEndpoint = 'https://supplychains.trase.earth/data';
const rawEndpoint = 'https://mongabay.trase.earth/data';
const someKey = 'id0_namesomeName';
const someParams = { id: 0, name: 'someName' };
const someUrl = 'http://supplychains.trase.earth';
const someUrl = 'http://mongabay.trase.earth';
const someEndpoints = {
[someEndpoint]: {
key: someKey
Expand Down
8 changes: 4 additions & 4 deletions frontend/stories/cards.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ storiesOf('Card', module).addWithJSX('Card', () => (
title="I'm a default card"
subtitle="A cool subtitle"
actionName="An action name"
linkUrl="https://supplychains.trase.earth"
imageUrl="https://supplychains.trase.earth/images/logos/new-logo-trase.svg"
linkUrl="https://mongabay.trase.earth"
imageUrl="https://mongabay.trase.earth/images/logos/new-logo-trase.svg"
/>
</div>
));
Expand All @@ -22,7 +22,7 @@ storiesOf('Card', module).addWithJSX('New variant', () => (
title="I'm a new card"
subtitle="A cool subtitle"
actionName="An action name"
linkUrl="https://supplychains.trase.earth"
linkUrl="https://mongabay.trase.earth"
/>
</div>
));
Expand All @@ -34,7 +34,7 @@ storiesOf('Card', module).addWithJSX('Dashed variant', () => (
title="I'm a new card"
subtitle="A cool subtitle"
actionName="An action name"
linkUrl="https://supplychains.trase.earth/images/logos/new-logo-trase.svg"
linkUrl="https://mongabay.trase.earth/images/logos/new-logo-trase.svg"
/>
</div>
));
Expand Down

0 comments on commit 5c244d6

Please sign in to comment.