diff --git a/client/cypress/e2e/analysis/filters-map.cy.ts b/client/cypress/e2e/analysis/filters-map.cy.ts index 3a58beaee..a6921d021 100644 --- a/client/cypress/e2e/analysis/filters-map.cy.ts +++ b/client/cypress/e2e/analysis/filters-map.cy.ts @@ -1,9 +1,9 @@ describe('Analysis filters', () => { beforeEach(() => { - cy.intercept('GET', '/api/v1/indicators?sort=name', { - fixture: 'indicators/index', - }).as('fetchIndicators'); - cy.intercept('GET', '/api/v1/indicators?filter[status]=active', { + // cy.intercept('GET', '/api/v1/indicators?sort=name', { + // fixture: 'indicators/index', + // }).as('fetchIndicators'); + cy.intercept('GET', '/api/v1/indicators*', { fixture: 'indicators/index', }).as('fetchActiveIndicators'); cy.intercept('GET', '/api/v1/h3/years*', { @@ -27,47 +27,24 @@ describe('Analysis filters', () => { }); // Indicators - it('not to filter by a disabled indicator', () => { - cy.intercept('GET', '/api/v1/indicators*', { - statusCode: 200, - fixture: 'indicators/index', - }).as('fetchIndicators'); - - cy.wait('@fetchIndicators').then((interception) => { - const firstDisabledIndicator = interception.response.body?.data.find( - ({ attributes }) => attributes.status === 'inactive', + it('arriving to /analysis/map without params will load the first active indicator available and reflect it in the URL', () => { + cy.wait('@fetchActiveIndicators').then((interception) => { + const firstIndicator = interception.response.body?.data[0]; + cy.get('[data-testid="select-indicators-filter"]').should( + 'contain', + firstIndicator?.attributes.name, ); - // opens the select - cy.get('[data-testid="select-indicators-filter"]').find('button').click(); - cy.get('[data-testid="select-indicators-filter"]') - .find('li[data-headlessui-state="disabled"]') - .first() - .should('contain', firstDisabledIndicator?.attributes.name) - .should('have.attr', 'aria-disabled', 'true'); - // url should not include the disabled indicator - cy.url().should('not.include', `indicator=${firstDisabledIndicator?.id}`); // Land use + cy.url().should('include', `indicators=${firstIndicator?.id}`); }); }); - it('filter by an active indicator', () => { - cy.intercept('GET', '/api/v1/indicators*', { - statusCode: 200, - fixture: 'indicators/index', - }).as('fetchIndicators'); - - cy.wait('@fetchIndicators').then((interception) => { - const activeIndicators = interception.response.body?.data.filter( - ({ attributes }) => attributes.status === 'active', - ); - // opens the select - cy.get('[data-testid="select-indicators-filter"]').find('button').click(); + it('in analysis map, selecting an indicator will update the URL accordingly ', () => { + cy.wait('@fetchActiveIndicators').then((interception) => { + const thirdIndicator = interception.response.body?.data[2]; cy.get('[data-testid="select-indicators-filter"]') - .find('li:not([data-headlessui-state="disabled"])') - .eq(1) - .should('contain', activeIndicators[1]?.attributes.name) - .click(); - // url should include the active indicator - cy.url().should('include', `indicator=${activeIndicators[1]?.id}`); + .type('{downarrow}{downarrow}{enter}') + .should('contain', thirdIndicator?.attributes.name); + cy.url().should('include', `indicators=${thirdIndicator?.id}`); }); }); diff --git a/client/cypress/e2e/analysis/filters-table.cy.ts b/client/cypress/e2e/analysis/filters-table.cy.ts index 4fb423f95..82d03ce0e 100644 --- a/client/cypress/e2e/analysis/filters-table.cy.ts +++ b/client/cypress/e2e/analysis/filters-table.cy.ts @@ -1,15 +1,19 @@ describe('Analysis filters', () => { beforeEach(() => { cy.intercept('GET', '/api/v1/indicators?sort=name').as('fetchIndicators'); - cy.intercept('GET', '/api/v1/indicators?filter[status]=active').as('fetchActiveIndicators'); + cy.intercept('GET', '/api/v1/indicators?filter[status]=active', { + statusCode: 200, + fixture: 'indicators/index', + }).as('fetchActiveIndicators'); cy.intercept('GET', '/api/v1/h3/years*', { statusCode: 200, fixture: 'years/index', }).as('fetchYears'); cy.intercept('GET', '/api/v1/materials/trees*').as('fetchMaterialsTrees'); + cy.intercept('GET', '/api/v1/impact/table*').as('fetchTableData'); + cy.login(); - cy.visit('/analysis/table'); }); afterEach(() => { @@ -17,58 +21,96 @@ describe('Analysis filters', () => { }); // Indicators - it('filter by All indicator', () => { - // select indicator - cy.get('[data-testid="select-indicators-filter"]').find('button').click(); - cy.get('[data-testid="select-indicators-filter"] ul li:first').click(); + it('/analysis/table page without indicators in URL displays all active indicators', () => { + cy.visit('/analysis/table'); + + cy.wait(['@fetchActiveIndicators', '@fetchTableData']).then((interception) => { + const allIndicators = interception[0].response.body?.data?.length; + const dataTableRequest = interception[1]; + + expect(dataTableRequest.request.query.indicatorIds).to.deep.eq( + interception[0].response.body?.data.map(({ id }) => id), + ); + + cy.get('[data-testid="analysis-table"]') + .find('table > tbody > tr[class="group"]') + .should('have.length', allIndicators); - cy.url().should('include', 'indicator=all'); + cy.url().should('not.include', 'indicator=all'); + }); }); - it('not to filter by a disabled indicator', () => { - cy.intercept('GET', '/api/v1/indicators*', { - fixture: 'indicators/index', - }).as('fetchIndicators'); + it('selecting multiple indicators will filter the data of the table', () => { + cy.visit('/analysis/table'); - cy.wait('@fetchIndicators').then((interception) => { - const firstDisabledIndicator = interception.response.body?.data.find( - ({ attributes }) => attributes.status === 'inactive', + cy.wait(['@fetchActiveIndicators', '@fetchTableData']).then((interception) => { + const indicators = interception[0].response.body?.data; + const waterQuality = indicators.filter( + ({ attributes }) => attributes.category === 'Water quality', ); - // opens the select - cy.get('[data-testid="select-indicators-filter"]').find('button').click(); - cy.get('[data-testid="select-indicators-filter"]') - .find('li[data-headlessui-state="disabled"]') - .first() - .should('contain', firstDisabledIndicator?.attributes.name) - .should('have.attr', 'aria-disabled', 'true'); - // url should not include the disabled indicator - cy.url().should('not.include', `indicator=${firstDisabledIndicator?.id}`); // Land use + + const $indicatorSelector = cy.get('[data-testid="tree-select-indicators"]'); + $indicatorSelector.click().type('Water quality'); + + $indicatorSelector + .find('[data-testid="tree-select-search-results"]') + .contains('Water quality') + .click(); + + cy.url().should('include', `indicators=${waterQuality.map(({ id }) => id).join(',')}`); + + cy.get('[data-testid="analysis-table"]') + .find('table > tbody > tr[class="group"]') + .should('have.length', waterQuality?.length); }); }); - it('filter by an active indicator', () => { - cy.intercept('GET', '/api/v1/indicators*', { - fixture: 'indicators/index', - }).as('fetchIndicators'); + it('an user inspects one of the indicators in detail', () => { + cy.visit('/analysis/table'); - cy.wait('@fetchIndicators').then((interception) => { - const firstActiveIndicator = interception.response.body?.data.find( - ({ attributes }) => attributes.status === 'active', + cy.wait(['@fetchActiveIndicators', '@fetchTableData']).then((interception) => { + const indicators = interception[0].response.body?.data; + const waterQuality = indicators.filter( + ({ attributes }) => attributes.category === 'Water quality', ); - // opens the select - cy.get('[data-testid="select-indicators-filter"]').find('button').click(); - cy.get('[data-testid="select-indicators-filter"]') - .find('li:not([data-headlessui-state="disabled"])') - .eq(1) - .should('contain', firstActiveIndicator?.attributes.name) + + const $indicatorSelector = cy.get('[data-testid="tree-select-indicators"]'); + + const $tableHeader = cy + .get('[data-testid="analysis-table"]') + .find('table > thead > tr') + .first(); + + const $tableRows = cy + .get('[data-testid="analysis-table"]') + .find('table > tbody > tr[class="group"]'); + + $indicatorSelector.click().type('Water quality'); + + $indicatorSelector + .find('[data-testid="tree-select-search-results"]') + .contains('Water quality') .click(); - // url should include the active indicator - cy.url().should('include', `indicator=${firstActiveIndicator?.id}`); + + cy.wait('@fetchTableData'); + + $tableRows.should('have.length', waterQuality?.length); + + $tableRows.first().find('button').contains('View detail').click(); + + $tableHeader.contains(waterQuality[0].attributes.name); + + cy.url().should( + 'include', + `indicators=${waterQuality.map(({ id }) => id).join(',')}&detail=${waterQuality[0].id}`, + ); }); }); - // Group by filters + // // Group by filters it('filter by a group', () => { + cy.visit('/analysis/table'); + cy.get('[data-testid="select-group-filters"]').find('button').click(); cy.get('[data-testid="select-group-filters"]') .find('li') @@ -80,6 +122,8 @@ describe('Analysis filters', () => { // Years it('filter by a range of years', () => { + cy.visit('/analysis/table'); + cy.wait('@fetchYears').then((interception) => { const firstYear = interception.response.body?.data[0]; const lastYear = diff --git a/client/cypress/fixtures/indicators/index.json b/client/cypress/fixtures/indicators/index.json index de639c6db..410b070a3 100644 --- a/client/cypress/fixtures/indicators/index.json +++ b/client/cypress/fixtures/indicators/index.json @@ -1,202 +1,229 @@ { "meta": { - "totalItems": 5, - "totalPages": 1, - "size": 25, - "page": 1 + "totalItems": 6, + "totalPages": 1, + "size": 25, + "page": 1 }, "data": [ - { - "type": "indicators", - "id": "5c595ac7-f144-485f-9f32-601f6faae9fe", - "attributes": { - "id": "5c595ac7-f144-485f-9f32-601f6faae9fe", - "name": "Land use", - "description": "The total land area required to produce the material. Land impact is calculated using material production and yield data from the global 2010 MAPSPAM and 2010 Gridded Livestock of the World v3 (GLWv3) datasets.", - "unit": { - "id": "6970f9b8-eba0-4fee-b6ee-2723ce6604d4", - "name": "hectare per year", - "shortName": "HAR", - "symbol": "ha/yr", - "description": "A unit of count defining the number of units counted in multiples of 100." - }, - "status": "active", - "metadata": { - "name": "Land use", - "units": "ha/yr", - "source": [ - "Mapspam 2010", - "LGW3 2010" - ], - "license": "CC BY 4.0", - "citation": [ - "International Food Policy Research Institute, 2019, “Global Spatially-Disaggregated Crop Production Statistics Data for 2010 Version 2.0”, https://doi.org/10.7910/DVN/PRFF8V, Harvard Dataverse, V4", - "Yu, Q., You, L., Wood-Sichra, U., Ru, Y., et. al. 2020. A cultivated planet in 2010: 2. the global gridded agricultural production maps, Earth Syst. Sci. Data Discuss. https://doi.org/10.5194/essd-2020-11", - "Gilbert, M., Nicolas, G., Cinardi, G., Van Boeckel, T.P., et. al. 2018. Global distribution data for cattle, buffaloes, horses, sheep, goats, pigs, chickens and ducks in 2010. Scientific data, 5(1), pp.1-11. https://doi.org/10.1038/sdata.2018.227" - ], - "name code": "LI", - "resolution": "10x10 kilometers", - "short name": "Land use", - "description": "The total land area required to produce the material. Land impact is calculated using material production and yield data from the global 2010 MAPSPAM and 2010 Gridded Livestock of the World v3 (GLWv3) datasets.", - "indicator type": "farm-level", - "date of content": "2010", - "geographic coverage": "Global coverage.", - "frequency of updates": "" - }, - "nameCode": "LI" + { + "type": "indicators", + "id": "5c133ba4-da24-46db-9c6c-ece7520f01b0", + "attributes": { + "id": "5c133ba4-da24-46db-9c6c-ece7520f01b0", + "name": "Cropland expansion in natural ecosystems", + "description": "The annual average area of cropland expansion into natural ecosystems occuring within a 50km radius attributable to the raw material sourced.", + "category": "Natural ecosystem conversion", + "status": "active", + "metadata": { + "name": "Cropland expansion in natural ecosystems", + "units": "ha/yr", + "source": [ + "Esri/Sentinel-2 10m land use/land cover", + "SBTN/WRI/Systemiq/WWF" + ], + "license": "CC BY 4.0", + "citation": [ + "Mazur, Elise, Michelle Sims, Elizabeth Goldman, Martina Schneider, Fred Stolle, Marco Daldoss Pirri, and Craig Beatty. 2023. ‘SBTN Natural Lands Map: Technical Documentation’. SBTN. https://sciencebasedtargetsnetwork.org/wp-content/uploads/2023/05/Technical-Guidance-2023-Step3-Land-v0.3-Natural-Lands-Map.pdf.", + "Karra, Krishna, Caitlin Kontgis, Zoe Statman-Weil, Joseph C. Mazzariello, Mark Mathis, and Steven P. Brumby. 2021. ‘Global Land Use / Land Cover with Sentinel 2 and Deep Learning’. In 2021 IEEE International Geoscience and Remote Sensing Symposium IGARSS, 4704–7. Brussels, Belgium: IEEE. https://doi.org/10.1109/IGARSS47720.2021.9553499." + ], + "name_code": "NCE", + "resolution": "100x100 meters", + "short_name": "Net cropland expansion", + "description": "The cropland expansion in natural ecosystems indicator quantifies the annual average area of cropland expansion into natural ecosystems occuring within a 50km radius attributable to the raw material sourced.", + "indicator_type": "landscape-level", + "interpretation": "An estimate of the annual net area of cropland expansion into natural ecosystems since 2020 within a 50km radius that is attributable to the quantity of raw material sourced using a statistical land use change (sLUC) approach. This indicator assumes that land conversion is driven by demand for land in the local area and is a conservative estimate of the amount of natural ecosystems that are lost to cropland expansion in the local area. It is intended to assist companies in prioritizing sourcing areas in alignment with Zero Deforestation and Zero Land Conversion commitments, such as the Accountability Framework Initiative (AFI) and the Science Based Targets Network (SBTN) Zero Natural Land Conversion target.", + "date_of_content": "2023", + "geographic_coverage": "Global coverage.", + "frequency_of_updates": "Annual", + "impact_type_category": "Natural ecosystem conversion" + }, + "nameCode": "NCE" + } + }, + { + "type": "indicators", + "id": "936d0a9f-fe48-42b4-9433-63282d4dada5", + "attributes": { + "id": "936d0a9f-fe48-42b4-9433-63282d4dada5", + "name": "Deforestation footprint (sLUC)", + "description": "The deforestation footprint (sLUC) indicator quantifies the annual average area of deforestation within a 50km radius attributable to the raw material sourced.", + "category": "Natural ecosystem conversion", + "status": "active", + "metadata": { + "name": "Deforestation footprint (sLUC)", + "units": "ha/yr", + "source": [ + "Hansen/UMD/Google/USGS/NASA", + "Mazur/Potapov/Turubanova/Chuvieco" + ], + "license": "CC BY 4.0", + "citation": [ + "Chuvieco, Emilio, Joshua Lizundia-Loiola, Maria Lucrecia Pettinari, Ruben Ramo, Marc Padilla, Kevin Tansey, Florent Mouillot, et al. 2018. ‘Generation and Analysis of a New Global Burned Area Product Based on MODIS 250 m Reflectance Bands and Thermal Anomalies’. Earth System Science Data 10 (4): 2015–31. https://doi.org/10.5194/essd-10-2015-2018.", + "Hansen, M. C., P. V. Potapov, R. Moore, M. Hancher, S. A. Turubanova, A. Tyukavina, D. Thau, et al. 2013. ‘High-Resolution Global Maps of 21st-Century Forest Cover Change’. Science 342 (6160): 850–53. https://doi.org/10.1126/science.1244693", + "Mazur, Elise, Michelle Sims, Elizabeth Goldman, Martina Schneider, Fred Stolle, Marco Daldoss Pirri, and Craig Beatty. 2023. ‘SBTN Natural Lands Map: Technical Documentation’. SBTN. https://sciencebasedtargetsnetwork.org/wp-content/uploads/2023/05/Technical-Guidance-2023-Step3-Land-v0.3-Natural-Lands-Map.pdf.", + "Potapov, Peter, Matthew C. Hansen, Lars Laestadius, Svetlana Turubanova, Alexey Yaroshenko, Christoph Thies, Wynet Smith, et al. 2017. ‘The Last Frontiers of Wilderness: Tracking Loss of Intact Forest Landscapes from 2000 to 2013’. Science Advances 3 (1): e1600821. https://doi.org/10.1126/sciadv.1600821.", + "Potapov, Peter, Matthew C. Hansen, Amy Pickens, Andres Hernandez-Serna, Alexandra Tyukavina, Svetlana Turubanova, Viviana Zalles, et al. 2022. ‘The Global 2000-2020 Land Cover and Land Use Change Dataset Derived From the Landsat Archive: First Results’. Frontiers in Remote Sensing 3 (April): 856903. https://doi.org/10.3389/frsen.2022.856903. ", + "Turubanova, Svetlana, Peter V Potapov, Alexandra Tyukavina, and Matthew C Hansen. 2018. ‘Ongoing Primary Forest Loss in Brazil, Democratic Republic of the Congo, and Indonesia’. Environmental Research Letters 13 (7): 074028. https://doi.org/10.1088/1748-9326/aacd1c." + ], + "name_code": "DF_SLUC", + "resolution": "100x100 meters", + "short_name": "Deforestation footprint (sLUC)", + "description": "The deforestation footprint (sLUC) indicator quantifies the annual average area of deforestation within a 50km radius attributable to the raw material sourced.", + "indicator_type": "landscape-level", + "interpretation": "Deforestation footprint estimates the area of deforestation occurring within a 50km radius that is attributable to the quantity of raw material sourced using a statistical land use change (sLUC) approach. The indicator assumes that deforestation is driven by demand for land area.", + "date_of_content": "2001-2022", + "geographic_coverage": "Global coverage (excluding Antarctica and other Arctic islands).", + "frequency_of_updates": "Annual", + "impact_type_category": "Natural ecosystem conversion" + }, + "nameCode": "DF_SLUC" + } + }, + { + "type": "indicators", + "id": "a39394be-ad57-41bc-9c2c-be0949ec6193", + "attributes": { + "id": "a39394be-ad57-41bc-9c2c-be0949ec6193", + "name": "Excess freshwater nutrient load assimilation volume", + "description": "The excess freshwater nutrient load assimilation volume indicator aims to quantify the volume by which nutrient load associated with the raw material sourced must be decreased to achieve the desired instream nutrient concentration.", + "category": "Water quality", + "status": "active", + "metadata": { + "name": "Excess freshwater nutrient load assimilation volume", + "units": "Mm3/yr", + "source": [ + "McDowell et al 2020", + "Mekonnen 2011", + "Mekonnen 2012" + ], + "license": "CC BY 4.0", + "citation": [ + "McDowell, R. W., A. Noble, P. Pletnyakov, B. E. Haggard and L. M. Mosley, 2020. Global Mapping of Freshwater Nutrient Enrichment and Periphyton Growth Potential. Scientific Reports.https: //doi.org/10.1038/s41598-020-60279-w.", + "McDowell, R. W., A. Noble, P. Pletnyakov, B. E. Haggard and L. M. Mosley, 2020. Global Mapping of Freshwater Nutrient Enrichment and Periphyton Growth Potential. Scientific Reports.https: //doi.org/10.1038/s41598-020-60279-w.", + "Mekonnen, M.M. & Hoekstra, A.Y. (2011) The green, blue and grey water footprint of crops and derived crop products, Hydrology and Earth System Sciences, 15(5): 1577-1600.", + "Mekonnen, M.M. & Hoekstra, A.Y. (2012) A global assessment of the water footprint of farm animal products, Ecosystems, 15(3): 401–415." + ], + "name_code": "ENL", + "resolution": "", + "short_name": "Excess nutrient load", + "description": "The excess freshwater nutrient load assimilation volume indicator aims to quantify the volume by which nutrient load associated with the raw material sourced must be decreased to achieve the desired instream nutrient concentration.", + "indicator_type": "farm-level", + "interpretation": "The excess nutrient load indicator describes the extent to which nutrient loads must be reduced to meet the desired nutrient concentration following the Science Based Targets Network (SBTN) water quality target indicator approach (Science Based Targets Network 2023b). The reduction is measured as a proportion of the total nutrient load indicator and expressed in terms of the volume of freshwater required to absorb the excess pollutants.", + "date_of_content": "", + "geographic_coverage": "Global coverage.", + "frequency_of_updates": "", + "impact_type_category": "Water quality" + }, + "nameCode": "ENL" + } + }, + { + "type": "indicators", + "id": "ffdd6f19-6737-4a10-9d36-5243d3f14b45", + "attributes": { + "id": "ffdd6f19-6737-4a10-9d36-5243d3f14b45", + "name": "Excess surface or groundwater use", + "description": "The excess surface or groundwater use indicator calculates the volume by which the water consumption associated with the production of the raw material sourced must be decreased to reduce pressure on nature.", + "category": "Water quantity", + "status": "active", + "metadata": { + "name": "Excess surface or groundwater use", + "units": "Mm3/yr", + "source": [ + "Aqueduct 4.0 2019", + "Mekonnen 2011", + "Mekonnen 2012" + ], + "license": "CC BY 4.0", + "citation": [ + "Kuzma, S., M.F.P. Bierkens, S.Lakshman, T. Luo, L. Saccoccia, E. H. Sutanudjaja, and R. Van Beek. 2023. “Aqueduct 4.0: Updated decision-relevant global water risk indicators.” Technical Note. Washington, DC: World Resources Institute. Available online at: doi.org/10.46830/ writn.23.00061.", + "Mekonnen, M.M. & Hoekstra, A.Y. (2011) The green, blue and grey water footprint of crops and derived crop products, Hydrology and Earth System Sciences, 15(5): 1577-1600.", + "Mekonnen, M.M. & Hoekstra, A.Y. (2012) A global assessment of the water footprint of farm animal products, Ecosystems, 15(3): 401–415." + ], + "name_code": "UWU", + "resolution": "", + "short_name": "Unsustainable water use", + "description": "The excess surface or groundwater use indicator calculates the volume by which the water consumption associated with the production of the raw material sourced must be decreased to reduce pressure on nature.", + "indicator_type": "farm-level", + "interpretation": "The unsustainable water use indicator shows the amount by which water use would need to be reduced in order to reduce pressure on local watersheds and return them to a maximum allowable level of basin-wide withdrawals, according to the Science Based Targets Network (SBTN) water quantity target approach (Science Based Targets Network 2023b). Unsustainable water use is measured as a proportion of total water use.", + "date_of_content": "2019", + "geographic_coverage": "Global coverage.", + "frequency_of_updates": "", + "impact_type_category": "Water quantity" + }, + "nameCode": "UWU" + } + }, + { + "type": "indicators", + "id": "d5f945c9-8636-45a2-a7c9-67a1dc8e687a", + "attributes": { + "id": "d5f945c9-8636-45a2-a7c9-67a1dc8e687a", + "name": "Freshwater nutrient load assimilation volume", + "description": "The freshwater nutrient load assimilation volume indicator estimates the annual average water volume required to assimilate the nutrient load added by the raw material sourced.", + "category": "Water quality", + "status": "active", + "metadata": { + "name": "Freshwater nutrient load assimilation volume", + "units": "Mm3/yr", + "source": [ + "Mekonnen 2011", + "Mekonnen 2012" + ], + "license": "CC BY 4.0", + "citation": [ + "Mekonnen, M.M. & Hoekstra, A.Y. (2011) The green, blue and grey water footprint of crops and derived crop products, Hydrology and Earth System Sciences, 15(5): 1577-1600.", + "Mekonnen, M.M. & Hoekstra, A.Y. (2012) A global assessment of the water footprint of farm animal products, Ecosystems, 15(3): 401–415." + ], + "name_code": "NL", + "resolution": "", + "short_name": "Nutrient load", + "description": "The freshwater nutrient load assimilation volume indicator estimates the annual average water volume required to assimilate the nutrient load added by the raw material sourced.", + "indicator_type": "farm-level", + "interpretation": "The nutrient load indicator describes the average volume of freshwater required to absorb the nutrient load created by production of the raw material. It is intended to align with the Science Based Targets Network (SBTN) water quality target indicator (Science Based Targets Network 2023b).", + "date_of_content": "1996-2005", + "geographic_coverage": "Global coverage.", + "frequency_of_updates": "", + "impact_type_category": "Water quality" + }, + "nameCode": "NL" + } + }, + { + "type": "indicators", + "id": "9c2124c7-5df0-40d5-962e-d35480d48cd3", + "attributes": { + "id": "9c2124c7-5df0-40d5-962e-d35480d48cd3", + "name": "Surface or groundwater use", + "description": "The surface or groundwater use indicator estimates the volume of surface or groundwater that is consumed in the production of the raw material sourced.", + "category": "Water quantity", + "status": "active", + "metadata": { + "name": "Surface or groundwater use", + "units": "Mm3/yr", + "source": [ + "Mekonnen 2011", + "Mekonnen 2012" + ], + "license": "CC BY 4.0", + "citation": [ + "Mekonnen, M.M. & Hoekstra, A.Y. (2011) The green, blue and grey water footprint of crops and derived crop products, Hydrology and Earth System Sciences, 15(5): 1577-1600.", + "Mekonnen, M.M. & Hoekstra, A.Y. (2012) A global assessment of the water footprint of farm animal products, Ecosystems, 15(3): 401–415." + ], + "name_code": "WU", + "resolution": "", + "short_name": "Water use", + "description": "The surface or groundwater use indicator estimates the volume of surface or groundwater that is consumed in the production of the raw material sourced.", + "indicator_type": "farm-level", + "interpretation": "The water use indicator describes the average volume of water consumed in the production of raw materials in a given country context. It is intended to align with the Science Based Targets Network (SBTN) water quantity target indicator (Science Based Targets Network 2023b).", + "date_of_content": "1996-2005", + "geographic_coverage": "Global coverage.", + "frequency_of_updates": "", + "impact_type_category": "Water quantity" + }, + "nameCode": "WU" + } } - }, - { - "type": "indicators", - "id": "936d0a9f-fe48-42b4-9433-63282d4dada5", - "attributes": { - "id": "936d0a9f-fe48-42b4-9433-63282d4dada5", - "name": "Deforestation risk", - "description": "Forest loss occurring near material production areas. Deforestation is either calculated using Satelligence models trained to identify transitions from forest to non-forest states in satellite imagery, or using global tree cover loss data from Global Forest Watch.", - "unit": { - "id": "6970f9b8-eba0-4fee-b6ee-2723ce6604d4", - "name": "hectare per year", - "shortName": "HAR", - "symbol": "ha/yr", - "description": "A unit of count defining the number of units counted in multiples of 100." - }, - "status": "active", - "metadata": { - "name": "Deforestation risk", - "units": "ha/yr", - "source": [ - "Satelligence 2022", - "Hansen 2001-2021" - ], - "license": "CC BY 4.0", - "citation": [ - "Satelligence, 2022. Forest Change Bulletins. https://satelligence.com/technology", - "Hansen, M. C., P. V. Potapov, R. Moore, M. Hancher, S. A. Turubanova, A. Tyukavina, D. Thau, et al. 2013. “High-Resolution Global Maps of 21st-Century Forest Cover Change.” Science 342 (6160): 850–53. https://doi.org/10.1126/science.1244693. " - ], - "name code": "DF_LUC_T", - "resolution": "30x30 meters", - "short name": "Deforestation risk", - "description": "Forest loss occurring near material production areas. Deforestation is either calculated using Satelligence models trained to identify transitions from forest to non-forest states in satellite imagery, or using global tree cover loss data from Global Forest Watch.", - "indicator type": "landscape-level", - "date of content": "2001-2021", - "geographic coverage": "Global coverage (excluding Antarctica and other Arctic islands).", - "frequency of updates": "Annual" - }, - "nameCode": "DF_LUC_T" - } - }, - { - "type": "indicators", - "id": "157b5f22-916b-4981-84c7-f6607ec65445", - "attributes": { - "id": "157b5f22-916b-4981-84c7-f6607ec65445", - "name": "Climate risk from land use change", - "description": "The GHG emissions associated with forest loss near agricultural production areas. The general equation for landscape-level impacts is adjusted for the mean annual gross emissions of GHGs associated with forest change from 2001 to 2019.", - "unit": { - "id": "a0e8110c-fbde-4c8c-ac19-f0f69078b96b", - "name": "tonnes of carbon dioxide equivalent per year", - "shortName": "TCO2EYR", - "symbol": "tCO2e/yr", - "description": "Tonnes of carbon dioxide equivalent per year" - }, - "status": "active", - "metadata": { - "name": "Climate risk", - "units": "tCO2eq/yr", - "source": [ - "Harris 2001-2021" - ], - "license": "CC BY 4.0", - "citation": [ - "Harris, N.L., Gibbs, D.A., Baccini, A. et al. Global maps of twenty-first century forest carbon fluxes. Nat. Clim. Chang. 11, 234–240 (2021). https://doi.org/10.1038/s41558-020-00976-6" - ], - "name code": "GHG_LUC_T", - "resolution": "30x30 meters", - "short name": "Climate risk", - "description": "The GHG emissions associated with forest loss near agricultural production areas. The general equation for landscape-level impacts is adjusted for the mean annual gross emissions of GHGs associated with forest change from 2001 to 2019.", - "indicator type": "landscape-level", - "date of content": "2001-2021", - "geographic coverage": "Global coverage.", - "frequency of updates": "Annual" - }, - "nameCode": "GHG_LUC_T" - } - }, - { - "type": "indicators", - "id": "ffdd6f19-6737-4a10-9d36-5243d3f14b45", - "attributes": { - "id": "ffdd6f19-6737-4a10-9d36-5243d3f14b45", - "name": "Unsustainable water use", - "description": "The water consumption in regions with a baseline water stress (BWS) ratio of more than 0.4, as identified by Aqueduct. BWS measures the ratio of total water withdrawals to available renewable surface and groundwater supplies.", - "unit": { - "id": "9c0da38a-6371-4c79-879b-218fc39c4700", - "name": "milions of cubic meters per year", - "shortName": "MM3YR", - "symbol": "Mm3/yr", - "description": "Millions of cubic meters per year" - }, - "status": "active", - "metadata": { - "name": "Unsustainable water use", - "units": "Mm3/yr", - "source": [ - "Aqueduct 3.0 2019" - ], - "license": "CC BY 4.0", - "citation": [ - "Hofste, R., S. Kuzma, S. Walker, E.H. Sutanudjaja, et. al. 2019. “Aqueduct 3.0: Updated DecisionRelevant Global Water Risk Indicators.” Technical Note. Washington, DC: World Resources Institute. Available online at: https://www.wri.org/publication/aqueduct-30" - ], - "name code": "UWUSR_T", - "resolution": "", - "short name": "Unsustainable water use", - "description": "The water consumption in regions with a baseline water stress (BWS) ratio of more than 0.4, as identified by Aqueduct. BWS measures the ratio of total water withdrawals to available renewable surface and groundwater supplies.", - "indicator type": "farm-level", - "date of content": "2019", - "geographic coverage": "Global coverage.", - "frequency of updates": "" - }, - "nameCode": "UWUSR_T" - } - }, - { - "type": "indicators", - "id": "9c2124c7-5df0-40d5-962e-d35480d48cd3", - "attributes": { - "id": "9c2124c7-5df0-40d5-962e-d35480d48cd3", - "name": "Water use", - "description": "The water resources consumed to produce the material. Water consumption impact calculated using product blue water footprint estimates from the period 1996-2005. ", - "unit": { - "id": "9c0da38a-6371-4c79-879b-218fc39c4700", - "name": "milions of cubic meters per year", - "shortName": "MM3YR", - "symbol": "Mm3/yr", - "description": "Millions of cubic meters per year" - }, - "status": "inactive", - "metadata": { - "name": "Water use", - "units": "Mm3/yr", - "source": [ - "Mekonnen 2011", - "Mekonnen 2012" - ], - "license": "CC BY 4.0", - "citation": [ - "Mekonnen, M.M. & Hoekstra, A.Y. (2011) The green, blue and grey water footprint of crops and derived crop products, Hydrology and Earth System Sciences, 15(5): 1577-1600.", - "Mekonnen, M.M. & Hoekstra, A.Y. (2012) A global assessment of the water footprint of farm animal products, Ecosystems, 15(3): 401–415." - ], - "name code": "UWU_T", - "resolution": "", - "short name": "Water use", - "description": "The water resources consumed to produce the material. Water consumption impact calculated using product blue water footprint estimates from the period 1996-2005.", - "indicator type": "farm-level", - "date of content": "1996-2005", - "geographic coverage": "Global coverage.", - "frequency of updates": "" - }, - "nameCode": "UWU_T" - } - } ] } diff --git a/client/src/containers/analysis-visualization/analysis-filters/indicators/index.tsx b/client/src/containers/analysis-visualization/analysis-filters/indicators/index.tsx index 3e495b627..5807fdb95 100644 --- a/client/src/containers/analysis-visualization/analysis-filters/indicators/index.tsx +++ b/client/src/containers/analysis-visualization/analysis-filters/indicators/index.tsx @@ -106,6 +106,7 @@ const IndicatorsFilter = () => { return (