1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

fix ts strict errors (#12355)

This commit is contained in:
Brandon Treston
2024-12-11 19:08:14 -05:00
committed by GitHub
parent 859f87aabe
commit 8dd904f4b7
2 changed files with 15 additions and 15 deletions

View File

@@ -53,8 +53,8 @@ const DisallowedPlanTypes = [
],
})
export class vNextClientsComponent {
providerId: string;
addableOrganizations: Organization[];
providerId: string = "";
addableOrganizations: Organization[] = [];
loading = true;
manageOrganizations = false;
showAddExisting = false;
@@ -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(
@@ -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();

View File

@@ -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,
@@ -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(
@@ -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;
@@ -146,7 +146,7 @@ export class vNextManageClientsComponent {
organization: {
id: organization.id,
name: organization.organizationName,
seats: organization.seats,
seats: organization.seats ? organization.seats : 0,
},
},
});
@@ -164,7 +164,7 @@ export class vNextManageClientsComponent {
const dialogRef = openManageClientSubscriptionDialog(this.dialogService, {
data: {
organization,
provider: this.provider,
provider: this.provider!,
},
});
@@ -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();