Skip to content

Commit fd584ed

Browse files
authored
DEV: Update linting config and run gjs-codemod (#82)
* DEV: Update linting config and run gjs-codemod * cleanup
1 parent f4ef4a4 commit fd584ed

33 files changed

+935
-1395
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: f4ef4a41587d75d062b4fc7841d8f78e7726ea59
12
< 3.5.0.beta1-dev: 5fda8d63def631692e8780c6b8bc2457eae55a29
23
< 3.4.0.beta1-dev: 471a797e05f9b55df90ef71145420ec001f9f48d
34
< 3.3.0.beta1-dev: 7614fc31171ea4fbe4d26442cd0c50fccc41ac2b

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.2)
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.76.0)
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.45.0, < 2.0)
4950
ruby-progressbar (~> 1.7)
5051
unicode-display_width (>= 2.4.0, < 4.0)
51-
rubocop-ast (1.39.0)
52-
parser (>= 3.3.1.0)
52+
rubocop-ast (1.45.0)
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)
@@ -98,4 +100,4 @@ DEPENDENCIES
98100
syntax_tree
99101

100102
BUNDLED WITH
101-
2.6.6
103+
2.6.9

desktop/desktop.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
display: none;
77
}
88

9-
@media screen and (min-width: 767px) {
9+
@media screen and (width >= 767px) {
1010
// Show the sidebar at 767px
1111
.tc-right-sidebar {
1212
display: block;

javascripts/connectors/before-list-area/tc-right-sidebar.hbs

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import Component from "@glimmer/component";
2+
import categoryLink from "discourse/helpers/category-link";
3+
import Category from "discourse/models/category";
4+
import { i18n } from "discourse-i18n";
5+
6+
export default class CategoryList extends Component {
7+
constructor() {
8+
super(...arguments);
9+
this.blockTitle =
10+
this.args.title || i18n(themePrefix("category_list.heading"));
11+
12+
this.categoryList = this.args.id.split(",");
13+
if (!this.categoryList) {
14+
return;
15+
}
16+
this.categoryList.forEach(function (id, i, arr) {
17+
arr[i] = Category.findById(id);
18+
});
19+
}
20+
21+
<template>
22+
<h3 class="category-list__heading">
23+
{{this.blockTitle}}
24+
</h3>
25+
26+
<div class="category-list__container">
27+
{{#each this.categoryList as |category|}}
28+
<div class="category-list__category">
29+
{{categoryLink category}}
30+
</div>
31+
{{/each}}
32+
</div>
33+
</template>
34+
}

javascripts/discourse/components/category-list.hbs

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

javascripts/discourse/components/category-list.js

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

javascripts/discourse/components/category-topics.js renamed to javascripts/discourse/components/category-topics.gjs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Component from "@glimmer/component";
22
import { tracked } from "@glimmer/tracking";
33
import { service } from "@ember/service";
4+
import categoryLink from "discourse/helpers/category-link";
5+
import htmlSafe from "discourse/helpers/html-safe";
6+
import replaceEmoji from "discourse/helpers/replace-emoji";
47
import getURL from "discourse/lib/get-url";
58
import Category from "discourse/models/category";
69

@@ -12,8 +15,8 @@ export default class CategoryTopics extends Component {
1215

1316
constructor() {
1417
super(...arguments);
15-
const count = this.args?.params?.count || 10;
16-
const categoryId = this.args?.params?.id;
18+
const count = this.args.count || 10;
19+
const categoryId = this.args.id;
1720

1821
if (!categoryId) {
1922
return;
@@ -40,4 +43,19 @@ export default class CategoryTopics extends Component {
4043
super.willDestroy(...arguments);
4144
this.topics = null;
4245
}
46+
47+
<template>
48+
{{categoryLink this.category}}
49+
50+
<div class="category-topics--content">
51+
{{#each this.topics as |topic|}}
52+
<a href={{topic.url}} class="category-topics--topic">
53+
{{htmlSafe (replaceEmoji topic.fancy_title)}}
54+
<span class="category-topics--posts-count">
55+
({{topic.posts_count}})
56+
</span>
57+
</a>
58+
{{/each}}
59+
</div>
60+
</template>
4361
}

javascripts/discourse/components/category-topics.hbs

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import htmlSafe from "discourse/helpers/html-safe";
2+
3+
const CustomHtmlRsb = <template>{{htmlSafe @content}}</template>;
4+
5+
export default CustomHtmlRsb;

0 commit comments

Comments
 (0)