Skip to content

Commit 861fc62

Browse files
Merge pull request #319 from Trendyol/summary-add
feat: jira summary add
2 parents 01a9df2 + a4196cc commit 861fc62

File tree

14 files changed

+149
-19
lines changed

14 files changed

+149
-19
lines changed

gurubu-client/src/app/components/room/grooming-board/grooming-board-live-chart.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import { calculateVotesOptimized } from "@/shared/helpers/calculateVotesCount";
66
import { useGroomingRoom } from "@/contexts/GroomingRoomContext";
77
import { GroomingMode } from "@/shared/enums";
88
import { useTheme } from "@/contexts/ThemeContext";
9+
import classNames from "classnames";
910

1011
const GroomingBoardLiveChart = () => {
1112
const chartRef = useRef<ReactECharts>(null);
12-
const { groomingInfo } = useGroomingRoom();
13+
const { groomingInfo, jiraSidebarExpanded } = useGroomingRoom();
1314
const { currentTheme } = useTheme();
1415

1516
const calculatedVotes = calculateVotesOptimized(
@@ -94,7 +95,7 @@ const GroomingBoardLiveChart = () => {
9495
}
9596

9697
return (
97-
<div className="grooming-board-live-chart">
98+
<div className={classNames("grooming-board-live-chart", {"jira-sidebar-expanded": jiraSidebarExpanded})}>
9899
<ReactECharts
99100
ref={chartRef}
100101
option={getOption()}

gurubu-client/src/app/components/room/grooming-board/grooming-board.tsx

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import VotingStick from "./voting-stick";
33
import MetricAverages from "./metric-averages";
44
import GroomingBoardErrorPopup from "./grooming-board-error-popup";
55
import GroomingBoardResult from "./grooming-board-result";
6+
import IssueSummary from "./issue-summary";
67
import GroomingBoardLogs from "./grooming-board-logs";
78
import GroomingBoardActions from "./grooming-board-actions";
89
import Loading from "../loading";
@@ -48,6 +49,8 @@ const GroomingBoard = ({
4849
setShowErrorPopup,
4950
editVoteClicked,
5051
setEditVoteClicked,
52+
jiraSidebarExpanded,
53+
setJiraSidebarExpanded,
5154
} = useGroomingRoom();
5255

5356
const { showLoader } = useLoader();
@@ -61,6 +64,10 @@ const GroomingBoard = ({
6164
const isScoreGrooming = groomingInfo.mode === GroomingMode.ScoreGrooming;
6265
const isPlanningPoker = groomingInfo.mode === GroomingMode.PlanningPoker;
6366

67+
const selectedIssueIndex = groomingInfo.issues?.findIndex(
68+
(issue) => issue.selected
69+
);
70+
6471
useEffect(() => {
6572
const handleInitialize = (data: GroomingInfo) => {
6673
if (data?.participants[lobby.userID]) {
@@ -147,14 +154,17 @@ const GroomingBoard = ({
147154
}
148155

149156
return (
150-
<div className="grooming-board">
157+
<div className={classNames("grooming-board", {jiraSidebarExpanded: jiraSidebarExpanded})}>
151158
{showLoader && <Loading />}
152159
<section
153160
className={classNames("grooming-board__playground", {
154161
"story-point-mode": isPlanningPoker,
155162
})}
156163
>
157164
{!editVoteClicked && isScoreGrooming && <GroomingBoardResult />}
165+
{isPlanningPoker && (
166+
<IssueSummary issueSummary={groomingInfo.issues?.[selectedIssueIndex]?.summary} />
167+
)}
158168
{showVotingStick && isScoreGrooming && (
159169
<div className="grooming-board__voting-sticks">
160170
{groomingInfo.metrics?.map((metric) => (
@@ -178,7 +188,13 @@ const GroomingBoard = ({
178188
))}
179189
</div>
180190
)}
181-
<GroomingBoardLiveChart />
191+
{!jiraSidebarExpanded && <GroomingBoardLiveChart />}
192+
{jiraSidebarExpanded && (
193+
<div className="grooming-board__logs-chart">
194+
<GroomingBoardLogs roomId={roomId} />
195+
<GroomingBoardLiveChart />
196+
</div>
197+
)}
182198
{!editVoteClicked && <MetricAverages />}
183199
{groomingInfo.isResultShown && isScoreGrooming && (
184200
<div className="grooming-board__toggle-button-wrapper">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { useGroomingRoom } from "@/contexts/GroomingRoomContext";
2+
3+
interface IssueSummaryProps {
4+
issueSummary?: string;
5+
}
6+
7+
const IssueSummary = ({ issueSummary }: IssueSummaryProps) => {
8+
const { jiraSidebarExpanded, setJiraSidebarExpanded } = useGroomingRoom();
9+
10+
if (!issueSummary) {
11+
return null;
12+
}
13+
14+
return (
15+
<div className="grooming-board__issue-summary" onClick={() => setJiraSidebarExpanded(!jiraSidebarExpanded)}>
16+
<div className="grooming-board__issue-summary-header">
17+
<h3 className="grooming-board__issue-summary-title">Current Issue</h3>
18+
<button
19+
className="grooming-board__show-details-button"
20+
>
21+
{jiraSidebarExpanded ? 'Hide Details' : 'Show Details'}
22+
</button>
23+
</div>
24+
<p className="grooming-board__issue-summary-text">{issueSummary}</p>
25+
</div>
26+
);
27+
};
28+
29+
export default IssueSummary;

gurubu-client/src/app/components/room/grooming-footer/grooming-footer.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
"use client";
12
import React from "react";
23
import { IconBrandGithub } from "@tabler/icons-react";
4+
import { useGroomingRoom } from "@/contexts/GroomingRoomContext";
35
import Feedback from "./feedback";
6+
import classNames from "classnames";
47

58
const GroomingFooter = () => {
69
const currentDate = new Date().getFullYear();
10+
const { jiraSidebarExpanded } = useGroomingRoom();
11+
712
return (
8-
<footer className="grooming-footer">
13+
<footer className={classNames("grooming-footer", {"jira-sidebar-expanded": jiraSidebarExpanded})}>
914
<div className="grooming-footer__content">
1015
<div className="grooming-footer__content-copyright">
1116
© 2023 - {currentDate} GuruBu

gurubu-client/src/app/components/room/grooming-navbar/grooming-navbar.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Modal } from "@/components/common/modal";
1010
import { ImportJiraIssuesForm } from "@/components/room/grooming-navbar/import-jira-issues";
1111
import { GroomingMode } from "@/shared/enums";
1212
import { AnnouncementTooltip } from "./announcement-tooltip";
13+
import classNames from "classnames";
1314

1415
interface Props {
1516
showNickNameForm: boolean;
@@ -31,7 +32,7 @@ const GroomingNavbar = ({ showNickNameForm, roomId }: Props) => {
3132
setModalOpen(false);
3233
};
3334

34-
const { groomingInfo, roomStatus, userInfo } = useGroomingRoom();
35+
const { groomingInfo, roomStatus, userInfo, jiraSidebarExpanded } = useGroomingRoom();
3536
const [isGroomingLinkCopied, setIsGroomingLinkCopied] = useState(false);
3637

3738
if (roomStatus !== ROOM_STATUS.FOUND || showNickNameForm) {
@@ -63,7 +64,7 @@ const GroomingNavbar = ({ showNickNameForm, roomId }: Props) => {
6364

6465
return (
6566
<nav className="grooming-navbar">
66-
<div className="grooming-navbar__content">
67+
<div className={classNames("grooming-navbar__content", { "jira-sidebar-expanded": jiraSidebarExpanded })}>
6768
<Logo />
6869
<div className="grooming-navbar__content-right">
6970
<div className="grooming-navbar__content-actions">

gurubu-client/src/app/components/room/jira-sidebar/index.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@ import React, { useEffect, useState } from "react";
22
import Sidebar from "@/components/common/sidebar";
33
import classNames from "classnames";
44
import GroomingBoardJiraTable from "../grooming-board/grooming-board-jira-table";
5-
import GroomingBoardResultV2 from "../grooming-board/grooming-board-result-v2";
65
import { useGroomingRoom } from "@/contexts/GroomingRoomContext";
76
import { IconPlayerTrackNext, IconPlayerTrackPrev } from "@tabler/icons-react";
8-
import { GroomingMode } from "@/shared/enums";
97

108
interface Props {
119
roomId: string;
1210
}
1311

1412
const JiraSidebar = ({ roomId }: Props) => {
15-
const [jiraSidebarExpanded, setJiraSidebarExpanded] = useState(false);
16-
const { groomingInfo, userInfo } = useGroomingRoom();
13+
const { groomingInfo, jiraSidebarExpanded, setJiraSidebarExpanded } = useGroomingRoom();
1714

1815
const isJiraSidebarExist =
1916
groomingInfo.issues && groomingInfo.issues.length > 0;
2017

21-
const voteText =
22-
'You can click "Set Vote" if you want to set this average estimation:';
23-
2418
const onClose = () => {
2519
setJiraSidebarExpanded(false);
2620
};

gurubu-client/src/app/contexts/GroomingRoomContext.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface GroomingContextValues {
2020
setEditVoteClicked: Function;
2121
currentJiraIssueIndex: number;
2222
setCurrentJiraIssueIndex: (value: number) => void;
23+
jiraSidebarExpanded: boolean;
24+
setJiraSidebarExpanded: (value: boolean) => void;
2325
}
2426

2527
const GroomingRoomContext = createContext({} as GroomingContextValues);
@@ -37,6 +39,7 @@ export function GroomingRoomProvider({ children, roomId }: GroomingRoomProviderP
3739
const [showErrorPopup, setShowErrorPopup] = useState(false);
3840
const [editVoteClicked, setEditVoteClicked] = useState(false);
3941
const [currentJiraIssueIndex, setCurrentJiraIssueIndex] = useState(0);
42+
const [jiraSidebarExpanded, setJiraSidebarExpanded] = useState(false);
4043

4144
useEffect(() => {
4245
const nickname = localStorage.getItem("nickname");
@@ -69,7 +72,9 @@ export function GroomingRoomProvider({ children, roomId }: GroomingRoomProviderP
6972
editVoteClicked,
7073
setEditVoteClicked,
7174
currentJiraIssueIndex,
72-
setCurrentJiraIssueIndex
75+
setCurrentJiraIssueIndex,
76+
jiraSidebarExpanded,
77+
setJiraSidebarExpanded
7378
}),
7479
[
7580
roomStatus,
@@ -87,7 +92,9 @@ export function GroomingRoomProvider({ children, roomId }: GroomingRoomProviderP
8792
editVoteClicked,
8893
setEditVoteClicked,
8994
currentJiraIssueIndex,
90-
setCurrentJiraIssueIndex
95+
setCurrentJiraIssueIndex,
96+
jiraSidebarExpanded,
97+
setJiraSidebarExpanded
9198
]
9299
);
93100
return <GroomingRoomContext.Provider value={values}>{children}</GroomingRoomContext.Provider>;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.grooming-board-live-chart {
22
margin-top: 24px;
3-
padding-top: 24px;
4-
border-top: 1px solid #eaecf0;
3+
&.jira-sidebar-expanded{
4+
width: 300px;
5+
}
56
}

gurubu-client/src/app/styles/room/grooming-board/grooming-board.scss

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
padding: 12px;
1111
flex-direction: column;
1212
}
13+
&.jiraSidebarExpanded{
14+
padding-inline: 0;
15+
margin-inline: 16px;
16+
}
1317
&__playground {
1418
width: 60%;
1519
display: flex;
@@ -22,6 +26,12 @@
2226
}
2327
}
2428
}
29+
&__logs-chart{
30+
display: flex;
31+
gap: 16px;
32+
overflow-y: auto;
33+
overflow-anchor: none;
34+
}
2535
&__toggle-button-wrapper {
2636
width: 100%;
2737
height: 50px;
@@ -134,6 +144,7 @@
134144
border: 1px solid $gray-20;
135145
padding: 0 12px 12px 12px;
136146
max-height: max-content;
147+
width: 300px;
137148
}
138149
&__metrics {
139150
display: flex;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.grooming-board {
2+
&__issue-summary {
3+
background-color: #f9f5ff;
4+
border-radius: $radius-large;
5+
padding: 16px 24px;
6+
margin-bottom: 24px;
7+
box-shadow: $shadow-sm;
8+
cursor: pointer;
9+
}
10+
11+
&__issue-summary-header {
12+
display: flex;
13+
justify-content: space-between;
14+
align-items: center;
15+
margin-bottom: 8px;
16+
}
17+
18+
&__show-details-button {
19+
background-color: $primary-700;
20+
color: #ffffff;
21+
border: none;
22+
padding: 8px 16px;
23+
border-radius: $radius-medium;
24+
font-size: $font-size-paragraph-3;
25+
font-weight: $medium;
26+
cursor: pointer;
27+
transition: background-color 0.2s ease;
28+
29+
&:hover {
30+
background-color: $primary-600;
31+
}
32+
}
33+
34+
&__issue-summary-title {
35+
color: $gray-600;
36+
font-size: $font-size-paragraph-3;
37+
font-weight: $medium;
38+
}
39+
40+
&__issue-summary-text {
41+
color: $gray-900;
42+
font-size: $font-size-paragraph-2;
43+
line-height: $line-height-paragraph-2;
44+
font-weight: $semibold;
45+
white-space: nowrap;
46+
overflow: hidden;
47+
text-overflow: ellipsis;
48+
max-width: 100%;
49+
}
50+
}

gurubu-client/src/app/styles/room/grooming-board/voting-stick-v2.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
&__vote-cards {
1313
display: flex;
1414
align-items: center;
15-
justify-content: space-around;
1615
border-radius: $radius-large;
16+
gap: 8px;
1717
width: 100%;
1818
@media (max-width: 850px) {
1919
flex-wrap: wrap;

gurubu-client/src/app/styles/room/grooming-footer/grooming-footer.scss

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
justify-content: center;
77
border-top: 1px solid #eaecf0;
88
position: relative;
9+
background-color: #ffffff;
10+
margin-top: 10px;
11+
&.jira-sidebar-expanded{
12+
margin-inline: 0;
13+
justify-content: start;
14+
.grooming-footer__content{
15+
padding-inline: 0;
16+
margin-left: 16px;
17+
}
18+
}
919
&__content {
1020
padding: 12px 48px 12px 48px;
1121
@media (max-width: 850px) {

gurubu-client/src/app/styles/room/grooming-navbar/grooming-navbar.scss

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
width: 80%;
1010
margin: 0 auto;
1111
padding: $space-xlarge $space-xxxlarge;
12+
&.jira-sidebar-expanded{
13+
margin-inline: 16px;
14+
padding-inline: 0;
15+
}
1216
@media (max-width: 850px) {
1317
padding: $space-xlarge 12px;
1418
margin: 0 12px;

gurubu-client/src/app/styles/room/style.scss

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@import "./grooming-board/voting-stick-v2.scss";
1717
@import "./grooming-board/nickname-form.scss";
1818
@import "./grooming-board/grooming-board.scss";
19+
@import "./grooming-board/issue-summary.scss";
1920
@import "./grooming-board/connecting-info.scss";
2021
@import "./grooming-board/metric-averages.scss";
2122
@import "./grooming-board/grooming-board-participants.scss";

0 commit comments

Comments
 (0)