Skip to content

Commit a7dad17

Browse files
Merge pull request #3147 from OneCommunityGlobal/luis-fix-summary-bug
added managers to view generate summary button and fixed but which pr…
2 parents 7ad2ede + d481471 commit a7dad17

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/UserProfile/UserProfile.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@ function UserProfile(props) {
248248

249249
const loadSummaryIntroDetails = async (teamId, user) => {
250250
const currentManager = user;
251+
252+
if (!teamId) {
253+
setSummaryIntro(
254+
`This week’s summary was managed by ${currentManager.firstName} ${currentManager.lastName} and includes .
255+
These people did NOT provide a summary .
256+
<Insert the proofread and single-paragraph summary created by ChatGPT>`,
257+
);
258+
return;
259+
}
260+
251261
try {
252262
const res = await axios.get(ENDPOINTS.TEAM_USERS(teamId));
253263
const { data } = res;
@@ -316,9 +326,7 @@ function UserProfile(props) {
316326
newUserProfile.totalIntangibleHrs = Number(newUserProfile.totalIntangibleHrs.toFixed(2));
317327

318328
const teamId = newUserProfile?.teams[0]?._id;
319-
if (teamId) {
320329
await loadSummaryIntroDetails(teamId, response.data);
321-
}
322330

323331
const startDate = newUserProfile?.startDate.split('T')[0];
324332
// Validate team and project data. Remove incorrect data which may lead to page crash. E.g teams: [null]

src/components/Warnings/Warnings.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default function Warning({ personId, username, userRole, displayUser }) {
9898
));
9999

100100
return (
101-
(userRole === 'Administrator' || userRole === 'Owner') && (
101+
(userRole === 'Administrator' || userRole === 'Owner' || userRole === 'Manager') && (
102102
<div className="warnings-container">
103103
<div className="button__container">
104104
<Button

0 commit comments

Comments
 (0)