@ -50,11 +50,7 @@ import { PageLink } from '@shared/models/page/page-link';
import { Edge } from '@shared/models/edge.models' ;
import { Edge } from '@shared/models/edge.models' ;
import { mergeMap } from 'rxjs/operators' ;
import { mergeMap } from 'rxjs/operators' ;
import { ItemType } from '@shared/models/iot-hub/iot-hub-item.models' ;
import { ItemType } from '@shared/models/iot-hub/iot-hub-item.models' ;
import {
import { IotHubActionsService } from '@home/components/iot-hub/iot-hub-actions.service' ;
TbIotHubAddItemDialogComponent ,
IotHubAddItemDialogData ,
IotHubAddItemDialogResult
} from '@home/components/iot-hub/iot-hub-add-item-dialog.component' ;
import { PageData } from '@shared/models/page/page-data' ;
import { PageData } from '@shared/models/page/page-data' ;
import { CustomTranslatePipe } from '@shared/pipe/custom-translate.pipe' ;
import { CustomTranslatePipe } from '@shared/pipe/custom-translate.pipe' ;
@ -69,6 +65,7 @@ export class RuleChainsTableConfigResolver {
private importExport : ImportExportService ,
private importExport : ImportExportService ,
private itembuffer : ItemBufferService ,
private itembuffer : ItemBufferService ,
private edgeService : EdgeService ,
private edgeService : EdgeService ,
private iotHubActions : IotHubActionsService ,
private translate : TranslateService ,
private translate : TranslateService ,
private datePipe : DatePipe ,
private datePipe : DatePipe ,
private router : Router ,
private router : Router ,
@ -303,16 +300,7 @@ export class RuleChainsTableConfigResolver {
addRuleChainFromIotHub() {
addRuleChainFromIotHub() {
const ruleChainScope = this . config . componentsData . ruleChainScope ;
const ruleChainScope = this . config . componentsData . ruleChainScope ;
const ruleChainType = ruleChainScope === 'edges' ? 'EDGE' : 'CORE' ;
const ruleChainType = ruleChainScope === 'edges' ? 'EDGE' : 'CORE' ;
const dialogRef = this . dialog . open ( TbIotHubAddItemDialogComponent , {
this . iotHubActions . addItem ( ItemType . RULE_CHAIN , { itemSubType : ruleChainType } ) . subscribe ( result = > {
panelClass : [ 'tb-dialog' , 'tb-fullscreen-dialog' ] ,
disableClose : true ,
autoFocus : false ,
data : {
itemType : ItemType.RULE_CHAIN ,
itemSubType : ruleChainType
} as IotHubAddItemDialogData
} ) ;
dialogRef . afterClosed ( ) . subscribe ( ( result : IotHubAddItemDialogResult ) = > {
if ( result ? . descriptor ? . type === 'RULE_CHAIN' && result . descriptor . ruleChainId ? . id ) {
if ( result ? . descriptor ? . type === 'RULE_CHAIN' && result . descriptor . ruleChainId ? . id ) {
const ruleChainId = result . descriptor . ruleChainId . id ;
const ruleChainId = result . descriptor . ruleChainId . id ;
if ( ruleChainScope === 'edges' ) {
if ( ruleChainScope === 'edges' ) {