From 208c0d10e82ee2ad2458738adf8e398fd5a891f9 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 1 Mar 2021 10:35:28 +0000 Subject: [PATCH] Ent 6879 separar en alertas de inventario el selector de grupos de acl del selector de grupos sobre el que se aplican las alertas --- pandora_console/extras/mr/45.sql | 4 +++- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 1 + pandora_console/pandoradb.sql | 1 + visual_console_client/src/Item.ts | 2 +- visual_console_client/src/items/Line.ts | 12 ++++++++---- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pandora_console/extras/mr/45.sql b/pandora_console/extras/mr/45.sql index 584908f813..a1259e4a77 100644 --- a/pandora_console/extras/mr/45.sql +++ b/pandora_console/extras/mr/45.sql @@ -1,6 +1,8 @@ START TRANSACTION; +ALTER TABLE `tinventory_alert` ADD COLUMN `alert_groups` TEXT NOT NULL; +UPDATE `tinventory_alert` t1 INNER JOIN `tinventory_alert` t2 ON t1.id = t2.id SET t1.alert_groups = t2.id_group; + ALTER TABLE `tnotification_source` ADD COLUMN `subtype_blacklist` TEXT; COMMIT; - diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 64683c2096..8f4cbf6209 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -363,6 +363,7 @@ CREATE TABLE IF NOT EXISTS `tinventory_alert`( `last_fired` text NOT NULL default '', `disable_event` tinyint(1) UNSIGNED default 0, `enabled` tinyint(1) UNSIGNED default 1, + `alert_groups` text NOT NULL default '', PRIMARY KEY (`id`), FOREIGN KEY (`id_module_inventory`) REFERENCES tmodule_inventory(`id_module_inventory`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 32d025b128..ce3b347df2 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2653,6 +2653,7 @@ CREATE TABLE IF NOT EXISTS `tinventory_alert`( `last_fired` text NOT NULL default '', `disable_event` tinyint(1) UNSIGNED default 0, `enabled` tinyint(1) UNSIGNED default 1, + `alert_groups` text NOT NULL default '', PRIMARY KEY (`id`), FOREIGN KEY (`id_module_inventory`) REFERENCES tmodule_inventory(`id_module_inventory`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/visual_console_client/src/Item.ts b/visual_console_client/src/Item.ts index 0b8de44ef4..4aeb5f5c88 100644 --- a/visual_console_client/src/Item.ts +++ b/visual_console_client/src/Item.ts @@ -844,7 +844,7 @@ abstract class VisualConsoleItem { if ( prevProps && - (this.props.isLinkEnabled && prevProps.link !== this.props.link) + this.props.isLinkEnabled && prevProps.link !== this.props.link ) { if (this.props.link !== null) { this.elementRef.setAttribute("href", this.props.link); diff --git a/visual_console_client/src/items/Line.ts b/visual_console_client/src/items/Line.ts index d4c79aff70..2c39a3cb8b 100644 --- a/visual_console_client/src/items/Line.ts +++ b/visual_console_client/src/items/Line.ts @@ -446,10 +446,14 @@ export default class Line extends Item { } // Init the movement listeners. - this.initStartPositionMovementListener(startCircle, this.elementRef - .parentElement as HTMLElement); - this.initEndPositionMovementListener(endCircle, this.elementRef - .parentElement as HTMLElement); + this.initStartPositionMovementListener( + startCircle, + this.elementRef.parentElement as HTMLElement + ); + this.initEndPositionMovementListener( + endCircle, + this.elementRef.parentElement as HTMLElement + ); } else if (!this.moveMode) { this.stopStartPositionMovementListener(); // Remove circles.