Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/url bugs and rush threshold #164

Merged
merged 4 commits into from
Sep 18, 2024

Conversation

wderocco8
Copy link
Contributor

What does this PR do?

  1. Adds logic to decide if rush has attended the appropriate number of events for an interview
  2. Fixed bug when opening URLs that are not prefixed by "http" or "https"

Type of change

  • Fix: Bug fix (non-breaking change which fixes an issue)
  • Refactor: Any code refactoring
  • Chore: technical debt, workflow improvements
  • Feature: New feature (non-breaking change which adds functionality)
  • Documentation: This change requires a documentation update

Tests Performed

Screenshots

Additional Comments

const attendedRemaining = remainingEvents.filter((event) => events[event]).length;

// Check if the rush threshold is met: at least 1 mandatory event and 2 other events
return attendedMandatory && attendedRemaining >= 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the count 2 is a constant? Additionally, you use that logic on both functions so maybe you can abstract this by creating a helper function like isRushThresholdMet(...) - verbosity in this case would help understand the functionality better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completely agree on both. I'll update 2 to be a constant, but Imma come back to the abstraction on a separate PR bc I'm a bit swamped rn lol (and I wanna fix the analytics processing in the backend anyways)


export const getRushThreshold = (events: { [key: string]: boolean }) => {
// Check if at least one mandatory event was attended
const attendedMandatory = mandatoryEvents.some((event) => events[event]);
Copy link
Contributor

@jinyoungbang jinyoungbang Sep 17, 2024

Choose a reason for hiding this comment

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

nit - hasAttendedMandatoryEvent would be a better name

const attendedMandatory = mandatoryEvents.some((event) => events[event]);

// Count how many remaining events were attended
const attendedRemaining = remainingEvents.filter((event) => events[event]).length;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - numAttendedRemainingEvents? or maybe a better name would be better.

@wderocco8 wderocco8 merged commit 45c3162 into dev/3.0 Sep 18, 2024
1 check passed
@wderocco8 wderocco8 deleted the hotfix/url-bugs-AND-rush-threshold branch September 18, 2024 12:59
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