From acadd0f8278a19eef4b5053ee5fbbcc54891885e Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Thu, 21 Jul 2022 13:31:00 +0300 Subject: [PATCH] Rate limits fix close null bug --- .../rate-limits-details-dialog.component.ts | 2 +- .../tenant/rate-limits/rate-limits.component.ts | 11 ++++++----- ui-ngx/src/app/shared/models/rate-limits.models.ts | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.ts b/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.ts index 69bf5cda4f..790ca57838 100644 --- a/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.ts @@ -72,7 +72,7 @@ export class RateLimitsDetailsDialogComponent extends DialogComponent(RateLimitsDetailsDialogComponent, { disableClose: true, @@ -120,7 +121,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida readonly: this.disabled } }).afterClosed().subscribe((result) => { - if (result) { + if (result || result === null) { this.modelValue = result; this.updateModel(); } diff --git a/ui-ngx/src/app/shared/models/rate-limits.models.ts b/ui-ngx/src/app/shared/models/rate-limits.models.ts index 272728c647..7185dbdd44 100644 --- a/ui-ngx/src/app/shared/models/rate-limits.models.ts +++ b/ui-ngx/src/app/shared/models/rate-limits.models.ts @@ -36,7 +36,7 @@ export enum RateLimitsType { TENANT_ENTITY_IMPORT_RATE_LIMIT = 'TENANT_ENTITY_IMPORT_RATE_LIMIT' } -export const rateLimitLabelTranslationMap = new Map( +export const rateLimitsLabelTranslationMap = new Map( [ [RateLimitsType.TENANT_MESSAGES, 'tenant-profile.rate-limits.transport-tenant-msg'], [RateLimitsType.TENANT_TELEMETRY_MESSAGES, 'tenant-profile.rate-limits.transport-tenant-telemetry-msg'], @@ -53,7 +53,7 @@ export const rateLimitLabelTranslationMap = new Map( ] ); -export const rateLimitDialogTitleTranslationMap = new Map( +export const rateLimitsDialogTitleTranslationMap = new Map( [ [RateLimitsType.TENANT_MESSAGES, 'tenant-profile.rate-limits.edit-transport-tenant-msg-title'], [RateLimitsType.TENANT_TELEMETRY_MESSAGES, 'tenant-profile.rate-limits.edit-transport-tenant-telemetry-msg-title'],