Check related rulechain during unassing from edge
This commit is contained in:
parent
880ee028ab
commit
ffc18489c4
@ -409,21 +409,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
addRuleChainsToEdge($event: Event) {
|
private checkMissingToRelatedRuleChains() {
|
||||||
if ($event) {
|
|
||||||
$event.stopPropagation();
|
|
||||||
}
|
|
||||||
this.dialog.open<AddEntitiesToEdgeDialogComponent, AddEntitiesToEdgeDialogData,
|
|
||||||
boolean>(AddEntitiesToEdgeDialogComponent, {
|
|
||||||
disableClose: true,
|
|
||||||
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
|
|
||||||
data: {
|
|
||||||
edgeId: this.config.componentsData.edgeId,
|
|
||||||
entityType: EntityType.RULE_CHAIN
|
|
||||||
}
|
|
||||||
}).afterClosed()
|
|
||||||
.subscribe((res) => {
|
|
||||||
if (res) {
|
|
||||||
this.edgeService.findMissingToRelatedRuleChains(this.config.componentsData.edgeId).subscribe(
|
this.edgeService.findMissingToRelatedRuleChains(this.config.componentsData.edgeId).subscribe(
|
||||||
(missingRuleChains) => {
|
(missingRuleChains) => {
|
||||||
if (missingRuleChains && Object.keys(missingRuleChains).length > 0) {
|
if (missingRuleChains && Object.keys(missingRuleChains).length > 0) {
|
||||||
@ -447,6 +433,24 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addRuleChainsToEdge($event: Event) {
|
||||||
|
if ($event) {
|
||||||
|
$event.stopPropagation();
|
||||||
|
}
|
||||||
|
this.dialog.open<AddEntitiesToEdgeDialogComponent, AddEntitiesToEdgeDialogData,
|
||||||
|
boolean>(AddEntitiesToEdgeDialogComponent, {
|
||||||
|
disableClose: true,
|
||||||
|
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
|
||||||
|
data: {
|
||||||
|
edgeId: this.config.componentsData.edgeId,
|
||||||
|
entityType: EntityType.RULE_CHAIN
|
||||||
|
}
|
||||||
|
}).afterClosed()
|
||||||
|
.subscribe((res) => {
|
||||||
|
if (res) {
|
||||||
|
this.checkMissingToRelatedRuleChains();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -465,7 +469,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
|
|||||||
if (res) {
|
if (res) {
|
||||||
this.ruleChainService.unassignRuleChainFromEdge(this.config.componentsData.edgeId, ruleChain.id.id).subscribe(
|
this.ruleChainService.unassignRuleChainFromEdge(this.config.componentsData.edgeId, ruleChain.id.id).subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.config.updateData(this.config.componentsData.ruleChainScope !== 'tenant');
|
this.checkMissingToRelatedRuleChains();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -493,7 +497,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
|
|||||||
);
|
);
|
||||||
forkJoin(tasks).subscribe(
|
forkJoin(tasks).subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.config.updateData();
|
this.checkMissingToRelatedRuleChains();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user