Skip to content

Commit

Permalink
Query widget number-verb number agreement (#1683)
Browse files Browse the repository at this point in the history
* Query widget number-verb agreement

* Missing this, whoops
  • Loading branch information
mccahan authored Oct 2, 2024
1 parent 69b49c1 commit c0bee7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Resources/queries/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@
connections.add(statement.connection);
}

const $text = $('<span />').text(`${data.nb_statements} statements were executed`);
const $text = $('<span />').text(`${data.nb_statements} ${data.nb_statements == 1 ? 'statement was' : 'statements were'} executed`);
if (data.nb_excluded_statements) {
$text.append(`, ${data.nb_excluded_statements} have been excluded`);
$text.append(`, ${data.nb_excluded_statements} ${data.nb_excluded_statements == 1 ? 'has' : 'have'} been excluded`);
}
if (data.nb_failed_statements > 0 || this.duplicateQueries.size > 0) {
const details = [];
if (data.nb_failed_statements) {
details.push(`${data.nb_failed_statements} failed`);
}
if (this.duplicateQueries.size > 0) {
details.push(`${this.duplicateQueries.size} duplicates`);
details.push(`${this.duplicateQueries.size} ${this.duplicateQueries.size == 1 ? 'duplicate' : 'duplicates'}`);
}
$text.append(` (${details.join(', ')})`);
}
Expand Down

0 comments on commit c0bee7c

Please sign in to comment.