Skip to content

Commit 082ef12

Browse files
authored
DEV: Update linting config and run gjs-codemod (#209)
1 parent 2caa043 commit 082ef12

21 files changed

+929
-858
lines changed

.discourse-compatibility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.5.0.beta5-dev: 92e29f51d5f7f8058895ceae681b0f0cfee157b2
12
< 3.5.0.beta1-dev: 4e42539cda9a54d7827bcdf51b6dfbcf56d24cc9
23
< 3.4.0.beta2-dev: 12dfb332bf830b1c8c9a24b86f5327504e9ab672
34
< 3.4.0.beta1-dev: 7721b1646dead4719c02868ef7965f1b27c74eb3

Gemfile.lock

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,44 @@ GEM
1414
securerandom (>= 0.3)
1515
tzinfo (~> 2.0, >= 2.0.5)
1616
uri (>= 0.13.1)
17-
ast (2.4.2)
18-
base64 (0.2.0)
19-
benchmark (0.4.0)
20-
bigdecimal (3.1.9)
17+
ast (2.4.3)
18+
base64 (0.3.0)
19+
benchmark (0.4.1)
20+
bigdecimal (3.2.0)
2121
concurrent-ruby (1.3.5)
22-
connection_pool (2.5.0)
23-
drb (2.2.1)
22+
connection_pool (2.5.3)
23+
drb (2.2.3)
2424
i18n (1.14.7)
2525
concurrent-ruby (~> 1.0)
26-
json (2.10.2)
27-
language_server-protocol (3.17.0.4)
26+
json (2.12.2)
27+
language_server-protocol (3.17.0.5)
2828
lint_roller (1.1.0)
29-
logger (1.6.6)
29+
logger (1.7.0)
3030
minitest (5.25.5)
31-
parallel (1.26.3)
32-
parser (3.3.7.1)
31+
parallel (1.27.0)
32+
parser (3.3.8.0)
3333
ast (~> 2.4.1)
3434
racc
3535
prettier_print (1.2.1)
36+
prism (1.4.0)
3637
racc (1.8.1)
37-
rack (3.1.12)
38+
rack (3.1.15)
3839
rainbow (3.1.1)
3940
regexp_parser (2.10.0)
40-
rubocop (1.74.0)
41+
rubocop (1.75.8)
4142
json (~> 2.3)
4243
language_server-protocol (~> 3.17.0.2)
4344
lint_roller (~> 1.1.0)
4445
parallel (~> 1.10)
4546
parser (>= 3.3.0.2)
4647
rainbow (>= 2.2.2, < 4.0)
4748
regexp_parser (>= 2.9.3, < 3.0)
48-
rubocop-ast (>= 1.38.0, < 2.0)
49+
rubocop-ast (>= 1.44.0, < 2.0)
4950
ruby-progressbar (~> 1.7)
5051
unicode-display_width (>= 2.4.0, < 4.0)
51-
rubocop-ast (1.38.1)
52-
parser (>= 3.3.1.0)
52+
rubocop-ast (1.44.1)
53+
parser (>= 3.3.7.2)
54+
prism (~> 1.4)
5355
rubocop-capybara (2.22.1)
5456
lint_roller (~> 1.1)
5557
rubocop (~> 1.72, >= 1.72.1)
@@ -65,13 +67,13 @@ GEM
6567
rubocop-factory_bot (2.27.1)
6668
lint_roller (~> 1.1)
6769
rubocop (~> 1.72, >= 1.72.1)
68-
rubocop-rails (2.30.3)
70+
rubocop-rails (2.32.0)
6971
activesupport (>= 4.2.0)
7072
lint_roller (~> 1.1)
7173
rack (>= 1.1)
72-
rubocop (>= 1.72.1, < 2.0)
73-
rubocop-ast (>= 1.38.0, < 2.0)
74-
rubocop-rspec (3.5.0)
74+
rubocop (>= 1.75.0, < 2.0)
75+
rubocop-ast (>= 1.44.0, < 2.0)
76+
rubocop-rspec (3.6.0)
7577
lint_roller (~> 1.1)
7678
rubocop (~> 1.72, >= 1.72.1)
7779
rubocop-rspec_rails (2.31.0)
@@ -97,4 +99,4 @@ DEPENDENCIES
9799
syntax_tree
98100

99101
BUNDLED WITH
100-
2.6.6
102+
2.6.9
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import Component from "@ember/component";
2+
import { on } from "@ember/modifier";
3+
import { tagName } from "@ember-decorators/component";
4+
import icon from "discourse/helpers/d-icon";
5+
import discourseComputed from "discourse/lib/decorators";
6+
7+
@tagName("")
8+
export default class DocsCategory extends Component {
9+
@discourseComputed("category")
10+
categoryName(category) {
11+
return this.site.categories.findBy("id", category.id).name;
12+
}
13+
14+
<template>
15+
<a
16+
href
17+
{{on "click" this.selectCategory}}
18+
class="docs-item docs-category {{if this.category.active 'selected'}}"
19+
>
20+
{{icon (if this.category.active "circle-xmark" "far-circle")}}
21+
22+
<span class="docs-item-id category-id">{{this.categoryName}}</span>
23+
<span
24+
class="docs-item-count category-count"
25+
>{{this.category.count}}</span>
26+
</a>
27+
</template>
28+
}

assets/javascripts/discourse/components/docs-category.hbs

Lines changed: 0 additions & 10 deletions
This file was deleted.

assets/javascripts/discourse/components/docs-category.js

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import Component, { Input } from "@ember/component";
2+
import { on } from "@ember/modifier";
3+
import { action } from "@ember/object";
4+
import { classNames } from "@ember-decorators/component";
5+
import DButton from "discourse/components/d-button";
6+
import icon from "discourse/helpers/d-icon";
7+
import { i18n } from "discourse-i18n";
8+
9+
@classNames("docs-search")
10+
export default class DocsSearch extends Component {
11+
@action
12+
onKeyDown(event) {
13+
if (event.key === "Enter") {
14+
this.set("searchTerm", event.target.value);
15+
this.onSearch(event.target.value);
16+
}
17+
}
18+
19+
@action
20+
clearSearch() {
21+
this.set("searchTerm", "");
22+
this.onSearch("");
23+
}
24+
25+
<template>
26+
<span class="docs-search-wrapper">
27+
<Input
28+
@type="text"
29+
@value={{readonly this.searchTerm}}
30+
class="no-blur docs-search-bar"
31+
autocorrect="off"
32+
placeholder={{i18n "docs.search.placeholder"}}
33+
autocapitalize="off"
34+
{{on "keydown" this.onKeyDown}}
35+
/>
36+
37+
{{#if this.searchTerm}}
38+
<DButton
39+
@action={{action "clearSearch"}}
40+
class="clear-search"
41+
@label="docs.search.clear"
42+
/>
43+
{{else}}
44+
{{icon "magnifying-glass"}}
45+
{{/if}}
46+
</span>
47+
</template>
48+
}

assets/javascripts/discourse/components/docs-search.hbs

Lines changed: 0 additions & 21 deletions
This file was deleted.

assets/javascripts/discourse/components/docs-search.js

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Component from "@ember/component";
2+
import { on } from "@ember/modifier";
3+
import { tagName } from "@ember-decorators/component";
4+
import icon from "discourse/helpers/d-icon";
5+
6+
@tagName("")
7+
export default class DocsTag extends Component {
8+
<template>
9+
<a
10+
href
11+
{{on "click" this.selectTag}}
12+
class="docs-item docs-tag
13+
{{if this.tag.active 'selected'}}{{if this.subtag 'subtag'}}"
14+
>
15+
{{icon (if this.tag.active "circle-xmark" "plus")}}
16+
17+
<span class="docs-item-id tag-id">{{this.tag.id}}</span>
18+
<span class="docs-item-count tag-count">{{this.tag.count}}</span>
19+
</a>
20+
</template>
21+
}

assets/javascripts/discourse/components/docs-tag.hbs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)