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

[PM-10703] Admin Portal Selecting Families plan does not check defau… #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lizard-boy
Copy link

@lizard-boy lizard-boy commented Oct 19, 2024

…lt features

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-10703

📔 Objective

Families plan is not checking default features when being selected.

This is happening because the families plan doesn't support secrets manager when a free or paid organization has secrets manager selected. Because it then resolved to an undefined plan, no values are being selected. So we remove the filter in the OrganizationEditModel.

To get the error message to display properly, we store the error message in TempData and then redirect to the Edit action.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Greptile Summary

This pull request addresses an issue with the Families plan not correctly checking default features in the Admin Portal, specifically related to Secrets Manager support.

  • Modified OrganizationsController.cs to improve error handling and check for Secrets Manager support before updating organizations
  • Updated OrganizationEditModel.cs to remove a filter in GetPlansHelper, allowing all plans to be included regardless of Secrets Manager support
  • Implemented TempData for displaying error messages instead of throwing exceptions in the Edit action method
  • Removed unused 'Bit.Core.Exceptions' import from OrganizationsController.cs
  • Potential side effects of including all plans in GetPlansHelper need careful consideration for overall plan selection and feature management

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +242 to +243
TempData["Error"] = "Plan does not support Secrets Manager";
return RedirectToAction("Edit", new { id });
Copy link

Choose a reason for hiding this comment

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

style: Consider using a constant or enum for the error message to maintain consistency and ease of maintenance.

@@ -181,7 +181,6 @@ public OrganizationEditModel(
*/
public object GetPlansHelper() =>
StaticStore.Plans
Copy link

Choose a reason for hiding this comment

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

logic: Removing this filter may include plans that don't support Secrets Manager. Ensure this doesn't cause issues elsewhere in the application.

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