Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 8d83101

Browse files
committed
Made minor changes for calendar sync functionality.
Specifically, the loading message is updated when sync is complete & added links for support & calendar management.
1 parent fbc0070 commit 8d83101

File tree

5 files changed

+55
-10
lines changed

5 files changed

+55
-10
lines changed

src/routes/PositionDetails/components/InterviewPopup/CalendarSyncTimedOut/index.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ const CalendarSyncTimedOut = ({ userSettings, onContinue }) => {
1515
<div styleName="timedout-wrapper">
1616
<div styleName="timedout-text">
1717
<p>Strange, it takes too long to sync your calendar {primaryCalendar.email}.</p>
18-
<p>Please, try re-connecting your calendar by clicking "manage connected calendars". Would you have any issues, please don't hesitate to reach out to us by [email protected].</p>
18+
<p>
19+
Please, try re-connecting your calendar by clicking "
20+
<span
21+
onClick={() => onContinue(POPUP_STAGES.MANAGE_CALENDAR)}
22+
styleName="manage-calendar"
23+
>
24+
manage connected calendars</span>". Would you have any issues, please don't hesitate to reach out to us
25+
by <a styleName="topcoder-support-email-link" href="mailto:[email protected]">[email protected]</a>.
26+
</p>
1927
</div>
2028
<div styleName="button-wrapper">
2129
<Button

src/routes/PositionDetails/components/InterviewPopup/CalendarSyncTimedOut/styles.module.scss

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,22 @@
2121

2222
.confirm-text-bold {
2323
font-weight: bold;
24-
}
24+
}
25+
26+
.manage-calendar {
27+
color: #0d61bf;
28+
@include font-roboto;
29+
font-weight: 400;
30+
font-size: 14px;
31+
cursor: pointer;
32+
text-decoration: underline;
33+
}
34+
35+
.topcoder-support-email-link {
36+
color: #0d61bf !important;
37+
@include font-roboto;
38+
font-weight: 400;
39+
font-size: 14px;
40+
cursor: pointer;
41+
text-decoration: underline;
42+
}

src/routes/PositionDetails/components/InterviewPopup/Confirm/index.jsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Confirm = ({
2828
onGoBack,
2929
onContinue,
3030
onShowingLoader,
31+
onSetLoadingMessage,
3132
userSettings,
3233
getSettingsModular,
3334
}) => {
@@ -58,11 +59,8 @@ const Confirm = ({
5859
setSyncCalendarTimeoutId(null);
5960
setInitiateInterviewConfirmation(false);
6061

61-
// disable loading indicator
62-
onSetLoadingMessage(`Scheduling interview...`);
63-
6462
// continue with interview scheduling
65-
onContinueAhead();
63+
onContinueAhead(true);
6664
}
6765
else if ((primaryCalendar && !calendarSynced) && (syncCalendarTimeoutId || initiateInterviewConfirmation))
6866
{
@@ -82,20 +80,24 @@ const Confirm = ({
8280
return () => clearTimeout(syncCalendarTimeoutId);
8381
}, [userSettings]);
8482

85-
const onSetLoadingMessage = (text) => setLoadingMessage(text);
83+
const onSetLoadingMessageLocal = (text) => setLoadingMessage(text);
8684

8785
/**
8886
* This will trigger the API call to the server to request an interview
8987
*/
90-
const onContinueAhead = () => {
88+
const onContinueAhead = (showSyncCompletedMessage) => {
9189
const params = {
9290
hostTimezone: scheduleDetails.timezone,
9391
duration: scheduleDetails.duration,
9492
availableTime: scheduleDetails.slots,
9593
};
96-
onSetLoadingMessage(null);
94+
onSetLoadingMessageLocal(null);
9795
onShowingLoader(true);
9896

97+
// sync completed, let the user know scheduling is underway
98+
if (showSyncCompletedMessage)
99+
onSetLoadingMessage("Scheduling interview...");
100+
99101
confirmInterview(candidateId, params)
100102
.then(() => dispatch(loadPosition(teamId, positionId)))
101103
.then(() => onContinue(POPUP_STAGES.SUCCESS))
@@ -114,7 +116,7 @@ const Confirm = ({
114116
if (primaryCalendar && !calendarSynced)
115117
{
116118
// show loading indicator with message
117-
onSetLoadingMessage(`Syncing your new calendar ${primaryCalendar.email}, it might take a few minutes...`);
119+
onSetLoadingMessageLocal(`Syncing your new calendar ${primaryCalendar.email}, it might take a few minutes...`);
118120

119121
// fetch UserMeetingSettings in the background, for the 1st time, no timeout is necessary,
120122
// so we set initiateInterviewConfirmation value to true
@@ -175,6 +177,7 @@ Confirm.propTypes = {
175177
onGoBack: PT.func,
176178
onContinue: PT.func,
177179
onShowingLoader: PT.func,
180+
onSetLoadingMessage: PT.func,
178181
userSettings: PT.object,
179182
getSettingsModular: PT.func,
180183
};

src/routes/PositionDetails/components/InterviewPopup/index.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const InterviewPopup = ({
3636
const [stage, setStage] = useState(initialStage);
3737
const [previousStage, setPreviousStage] = useState(initialStage);
3838
const [isLoading, setLoading] = useState(false);
39+
const [loadingMessage, setLoadingMessage] = useState(null);
3940
const [userSettings, setUserSettings] = useState();
4041
const { v5UserProfile } = useSelector((state) => state.authUser);
4142
const [scheduleDetails, setScheduleDetails] = useState({
@@ -49,6 +50,12 @@ const InterviewPopup = ({
4950
}
5051
}, [open]);
5152

53+
// if loading finished, reset value of loadingMessage
54+
useEffect(() => {
55+
if (!isLoading)
56+
setLoadingMessage(null);
57+
}, [isLoading])
58+
5259
const onCloseInterviewPopup = () => {
5360
setStage("");
5461
setScheduleDetails({
@@ -169,6 +176,8 @@ const InterviewPopup = ({
169176
setLoading(loading);
170177
};
171178

179+
const onSetLoadingMessage = (text) => setLoadingMessage(text);
180+
172181
/**
173182
* Removes the calendar from the state once it is removed from the server
174183
*/
@@ -231,6 +240,7 @@ const InterviewPopup = ({
231240
candidate={candidate}
232241
userSettings={userSettings}
233242
getSettingsModular={getSettingsModular}
243+
onSetLoadingMessage={onSetLoadingMessage}
234244
/>
235245
);
236246
case POPUP_STAGES.SUCCESS:
@@ -301,6 +311,7 @@ const InterviewPopup = ({
301311
})}
302312
>
303313
<Spinner stype="Oval" width={80} height={80} />
314+
{isLoading && loadingMessage && <p styleName="loading-message">{loadingMessage}</p>}
304315
</div>
305316
<div
306317
styleName={cn("component-wrapper", {

src/routes/PositionDetails/components/InterviewPopup/styles.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@
2323
.show-component-wrapper {
2424
display: block;
2525
}
26+
27+
.loading-message {
28+
margin-top: 10px;
29+
text-align: center;
30+
}

0 commit comments

Comments
 (0)