Skip to content

Commit 9ce7364

Browse files
authored
DEV: Update linting config and run gjs-codemod (#25)
* DEV: Update linting config and run gjs-codemod * on removal as well * DEV: Update linting config and run gjs-codemod
1 parent 29f680c commit 9ce7364

File tree

8 files changed

+524
-1062
lines changed

8 files changed

+524
-1062
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: 29f680c6d45717a4eb53d1944322b08d8dc53638
12
< 3.5.0.beta1-dev: 491e0aa9007213004d22a9e5a61f93ce8409f6de
23
< 3.4.0.beta1-dev: e1c51ef38a9b53a9ee86bc4cdbe61561cc327eea
34
< 3.3.0.beta1-dev: 43ba66cf0c7cc43aa36f9e6c49c5523cbc0a0190

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.1)
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
@@ -9,7 +9,7 @@
99
margin: 0 auto;
1010
font-size: var(--font-down-1);
1111

12-
@media screen and (max-width: 990px) {
12+
@media screen and (width <= 990px) {
1313
text-align: center;
1414
}
1515
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import Component from "@ember/component";
2+
import { classNames } from "@ember-decorators/component";
3+
import { modifier as modifierFn } from "ember-modifier";
4+
import { or } from "truth-helpers";
5+
import htmlSafe from "discourse/helpers/html-safe";
6+
7+
const YEAR = new Date().getFullYear();
8+
9+
function recalculateHight() {
10+
const headerHeight = document.querySelector(".d-header-wrap").offsetHeight;
11+
const footerHeight = document.querySelector(
12+
".below-footer-outlet"
13+
).offsetHeight;
14+
const mainOutletStyles = getComputedStyle(
15+
document.querySelector("#main-outlet")
16+
);
17+
const mainOutletPaddingTop = parseInt(
18+
mainOutletStyles.getPropertyValue("padding-top"),
19+
10
20+
);
21+
if (headerHeight && footerHeight && mainOutletPaddingTop) {
22+
const mainOffset = headerHeight + footerHeight + mainOutletPaddingTop + 1;
23+
document.querySelector("#main-outlet").style.minHeight =
24+
"calc(100vh - " + mainOffset + "px)";
25+
}
26+
}
27+
28+
const adjustMinHeight = modifierFn(() => {
29+
recalculateHight();
30+
return () => recalculateHight();
31+
});
32+
33+
@classNames("below-footer-outlet", "minimal-footer")
34+
export default class MinimalFooter extends Component {
35+
<template>
36+
{{#if this.showFooter}}
37+
<footer {{adjustMinHeight}} class="discourse-minimal-footer">
38+
<div class="discourse-minimal-footer-content">
39+
{{#if settings.footer_logo}}
40+
<div class="discourse-minimal-footer-logo">
41+
<a
42+
href={{settings.footer_logo_url}}
43+
target="_blank"
44+
rel="noopener noreferrer"
45+
>
46+
<img src={{settings.footer_logo}} />
47+
</a>
48+
</div>
49+
{{/if}}
50+
51+
{{#if settings.footer_html_a}}
52+
<p class="discourse-minimal-footer-row-a">
53+
{{htmlSafe settings.footer_html_a}}
54+
</p>
55+
{{/if}}
56+
57+
{{#if settings.footer_html_b}}
58+
<p class="discourse-minimal-footer-row-b">
59+
{{htmlSafe settings.footer_html_b}}
60+
</p>
61+
{{/if}}
62+
63+
{{#if (or settings.show_copyright settings.footer_html_c)}}
64+
<p class="discourse-minimal-footer-row-c">
65+
{{#if settings.show_copyright}}
66+
&copy;
67+
{{YEAR}}
68+
{{/if}}
69+
{{#if settings.footer_html_c}}
70+
{{htmlSafe settings.footer_html_c}}
71+
{{/if}}
72+
</p>
73+
{{/if}}
74+
</div>
75+
</footer>
76+
{{/if}}
77+
</template>
78+
}

javascripts/discourse/connectors/below-footer/minimal-footer.hbs

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

javascripts/discourse/connectors/below-footer/minimal-footer.js

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

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)