|
|
|
@ -14,11 +14,11 @@ |
|
|
|
/// limitations under the License.
|
|
|
|
///
|
|
|
|
|
|
|
|
import { Component, forwardRef } from '@angular/core'; |
|
|
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; |
|
|
|
import { AliasFilterType, EntityAliasFilter } from '@shared/models/alias.models'; |
|
|
|
import { AliasEntityType, EntityType, entityTypeTranslations } from '@shared/models/entity-type.models'; |
|
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
|
import {Component, forwardRef} from '@angular/core'; |
|
|
|
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms'; |
|
|
|
import {AliasFilterType, EntityAliasFilter} from '@shared/models/alias.models'; |
|
|
|
import {AliasEntityType, EntityType, entityTypeTranslations} from '@shared/models/entity-type.models'; |
|
|
|
import {TranslateService} from '@ngx-translate/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-entity-filter-view', |
|
|
|
@ -101,6 +101,17 @@ export class EntityFilterViewComponent implements ControlValueAccessor { |
|
|
|
{deviceType}); |
|
|
|
} |
|
|
|
break; |
|
|
|
case AliasFilterType.edgeType: |
|
|
|
const edgeType = this.filter.edgeType; |
|
|
|
prefix = this.filter.edgeNameFilter; |
|
|
|
if (prefix && prefix.length) { |
|
|
|
this.filterDisplayValue = this.translate.instant('alias.filter-type-edge-type-and-name-description', |
|
|
|
{edgeType, prefix}); |
|
|
|
} else { |
|
|
|
this.filterDisplayValue = this.translate.instant('alias.filter-type-edge-type-description', |
|
|
|
{edgeType}); |
|
|
|
} |
|
|
|
break; |
|
|
|
case AliasFilterType.entityViewType: |
|
|
|
const entityView = this.filter.entityViewType; |
|
|
|
prefix = this.filter.entityViewNameFilter; |
|
|
|
@ -166,6 +177,7 @@ export class EntityFilterViewComponent implements ControlValueAccessor { |
|
|
|
break; |
|
|
|
case AliasFilterType.assetSearchQuery: |
|
|
|
case AliasFilterType.deviceSearchQuery: |
|
|
|
case AliasFilterType.edgeSearchQuery: |
|
|
|
case AliasFilterType.entityViewSearchQuery: |
|
|
|
allEntitiesText = this.translate.instant('alias.all-entities'); |
|
|
|
anyRelationText = this.translate.instant('alias.any-relation'); |
|
|
|
@ -207,6 +219,16 @@ export class EntityFilterViewComponent implements ControlValueAccessor { |
|
|
|
this.filterDisplayValue = this.translate.instant('alias.filter-type-device-search-query-description', |
|
|
|
translationValues |
|
|
|
); |
|
|
|
} else if (this.filter.type === AliasFilterType.edgeSearchQuery) { |
|
|
|
const edgeTypesQuoted = []; |
|
|
|
this.filter.edgeTypes.forEach((filterEdgeType) => { |
|
|
|
edgeTypesQuoted.push(`'${filterEdgeType}'`); |
|
|
|
}); |
|
|
|
const edgeTypesText = edgeTypesQuoted.join(', '); |
|
|
|
translationValues.edgeTypes = edgeTypesText; |
|
|
|
this.filterDisplayValue = this.translate.instant('alias.filter-type-edge-search-query-description', |
|
|
|
translationValues |
|
|
|
); |
|
|
|
} else if (this.filter.type === AliasFilterType.entityViewSearchQuery) { |
|
|
|
const entityViewTypesQuoted = []; |
|
|
|
this.filter.entityViewTypes.forEach((filterEntityViewType) => { |
|
|
|
|