From 6de1e359a2bade386445315e3befbdb65de13356 Mon Sep 17 00:00:00 2001 From: Frederico Minuzzi Date: Mon, 3 Jun 2024 12:01:29 -0300 Subject: [PATCH 1/2] Added a variable to allow alert functionality to work out of the box for the RTLS/Marker Kickstarter. --- src/cleanAnalysis.ts | 2 +- src/services/devicesExport.ts | 9 +++++++++ src/startAnalysis.ts | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cleanAnalysis.ts b/src/cleanAnalysis.ts index 2a60f80..5bcb500 100644 --- a/src/cleanAnalysis.ts +++ b/src/cleanAnalysis.ts @@ -15,7 +15,7 @@ const config: IExport = { // Entities that will be copied from the application. // entities: ["dictionaries"], entities: ["devices", "analysis", "dashboards", "accessManagement", "run_buttons", "actions", "dictionaries"], - data: ["list_devtype_id"], + data: ["list_devtype_id", "alert_settings"], // added alert_settings for the alert feature in RTLS Marker kickstarter // Account that entities will be copied from. export: { diff --git a/src/services/devicesExport.ts b/src/services/devicesExport.ts index 0feb04b..0dcb845 100644 --- a/src/services/devicesExport.ts +++ b/src/services/devicesExport.ts @@ -41,6 +41,15 @@ async function deviceExport(account: Account, import_account: Account, export_ho variables: config.data, qty: 9999, }); + + console.log({ + variables: config.data, + qty: 9999, + }); + + console.log(device.info.name); + console.log(data); + if (data.length > 0) { device.sendData(data).catch(console.error); } diff --git a/src/startAnalysis.ts b/src/startAnalysis.ts index 5fc879d..eb1adb0 100644 --- a/src/startAnalysis.ts +++ b/src/startAnalysis.ts @@ -23,7 +23,7 @@ const config: IExport = { // Entities that will be copied from the application. // entities: ["dictionaries"], entities: ["devices", "analysis", "dashboards", "accessManagement", "run_buttons", "actions", "dictionaries"], - data: ["list_devtype_id"], + data: ["list_devtype_id", "alert_settings"], // added alert_settings for the alert feature in RTLS Marker kickstarter // Account that entities will be copied from. export: { From 92ddc5452eb69dfad66dbc63041783e48b2c294d Mon Sep 17 00:00:00 2001 From: Frederico Minuzzi Date: Mon, 3 Jun 2024 12:09:34 -0300 Subject: [PATCH 2/2] changed enabled to published --- src/start.ts | 2 +- src/startAnalysis.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/start.ts b/src/start.ts index e407171..8c738a3 100644 --- a/src/start.ts +++ b/src/start.ts @@ -32,7 +32,7 @@ async function startImport() { if (import_rule.includes("run_buttons")) { const run = await import_account.run.info(); if (!run || !run.name) { - throw "Exported account doesn't have RUN enabled. Not possible to import RUN Buttons."; + throw "Exported account doesn't have RUN published. Not possible to import RUN Buttons."; } } diff --git a/src/startAnalysis.ts b/src/startAnalysis.ts index eb1adb0..13b1ab1 100644 --- a/src/startAnalysis.ts +++ b/src/startAnalysis.ts @@ -121,7 +121,7 @@ async function startImport(context: TagoContext, scope: Data[]): Promise { if (import_rule.includes("run_buttons")) { const run = await import_account.run.info(); if (!run || !run.name) { - return Promise.reject(await validate("The account doesn't have RUN enabled. Not possible to import RUN Buttons.", "danger")); + return Promise.reject(await validate("The account doesn't have RUN published. Not possible to import RUN Buttons.", "danger")); } }