Skip to content

Commit

Permalink
[Fix #478] Make sure last editor column shows creator username if edi…
Browse files Browse the repository at this point in the history
…tor is not present.
  • Loading branch information
kostobog committed Aug 9, 2024
1 parent 6dd6cd9 commit a9ba4fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/table/FaultTreeTableBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const FaultTreeTableBody: FC<FaultTreeTableBodyProps> = ({ faultTrees, handleFau
{faultTrees.map((faultTree, rowIndex) => {
const routePath = ROUTES.FTA + `/${extractFragment(faultTree.iri)}`;
const statusColor = faultTree?.status !== Status.OK ? "red" : "white";

const editor = faultTree?.editor || faultTree?.creator;
return (
<TableRow key={rowIndex} className={classes.noBorder}>
<TableCell className={classes.firstColumn}>{faultTree.name}</TableCell>
Expand All @@ -47,7 +47,7 @@ const FaultTreeTableBody: FC<FaultTreeTableBodyProps> = ({ faultTrees, handleFau
<TableCell className={classes.tableCell}>{failureRate(faultTree?.requiredFailureRate)}</TableCell>
<TableCell className={classes.tableCell}>{formatDate(faultTree?.modified)}</TableCell>
<TableCell className={classes.tableCell}>{formatDate(faultTree?.created)}</TableCell>
<TableCell className={classes.tableCell}>{faultTree?.editor?.username}</TableCell>
<TableCell className={classes.tableCell}>{editor?.username}</TableCell>
<TableCell className={classes.tableCell}>
<Box className={classes.rowOptionsContainer}>
<Button
Expand Down
3 changes: 3 additions & 0 deletions src/models/faultTreeModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export interface FaultTree extends AbstractModel {
system?: System;
calculatedFailureRate?: number;
fhaBasedFailureRate?: number;
creator?: {
username?: string;
};
editor?: {
username?: string;
};
Expand Down

0 comments on commit a9ba4fc

Please sign in to comment.