Skip to content

Commit

Permalink
[Fixes #5203] avoid count label in countries, add missing flags
Browse files Browse the repository at this point in the history
  • Loading branch information
gioscarda committed Nov 8, 2019
1 parent 5d72cb6 commit c348549
Show file tree
Hide file tree
Showing 112 changed files with 29,931 additions and 86 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ geonode/static/.components/
geonode/static_root/
geonode/static/node_modules/
node_modules/
# Exception for monitoring frontend
!geonode/monitoring/static/monitoring/node_modules/
# Listing all of them instead of putting geonode/static/lib out of version control.
geonode/local_settings.py

Expand Down
27 changes: 16 additions & 11 deletions geonode/monitoring/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,17 @@ def _key(v):
values = requests.distinct(
column_name).values_list(column_name, flat=True)
for v in values:
value = v
if is_user_metric:
value = v[0]
rqs = requests.filter(**{column_name: value})
row = rqs.aggregate(
value=models.Count(column_name),
samples=models.Count(column_name)
)
row['label'] = v
q.append(row)
if v is not None:
value = v
if is_user_metric:
value = v[0]
rqs = requests.filter(**{column_name: value})
row = rqs.aggregate(
value=models.Count(column_name),
samples=models.Count(column_name)
)
row['label'] = v
q.append(row)
q.sort(key=_key)
q.reverse()

Expand Down Expand Up @@ -947,7 +948,11 @@ def postproc(row):
except Resolver404:
t['href'] = ""
row[tcol] = t
return row
# Avoid Count label for countries
# (it has been already fixed in "set_metric_values"
# but the following line avoid showing the label in case of existing dirty db)
if not (metric_name == "request.country" and row["label"] == "count"):
return row

return [postproc(row) for row in raw_sql(q, params)]

Expand Down
116 changes: 58 additions & 58 deletions geonode/monitoring/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,66 @@
"author": "",
"license": "GPL-3.0",
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"css-loader": "^3.2.0",
"eslint": "^6.1.0",
"eslint-loader": "^2.2.1",
"eslint-plugin-react": "^7.14.3",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^4.2.0",
"fs-extra": "^8.1.0",
"node-sass": "^4.12.0",
"redux-devtools-extension": "^2.13.8",
"sass-loader": "^7.1.0",
"style-loader": "^1.0.0",
"to-string-loader": "^1.1.5",
"url-loader": "^2.1.0",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2",
"webpack-parallel-uglify-plugin": "^1.1.1"
"@babel/core": "7.5.5",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-proposal-decorators": "7.4.4",
"@babel/preset-env": "7.5.5",
"@babel/preset-react": "7.0.0",
"babel-eslint": "10.0.2",
"babel-loader": "8.0.6",
"babel-plugin-transform-decorators-legacy": "1.3.5",
"css-loader": "3.2.0",
"eslint": "6.1.0",
"eslint-loader": "2.2.1",
"eslint-plugin-react": "7.14.3",
"extract-text-webpack-plugin": "4.0.0-beta.0",
"file-loader": "4.2.0",
"fs-extra": "8.1.0",
"node-sass": "4.12.0",
"redux-devtools-extension": "2.13.8",
"sass-loader": "7.1.0",
"style-loader": "1.0.0",
"to-string-loader": "1.1.5",
"url-loader": "2.1.0",
"webpack": "4.39.1",
"webpack-cli": "3.3.6",
"webpack-dev-server": "3.7.2",
"webpack-parallel-uglify-plugin": "1.1.1"
},
"dependencies": {
"@material-ui/core": "^4.3.1",
"@material-ui/icons": "^4.2.1",
"@material-ui/lab": "^4.0.0-alpha.22",
"axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"chroma-js": "^2.0.4",
"clsx": "^1.0.4",
"d3": "^5.9.7",
"datamaps": "^0.5.9",
"flag-icon-css": "^3.3.0",
"i18n-iso-countries": "^4.3.1",
"isomorphic-fetch": "^2.2.1",
"material-ui": "^0.20.2",
"moment": "^2.24.0",
"numeral": "^2.0.6",
"radium": "^0.25.2",
"react": "^16.9.0",
"react-calendar-heatmap": "^1.8.1",
"react-dom": "^16.9.0",
"react-hot-loader": "^4.12.10",
"react-intl": "^3.1.13",
"react-redux": "^7.1.0",
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1",
"react-select": "^3.0.4",
"react-simple-maps": "^0.12.1",
"react-tap-event-plugin": "^3.0.3",
"react-tooltip": "^3.10.0",
"@material-ui/core": "4.3.1",
"@material-ui/icons": "4.2.1",
"@material-ui/lab": "4.0.0-alpha.22",
"axios": "0.19.0",
"babel-polyfill": "6.26.0",
"chroma-js": "2.0.4",
"clsx": "1.0.4",
"d3": "5.9.7",
"datamaps": "0.5.9",
"flag-icon-css": "3.3.0",
"i18n-iso-countries": "4.3.1",
"isomorphic-fetch": "2.2.1",
"material-ui": "0.20.2",
"moment": "2.24.0",
"numeral": "2.0.6",
"radium": "0.25.2",
"react": "16.9.0",
"react-calendar-heatmap": "1.8.1",
"react-dom": "16.9.0",
"react-hot-loader": "4.12.10",
"react-intl": "3.1.13",
"react-redux": "7.1.0",
"react-router": "5.0.1",
"react-router-dom": "5.0.1",
"react-select": "3.0.4",
"react-simple-maps": "0.12.1",
"react-tap-event-plugin": "3.0.3",
"react-tooltip": "3.10.0",
"reactjs-calendar-heatmap": "0.0.10",
"recharts": "^1.6.2",
"redux": "^4.0.4",
"redux-actions": "^2.6.5",
"redux-thunk": "^2.3.0",
"ua-parser-js": "^0.7.20"
"recharts": "1.6.2",
"redux": "4.0.4",
"redux-actions": "2.6.5",
"redux-thunk": "2.3.0",
"ua-parser-js": "0.7.20"
}
}
34 changes: 17 additions & 17 deletions geonode/monitoring/static/monitoring/bundle.js

Large diffs are not rendered by default.

0 comments on commit c348549

Please sign in to comment.