Skip to content

Commit e3004f5

Browse files
committed
DEV: Update linting
1 parent bef709a commit e3004f5

File tree

8 files changed

+1247
-1345
lines changed

8 files changed

+1247
-1345
lines changed

Gemfile.lock

Lines changed: 60 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,93 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.1.3.3)
4+
activesupport (8.0.2)
55
base64
6+
benchmark (>= 0.3)
67
bigdecimal
7-
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
concurrent-ruby (~> 1.0, >= 1.3.1)
89
connection_pool (>= 2.2.5)
910
drb
1011
i18n (>= 1.6, < 2)
12+
logger (>= 1.4.2)
1113
minitest (>= 5.1)
12-
mutex_m
13-
tzinfo (~> 2.0)
14+
securerandom (>= 0.3)
15+
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
1417
ast (2.4.2)
1518
base64 (0.2.0)
16-
bigdecimal (3.1.8)
17-
concurrent-ruby (1.2.3)
18-
connection_pool (2.4.1)
19+
benchmark (0.4.0)
20+
bigdecimal (3.1.9)
21+
concurrent-ruby (1.3.5)
22+
connection_pool (2.5.0)
1923
drb (2.2.1)
20-
i18n (1.14.5)
24+
i18n (1.14.7)
2125
concurrent-ruby (~> 1.0)
22-
json (2.7.2)
23-
language_server-protocol (3.17.0.3)
24-
minitest (5.23.1)
25-
mutex_m (0.2.0)
26-
parallel (1.24.0)
27-
parser (3.3.1.0)
26+
json (2.10.2)
27+
language_server-protocol (3.17.0.4)
28+
lint_roller (1.1.0)
29+
logger (1.6.6)
30+
minitest (5.25.5)
31+
parallel (1.26.3)
32+
parser (3.3.7.1)
2833
ast (~> 2.4.1)
2934
racc
3035
prettier_print (1.2.1)
31-
racc (1.8.0)
32-
rack (3.0.12)
36+
racc (1.8.1)
37+
rack (3.1.12)
3338
rainbow (3.1.1)
34-
regexp_parser (2.9.2)
35-
rexml (3.3.9)
36-
rubocop (1.64.0)
39+
regexp_parser (2.10.0)
40+
rubocop (1.74.0)
3741
json (~> 2.3)
38-
language_server-protocol (>= 3.17.0)
42+
language_server-protocol (~> 3.17.0.2)
43+
lint_roller (~> 1.1.0)
3944
parallel (~> 1.10)
4045
parser (>= 3.3.0.2)
4146
rainbow (>= 2.2.2, < 4.0)
42-
regexp_parser (>= 1.8, < 3.0)
43-
rexml (>= 3.2.5, < 4.0)
44-
rubocop-ast (>= 1.31.1, < 2.0)
47+
regexp_parser (>= 2.9.3, < 3.0)
48+
rubocop-ast (>= 1.38.0, < 2.0)
4549
ruby-progressbar (~> 1.7)
46-
unicode-display_width (>= 2.4.0, < 3.0)
47-
rubocop-ast (1.31.3)
50+
unicode-display_width (>= 2.4.0, < 4.0)
51+
rubocop-ast (1.38.1)
4852
parser (>= 3.3.1.0)
49-
rubocop-capybara (2.20.0)
50-
rubocop (~> 1.41)
51-
rubocop-discourse (3.8.0)
53+
rubocop-capybara (2.22.1)
54+
lint_roller (~> 1.1)
55+
rubocop (~> 1.72, >= 1.72.1)
56+
rubocop-discourse (3.12.1)
5257
activesupport (>= 6.1)
53-
rubocop (>= 1.59.0)
54-
rubocop-capybara (>= 2.0.0)
55-
rubocop-factory_bot (>= 2.0.0)
56-
rubocop-rails (>= 2.25.0)
57-
rubocop-rspec (>= 2.25.0)
58-
rubocop-factory_bot (2.25.1)
59-
rubocop (~> 1.41)
60-
rubocop-rails (2.25.0)
58+
lint_roller (>= 1.1.0)
59+
rubocop (>= 1.73.2)
60+
rubocop-capybara (>= 2.22.0)
61+
rubocop-factory_bot (>= 2.27.0)
62+
rubocop-rails (>= 2.30.3)
63+
rubocop-rspec (>= 3.0.1)
64+
rubocop-rspec_rails (>= 2.31.0)
65+
rubocop-factory_bot (2.27.1)
66+
lint_roller (~> 1.1)
67+
rubocop (~> 1.72, >= 1.72.1)
68+
rubocop-rails (2.30.3)
6169
activesupport (>= 4.2.0)
70+
lint_roller (~> 1.1)
6271
rack (>= 1.1)
63-
rubocop (>= 1.33.0, < 2.0)
64-
rubocop-ast (>= 1.31.1, < 2.0)
65-
rubocop-rspec (2.29.2)
66-
rubocop (~> 1.40)
67-
rubocop-capybara (~> 2.17)
68-
rubocop-factory_bot (~> 2.22)
69-
rubocop-rspec_rails (~> 2.28)
70-
rubocop-rspec_rails (2.28.3)
71-
rubocop (~> 1.40)
72+
rubocop (>= 1.72.1, < 2.0)
73+
rubocop-ast (>= 1.38.0, < 2.0)
74+
rubocop-rspec (3.5.0)
75+
lint_roller (~> 1.1)
76+
rubocop (~> 1.72, >= 1.72.1)
77+
rubocop-rspec_rails (2.31.0)
78+
lint_roller (~> 1.1)
79+
rubocop (~> 1.72, >= 1.72.1)
80+
rubocop-rspec (~> 3.5)
7281
ruby-progressbar (1.13.0)
82+
securerandom (0.4.1)
7383
syntax_tree (6.2.0)
7484
prettier_print (>= 1.2.0)
7585
tzinfo (2.0.6)
7686
concurrent-ruby (~> 1.0)
77-
unicode-display_width (2.5.0)
87+
unicode-display_width (3.1.4)
88+
unicode-emoji (~> 4.0, >= 4.0.4)
89+
unicode-emoji (4.0.4)
90+
uri (1.0.3)
7891

7992
PLATFORMS
8093
ruby
@@ -84,4 +97,4 @@ DEPENDENCIES
8497
syntax_tree
8598

8699
BUNDLED WITH
87-
2.5.10
100+
2.6.6

assets/javascripts/discourse/adapters/teambuild-progress.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import RestAdapter from "discourse/adapters/rest";
22

33
export default class TeambuildProgressAdapter extends RestAdapter {
44
jsonMode = true;
5+
56
pathFor(store, type, username) {
67
return `/team-build/progress/${username}.json`;
78
}

assets/javascripts/discourse/adapters/teambuild-target.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import RestAdapter from "discourse/adapters/rest";
22

33
export default class TeambuildTargetAdapter extends RestAdapter {
44
jsonMode = true;
5+
56
pathFor(store, type, id) {
67
if (id) {
78
return `/team-build/targets/${id}.json`;
Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,83 @@
11
import Component from "@ember/component";
2-
import { computed } from "@ember/object";
2+
import { action, computed } from "@ember/object";
33
import { equal, or } from "@ember/object/computed";
44
import { underscore } from "@ember/string";
5+
import { tagName } from "@ember-decorators/component";
56
import { popupAjaxError } from "discourse/lib/ajax-error";
67
import { bufferedProperty } from "discourse/mixins/buffered-content";
78
import { Types } from "discourse/plugins/discourse-teambuild/discourse/models/teambuild-target";
89

9-
export default Component.extend(bufferedProperty("target"), {
10-
tagName: "",
11-
editSelected: false,
10+
@tagName("")
11+
export default class TeambuildTarget extends Component.extend(
12+
bufferedProperty("target")
13+
) {
14+
editSelected = false;
1215

13-
needsGroup: equal("buffered.target_type_id", Types.USER_GROUP),
16+
@equal("buffered.target_type_id", Types.USER_GROUP) needsGroup;
17+
@or("editSelected", "target.isNew") editing;
1418

15-
canMoveUp: computed("editing", "index", function () {
19+
@computed("editing", "index")
20+
get canMoveUp() {
1621
return !this.editing && this.index > 0;
17-
}),
22+
}
1823

19-
canMoveDown: computed("editing", "index", "length", function () {
24+
@computed("editing", "index", "length")
25+
get canMoveDown() {
2026
return !this.editing && this.index < this.length - 1;
21-
}),
27+
}
2228

23-
editing: or("editSelected", "target.isNew"),
24-
25-
targetTypes: computed(function () {
29+
@computed
30+
get targetTypes() {
2631
return Object.keys(Types).map((key) => {
2732
return { id: Types[key], name: underscore(key) };
2833
});
29-
}),
34+
}
3035

31-
saveDisabled: computed(
36+
@computed(
3237
"buffered.name",
3338
"target.isSaving",
3439
"needsGroup",
35-
"buffered.group_id",
36-
function () {
37-
if (this.target.isSaving) {
38-
return true;
39-
}
40-
let name = this.get("buffered.name");
41-
if (!name || name.length === 0) {
42-
return true;
43-
}
44-
if (this.needsGroup && !this.get("buffered.group_id")) {
45-
return true;
46-
}
47-
return false;
40+
"buffered.group_id"
41+
)
42+
get saveDisabled() {
43+
if (this.target.isSaving) {
44+
return true;
45+
}
46+
47+
let name = this.get("buffered.name");
48+
if (!name || name.length === 0) {
49+
return true;
50+
}
51+
52+
if (this.needsGroup && !this.get("buffered.group_id")) {
53+
return true;
4854
}
49-
),
5055

51-
actions: {
52-
save() {
53-
this.target
54-
.save(this.buffered.getProperties("name", "target_type_id", "group_id"))
55-
.then(() => {
56-
this.set("editSelected", false);
57-
})
58-
.catch(popupAjaxError);
59-
},
60-
cancel() {
61-
if (this.target.isNew) {
62-
return this.removeTarget();
63-
} else {
56+
return false;
57+
}
58+
59+
@action
60+
save() {
61+
this.target
62+
.save(this.buffered.getProperties("name", "target_type_id", "group_id"))
63+
.then(() => {
6464
this.set("editSelected", false);
65-
this.rollbackBuffer();
66-
}
67-
},
68-
destroy() {
69-
this.target.destroyRecord().then(() => this.removeTarget());
70-
},
71-
},
72-
});
65+
})
66+
.catch(popupAjaxError);
67+
}
68+
69+
@action
70+
cancel() {
71+
if (this.target.isNew) {
72+
return this.removeTarget();
73+
} else {
74+
this.set("editSelected", false);
75+
this.rollbackBuffer();
76+
}
77+
}
78+
79+
@action
80+
destroy() {
81+
this.target.destroyRecord().then(() => this.removeTarget());
82+
}
83+
}

assets/stylesheets/team-build.scss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,39 @@
1111

1212
.high-scores {
1313
min-width: 300px;
14+
1415
td {
1516
padding: 0.25em;
1617
}
18+
1719
.user {
1820
.avatar {
1921
margin-right: 0.5em;
2022
}
23+
2124
a {
2225
font-weight: bold;
2326
color: var(--primary-high);
2427
}
2528
}
29+
2630
.rank {
2731
padding-left: 1em;
32+
2833
.emoji {
2934
margin-left: 0.5em;
3035
}
3136
}
37+
3238
td.score {
3339
font-size: 1.5em;
3440
text-align: center;
3541
}
42+
3643
th.score {
3744
text-align: center;
3845
}
46+
3947
tr.me {
4048
background-color: var(--highlight-medium);
4149
}
@@ -50,12 +58,14 @@
5058
font-size: 1.25em;
5159
}
5260
}
61+
5362
.completed-score {
5463
margin-top: 1em;
5564
margin-bottom: 1em;
5665
font-size: 1.2em;
5766
font-weight: bold;
5867
display: flex;
68+
5969
.username {
6070
color: var(--primary-medium);
6171
margin-right: 0.5em;
@@ -64,6 +74,7 @@
6474

6575
.multi-choice {
6676
flex-wrap: wrap;
77+
6778
.teambuild-choice {
6879
width: 200px;
6980
}
@@ -81,6 +92,7 @@
8192
&.completed {
8293
font-weight: bold;
8394
}
95+
8496
.controls,
8597
.display-done {
8698
margin-right: 0.5em;
@@ -113,27 +125,29 @@
113125
align-items: center;
114126
justify-content: space-between;
115127

116-
.target-details {
117-
}
118-
119128
.target-types {
120129
display: flex;
130+
121131
label {
122132
margin-right: 1em;
123133
}
124134
}
135+
125136
.target-group-name {
126137
font-weight: bold;
127138
}
139+
128140
.target-name {
129141
label {
130142
display: block;
131143
}
132144
margin-top: 0.5em;
145+
133146
input {
134147
width: 500px;
135148
}
136149
}
150+
137151
.controls {
138152
margin-left: 1em;
139153
}

0 commit comments

Comments
 (0)