Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zhifan fix badge doesn't display on summary #3090

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/components/WeeklySummariesReport/FormattedReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function FormattedReport({
allRoleInfo={allRoleInfo}
canEditTeamCode={canEditTeamCode}
badges={badges}
loadBzadges={loadBadges}
loadBadges={loadBadges}
canSeeBioHighlight={canSeeBioHighlight}
darkMode={darkMode}
handleTeamCodeChange={handleTeamCodeChange}
Expand Down Expand Up @@ -208,7 +208,6 @@ function ReportDetails({
handleTeamCodeChange,
auth,
}) {
const [filteredBadges, setFilteredBadges] = useState([]);
const ref = useRef(null);
const cantEditJaeRelatedRecord = cantUpdateDevAdminDetails(summary.email, loggedInUserEmail);

Expand All @@ -219,10 +218,6 @@ function ReportDetails({
summary.daysInTeam > 60 &&
summary.bioPosted !== 'posted';

useEffect(() => {
setFilteredBadges(badges.filter(badge => badge.showReport === true));
}, []);

return (
<li className={`list-group-item px-0 ${darkMode ? 'bg-yinmn-blue' : ''}`} ref={ref}>
<ListGroup className="px-0" flush>
Expand Down Expand Up @@ -273,7 +268,7 @@ function ReportDetails({
</Col>
<Col xs="6">
{loadBadges && summary.badgeCollection?.length > 0 && (
<WeeklyBadge summary={summary} weekIndex={weekIndex} badges={filteredBadges} />
<WeeklyBadge summary={summary} weekIndex={weekIndex} badges={badges} />
)}
</Col>
</Row>
Expand Down