Skip to content

Commit

Permalink
merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
fpigeonjr committed Apr 3, 2024
2 parents f0c8629 + 3d9329f commit 846b0c3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
Binary file modified frontend/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react": "18.2.0",
"react-currency-format": "1.1.0",
"react-dom": "18.2.0",
"react-markdown": "8.0.7",
"react-markdown": "9.0.1",
"react-modal": "3.16.1",
"react-redux": "8.1.3",
"react-router-dom": "6.22.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ const eventMessage = (historyItem) => {
case "UPDATED":
return `${titleName} updated by ${createdByName}`;
case "DELETED":
return `${titleName} deleted by ${createdByName}`;
if (historyItem.class_name === "BudgetLineItem") {
return `${findObjectTitle(historyItem)} deleted by ${createdByName}`;
} else {
return `${titleName} deleted by ${createdByName}`;
}

default:
return `${className} ${historyItem.event_type} by ${createdByName}`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import ReactMarkdown from "react-markdown";
import PropTypes from "prop-types";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faClock } from "@fortawesome/free-regular-svg-icons";
import PropTypes from "prop-types";
import { timeAgo } from "../../../helpers/utils.js";
import styles from "./LogItem.module.css";
import ReactMarkdown from "react-markdown";

/**
* Renders a Log item
* @component
* @param {Object} props - The component props.
* @param {string} props.title - The Log item title.
* @param {string} props.message - The Log item message.
* @param {string} props.createdOn - The Log item creation date.
* @param {string} [props.variant] - The Log item variant.
* @param {boolean} [props.withSeparator] - The Log item separator.
* @param {string} [props.variant] - The Log item variant. optional
* @param {boolean} [props.withSeparator] - The Log item separator. optional
* @param {React.ReactNode} [props.children] - The Log item children. optional
* @returns {JSX.Element} - The rendered component.
*/
export const LogItem = ({ title, message, createdOn, variant, withSeparator = false, children }) => {
Expand All @@ -22,7 +24,7 @@ export const LogItem = ({ title, message, createdOn, variant, withSeparator = fa
<li className={`${isLarge ? "font-body-sm" : "font-12px"} ${styles.notificationListItem}`}>
<div className="display-flex flex-justify margin-bottom-1">
<span
className={`text-bold ${isLarge ? "font-body-sm" : undefined}`}
className={`text-bold ${isLarge ? "font-body-sm" : ""}`}
data-cy="log-item-title"
>
{title}
Expand All @@ -36,13 +38,12 @@ export const LogItem = ({ title, message, createdOn, variant, withSeparator = fa
</span>
</div>
{message && (
<p
className={`margin-0 line-height-sans-2 margin-y-1 ${isLarge ? "font-body-sm" : undefined}`}
<div
className={`margin-0 line-height-sans-0 margin-y-1 ${isLarge ? "font-body-sm" : ""}`}
data-cy="log-item-message"
>
{/*{message}*/}
<ReactMarkdown>{message}</ReactMarkdown>
</p>
<ReactMarkdown className="margin-top-neg-1 margin-bottom-neg-1">{message}</ReactMarkdown>
</div>
)}
<div
className="margin-bottom-1"
Expand All @@ -51,7 +52,7 @@ export const LogItem = ({ title, message, createdOn, variant, withSeparator = fa
{children}
</div>

{withSeparator ? <hr className="height-1px bg-brand-neutral-lighter margin-bottom-1" /> : null}
{withSeparator && <hr className="height-1px bg-brand-neutral-lighter margin-bottom-1" />}
</li>
);
};
Expand Down

0 comments on commit 846b0c3

Please sign in to comment.