Skip to content

Commit

Permalink
empty string as default name instead of null (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Aug 6, 2023
1 parent 67f005f commit c9b57bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/graphs/label-trend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const labelTrendChartOptions = (data: LabelTrend) => {
labels: {
useHTML: true,
formatter: (ctx) => {
const name = data.chartSeries.name[ctx.pos]
const name = data.chartSeries.name[ctx.pos] || ""
return `${ctx.isFirst || ctx.isLast ? ctx.value : ""}<br><span>
<p>${name?.length > 20 ? name.substring(0, 15) + "...": name}</p>
</span>`;
Expand Down
10 changes: 5 additions & 5 deletions src/app/item-detail/label-trend/label-trend.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class LabelTrendComponent {

open(content) {
this.modalService.open(content, { size: "xl", windowClass: "label-modal d-print-none" }).result
.then((_) => { this.labelChartOption = null; }, () => { this.labelChartOption = null; });
.then(() => { this.labelChartOption = null; }, () => { this.labelChartOption = null; });
this.fetchTrendData();

this.labelApiService.fetchLabelMaxVu(
Expand All @@ -45,8 +45,8 @@ export class LabelTrendComponent {
this.params.id,
this.trendInput.labelName,
{ environment: this.trendInput.environment }
).subscribe(__ => {
this.vuFilters = __.result.filter((r) => r.count >= 2).map((r) => r.maxVu);
).subscribe(labelMaxVu => {
this.vuFilters = labelMaxVu.result.filter((r) => r.count >= 2).map((r) => r.maxVu);
});
}

Expand All @@ -65,8 +65,8 @@ export class LabelTrendComponent {
environment: this.trendInput.environment,
virtualUsers
}
).subscribe((_) => {
this.labelChartOption = _.chartSeries.timePoints.length >= 2 ? labelTrendChartOptions(_) : emptyChart();
).subscribe((labelTrend) => {
this.labelChartOption = labelTrend.chartSeries.timePoints.length >= 2 ? labelTrendChartOptions(labelTrend) : emptyChart();
this.updateFlag = true;
});
}
Expand Down

0 comments on commit c9b57bd

Please sign in to comment.