diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-service-rpc-connector-templates.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-service-rpc-connector-templates.component.html index c12355e8d4..035a5c6317 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-service-rpc-connector-templates.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-service-rpc-connector-templates.component.html @@ -32,13 +32,12 @@ -
diff --git a/ui-ngx/src/app/shared/pipe/is-exist.pipe.ts b/ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts similarity index 70% rename from ui-ngx/src/app/shared/pipe/is-exist.pipe.ts rename to ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts index f661048be6..320afd1dc4 100644 --- a/ui-ngx/src/app/shared/pipe/is-exist.pipe.ts +++ b/ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts @@ -17,10 +17,12 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'isExist' + name: 'keyValueIsNotEmpty' }) -export class IsExistPipe implements PipeTransform { - transform(value: unknown): boolean { - return value !== null && value !== undefined; +export class KeyValueIsNotEmptyPipe implements PipeTransform { + transform(obj: Record): Record { + return Object.fromEntries( + Object.entries(obj).filter(([_, value]) => value !== null && value !== undefined) + ); } } diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index 9b8c930c2f..25bcd56b47 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -219,7 +219,7 @@ import { ImageGalleryDialogComponent } from '@shared/components/image/image-gall import { RuleChainSelectPanelComponent } from '@shared/components/rule-chain/rule-chain-select-panel.component'; import { WidgetButtonComponent } from '@shared/components/button/widget-button.component'; import { HexInputComponent } from '@shared/components/color-picker/hex-input.component'; -import { IsExistPipe } from "@shared/pipe/is-exist.pipe"; +import { KeyValueIsNotEmptyPipe } from "@shared/pipe/key-value-not-empty.pipe"; export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) { return markedOptionsService; @@ -367,7 +367,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) ShortNumberPipe, SelectableColumnsPipe, KeyboardShortcutPipe, - IsExistPipe, + KeyValueIsNotEmptyPipe, TbJsonToStringDirective, JsonObjectEditDialogComponent, HistorySelectorComponent, @@ -621,7 +621,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) SafePipe, ShortNumberPipe, SelectableColumnsPipe, - IsExistPipe, + KeyValueIsNotEmptyPipe, RouterModule, TranslateModule, JsonObjectEditDialogComponent,