From 3b2daf1bc836e2fc8eff5c0a8af094da54757226 Mon Sep 17 00:00:00 2001 From: sanke1 <22073083+sankerust@users.noreply.github.com> Date: Tue, 26 Feb 2019 18:14:13 +0300 Subject: [PATCH] Change help section in analytics tab (#194) --- .../controllers/analytic_controller.ts | 3 +++ .../graph_panel/partials/help_section.html | 25 +++++++++++++++++ .../graph_panel/partials/tab_analytics.html | 27 +------------------ tests/setup_tests.ts | 2 ++ 4 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 src/panel/graph_panel/partials/help_section.html diff --git a/src/panel/graph_panel/controllers/analytic_controller.ts b/src/panel/graph_panel/controllers/analytic_controller.ts index 21c5595..3f60b65 100644 --- a/src/panel/graph_panel/controllers/analytic_controller.ts +++ b/src/panel/graph_panel/controllers/analytic_controller.ts @@ -14,6 +14,7 @@ import { SegmentsSet } from '../models/segment_set'; import { SegmentArray } from '../models/segment_array'; import { ServerInfo } from '../models/info'; import { Threshold, Condition } from '../models/threshold'; +import text from '../partials/help_section.html'; import { ANALYTIC_UNIT_COLORS, @@ -60,6 +61,8 @@ export class AnalyticController { // this.analyticUnits.forEach(a => this.runEnabledWaiter(a)); } + get helpSectionText() { return text; } + getSegmentsSearcher(): AnalyticSegmentsSearcher { return this._segmentsSearcher.bind(this); } diff --git a/src/panel/graph_panel/partials/help_section.html b/src/panel/graph_panel/partials/help_section.html new file mode 100644 index 0000000..4b1dd26 --- /dev/null +++ b/src/panel/graph_panel/partials/help_section.html @@ -0,0 +1,25 @@ +
+  For usage instructions:
+  Visit our Wiki page.
+  
+  If you encounter any problems:
+  Look for solution or create a new Issue here.
+  
+  Available labeling patterns examples:
+  1) General: patterns in your data that don't fall under any of provided built-in patterns.
+  
+  2) Peaks: a sharp increase to a certain single value, followed by a return to the original value.
+  
+  
+  
+  3) Troughs: a sharp decrease to a certain single value, followed by a return to the original value.
+  
+  
+  4) Jumps: increase to a certain value without returning to the original state.
+  
+  
+  5) Drops: decrease to a certain value without returning to the original state.
+  
+  
+  6) Custom: any custom model created and imported by you.
+
diff --git a/src/panel/graph_panel/partials/tab_analytics.html b/src/panel/graph_panel/partials/tab_analytics.html index ef57a28..5846c38 100644 --- a/src/panel/graph_panel/partials/tab_analytics.html +++ b/src/panel/graph_panel/partials/tab_analytics.html @@ -200,30 +200,5 @@ -
-
-    For usage instructions:
-        Visit our Wiki page.
-
-    If you encounter any problems:
-        Look for solution or create a new Issue here.
-
-    Available labeling patterns examples:
-      1) General: patterns in your data that don't fall under any of provided built-in patterns.
-
-      2) Peaks: a sharp increase to a certain single value, followed by a return to the original value.
-      
-
-      3) Troughs: a sharp decrease to a certain single value, followed by a return to the original value.
-      
-
-      4) Jumps: increase to a certain value without returning to the original state.
-      
-
-      5) Drops: decrease to a certain value without returning to the original state.
-      
-
-      6) Custom: any custom model created and imported by you.
-      
-
+
diff --git a/tests/setup_tests.ts b/tests/setup_tests.ts index 0d55b96..46dfac2 100644 --- a/tests/setup_tests.ts +++ b/tests/setup_tests.ts @@ -25,5 +25,7 @@ analyticService.postNewItem = async function (newItem: AnalyticUnit, metric: Met export const analyticController = new AnalyticController({}, analyticService, new Emitter()); +jest.mock('../src/panel/graph_panel/partials/help_section.html', () => ''); + console.log = jest.fn(); console.error = jest.fn();