Skip to content

Commit 97652f7

Browse files
committed
Removed the self-review tab.
1 parent 654ff60 commit 97652f7

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

web-ui-external-feedback/src/components/reviews/TeamMemberReview.jsx

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ const TeamMemberReview = ({
9494
const csrf = selectCsrfToken(state);
9595
const currentUser = selectCurrentUser(state);
9696
const theme = useTheme();
97-
const [value, setValue] = useState(1);
97+
const [value, setValue] = useState(0);
9898

99-
const review = reviews && reviews[value - 1];
99+
const review = reviews && reviews[value];
100100
const recipient = selectProfile(state, review?.recipientId);
101101

102102
const handleChange = (event, newValue) => {
@@ -107,11 +107,6 @@ const TeamMemberReview = ({
107107
setValue(index);
108108
};
109109

110-
let selfReviewIcon = <HourglassEmptyIcon />;
111-
if (selfReview && selfReview.status?.toUpperCase() === 'SUBMITTED') {
112-
selfReviewIcon = <CheckCircleIcon />;
113-
}
114-
115110
return (
116111
<Root>
117112
<Box sx={{ bgcolor: 'background.paper', width: '100%' }}>
@@ -123,15 +118,6 @@ const TeamMemberReview = ({
123118
textColor="inherit"
124119
variant="fullWidth"
125120
>
126-
<Tab
127-
icon={selfReviewIcon}
128-
label={
129-
memberProfile?.firstName
130-
? memberProfile?.firstName + "'s Self-Review"
131-
: 'Self-Review'
132-
}
133-
{...a11yProps(0)}
134-
/>
135121
{reviews &&
136122
reviews.filter(r => !!r).map((review, index) => {
137123
const reviewer = review.recipientId == memberProfile?.id ?
@@ -148,7 +134,10 @@ const TeamMemberReview = ({
148134
}
149135

150136
return (
151-
<Tab icon={icon} label={label} {...a11yProps(index + 1)} />
137+
<Tab key={index}
138+
icon={icon}
139+
label={label}
140+
{...a11yProps(index)} />
152141
);
153142
})}
154143
</Tabs>
@@ -158,18 +147,6 @@ const TeamMemberReview = ({
158147
index={value}
159148
onChangeIndex={handleChangeIndex}
160149
>
161-
<TabPanel value={value} index={0} dir={theme.direction}>
162-
{selfReview?.id ? (
163-
<FeedbackSubmitForm
164-
requesteeName={
165-
memberProfile?.firstName + ' ' + memberProfile?.lastName
166-
}
167-
requestId={selfReview?.id}
168-
request={selfReview}
169-
reviewOnly={true}
170-
/>
171-
) : (<Typography variant="h4">Not Available</Typography>)}
172-
</TabPanel>
173150
{reviews &&
174151
reviews.filter(r => !!r).map((review, index) => {
175152
const reviewer = selectProfile(state, review.recipientId);
@@ -179,7 +156,10 @@ const TeamMemberReview = ({
179156
review.status?.toUpperCase() === 'SUBMITTED');
180157

181158
return (
182-
<TabPanel value={value} index={index + 1} dir={theme.direction}>
159+
<TabPanel key={index}
160+
value={value}
161+
index={index}
162+
dir={theme.direction}>
183163
<FeedbackSubmitForm
184164
requesteeName={requesteeName}
185165
requestId={review.id}

0 commit comments

Comments
 (0)