Commit a37e2a7e authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH
Browse files

fix server & rm settings fetching from webapp

parent b3410da0
......@@ -61,7 +61,6 @@ class Home(Resource):
'experiments',
'plotters',
'plotterparameters',
'settings',
'layout',
'environments',
]
......@@ -221,12 +220,12 @@ def generate_entity_tree(entity, config):
file_tree = generate_file_tree(entity, config)
entity_tree = {}
user_and_name = [
'dataformat',
'library',
'algorithm',
'toolchain',
'plotter',
'plotterparameter',
'dataformats',
'libraries',
'algorithms',
'toolchains',
'plotters',
'plotterparameters',
]
if entity in user_and_name:
......@@ -242,7 +241,7 @@ def generate_entity_tree(entity, config):
json_obj = generate_json_entity(f, parent_names)
entity_tree[user['name']][obj['name']].append(json_obj)
elif entity == BeatEntity.DATABASE:
elif entity == 'databases':
for obj in file_tree['children']:
entity_tree[obj['name']] = list()
for f in obj['children']:
......@@ -253,7 +252,7 @@ def generate_entity_tree(entity, config):
json_obj = generate_json_entity(f, parent_names)
entity_tree[obj['name']].append(json_obj)
elif entity == BeatEntity.EXPERIMENT:
elif entity == 'experiments':
for user in file_tree['children']:
uname = user['name']
entity_tree[uname] = {}
......@@ -356,7 +355,7 @@ def gen_endpoint(entity):
try:
return generate_entity_tree(entity, self.config)
except NotADirectoryError:
return {}
return []
def get(self):
"""Returns the entity tree"""
......
......@@ -24,13 +24,12 @@ export type ActionThunkCreator = (any) => (dispatch: Dispatch<*>) => Promise<*>;
export const fetchAllObjects: ActionThunkCreator = () => async (dispatch: Dispatch<*>) => {
//console.log(`fetchAllObjects`);
const getFuncs = [...BEAT_ENTITIES, 'settings', 'environments'].map(e => genModuleApiFuncs(e).get);
const getFuncs = [...BEAT_ENTITIES, 'environments'].map(e => genModuleApiFuncs(e).get);
const jsons = await Promise.all(getFuncs.map(async (get): Promise<*> => get()));
const arrs = jsons.map((j, i, js) => i >= js.length - 2 ? j : objToArr(j));
console.log(environmentsSave(arrs[9]));
dispatch(environmentsSave(arrs[9]));
dispatch(settingsSave(arrs[8]));
//dispatch(settingsSave(arrs[8]));
dispatch(environmentsSave(arrs[8]));
dispatch(databaseSave(arrs[0]));
dispatch(librarySave(arrs[1]));
......
Supports Markdown
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