Skip to content

Commit 3d337d5

Browse files
authored
Merge pull request #1726 from topcoder-platform/chunk_size
Engagements v2 changes
2 parents 9263eb6 + 7d1d959 commit 3d337d5

13 files changed

Lines changed: 377 additions & 83 deletions

File tree

src/components/ApplicationsList/index.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import DateInput from '../DateInput'
1212
import Handle from '../Handle'
1313
import styles from './ApplicationsList.module.scss'
1414
import { PROFILE_URL } from '../../config/constants'
15+
import { serializeTentativeAssignmentDate } from '../../util/assignmentDates'
1516

1617
const STATUS_OPTIONS = [
1718
{ label: 'All', value: 'all' },
@@ -99,6 +100,21 @@ const getApplicationName = (application) => {
99100
return fullName || application.name || application.email || null
100101
}
101102

103+
const getApplicationMobileNumber = (application) => {
104+
if (!application) {
105+
return null
106+
}
107+
108+
const value = [
109+
application.mobileNumber,
110+
application.mobile_number,
111+
application.phoneNumber,
112+
application.phone
113+
].find((phoneNumber) => phoneNumber != null && `${phoneNumber}`.trim() !== '')
114+
115+
return value ? `${value}`.trim() : null
116+
}
117+
102118
const getApplicationRating = (application) => {
103119
if (!application) {
104120
return undefined
@@ -303,9 +319,11 @@ const ApplicationsList = ({
303319

304320
setIsAccepting(true)
305321
try {
322+
const startDate = serializeTentativeAssignmentDate(parsedStart)
323+
const endDate = serializeTentativeAssignmentDate(parsedEnd)
306324
await onUpdateStatus(acceptApplication.id, 'SELECTED', {
307-
startDate: parsedStart.toISOString(),
308-
endDate: parsedEnd.toISOString(),
325+
startDate,
326+
endDate,
309327
agreementRate: normalizedRate,
310328
...(normalizedOtherRemarks ? { otherRemarks: normalizedOtherRemarks } : {})
311329
})
@@ -500,7 +518,7 @@ const ApplicationsList = ({
500518
<th>Email</th>
501519
<th>Applied Date</th>
502520
<th>Years of Experience</th>
503-
<th>Availability</th>
521+
<th>Phone Number</th>
504522
<th>Status</th>
505523
<th>Actions</th>
506524
</tr>
@@ -541,7 +559,7 @@ const ApplicationsList = ({
541559
<td>{application.email || '-'}</td>
542560
<td>{formatDateTime(application.createdAt)}</td>
543561
<td>{application.yearsOfExperience != null ? application.yearsOfExperience : '-'}</td>
544-
<td>{application.availability || '-'}</td>
562+
<td>{getApplicationMobileNumber(application) || '-'}</td>
545563
<td>
546564
<span className={`${styles.status} ${statusClass}`}>
547565
{statusLabel}

src/components/EngagementEditor/EngagementEditor.module.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@
8080
}
8181
}
8282
}
83+
84+
.privateEngagementRow {
85+
.field {
86+
&.col2.privateEngagementField {
87+
width: 100%;
88+
max-width: none;
89+
min-width: 0;
90+
align-items: flex-start;
91+
justify-content: flex-start;
92+
}
93+
}
94+
}
8395
}
8496
}
8597

@@ -227,6 +239,11 @@
227239
color: $tc-blue-40;
228240
}
229241

242+
.privateEngagementCheckbox {
243+
align-self: flex-start;
244+
margin: 0;
245+
}
246+
230247
.assignmentDetails {
231248
display: flex;
232249
flex-wrap: wrap;

src/components/EngagementEditor/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Handle from '../Handle'
1515
import { JOB_ROLE_OPTIONS, JOB_WORKLOAD_OPTIONS } from '../../config/constants'
1616
import { suggestProfiles } from '../../services/user'
1717
import { getCountableAssignments } from '../../util/engagements'
18+
import { serializeTentativeAssignmentDate } from '../../util/assignmentDates'
1819
import { formatTimeZoneLabel, formatTimeZoneList } from '../../util/timezones'
1920
import styles from './EngagementEditor.module.scss'
2021

@@ -406,8 +407,8 @@ const EngagementEditor = ({
406407
nextAssignedMemberHandles[assignModal.index] = assignModal.handle
407408
nextAssignmentDetails[assignModal.index] = {
408409
memberHandle: assignModal.handle,
409-
startDate: parsedStart.toISOString(),
410-
endDate: parsedEnd.toISOString(),
410+
startDate: serializeTentativeAssignmentDate(parsedStart),
411+
endDate: serializeTentativeAssignmentDate(parsedEnd),
411412
agreementRate: normalizedRate,
412413
otherRemarks: normalizedOtherRemarks
413414
}
@@ -930,12 +931,13 @@ const EngagementEditor = ({
930931
)}
931932

932933
{canEdit && (
933-
<div className={styles.row}>
934+
<div className={cn(styles.row, styles.privateEngagementRow)}>
934935
<div className={cn(styles.field, styles.col1)}>
935936
<label htmlFor='isPrivate'>Private Engagement :</label>
936937
</div>
937-
<div className={cn(styles.field, styles.col2)}>
938+
<div className={cn(styles.field, styles.col2, styles.privateEngagementField)}>
938939
<input
940+
className={styles.privateEngagementCheckbox}
939941
id='isPrivate'
940942
name='isPrivate'
941943
type='checkbox'

0 commit comments

Comments
 (0)