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 {
 | 
			
		||||
    this.dialogRef.close(null);
 | 
			
		||||
    this.dialogRef.close(false);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  save(): void {
 | 
			
		||||
 | 
			
		||||
@ -30,11 +30,12 @@ import {
 | 
			
		||||
  RateLimitsDetailsDialogData
 | 
			
		||||
} from '@home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component';
 | 
			
		||||
import {
 | 
			
		||||
  rateLimitDialogTitleTranslationMap,
 | 
			
		||||
  rateLimitLabelTranslationMap,
 | 
			
		||||
  rateLimitsDialogTitleTranslationMap,
 | 
			
		||||
  rateLimitsLabelTranslationMap,
 | 
			
		||||
  RateLimitsType,
 | 
			
		||||
  stringToRateLimitsArray
 | 
			
		||||
} from '@shared/models/rate-limits.models';
 | 
			
		||||
import { isNull } from 'util';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'tb-rate-limits',
 | 
			
		||||
@ -81,7 +82,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.label = rateLimitLabelTranslationMap.get(this.type);
 | 
			
		||||
    this.label = rateLimitsLabelTranslationMap.get(this.type);
 | 
			
		||||
    this.rateLimitsFormGroup = this.fb.group({
 | 
			
		||||
      rateLimits: [null, []]
 | 
			
		||||
    });
 | 
			
		||||
@ -109,7 +110,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida
 | 
			
		||||
    if ($event) {
 | 
			
		||||
      $event.stopPropagation();
 | 
			
		||||
    }
 | 
			
		||||
    const title = rateLimitDialogTitleTranslationMap.get(this.type);
 | 
			
		||||
    const title = rateLimitsDialogTitleTranslationMap.get(this.type);
 | 
			
		||||
    this.dialog.open<RateLimitsDetailsDialogComponent, RateLimitsDetailsDialogData,
 | 
			
		||||
      string>(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();
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -36,7 +36,7 @@ export enum RateLimitsType {
 | 
			
		||||
  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_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_TELEMETRY_MESSAGES, 'tenant-profile.rate-limits.edit-transport-tenant-telemetry-msg-title'],
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user