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 035a5c6317..dc9da182ef 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,7 +32,7 @@
diff --git a/ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts b/ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts
index 320afd1dc4..16c5ad29b0 100644
--- a/ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts
+++ b/ui-ngx/src/app/shared/pipe/key-value-not-empty.pipe.ts
@@ -14,15 +14,31 @@
/// limitations under the License.
///
-import { Pipe, PipeTransform } from '@angular/core';
+import { KeyValueChanges, KeyValueDiffer, KeyValueDiffers, Pipe, PipeTransform } from '@angular/core';
+import { KeyValue, KeyValuePipe } from "@angular/common";
@Pipe({
- name: 'keyValueIsNotEmpty'
+ name: 'keyValueIsNotEmpty',
})
-export class KeyValueIsNotEmptyPipe implements PipeTransform {
- transform(obj: Record): Record {
- return Object.fromEntries(
- Object.entries(obj).filter(([_, value]) => value !== null && value !== undefined)
- );
+export class KeyValueIsNotEmptyPipe extends KeyValuePipe implements PipeTransform {
+ private difference!: KeyValueDiffer;
+
+ constructor(private readonly keyValueDiffers: KeyValueDiffers) {
+ super(keyValueDiffers);
+ }
+
+ transform(
+ input: Record,
+ compareFn?: (a: KeyValue, b: KeyValue) => number
+ ): KeyValue[] & null {
+ super.transform(input, compareFn);
+ this.difference ??= this.keyValueDiffers.find(input).create();
+ const differChanges: KeyValueChanges | null = this.difference.diff(input as any);
+ if (differChanges) {
+ console.log(differChanges)
+ const filteredEntries = [...Object.entries(input)]
+ .filter(([_, value]) => value !== null && value !== undefined);
+ return super.transform(new Map(filteredEntries), compareFn) as KeyValue[] & null;
+ }
}
}