Fix org upgrade issues (#3091)

This commit is contained in:
Robyn MacCallum 2022-07-12 13:58:33 -04:00 committed by GitHub
parent 31a5fdbebb
commit a43aa9612c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 14 deletions

View File

@ -6,7 +6,7 @@
</form> </form>
<form #form [formGroup]="formGroup" *ngIf="!nameOnly"> <form #form [formGroup]="formGroup" *ngIf="!nameOnly">
<h2>{{ "generalInformation" | i18n }}</h2> <h2>{{ "generalInformation" | i18n }}</h2>
<div class="tw-flex tw-w-full tw-space-x-4"> <div class="tw-flex tw-w-full tw-space-x-4" *ngIf="createOrganization">
<bit-form-field class="tw-w-1/2"> <bit-form-field class="tw-w-1/2">
<bit-label>{{ "organizationName" | i18n }}</bit-label> <bit-label>{{ "organizationName" | i18n }}</bit-label>
<input bitInput type="text" formControlName="name" /> <input bitInput type="text" formControlName="name" />
@ -15,7 +15,12 @@
<bit-label>{{ "billingEmail" | i18n }}</bit-label> <bit-label>{{ "billingEmail" | i18n }}</bit-label>
<input bitInput type="email" formControlName="billingEmail" /> <input bitInput type="email" formControlName="billingEmail" />
</bit-form-field> </bit-form-field>
<bit-form-field class="tw-w-1/2" *ngIf="isProvider">
<bit-label>{{ "clientOwnerEmail" | i18n }}</bit-label>
<input bitInput type="email" formControlName="clientOwnerEmail" />
</bit-form-field>
</div> </div>
<div *ngIf="!isProvider && !acceptingSponsorship">
<input <input
type="checkbox" type="checkbox"
name="businessOwned" name="businessOwned"
@ -29,4 +34,5 @@
<input bitInput type="text" formControlName="businessName" /> <input bitInput type="text" formControlName="businessName" />
</bit-form-field> </bit-form-field>
</div> </div>
</div>
</form> </form>

View File

@ -7,6 +7,9 @@ import { FormGroup } from "@angular/forms";
}) })
export class OrganizationInformationComponent { export class OrganizationInformationComponent {
@Input() nameOnly = false; @Input() nameOnly = false;
@Input() createOrganization = true;
@Input() isProvider = false;
@Input() acceptingSponsorship = false;
@Input() formGroup: FormGroup; @Input() formGroup: FormGroup;
@Output() changedBusinessOwned = new EventEmitter<void>(); @Output() changedBusinessOwned = new EventEmitter<void>();
} }

View File

@ -34,6 +34,9 @@
<app-org-info <app-org-info
(changedBusinessOwned)="changedOwnedBusiness()" (changedBusinessOwned)="changedOwnedBusiness()"
[formGroup]="formGroup" [formGroup]="formGroup"
[createOrganization]="createOrganization"
[isProvider]="!!providerId"
[acceptingSponsorship]="acceptingSponsorship"
></app-org-info> ></app-org-info>
<h2 class="mt-5">{{ "chooseYourPlan" | i18n }}</h2> <h2 class="mt-5">{{ "chooseYourPlan" | i18n }}</h2>
<div *ngFor="let selectableProduct of selectableProducts" class="form-check form-check-block"> <div *ngFor="let selectableProduct of selectableProducts" class="form-check form-check-block">

View File

@ -58,7 +58,7 @@ export class OrganizationPlansComponent implements OnInit {
premiumAccessAddon: [false], premiumAccessAddon: [false],
additionalStorage: [0, [Validators.min(0), Validators.max(99)]], additionalStorage: [0, [Validators.min(0), Validators.max(99)]],
additionalSeats: [0, [Validators.min(0), Validators.max(100000)]], additionalSeats: [0, [Validators.min(0), Validators.max(100000)]],
clientOwnerEmail: [""], clientOwnerEmail: ["", [Validators.email]],
businessName: [""], businessName: [""],
plan: [this.plan], plan: [this.plan],
product: [this.product], product: [this.product],
@ -96,6 +96,11 @@ export class OrganizationPlansComponent implements OnInit {
this.changedOwnedBusiness(); this.changedOwnedBusiness();
} }
if (!this.createOrganization) {
this.formGroup.controls.product.setValue(ProductType.Families);
this.changedProduct();
}
this.loading = false; this.loading = false;
} }