Skip to content

Commit

Permalink
cleaned up some more
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaquish committed Mar 11, 2024
1 parent 34619a6 commit 7b80423
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
8 changes: 3 additions & 5 deletions backend/ibutsu_server/widgets/importance_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 8 additions & 11 deletions frontend/src/widgets/importancecomponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -84,23 +81,23 @@ export class ImportanceComponentWidget extends React.Component {
}
{(!this.state.dataError && !this.state.isLoading) &&
<CardBody>
{this.state.data.sdatnew.map((sdat) => (
{this.state.data.table_data.map((tdat) => (
<>
<Text key={sdat.component} component="h2">{sdat.component}</Text>
<Text key={tdat.component} component="h2">{tdat.component}</Text>
<Table aria-label="tttable" variant="compact">
<Thead>
<Tr>
{["-", ...sdat.bnums].map((bnum) => (
<Th key={bnum}>{bnum}</Th>
{["-", ...tdat.bnums].map((buildnum) => (
<Th key={buildnum}>{buildnum}</Th>
))}
</Tr>
</Thead>
<Tbody>
{sdat.importances.map((importance) => (
{tdat.importances.map((importance) => (
<Tr key={importance}>
<Text component="h2">{importance}</Text>
{sdat.bnums.map((bnum) => (
<Td key={bnum}><Link to={`/results?id[in]=${sdat.data[bnum][importance]["result_list"].join(";")}`}>{sdat.data[bnum][importance]["percentage"]}</Link></Td>
{tdat.bnums.map((buildnum) => (
<Td key={buildnum}><Link to={`/results?id[in]=${tdat.data[buildnum][importance]["result_list"].join(";")}`}>{tdat.data[buildnum][importance]["percentage"]}</Link></Td>
))}
</Tr>
))}
Expand Down

0 comments on commit 7b80423

Please sign in to comment.