Rate limits fix close null bug
This commit is contained in:
parent
9ada3562d5
commit
acadd0f827
@ -72,7 +72,7 @@ export class RateLimitsDetailsDialogComponent extends DialogComponent<RateLimits
|
|||||||
}
|
}
|
||||||
|
|
||||||
cancel(): void {
|
cancel(): void {
|
||||||
this.dialogRef.close(null);
|
this.dialogRef.close(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
save(): void {
|
save(): void {
|
||||||
|
|||||||
@ -30,11 +30,12 @@ import {
|
|||||||
RateLimitsDetailsDialogData
|
RateLimitsDetailsDialogData
|
||||||
} from '@home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component';
|
} from '@home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component';
|
||||||
import {
|
import {
|
||||||
rateLimitDialogTitleTranslationMap,
|
rateLimitsDialogTitleTranslationMap,
|
||||||
rateLimitLabelTranslationMap,
|
rateLimitsLabelTranslationMap,
|
||||||
RateLimitsType,
|
RateLimitsType,
|
||||||
stringToRateLimitsArray
|
stringToRateLimitsArray
|
||||||
} from '@shared/models/rate-limits.models';
|
} from '@shared/models/rate-limits.models';
|
||||||
|
import { isNull } from 'util';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-rate-limits',
|
selector: 'tb-rate-limits',
|
||||||
@ -81,7 +82,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.label = rateLimitLabelTranslationMap.get(this.type);
|
this.label = rateLimitsLabelTranslationMap.get(this.type);
|
||||||
this.rateLimitsFormGroup = this.fb.group({
|
this.rateLimitsFormGroup = this.fb.group({
|
||||||
rateLimits: [null, []]
|
rateLimits: [null, []]
|
||||||
});
|
});
|
||||||
@ -109,7 +110,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida
|
|||||||
if ($event) {
|
if ($event) {
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
}
|
}
|
||||||
const title = rateLimitDialogTitleTranslationMap.get(this.type);
|
const title = rateLimitsDialogTitleTranslationMap.get(this.type);
|
||||||
this.dialog.open<RateLimitsDetailsDialogComponent, RateLimitsDetailsDialogData,
|
this.dialog.open<RateLimitsDetailsDialogComponent, RateLimitsDetailsDialogData,
|
||||||
string>(RateLimitsDetailsDialogComponent, {
|
string>(RateLimitsDetailsDialogComponent, {
|
||||||
disableClose: true,
|
disableClose: true,
|
||||||
@ -120,7 +121,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida
|
|||||||
readonly: this.disabled
|
readonly: this.disabled
|
||||||
}
|
}
|
||||||
}).afterClosed().subscribe((result) => {
|
}).afterClosed().subscribe((result) => {
|
||||||
if (result) {
|
if (result || result === null) {
|
||||||
this.modelValue = result;
|
this.modelValue = result;
|
||||||
this.updateModel();
|
this.updateModel();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export enum RateLimitsType {
|
|||||||
TENANT_ENTITY_IMPORT_RATE_LIMIT = 'TENANT_ENTITY_IMPORT_RATE_LIMIT'
|
TENANT_ENTITY_IMPORT_RATE_LIMIT = 'TENANT_ENTITY_IMPORT_RATE_LIMIT'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const rateLimitLabelTranslationMap = new Map<RateLimitsType, string>(
|
export const rateLimitsLabelTranslationMap = new Map<RateLimitsType, string>(
|
||||||
[
|
[
|
||||||
[RateLimitsType.TENANT_MESSAGES, 'tenant-profile.rate-limits.transport-tenant-msg'],
|
[RateLimitsType.TENANT_MESSAGES, 'tenant-profile.rate-limits.transport-tenant-msg'],
|
||||||
[RateLimitsType.TENANT_TELEMETRY_MESSAGES, 'tenant-profile.rate-limits.transport-tenant-telemetry-msg'],
|
[RateLimitsType.TENANT_TELEMETRY_MESSAGES, 'tenant-profile.rate-limits.transport-tenant-telemetry-msg'],
|
||||||
@ -53,7 +53,7 @@ export const rateLimitLabelTranslationMap = new Map<RateLimitsType, string>(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
export const rateLimitDialogTitleTranslationMap = new Map<RateLimitsType, string>(
|
export const rateLimitsDialogTitleTranslationMap = new Map<RateLimitsType, string>(
|
||||||
[
|
[
|
||||||
[RateLimitsType.TENANT_MESSAGES, 'tenant-profile.rate-limits.edit-transport-tenant-msg-title'],
|
[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'],
|
[RateLimitsType.TENANT_TELEMETRY_MESSAGES, 'tenant-profile.rate-limits.edit-transport-tenant-telemetry-msg-title'],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user