Skip to content

Comments

[PROD RELEASE] - Bug fixes#1484

Merged
kkartunov merged 8 commits intomasterfrom
dev
Feb 18, 2026
Merged

[PROD RELEASE] - Bug fixes#1484
kkartunov merged 8 commits intomasterfrom
dev

Conversation

@kkartunov
Copy link
Collaborator

@kkartunov kkartunov requested a review from jmgasper as a code owner February 18, 2026 13:39
const users = leaveEntry?.usersOnLeave ?? []
const sortedUsers = [...users].sort(compareUsersByName)
const displayedUsers = sortedUsers.slice(0, 10)
const displayedUsers = sortedUsers.slice(0, 2)

Choose a reason for hiding this comment

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

[⚠️ design]
Reducing the number of displayed users from 10 to 2 might significantly change the user experience. Ensure that this change is intentional and aligns with the design requirements.

</div>

{isMobile && openDateKey && (() => {
{openDateKey && (() => {

Choose a reason for hiding this comment

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

[⚠️ correctness]
The condition isMobile && openDateKey was removed. Ensure that this change does not unintentionally affect the mobile-specific behavior of the calendar.

</span>
<a
className={styles.signInLink}
href={`${EnvironmentConfig.URLS.USER_PROFILE}/${props.profileHandle}`}

Choose a reason for hiding this comment

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

[❗❗ security]
The URL construction for the profile link uses string interpolation with props.profileHandle. Ensure that profileHandle is properly sanitized to prevent potential injection attacks or malformed URLs.

const showAssignedActions = assignmentStatus === 'assigned'
const showOfferActions = assignmentStatus === 'selected'

const renderOfferActions = (

Choose a reason for hiding this comment

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

[⚠️ performance]
The renderOfferActions function is defined within the AssignmentCard component, which means it will be re-created on every render. Consider using useCallback to memoize this function if it doesn't depend on any props or state that change frequently.

const isLoggedIn = profileContext.isLoggedIn
const userId = profileContext.profile?.userId
const profileHandle = profileContext.profile?.handle
const profileCompleteness = useProfileCompleteness(profileHandle)

Choose a reason for hiding this comment

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

[❗❗ correctness]
The useProfileCompleteness hook is called with profileHandle, which could be undefined if profileContext.profile is not available. Ensure that useProfileCompleteness can handle an undefined argument gracefully.


if (
profileCompleteness
&& typeof profileCompleteness.percent === 'number'

Choose a reason for hiding this comment

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

[❗❗ correctness]
The check typeof profileCompleteness.percent === 'number' is necessary, but consider adding a check to ensure profileCompleteness is not undefined before accessing percent to avoid potential runtime errors.

function handleFormChange(nextValue: OpenToWorkData): void {
setFormValue(nextValue)

if (submitAttempted) {

Choose a reason for hiding this comment

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

[⚠️ performance]
The validateOpenToWork function is called on every form change when submitAttempted is true. This could lead to performance issues if the validation logic is complex or if the form changes frequently. Consider optimizing the validation logic or debouncing the validation calls.

const errors = validateOpenToWork(formValue)
setFormErrors(errors)

if (Object.keys(errors).length > 0) {

Choose a reason for hiding this comment

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

[❗❗ correctness]
The check if (Object.keys(errors).length > 0) is used to determine if there are validation errors. Ensure that validateOpenToWork always returns an object, even if there are no errors, to avoid potential runtime errors.

setFormValue(nextValue)

if (submitAttempted) {
setFormErrors(validateOpenToWork(nextValue))

Choose a reason for hiding this comment

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

[⚠️ performance]
The validateOpenToWork function is called twice: once in handleFormChange and again in handleOpenForWorkSave. Consider optimizing this by storing the result of the validation in a variable and reusing it if possible.

const errors = validateOpenToWork(formValue)
setFormErrors(errors)

if (Object.keys(errors).length > 0) {

Choose a reason for hiding this comment

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

[💡 maintainability]
The check Object.keys(errors).length > 0 is used to determine if there are errors. Consider using a utility function like isEmptyObject for better readability and maintainability.

[key: string]: string
} = {
ConsumerGoods: 'Consumer goods',
HealthCare: 'Healthcare',

Choose a reason for hiding this comment

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

[❗❗ correctness]
Inconsistent casing: 'HealthCare' should be 'Healthcare' to match the label 'Healthcare'.

[key: string]: string
} = {
'Consumer goods': 'ConsumerGoods',
Healthcare: 'HealthCare',

Choose a reason for hiding this comment

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

[❗❗ correctness]
Inconsistent casing: 'HealthCare' should be 'Healthcare' to match the label 'Healthcare'.

@kkartunov kkartunov merged commit 9050a42 into master Feb 18, 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.

2 participants