imageFilenames and imageFilename, backend integration tests, frontend tests, removed username references

This commit is contained in:
jackiettran
2025-11-26 23:13:23 -05:00
parent f2d3aac029
commit 11593606aa
52 changed files with 2815 additions and 150 deletions

View File

@@ -437,9 +437,9 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
{/* Header */}
<div className="bg-primary text-white p-3 d-flex align-items-center justify-content-between flex-shrink-0">
<div className="d-flex align-items-center">
{recipient.profileImage ? (
{recipient.imageFilename ? (
<img
src={recipient.profileImage}
src={recipient.imageFilename}
alt={`${recipient.firstName} ${recipient.lastName}`}
className="rounded-circle me-2"
style={{ width: "35px", height: "35px", objectFit: "cover" }}
@@ -525,10 +525,10 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
wordBreak: "break-word",
}}
>
{message.imagePath && (
{message.imageFilename && (
<div className="mb-2">
<img
src={getMessageImageUrl(message.imagePath)}
src={getMessageImageUrl(message.imageFilename)}
alt="Shared image"
style={{
width: "100%",
@@ -539,7 +539,7 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
}}
onClick={() =>
window.open(
getMessageImageUrl(message.imagePath!),
getMessageImageUrl(message.imageFilename!),
"_blank"
)
}

View File

@@ -212,9 +212,9 @@ const CommentThread: React.FC<CommentThreadProps> = ({
<p className="card-text mb-2" style={{ whiteSpace: "pre-wrap" }}>
{comment.content}
</p>
{comment.images && comment.images.length > 0 && (
{comment.imageFilenames && comment.imageFilenames.length > 0 && (
<div className="row g-2 mb-2">
{comment.images.map((image, index) => (
{comment.imageFilenames.map((image, index) => (
<div key={index} className="col-4 col-md-3">
<img
src={getForumImageUrl(image)}

View File

@@ -47,9 +47,9 @@ const ItemCard: React.FC<ItemCardProps> = ({
return (
<Link to={`/items/${item.id}`} className="text-decoration-none">
<div className="card h-100" style={{ cursor: 'pointer' }}>
{item.images && item.images[0] ? (
{item.imageFilenames && item.imageFilenames[0] ? (
<img
src={item.images[0]}
src={item.imageFilenames[0]}
className="card-img-top"
alt={item.name}
style={{

View File

@@ -29,9 +29,9 @@ const ItemMarkerInfo: React.FC<ItemMarkerInfoProps> = ({ item, onViewDetails })
return (
<div style={{ width: 'min(280px, 90vw)', maxWidth: '280px' }}>
<div className="card border-0">
{item.images && item.images[0] ? (
{item.imageFilenames && item.imageFilenames[0] ? (
<img
src={item.images[0]}
src={item.imageFilenames[0]}
className="card-img-top"
alt={item.name}
style={{

View File

@@ -85,9 +85,9 @@ const ItemReviews: React.FC<ItemReviewsProps> = ({ itemId }) => {
onClick={() => rental.renter && navigate(`/users/${rental.renterId}`)}
style={{ cursor: "pointer" }}
>
{rental.renter?.profileImage ? (
{rental.renter?.imageFilename ? (
<img
src={rental.renter.profileImage}
src={rental.renter.imageFilename}
alt={`${rental.renter.firstName} ${rental.renter.lastName}`}
className="rounded-circle"
style={{

View File

@@ -102,9 +102,9 @@ const ReviewItemModal: React.FC<ReviewItemModalProps> = ({
{rental.owner && rental.item && (
<div className="mb-4 text-center">
<div className="d-flex justify-content-center mb-3">
{rental.owner.profileImage ? (
{rental.owner.imageFilename ? (
<img
src={rental.owner.profileImage}
src={rental.owner.imageFilename}
alt={`${rental.owner.firstName} ${rental.owner.lastName}`}
className="rounded-circle"
style={{

View File

@@ -102,9 +102,9 @@ const ReviewRenterModal: React.FC<ReviewRenterModalProps> = ({
{rental.renter && rental.item && (
<div className="mb-4 text-center">
<div className="d-flex justify-content-center mb-3">
{rental.renter.profileImage ? (
{rental.renter.imageFilename ? (
<img
src={rental.renter.profileImage}
src={rental.renter.imageFilename}
alt={`${rental.renter.firstName} ${rental.renter.lastName}`}
className="rounded-circle"
style={{