From 7b804230d177226b073b1bf5d7fa8dc83b4d212d Mon Sep 17 00:00:00 2001 From: jjaquish Date: Mon, 11 Mar 2024 17:27:17 -0400 Subject: [PATCH] cleaned up some more --- .../widgets/importance_component.py | 8 +++----- frontend/src/widgets/importancecomponent.js | 19 ++++++++----------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/backend/ibutsu_server/widgets/importance_component.py b/backend/ibutsu_server/widgets/importance_component.py index 78cba8df..5f7b04e1 100644 --- a/backend/ibutsu_server/widgets/importance_component.py +++ b/backend/ibutsu_server/widgets/importance_component.py @@ -161,15 +161,13 @@ def get_importance_component(env="prod", # Need this broken down more for the table sdatret = [] + table_data = [] for key in sdatdict.keys(): - sdatret.append({"component": key, + table_data.append({"component": key, "bnums": sorted(list(bnums)), "importances": importances, "data": sdatdict[key]}) # return data, for sanity - data = {"testa": group_field, - "testb": components, - "testc": project, - "sdatnew": sdatret} + data = {"table_data": table_data} return data diff --git a/frontend/src/widgets/importancecomponent.js b/frontend/src/widgets/importancecomponent.js index 716057b5..14c003ef 100644 --- a/frontend/src/widgets/importancecomponent.js +++ b/frontend/src/widgets/importancecomponent.js @@ -36,10 +36,7 @@ export class ImportanceComponentWidget extends React.Component { this.params = props.params || {}; this.state = { data: { - testa: "", - testb: "", - testc: "", - sdatnew: [] + table_data: [] }, isLoading: true, }; @@ -84,23 +81,23 @@ export class ImportanceComponentWidget extends React.Component { } {(!this.state.dataError && !this.state.isLoading) && - {this.state.data.sdatnew.map((sdat) => ( + {this.state.data.table_data.map((tdat) => ( <> - {sdat.component} + {tdat.component} - {["-", ...sdat.bnums].map((bnum) => ( - + {["-", ...tdat.bnums].map((buildnum) => ( + ))} - {sdat.importances.map((importance) => ( + {tdat.importances.map((importance) => ( {importance} - {sdat.bnums.map((bnum) => ( - + {tdat.bnums.map((buildnum) => ( + ))} ))}
{bnum}{buildnum}
{sdat.data[bnum][importance]["percentage"]}{tdat.data[buildnum][importance]["percentage"]}