Skip to content

Commit 6255600

Browse files
committed
DEV: Update linting config and run gjs-codemod
1 parent 02c3e4a commit 6255600

File tree

11 files changed

+533
-1056
lines changed

11 files changed

+533
-1056
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: 02c3e4ad4962fc224a5496211444ee72b2384e8a
12
< 3.5.0.beta1-dev: 21a87052efc621c728a6aba596a6c437675d8574
23
< 3.4.0.beta2-dev: fe80ffbca41027dc1262881bef3eade511d05d3f
34
< 3.4.0.beta1-dev: 8520420d6154d47be11c7667a502e60cdc3d375b

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

common/common.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
}
261261
}
262262

263-
@media screen and (max-width: 736px) {
263+
@media screen and (width <= 736px) {
264264
// Wrap columns
265265
.banner-box .row {
266266
display: block;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import Component from "@glimmer/component";
2+
import { or } from "truth-helpers";
3+
import icon from "discourse/helpers/d-icon";
4+
import htmlSafe from "discourse/helpers/html-safe";
5+
6+
export default class VersatileBannerColumn extends Component {
7+
get isHttpLink() {
8+
return this.args.icon.startsWith("http");
9+
}
10+
11+
<template>
12+
{{#if (or @icon @columnContent)}}
13+
<div class="{{@columnClass}} single-box">
14+
{{#if @icon}}
15+
<div class="icon">
16+
{{#if this.isHttpLink}}
17+
<img class="responsive-img" src={{@icon}} alt="Icon" />
18+
{{else}}
19+
{{icon @icon}}
20+
{{/if}}
21+
</div>
22+
{{/if}}
23+
{{#if @columnContent}}
24+
<div>
25+
{{htmlSafe @columnContent}}
26+
</div>
27+
{{/if}}
28+
</div>
29+
{{/if}}
30+
</template>
31+
}

javascripts/discourse/components/versatile-banner-column.hbs

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

javascripts/discourse/components/versatile-banner-column.js

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

javascripts/discourse/components/versatile-banner.js renamed to javascripts/discourse/components/versatile-banner.gjs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import Component from "@glimmer/component";
22
import { tracked } from "@glimmer/tracking";
33
import { action } from "@ember/object";
44
import { service } from "@ember/service";
5+
import { and } from "truth-helpers";
6+
import DButton from "discourse/components/d-button";
7+
import htmlSafe from "discourse/helpers/html-safe";
58
import cookie, { removeCookie } from "discourse/lib/cookie";
69
import { convertIconClass } from "discourse/lib/icon-library";
710
import { defaultHomepage } from "discourse/lib/utilities";
811
import { i18n } from "discourse-i18n";
12+
import VersatileBannerColumn from "./versatile-banner-column";
913

1014
export default class VersatileBanner extends Component {
1115
@service router;
@@ -134,4 +138,55 @@ export default class VersatileBanner extends Component {
134138
path: "/",
135139
});
136140
}
141+
142+
<template>
143+
{{#if this.shouldShow}}
144+
{{#unless this.bannerClosed}}
145+
<div class="banner-box">
146+
<div class="container">
147+
<div class="button-container">
148+
{{#if settings.dismissible}}
149+
<DButton
150+
@action={{this.closeBanner}}
151+
@translatedLabel={{i18n (themePrefix "close.label")}}
152+
@translatedTitle={{i18n (themePrefix "close.title")}}
153+
@icon="xmark"
154+
class="close"
155+
/>
156+
{{/if}}
157+
{{#if settings.collapsible}}
158+
<DButton
159+
@action={{this.toggleBanner}}
160+
@translatedLabel={{this.toggleLabel}}
161+
@translatedTitle={{i18n (themePrefix "toggle.title")}}
162+
@icon={{this.toggleIcon}}
163+
class="toggle"
164+
/>
165+
{{/if}}
166+
</div>
167+
<div class="section-header">
168+
{{htmlSafe settings.main_heading_content}}
169+
</div>
170+
<div
171+
id="banner-content_wrap"
172+
class={{if
173+
(and settings.collapsible this.bannerCollapsed)
174+
"--banner-collapsed"
175+
}}
176+
>
177+
<div class="row">
178+
{{#each this.columnData as |data|}}
179+
<VersatileBannerColumn
180+
@columnContent={{data.content}}
181+
@icon={{data.icon}}
182+
@columnClass={{data.class}}
183+
/>
184+
{{/each}}
185+
</div>
186+
</div>
187+
</div>
188+
</div>
189+
{{/unless}}
190+
{{/if}}
191+
</template>
137192
}

javascripts/discourse/components/versatile-banner.hbs

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

migrations/settings/0001-migrate-from-deprecated-icon-names.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function migrate(settings) {
44
"second_column_icon",
55
"third_column_icon",
66
"fourth_column_icon",
7-
]
7+
];
88

99
settingNames.forEach((settingName) => {
1010
const oldSetting = settings.get(settingName);

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@discourse/lint-configs": "2.11.1",
5-
"ember-template-lint": "7.0.1",
6-
"eslint": "9.22.0",
4+
"@discourse/lint-configs": "2.25.0",
5+
"ember-template-lint": "7.8.1",
6+
"eslint": "9.28.0",
77
"prettier": "3.5.3",
8-
"stylelint": "16.16.0"
8+
"stylelint": "16.20.0"
99
},
1010
"engines": {
1111
"node": ">= 22",

0 commit comments

Comments
 (0)