Skip to content

Commit

Permalink
String concatenation & remove uppecase code
Browse files Browse the repository at this point in the history
  • Loading branch information
3lviend committed Sep 27, 2024
1 parent 1da036d commit 76234da
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
9 changes: 4 additions & 5 deletions public/js/hit.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,19 @@ export default class extends Component {
}

headerJSX() {
var length = `length: ${this.hitLength().toLocaleString()}`;
var meta = length.charAt(0).toUpperCase() + length.slice(1);
var meta = `Length: ${this.hitLength().toLocaleString()}`;

if (this.props.showQueryCrumbs && this.props.showHitCrumbs) {
// Multiper queries, multiple hits
meta = `hit ${this.props.hit.number} of query ${this.props.query.number}. ` + meta;
meta = `hit ${this.props.hit.number} of query ${this.props.query.number}. ${meta}`;
}
else if (this.props.showQueryCrumbs && !this.props.showHitCrumbs) {
// Multiple queries, single hit
meta = `the only hit of query ${this.props.query.number}. ` + meta;
meta = `the only hit of query ${this.props.query.number}. ${meta}`;
}
else if (!this.props.showQueryCrumbs && this.props.showHitCrumbs) {
// Single query, multiple hits
meta = `hit ${this.props.hit.number}. ` + meta;
meta = `hit ${this.props.hit.number}. ${meta}`;
}

return <div className="section-header border-b border-seqorange flex flex-col sm:flex-row sm:justify-between w-full">
Expand Down
5 changes: 2 additions & 3 deletions public/js/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ export class ReportQuery extends Component {
return this.props.query.hits.length;
}
headerJSX() {
var length = `length: ${this.queryLength().toLocaleString()}`;
var meta = length.charAt(0).toUpperCase() + length.slice(1);
var meta = `Length: ${this.queryLength().toLocaleString()}`;

if (this.props.showQueryCrumbs) {
meta = `query ${this.props.query.number}. ` + meta;
meta = `query ${this.props.query.number}. ${meta}`;
}
return <div className="section-header border-b border-seqorange justify-between w-full flex flex-col sm:flex-row gap-4">
<h3 className="text-base cursor-pointer flex flex-col sm:flex-row items-start">
Expand Down
2 changes: 1 addition & 1 deletion public/sequenceserver-report.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/sequenceserver-report.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/sequenceserver-search.min.js.map

Large diffs are not rendered by default.

0 comments on commit 76234da

Please sign in to comment.