Skip to content

Commit 17b0ce7

Browse files
committed
1 parent 6e3e632 commit 17b0ce7

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

codemods.log

Whitespace-only changes.

lefthook.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ pre-commit:
2222
glob: "*.scss"
2323
include: "app/assets/stylesheets|plugins/.+?/assets/stylesheets"
2424
run: yarn pprettier --list-different {staged_files}
25-
eslint:
26-
glob: "*.js"
27-
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
28-
run: yarn eslint -f compact --quiet {staged_files}
25+
# eslint:
26+
# glob: "*.js"
27+
# include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
28+
# run: yarn eslint -f compact --quiet {staged_files}
2929
ember-template-lint:
3030
glob: "*.hbs"
3131
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
@@ -49,8 +49,8 @@ lints:
4949
run: yarn pprettier --list-different **/*.js
5050
prettier-scss:
5151
run: yarn pprettier --list-different **/*.scss
52-
eslint:
53-
run: yarn eslint -f compact --quiet --ext .js .
52+
# eslint:
53+
# run: yarn eslint -f compact --quiet --ext .js .
5454
ember-template-lint:
5555
run: yarn run ember-template-lint .
5656
yaml-syntax:
Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,51 @@
1+
import classic from "ember-classic-decorator";
2+
import { tagName } from "@ember-decorators/component";
3+
import { equal } from "@ember/object/computed";
14
import Component from "@ember/component";
25
import I18n from "I18n";
36
import { action } from "@ember/object";
47
import discourseComputed from "discourse-common/utils/decorators";
5-
import { equal } from "@ember/object/computed";
68
import { getColors } from "discourse/plugins/poll/lib/chart-colors";
79
import { htmlSafe } from "@ember/template";
810
import { propertyEqual } from "discourse/lib/computed";
911

10-
export default Component.extend({
12+
@classic
13+
@tagName("")
14+
export default class PollBreakdownOption extends Component {
1115
// Arguments:
12-
option: null,
13-
index: null,
14-
totalVotes: null,
15-
optionsCount: null,
16-
displayMode: null,
17-
highlightedOption: null,
18-
onMouseOver: null,
19-
onMouseOut: null,
16+
option = null;
17+
18+
index = null;
19+
totalVotes = null;
20+
optionsCount = null;
21+
displayMode = null;
22+
highlightedOption = null;
23+
onMouseOver = null;
24+
onMouseOut = null;
2025

21-
tagName: "",
26+
@propertyEqual("highlightedOption", "index")
27+
highlighted;
2228

23-
highlighted: propertyEqual("highlightedOption", "index"),
24-
showPercentage: equal("displayMode", "percentage"),
29+
@equal("displayMode", "percentage")
30+
showPercentage;
2531

2632
@discourseComputed("option.votes", "totalVotes")
2733
percent(votes, total) {
2834
return I18n.toNumber((votes / total) * 100.0, { precision: 1 });
29-
},
35+
}
3036

3137
@discourseComputed("optionsCount")
3238
optionColors(optionsCount) {
3339
return getColors(optionsCount);
34-
},
40+
}
3541

3642
@discourseComputed("highlighted")
3743
colorBackgroundStyle(highlighted) {
3844
if (highlighted) {
3945
// TODO: Use CSS variables (#10341)
4046
return htmlSafe("background: rgba(0, 0, 0, 0.1);");
4147
}
42-
},
48+
}
4349

4450
@discourseComputed("highlighted", "optionColors", "index")
4551
colorPreviewStyle(highlighted, optionColors, index) {
@@ -48,7 +54,7 @@ export default Component.extend({
4854
: optionColors[index];
4955

5056
return htmlSafe(`background: ${color};`);
51-
},
57+
}
5258

5359
@action
5460
onHover(active) {
@@ -57,5 +63,5 @@ export default Component.extend({
5763
} else {
5864
this.onMouseOut();
5965
}
60-
},
61-
});
66+
}
67+
}

0 commit comments

Comments
 (0)