1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-19 15:57:42 +01: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -53,8 +53,8 @@ const DisallowedPlanTypes = [
], ],
}) })
export class vNextClientsComponent { export class vNextClientsComponent {
providerId: string; providerId: string = "";
addableOrganizations: Organization[]; addableOrganizations: Organization[] = [];
loading = true; loading = true;
manageOrganizations = false; manageOrganizations = false;
showAddExisting = false; showAddExisting = false;
@ -79,8 +79,8 @@ export class vNextClientsComponent {
this.searchControl.setValue(queryParams.search); this.searchControl.setValue(queryParams.search);
}); });
this.activatedRoute.parent.params this.activatedRoute.parent?.params
.pipe( ?.pipe(
switchMap((params) => { switchMap((params) => {
this.providerId = params.providerId; this.providerId = params.providerId;
return this.providerService.get$(this.providerId).pipe( return this.providerService.get$(this.providerId).pipe(
@ -125,7 +125,7 @@ export class vNextClientsComponent {
await this.webProviderService.detachOrganization(this.providerId, organization.id); await this.webProviderService.detachOrganization(this.providerId, organization.id);
this.toastService.showToast({ this.toastService.showToast({
variant: "success", variant: "success",
title: null, title: "",
message: this.i18nService.t("detachedOrganization", organization.organizationName), message: this.i18nService.t("detachedOrganization", organization.organizationName),
}); });
await this.load(); await this.load();

View File

@ -51,15 +51,15 @@ import { vNextNoClientsComponent } from "./vnext-no-clients.component";
], ],
}) })
export class vNextManageClientsComponent { export class vNextManageClientsComponent {
providerId: string; providerId: string = "";
provider: Provider; provider: Provider | undefined;
loading = true; loading = true;
isProviderAdmin = false; isProviderAdmin = false;
dataSource: TableDataSource<ProviderOrganizationOrganizationDetailsResponse> = dataSource: TableDataSource<ProviderOrganizationOrganizationDetailsResponse> =
new TableDataSource(); new TableDataSource();
protected searchControl = new FormControl("", { nonNullable: true }); protected searchControl = new FormControl("", { nonNullable: true });
protected plans: PlanResponse[]; protected plans: PlanResponse[] = [];
constructor( constructor(
private billingApiService: BillingApiServiceAbstraction, private billingApiService: BillingApiServiceAbstraction,
@ -76,8 +76,8 @@ export class vNextManageClientsComponent {
this.searchControl.setValue(queryParams.search); this.searchControl.setValue(queryParams.search);
}); });
this.activatedRoute.parent.params this.activatedRoute.parent?.params
.pipe( ?.pipe(
switchMap((params) => { switchMap((params) => {
this.providerId = params.providerId; this.providerId = params.providerId;
return this.providerService.get$(this.providerId).pipe( return this.providerService.get$(this.providerId).pipe(
@ -110,12 +110,12 @@ export class vNextManageClientsComponent {
async load() { async load() {
this.provider = await firstValueFrom(this.providerService.get$(this.providerId)); 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)) const clients = (await this.billingApiService.getProviderClientOrganizations(this.providerId))
.data; .data;
clients.forEach((client) => (client.plan = client.plan.replace(" (Monthly)", ""))); clients.forEach((client) => (client.plan = client.plan?.replace(" (Monthly)", "")));
this.dataSource.data = clients; this.dataSource.data = clients;
@ -146,7 +146,7 @@ export class vNextManageClientsComponent {
organization: { organization: {
id: organization.id, id: organization.id,
name: organization.organizationName, name: organization.organizationName,
seats: organization.seats, seats: organization.seats ? organization.seats : 0,
}, },
}, },
}); });
@ -164,7 +164,7 @@ export class vNextManageClientsComponent {
const dialogRef = openManageClientSubscriptionDialog(this.dialogService, { const dialogRef = openManageClientSubscriptionDialog(this.dialogService, {
data: { data: {
organization, organization,
provider: this.provider, provider: this.provider!,
}, },
}); });
@ -190,7 +190,7 @@ export class vNextManageClientsComponent {
await this.webProviderService.detachOrganization(this.providerId, organization.id); await this.webProviderService.detachOrganization(this.providerId, organization.id);
this.toastService.showToast({ this.toastService.showToast({
variant: "success", variant: "success",
title: null, title: "",
message: this.i18nService.t("detachedOrganization", organization.organizationName), message: this.i18nService.t("detachedOrganization", organization.organizationName),
}); });
await this.load(); await this.load();