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-13620]Existing user email linking to create-organization #13030

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyprain-okeke
Copy link
Contributor

🎟️ Tracking

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

📔 Objective

We will update the endpoint behavior so that when the email address for an existing user is submitted, the user is sent an email.

The email content will be the same as the one received by users who do not exist, but the link will be specific to the existing user email and the flow following receipt of the email will differ.

📸 Screenshots

Uploading Screen Recording 2025-01-23 at 11.54.43.mov…

⏰ 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

@cyprain-okeke cyprain-okeke requested a review from a team as a code owner January 23, 2025 10:59
@cyprain-okeke cyprain-okeke requested review from eliykat and a team January 23, 2025 10:59
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details5bdc2a1e-ae97-449f-a866-7ecb166a7d86

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 35.10%. Comparing base (e847f96) to head (58ee859).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...-console/settings/create-organization.component.ts 0.00% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13030      +/-   ##
==========================================
- Coverage   35.10%   35.10%   -0.01%     
==========================================
  Files        2990     2990              
  Lines       91078    91093      +15     
  Branches    17052    17059       +7     
==========================================
  Hits        31974    31974              
- Misses      56611    56626      +15     
  Partials     2493     2493              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -25,19 +25,54 @@ export class CreateOrganizationComponent implements OnInit {
ngOnInit() {
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
this.route.queryParams.pipe(first()).subscribe(async (qParams) => {
if (qParams.plan === "families") {
if (qParams.plan === "families" || qParams.productTier == ProductTierType.Families) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to support both these queryparams? Can we just use one or the other?

Comment on lines +51 to +58
if (this.orgPlansComponent.selectedSecretsManagerPlan) {
this.orgPlansComponent.secretsManagerSubscription.patchValue({
enabled: true,
userSeats: 1,
additionalServiceAccounts: 0,
});
}
});
Copy link
Member

@eliykat eliykat Jan 24, 2025

Choose a reason for hiding this comment

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

I think the logic here is: "if the selected plan supports SM, enable SM by default". Is that right?

The logic here is too complicated, especially with the waitForPlansToLoad(). I suggest moving this into the OrganizationPlansComponent, e.g.

@Input()
set EnableSecretsManagerByDefault(value: boolean) {
  if (value && this.selectedSecretsManagerPlan) {
    this.orgPlansComponent.secretsManagerSubscription.patchValue({
   // etc
  }
}

...or it might have to be in ngOnInit because it relies on the plan & product being set first. (that might solve your timing problems)

Then this component can just set the input property in the template, based on the query params. e.g.

this.secretsManager = qParams.Product == ProductType.SecretsManager;
<app-organization-plans [providerId]="providerId" [enableSecretsManagerByDefault]="secretsManager"></app-organization-plans>

Comment on lines 44 to 45
this.orgPlansComponent.plan = PlanType.EnterpriseAnnually;
this.orgPlansComponent.productTier = ProductTierType.Enterprise;
Copy link
Member

Choose a reason for hiding this comment

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

These are already @Input properties in OrganizationPlansComponent. It would be better to pass them in via the template rather than using @ViewChild.

@@ -25,19 +25,54 @@ export class CreateOrganizationComponent implements OnInit {
ngOnInit() {
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
Copy link
Member

Choose a reason for hiding this comment

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

Please resolve these while you're here.

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