Skip to content

Comments

[PROD RELEASE]#1466

Merged
kkartunov merged 16 commits intomasterfrom
dev
Feb 10, 2026
Merged

[PROD RELEASE]#1466
kkartunov merged 16 commits intomasterfrom
dev

Conversation

@kkartunov
Copy link
Collaborator

@kkartunov kkartunov commented Feb 10, 2026

@kkartunov kkartunov requested a review from jmgasper as a code owner February 10, 2026 08:05
city,
associatedSkills,
}: any = work
const normalizedCompanyName: string = _.trim(companyName || company || '')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Using _.trim on companyName || company || '' is safe, but consider handling cases where both companyName and company are non-empty but different. This could lead to unexpected results if the data is inconsistent.

associatedSkills: Array.isArray(associatedSkills) ? associatedSkills : undefined,
cityName: city,
companyName: companyName || '',
company: normalizedCompanyName || undefined,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The property company is being set to normalizedCompanyName || undefined. If normalizedCompanyName is an empty string, this will result in company being undefined. Ensure this behavior is intentional and aligns with the expected data structure.


toast.success('Starting bulk approve', { position: toast.POSITION.BOTTOM_RIGHT })

for (const id of ids) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Using any for updates can lead to runtime errors and makes the code harder to maintain. Consider defining a specific type for updates to ensure type safety.

// awaiting sequentially to preserve order and server load control
// errors for individual items are caught and reported
// eslint-disable-next-line no-await-in-loop
const msg = await editPayment(updates)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
Using await inside a loop can lead to performance bottlenecks as each request waits for the previous one to complete. Consider using Promise.all to execute requests concurrently if order is not important.

onConfirm={function onConfirm() {
onBulkApprove(bulkAuditNote)
}}
canSave={bulkAuditNote.trim().length > 0}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 correctness]
The canSave condition relies on bulkAuditNote.trim().length > 0, which could lead to issues if the user enters only whitespace. Consider trimming the input before validation.

size='lg'
/>
)}
{props.selectedCount && props.selectedCount > 0 && (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 readability]
The condition props.selectedCount && props.selectedCount > 0 is redundant. props.selectedCount > 0 is sufficient since it inherently checks for truthiness.

className={styles.bulkButton}
label={`${props.selectedCount > 1 ? 'Bulk ' : ''}Approve (${props.selectedCount})`}
size='lg'
onClick={() => props.onBulkClick?.()}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider providing a default value or handling the case where onBulkClick is not defined, to avoid potential runtime errors if the function is expected to be called.

}
}, [props.selectedPayments])

// Only rows with this status are selectable for bulk actions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 maintainability]
Consider extracting the selectableStatus string into a constant or configuration file to avoid magic strings and improve maintainability.

type='checkbox'
aria-label='Select All'
checked={allVisibleSelected}
ref={el => { if (el) el.indeterminate = someVisibleSelected }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Using ref to set indeterminate state directly on the DOM element can lead to unexpected behavior if the component re-renders. Consider using a useEffect hook to manage the indeterminate state based on someVisibleSelected.

const someVisibleSelected = visibleSelectablePayments.some(p => selectedPayments[p.id]) && !allVisibleSelected

const onToggleSelectAll = (checked: boolean) => {
if (checked) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The onToggleSelectAll function directly mutates the selectedPayments state, which can lead to bugs if the state is updated elsewhere asynchronously. Consider using a functional state update to ensure consistency.

certification?: UserSkillActivity
course?: UserSkillActivity
challenge?: UserSkillActivity
challenge?: {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Changing challenge from UserSkillActivity to an object with dynamic keys of type UserSkillActivity increases flexibility but may introduce issues if not handled properly. Ensure that all parts of the codebase that interact with challenge are updated to handle this new structure. Consider if this change impacts serialization/deserialization or any external API contracts.

return 'Loading...'
}

if (!skillDetails.lastUsedDate && !skillDetails.activity) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Returning an empty string when both lastUsedDate and activity are missing might lead to unexpected UI behavior. Consider providing a more informative fallback or handling this case explicitly in the UI.

<strong>Last used:</strong>
<span>{format(new Date(skillDetails.lastUsedDate), 'MMM dd, yyyy HH:mm')}</span>
<strong>Last activity:</strong>
<span>{format(new Date(skillDetails.lastUsedDate), 'MMM dd, yyyy')}</span>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The format function is called with skillDetails.lastUsedDate without checking if it's a valid date. If lastUsedDate is undefined or invalid, this could throw an error. Consider validating lastUsedDate before formatting.

))}
</li>
)}
{skillDetails.activity.challenge && Object.keys(skillDetails.activity.challenge)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Using Object.keys(skillDetails.activity.challenge) assumes challenge is an object. Ensure challenge is always an object or handle cases where it might not be.

vas3a and others added 2 commits February 10, 2026 10:07
…-approver-fixes

PM-3698 - engagement approver fixes
// awaiting sequentially to preserve order and server load control
// errors for individual items are caught and reported
// eslint-disable-next-line no-await-in-loop
await editPayment(updates)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The editPayment function is awaited inside a loop. This can lead to performance issues if the number of payments is large, as each request waits for the previous one to complete. Consider using Promise.all to execute these requests concurrently, if the order of execution is not critical.

}
}

if (successfullyUpdated === ids.length) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 usability]
The success message is only shown if all payments are successfully updated. Consider providing feedback for partial success as well, to inform the user how many payments were successfully updated even if some failed.

size='lg'
/>
)}
{!!props.selectedCount && props.selectedCount > 0 && (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 readability]
The use of double negation !!props.selectedCount is redundant here since props.selectedCount > 0 already ensures that props.selectedCount is truthy. Consider removing !!props.selectedCount for clarity.

@kkartunov kkartunov merged commit 6469522 into master Feb 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants