Skip to content

Commit

Permalink
fix ts strict errors (#12355)
Browse files Browse the repository at this point in the history
  • Loading branch information
BTreston authored Dec 12, 2024
1 parent 859f87a commit 8dd904f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const DisallowedPlanTypes = [
],
})
export class vNextClientsComponent {
providerId: string;
addableOrganizations: Organization[];
providerId: string = "";
addableOrganizations: Organization[] = [];
loading = true;
manageOrganizations = false;
showAddExisting = false;
Expand All @@ -79,8 +79,8 @@ export class vNextClientsComponent {
this.searchControl.setValue(queryParams.search);
});

this.activatedRoute.parent.params
.pipe(
this.activatedRoute.parent?.params
?.pipe(
switchMap((params) => {
this.providerId = params.providerId;
return this.providerService.get$(this.providerId).pipe(
Expand Down Expand Up @@ -125,7 +125,7 @@ export class vNextClientsComponent {
await this.webProviderService.detachOrganization(this.providerId, organization.id);
this.toastService.showToast({
variant: "success",
title: null,
title: "",
message: this.i18nService.t("detachedOrganization", organization.organizationName),
});
await this.load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ import { vNextNoClientsComponent } from "./vnext-no-clients.component";
],
})
export class vNextManageClientsComponent {
providerId: string;
provider: Provider;
providerId: string = "";
provider: Provider | undefined;
loading = true;
isProviderAdmin = false;
dataSource: TableDataSource<ProviderOrganizationOrganizationDetailsResponse> =
new TableDataSource();

protected searchControl = new FormControl("", { nonNullable: true });
protected plans: PlanResponse[];
protected plans: PlanResponse[] = [];

constructor(
private billingApiService: BillingApiServiceAbstraction,
Expand All @@ -76,8 +76,8 @@ export class vNextManageClientsComponent {
this.searchControl.setValue(queryParams.search);
});

this.activatedRoute.parent.params
.pipe(
this.activatedRoute.parent?.params
?.pipe(
switchMap((params) => {
this.providerId = params.providerId;
return this.providerService.get$(this.providerId).pipe(
Expand Down Expand Up @@ -110,12 +110,12 @@ export class vNextManageClientsComponent {
async load() {
this.provider = await firstValueFrom(this.providerService.get$(this.providerId));

this.isProviderAdmin = this.provider.type === ProviderUserType.ProviderAdmin;
this.isProviderAdmin = this.provider?.type === ProviderUserType.ProviderAdmin;

const clients = (await this.billingApiService.getProviderClientOrganizations(this.providerId))
.data;

clients.forEach((client) => (client.plan = client.plan.replace(" (Monthly)", "")));
clients.forEach((client) => (client.plan = client.plan?.replace(" (Monthly)", "")));

this.dataSource.data = clients;

Expand Down Expand Up @@ -146,7 +146,7 @@ export class vNextManageClientsComponent {
organization: {
id: organization.id,
name: organization.organizationName,
seats: organization.seats,
seats: organization.seats ? organization.seats : 0,
},
},
});
Expand All @@ -164,7 +164,7 @@ export class vNextManageClientsComponent {
const dialogRef = openManageClientSubscriptionDialog(this.dialogService, {
data: {
organization,
provider: this.provider,
provider: this.provider!,
},
});

Expand All @@ -190,7 +190,7 @@ export class vNextManageClientsComponent {
await this.webProviderService.detachOrganization(this.providerId, organization.id);
this.toastService.showToast({
variant: "success",
title: null,
title: "",
message: this.i18nService.t("detachedOrganization", organization.organizationName),
});
await this.load();
Expand Down

0 comments on commit 8dd904f

Please sign in to comment.