Skip to content

Commit

Permalink
Updated query for Analysis country selector
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Nov 26, 2020
1 parent 7cc2ab3 commit 979464b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ const CountrySelector = (props) => {
'@type': 'discodata_sql_builder',
sql: {
value:
'{"fieldsets":[{"id":"sql_metadata","title":"SQL","fields":["analysis_countries"]}],"properties":{"analysis_countries":{"title":"Analysis countries","isCollection":true,"hasPagination":true,"urlQuery":true,"sql":"SELECT DISTINCT PQPC.CountryCode as [key], LC.[CountryName] as [value], LC.[CountryName] as [text]\\nFROM [IED].[latest].[PollutantQuantityPerCapita] as PQPC\\nLEFT JOIN [IED].[latest].[LOV_Countries] as LC\\nON PQPC.[CountryCode] = LC.[CountryCode]\\nWHERE reportingYear IN (\'2018\')"}},"required":[]}',
'{"fieldsets":[{"id":"sql_metadata","title":"SQL","fields":["analysis_countries"]}],"properties":{"analysis_countries":{"title":"Analysis countries","isCollection":true,"hasPagination":true,"urlQuery":true,"sql":"SELECT distinct c.CountryCode as [key], c.countryName as [value], c.countryName as [text]\\nFROM [IED].[latest].[Tableau_Analysis1_2_table] AS a \\nINNER JOIN [IED].[latest].[Tableau_Analysis1_2_bigInstallations] AS b ON a.FacilityId = b.FacilityId\\nINNER JOIN [IED].[latest].[LOV_Countries] c on c.CountryCode = a.CountryCode\\nWHERE b.[Pollutant Name] in (\'Cadmium and compounds (as Cd)\', \'Carbon dioxide (CO2)\', \'Lead and compounds (as Pb)\', \'Mercury and compounds (as Hg)\', \'Nickel and compounds (as Ni)\', \'Nitrogen oxides (NOX)\', \'Particulate matter (PM10)\', \'Sulphur oxides (SOX)\', \'Total nitrogen\', \'Total organic carbon(as total C or COD/3) (TOC)\', \'Total phosphorus\')\\nAND a.euregReportingYear IN (\\n SELECT MAX(aa.euregReportingYear) AS maxyear FROM [IED].[latest].[Tableau_Analysis1_2_table] AS aa \\n INNER JOIN [IED].[latest].[Tableau_Analysis1_2_bigInstallations] AS bb \\n ON aa.FacilityId = bb.FacilityId\\n WHERE bb.[Pollutant Name] = b.[Pollutant Name]\\n)"}},"required":[]}',
},
}}
/>
Expand Down
16 changes: 8 additions & 8 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import {
import { installDiscodataBlocks } from 'volto-datablocks';
import { applyConfig as eprtrConfig } from './localconfig';

// const consoleError = console.error.bind(console);
// // eslint-disable-next-line
// console.error = (message, ...args) => {
// if (typeof message === 'string' && message.startsWith('[React Intl]')) {
// return;
// }
// consoleError(message, ...args);
// };
const consoleError = console.error.bind(console);
// eslint-disable-next-line
console.error = (message, ...args) => {
if (typeof message === 'string' && message.startsWith('[React Intl]')) {
return;
}
consoleError(message, ...args);
};

const addonConfig = [
installTableau,
Expand Down

0 comments on commit 979464b

Please sign in to comment.