Skip to content

Commit

Permalink
Merge pull request #44 from kbss-cvut/1364-code-review
Browse files Browse the repository at this point in the history
[#1364] Minor code optimization.
  • Loading branch information
Saeedla authored Nov 10, 2020
2 parents 77f408b + 85464bc commit 0c9c7c9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/component/term/TermDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,12 @@ export class TermDetail extends EditableComponent<TermDetailProps, TermDetailSta
if (this.props.validationResults && this.props.validationResults[this.props.vocabulary.iri]) {
score = this.computeScore(this.props.validationResults[this.props.vocabulary.iri].filter(result => result.term.iri === this.props.term?.iri));
}
const emptyString = " ";
return <Badge color={this.setBadgeColor(score)}
className="term-quality-badge"
title={"The score of this term is " + score + "%. Click to see the validation results."}
title={(score !== undefined) ? this.props.formatMessage("term.badge.score.tooltip", {score}) : this.props.i18n("term.badge.no-score.tooltip")}
onClick={this.onBadgeClick}
> {emptyString}
</Badge>
>&nbsp;
</Badge>;
}

public render() {
Expand Down
4 changes: 4 additions & 0 deletions src/component/term/Terms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
.term-quality-badge {
margin-right: 0.5rem;
cursor: pointer;
width: 0.1rem;
height: 0.1rem;
position: relative;
top: 0.35rem;
}
2 changes: 2 additions & 0 deletions src/i18n/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ export default {
"term.metadata.status.help" : "Rozpracovaný pojem není připraven k používání, zatímco schválený ano.",
"term.metadata.types.select.placeholder": "Vyberte typ",
"term.removed.message": "Pojem by odstraněn.",
"term.badge.score.tooltip": "Skóre tohoto pojmu je {score}%. Klikněte pro zobrazení výsledků kontroly",
"term.badge.no-score.tooltip": "Pro tento pojem není skóre k dispozici",

"glossary.title": "Pojmy",
"glossary.new": "Nový pojem",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ export default {
"term.metadata.status.help" : "Draft term is not ready to be used yet, while Confirmed term is.",
"term.metadata.types.select.placeholder": "Select type",
"term.removed.message": "Term successfully removed.",
"term.badge.score.tooltip": "The score of this term is {score}%. Click to see the validation results",
"term.badge.no-score.tooltip": "There is no available score for this term",

"glossary.title": "Terms",
"glossary.new": "New Term",
Expand Down

0 comments on commit 0c9c7c9

Please sign in to comment.