Skip to content

Commit f4888f3

Browse files
committed
Merge branch 'develop' into feature-2645/feedback-request-add-ability-to-request-feedback-from-external-source
2 parents 076f81a + 16e86dc commit f4888f3

File tree

18 files changed

+124
-258
lines changed

18 files changed

+124
-258
lines changed

docs/Gemfile.lock

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ GEM
251251
rb-fsevent (0.11.2)
252252
rb-inotify (0.10.1)
253253
ffi (~> 1.0)
254-
rexml (3.3.6)
255-
strscan
254+
rexml (3.3.9)
256255
rouge (3.30.0)
257256
rubyzip (2.3.2)
258257
safe_yaml (1.0.5)
@@ -266,7 +265,6 @@ GEM
266265
faraday (>= 0.17.3, < 3)
267266
simpleidn (0.2.1)
268267
unf (~> 0.1.4)
269-
strscan (3.1.0)
270268
terminal-table (1.8.0)
271269
unicode-display_width (~> 1.1, >= 1.1.1)
272270
typhoeus (1.4.1)

server/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
33
plugins {
44
id 'maven-publish'
55
id("com.gradleup.shadow") version "8.3.2"
6-
id("io.micronaut.application") version "4.4.2"
6+
id("io.micronaut.application") version "4.4.3"
77
id "jacoco"
88
}
99

server/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
micronautVersion=4.6.2
1+
micronautVersion=4.6.3
22
seleniumVersion=4.24.0

server/src/main/java/com/objectcomputing/checkins/services/volunteering/VolunteeringOrganization.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class VolunteeringOrganization {
4444
private String description;
4545

4646
@Column(name = "website")
47-
@NotBlank
4847
@Schema(description = "website for the volunteering organization")
4948
private String website;
5049

@@ -59,4 +58,4 @@ public VolunteeringOrganization(String name, String description, String website)
5958
public VolunteeringOrganization(String name, String description, String website, boolean active) {
6059
this(null, name, description, website, active);
6160
}
62-
}
61+
}

server/src/main/java/com/objectcomputing/checkins/services/volunteering/VolunteeringOrganizationDTO.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ public class VolunteeringOrganizationDTO {
2121
@Schema(description = "description of the volunteering organization")
2222
private String description;
2323

24-
@NotBlank
2524
@Schema(description = "website for the volunteering organization")
2625
private String website;
2726

2827
@Schema(description = "whether the Volunteering Organization is active")
2928
private Boolean active;
3029

31-
public VolunteeringOrganizationDTO(@NotBlank String name, @NotBlank String description, @NotBlank String website) {
30+
public VolunteeringOrganizationDTO(@NotBlank String name, @NotBlank String description, String website) {
3231
this(name, description, website, true);
3332
}
3433
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE volunteering_organization ALTER COLUMN website DROP NOT NULL

server/src/test/java/com/objectcomputing/checkins/services/volunteering/VolunteeringOrganizationControllerTest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,4 @@ void testCreateOrganizationWithoutDescription() {
148148
String body = e.getResponse().getBody(String.class).get();
149149
assertTrue(body.contains("organization.description: must not be blank"), body + " should contain 'organization.description: must not be blank'");
150150
}
151-
152-
@Test
153-
void testCreateOrganizationWithoutWebsite() {
154-
MemberProfile memberProfile = createADefaultMemberProfile();
155-
String adminAuth = auth(memberProfile.getWorkEmail(), ADMIN_ROLE);
156-
VolunteeringOrganizationDTO org = new VolunteeringOrganizationDTO("name", "description", null);
157-
158-
HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> organizationClient.createOrganization(adminAuth, org));
159-
assertEquals(HttpStatus.BAD_REQUEST, e.getStatus());
160-
String body = e.getResponse().getBody(String.class).get();
161-
assertTrue(body.contains("organization.website: must not be blank"), body + " should contain 'organization.website: must not be blank'");
162-
}
163151
}

web-ui/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
"react-swipeable-views": "^0.14.0",
4747
"recharts": "^2.12.4",
4848
"reselect": "^4.0.0",
49-
"styled-components": "^6.1.8",
50-
"universal-cookie": "^4.0.4"
49+
"styled-components": "^6.1.8"
5150
},
5251
"scripts": {
5352
"build-ladle": "ladle build",

web-ui/src/components/guild-results/GuildResults.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ const GuildResults = () => {
113113
</div>
114114
</div>
115115
<div className="guilds">
116-
{guilds?.length
117-
? guilds?.map((guild, index) =>
116+
{guilds
117+
? guilds.map((guild, index) =>
118118
guild.name.toLowerCase().includes(searchText.toLowerCase()) ? (
119119
<GuildSummaryCard
120120
key={`guild-summary-${guild.id}`}

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

Lines changed: 15 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ import {
2020
Typography
2121
} from '@mui/material';
2222
import FeedbackSubmitForm from '../feedback_submit_form/FeedbackSubmitForm';
23-
import SelectUserModal from './SelectUserModal';
24-
import { cancelFeedbackRequest, updateFeedbackRequest } from '../../api/feedback';
25-
import { UPDATE_TOAST } from '../../context/actions';
2623

2724
const propTypes = {
2825
selfReview: PropTypes.any,
@@ -97,27 +94,7 @@ const TeamMemberReview = ({
9794
const csrf = selectCsrfToken(state);
9895
const currentUser = selectCurrentUser(state);
9996
const theme = useTheme();
100-
const [value, setValue] = useState(0);
101-
const [init, setInit] = useState(true);
102-
const [reassignOpen, setReassignOpen] = useState(false);
103-
const [cancelOpen, setCancelOpen] = useState(false);
104-
105-
const handleOpenReassign = useCallback(
106-
() => setReassignOpen(true),
107-
[setReassignOpen]
108-
);
109-
const handleCloseReassign = useCallback(
110-
() => setReassignOpen(false),
111-
[setReassignOpen]
112-
);
113-
const handleOpenCancel = useCallback(
114-
() => setCancelOpen(true),
115-
[setCancelOpen]
116-
);
117-
const handleCloseCancel = useCallback(
118-
() => setCancelOpen(false),
119-
[setCancelOpen]
120-
);
97+
const [value, setValue] = useState(1);
12198

12299
const review = reviews && reviews[value - 1];
123100
const recipient = selectProfile(state, review?.recipientId);
@@ -130,91 +107,9 @@ const TeamMemberReview = ({
130107
setValue(index);
131108
};
132109

133-
const handleCancelClick = useCallback(() => {
134-
const cancelRequest = async () => {
135-
const res = await cancelFeedbackRequest(review, csrf);
136-
const cancellationResponse =
137-
res && res.payload && res.payload.status === 200 && !res.error
138-
? res.payload.data
139-
: null;
140-
if (!cancellationResponse) {
141-
window.snackDispatch({
142-
type: UPDATE_TOAST,
143-
payload: {
144-
severity: 'error',
145-
toast:
146-
'There was an error cancelling the review. Please contact your administrator.'
147-
}
148-
});
149-
}
150-
return cancellationResponse;
151-
};
152-
153-
handleCloseCancel();
154-
if (csrf) {
155-
cancelRequest().then(res => {
156-
if (res) {
157-
reloadReviews();
158-
window.snackDispatch({
159-
type: UPDATE_TOAST,
160-
payload: {
161-
severity: 'success',
162-
toast: 'Review canceled'
163-
}
164-
});
165-
}
166-
});
167-
}
168-
}, [csrf, handleCloseCancel, review, reloadReviews]);
169-
170-
const handleReassign = useCallback(
171-
assignee => {
172-
const reassignRequest = async () => {
173-
review.recipientId = assignee.id;
174-
const res = await updateFeedbackRequest(review, csrf);
175-
const updateResponse =
176-
res && res.payload && res.payload.status === 200 && !res.error
177-
? res.payload.data
178-
: null;
179-
if (!updateResponse) {
180-
window.snackDispatch({
181-
type: UPDATE_TOAST,
182-
payload: {
183-
severity: 'error',
184-
toast:
185-
'There was an error reassigning the review. Please contact your administrator.'
186-
}
187-
});
188-
}
189-
return updateResponse;
190-
};
191-
192-
handleCloseReassign();
193-
if (csrf) {
194-
reassignRequest().then(res => {
195-
if (res) {
196-
reloadReviews();
197-
window.snackDispatch({
198-
type: UPDATE_TOAST,
199-
payload: {
200-
severity: 'success',
201-
toast: 'Review reassigned'
202-
}
203-
});
204-
}
205-
});
206-
}
207-
},
208-
[csrf, handleCloseReassign, review, reloadReviews]
209-
);
210-
211110
let selfReviewIcon = <HourglassEmptyIcon />;
212111
if (selfReview && selfReview.status?.toUpperCase() === 'SUBMITTED') {
213112
selfReviewIcon = <CheckCircleIcon />;
214-
} else if (init) {
215-
// If there is no self-review, switch to the next tab.
216-
setInit(false);
217-
setValue(1);
218113
}
219114

220115
return (
@@ -228,25 +123,21 @@ const TeamMemberReview = ({
228123
textColor="inherit"
229124
variant="fullWidth"
230125
>
231-
{selfReview && selfReview.id && (<Tab
126+
<Tab
232127
icon={selfReviewIcon}
233128
label={
234129
memberProfile?.firstName
235130
? memberProfile?.firstName + "'s Self-Review"
236131
: 'Self-Review'
237132
}
238133
{...a11yProps(0)}
239-
/>)}
134+
/>
240135
{reviews &&
241-
reviews.map((review, index) => {
242-
if (!review) {
243-
return (<></>);
244-
}
136+
reviews.filter(r => !!r).map((review, index) => {
245137
const reviewer = review.recipientId == memberProfile?.id ?
246138
memberProfile :
247139
selectProfile(state, review.recipientId);
248140
let label = reviewer?.firstName + "'s Review";
249-
250141
if (reviewer?.id === currentUser?.id) {
251142
label = 'Your Review';
252143
}
@@ -267,24 +158,20 @@ const TeamMemberReview = ({
267158
index={value}
268159
onChangeIndex={handleChangeIndex}
269160
>
270-
{selfReview && selfReview.id && (
271161
<TabPanel value={value} index={0} dir={theme.direction}>
272-
<FeedbackSubmitForm
273-
requesteeName={
274-
memberProfile?.firstName + ' ' + memberProfile?.lastName
275-
}
276-
requestId={selfReview?.id}
277-
request={selfReview}
278-
reviewOnly={true}
279-
/>
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>)}
280172
</TabPanel>
281-
)}
282173
{reviews &&
283-
reviews.map((review, index) => {
284-
if (!review) {
285-
return (<></>);
286-
}
287-
174+
reviews.filter(r => !!r).map((review, index) => {
288175
const reviewer = selectProfile(state, review.recipientId);
289176
const requestee = selectProfile(state, review.requesteeId);
290177
const requesteeName = requestee?.name;
@@ -293,26 +180,6 @@ const TeamMemberReview = ({
293180

294181
return (
295182
<TabPanel value={value} index={index + 1} dir={theme.direction}>
296-
{review && review.status?.toUpperCase() !== 'SUBMITTED' && (
297-
<div className={classes.buttonRow}>
298-
<Button
299-
onClick={handleOpenCancel}
300-
className={classes.actionButtons}
301-
variant="outlined"
302-
color="secondary"
303-
>
304-
Cancel
305-
</Button>
306-
<Button
307-
onClick={handleOpenReassign}
308-
className={classes.actionButtons}
309-
variant="outlined"
310-
color="primary"
311-
>
312-
Reassign
313-
</Button>
314-
</div>
315-
)}
316183
<FeedbackSubmitForm
317184
requesteeName={requesteeName}
318185
requestId={review.id}
@@ -323,39 +190,6 @@ const TeamMemberReview = ({
323190
);
324191
})}
325192
</SwipeableViews>
326-
<SelectUserModal
327-
userLabel="Reviewer"
328-
open={reassignOpen}
329-
onSelect={handleReassign}
330-
onClose={handleCloseReassign}
331-
/>
332-
<Modal open={cancelOpen} onClose={handleCloseCancel}>
333-
<Card className="cancel-feedback-request-modal">
334-
<CardHeader
335-
title={
336-
<Typography variant="h5" fontWeight="bold">
337-
Cancel Review
338-
</Typography>
339-
}
340-
/>
341-
<CardContent>
342-
<Typography variant="body1">
343-
Are you sure you want to cancel the review sent to{' '}
344-
<b>{recipient?.name}</b> on <b>{review?.sendDate}</b>? The
345-
recipient will not be able to respond to this request once it is
346-
canceled.
347-
</Typography>
348-
</CardContent>
349-
<CardActions>
350-
<Button color="secondary" onClick={handleCloseReassign}>
351-
No, Keep Feedback Request
352-
</Button>
353-
<Button color="primary" onClick={handleCancelClick}>
354-
Yes, Cancel Feedback Request
355-
</Button>
356-
</CardActions>
357-
</Card>
358-
</Modal>
359193
</Box>
360194
</Root>
361195
);

0 commit comments

Comments
 (0)