Unverified Commit 246e5f79 authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

Correctly set column editable state (#524)

parent 1a2e125c
...@@ -96,14 +96,15 @@ def marshall_table_full(table_dict: Dict) -> Dict: ...@@ -96,14 +96,15 @@ def marshall_table_full(table_dict: Dict) -> Dict:
for reader_object in readers: for reader_object in readers:
reader_object['user'] = _map_user_object_to_schema(reader_object['user']) reader_object['user'] = _map_user_object_to_schema(reader_object['user'])
# If order is provided, we sort the column based on the pre-defined order columns = results['columns']
if app.config['COLUMN_STAT_ORDER']: for col in columns:
columns = results['columns'] # Set editable state
for col in columns: col['is_editable'] = is_editable
# If order is provided, we sort the column based on the pre-defined order
if app.config['COLUMN_STAT_ORDER']:
# the stat_type isn't defined in COLUMN_STAT_ORDER, we just use the max index for sorting # the stat_type isn't defined in COLUMN_STAT_ORDER, we just use the max index for sorting
col['stats'].sort(key=lambda x: app.config['COLUMN_STAT_ORDER']. col['stats'].sort(key=lambda x: app.config['COLUMN_STAT_ORDER'].
get(x['stat_type'], len(app.config['COLUMN_STAT_ORDER']))) get(x['stat_type'], len(app.config['COLUMN_STAT_ORDER'])))
col['is_editable'] = is_editable
# TODO: Add the 'key' or 'id' to the base TableSchema # TODO: Add the 'key' or 'id' to the base TableSchema
results['key'] = f'{table.database}://{table.cluster}.{table.schema}/{table.name}' results['key'] = f'{table.database}://{table.cluster}.{table.schema}/{table.name}'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment