Skip to content

Commit

Permalink
avniproject/avni-client#1172 | minor code refactoring in RuleFailureT…
Browse files Browse the repository at this point in the history
…elemetryList.js
  • Loading branch information
himeshr committed Nov 16, 2023
1 parent 73b027c commit b3a9961
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ const STATUS = {
ALL: 3
};

function renderIdAndType(id, type) {
return rowData => (
<Fragment>
<span>{rowData[id] || ""}</span>
<b>{rowData[type] ? " (" + rowData[type] + ")" : ""}</b>
</Fragment>
);
}

const columns = [
{
title: "Message",
Expand Down Expand Up @@ -56,22 +65,12 @@ const columns = [
{
title: "Source",
field: "source",
render: rowData => (
<Fragment>
<span>{rowData.sourceId || ""}</span>
<b>{rowData.sourceType ? " (" + rowData.sourceType + ")" : ""}</b>
</Fragment>
)
render: renderIdAndType("sourceId", "sourceType")
},
{
title: "Entity",
field: "entity",
render: rowData => (
<Fragment>
<span>{rowData.entityId || ""}</span>
<b>{rowData.entityType ? " (" + rowData.entityType + ")" : ""}</b>
</Fragment>
)
render: renderIdAndType("entityId", "entityType")
},
{
title: "App",
Expand Down

0 comments on commit b3a9961

Please sign in to comment.