Skip to content

Conversation

theodkp
Copy link
Contributor

@theodkp theodkp commented Oct 10, 2025

  • Adds remove Teammate functionality
  • Admins can remove teammates from webapp (given warning first through dialog box popup)
  • Removed users will automatically become admin of a new team
  • Removed users will receive an email notifying them of the removal and new team

Notes

  • Attempted to create email based on format of other emails ( can be changed ofc)
  • Currently doesn't update stripe

closes #135

@theodkp theodkp requested a review from konsalex as a code owner October 10, 2025 00:06
Copy link

netlify bot commented Oct 10, 2025

Deploy Preview for hoppdocs ready!

Name Link
🔨 Latest commit eff392d
🔍 Latest deploy log https://app.netlify.com/projects/hoppdocs/deploys/68ea35b7a0f9200008de888f
😎 Deploy Preview https://deploy-preview-136--hoppdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@konsalex konsalex left a comment

Choose a reason for hiding this comment

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

Thanks for the PR mate.

Some minor nits, that I fixed.

I can also see that updateSubscriptionQuantity was un-exported, but turns out we will need to use it in the handlers so exported it.

Comment on lines 128 to 131
htmlBody := string(templateBytes)
htmlBody = strings.Replace(htmlBody, "{first_name}", user.FirstName, -1)
htmlBody = strings.Replace(htmlBody, "{old_team_name}", oldTeamName, -1)
htmlBody = strings.Replace(htmlBody, "{new_team_name}", newTeamName, -1)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Recently I learned this is a good use case for strings.Replacer

htmlBody = strings.Replace(htmlBody, "{old_team_name}", oldTeamName, -1)
htmlBody = strings.Replace(htmlBody, "{new_team_name}", newTeamName, -1)

subject := fmt.Sprintf("You've been removed from %s", oldTeamName)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could prefix the subject line with Hopp so folks will know who this message comes from immediately

Comment on lines +894 to +896
if !user.IsAdmin {
return echo.NewHTTPError(http.StatusForbidden, "admin required")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: those checks are preferable to be highest priority, as you avoid doing any roundtrips to the DB. Fail fast type of thing.

@konsalex konsalex merged commit 9a52dce into gethopp:main Oct 11, 2025
14 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.

feat: add ability to remove team members

2 participants