kytos-ng / maintenance

Kytos Maintenance Window NApp
https://kytos-ng.github.io/api/maintenance.html
0 stars 7 forks source link

UI: wrong name MW attribute - link should be links #69

Closed italovalcy closed 1 year ago

italovalcy commented 1 year ago

Hi,

The MW attribute for links under maintenance is being sent wrongly from the UI to backend: instead of link it should be links in https://github.com/kytos-ng/maintenance/blob/99e69d5d7725a707b223399ef014437c2ec06a35/ui/k-toolbar/main.kytos#L123

As a consequence, the MW is not created in the UI when only links are provided (see image below)

Screenshot 2023-02-06 at 3 10 10 PM

italovalcy commented 1 year ago

the following patch seems to fix the issue:

diff --git a/ui/k-toolbar/main.kytos b/ui/k-toolbar/main.kytos
index 130c352..89a4775 100644
--- a/ui/k-toolbar/main.kytos
+++ b/ui/k-toolbar/main.kytos
@@ -120,7 +120,7 @@
                                           "start": self.start,
                                           "end": self.end,
                                           "switches": filteredSwitches,
-                                          "link": filteredLinks,
+                                          "links": filteredLinks,
                                           "interfaces": filteredInterfaces,
                                           "force": self.checked_list.includes("force"),
                     }),