Skip to content

Commit

Permalink
generate share token scenario settings (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Feb 15, 2022
1 parent cf94f6d commit 9d86032
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
}

.desc {
padding-bottom: 20px;
padding-bottom: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ <h6>Delete sample data after processing</h6>
</div>
</div>

<div class="form-sub">
<h6>Generate share token automatically</h6>
<div class="desc text-secondary"><i class="fas fa-info-circle"> </i>
<small> When enabled the API will return share token upon new test report upload.</small></div>
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="shareToken" formControlName="generateShareToken">
<label class="custom-control-label" for="shareToken">Enabled</label>
</div>
</div>
</div>

</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class SettingsScenarioComponent implements OnInit {
zeroErrorToleranceEnabled: null,
deleteSamples: null,
keepTestRunsPeriod: null,
generateShareToken: null,
};

params;
Expand Down Expand Up @@ -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() {
Expand All @@ -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,
});
}

Expand All @@ -137,15 +142,17 @@ 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,
analysisEnabled,
zeroErrorToleranceEnabled,
keepTestRunsPeriod,
deleteSamples,
generateShareToken,
thresholds: {
enabled: thresholdEnabled,
errorRate: parseFloat(thresholdErrorRate),
Expand Down

0 comments on commit 9d86032

Please sign in to comment.