mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-18 15:47:57 +01:00
fix ts strict errors (#12355)
This commit is contained in:
parent
859f87aabe
commit
8dd904f4b7
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user