mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
[SG-485] and [SG-486] Trial Initiation routing and bug fixes
This commit is contained in:
@@ -11,6 +11,7 @@ import { OrganizationService } from "@bitwarden/common/abstractions/organization
|
||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||
import { PolicyService } from "@bitwarden/common/abstractions/policy.service";
|
||||
import { SyncService } from "@bitwarden/common/abstractions/sync.service";
|
||||
import { ProductType } from "@bitwarden/common/enums/productType";
|
||||
|
||||
import { OrganizationPlansComponent } from "src/app/settings/organization-plans.component";
|
||||
|
||||
@@ -51,10 +52,11 @@ export class BillingComponent extends OrganizationPlansComponent {
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
const additionalSeats = this.product == ProductType.Families ? 0 : 1;
|
||||
this.formGroup.patchValue({
|
||||
name: this.orgInfoForm.get("name")?.value,
|
||||
billingEmail: this.orgInfoForm.get("email")?.value,
|
||||
additionalSeats: 1,
|
||||
additionalSeats: additionalSeats,
|
||||
plan: this.plan,
|
||||
product: this.product,
|
||||
});
|
||||
|
||||
@@ -34,6 +34,7 @@ export class TrialInitiationComponent implements OnInit {
|
||||
accountCreateOnly = true;
|
||||
policies: Policy[];
|
||||
enforcedPolicyOptions: MasterPasswordPolicyOptions;
|
||||
validOrgs: string[] = ["teams", "enterprise", "families"];
|
||||
@ViewChild("stepper", { static: false }) verticalStepper: VerticalStepperComponent;
|
||||
|
||||
orgInfoFormGroup = this.formBuilder.group({
|
||||
@@ -63,17 +64,22 @@ export class TrialInitiationComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
this.org = qParams.org;
|
||||
if (this.validOrgs.includes(qParams.org)) {
|
||||
this.org = qParams.org;
|
||||
} else {
|
||||
this.org = "families";
|
||||
}
|
||||
|
||||
this.orgLabel = this.titleCasePipe.transform(this.org);
|
||||
this.accountCreateOnly = false;
|
||||
|
||||
if (qParams.org === "families") {
|
||||
if (this.org === "families") {
|
||||
this.plan = PlanType.FamiliesAnnually;
|
||||
this.product = ProductType.Families;
|
||||
} else if (qParams.org === "teams") {
|
||||
} else if (this.org === "teams") {
|
||||
this.plan = PlanType.TeamsAnnually;
|
||||
this.product = ProductType.Teams;
|
||||
} else if (qParams.org === "enterprise") {
|
||||
} else if (this.org === "enterprise") {
|
||||
this.plan = PlanType.EnterpriseAnnually;
|
||||
this.product = ProductType.Enterprise;
|
||||
}
|
||||
|
||||
@@ -63,10 +63,16 @@ const routes: Routes = [
|
||||
{ path: "2fa", component: TwoFactorComponent, canActivate: [UnauthGuard] },
|
||||
{
|
||||
path: "register",
|
||||
component: flagEnabled("showTrial") ? TrialInitiationComponent : RegisterComponent,
|
||||
component: RegisterComponent,
|
||||
canActivate: [UnauthGuard],
|
||||
data: { titleId: "createAccount" },
|
||||
},
|
||||
buildFlaggedRoute("showTrial", {
|
||||
path: "trial",
|
||||
component: TrialInitiationComponent,
|
||||
canActivate: [UnauthGuard],
|
||||
data: { titleId: "startTrial" },
|
||||
}),
|
||||
{
|
||||
path: "sso",
|
||||
component: SsoComponent,
|
||||
|
||||
Reference in New Issue
Block a user