Skip to content

Commit

Permalink
Update according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
nilscognite committed Aug 6, 2024
1 parent 5f24ec6 commit 448d21e
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,26 +93,16 @@ export abstract class BaseFilterCommand extends RenderTargetCommand {
if (this._children === undefined) {
return this.getNoneLabel(translate);
}
let label = '';
let counter = 0;
for (const child of this._children) {
if (!child.isChecked) {
continue;
}
if (counter > 0) {
label = label.concat(', ');
}
label = label.concat(child.getLabel(translate));
counter++;
}
const selected = this._children.filter((child) => child.isChecked);
const counter = selected.length;
if (counter === 0) {
return this.getNoneLabel(translate);
}
if (counter === this._children.length) {
return this.getAllLabel(translate);
}
if (counter === 1) {
return label;
return selected[0].getLabel(translate);
}
return counter.toString() + ' ' + this.getSelected(translate);
}
Expand Down

0 comments on commit 448d21e

Please sign in to comment.