From 9d86032a6f81c9cbf1c186fb3a4bc1313641672b Mon Sep 17 00:00:00 2001 From: Ludek Novy <13610612+ludeknovy@users.noreply.github.com> Date: Tue, 15 Feb 2022 13:24:44 +0100 Subject: [PATCH] generate share token scenario settings (#227) --- .../scenario-settings.component.css | 2 +- .../scenario-settings.component.html | 12 ++++++++++++ .../scenario-settings/scenario-settings.component.ts | 9 ++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/app/scenario/scenario-settings/scenario-settings.component.css b/src/app/scenario/scenario-settings/scenario-settings.component.css index b03f3835..8a5233dd 100644 --- a/src/app/scenario/scenario-settings/scenario-settings.component.css +++ b/src/app/scenario/scenario-settings/scenario-settings.component.css @@ -7,5 +7,5 @@ } .desc { - padding-bottom: 20px; + padding-bottom: 10px; } diff --git a/src/app/scenario/scenario-settings/scenario-settings.component.html b/src/app/scenario/scenario-settings/scenario-settings.component.html index 66f6d567..3684985e 100644 --- a/src/app/scenario/scenario-settings/scenario-settings.component.html +++ b/src/app/scenario/scenario-settings/scenario-settings.component.html @@ -85,6 +85,18 @@
Delete sample data after processing
+
+
Generate share token automatically
+
+ When enabled the API will return share token upon new test report upload.
+
+
+ + +
+
+
+ diff --git a/src/app/scenario/scenario-settings/scenario-settings.component.ts b/src/app/scenario/scenario-settings/scenario-settings.component.ts index 945ed9ea..29b9a5da 100644 --- a/src/app/scenario/scenario-settings/scenario-settings.component.ts +++ b/src/app/scenario/scenario-settings/scenario-settings.component.ts @@ -28,6 +28,7 @@ export class SettingsScenarioComponent implements OnInit { zeroErrorToleranceEnabled: null, deleteSamples: null, keepTestRunsPeriod: null, + generateShareToken: null, }; params; @@ -111,6 +112,9 @@ export class SettingsScenarioComponent implements OnInit { this.formControls.keepTestRunsPeriod = new FormControl(settings.keepTestRunsPeriod, [ Validators.required ]); + this.formControls.generateShareToken = new FormControl(settings.generateShareToken, [ + Validators.required + ]) } createForm() { @@ -124,6 +128,7 @@ export class SettingsScenarioComponent implements OnInit { zeroErrorToleranceEnabled: this.formControls.zeroErrorToleranceEnabled, deleteSamples: this.formControls.deleteSamples, keepTestRunsPeriod: this.formControls.keepTestRunsPeriod, + generateShareToken: this.formControls.generateShareToken, }); } @@ -137,8 +142,9 @@ export class SettingsScenarioComponent implements OnInit { const { scenarioName, analysisEnabled, thresholdEnabled, thresholdErrorRate, - thresholdPercentile, thresholdThroughput, deleteSamples, zeroErrorToleranceEnabled, keepTestRunsPeriod + thresholdPercentile, thresholdThroughput, deleteSamples, zeroErrorToleranceEnabled, keepTestRunsPeriod, generateShareToken } = this.scenarioSettingsForm.value; + console.log(this.scenarioSettingsForm.value) const { projectName, scenarioName: currentScenarioName } = this.params; const body = { scenarioName, @@ -146,6 +152,7 @@ export class SettingsScenarioComponent implements OnInit { zeroErrorToleranceEnabled, keepTestRunsPeriod, deleteSamples, + generateShareToken, thresholds: { enabled: thresholdEnabled, errorRate: parseFloat(thresholdErrorRate),