Skip to content

Commit

Permalink
Merge branch 'feature/11988-front-integration-home-page' into 'modis_…
Browse files Browse the repository at this point in the history
…master'

#90 - GUI Frontend - Added filters and table to see last uploaded raw data

See merge request datalake/docker_datalake!102
  • Loading branch information
latamen.aitmeddour committed Sep 6, 2021
2 parents c949859 + ca74ed4 commit 97c863f
Show file tree
Hide file tree
Showing 9 changed files with 872 additions and 148 deletions.
5 changes: 5 additions & 0 deletions service_zone/backend/flask/neocampus/routers/mongo_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def get_metadata():
if(("limit" in request.get_json() and "offset" not in request.get_json()) or ("limit" not in request.get_json() and "offset" in request.get_json())):
return jsonify({'error': 'Limit and offset have to be sent together.'})

if("sort_field" in request.get_json() and "sort_value" in request.get_json()):
params['sort_field'] = request.get_json()['sort_field']
params['sort_value'] = request.get_json()['sort_value']

# Sort columns
if("limit" in request.get_json() and "offset" in request.get_json()):
params['limit'] = request.get_json()['limit']
params['offset'] = request.get_json()['offset']
Expand Down
4 changes: 4 additions & 0 deletions service_zone/backend/flask/neocampus/services/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def get_metadata(db_name, params):

metadata = collection.find(dict_query)

# Sort columns
if("sort_field" in params.keys() and "sort_value" in params.keys()):
metadata.sort(params['sort_field'], params['sort_value'])

if("offset" in params.keys() and "limit" in params.keys()):
metadata = metadata.skip(params['offset'])
metadata = metadata.limit(params['limit'])
Expand Down
Loading

0 comments on commit 97c863f

Please sign in to comment.