From 920cd9c18fc4c41e6229a1b3a1696c46c3a14487 Mon Sep 17 00:00:00 2001 From: Dan Ko Date: Thu, 29 Aug 2024 13:28:22 -0400 Subject: [PATCH 01/10] add background color to handle transparent avatars --- src/components/avatar/Avatar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/avatar/Avatar.tsx b/src/components/avatar/Avatar.tsx index c8cfa400..0793b0c2 100644 --- a/src/components/avatar/Avatar.tsx +++ b/src/components/avatar/Avatar.tsx @@ -31,6 +31,7 @@ export default function Avatar({ } width={width} height={height} + className="bg-base-200" /> ); From f67d6f5fbe97db8c681a8c2ae785c2212025ac96 Mon Sep 17 00:00:00 2001 From: Dan Ko Date: Thu, 29 Aug 2024 13:40:08 -0400 Subject: [PATCH 02/10] add test --- src/components/avatar/Avatar.test.tsx | 23 +++++++++++++++++------ src/components/avatar/Avatar.tsx | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/components/avatar/Avatar.test.tsx b/src/components/avatar/Avatar.test.tsx index f2cb515c..c6207316 100644 --- a/src/components/avatar/Avatar.test.tsx +++ b/src/components/avatar/Avatar.test.tsx @@ -1,11 +1,11 @@ import { render, screen } from "@testing-library/react"; import Avatar from "@/components/avatar/Avatar"; +const imageUrl = + "https://gravatar.com/avatar/c8cf6521c193fc743c7fadcd8be04e983724764efa65b3c3913b6d22f086a11f?s=200&r=g&d=robohash"; + describe("Avatar Component", () => { it("renders image correctly", () => { - const imageUrl = - "https://gravatar.com/avatar/c8cf6521c193fc743c7fadcd8be04e983724764efa65b3c3913b6d22f086a11f?s=200&r=g&d=robohash"; - render(); const image = screen.getByRole("img", { name: /avatar/i }); @@ -14,9 +14,6 @@ describe("Avatar Component", () => { }); it("should have correct image url", () => { - const imageUrl = - "https://gravatar.com/avatar/c8cf6521c193fc743c7fadcd8be04e983724764efa65b3c3913b6d22f086a11f?s=200&r=g&d=robohash"; - render(); const image: HTMLImageElement = screen.getByRole("img", { @@ -25,4 +22,18 @@ describe("Avatar Component", () => { expect(image.src).toContain(encodeURIComponent(`${imageUrl}&v=1.2`)); }); + + it("handles transparent avatars", () => { + render(); + + const image: HTMLImageElement = screen.getByRole("img", { + name: /avatar/i, + }); + + const hasBgClass = Array.from(image.classList).some((className) => + /^bg-.+/.test(className), + ); + + expect(hasBgClass).toBe(true); + }); }); diff --git a/src/components/avatar/Avatar.tsx b/src/components/avatar/Avatar.tsx index 0793b0c2..9987c05e 100644 --- a/src/components/avatar/Avatar.tsx +++ b/src/components/avatar/Avatar.tsx @@ -31,7 +31,7 @@ export default function Avatar({ } width={width} height={height} - className="bg-base-200" + className={cn("bg-base-200")} /> ); From 891ad1e9c4c753688360329feb9b96b1aeea79f0 Mon Sep 17 00:00:00 2001 From: Jane Moroz Date: Wed, 18 Sep 2024 12:24:19 +0300 Subject: [PATCH 03/10] fix: fix padding issues + update widget title font size --- .../components/voyage-dashboard/DashboardWidget.tsx | 10 +++++----- .../voyage-dashboard/FeaturesStateContent.tsx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx b/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx index b9fc70f8..c5e8b01a 100644 --- a/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx +++ b/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx @@ -50,18 +50,18 @@ function DashboardWidget({ >

{headerTitle} - {isWidgetClickable ? ( -

- + {isWidgetClickable && ( +
+
- ) : null} + )}

diff --git a/src/app/(main)/dashboard/components/voyage-dashboard/FeaturesStateContent.tsx b/src/app/(main)/dashboard/components/voyage-dashboard/FeaturesStateContent.tsx index d6cb4ec0..e0050724 100644 --- a/src/app/(main)/dashboard/components/voyage-dashboard/FeaturesStateContent.tsx +++ b/src/app/(main)/dashboard/components/voyage-dashboard/FeaturesStateContent.tsx @@ -5,14 +5,14 @@ interface FeaturesStateContentProps { } function FeaturesStateContent({ contentObject }: FeaturesStateContentProps) { return ( -
-
+
+
{contentObject?.map((item) => (
-

+

{item}

From 9d040b9d933952190ad5aee3ac238f2d6e498d19 Mon Sep 17 00:00:00 2001 From: Jane Moroz Date: Wed, 18 Sep 2024 12:27:28 +0300 Subject: [PATCH 04/10] fix: lint --- .../dashboard/components/voyage-dashboard/DashboardWidget.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx b/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx index c5e8b01a..ecdbee52 100644 --- a/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx +++ b/src/app/(main)/dashboard/components/voyage-dashboard/DashboardWidget.tsx @@ -58,7 +58,7 @@ function DashboardWidget({ > {headerTitle} {isWidgetClickable && ( -
+
)} From dd6d1bf18a059f130689665ba03c6105135a5119 Mon Sep 17 00:00:00 2001 From: Jane Moroz Date: Wed, 18 Sep 2024 18:05:18 +0300 Subject: [PATCH 05/10] feat: add tooltip to avatar groups in techStack and Ideation votes --- .../[teamId]/ideation/components/VoteCard.tsx | 30 ++++++++++++---- .../tech-stack/components/TechStackCard.tsx | 36 ++++++++++++++++--- src/components/Tooltip.tsx | 10 +++++- src/components/avatar/Avatar.tsx | 8 ++++- 4 files changed, 71 insertions(+), 13 deletions(-) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx index 042aa0ff..f30072f5 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx @@ -17,6 +17,7 @@ import { import { onOpenModal } from "@/store/features/modal/modalSlice"; import AvatarGroup from "@/components/avatar/AvatarGroup"; import Avatar from "@/components/avatar/Avatar"; +import Tooltip from "@/components/Tooltip"; interface VoteCardProps { projectIdeaId: number; @@ -33,6 +34,7 @@ function VoteCard({ projectIdeaId, users, className }: VoteCardProps) { const { isOpen } = useModal(); const dispatch = useAppDispatch(); const [voteChanged, setVoteChanged] = useState(false); + const [tooltipHovered, setTooltipHovered] = useState(""); const { runAction: addIdeationVoteAction, @@ -131,12 +133,28 @@ function VoteCard({ projectIdeaId, users, className }: VoteCardProps) { }`} {users.map((user) => ( - + + { + setTooltipHovered(user.votedBy.member.id); + }} + onMouseLeave={() => { + setTooltipHovered(""); + }} + /> + ))}
diff --git a/src/components/avatar/Avatar.tsx b/src/components/avatar/Avatar.tsx index 9987c05e..4adb0b0c 100644 --- a/src/components/avatar/Avatar.tsx +++ b/src/components/avatar/Avatar.tsx @@ -7,6 +7,8 @@ interface AvatarProps { customClassName?: string; width: number; height: number; + onMouseEnter?: () => void; + onMouseLeave?: () => void; } export default function Avatar({ @@ -14,13 +16,17 @@ export default function Avatar({ customClassName, width = 24, height = 24, + onMouseEnter, + onMouseLeave, }: AvatarProps) { return (
avatar Date: Fri, 20 Sep 2024 22:46:30 +0300 Subject: [PATCH 06/10] fix: update colors --- .../[teamId]/ideation/components/VoteCard.tsx | 4 ++-- .../[teamId]/tech-stack/components/TechStackCard.tsx | 12 ++++++------ src/components/Tooltip.tsx | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx index f30072f5..5bcd57c6 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx @@ -126,7 +126,7 @@ function VoteCard({ projectIdeaId, users, className }: VoteCardProps) { return (
-
+

{users.length}

{`Vote${ users.length > 1 ? "s" : "" @@ -136,7 +136,7 @@ function VoteCard({ projectIdeaId, users, className }: VoteCardProps) {

{/**TODO Refactor this beast into smaller more module pieces. */} -
+
    {data.map((element) => { const voteIsSubmitted = element.teamTechStackItemVotes.find( @@ -241,13 +241,13 @@ export default function TechStackCard({ title, data }: TechStackCardProps) { ); return (
  • {editItemId === element.id ? (
    handleEdit(element.id))} - className="col-span-6 -my-2 h-12" + className="h-12 col-span-6 -my-2" ref={editRef} > {element.teamTechStackItemVotes.length < 2 && ( -
    +
    setOpenMenuId(element.id)} @@ -352,7 +352,7 @@ export default function TechStackCard({ title, data }: TechStackCardProps) {
    ))}
    diff --git a/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx b/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx index b6329a69..4b7e300c 100644 --- a/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx +++ b/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx @@ -120,10 +120,10 @@ export default function MeetingForm() { data.meetingLink === "" ? { description: data.description, title: data.title } : { - description: data.description, - title: data.title, - meetingLink: data.meetingLink, - }; + description: data.description, + title: data.title, + meetingLink: data.meetingLink, + }; if (editMode) { const [res, error] = await editMeetingAction({ From 4655623b09ad680e07fe907b9964b57e81f9743b Mon Sep 17 00:00:00 2001 From: JaneMoroz Date: Fri, 20 Sep 2024 23:27:42 +0300 Subject: [PATCH 09/10] fix: lint --- .../[teamId]/sprints/components/forms/MeetingForm.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx b/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx index 4b7e300c..b6329a69 100644 --- a/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx +++ b/src/app/(main)/my-voyage/[teamId]/sprints/components/forms/MeetingForm.tsx @@ -120,10 +120,10 @@ export default function MeetingForm() { data.meetingLink === "" ? { description: data.description, title: data.title } : { - description: data.description, - title: data.title, - meetingLink: data.meetingLink, - }; + description: data.description, + title: data.title, + meetingLink: data.meetingLink, + }; if (editMode) { const [res, error] = await editMeetingAction({ From 4b89a5193b46e5debbdfa692f7ca679c0cb7a4da Mon Sep 17 00:00:00 2001 From: Daniel Ko Date: Sun, 6 Oct 2024 14:55:41 -0400 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d976ad0..7c61690a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [0.1.1] - 2024-10-06 -## [1.0.0-alpha.6] - 2024-09-27 +### Added +- Added tooltips over avatars https://github.com/chingu-x/chingu-dashboard/issues/221 + +### Fixed +- Fixed text truncation and spacing issues in features widget on dashboard page https://github.com/chingu-x/chingu-dashboard/issues/256 + +## [0.1.0-alpha.6] - 2024-09-27 ### Added - Added po and sm forms for the weekly checkin for the appropriate teams https://github.com/chingu-x/chingu-dashboard/issues/216 @@ -18,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ### Fixed -## [1.0.0-alpha.5] - 2024-09-19 +## [0.1.0-alpha.5] - 2024-09-19 ### Added @@ -26,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ### Changed - Made meeting link optional https://github.com/chingu-x/chingu-dashboard/issues/237 -## [1.0.0-alpha.4] - 2024-09-10 +## [0.1.0-alpha.4] - 2024-09-10 ### Added @@ -40,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Fixed issue with meeting notes section becoming scrollable instead of expanding when saved https://github.com/chingu-x/chingu-dashboard/issues/248 -## [1.0.0-alpha.3] - 2024-09-05 +## [0.1.0-alpha.3] - 2024-09-05 ### Added - Added 404 page https://github.com/chingu-x/chingu-dashboard/issues/205 @@ -55,7 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Fixed overflow issue with features description in the list https://github.com/chingu-x/chingu-dashboard/issues/222 - Fixed an issue with selecting team members in checkboxes https://github.com/chingu-x/chingu-dashboard/issues/230 -## [1.0.0-alpha.2] - 2024-08-28 +## [0.1.0-alpha.2] - 2024-08-28 ### Added - Added version to image in avatar component @@ -64,7 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ### Fixed -## [1.0.0-alpha.1] - 2024-08-26 +## [0.1.0-alpha.1] - 2024-08-26 ### Added