Browse Source

[PROD-3656] [FIX] added pipe

pull/11012/head
mpetrov 2 years ago
parent
commit
24214688cb
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-service-rpc-connector-templates.component.html
  2. 10
      ui-ngx/src/app/shared/pipe/is-exist.pipe.ts
  3. 3
      ui-ngx/src/app/shared/shared.module.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-service-rpc-connector-templates.component.html

@ -37,7 +37,7 @@
[ngTemplateOutletContext]="{ $implicit: config, innerValue: false }">
</ng-container>
<ng-template #RPCTemplateRef let-config let-innerValue='innerValue'>
<div *ngIf="config.value !== null"
<div *ngIf="config.value | isExist"
[fxLayout]="isObject(config.value) ? 'column': 'row'"
[fxLayoutAlign]="!isObject(config.value) ? 'space-between center' : ''"
[ngStyle]="{'padding-left': innerValue ? '16px': '0'}"

10
ui-ngx/src/app/shared/pipe/is-exist.pipe.ts

@ -0,0 +1,10 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'isExist'
})
export class IsExistPipe implements PipeTransform {
transform(value: unknown): boolean {
return value !== null && value !== undefined;
}
}

3
ui-ngx/src/app/shared/shared.module.ts

@ -219,6 +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";
export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService) {
return markedOptionsService;
@ -366,6 +367,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
ShortNumberPipe,
SelectableColumnsPipe,
KeyboardShortcutPipe,
IsExistPipe,
TbJsonToStringDirective,
JsonObjectEditDialogComponent,
HistorySelectorComponent,
@ -619,6 +621,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
SafePipe,
ShortNumberPipe,
SelectableColumnsPipe,
IsExistPipe,
RouterModule,
TranslateModule,
JsonObjectEditDialogComponent,

Loading…
Cancel
Save